use of com.google.logging.v2.DeleteExclusionRequest in project java-logging by googleapis.
the class LoggingImplTest method testDeleteExclusion.
@Test
public void testDeleteExclusion() {
DeleteExclusionRequest request = DeleteExclusionRequest.newBuilder().setName(EXCLUSION_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.deleteExclusion(EXCLUSION_NAME));
}
use of com.google.logging.v2.DeleteExclusionRequest in project java-logging by googleapis.
the class ConfigClient method deleteExclusion.
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes an exclusion in the _Default sink.
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated for illustrative purposes only.
* // It may require modifications to work in your environment.
* try (ConfigClient configClient = ConfigClient.create()) {
* String name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]").toString();
* configClient.deleteExclusion(name);
* }
* }</pre>
*
* @param name Required. The resource name of an existing exclusion to delete:
* <p>"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
* "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
* "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
* "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
* <p>For example:
* <p>`"projects/my-project/exclusions/my-exclusion"`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final void deleteExclusion(String name) {
DeleteExclusionRequest request = DeleteExclusionRequest.newBuilder().setName(name).build();
deleteExclusion(request);
}
use of com.google.logging.v2.DeleteExclusionRequest in project java-logging by googleapis.
the class LoggingImplTest method testDeleteExclusionAsync.
@Test
public void testDeleteExclusionAsync() throws ExecutionException, InterruptedException {
DeleteExclusionRequest request = DeleteExclusionRequest.newBuilder().setName(EXCLUSION_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.deleteExclusionAsync(EXCLUSION_NAME).get());
}
use of com.google.logging.v2.DeleteExclusionRequest in project java-logging by googleapis.
the class ConfigClient method deleteExclusion.
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes an exclusion in the _Default sink.
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated for illustrative purposes only.
* // It may require modifications to work in your environment.
* try (ConfigClient configClient = ConfigClient.create()) {
* LogExclusionName name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]");
* configClient.deleteExclusion(name);
* }
* }</pre>
*
* @param name Required. The resource name of an existing exclusion to delete:
* <p>"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
* "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
* "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
* "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
* <p>For example:
* <p>`"projects/my-project/exclusions/my-exclusion"`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final void deleteExclusion(LogExclusionName name) {
DeleteExclusionRequest request = DeleteExclusionRequest.newBuilder().setName(name == null ? null : name.toString()).build();
deleteExclusion(request);
}
use of com.google.logging.v2.DeleteExclusionRequest in project gapic-generator-java by googleapis.
the class AsyncDeleteExclusion method asyncDeleteExclusion.
public static void asyncDeleteExclusion() throws Exception {
// It may require modifications to work in your environment.
try (ConfigClient configClient = ConfigClient.create()) {
DeleteExclusionRequest request = DeleteExclusionRequest.newBuilder().setName(LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]").toString()).build();
ApiFuture<Empty> future = configClient.deleteExclusionCallable().futureCall(request);
// Do something.
future.get();
}
}
Aggregations