use of com.google.monitoring.v3.DeleteGroupRequest in project google-cloud-java by GoogleCloudPlatform.
the class GroupServiceClient method deleteGroup.
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Deletes an existing group.
*
* <p>Sample code:
*
* <pre><code>
* try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
* GroupName name = GroupName.create("[PROJECT]", "[GROUP]");
* groupServiceClient.deleteGroup(name);
* }
* </code></pre>
*
* @param name The group to delete. The format is
* `"projects/{project_id_or_number}/groups/{group_id}"`.
* @throws com.google.api.gax.grpc.ApiException if the remote call fails
*/
public final void deleteGroup(GroupName name) {
DeleteGroupRequest request = DeleteGroupRequest.newBuilder().setNameWithGroupName(name).build();
deleteGroup(request);
}
use of com.google.monitoring.v3.DeleteGroupRequest in project google-cloud-java by GoogleCloudPlatform.
the class GroupServiceClientTest method deleteGroupTest.
@Test
@SuppressWarnings("all")
public void deleteGroupTest() {
Empty expectedResponse = Empty.newBuilder().build();
mockGroupService.addResponse(expectedResponse);
GroupName name = GroupName.create("[PROJECT]", "[GROUP]");
client.deleteGroup(name);
List<GeneratedMessageV3> actualRequests = mockGroupService.getRequests();
Assert.assertEquals(1, actualRequests.size());
DeleteGroupRequest actualRequest = (DeleteGroupRequest) actualRequests.get(0);
Assert.assertEquals(name, actualRequest.getNameAsGroupName());
}
Aggregations