use of com.google.logging.v2.DeleteExclusionRequest in project gapic-generator-java by googleapis.
the class ConfigClient method deleteExclusion.
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes an exclusion.
*
* <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>Example: `"projects/my-project-id/exclusions/my-exclusion-id"`.
* @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 gapic-generator-java by googleapis.
the class ConfigClient method deleteExclusion.
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes an exclusion.
*
* <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>Example: `"projects/my-project-id/exclusions/my-exclusion-id"`.
* @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 ConfigClientTest method deleteExclusionTest.
@Test
public void deleteExclusionTest() throws Exception {
Empty expectedResponse = Empty.newBuilder().build();
mockConfigServiceV2.addResponse(expectedResponse);
LogExclusionName name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]");
client.deleteExclusion(name);
List<AbstractMessage> actualRequests = mockConfigServiceV2.getRequests();
Assert.assertEquals(1, actualRequests.size());
DeleteExclusionRequest actualRequest = ((DeleteExclusionRequest) actualRequests.get(0));
Assert.assertEquals(name.toString(), actualRequest.getName());
Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
use of com.google.logging.v2.DeleteExclusionRequest in project gapic-generator-java by googleapis.
the class ConfigClientTest method deleteExclusionTest2.
@Test
public void deleteExclusionTest2() throws Exception {
Empty expectedResponse = Empty.newBuilder().build();
mockConfigServiceV2.addResponse(expectedResponse);
String name = "name3373707";
client.deleteExclusion(name);
List<AbstractMessage> actualRequests = mockConfigServiceV2.getRequests();
Assert.assertEquals(1, actualRequests.size());
DeleteExclusionRequest actualRequest = ((DeleteExclusionRequest) actualRequests.get(0));
Assert.assertEquals(name, actualRequest.getName());
Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
Aggregations