@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.logging.v2.DeleteLogMetricRequest)) { return super.equals(obj); } com.google.logging.v2.DeleteLogMetricRequest other = (com.google.logging.v2.DeleteLogMetricRequest) obj; boolean result = true; result = result && getMetricName().equals(other.getMetricName()); 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) + METRIC_NAME_FIELD_NUMBER; hash = (53 * hash) + getMetricName().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
/** * * * <pre> * The resource name of the metric to delete: * "projects/[PROJECT_ID]/metrics/[METRIC_ID]" * </pre> * * <code>string metric_name = 1;</code> */ public Builder clearMetricName() { metricName_ = getDefaultInstance().getMetricName(); onChanged(); return this; } /**
public Builder mergeFrom(com.google.logging.v2.DeleteLogMetricRequest other) { if (other == com.google.logging.v2.DeleteLogMetricRequest.getDefaultInstance()) return this; if (!other.getMetricName().isEmpty()) { metricName_ = other.metricName_; onChanged(); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
@Test @SuppressWarnings("all") public void deleteLogMetricTest() { Empty expectedResponse = Empty.newBuilder().build(); mockMetricsServiceV2.addResponse(expectedResponse); MetricName metricName = ProjectMetricName.of("[PROJECT]", "[METRIC]"); client.deleteLogMetric(metricName); List<GeneratedMessageV3> actualRequests = mockMetricsServiceV2.getRequests(); Assert.assertEquals(1, actualRequests.size()); DeleteLogMetricRequest actualRequest = (DeleteLogMetricRequest) actualRequests.get(0); Assert.assertEquals(metricName, MetricNames.parse(actualRequest.getMetricName())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern())); }