/** * * * <pre> * The name of the note in the form of * `projects/[PROVIDER_ID]/notes/[NOTE_ID]`. * </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 io.grafeas.v1beta1.DeleteNoteRequest buildPartial() { io.grafeas.v1beta1.DeleteNoteRequest result = new io.grafeas.v1beta1.DeleteNoteRequest(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 io.grafeas.v1beta1.DeleteNoteRequest getDefaultInstanceForType() { return io.grafeas.v1beta1.DeleteNoteRequest.getDefaultInstance(); }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof io.grafeas.v1beta1.DeleteNoteRequest)) { return super.equals(obj); } io.grafeas.v1beta1.DeleteNoteRequest other = (io.grafeas.v1beta1.DeleteNoteRequest) 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 io.grafeas.v1beta1.DeleteNoteRequest build() { io.grafeas.v1beta1.DeleteNoteRequest 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; }
private static io.grpc.MethodDescriptor< io.grafeas.v1beta1.DeleteNoteRequest, com.google.protobuf.Empty> getDeleteNoteMethodHelper() { io.grpc.MethodDescriptor<io.grafeas.v1beta1.DeleteNoteRequest, com.google.protobuf.Empty> getDeleteNoteMethod; if ((getDeleteNoteMethod = GrafeasV1Beta1Grpc.getDeleteNoteMethod) == null) { synchronized (GrafeasV1Beta1Grpc.class) { if ((getDeleteNoteMethod = GrafeasV1Beta1Grpc.getDeleteNoteMethod) == null) { GrafeasV1Beta1Grpc.getDeleteNoteMethod = getDeleteNoteMethod = io.grpc.MethodDescriptor .<io.grafeas.v1beta1.DeleteNoteRequest, com.google.protobuf.Empty>newBuilder() .setType(io.grpc.MethodDescriptor.MethodType.UNARY) .setFullMethodName( generateFullMethodName("grafeas.v1beta1.GrafeasV1Beta1", "DeleteNote")) .setSampledToLocalTracing(true) .setRequestMarshaller( io.grpc.protobuf.ProtoUtils.marshaller( io.grafeas.v1beta1.DeleteNoteRequest.getDefaultInstance())) .setResponseMarshaller( io.grpc.protobuf.ProtoUtils.marshaller( com.google.protobuf.Empty.getDefaultInstance())) .setSchemaDescriptor(new GrafeasV1Beta1MethodDescriptorSupplier("DeleteNote")) .build(); } } } return getDeleteNoteMethod; }
@Test @SuppressWarnings("all") public void deleteNoteTest() { Empty expectedResponse = Empty.newBuilder().build(); mockGrafeasV1Beta1.addResponse(expectedResponse); NoteName name = NoteName.of("[PROJECT]", "[NOTE]"); client.deleteNote(name); List<GeneratedMessageV3> actualRequests = mockGrafeasV1Beta1.getRequests(); Assert.assertEquals(1, actualRequests.size()); DeleteNoteRequest actualRequest = (DeleteNoteRequest) actualRequests.get(0); Assert.assertEquals(name, NoteName.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(io.grafeas.v1beta1.DeleteNoteRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); }
@java.lang.Override public io.grafeas.v1beta1.DeleteNoteRequest build() { io.grafeas.v1beta1.DeleteNoteRequest result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; }
public Builder mergeFrom(io.grafeas.v1beta1.DeleteNoteRequest other) { if (other == io.grafeas.v1beta1.DeleteNoteRequest.getDefaultInstance()) return this; if (!other.getName().isEmpty()) { name_ = other.name_; onChanged(); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
@java.lang.Override public io.grafeas.v1beta1.DeleteNoteRequest getDefaultInstanceForType() { return io.grafeas.v1beta1.DeleteNoteRequest.getDefaultInstance(); }
/** * Deletes the specified note. * * <p>Sample code: * * <pre><code> * try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) { * NoteName name = NoteName.of("[PROJECT]", "[NOTE]"); * grafeasV1Beta1Client.deleteNote(name.toString()); * } * </code></pre> * * @param name The name of the note in the form of `projects/[PROVIDER_ID]/notes/[NOTE_ID]`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final void deleteNote(String name) { DeleteNoteRequest request = DeleteNoteRequest.newBuilder().setName(name).build(); deleteNote(request); }