/** * * * <pre> * Required. Redis instance resource name using the form: * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` * where `location_id` refers to a GCP region * </pre> * * <code>string name = 1;</code> */ public Builder clearName() { name_ = getDefaultInstance().getName(); onChanged(); return this; } /**
@java.lang.Override public Builder newBuilderForType() { return newBuilder(); }
@java.lang.Override public com.google.cloud.redis.v1beta1.DeleteInstanceRequest buildPartial() { com.google.cloud.redis.v1beta1.DeleteInstanceRequest result = new com.google.cloud.redis.v1beta1.DeleteInstanceRequest(this); result.name_ = name_; onBuilt(); return result; }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + NAME_FIELD_NUMBER; hash = (53 * hash) + getName().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { done = true; } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable();
@java.lang.Override public com.google.cloud.redis.v1beta1.DeleteInstanceRequest getDefaultInstanceForType() { return com.google.cloud.redis.v1beta1.DeleteInstanceRequest.getDefaultInstance(); }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.cloud.redis.v1beta1.DeleteInstanceRequest)) { return super.equals(obj); } com.google.cloud.redis.v1beta1.DeleteInstanceRequest other = (com.google.cloud.redis.v1beta1.DeleteInstanceRequest) obj; boolean result = true; result = result && getName().equals(other.getName()); result = result && unknownFields.equals(other.unknownFields); return result; }
@java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (!getNameBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); } unknownFields.writeTo(output); }
public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); }
@java.lang.Override public com.google.cloud.redis.v1beta1.DeleteInstanceRequest build() { com.google.cloud.redis.v1beta1.DeleteInstanceRequest result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + NAME_FIELD_NUMBER; hash = (53 * hash) + getName().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
io.grpc.protobuf.ProtoUtils.marshaller( com.google.cloud.redis.v1beta1.DeleteInstanceRequest .getDefaultInstance())) .setResponseMarshaller( io.grpc.protobuf.ProtoUtils.marshaller(
@Test @SuppressWarnings("all") public void deleteInstanceTest() throws Exception { Empty expectedResponse = Empty.newBuilder().build(); Operation resultOperation = Operation.newBuilder() .setName("deleteInstanceTest") .setDone(true) .setResponse(Any.pack(expectedResponse)) .build(); mockCloudRedis.addResponse(resultOperation); InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); Empty actualResponse = client.deleteInstanceAsync(name).get(); Assert.assertEquals(expectedResponse, actualResponse); List<GeneratedMessageV3> actualRequests = mockCloudRedis.getRequests(); Assert.assertEquals(1, actualRequests.size()); DeleteInstanceRequest actualRequest = (DeleteInstanceRequest) actualRequests.get(0); Assert.assertEquals(name, InstanceName.parse(actualRequest.getName())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern())); }
if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { done = true; } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable();
@java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (!getNameBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; }
public static Builder newBuilder(com.google.cloud.redis.v1beta1.DeleteInstanceRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); }
@java.lang.Override public com.google.cloud.redis.v1beta1.DeleteInstanceRequest build() { com.google.cloud.redis.v1beta1.DeleteInstanceRequest result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; }
public Builder mergeFrom(com.google.cloud.redis.v1beta1.DeleteInstanceRequest other) { if (other == com.google.cloud.redis.v1beta1.DeleteInstanceRequest.getDefaultInstance()) return this; if (!other.getName().isEmpty()) { name_ = other.name_; onChanged(); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
/** * Deletes a specific Redis instance. Instance stops serving and data is deleted. * * <p>Sample code: * * <pre><code> * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { * InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); * Empty response = cloudRedisClient.deleteInstanceAsync(name.toString()).get(); * } * </code></pre> * * @param name Required. Redis instance resource name using the form: * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` where `location_id` * refers to a GCP region * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi( "The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture<Empty, Any> deleteInstanceAsync(String name) { DeleteInstanceRequest request = DeleteInstanceRequest.newBuilder().setName(name).build(); return deleteInstanceAsync(request); }
@java.lang.Override public com.google.cloud.redis.v1beta1.DeleteInstanceRequest getDefaultInstanceForType() { return com.google.cloud.redis.v1beta1.DeleteInstanceRequest.getDefaultInstance(); }