/** * * * <pre> * [Required] The error event to be reported. * </pre> * * <code>.google.devtools.clouderrorreporting.v1beta1.ReportedErrorEvent event = 2;</code> */ public com.google.devtools.clouderrorreporting.v1beta1.ReportedErrorEventOrBuilder getEventOrBuilder() { return getEvent(); }
@java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (!getProjectNameBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, projectName_); } if (event_ != null) { output.writeMessage(2, getEvent()); } unknownFields.writeTo(output); }
@java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (!getProjectNameBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, projectName_); } if (event_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getEvent()); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; }
@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())); }
/** * * * <pre> * [Required] The error event to be reported. * </pre> * * <code>.google.devtools.clouderrorreporting.v1beta1.ReportedErrorEvent event = 2;</code> */ public com.google.devtools.clouderrorreporting.v1beta1.ReportedErrorEventOrBuilder getEventOrBuilder() { return getEvent(); }
@java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (!getProjectNameBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, projectName_); } if (event_ != null) { output.writeMessage(2, getEvent()); } unknownFields.writeTo(output); }
@java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (!getProjectNameBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, projectName_); } if (event_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getEvent()); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; }
@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; }