@java.lang.Override public Builder newBuilderForType() { return newBuilder(); }
/** * 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()) { * SinkName sinkName = ProjectSinkName.of("[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.rpc.ApiException if the remote call fails */ public final void deleteSink(SinkName sinkName) { DeleteSinkRequest request = DeleteSinkRequest.newBuilder() .setSinkName(sinkName == null ? null : sinkName.toString()) .build(); deleteSink(request); }
/** * 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()) { * SinkName sinkName = ProjectSinkName.of("[PROJECT]", "[SINK]"); * configClient.deleteSink(sinkName.toString()); * } * </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.rpc.ApiException if the remote call fails */ public final void deleteSink(String sinkName) { DeleteSinkRequest request = DeleteSinkRequest.newBuilder().setSinkName(sinkName).build(); deleteSink(request); }
@Override public ApiFuture<Boolean> deleteSinkAsync(String sink) { DeleteSinkRequest request = DeleteSinkRequest.newBuilder() .setSinkName(ProjectSinkName.of(getOptions().getProjectId(), sink).toString()) .build(); return transform(rpc.delete(request), EMPTY_TO_BOOLEAN_FUNCTION); }
@Test public void testDeleteSink() { DeleteSinkRequest request = DeleteSinkRequest.newBuilder().setSinkName(SINK_NAME_PB).build(); ApiFuture<Empty> response = ApiFutures.immediateFuture(Empty.getDefaultInstance()); EasyMock.expect(loggingRpcMock.delete(request)).andReturn(response); EasyMock.replay(rpcFactoryMock, loggingRpcMock); logging = options.getService(); assertTrue(logging.deleteSink(SINK_NAME)); }
@Test public void testDeleteSink_Null() { DeleteSinkRequest request = DeleteSinkRequest.newBuilder().setSinkName(SINK_NAME_PB).build(); ApiFuture<Empty> response = ApiFutures.immediateFuture(null); EasyMock.expect(loggingRpcMock.delete(request)).andReturn(response); EasyMock.replay(rpcFactoryMock, loggingRpcMock); logging = options.getService(); assertFalse(logging.deleteSink(SINK_NAME)); }
@Test public void testDeleteSinkAsync_Null() throws ExecutionException, InterruptedException { DeleteSinkRequest request = DeleteSinkRequest.newBuilder().setSinkName(SINK_NAME_PB).build(); ApiFuture<Empty> response = ApiFutures.immediateFuture(null); EasyMock.expect(loggingRpcMock.delete(request)).andReturn(response); EasyMock.replay(rpcFactoryMock, loggingRpcMock); logging = options.getService(); assertFalse(logging.deleteSinkAsync(SINK_NAME).get()); }
@Test public void testDeleteSinkAsync() throws ExecutionException, InterruptedException { DeleteSinkRequest request = DeleteSinkRequest.newBuilder().setSinkName(SINK_NAME_PB).build(); ApiFuture<Empty> response = ApiFutures.immediateFuture(Empty.getDefaultInstance()); EasyMock.expect(loggingRpcMock.delete(request)).andReturn(response); EasyMock.replay(rpcFactoryMock, loggingRpcMock); logging = options.getService(); assertTrue(logging.deleteSinkAsync(SINK_NAME).get()); }
/** * 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()) { * SinkName sinkName = ProjectSinkName.of("[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.rpc.ApiException if the remote call fails */ public final void deleteSink(SinkName sinkName) { DeleteSinkRequest request = DeleteSinkRequest.newBuilder() .setSinkName(sinkName == null ? null : sinkName.toString()) .build(); deleteSink(request); }
/** * 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()) { * SinkName sinkName = ProjectSinkName.of("[PROJECT]", "[SINK]"); * configClient.deleteSink(sinkName.toString()); * } * </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.rpc.ApiException if the remote call fails */ public final void deleteSink(String sinkName) { DeleteSinkRequest request = DeleteSinkRequest.newBuilder().setSinkName(sinkName).build(); deleteSink(request); }
@Override public ApiFuture<Boolean> deleteSinkAsync(String sink) { DeleteSinkRequest request = DeleteSinkRequest.newBuilder() .setSinkName(ProjectSinkName.of(getOptions().getProjectId(), sink).toString()) .build(); return transform(rpc.delete(request), EMPTY_TO_BOOLEAN_FUNCTION); }