/** * * * <pre> * The name of the project in the form of `projects/[PROJECT_ID]`, under which * the occurrence is to be created. * </pre> * * <code>string parent = 1;</code> */ public Builder clearParent() { parent_ = getDefaultInstance().getParent(); onChanged(); return this; } /**
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + PARENT_FIELD_NUMBER; hash = (53 * hash) + getParent().hashCode(); if (hasOccurrence()) { hash = (37 * hash) + OCCURRENCE_FIELD_NUMBER; hash = (53 * hash) + getOccurrence().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof io.grafeas.v1beta1.CreateOccurrenceRequest)) { return super.equals(obj); } io.grafeas.v1beta1.CreateOccurrenceRequest other = (io.grafeas.v1beta1.CreateOccurrenceRequest) obj; boolean result = true; result = result && getParent().equals(other.getParent()); result = result && (hasOccurrence() == other.hasOccurrence()); if (hasOccurrence()) { result = result && getOccurrence().equals(other.getOccurrence()); } result = result && unknownFields.equals(other.unknownFields); return result; }
public Builder mergeFrom(io.grafeas.v1beta1.CreateOccurrenceRequest other) { if (other == io.grafeas.v1beta1.CreateOccurrenceRequest.getDefaultInstance()) return this; if (!other.getParent().isEmpty()) { parent_ = other.parent_; onChanged(); } if (other.hasOccurrence()) { mergeOccurrence(other.getOccurrence()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
@Test @SuppressWarnings("all") public void createOccurrenceTest() { String name = "name3373707"; String noteName = "noteName1780787896"; String remediation = "remediation779381797"; Occurrence expectedResponse = Occurrence.newBuilder() .setName(name) .setNoteName(noteName) .setRemediation(remediation) .build(); mockGrafeasV1Beta1.addResponse(expectedResponse); ProjectName parent = ProjectName.of("[PROJECT]"); Occurrence occurrence = Occurrence.newBuilder().build(); Occurrence actualResponse = client.createOccurrence(parent, occurrence); Assert.assertEquals(expectedResponse, actualResponse); List<GeneratedMessageV3> actualRequests = mockGrafeasV1Beta1.getRequests(); Assert.assertEquals(1, actualRequests.size()); CreateOccurrenceRequest actualRequest = (CreateOccurrenceRequest) actualRequests.get(0); Assert.assertEquals(parent, ProjectName.parse(actualRequest.getParent())); Assert.assertEquals(occurrence, actualRequest.getOccurrence()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern())); }
/** * * * <pre> * The name of the project in the form of `projects/[PROJECT_ID]`, under which * the occurrence is to be created. * </pre> * * <code>string parent = 1;</code> */ public Builder clearParent() { parent_ = getDefaultInstance().getParent(); onChanged(); return this; } /**
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof io.grafeas.v1beta1.CreateOccurrenceRequest)) { return super.equals(obj); } io.grafeas.v1beta1.CreateOccurrenceRequest other = (io.grafeas.v1beta1.CreateOccurrenceRequest) obj; boolean result = true; result = result && getParent().equals(other.getParent()); result = result && (hasOccurrence() == other.hasOccurrence()); if (hasOccurrence()) { result = result && getOccurrence().equals(other.getOccurrence()); } result = result && unknownFields.equals(other.unknownFields); return result; }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + PARENT_FIELD_NUMBER; hash = (53 * hash) + getParent().hashCode(); if (hasOccurrence()) { hash = (37 * hash) + OCCURRENCE_FIELD_NUMBER; hash = (53 * hash) + getOccurrence().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
public Builder mergeFrom(io.grafeas.v1beta1.CreateOccurrenceRequest other) { if (other == io.grafeas.v1beta1.CreateOccurrenceRequest.getDefaultInstance()) return this; if (!other.getParent().isEmpty()) { parent_ = other.parent_; onChanged(); } if (other.hasOccurrence()) { mergeOccurrence(other.getOccurrence()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }