@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.monitoring.v3.DeleteNotificationChannelRequest)) { return super.equals(obj); } com.google.monitoring.v3.DeleteNotificationChannelRequest other = (com.google.monitoring.v3.DeleteNotificationChannelRequest) obj; boolean result = true; result = result && getName().equals(other.getName()); result = result && (getForce() == other.getForce()); 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) + NAME_FIELD_NUMBER; hash = (53 * hash) + getName().hashCode(); hash = (37 * hash) + FORCE_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getForce()); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
/** * * * <pre> * The channel for which to execute the request. The format is * `projects/[PROJECT_ID]/notificationChannels/[CHANNEL_ID]`. * </pre> * * <code>string name = 3;</code> */ public Builder clearName() { name_ = getDefaultInstance().getName(); onChanged(); return this; } /**
public Builder mergeFrom(com.google.monitoring.v3.DeleteNotificationChannelRequest other) { if (other == com.google.monitoring.v3.DeleteNotificationChannelRequest.getDefaultInstance()) return this; if (!other.getName().isEmpty()) { name_ = other.name_; onChanged(); } if (other.getForce() != false) { setForce(other.getForce()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
@Test @SuppressWarnings("all") public void deleteNotificationChannelTest() { Empty expectedResponse = Empty.newBuilder().build(); mockNotificationChannelService.addResponse(expectedResponse); NotificationChannelName name = NotificationChannelName.of("[PROJECT]", "[NOTIFICATION_CHANNEL]"); boolean force = false; client.deleteNotificationChannel(name, force); List<GeneratedMessageV3> actualRequests = mockNotificationChannelService.getRequests(); Assert.assertEquals(1, actualRequests.size()); DeleteNotificationChannelRequest actualRequest = (DeleteNotificationChannelRequest) actualRequests.get(0); Assert.assertEquals(name, NotificationChannelName.parse(actualRequest.getName())); Assert.assertEquals(force, actualRequest.getForce()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern())); }