All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.google.api.services.spanner.v1.model.Transaction Maven / Gradle / Ivy

There is a newer version: v1-rev20241020-2.0.0
Show newest version
/*
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 */
/*
 * This code was generated by https://github.com/googleapis/google-api-java-client-services/
 * Modify at your own risk.
 */

package com.google.api.services.spanner.v1.model;

/**
 * A transaction.
 *
 * 

This is the Java data model class that specifies how to parse/serialize into the JSON that is * transmitted over HTTP when working with the Cloud Spanner API. For a detailed explanation see: * https://developers.google.com/api-client-library/java/google-http-java-client/json *

* * @author Google, Inc. */ @SuppressWarnings("javadoc") public final class Transaction extends com.google.api.client.json.GenericJson { /** * `id` may be used to identify the transaction in subsequent Read, ExecuteSql, Commit, or * Rollback calls. Single-use read-only transactions do not have IDs, because single-use * transactions do not support multiple requests. * The value may be {@code null}. */ @com.google.api.client.util.Key private java.lang.String id; /** * For snapshot read-only transactions, the read timestamp chosen for the transaction. Not * returned by default: see TransactionOptions.ReadOnly.return_read_timestamp. A timestamp in * RFC3339 UTC \"Zulu\" format, accurate to nanoseconds. Example: * `"2014-10-02T15:01:23.045123456Z"`. * The value may be {@code null}. */ @com.google.api.client.util.Key private String readTimestamp; /** * `id` may be used to identify the transaction in subsequent Read, ExecuteSql, Commit, or * Rollback calls. Single-use read-only transactions do not have IDs, because single-use * transactions do not support multiple requests. * @see #decodeId() * @return value or {@code null} for none */ public java.lang.String getId() { return id; } /** * `id` may be used to identify the transaction in subsequent Read, ExecuteSql, Commit, or * Rollback calls. Single-use read-only transactions do not have IDs, because single-use * transactions do not support multiple requests. * @see #getId() * @return Base64 decoded value or {@code null} for none * * @since 1.14 */ public byte[] decodeId() { return com.google.api.client.util.Base64.decodeBase64(id); } /** * `id` may be used to identify the transaction in subsequent Read, ExecuteSql, Commit, or * Rollback calls. Single-use read-only transactions do not have IDs, because single-use * transactions do not support multiple requests. * @see #encodeId() * @param id id or {@code null} for none */ public Transaction setId(java.lang.String id) { this.id = id; return this; } /** * `id` may be used to identify the transaction in subsequent Read, ExecuteSql, Commit, or * Rollback calls. Single-use read-only transactions do not have IDs, because single-use * transactions do not support multiple requests. * @see #setId() * *

* The value is encoded Base64 or {@code null} for none. *

* * @since 1.14 */ public Transaction encodeId(byte[] id) { this.id = com.google.api.client.util.Base64.encodeBase64URLSafeString(id); return this; } /** * For snapshot read-only transactions, the read timestamp chosen for the transaction. Not * returned by default: see TransactionOptions.ReadOnly.return_read_timestamp. A timestamp in * RFC3339 UTC \"Zulu\" format, accurate to nanoseconds. Example: * `"2014-10-02T15:01:23.045123456Z"`. * @return value or {@code null} for none */ public String getReadTimestamp() { return readTimestamp; } /** * For snapshot read-only transactions, the read timestamp chosen for the transaction. Not * returned by default: see TransactionOptions.ReadOnly.return_read_timestamp. A timestamp in * RFC3339 UTC \"Zulu\" format, accurate to nanoseconds. Example: * `"2014-10-02T15:01:23.045123456Z"`. * @param readTimestamp readTimestamp or {@code null} for none */ public Transaction setReadTimestamp(String readTimestamp) { this.readTimestamp = readTimestamp; return this; } @Override public Transaction set(String fieldName, Object value) { return (Transaction) super.set(fieldName, value); } @Override public Transaction clone() { return (Transaction) super.clone(); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy