public Builder mergeFrom(com.google.datastore.v1.RollbackRequest other) { if (other == com.google.datastore.v1.RollbackRequest.getDefaultInstance()) return this; if (!other.getProjectId().isEmpty()) { projectId_ = other.projectId_; onChanged(); } if (other.getTransaction() != com.google.protobuf.ByteString.EMPTY) { setTransaction(other.getTransaction()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
@java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { com.google.datastore.v1.RollbackRequest parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (com.google.datastore.v1.RollbackRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; }
/** * * * <pre> * The ID of the project against which to make the request. * </pre> * * <code>string project_id = 8;</code> */ public Builder setProjectIdBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); projectId_ = value; onChanged(); return this; }
@java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { com.google.datastore.v1.RollbackRequest parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (com.google.datastore.v1.RollbackRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; }
@Override public ListenableFuture<RollbackResult> rollbackAsync(final ListenableFuture<TransactionResult> txn) { final ListenableFuture<Response> httpResponse = Futures.transformAsync(txn, result -> { final ByteString transaction = result.getTransaction(); if (transaction == null) { throw new DatastoreException("Invalid transaction."); } final RollbackRequest.Builder request = RollbackRequest.newBuilder(); final ProtoHttpContent payload = new ProtoHttpContent(request.build()); return ListenableFutureAdapter.asGuavaFuture(prepareRequest("rollback", payload).execute()); }, MoreExecutors.directExecutor()); return Futures.transformAsync(httpResponse, response -> { if (!isSuccessful(response.getStatusCode())) { throw new DatastoreException(response.getStatusCode(), response.getResponseBody()); } final RollbackResponse rollback = RollbackResponse.parseFrom(streamResponse(response)); return Futures.immediateFuture(RollbackResult.build(rollback)); }, MoreExecutors.directExecutor()); }
/** * * * <pre> * The ID of the project against which to make the request. * </pre> * * <code>string project_id = 8;</code> */ public Builder setProjectId(java.lang.String value) { if (value == null) { throw new NullPointerException(); } projectId_ = value; onChanged(); return this; } /**
/** * * * <pre> * The transaction identifier, returned by a call to * [Datastore.BeginTransaction][google.datastore.v1.Datastore.BeginTransaction]. * </pre> * * <code>bytes transaction = 1;</code> */ public Builder setTransaction(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } transaction_ = value; onChanged(); return this; } /**
/** * <pre> * The ID of the project against which to make the request. * </pre> * * <code>optional string project_id = 8;</code> */ public Builder setProjectId( java.lang.String value) { if (value == null) { throw new NullPointerException(); } projectId_ = value; onChanged(); return this; } /**
/** * <pre> * The transaction identifier, returned by a call to * [Datastore.BeginTransaction][google.datastore.v1.Datastore.BeginTransaction]. * </pre> * * <code>optional bytes transaction = 1;</code> */ public Builder setTransaction(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } transaction_ = value; onChanged(); return this; } /**
public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { com.google.datastore.v1.RollbackRequest parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (com.google.datastore.v1.RollbackRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; }
/** * <pre> * The ID of the project against which to make the request. * </pre> * * <code>optional string project_id = 8;</code> */ public Builder setProjectIdBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); projectId_ = value; onChanged(); return this; }
/** * * * <pre> * The transaction identifier, returned by a call to * [Datastore.BeginTransaction][google.datastore.v1.Datastore.BeginTransaction]. * </pre> * * <code>bytes transaction = 1;</code> */ public Builder clearTransaction() { transaction_ = getDefaultInstance().getTransaction(); onChanged(); return this; }
/** * * * <pre> * The ID of the project against which to make the request. * </pre> * * <code>string project_id = 8;</code> */ public Builder clearProjectId() { projectId_ = getDefaultInstance().getProjectId(); onChanged(); return this; } /**
/** * <pre> * The transaction identifier, returned by a call to * [Datastore.BeginTransaction][google.datastore.v1.Datastore.BeginTransaction]. * </pre> * * <code>optional bytes transaction = 1;</code> */ public Builder clearTransaction() { transaction_ = getDefaultInstance().getTransaction(); onChanged(); return this; } public final Builder setUnknownFields(
private Builder() { maybeForceBuilderInitialization(); }
public static Builder newBuilder(com.google.datastore.v1.RollbackRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); }
private Builder() { maybeForceBuilderInitialization(); }
private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); }
/** * <pre> * The ID of the project against which to make the request. * </pre> * * <code>optional string project_id = 8;</code> */ public Builder clearProjectId() { projectId_ = getDefaultInstance().getProjectId(); onChanged(); return this; } /**
public Builder mergeFrom(com.google.datastore.v1.RollbackRequest other) { if (other == com.google.datastore.v1.RollbackRequest.getDefaultInstance()) return this; if (!other.getProjectId().isEmpty()) { projectId_ = other.projectId_; onChanged(); } if (other.getTransaction() != com.google.protobuf.ByteString.EMPTY) { setTransaction(other.getTransaction()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }