@java.lang.Override public Builder newBuilderForType() { return newBuilder(); }
public Builder mergeFrom(io.grafeas.v1beta1.UpdateOccurrenceRequest other) { if (other == io.grafeas.v1beta1.UpdateOccurrenceRequest.getDefaultInstance()) return this; if (!other.getName().isEmpty()) { name_ = other.name_; onChanged(); } if (other.hasOccurrence()) { mergeOccurrence(other.getOccurrence()); } if (other.hasUpdateMask()) { mergeUpdateMask(other.getUpdateMask()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
@java.lang.Override public io.grafeas.v1beta1.UpdateOccurrenceRequest buildPartial() { io.grafeas.v1beta1.UpdateOccurrenceRequest result = new io.grafeas.v1beta1.UpdateOccurrenceRequest(this); result.name_ = name_; if (occurrenceBuilder_ == null) { result.occurrence_ = occurrence_; } else { result.occurrence_ = occurrenceBuilder_.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 (occurrence_ != null) { output.writeMessage(2, getOccurrence()); } 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.UpdateOccurrenceRequest)) { return super.equals(obj); } io.grafeas.v1beta1.UpdateOccurrenceRequest other = (io.grafeas.v1beta1.UpdateOccurrenceRequest) obj; boolean result = true; result = result && getName().equals(other.getName()); result = result && (hasOccurrence() == other.hasOccurrence()); if (hasOccurrence()) { result = result && getOccurrence().equals(other.getOccurrence()); } 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 occurrence in the form of * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`. * </pre> * * <code>string name = 1;</code> */ public Builder clearName() { name_ = getDefaultInstance().getName(); onChanged(); return this; } /**
@Test @SuppressWarnings("all") public void updateOccurrenceTest() { String name2 = "name2-1052831874"; String noteName = "noteName1780787896"; String remediation = "remediation779381797"; Occurrence expectedResponse = Occurrence.newBuilder() .setName(name2) .setNoteName(noteName) .setRemediation(remediation) .build(); mockGrafeasV1Beta1.addResponse(expectedResponse); OccurrenceName name = OccurrenceName.of("[PROJECT]", "[OCCURRENCE]"); Occurrence occurrence = Occurrence.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); Occurrence actualResponse = client.updateOccurrence(name, occurrence, updateMask); Assert.assertEquals(expectedResponse, actualResponse); List<GeneratedMessageV3> actualRequests = mockGrafeasV1Beta1.getRequests(); Assert.assertEquals(1, actualRequests.size()); UpdateOccurrenceRequest actualRequest = (UpdateOccurrenceRequest) actualRequests.get(0); Assert.assertEquals(name, OccurrenceName.parse(actualRequest.getName())); Assert.assertEquals(occurrence, actualRequest.getOccurrence()); Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern())); }
@java.lang.Override public io.grafeas.v1beta1.UpdateOccurrenceRequest getDefaultInstanceForType() { return io.grafeas.v1beta1.UpdateOccurrenceRequest.getDefaultInstance(); }
/** * * * <pre> * The updated occurrence. * </pre> * * <code>.grafeas.v1beta1.Occurrence occurrence = 2;</code> */ public io.grafeas.v1beta1.OccurrenceOrBuilder getOccurrenceOrBuilder() { return getOccurrence(); }
/** * * * <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 (occurrence_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getOccurrence()); } if (updateMask_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getUpdateMask()); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; }
/** * * * <pre> * The name of the occurrence in the form of * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`. * </pre> * * <code>string name = 1;</code> */ public Builder clearName() { name_ = getDefaultInstance().getName(); onChanged(); return this; } /**
.setRequestMarshaller( io.grpc.protobuf.ProtoUtils.marshaller( io.grafeas.v1beta1.UpdateOccurrenceRequest.getDefaultInstance())) .setResponseMarshaller( io.grpc.protobuf.ProtoUtils.marshaller(
/** * * * <pre> * The updated occurrence. * </pre> * * <code>.grafeas.v1beta1.Occurrence occurrence = 2;</code> */ public io.grafeas.v1beta1.OccurrenceOrBuilder getOccurrenceOrBuilder() { return getOccurrence(); }
/** * * * <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 (hasOccurrence()) { hash = (37 * hash) + OCCURRENCE_FIELD_NUMBER; hash = (53 * hash) + getOccurrence().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 (occurrence_ != null) { output.writeMessage(2, getOccurrence()); } if (updateMask_ != null) { output.writeMessage(3, getUpdateMask()); } unknownFields.writeTo(output); }
/** * Updates the specified occurrence. * * <p>Sample code: * * <pre><code> * try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) { * OccurrenceName name = OccurrenceName.of("[PROJECT]", "[OCCURRENCE]"); * Occurrence occurrence = Occurrence.newBuilder().build(); * FieldMask updateMask = FieldMask.newBuilder().build(); * Occurrence response = grafeasV1Beta1Client.updateOccurrence(name.toString(), occurrence, updateMask); * } * </code></pre> * * @param name The name of the occurrence in the form of * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`. * @param occurrence The updated occurrence. * @param updateMask The fields to update. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Occurrence updateOccurrence( String name, Occurrence occurrence, FieldMask updateMask) { UpdateOccurrenceRequest request = UpdateOccurrenceRequest.newBuilder() .setName(name) .setOccurrence(occurrence) .setUpdateMask(updateMask) .build(); return updateOccurrence(request); }
@java.lang.Override public io.grafeas.v1beta1.UpdateOccurrenceRequest getDefaultInstanceForType() { return io.grafeas.v1beta1.UpdateOccurrenceRequest.getDefaultInstance(); }
@java.lang.Override public io.grafeas.v1beta1.UpdateOccurrenceRequest buildPartial() { io.grafeas.v1beta1.UpdateOccurrenceRequest result = new io.grafeas.v1beta1.UpdateOccurrenceRequest(this); result.name_ = name_; if (occurrenceBuilder_ == null) { result.occurrence_ = occurrence_; } else { result.occurrence_ = occurrenceBuilder_.build(); } if (updateMaskBuilder_ == null) { result.updateMask_ = updateMask_; } else { result.updateMask_ = updateMaskBuilder_.build(); } onBuilt(); return result; }