use of com.google.cloud.securitycenter.v1.NotificationConfig in project java-securitycenter by googleapis.
the class ListNotificationConfigSnippets method listNotificationConfigs.
// [START securitycenter_list_notification_configs]
public static ImmutableList<NotificationConfig> listNotificationConfigs(String organizationId) throws IOException {
// String organizationId = "{your-org-id}";
OrganizationName orgName = OrganizationName.newBuilder().setOrganization(organizationId).build();
try (SecurityCenterClient client = SecurityCenterClient.create()) {
ListNotificationConfigsPagedResponse response = client.listNotificationConfigs(orgName);
ImmutableList<NotificationConfig> notificationConfigs = ImmutableList.copyOf(response.iterateAll());
System.out.println(String.format("List notifications response: %s", response.getPage().getValues()));
return notificationConfigs;
}
}
Aggregations