@java.lang.Override public Builder newBuilderForType() { return newBuilder(); }
public Builder mergeFrom(io.grafeas.v1beta1.UpdateNoteRequest other) { if (other == io.grafeas.v1beta1.UpdateNoteRequest.getDefaultInstance()) return this; if (!other.getName().isEmpty()) { name_ = other.name_; onChanged(); } if (other.hasNote()) { mergeNote(other.getNote()); } if (other.hasUpdateMask()) { mergeUpdateMask(other.getUpdateMask()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
@java.lang.Override public io.grafeas.v1beta1.UpdateNoteRequest buildPartial() { io.grafeas.v1beta1.UpdateNoteRequest result = new io.grafeas.v1beta1.UpdateNoteRequest(this); result.name_ = name_; if (noteBuilder_ == null) { result.note_ = note_; } else { result.note_ = noteBuilder_.build(); } if (updateMaskBuilder_ == null) { result.updateMask_ = updateMask_; } else { result.updateMask_ = updateMaskBuilder_.build(); } onBuilt(); 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_); } if (note_ != null) { output.writeMessage(2, getNote()); } if (updateMask_ != null) { output.writeMessage(3, getUpdateMask()); } unknownFields.writeTo(output); }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof io.grafeas.v1beta1.UpdateNoteRequest)) { return super.equals(obj); } io.grafeas.v1beta1.UpdateNoteRequest other = (io.grafeas.v1beta1.UpdateNoteRequest) obj; boolean result = true; result = result && getName().equals(other.getName()); result = result && (hasNote() == other.hasNote()); if (hasNote()) { result = result && getNote().equals(other.getNote()); } result = result && (hasUpdateMask() == other.hasUpdateMask()); if (hasUpdateMask()) { result = result && getUpdateMask().equals(other.getUpdateMask()); } result = result && unknownFields.equals(other.unknownFields); return result; }
/** * * * <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; } /**
@Test @SuppressWarnings("all") public void updateNoteTest() { String name2 = "name2-1052831874"; String shortDescription = "shortDescription-235369287"; String longDescription = "longDescription-1747792199"; Note expectedResponse = Note.newBuilder() .setName(name2) .setShortDescription(shortDescription) .setLongDescription(longDescription) .build(); mockGrafeasV1Beta1.addResponse(expectedResponse); NoteName name = NoteName.of("[PROJECT]", "[NOTE]"); Note note = Note.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); Note actualResponse = client.updateNote(name, note, updateMask); Assert.assertEquals(expectedResponse, actualResponse); List<GeneratedMessageV3> actualRequests = mockGrafeasV1Beta1.getRequests(); Assert.assertEquals(1, actualRequests.size()); UpdateNoteRequest actualRequest = (UpdateNoteRequest) actualRequests.get(0); Assert.assertEquals(name, NoteName.parse(actualRequest.getName())); Assert.assertEquals(note, actualRequest.getNote()); Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern())); }
@java.lang.Override public io.grafeas.v1beta1.UpdateNoteRequest getDefaultInstanceForType() { return io.grafeas.v1beta1.UpdateNoteRequest.getDefaultInstance(); }
/** * * * <pre> * The updated note. * </pre> * * <code>.grafeas.v1beta1.Note note = 2;</code> */ public io.grafeas.v1beta1.NoteOrBuilder getNoteOrBuilder() { return getNote(); }
/** * * * <pre> * The fields to update. * </pre> * * <code>.google.protobuf.FieldMask update_mask = 3;</code> */ public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { return getUpdateMask(); }
@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_); } if (note_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getNote()); } if (updateMask_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getUpdateMask()); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; }
/** * * * <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; } /**
private static io.grpc.MethodDescriptor< io.grafeas.v1beta1.UpdateNoteRequest, io.grafeas.v1beta1.Note> getUpdateNoteMethodHelper() { io.grpc.MethodDescriptor<io.grafeas.v1beta1.UpdateNoteRequest, io.grafeas.v1beta1.Note> getUpdateNoteMethod; if ((getUpdateNoteMethod = GrafeasV1Beta1Grpc.getUpdateNoteMethod) == null) { synchronized (GrafeasV1Beta1Grpc.class) { if ((getUpdateNoteMethod = GrafeasV1Beta1Grpc.getUpdateNoteMethod) == null) { GrafeasV1Beta1Grpc.getUpdateNoteMethod = getUpdateNoteMethod = io.grpc.MethodDescriptor .<io.grafeas.v1beta1.UpdateNoteRequest, io.grafeas.v1beta1.Note>newBuilder() .setType(io.grpc.MethodDescriptor.MethodType.UNARY) .setFullMethodName( generateFullMethodName("grafeas.v1beta1.GrafeasV1Beta1", "UpdateNote")) .setSampledToLocalTracing(true) .setRequestMarshaller( io.grpc.protobuf.ProtoUtils.marshaller( io.grafeas.v1beta1.UpdateNoteRequest.getDefaultInstance())) .setResponseMarshaller( io.grpc.protobuf.ProtoUtils.marshaller( io.grafeas.v1beta1.Note.getDefaultInstance())) .setSchemaDescriptor(new GrafeasV1Beta1MethodDescriptorSupplier("UpdateNote")) .build(); } } } return getUpdateNoteMethod; }
/** * * * <pre> * The updated note. * </pre> * * <code>.grafeas.v1beta1.Note note = 2;</code> */ public io.grafeas.v1beta1.NoteOrBuilder getNoteOrBuilder() { return getNote(); }
/** * * * <pre> * The fields to update. * </pre> * * <code>.google.protobuf.FieldMask update_mask = 3;</code> */ public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { return getUpdateMask(); }
@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(); if (hasNote()) { hash = (37 * hash) + NOTE_FIELD_NUMBER; hash = (53 * hash) + getNote().hashCode(); } if (hasUpdateMask()) { hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; hash = (53 * hash) + getUpdateMask().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
@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_); } if (note_ != null) { output.writeMessage(2, getNote()); } if (updateMask_ != null) { output.writeMessage(3, getUpdateMask()); } unknownFields.writeTo(output); }
/** * Updates the specified note. * * <p>Sample code: * * <pre><code> * try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) { * NoteName name = NoteName.of("[PROJECT]", "[NOTE]"); * Note note = Note.newBuilder().build(); * FieldMask updateMask = FieldMask.newBuilder().build(); * Note response = grafeasV1Beta1Client.updateNote(name.toString(), note, updateMask); * } * </code></pre> * * @param name The name of the note in the form of `projects/[PROVIDER_ID]/notes/[NOTE_ID]`. * @param note The updated note. * @param updateMask The fields to update. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Note updateNote(String name, Note note, FieldMask updateMask) { UpdateNoteRequest request = UpdateNoteRequest.newBuilder() .setName(name) .setNote(note) .setUpdateMask(updateMask) .build(); return updateNote(request); }
@java.lang.Override public io.grafeas.v1beta1.UpdateNoteRequest getDefaultInstanceForType() { return io.grafeas.v1beta1.UpdateNoteRequest.getDefaultInstance(); }
@java.lang.Override public io.grafeas.v1beta1.UpdateNoteRequest buildPartial() { io.grafeas.v1beta1.UpdateNoteRequest result = new io.grafeas.v1beta1.UpdateNoteRequest(this); result.name_ = name_; if (noteBuilder_ == null) { result.note_ = note_; } else { result.note_ = noteBuilder_.build(); } if (updateMaskBuilder_ == null) { result.updateMask_ = updateMask_; } else { result.updateMask_ = updateMaskBuilder_.build(); } onBuilt(); return result; }