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; }
@java.lang.Override public Builder newBuilderForType() { return newBuilder(); }
@java.lang.Override public com.google.monitoring.v3.DeleteNotificationChannelRequest buildPartial() { com.google.monitoring.v3.DeleteNotificationChannelRequest result = new com.google.monitoring.v3.DeleteNotificationChannelRequest(this); result.name_ = name_; result.force_ = force_; onBuilt(); 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; }
@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; }
/** * * * <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; } /**
@java.lang.Override public com.google.monitoring.v3.DeleteNotificationChannelRequest getDefaultInstanceForType() { return com.google.monitoring.v3.DeleteNotificationChannelRequest.getDefaultInstance(); }
if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { done = true; } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable();
@java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (!getNameBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 3, name_); } if (force_ != false) { output.writeBool(5, force_); } unknownFields.writeTo(output); }
@java.lang.Override public com.google.monitoring.v3.DeleteNotificationChannelRequest build() { com.google.monitoring.v3.DeleteNotificationChannelRequest result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; }
@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())); }
io.grpc.protobuf.ProtoUtils.marshaller( com.google.monitoring.v3.DeleteNotificationChannelRequest .getDefaultInstance())) .setResponseMarshaller( io.grpc.protobuf.ProtoUtils.marshaller(
@java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (!getNameBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, name_); } if (force_ != false) { size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, force_); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; }
/** * Deletes a notification channel. * * <p>Sample code: * * <pre><code> * try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) { * NotificationChannelName name = NotificationChannelName.of("[PROJECT]", "[NOTIFICATION_CHANNEL]"); * boolean force = false; * notificationChannelServiceClient.deleteNotificationChannel(name.toString(), force); * } * </code></pre> * * @param name The channel for which to execute the request. The format is * `projects/[PROJECT_ID]/notificationChannels/[CHANNEL_ID]`. * @param force If true, the notification channel will be deleted regardless of its use in alert * policies (the policies will be updated to remove the channel). If false, channels that are * still referenced by an existing alerting policy will fail to be deleted in a delete * operation. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final void deleteNotificationChannel(String name, boolean force) { DeleteNotificationChannelRequest request = DeleteNotificationChannelRequest.newBuilder().setName(name).setForce(force).build(); deleteNotificationChannel(request); }
io.grpc.protobuf.ProtoUtils.marshaller( com.google.monitoring.v3.DeleteNotificationChannelRequest .getDefaultInstance())) .setResponseMarshaller( io.grpc.protobuf.ProtoUtils.marshaller(
/** * Deletes a notification channel. * * <p>Sample code: * * <pre><code> * try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) { * NotificationChannelName name = NotificationChannelName.of("[PROJECT]", "[NOTIFICATION_CHANNEL]"); * boolean force = false; * notificationChannelServiceClient.deleteNotificationChannel(name, force); * } * </code></pre> * * @param name The channel for which to execute the request. The format is * `projects/[PROJECT_ID]/notificationChannels/[CHANNEL_ID]`. * @param force If true, the notification channel will be deleted regardless of its use in alert * policies (the policies will be updated to remove the channel). If false, channels that are * still referenced by an existing alerting policy will fail to be deleted in a delete * operation. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final void deleteNotificationChannel(NotificationChannelName name, boolean force) { DeleteNotificationChannelRequest request = DeleteNotificationChannelRequest.newBuilder() .setName(name == null ? null : name.toString()) .setForce(force) .build(); deleteNotificationChannel(request); }
/** * Deletes a notification channel. * * <p>Sample code: * * <pre><code> * try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) { * NotificationChannelName name = NotificationChannelName.of("[PROJECT]", "[NOTIFICATION_CHANNEL]"); * boolean force = false; * notificationChannelServiceClient.deleteNotificationChannel(name.toString(), force); * } * </code></pre> * * @param name The channel for which to execute the request. The format is * `projects/[PROJECT_ID]/notificationChannels/[CHANNEL_ID]`. * @param force If true, the notification channel will be deleted regardless of its use in alert * policies (the policies will be updated to remove the channel). If false, channels that are * still referenced by an existing alerting policy will fail to be deleted in a delete * operation. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final void deleteNotificationChannel(String name, boolean force) { DeleteNotificationChannelRequest request = DeleteNotificationChannelRequest.newBuilder().setName(name).setForce(force).build(); deleteNotificationChannel(request); }
/** * Deletes a notification channel. * * <p>Sample code: * * <pre><code> * try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) { * NotificationChannelName name = NotificationChannelName.of("[PROJECT]", "[NOTIFICATION_CHANNEL]"); * boolean force = false; * notificationChannelServiceClient.deleteNotificationChannel(name, force); * } * </code></pre> * * @param name The channel for which to execute the request. The format is * `projects/[PROJECT_ID]/notificationChannels/[CHANNEL_ID]`. * @param force If true, the notification channel will be deleted regardless of its use in alert * policies (the policies will be updated to remove the channel). If false, channels that are * still referenced by an existing alerting policy will fail to be deleted in a delete * operation. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final void deleteNotificationChannel(NotificationChannelName name, boolean force) { DeleteNotificationChannelRequest request = DeleteNotificationChannelRequest.newBuilder() .setName(name == null ? null : name.toString()) .setForce(force) .build(); deleteNotificationChannel(request); }