Search in sources :

Example 6 with DeleteSinkRequest

use of com.google.logging.v2.DeleteSinkRequest in project google-cloud-java by GoogleCloudPlatform.

the class ConfigClient method deleteSink.

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
   * Deletes a sink. If the sink has a unique `writer_identity`, then that service account is also
   * deleted.
   *
   * <p>Sample code:
   *
   * <pre><code>
   * try (ConfigClient configClient = ConfigClient.create()) {
   *   SinkNameOneof sinkName = SinkNameOneof.from(SinkName.create("[PROJECT]", "[SINK]"));
   *   configClient.deleteSink(sinkName);
   * }
   * </code></pre>
   *
   * @param sinkName Required. The full resource name of the sink to delete, including the parent
   *     resource and the sink identifier:
   *     <p>"projects/[PROJECT_ID]/sinks/[SINK_ID]"
   *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
   *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
   *     "folders/[FOLDER_ID]/sinks/[SINK_ID]"
   *     <p>Example: `"projects/my-project-id/sinks/my-sink-id"`.
   * @throws com.google.api.gax.grpc.ApiException if the remote call fails
   */
public final void deleteSink(SinkNameOneof sinkName) {
    DeleteSinkRequest request = DeleteSinkRequest.newBuilder().setSinkNameWithSinkNameOneof(sinkName).build();
    deleteSink(request);
}
Also used : DeleteSinkRequest(com.google.logging.v2.DeleteSinkRequest)

Aggregations

DeleteSinkRequest (com.google.logging.v2.DeleteSinkRequest)6 Empty (com.google.protobuf.Empty)5 Test (org.junit.Test)5 SinkNameOneof (com.google.logging.v2.SinkNameOneof)1 GeneratedMessageV3 (com.google.protobuf.GeneratedMessageV3)1