|
| 1 | +/* |
| 2 | + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except |
| 3 | + * in compliance with the License. You may obtain a copy of the License at |
| 4 | + * |
| 5 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 6 | + * |
| 7 | + * Unless required by applicable law or agreed to in writing, software distributed under the License |
| 8 | + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express |
| 9 | + * or implied. See the License for the specific language governing permissions and limitations under |
| 10 | + * the License. |
| 11 | + */ |
| 12 | +/* |
| 13 | + * This code was generated by https://github.com/googleapis/google-api-java-client-services/ |
| 14 | + * Modify at your own risk. |
| 15 | + */ |
| 16 | + |
| 17 | +package com.google.api.services.firestore.v1.model; |
| 18 | + |
| 19 | +/** |
| 20 | + * The request for Firestore.ExecutePipeline. |
| 21 | + * |
| 22 | + * <p> This is the Java data model class that specifies how to parse/serialize into the JSON that is |
| 23 | + * transmitted over HTTP when working with the Cloud Firestore API. For a detailed explanation see: |
| 24 | + * <a href="https://developers.google.com/api-client-library/java/google-http-java-client/json">https://developers.google.com/api-client-library/java/google-http-java-client/json</a> |
| 25 | + * </p> |
| 26 | + * |
| 27 | + * @author Google, Inc. |
| 28 | + */ |
| 29 | +@SuppressWarnings("javadoc") |
| 30 | +public final class ExecutePipelineRequest extends com.google.api.client.json.GenericJson { |
| 31 | + |
| 32 | + /** |
| 33 | + * Execute the pipeline in a new transaction. The identifier of the newly created transaction will |
| 34 | + * be returned in the first response on the stream. This defaults to a read-only transaction. |
| 35 | + * The value may be {@code null}. |
| 36 | + */ |
| 37 | + @com.google.api.client.util.Key |
| 38 | + private TransactionOptions newTransaction; |
| 39 | + |
| 40 | + /** |
| 41 | + * Execute the pipeline in a snapshot transaction at the given time. This must be a microsecond |
| 42 | + * precision timestamp within the past one hour, or if Point-in-Time Recovery is enabled, can |
| 43 | + * additionally be a whole minute timestamp within the past 7 days. |
| 44 | + * The value may be {@code null}. |
| 45 | + */ |
| 46 | + @com.google.api.client.util.Key |
| 47 | + private String readTime; |
| 48 | + |
| 49 | + /** |
| 50 | + * A pipelined operation. |
| 51 | + * The value may be {@code null}. |
| 52 | + */ |
| 53 | + @com.google.api.client.util.Key |
| 54 | + private StructuredPipeline structuredPipeline; |
| 55 | + |
| 56 | + /** |
| 57 | + * Run the query within an already active transaction. The value here is the opaque transaction ID |
| 58 | + * to execute the query in. |
| 59 | + * The value may be {@code null}. |
| 60 | + */ |
| 61 | + @com.google.api.client.util.Key |
| 62 | + private java.lang.String transaction; |
| 63 | + |
| 64 | + /** |
| 65 | + * Execute the pipeline in a new transaction. The identifier of the newly created transaction will |
| 66 | + * be returned in the first response on the stream. This defaults to a read-only transaction. |
| 67 | + * @return value or {@code null} for none |
| 68 | + */ |
| 69 | + public TransactionOptions getNewTransaction() { |
| 70 | + return newTransaction; |
| 71 | + } |
| 72 | + |
| 73 | + /** |
| 74 | + * Execute the pipeline in a new transaction. The identifier of the newly created transaction will |
| 75 | + * be returned in the first response on the stream. This defaults to a read-only transaction. |
| 76 | + * @param newTransaction newTransaction or {@code null} for none |
| 77 | + */ |
| 78 | + public ExecutePipelineRequest setNewTransaction(TransactionOptions newTransaction) { |
| 79 | + this.newTransaction = newTransaction; |
| 80 | + return this; |
| 81 | + } |
| 82 | + |
| 83 | + /** |
| 84 | + * Execute the pipeline in a snapshot transaction at the given time. This must be a microsecond |
| 85 | + * precision timestamp within the past one hour, or if Point-in-Time Recovery is enabled, can |
| 86 | + * additionally be a whole minute timestamp within the past 7 days. |
| 87 | + * @return value or {@code null} for none |
| 88 | + */ |
| 89 | + public String getReadTime() { |
| 90 | + return readTime; |
| 91 | + } |
| 92 | + |
| 93 | + /** |
| 94 | + * Execute the pipeline in a snapshot transaction at the given time. This must be a microsecond |
| 95 | + * precision timestamp within the past one hour, or if Point-in-Time Recovery is enabled, can |
| 96 | + * additionally be a whole minute timestamp within the past 7 days. |
| 97 | + * @param readTime readTime or {@code null} for none |
| 98 | + */ |
| 99 | + public ExecutePipelineRequest setReadTime(String readTime) { |
| 100 | + this.readTime = readTime; |
| 101 | + return this; |
| 102 | + } |
| 103 | + |
| 104 | + /** |
| 105 | + * A pipelined operation. |
| 106 | + * @return value or {@code null} for none |
| 107 | + */ |
| 108 | + public StructuredPipeline getStructuredPipeline() { |
| 109 | + return structuredPipeline; |
| 110 | + } |
| 111 | + |
| 112 | + /** |
| 113 | + * A pipelined operation. |
| 114 | + * @param structuredPipeline structuredPipeline or {@code null} for none |
| 115 | + */ |
| 116 | + public ExecutePipelineRequest setStructuredPipeline(StructuredPipeline structuredPipeline) { |
| 117 | + this.structuredPipeline = structuredPipeline; |
| 118 | + return this; |
| 119 | + } |
| 120 | + |
| 121 | + /** |
| 122 | + * Run the query within an already active transaction. The value here is the opaque transaction ID |
| 123 | + * to execute the query in. |
| 124 | + * @see #decodeTransaction() |
| 125 | + * @return value or {@code null} for none |
| 126 | + */ |
| 127 | + public java.lang.String getTransaction() { |
| 128 | + return transaction; |
| 129 | + } |
| 130 | + |
| 131 | + /** |
| 132 | + * Run the query within an already active transaction. The value here is the opaque transaction ID |
| 133 | + * to execute the query in. |
| 134 | + * @see #getTransaction() |
| 135 | + * @return Base64 decoded value or {@code null} for none |
| 136 | + * |
| 137 | + * @since 1.14 |
| 138 | + */ |
| 139 | + public byte[] decodeTransaction() { |
| 140 | + return com.google.api.client.util.Base64.decodeBase64(transaction); |
| 141 | + } |
| 142 | + |
| 143 | + /** |
| 144 | + * Run the query within an already active transaction. The value here is the opaque transaction ID |
| 145 | + * to execute the query in. |
| 146 | + * @see #encodeTransaction() |
| 147 | + * @param transaction transaction or {@code null} for none |
| 148 | + */ |
| 149 | + public ExecutePipelineRequest setTransaction(java.lang.String transaction) { |
| 150 | + this.transaction = transaction; |
| 151 | + return this; |
| 152 | + } |
| 153 | + |
| 154 | + /** |
| 155 | + * Run the query within an already active transaction. The value here is the opaque transaction ID |
| 156 | + * to execute the query in. |
| 157 | + * @see #setTransaction() |
| 158 | + * |
| 159 | + * <p> |
| 160 | + * The value is encoded Base64 or {@code null} for none. |
| 161 | + * </p> |
| 162 | + * |
| 163 | + * @since 1.14 |
| 164 | + */ |
| 165 | + public ExecutePipelineRequest encodeTransaction(byte[] transaction) { |
| 166 | + this.transaction = com.google.api.client.util.Base64.encodeBase64URLSafeString(transaction); |
| 167 | + return this; |
| 168 | + } |
| 169 | + |
| 170 | + @Override |
| 171 | + public ExecutePipelineRequest set(String fieldName, Object value) { |
| 172 | + return (ExecutePipelineRequest) super.set(fieldName, value); |
| 173 | + } |
| 174 | + |
| 175 | + @Override |
| 176 | + public ExecutePipelineRequest clone() { |
| 177 | + return (ExecutePipelineRequest) super.clone(); |
| 178 | + } |
| 179 | + |
| 180 | +} |
0 commit comments