/** * * * <pre> * [Required] The resource name of the Google Cloud Platform project. Written * as `projects/` plus the * [Google Cloud Platform project ID](https://support.google.com/cloud/answer/6158840). * Example: `projects/my-project-123`. * </pre> * * <code>string project_name = 1;</code> */ public Builder clearProjectName() { projectName_ = getDefaultInstance().getProjectName(); 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) + PROJECT_NAME_FIELD_NUMBER; hash = (53 * hash) + getProjectName().hashCode(); if (hasEvent()) { hash = (37 * hash) + EVENT_FIELD_NUMBER; hash = (53 * hash) + getEvent().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 com.google.devtools.clouderrorreporting.v1beta1.ReportErrorEventRequest)) { return super.equals(obj); } com.google.devtools.clouderrorreporting.v1beta1.ReportErrorEventRequest other = (com.google.devtools.clouderrorreporting.v1beta1.ReportErrorEventRequest) obj; boolean result = true; result = result && getProjectName().equals(other.getProjectName()); result = result && (hasEvent() == other.hasEvent()); if (hasEvent()) { result = result && getEvent().equals(other.getEvent()); } result = result && unknownFields.equals(other.unknownFields); return result; }
public Builder mergeFrom( com.google.devtools.clouderrorreporting.v1beta1.ReportErrorEventRequest other) { if (other == com.google.devtools.clouderrorreporting.v1beta1.ReportErrorEventRequest .getDefaultInstance()) return this; if (!other.getProjectName().isEmpty()) { projectName_ = other.projectName_; onChanged(); } if (other.hasEvent()) { mergeEvent(other.getEvent()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
@Test @SuppressWarnings("all") public void reportErrorEventTest() { ReportErrorEventResponse expectedResponse = ReportErrorEventResponse.newBuilder().build(); mockReportErrorsService.addResponse(expectedResponse); ProjectName projectName = ProjectName.of("[PROJECT]"); ReportedErrorEvent event = ReportedErrorEvent.newBuilder().build(); ReportErrorEventResponse actualResponse = client.reportErrorEvent(projectName, event); Assert.assertEquals(expectedResponse, actualResponse); List<GeneratedMessageV3> actualRequests = mockReportErrorsService.getRequests(); Assert.assertEquals(1, actualRequests.size()); ReportErrorEventRequest actualRequest = (ReportErrorEventRequest) actualRequests.get(0); Assert.assertEquals(projectName, ProjectName.parse(actualRequest.getProjectName())); Assert.assertEquals(event, actualRequest.getEvent()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern())); }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + PROJECT_NAME_FIELD_NUMBER; hash = (53 * hash) + getProjectName().hashCode(); if (hasEvent()) { hash = (37 * hash) + EVENT_FIELD_NUMBER; hash = (53 * hash) + getEvent().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
/** * * * <pre> * [Required] The resource name of the Google Cloud Platform project. Written * as `projects/` plus the * [Google Cloud Platform project ID](https://support.google.com/cloud/answer/6158840). * Example: `projects/my-project-123`. * </pre> * * <code>string project_name = 1;</code> */ public Builder clearProjectName() { projectName_ = getDefaultInstance().getProjectName(); onChanged(); return this; } /**
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.devtools.clouderrorreporting.v1beta1.ReportErrorEventRequest)) { return super.equals(obj); } com.google.devtools.clouderrorreporting.v1beta1.ReportErrorEventRequest other = (com.google.devtools.clouderrorreporting.v1beta1.ReportErrorEventRequest) obj; boolean result = true; result = result && getProjectName().equals(other.getProjectName()); result = result && (hasEvent() == other.hasEvent()); if (hasEvent()) { result = result && getEvent().equals(other.getEvent()); } result = result && unknownFields.equals(other.unknownFields); return result; }
public Builder mergeFrom( com.google.devtools.clouderrorreporting.v1beta1.ReportErrorEventRequest other) { if (other == com.google.devtools.clouderrorreporting.v1beta1.ReportErrorEventRequest .getDefaultInstance()) return this; if (!other.getProjectName().isEmpty()) { projectName_ = other.projectName_; onChanged(); } if (other.hasEvent()) { mergeEvent(other.getEvent()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }