@Generated(value="by gapic-generator-java") public class SecurityCenterClient extends Object implements BackgroundResource
This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
Source source = Source.newBuilder().build();
Source response = securityCenterClient.createSource(parent, source);
}
Note: close() needs to be called on the SecurityCenterClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().
The surface of this class includes several types of Java methods for each of the API's methods:
See the individual methods for example code.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.
This class can be customized by passing in a custom instance of SecurityCenterSettings to create(). For example:
To customize credentials:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
SecurityCenterSettings securityCenterSettings =
SecurityCenterSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
SecurityCenterClient securityCenterClient = SecurityCenterClient.create(securityCenterSettings);
To customize the endpoint:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
SecurityCenterSettings securityCenterSettings =
SecurityCenterSettings.newBuilder().setEndpoint(myEndpoint).build();
SecurityCenterClient securityCenterClient = SecurityCenterClient.create(securityCenterSettings);
To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over the wire:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
SecurityCenterSettings securityCenterSettings =
SecurityCenterSettings.newBuilder()
.setTransportChannelProvider(
SecurityCenterSettings.defaultHttpJsonTransportProviderBuilder().build())
.build();
SecurityCenterClient securityCenterClient = SecurityCenterClient.create(securityCenterSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
Modifier | Constructor and Description |
---|---|
protected |
SecurityCenterClient(SecurityCenterSettings settings)
Constructs an instance of SecurityCenterClient, using the given settings.
|
protected |
SecurityCenterClient(SecurityCenterStub stub) |
protected SecurityCenterClient(SecurityCenterSettings settings) throws IOException
IOException
protected SecurityCenterClient(SecurityCenterStub stub)
public static final SecurityCenterClient create() throws IOException
IOException
public static final SecurityCenterClient create(SecurityCenterSettings settings) throws IOException
IOException
public static final SecurityCenterClient create(SecurityCenterStub stub)
public final SecurityCenterSettings getSettings()
public SecurityCenterStub getStub()
public final OperationsClient getOperationsClient()
@BetaApi public final OperationsClient getHttpJsonOperationsClient()
public final OperationFuture<BulkMuteFindingsResponse,Empty> bulkMuteFindingsAsync(com.google.api.resourcenames.ResourceName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
ResourceName parent = FolderName.of("[FOLDER]");
BulkMuteFindingsResponse response = securityCenterClient.bulkMuteFindingsAsync(parent).get();
}
parent
- Required. The parent, at which bulk action needs to be applied. Its format is
"organizations/[organization_id]", "folders/[folder_id]", "projects/[project_id]".ApiException
- if the remote call failspublic final OperationFuture<BulkMuteFindingsResponse,Empty> bulkMuteFindingsAsync(String parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
String parent = FolderName.of("[FOLDER]").toString();
BulkMuteFindingsResponse response = securityCenterClient.bulkMuteFindingsAsync(parent).get();
}
parent
- Required. The parent, at which bulk action needs to be applied. Its format is
"organizations/[organization_id]", "folders/[folder_id]", "projects/[project_id]".ApiException
- if the remote call failspublic final OperationFuture<BulkMuteFindingsResponse,Empty> bulkMuteFindingsAsync(BulkMuteFindingsRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
BulkMuteFindingsRequest request =
BulkMuteFindingsRequest.newBuilder()
.setParent(FolderName.of("[FOLDER]").toString())
.setFilter("filter-1274492040")
.setMuteAnnotation("muteAnnotation-2111042008")
.build();
BulkMuteFindingsResponse response = securityCenterClient.bulkMuteFindingsAsync(request).get();
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final OperationCallable<BulkMuteFindingsRequest,BulkMuteFindingsResponse,Empty> bulkMuteFindingsOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
BulkMuteFindingsRequest request =
BulkMuteFindingsRequest.newBuilder()
.setParent(FolderName.of("[FOLDER]").toString())
.setFilter("filter-1274492040")
.setMuteAnnotation("muteAnnotation-2111042008")
.build();
OperationFuture<BulkMuteFindingsResponse, Empty> future =
securityCenterClient.bulkMuteFindingsOperationCallable().futureCall(request);
// Do something.
BulkMuteFindingsResponse response = future.get();
}
public final UnaryCallable<BulkMuteFindingsRequest,Operation> bulkMuteFindingsCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
BulkMuteFindingsRequest request =
BulkMuteFindingsRequest.newBuilder()
.setParent(FolderName.of("[FOLDER]").toString())
.setFilter("filter-1274492040")
.setMuteAnnotation("muteAnnotation-2111042008")
.build();
ApiFuture<Operation> future =
securityCenterClient.bulkMuteFindingsCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final Source createSource(OrganizationName parent, Source source)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
Source source = Source.newBuilder().build();
Source response = securityCenterClient.createSource(parent, source);
}
parent
- Required. Resource name of the new source's parent. Its format should be
"organizations/[organization_id]".source
- Required. The Source being created, only the display_name and description will be
used. All other fields will be ignored.ApiException
- if the remote call failspublic final Source createSource(String parent, Source source)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
String parent = OrganizationName.of("[ORGANIZATION]").toString();
Source source = Source.newBuilder().build();
Source response = securityCenterClient.createSource(parent, source);
}
parent
- Required. Resource name of the new source's parent. Its format should be
"organizations/[organization_id]".source
- Required. The Source being created, only the display_name and description will be
used. All other fields will be ignored.ApiException
- if the remote call failspublic final Source createSource(CreateSourceRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
CreateSourceRequest request =
CreateSourceRequest.newBuilder()
.setParent(OrganizationName.of("[ORGANIZATION]").toString())
.setSource(Source.newBuilder().build())
.build();
Source response = securityCenterClient.createSource(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<CreateSourceRequest,Source> createSourceCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
CreateSourceRequest request =
CreateSourceRequest.newBuilder()
.setParent(OrganizationName.of("[ORGANIZATION]").toString())
.setSource(Source.newBuilder().build())
.build();
ApiFuture<Source> future = securityCenterClient.createSourceCallable().futureCall(request);
// Do something.
Source response = future.get();
}
public final Finding createFinding(SourceName parent, String findingId, Finding finding)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
SourceName parent = SourceName.ofOrganizationSourceName("[ORGANIZATION]", "[SOURCE]");
String findingId = "findingId439150212";
Finding finding = Finding.newBuilder().build();
Finding response = securityCenterClient.createFinding(parent, findingId, finding);
}
parent
- Required. Resource name of the new finding's parent. Its format should be
"organizations/[organization_id]/sources/[source_id]".findingId
- Required. Unique identifier provided by the client within the parent scope. It
must be alphanumeric and less than or equal to 32 characters and greater than 0 characters
in length.finding
- Required. The Finding being created. The name and security_marks will be ignored
as they are both output only fields on this resource.ApiException
- if the remote call failspublic final Finding createFinding(String parent, String findingId, Finding finding)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
String parent = SourceName.ofOrganizationSourceName("[ORGANIZATION]", "[SOURCE]").toString();
String findingId = "findingId439150212";
Finding finding = Finding.newBuilder().build();
Finding response = securityCenterClient.createFinding(parent, findingId, finding);
}
parent
- Required. Resource name of the new finding's parent. Its format should be
"organizations/[organization_id]/sources/[source_id]".findingId
- Required. Unique identifier provided by the client within the parent scope. It
must be alphanumeric and less than or equal to 32 characters and greater than 0 characters
in length.finding
- Required. The Finding being created. The name and security_marks will be ignored
as they are both output only fields on this resource.ApiException
- if the remote call failspublic final Finding createFinding(CreateFindingRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
CreateFindingRequest request =
CreateFindingRequest.newBuilder()
.setParent(
SourceName.ofOrganizationSourceName("[ORGANIZATION]", "[SOURCE]").toString())
.setFindingId("findingId439150212")
.setFinding(Finding.newBuilder().build())
.build();
Finding response = securityCenterClient.createFinding(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<CreateFindingRequest,Finding> createFindingCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
CreateFindingRequest request =
CreateFindingRequest.newBuilder()
.setParent(
SourceName.ofOrganizationSourceName("[ORGANIZATION]", "[SOURCE]").toString())
.setFindingId("findingId439150212")
.setFinding(Finding.newBuilder().build())
.build();
ApiFuture<Finding> future = securityCenterClient.createFindingCallable().futureCall(request);
// Do something.
Finding response = future.get();
}
public final MuteConfig createMuteConfig(FolderName parent, MuteConfig muteConfig)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
FolderName parent = FolderName.of("[FOLDER]");
MuteConfig muteConfig = MuteConfig.newBuilder().build();
MuteConfig response = securityCenterClient.createMuteConfig(parent, muteConfig);
}
parent
- Required. Resource name of the new mute configs's parent. Its format is
"organizations/[organization_id]", "folders/[folder_id]", or "projects/[project_id]".muteConfig
- Required. The mute config being created.ApiException
- if the remote call failspublic final MuteConfig createMuteConfig(OrganizationName parent, MuteConfig muteConfig)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
MuteConfig muteConfig = MuteConfig.newBuilder().build();
MuteConfig response = securityCenterClient.createMuteConfig(parent, muteConfig);
}
parent
- Required. Resource name of the new mute configs's parent. Its format is
"organizations/[organization_id]", "folders/[folder_id]", or "projects/[project_id]".muteConfig
- Required. The mute config being created.ApiException
- if the remote call failspublic final MuteConfig createMuteConfig(ProjectName parent, MuteConfig muteConfig)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
MuteConfig muteConfig = MuteConfig.newBuilder().build();
MuteConfig response = securityCenterClient.createMuteConfig(parent, muteConfig);
}
parent
- Required. Resource name of the new mute configs's parent. Its format is
"organizations/[organization_id]", "folders/[folder_id]", or "projects/[project_id]".muteConfig
- Required. The mute config being created.ApiException
- if the remote call failspublic final MuteConfig createMuteConfig(String parent, MuteConfig muteConfig)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
String parent = OrganizationName.of("[ORGANIZATION]").toString();
MuteConfig muteConfig = MuteConfig.newBuilder().build();
MuteConfig response = securityCenterClient.createMuteConfig(parent, muteConfig);
}
parent
- Required. Resource name of the new mute configs's parent. Its format is
"organizations/[organization_id]", "folders/[folder_id]", or "projects/[project_id]".muteConfig
- Required. The mute config being created.ApiException
- if the remote call failspublic final MuteConfig createMuteConfig(FolderName parent, MuteConfig muteConfig, String muteConfigId)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
FolderName parent = FolderName.of("[FOLDER]");
MuteConfig muteConfig = MuteConfig.newBuilder().build();
String muteConfigId = "muteConfigId1689669942";
MuteConfig response = securityCenterClient.createMuteConfig(parent, muteConfig, muteConfigId);
}
parent
- Required. Resource name of the new mute configs's parent. Its format is
"organizations/[organization_id]", "folders/[folder_id]", or "projects/[project_id]".muteConfig
- Required. The mute config being created.muteConfigId
- Required. Unique identifier provided by the client within the parent scope.
It must consist of lower case letters, numbers, and hyphen, with the first character a
letter, the last a letter or a number, and a 63 character maximum.ApiException
- if the remote call failspublic final MuteConfig createMuteConfig(OrganizationName parent, MuteConfig muteConfig, String muteConfigId)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
MuteConfig muteConfig = MuteConfig.newBuilder().build();
String muteConfigId = "muteConfigId1689669942";
MuteConfig response = securityCenterClient.createMuteConfig(parent, muteConfig, muteConfigId);
}
parent
- Required. Resource name of the new mute configs's parent. Its format is
"organizations/[organization_id]", "folders/[folder_id]", or "projects/[project_id]".muteConfig
- Required. The mute config being created.muteConfigId
- Required. Unique identifier provided by the client within the parent scope.
It must consist of lower case letters, numbers, and hyphen, with the first character a
letter, the last a letter or a number, and a 63 character maximum.ApiException
- if the remote call failspublic final MuteConfig createMuteConfig(ProjectName parent, MuteConfig muteConfig, String muteConfigId)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
MuteConfig muteConfig = MuteConfig.newBuilder().build();
String muteConfigId = "muteConfigId1689669942";
MuteConfig response = securityCenterClient.createMuteConfig(parent, muteConfig, muteConfigId);
}
parent
- Required. Resource name of the new mute configs's parent. Its format is
"organizations/[organization_id]", "folders/[folder_id]", or "projects/[project_id]".muteConfig
- Required. The mute config being created.muteConfigId
- Required. Unique identifier provided by the client within the parent scope.
It must consist of lower case letters, numbers, and hyphen, with the first character a
letter, the last a letter or a number, and a 63 character maximum.ApiException
- if the remote call failspublic final MuteConfig createMuteConfig(String parent, MuteConfig muteConfig, String muteConfigId)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
String parent = OrganizationName.of("[ORGANIZATION]").toString();
MuteConfig muteConfig = MuteConfig.newBuilder().build();
String muteConfigId = "muteConfigId1689669942";
MuteConfig response = securityCenterClient.createMuteConfig(parent, muteConfig, muteConfigId);
}
parent
- Required. Resource name of the new mute configs's parent. Its format is
"organizations/[organization_id]", "folders/[folder_id]", or "projects/[project_id]".muteConfig
- Required. The mute config being created.muteConfigId
- Required. Unique identifier provided by the client within the parent scope.
It must consist of lower case letters, numbers, and hyphen, with the first character a
letter, the last a letter or a number, and a 63 character maximum.ApiException
- if the remote call failspublic final MuteConfig createMuteConfig(CreateMuteConfigRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
CreateMuteConfigRequest request =
CreateMuteConfigRequest.newBuilder()
.setParent(OrganizationName.of("[ORGANIZATION]").toString())
.setMuteConfig(MuteConfig.newBuilder().build())
.setMuteConfigId("muteConfigId1689669942")
.build();
MuteConfig response = securityCenterClient.createMuteConfig(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<CreateMuteConfigRequest,MuteConfig> createMuteConfigCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
CreateMuteConfigRequest request =
CreateMuteConfigRequest.newBuilder()
.setParent(OrganizationName.of("[ORGANIZATION]").toString())
.setMuteConfig(MuteConfig.newBuilder().build())
.setMuteConfigId("muteConfigId1689669942")
.build();
ApiFuture<MuteConfig> future =
securityCenterClient.createMuteConfigCallable().futureCall(request);
// Do something.
MuteConfig response = future.get();
}
public final NotificationConfig createNotificationConfig(OrganizationName parent, NotificationConfig notificationConfig)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
NotificationConfig notificationConfig = NotificationConfig.newBuilder().build();
NotificationConfig response =
securityCenterClient.createNotificationConfig(parent, notificationConfig);
}
parent
- Required. Resource name of the new notification config's parent. Its format is
"organizations/[organization_id]".notificationConfig
- Required. The notification config being created. The name and the
service account will be ignored as they are both output only fields on this resource.ApiException
- if the remote call failspublic final NotificationConfig createNotificationConfig(String parent, NotificationConfig notificationConfig)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
String parent = OrganizationName.of("[ORGANIZATION]").toString();
NotificationConfig notificationConfig = NotificationConfig.newBuilder().build();
NotificationConfig response =
securityCenterClient.createNotificationConfig(parent, notificationConfig);
}
parent
- Required. Resource name of the new notification config's parent. Its format is
"organizations/[organization_id]".notificationConfig
- Required. The notification config being created. The name and the
service account will be ignored as they are both output only fields on this resource.ApiException
- if the remote call failspublic final NotificationConfig createNotificationConfig(OrganizationName parent, String configId, NotificationConfig notificationConfig)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
String configId = "configId-580140035";
NotificationConfig notificationConfig = NotificationConfig.newBuilder().build();
NotificationConfig response =
securityCenterClient.createNotificationConfig(parent, configId, notificationConfig);
}
parent
- Required. Resource name of the new notification config's parent. Its format is
"organizations/[organization_id]".configId
- Required. Unique identifier provided by the client within the parent scope. It
must be between 1 and 128 characters, and contains alphanumeric characters, underscores or
hyphens only.notificationConfig
- Required. The notification config being created. The name and the
service account will be ignored as they are both output only fields on this resource.ApiException
- if the remote call failspublic final NotificationConfig createNotificationConfig(String parent, String configId, NotificationConfig notificationConfig)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
String parent = OrganizationName.of("[ORGANIZATION]").toString();
String configId = "configId-580140035";
NotificationConfig notificationConfig = NotificationConfig.newBuilder().build();
NotificationConfig response =
securityCenterClient.createNotificationConfig(parent, configId, notificationConfig);
}
parent
- Required. Resource name of the new notification config's parent. Its format is
"organizations/[organization_id]".configId
- Required. Unique identifier provided by the client within the parent scope. It
must be between 1 and 128 characters, and contains alphanumeric characters, underscores or
hyphens only.notificationConfig
- Required. The notification config being created. The name and the
service account will be ignored as they are both output only fields on this resource.ApiException
- if the remote call failspublic final NotificationConfig createNotificationConfig(CreateNotificationConfigRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
CreateNotificationConfigRequest request =
CreateNotificationConfigRequest.newBuilder()
.setParent(OrganizationName.of("[ORGANIZATION]").toString())
.setConfigId("configId-580140035")
.setNotificationConfig(NotificationConfig.newBuilder().build())
.build();
NotificationConfig response = securityCenterClient.createNotificationConfig(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<CreateNotificationConfigRequest,NotificationConfig> createNotificationConfigCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
CreateNotificationConfigRequest request =
CreateNotificationConfigRequest.newBuilder()
.setParent(OrganizationName.of("[ORGANIZATION]").toString())
.setConfigId("configId-580140035")
.setNotificationConfig(NotificationConfig.newBuilder().build())
.build();
ApiFuture<NotificationConfig> future =
securityCenterClient.createNotificationConfigCallable().futureCall(request);
// Do something.
NotificationConfig response = future.get();
}
public final void deleteMuteConfig(MuteConfigName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
MuteConfigName name =
MuteConfigName.ofOrganizationMuteConfigName("[ORGANIZATION]", "[MUTE_CONFIG]");
securityCenterClient.deleteMuteConfig(name);
}
name
- Required. Name of the mute config to delete. Its format is
organizations/{organization}/muteConfigs/{config_id},
folders/{folder}/muteConfigs/{config_id}, or projects/{project}/muteConfigs/{config_id}ApiException
- if the remote call failspublic final void deleteMuteConfig(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
String name =
MuteConfigName.ofOrganizationMuteConfigName("[ORGANIZATION]", "[MUTE_CONFIG]").toString();
securityCenterClient.deleteMuteConfig(name);
}
name
- Required. Name of the mute config to delete. Its format is
organizations/{organization}/muteConfigs/{config_id},
folders/{folder}/muteConfigs/{config_id}, or projects/{project}/muteConfigs/{config_id}ApiException
- if the remote call failspublic final void deleteMuteConfig(DeleteMuteConfigRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
DeleteMuteConfigRequest request =
DeleteMuteConfigRequest.newBuilder()
.setName(
MuteConfigName.ofOrganizationMuteConfigName("[ORGANIZATION]", "[MUTE_CONFIG]")
.toString())
.build();
securityCenterClient.deleteMuteConfig(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<DeleteMuteConfigRequest,Empty> deleteMuteConfigCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
DeleteMuteConfigRequest request =
DeleteMuteConfigRequest.newBuilder()
.setName(
MuteConfigName.ofOrganizationMuteConfigName("[ORGANIZATION]", "[MUTE_CONFIG]")
.toString())
.build();
ApiFuture<Empty> future = securityCenterClient.deleteMuteConfigCallable().futureCall(request);
// Do something.
future.get();
}
public final void deleteNotificationConfig(NotificationConfigName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
NotificationConfigName name =
NotificationConfigName.of("[ORGANIZATION]", "[NOTIFICATION_CONFIG]");
securityCenterClient.deleteNotificationConfig(name);
}
name
- Required. Name of the notification config to delete. Its format is
"organizations/[organization_id]/notificationConfigs/[config_id]".ApiException
- if the remote call failspublic final void deleteNotificationConfig(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
String name = NotificationConfigName.of("[ORGANIZATION]", "[NOTIFICATION_CONFIG]").toString();
securityCenterClient.deleteNotificationConfig(name);
}
name
- Required. Name of the notification config to delete. Its format is
"organizations/[organization_id]/notificationConfigs/[config_id]".ApiException
- if the remote call failspublic final void deleteNotificationConfig(DeleteNotificationConfigRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
DeleteNotificationConfigRequest request =
DeleteNotificationConfigRequest.newBuilder()
.setName(
NotificationConfigName.of("[ORGANIZATION]", "[NOTIFICATION_CONFIG]").toString())
.build();
securityCenterClient.deleteNotificationConfig(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<DeleteNotificationConfigRequest,Empty> deleteNotificationConfigCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
DeleteNotificationConfigRequest request =
DeleteNotificationConfigRequest.newBuilder()
.setName(
NotificationConfigName.of("[ORGANIZATION]", "[NOTIFICATION_CONFIG]").toString())
.build();
ApiFuture<Empty> future =
securityCenterClient.deleteNotificationConfigCallable().futureCall(request);
// Do something.
future.get();
}
public final BigQueryExport getBigQueryExport(BigQueryExportName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
BigQueryExportName name =
BigQueryExportName.ofOrganizationExportName("[ORGANIZATION]", "[EXPORT]");
BigQueryExport response = securityCenterClient.getBigQueryExport(name);
}
name
- Required. Name of the big query export to retrieve. Its format is
organizations/{organization}/bigQueryExports/{export_id},
folders/{folder}/bigQueryExports/{export_id}, or
projects/{project}/bigQueryExports/{export_id}ApiException
- if the remote call failspublic final BigQueryExport getBigQueryExport(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
String name =
BigQueryExportName.ofOrganizationExportName("[ORGANIZATION]", "[EXPORT]").toString();
BigQueryExport response = securityCenterClient.getBigQueryExport(name);
}
name
- Required. Name of the big query export to retrieve. Its format is
organizations/{organization}/bigQueryExports/{export_id},
folders/{folder}/bigQueryExports/{export_id}, or
projects/{project}/bigQueryExports/{export_id}ApiException
- if the remote call failspublic final BigQueryExport getBigQueryExport(GetBigQueryExportRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
GetBigQueryExportRequest request =
GetBigQueryExportRequest.newBuilder()
.setName(
BigQueryExportName.ofOrganizationExportName("[ORGANIZATION]", "[EXPORT]")
.toString())
.build();
BigQueryExport response = securityCenterClient.getBigQueryExport(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<GetBigQueryExportRequest,BigQueryExport> getBigQueryExportCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
GetBigQueryExportRequest request =
GetBigQueryExportRequest.newBuilder()
.setName(
BigQueryExportName.ofOrganizationExportName("[ORGANIZATION]", "[EXPORT]")
.toString())
.build();
ApiFuture<BigQueryExport> future =
securityCenterClient.getBigQueryExportCallable().futureCall(request);
// Do something.
BigQueryExport response = future.get();
}
public final com.google.iam.v1.Policy getIamPolicy(com.google.api.resourcenames.ResourceName resource)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
ResourceName resource = SourceName.ofOrganizationSourceName("[ORGANIZATION]", "[SOURCE]");
Policy response = securityCenterClient.getIamPolicy(resource);
}
resource
- REQUIRED: The resource for which the policy is being requested. See the
operation documentation for the appropriate value for this field.ApiException
- if the remote call failspublic final com.google.iam.v1.Policy getIamPolicy(String resource)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
String resource = FolderName.of("[FOLDER]").toString();
Policy response = securityCenterClient.getIamPolicy(resource);
}
resource
- REQUIRED: The resource for which the policy is being requested. See the
operation documentation for the appropriate value for this field.ApiException
- if the remote call failspublic final com.google.iam.v1.Policy getIamPolicy(com.google.iam.v1.GetIamPolicyRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
GetIamPolicyRequest request =
GetIamPolicyRequest.newBuilder()
.setResource(
SourceName.ofOrganizationSourceName("[ORGANIZATION]", "[SOURCE]").toString())
.setOptions(GetPolicyOptions.newBuilder().build())
.build();
Policy response = securityCenterClient.getIamPolicy(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.iam.v1.GetIamPolicyRequest,com.google.iam.v1.Policy> getIamPolicyCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
GetIamPolicyRequest request =
GetIamPolicyRequest.newBuilder()
.setResource(
SourceName.ofOrganizationSourceName("[ORGANIZATION]", "[SOURCE]").toString())
.setOptions(GetPolicyOptions.newBuilder().build())
.build();
ApiFuture<Policy> future = securityCenterClient.getIamPolicyCallable().futureCall(request);
// Do something.
Policy response = future.get();
}
public final MuteConfig getMuteConfig(MuteConfigName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
MuteConfigName name =
MuteConfigName.ofOrganizationMuteConfigName("[ORGANIZATION]", "[MUTE_CONFIG]");
MuteConfig response = securityCenterClient.getMuteConfig(name);
}
name
- Required. Name of the mute config to retrieve. Its format is
organizations/{organization}/muteConfigs/{config_id},
folders/{folder}/muteConfigs/{config_id}, or projects/{project}/muteConfigs/{config_id}ApiException
- if the remote call failspublic final MuteConfig getMuteConfig(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
String name =
MuteConfigName.ofOrganizationMuteConfigName("[ORGANIZATION]", "[MUTE_CONFIG]").toString();
MuteConfig response = securityCenterClient.getMuteConfig(name);
}
name
- Required. Name of the mute config to retrieve. Its format is
organizations/{organization}/muteConfigs/{config_id},
folders/{folder}/muteConfigs/{config_id}, or projects/{project}/muteConfigs/{config_id}ApiException
- if the remote call failspublic final MuteConfig getMuteConfig(GetMuteConfigRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
GetMuteConfigRequest request =
GetMuteConfigRequest.newBuilder()
.setName(
MuteConfigName.ofOrganizationMuteConfigName("[ORGANIZATION]", "[MUTE_CONFIG]")
.toString())
.build();
MuteConfig response = securityCenterClient.getMuteConfig(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<GetMuteConfigRequest,MuteConfig> getMuteConfigCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
GetMuteConfigRequest request =
GetMuteConfigRequest.newBuilder()
.setName(
MuteConfigName.ofOrganizationMuteConfigName("[ORGANIZATION]", "[MUTE_CONFIG]")
.toString())
.build();
ApiFuture<MuteConfig> future =
securityCenterClient.getMuteConfigCallable().futureCall(request);
// Do something.
MuteConfig response = future.get();
}
public final NotificationConfig getNotificationConfig(NotificationConfigName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
NotificationConfigName name =
NotificationConfigName.of("[ORGANIZATION]", "[NOTIFICATION_CONFIG]");
NotificationConfig response = securityCenterClient.getNotificationConfig(name);
}
name
- Required. Name of the notification config to get. Its format is
"organizations/[organization_id]/notificationConfigs/[config_id]".ApiException
- if the remote call failspublic final NotificationConfig getNotificationConfig(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
String name = NotificationConfigName.of("[ORGANIZATION]", "[NOTIFICATION_CONFIG]").toString();
NotificationConfig response = securityCenterClient.getNotificationConfig(name);
}
name
- Required. Name of the notification config to get. Its format is
"organizations/[organization_id]/notificationConfigs/[config_id]".ApiException
- if the remote call failspublic final NotificationConfig getNotificationConfig(GetNotificationConfigRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
GetNotificationConfigRequest request =
GetNotificationConfigRequest.newBuilder()
.setName(
NotificationConfigName.of("[ORGANIZATION]", "[NOTIFICATION_CONFIG]").toString())
.build();
NotificationConfig response = securityCenterClient.getNotificationConfig(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<GetNotificationConfigRequest,NotificationConfig> getNotificationConfigCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
GetNotificationConfigRequest request =
GetNotificationConfigRequest.newBuilder()
.setName(
NotificationConfigName.of("[ORGANIZATION]", "[NOTIFICATION_CONFIG]").toString())
.build();
ApiFuture<NotificationConfig> future =
securityCenterClient.getNotificationConfigCallable().futureCall(request);
// Do something.
NotificationConfig response = future.get();
}
public final OrganizationSettings getOrganizationSettings(OrganizationSettingsName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
OrganizationSettingsName name = OrganizationSettingsName.of("[ORGANIZATION]");
OrganizationSettings response = securityCenterClient.getOrganizationSettings(name);
}
name
- Required. Name of the organization to get organization settings for. Its format is
"organizations/[organization_id]/organizationSettings".ApiException
- if the remote call failspublic final OrganizationSettings getOrganizationSettings(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
String name = OrganizationSettingsName.of("[ORGANIZATION]").toString();
OrganizationSettings response = securityCenterClient.getOrganizationSettings(name);
}
name
- Required. Name of the organization to get organization settings for. Its format is
"organizations/[organization_id]/organizationSettings".ApiException
- if the remote call failspublic final OrganizationSettings getOrganizationSettings(GetOrganizationSettingsRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
GetOrganizationSettingsRequest request =
GetOrganizationSettingsRequest.newBuilder()
.setName(OrganizationSettingsName.of("[ORGANIZATION]").toString())
.build();
OrganizationSettings response = securityCenterClient.getOrganizationSettings(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<GetOrganizationSettingsRequest,OrganizationSettings> getOrganizationSettingsCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
GetOrganizationSettingsRequest request =
GetOrganizationSettingsRequest.newBuilder()
.setName(OrganizationSettingsName.of("[ORGANIZATION]").toString())
.build();
ApiFuture<OrganizationSettings> future =
securityCenterClient.getOrganizationSettingsCallable().futureCall(request);
// Do something.
OrganizationSettings response = future.get();
}
public final Source getSource(SourceName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
SourceName name = SourceName.ofOrganizationSourceName("[ORGANIZATION]", "[SOURCE]");
Source response = securityCenterClient.getSource(name);
}
name
- Required. Relative resource name of the source. Its format is
"organizations/[organization_id]/source/[source_id]".ApiException
- if the remote call failspublic final Source getSource(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
String name = SourceName.ofOrganizationSourceName("[ORGANIZATION]", "[SOURCE]").toString();
Source response = securityCenterClient.getSource(name);
}
name
- Required. Relative resource name of the source. Its format is
"organizations/[organization_id]/source/[source_id]".ApiException
- if the remote call failspublic final Source getSource(GetSourceRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
GetSourceRequest request =
GetSourceRequest.newBuilder()
.setName(SourceName.ofOrganizationSourceName("[ORGANIZATION]", "[SOURCE]").toString())
.build();
Source response = securityCenterClient.getSource(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<GetSourceRequest,Source> getSourceCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
GetSourceRequest request =
GetSourceRequest.newBuilder()
.setName(SourceName.ofOrganizationSourceName("[ORGANIZATION]", "[SOURCE]").toString())
.build();
ApiFuture<Source> future = securityCenterClient.getSourceCallable().futureCall(request);
// Do something.
Source response = future.get();
}
public final SecurityCenterClient.GroupAssetsPagedResponse groupAssets(GroupAssetsRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
GroupAssetsRequest request =
GroupAssetsRequest.newBuilder()
.setParent(OrganizationName.of("[ORGANIZATION]").toString())
.setFilter("filter-1274492040")
.setGroupBy("groupBy293428022")
.setCompareDuration(Duration.newBuilder().build())
.setReadTime(Timestamp.newBuilder().build())
.setPageToken("pageToken873572522")
.setPageSize(883849137)
.build();
for (GroupResult element : securityCenterClient.groupAssets(request).iterateAll()) {
// doThingsWith(element);
}
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<GroupAssetsRequest,SecurityCenterClient.GroupAssetsPagedResponse> groupAssetsPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
GroupAssetsRequest request =
GroupAssetsRequest.newBuilder()
.setParent(OrganizationName.of("[ORGANIZATION]").toString())
.setFilter("filter-1274492040")
.setGroupBy("groupBy293428022")
.setCompareDuration(Duration.newBuilder().build())
.setReadTime(Timestamp.newBuilder().build())
.setPageToken("pageToken873572522")
.setPageSize(883849137)
.build();
ApiFuture<GroupResult> future =
securityCenterClient.groupAssetsPagedCallable().futureCall(request);
// Do something.
for (GroupResult element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final UnaryCallable<GroupAssetsRequest,GroupAssetsResponse> groupAssetsCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
GroupAssetsRequest request =
GroupAssetsRequest.newBuilder()
.setParent(OrganizationName.of("[ORGANIZATION]").toString())
.setFilter("filter-1274492040")
.setGroupBy("groupBy293428022")
.setCompareDuration(Duration.newBuilder().build())
.setReadTime(Timestamp.newBuilder().build())
.setPageToken("pageToken873572522")
.setPageSize(883849137)
.build();
while (true) {
GroupAssetsResponse response = securityCenterClient.groupAssetsCallable().call(request);
for (GroupResult element : response.getGroupByResultsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final SecurityCenterClient.GroupFindingsPagedResponse groupFindings(SourceName parent, String groupBy)
To group across all sources provide a `-` as the source id. Example: /v1/organizations/{organization_id}/sources/-/findings, /v1/folders/{folder_id}/sources/-/findings, /v1/projects/{project_id}/sources/-/findings
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
SourceName parent = SourceName.ofOrganizationSourceName("[ORGANIZATION]", "[SOURCE]");
String groupBy = "groupBy293428022";
for (GroupResult element : securityCenterClient.groupFindings(parent, groupBy).iterateAll()) {
// doThingsWith(element);
}
}
parent
- Required. Name of the source to groupBy. Its format is
"organizations/[organization_id]/sources/[source_id]",
folders/[folder_id]/sources/[source_id], or projects/[project_id]/sources/[source_id]. To
groupBy across all sources provide a source_id of `-`. For example:
organizations/{organization_id}/sources/-, folders/{folder_id}/sources/-, or
projects/{project_id}/sources/-groupBy
- Required. Expression that defines what assets fields to use for grouping
(including `state_change`). The string value should follow SQL syntax: comma separated list
of fields. For example: "parent,resource_name".
The following fields are supported:
The following fields are supported when compare_duration is set:
ApiException
- if the remote call failspublic final SecurityCenterClient.GroupFindingsPagedResponse groupFindings(String parent, String groupBy)
To group across all sources provide a `-` as the source id. Example: /v1/organizations/{organization_id}/sources/-/findings, /v1/folders/{folder_id}/sources/-/findings, /v1/projects/{project_id}/sources/-/findings
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
String parent = SourceName.ofOrganizationSourceName("[ORGANIZATION]", "[SOURCE]").toString();
String groupBy = "groupBy293428022";
for (GroupResult element : securityCenterClient.groupFindings(parent, groupBy).iterateAll()) {
// doThingsWith(element);
}
}
parent
- Required. Name of the source to groupBy. Its format is
"organizations/[organization_id]/sources/[source_id]",
folders/[folder_id]/sources/[source_id], or projects/[project_id]/sources/[source_id]. To
groupBy across all sources provide a source_id of `-`. For example:
organizations/{organization_id}/sources/-, folders/{folder_id}/sources/-, or
projects/{project_id}/sources/-groupBy
- Required. Expression that defines what assets fields to use for grouping
(including `state_change`). The string value should follow SQL syntax: comma separated list
of fields. For example: "parent,resource_name".
The following fields are supported:
The following fields are supported when compare_duration is set:
ApiException
- if the remote call failspublic final SecurityCenterClient.GroupFindingsPagedResponse groupFindings(GroupFindingsRequest request)
To group across all sources provide a `-` as the source id. Example: /v1/organizations/{organization_id}/sources/-/findings, /v1/folders/{folder_id}/sources/-/findings, /v1/projects/{project_id}/sources/-/findings
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
GroupFindingsRequest request =
GroupFindingsRequest.newBuilder()
.setParent(
SourceName.ofOrganizationSourceName("[ORGANIZATION]", "[SOURCE]").toString())
.setFilter("filter-1274492040")
.setGroupBy("groupBy293428022")
.setReadTime(Timestamp.newBuilder().build())
.setCompareDuration(Duration.newBuilder().build())
.setPageToken("pageToken873572522")
.setPageSize(883849137)
.build();
for (GroupResult element : securityCenterClient.groupFindings(request).iterateAll()) {
// doThingsWith(element);
}
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<GroupFindingsRequest,SecurityCenterClient.GroupFindingsPagedResponse> groupFindingsPagedCallable()
To group across all sources provide a `-` as the source id. Example: /v1/organizations/{organization_id}/sources/-/findings, /v1/folders/{folder_id}/sources/-/findings, /v1/projects/{project_id}/sources/-/findings
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
GroupFindingsRequest request =
GroupFindingsRequest.newBuilder()
.setParent(
SourceName.ofOrganizationSourceName("[ORGANIZATION]", "[SOURCE]").toString())
.setFilter("filter-1274492040")
.setGroupBy("groupBy293428022")
.setReadTime(Timestamp.newBuilder().build())
.setCompareDuration(Duration.newBuilder().build())
.setPageToken("pageToken873572522")
.setPageSize(883849137)
.build();
ApiFuture<GroupResult> future =
securityCenterClient.groupFindingsPagedCallable().futureCall(request);
// Do something.
for (GroupResult element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final UnaryCallable<GroupFindingsRequest,GroupFindingsResponse> groupFindingsCallable()
To group across all sources provide a `-` as the source id. Example: /v1/organizations/{organization_id}/sources/-/findings, /v1/folders/{folder_id}/sources/-/findings, /v1/projects/{project_id}/sources/-/findings
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
GroupFindingsRequest request =
GroupFindingsRequest.newBuilder()
.setParent(
SourceName.ofOrganizationSourceName("[ORGANIZATION]", "[SOURCE]").toString())
.setFilter("filter-1274492040")
.setGroupBy("groupBy293428022")
.setReadTime(Timestamp.newBuilder().build())
.setCompareDuration(Duration.newBuilder().build())
.setPageToken("pageToken873572522")
.setPageSize(883849137)
.build();
while (true) {
GroupFindingsResponse response = securityCenterClient.groupFindingsCallable().call(request);
for (GroupResult element : response.getGroupByResultsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final SecurityCenterClient.ListAssetsPagedResponse listAssets(ListAssetsRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
ListAssetsRequest request =
ListAssetsRequest.newBuilder()
.setParent(OrganizationName.of("[ORGANIZATION]").toString())
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.setReadTime(Timestamp.newBuilder().build())
.setCompareDuration(Duration.newBuilder().build())
.setFieldMask(FieldMask.newBuilder().build())
.setPageToken("pageToken873572522")
.setPageSize(883849137)
.build();
for (ListAssetsResponse.ListAssetsResult element :
securityCenterClient.listAssets(request).iterateAll()) {
// doThingsWith(element);
}
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<ListAssetsRequest,SecurityCenterClient.ListAssetsPagedResponse> listAssetsPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
ListAssetsRequest request =
ListAssetsRequest.newBuilder()
.setParent(OrganizationName.of("[ORGANIZATION]").toString())
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.setReadTime(Timestamp.newBuilder().build())
.setCompareDuration(Duration.newBuilder().build())
.setFieldMask(FieldMask.newBuilder().build())
.setPageToken("pageToken873572522")
.setPageSize(883849137)
.build();
ApiFuture<ListAssetsResponse.ListAssetsResult> future =
securityCenterClient.listAssetsPagedCallable().futureCall(request);
// Do something.
for (ListAssetsResponse.ListAssetsResult element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final UnaryCallable<ListAssetsRequest,ListAssetsResponse> listAssetsCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
ListAssetsRequest request =
ListAssetsRequest.newBuilder()
.setParent(OrganizationName.of("[ORGANIZATION]").toString())
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.setReadTime(Timestamp.newBuilder().build())
.setCompareDuration(Duration.newBuilder().build())
.setFieldMask(FieldMask.newBuilder().build())
.setPageToken("pageToken873572522")
.setPageSize(883849137)
.build();
while (true) {
ListAssetsResponse response = securityCenterClient.listAssetsCallable().call(request);
for (ListAssetsResponse.ListAssetsResult element : response.getListAssetsResultsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final SecurityCenterClient.ListFindingsPagedResponse listFindings(ListFindingsRequest request)
To list across all sources provide a `-` as the source id. Example: /v1/organizations/{organization_id}/sources/-/findings
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
ListFindingsRequest request =
ListFindingsRequest.newBuilder()
.setParent(
SourceName.ofOrganizationSourceName("[ORGANIZATION]", "[SOURCE]").toString())
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.setReadTime(Timestamp.newBuilder().build())
.setCompareDuration(Duration.newBuilder().build())
.setFieldMask(FieldMask.newBuilder().build())
.setPageToken("pageToken873572522")
.setPageSize(883849137)
.build();
for (ListFindingsResponse.ListFindingsResult element :
securityCenterClient.listFindings(request).iterateAll()) {
// doThingsWith(element);
}
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<ListFindingsRequest,SecurityCenterClient.ListFindingsPagedResponse> listFindingsPagedCallable()
To list across all sources provide a `-` as the source id. Example: /v1/organizations/{organization_id}/sources/-/findings
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
ListFindingsRequest request =
ListFindingsRequest.newBuilder()
.setParent(
SourceName.ofOrganizationSourceName("[ORGANIZATION]", "[SOURCE]").toString())
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.setReadTime(Timestamp.newBuilder().build())
.setCompareDuration(Duration.newBuilder().build())
.setFieldMask(FieldMask.newBuilder().build())
.setPageToken("pageToken873572522")
.setPageSize(883849137)
.build();
ApiFuture<ListFindingsResponse.ListFindingsResult> future =
securityCenterClient.listFindingsPagedCallable().futureCall(request);
// Do something.
for (ListFindingsResponse.ListFindingsResult element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final UnaryCallable<ListFindingsRequest,ListFindingsResponse> listFindingsCallable()
To list across all sources provide a `-` as the source id. Example: /v1/organizations/{organization_id}/sources/-/findings
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
ListFindingsRequest request =
ListFindingsRequest.newBuilder()
.setParent(
SourceName.ofOrganizationSourceName("[ORGANIZATION]", "[SOURCE]").toString())
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.setReadTime(Timestamp.newBuilder().build())
.setCompareDuration(Duration.newBuilder().build())
.setFieldMask(FieldMask.newBuilder().build())
.setPageToken("pageToken873572522")
.setPageSize(883849137)
.build();
while (true) {
ListFindingsResponse response = securityCenterClient.listFindingsCallable().call(request);
for (ListFindingsResponse.ListFindingsResult element :
response.getListFindingsResultsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final SecurityCenterClient.ListMuteConfigsPagedResponse listMuteConfigs(FolderName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
FolderName parent = FolderName.of("[FOLDER]");
for (MuteConfig element : securityCenterClient.listMuteConfigs(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent
- Required. The parent, which owns the collection of mute configs. Its format is
"organizations/[organization_id]", "folders/[folder_id]", "projects/[project_id]".ApiException
- if the remote call failspublic final SecurityCenterClient.ListMuteConfigsPagedResponse listMuteConfigs(OrganizationName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
for (MuteConfig element : securityCenterClient.listMuteConfigs(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent
- Required. The parent, which owns the collection of mute configs. Its format is
"organizations/[organization_id]", "folders/[folder_id]", "projects/[project_id]".ApiException
- if the remote call failspublic final SecurityCenterClient.ListMuteConfigsPagedResponse listMuteConfigs(ProjectName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
for (MuteConfig element : securityCenterClient.listMuteConfigs(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent
- Required. The parent, which owns the collection of mute configs. Its format is
"organizations/[organization_id]", "folders/[folder_id]", "projects/[project_id]".ApiException
- if the remote call failspublic final SecurityCenterClient.ListMuteConfigsPagedResponse listMuteConfigs(String parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
String parent = OrganizationName.of("[ORGANIZATION]").toString();
for (MuteConfig element : securityCenterClient.listMuteConfigs(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent
- Required. The parent, which owns the collection of mute configs. Its format is
"organizations/[organization_id]", "folders/[folder_id]", "projects/[project_id]".ApiException
- if the remote call failspublic final SecurityCenterClient.ListMuteConfigsPagedResponse listMuteConfigs(ListMuteConfigsRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
ListMuteConfigsRequest request =
ListMuteConfigsRequest.newBuilder()
.setParent(OrganizationName.of("[ORGANIZATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (MuteConfig element : securityCenterClient.listMuteConfigs(request).iterateAll()) {
// doThingsWith(element);
}
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<ListMuteConfigsRequest,SecurityCenterClient.ListMuteConfigsPagedResponse> listMuteConfigsPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
ListMuteConfigsRequest request =
ListMuteConfigsRequest.newBuilder()
.setParent(OrganizationName.of("[ORGANIZATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<MuteConfig> future =
securityCenterClient.listMuteConfigsPagedCallable().futureCall(request);
// Do something.
for (MuteConfig element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final UnaryCallable<ListMuteConfigsRequest,ListMuteConfigsResponse> listMuteConfigsCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
ListMuteConfigsRequest request =
ListMuteConfigsRequest.newBuilder()
.setParent(OrganizationName.of("[ORGANIZATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
ListMuteConfigsResponse response =
securityCenterClient.listMuteConfigsCallable().call(request);
for (MuteConfig element : response.getMuteConfigsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final SecurityCenterClient.ListNotificationConfigsPagedResponse listNotificationConfigs(OrganizationName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
for (NotificationConfig element :
securityCenterClient.listNotificationConfigs(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent
- Required. Name of the organization to list notification configs. Its format is
"organizations/[organization_id]".ApiException
- if the remote call failspublic final SecurityCenterClient.ListNotificationConfigsPagedResponse listNotificationConfigs(String parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
String parent = OrganizationName.of("[ORGANIZATION]").toString();
for (NotificationConfig element :
securityCenterClient.listNotificationConfigs(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent
- Required. Name of the organization to list notification configs. Its format is
"organizations/[organization_id]".ApiException
- if the remote call failspublic final SecurityCenterClient.ListNotificationConfigsPagedResponse listNotificationConfigs(ListNotificationConfigsRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
ListNotificationConfigsRequest request =
ListNotificationConfigsRequest.newBuilder()
.setParent(OrganizationName.of("[ORGANIZATION]").toString())
.setPageToken("pageToken873572522")
.setPageSize(883849137)
.build();
for (NotificationConfig element :
securityCenterClient.listNotificationConfigs(request).iterateAll()) {
// doThingsWith(element);
}
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<ListNotificationConfigsRequest,SecurityCenterClient.ListNotificationConfigsPagedResponse> listNotificationConfigsPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
ListNotificationConfigsRequest request =
ListNotificationConfigsRequest.newBuilder()
.setParent(OrganizationName.of("[ORGANIZATION]").toString())
.setPageToken("pageToken873572522")
.setPageSize(883849137)
.build();
ApiFuture<NotificationConfig> future =
securityCenterClient.listNotificationConfigsPagedCallable().futureCall(request);
// Do something.
for (NotificationConfig element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final UnaryCallable<ListNotificationConfigsRequest,ListNotificationConfigsResponse> listNotificationConfigsCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
ListNotificationConfigsRequest request =
ListNotificationConfigsRequest.newBuilder()
.setParent(OrganizationName.of("[ORGANIZATION]").toString())
.setPageToken("pageToken873572522")
.setPageSize(883849137)
.build();
while (true) {
ListNotificationConfigsResponse response =
securityCenterClient.listNotificationConfigsCallable().call(request);
for (NotificationConfig element : response.getNotificationConfigsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final SecurityCenterClient.ListSourcesPagedResponse listSources(FolderName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
FolderName parent = FolderName.of("[FOLDER]");
for (Source element : securityCenterClient.listSources(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent
- Required. Resource name of the parent of sources to list. Its format should be
"organizations/[organization_id], folders/[folder_id], or projects/[project_id]".ApiException
- if the remote call failspublic final SecurityCenterClient.ListSourcesPagedResponse listSources(OrganizationName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
for (Source element : securityCenterClient.listSources(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent
- Required. Resource name of the parent of sources to list. Its format should be
"organizations/[organization_id], folders/[folder_id], or projects/[project_id]".ApiException
- if the remote call failspublic final SecurityCenterClient.ListSourcesPagedResponse listSources(ProjectName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
for (Source element : securityCenterClient.listSources(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent
- Required. Resource name of the parent of sources to list. Its format should be
"organizations/[organization_id], folders/[folder_id], or projects/[project_id]".ApiException
- if the remote call failspublic final SecurityCenterClient.ListSourcesPagedResponse listSources(String parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
String parent = OrganizationName.of("[ORGANIZATION]").toString();
for (Source element : securityCenterClient.listSources(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent
- Required. Resource name of the parent of sources to list. Its format should be
"organizations/[organization_id], folders/[folder_id], or projects/[project_id]".ApiException
- if the remote call failspublic final SecurityCenterClient.ListSourcesPagedResponse listSources(ListSourcesRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
ListSourcesRequest request =
ListSourcesRequest.newBuilder()
.setParent(OrganizationName.of("[ORGANIZATION]").toString())
.setPageToken("pageToken873572522")
.setPageSize(883849137)
.build();
for (Source element : securityCenterClient.listSources(request).iterateAll()) {
// doThingsWith(element);
}
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<ListSourcesRequest,SecurityCenterClient.ListSourcesPagedResponse> listSourcesPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
ListSourcesRequest request =
ListSourcesRequest.newBuilder()
.setParent(OrganizationName.of("[ORGANIZATION]").toString())
.setPageToken("pageToken873572522")
.setPageSize(883849137)
.build();
ApiFuture<Source> future =
securityCenterClient.listSourcesPagedCallable().futureCall(request);
// Do something.
for (Source element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final UnaryCallable<ListSourcesRequest,ListSourcesResponse> listSourcesCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
ListSourcesRequest request =
ListSourcesRequest.newBuilder()
.setParent(OrganizationName.of("[ORGANIZATION]").toString())
.setPageToken("pageToken873572522")
.setPageSize(883849137)
.build();
while (true) {
ListSourcesResponse response = securityCenterClient.listSourcesCallable().call(request);
for (Source element : response.getSourcesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final OperationFuture<RunAssetDiscoveryResponse,Empty> runAssetDiscoveryAsync(OrganizationName parent)
This API can only be called with limited frequency for an organization. If it is called too frequently the caller will receive a TOO_MANY_REQUESTS error.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
RunAssetDiscoveryResponse response =
securityCenterClient.runAssetDiscoveryAsync(parent).get();
}
parent
- Required. Name of the organization to run asset discovery for. Its format is
"organizations/[organization_id]".ApiException
- if the remote call failspublic final OperationFuture<RunAssetDiscoveryResponse,Empty> runAssetDiscoveryAsync(String parent)
This API can only be called with limited frequency for an organization. If it is called too frequently the caller will receive a TOO_MANY_REQUESTS error.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
String parent = OrganizationName.of("[ORGANIZATION]").toString();
RunAssetDiscoveryResponse response =
securityCenterClient.runAssetDiscoveryAsync(parent).get();
}
parent
- Required. Name of the organization to run asset discovery for. Its format is
"organizations/[organization_id]".ApiException
- if the remote call failspublic final OperationFuture<RunAssetDiscoveryResponse,Empty> runAssetDiscoveryAsync(RunAssetDiscoveryRequest request)
This API can only be called with limited frequency for an organization. If it is called too frequently the caller will receive a TOO_MANY_REQUESTS error.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
RunAssetDiscoveryRequest request =
RunAssetDiscoveryRequest.newBuilder()
.setParent(OrganizationName.of("[ORGANIZATION]").toString())
.build();
RunAssetDiscoveryResponse response =
securityCenterClient.runAssetDiscoveryAsync(request).get();
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final OperationCallable<RunAssetDiscoveryRequest,RunAssetDiscoveryResponse,Empty> runAssetDiscoveryOperationCallable()
This API can only be called with limited frequency for an organization. If it is called too frequently the caller will receive a TOO_MANY_REQUESTS error.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
RunAssetDiscoveryRequest request =
RunAssetDiscoveryRequest.newBuilder()
.setParent(OrganizationName.of("[ORGANIZATION]").toString())
.build();
OperationFuture<RunAssetDiscoveryResponse, Empty> future =
securityCenterClient.runAssetDiscoveryOperationCallable().futureCall(request);
// Do something.
RunAssetDiscoveryResponse response = future.get();
}
public final UnaryCallable<RunAssetDiscoveryRequest,Operation> runAssetDiscoveryCallable()
This API can only be called with limited frequency for an organization. If it is called too frequently the caller will receive a TOO_MANY_REQUESTS error.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
RunAssetDiscoveryRequest request =
RunAssetDiscoveryRequest.newBuilder()
.setParent(OrganizationName.of("[ORGANIZATION]").toString())
.build();
ApiFuture<Operation> future =
securityCenterClient.runAssetDiscoveryCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final Finding setFindingState(FindingName name, Finding.State state, Timestamp startTime)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
FindingName name =
FindingName.ofOrganizationSourceFindingName("[ORGANIZATION]", "[SOURCE]", "[FINDING]");
Finding.State state = Finding.State.forNumber(0);
Timestamp startTime = Timestamp.newBuilder().build();
Finding response = securityCenterClient.setFindingState(name, state, startTime);
}
name
- Required. The relative resource name of the finding. See:
https://cloud.google.com/apis/design/resource_names#relative_resource_name Example:
"organizations/{organization_id}/sources/{source_id}/finding/{finding_id}".state
- Required. The desired State of the finding.startTime
- Required. The time at which the updated state takes effect.ApiException
- if the remote call failspublic final Finding setFindingState(String name, Finding.State state, Timestamp startTime)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
String name =
FindingName.ofOrganizationSourceFindingName("[ORGANIZATION]", "[SOURCE]", "[FINDING]")
.toString();
Finding.State state = Finding.State.forNumber(0);
Timestamp startTime = Timestamp.newBuilder().build();
Finding response = securityCenterClient.setFindingState(name, state, startTime);
}
name
- Required. The relative resource name of the finding. See:
https://cloud.google.com/apis/design/resource_names#relative_resource_name Example:
"organizations/{organization_id}/sources/{source_id}/finding/{finding_id}".state
- Required. The desired State of the finding.startTime
- Required. The time at which the updated state takes effect.ApiException
- if the remote call failspublic final Finding setFindingState(SetFindingStateRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
SetFindingStateRequest request =
SetFindingStateRequest.newBuilder()
.setName(
FindingName.ofOrganizationSourceFindingName(
"[ORGANIZATION]", "[SOURCE]", "[FINDING]")
.toString())
.setStartTime(Timestamp.newBuilder().build())
.build();
Finding response = securityCenterClient.setFindingState(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<SetFindingStateRequest,Finding> setFindingStateCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
SetFindingStateRequest request =
SetFindingStateRequest.newBuilder()
.setName(
FindingName.ofOrganizationSourceFindingName(
"[ORGANIZATION]", "[SOURCE]", "[FINDING]")
.toString())
.setStartTime(Timestamp.newBuilder().build())
.build();
ApiFuture<Finding> future =
securityCenterClient.setFindingStateCallable().futureCall(request);
// Do something.
Finding response = future.get();
}
public final Finding setMute(FindingName name, Finding.Mute mute)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
FindingName name =
FindingName.ofOrganizationSourceFindingName("[ORGANIZATION]", "[SOURCE]", "[FINDING]");
Finding.Mute mute = Finding.Mute.forNumber(0);
Finding response = securityCenterClient.setMute(name, mute);
}
name
- Required. The relative resource name of the finding. See:
https://cloud.google.com/apis/design/resource_names#relative_resource_name Example:
"organizations/{organization_id}/sources/{source_id}/finding/{finding_id}",
"folders/{folder_id}/sources/{source_id}/finding/{finding_id}",
"projects/{project_id}/sources/{source_id}/finding/{finding_id}".mute
- Required. The desired state of the Mute.ApiException
- if the remote call failspublic final Finding setMute(String name, Finding.Mute mute)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
String name =
FindingName.ofOrganizationSourceFindingName("[ORGANIZATION]", "[SOURCE]", "[FINDING]")
.toString();
Finding.Mute mute = Finding.Mute.forNumber(0);
Finding response = securityCenterClient.setMute(name, mute);
}
name
- Required. The relative resource name of the finding. See:
https://cloud.google.com/apis/design/resource_names#relative_resource_name Example:
"organizations/{organization_id}/sources/{source_id}/finding/{finding_id}",
"folders/{folder_id}/sources/{source_id}/finding/{finding_id}",
"projects/{project_id}/sources/{source_id}/finding/{finding_id}".mute
- Required. The desired state of the Mute.ApiException
- if the remote call failspublic final Finding setMute(SetMuteRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
SetMuteRequest request =
SetMuteRequest.newBuilder()
.setName(
FindingName.ofOrganizationSourceFindingName(
"[ORGANIZATION]", "[SOURCE]", "[FINDING]")
.toString())
.build();
Finding response = securityCenterClient.setMute(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<SetMuteRequest,Finding> setMuteCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
SetMuteRequest request =
SetMuteRequest.newBuilder()
.setName(
FindingName.ofOrganizationSourceFindingName(
"[ORGANIZATION]", "[SOURCE]", "[FINDING]")
.toString())
.build();
ApiFuture<Finding> future = securityCenterClient.setMuteCallable().futureCall(request);
// Do something.
Finding response = future.get();
}
public final com.google.iam.v1.Policy setIamPolicy(com.google.api.resourcenames.ResourceName resource, com.google.iam.v1.Policy policy)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
ResourceName resource = SourceName.ofOrganizationSourceName("[ORGANIZATION]", "[SOURCE]");
Policy policy = Policy.newBuilder().build();
Policy response = securityCenterClient.setIamPolicy(resource, policy);
}
resource
- REQUIRED: The resource for which the policy is being specified. See the
operation documentation for the appropriate value for this field.policy
- REQUIRED: The complete policy to be applied to the `resource`. The size of the
policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud
Platform services (such as Projects) might reject them.ApiException
- if the remote call failspublic final com.google.iam.v1.Policy setIamPolicy(String resource, com.google.iam.v1.Policy policy)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
String resource = FolderName.of("[FOLDER]").toString();
Policy policy = Policy.newBuilder().build();
Policy response = securityCenterClient.setIamPolicy(resource, policy);
}
resource
- REQUIRED: The resource for which the policy is being specified. See the
operation documentation for the appropriate value for this field.policy
- REQUIRED: The complete policy to be applied to the `resource`. The size of the
policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud
Platform services (such as Projects) might reject them.ApiException
- if the remote call failspublic final com.google.iam.v1.Policy setIamPolicy(com.google.iam.v1.SetIamPolicyRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
SetIamPolicyRequest request =
SetIamPolicyRequest.newBuilder()
.setResource(
SourceName.ofOrganizationSourceName("[ORGANIZATION]", "[SOURCE]").toString())
.setPolicy(Policy.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
Policy response = securityCenterClient.setIamPolicy(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.iam.v1.SetIamPolicyRequest,com.google.iam.v1.Policy> setIamPolicyCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
SetIamPolicyRequest request =
SetIamPolicyRequest.newBuilder()
.setResource(
SourceName.ofOrganizationSourceName("[ORGANIZATION]", "[SOURCE]").toString())
.setPolicy(Policy.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
ApiFuture<Policy> future = securityCenterClient.setIamPolicyCallable().futureCall(request);
// Do something.
Policy response = future.get();
}
public final com.google.iam.v1.TestIamPermissionsResponse testIamPermissions(com.google.api.resourcenames.ResourceName resource, List<String> permissions)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
ResourceName resource = SourceName.ofOrganizationSourceName("[ORGANIZATION]", "[SOURCE]");
List<String> permissions = new ArrayList<>();
TestIamPermissionsResponse response =
securityCenterClient.testIamPermissions(resource, permissions);
}
resource
- REQUIRED: The resource for which the policy detail is being requested. See the
operation documentation for the appropriate value for this field.permissions
- The set of permissions to check for the `resource`. Permissions with
wildcards (such as '*' or 'storage.*') are not allowed. For more information see
[IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).ApiException
- if the remote call failspublic final com.google.iam.v1.TestIamPermissionsResponse testIamPermissions(String resource, List<String> permissions)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
String resource = FolderName.of("[FOLDER]").toString();
List<String> permissions = new ArrayList<>();
TestIamPermissionsResponse response =
securityCenterClient.testIamPermissions(resource, permissions);
}
resource
- REQUIRED: The resource for which the policy detail is being requested. See the
operation documentation for the appropriate value for this field.permissions
- The set of permissions to check for the `resource`. Permissions with
wildcards (such as '*' or 'storage.*') are not allowed. For more information see
[IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).ApiException
- if the remote call failspublic final com.google.iam.v1.TestIamPermissionsResponse testIamPermissions(com.google.iam.v1.TestIamPermissionsRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
TestIamPermissionsRequest request =
TestIamPermissionsRequest.newBuilder()
.setResource(
SourceName.ofOrganizationSourceName("[ORGANIZATION]", "[SOURCE]").toString())
.addAllPermissions(new ArrayList<String>())
.build();
TestIamPermissionsResponse response = securityCenterClient.testIamPermissions(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.iam.v1.TestIamPermissionsRequest,com.google.iam.v1.TestIamPermissionsResponse> testIamPermissionsCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
TestIamPermissionsRequest request =
TestIamPermissionsRequest.newBuilder()
.setResource(
SourceName.ofOrganizationSourceName("[ORGANIZATION]", "[SOURCE]").toString())
.addAllPermissions(new ArrayList<String>())
.build();
ApiFuture<TestIamPermissionsResponse> future =
securityCenterClient.testIamPermissionsCallable().futureCall(request);
// Do something.
TestIamPermissionsResponse response = future.get();
}
public final ExternalSystem updateExternalSystem(ExternalSystem externalSystem, FieldMask updateMask)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
ExternalSystem externalSystem = ExternalSystem.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
ExternalSystem response =
securityCenterClient.updateExternalSystem(externalSystem, updateMask);
}
externalSystem
- Required. The external system resource to update.updateMask
- The FieldMask to use when updating the external system resource.
If empty all mutable fields will be updated.
ApiException
- if the remote call failspublic final ExternalSystem updateExternalSystem(UpdateExternalSystemRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
UpdateExternalSystemRequest request =
UpdateExternalSystemRequest.newBuilder()
.setExternalSystem(ExternalSystem.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
ExternalSystem response = securityCenterClient.updateExternalSystem(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<UpdateExternalSystemRequest,ExternalSystem> updateExternalSystemCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
UpdateExternalSystemRequest request =
UpdateExternalSystemRequest.newBuilder()
.setExternalSystem(ExternalSystem.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
ApiFuture<ExternalSystem> future =
securityCenterClient.updateExternalSystemCallable().futureCall(request);
// Do something.
ExternalSystem response = future.get();
}
public final Finding updateFinding(Finding finding)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
Finding finding = Finding.newBuilder().build();
Finding response = securityCenterClient.updateFinding(finding);
}
finding
- Required. The finding resource to update or create if it does not already exist.
parent, security_marks, and update_time will be ignored.
In the case of creation, the finding id portion of the name must be alphanumeric and less than or equal to 32 characters and greater than 0 characters in length.
ApiException
- if the remote call failspublic final Finding updateFinding(UpdateFindingRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
UpdateFindingRequest request =
UpdateFindingRequest.newBuilder()
.setFinding(Finding.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
Finding response = securityCenterClient.updateFinding(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<UpdateFindingRequest,Finding> updateFindingCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
UpdateFindingRequest request =
UpdateFindingRequest.newBuilder()
.setFinding(Finding.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
ApiFuture<Finding> future = securityCenterClient.updateFindingCallable().futureCall(request);
// Do something.
Finding response = future.get();
}
public final MuteConfig updateMuteConfig(MuteConfig muteConfig, FieldMask updateMask)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
MuteConfig muteConfig = MuteConfig.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
MuteConfig response = securityCenterClient.updateMuteConfig(muteConfig, updateMask);
}
muteConfig
- Required. The mute config being updated.updateMask
- The list of fields to be updated. If empty all mutable fields will be
updated.ApiException
- if the remote call failspublic final MuteConfig updateMuteConfig(UpdateMuteConfigRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
UpdateMuteConfigRequest request =
UpdateMuteConfigRequest.newBuilder()
.setMuteConfig(MuteConfig.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
MuteConfig response = securityCenterClient.updateMuteConfig(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<UpdateMuteConfigRequest,MuteConfig> updateMuteConfigCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
UpdateMuteConfigRequest request =
UpdateMuteConfigRequest.newBuilder()
.setMuteConfig(MuteConfig.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
ApiFuture<MuteConfig> future =
securityCenterClient.updateMuteConfigCallable().futureCall(request);
// Do something.
MuteConfig response = future.get();
}
public final NotificationConfig updateNotificationConfig(NotificationConfig notificationConfig)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
NotificationConfig notificationConfig = NotificationConfig.newBuilder().build();
NotificationConfig response =
securityCenterClient.updateNotificationConfig(notificationConfig);
}
notificationConfig
- Required. The notification config to update.ApiException
- if the remote call failspublic final NotificationConfig updateNotificationConfig(NotificationConfig notificationConfig, FieldMask updateMask)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
NotificationConfig notificationConfig = NotificationConfig.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
NotificationConfig response =
securityCenterClient.updateNotificationConfig(notificationConfig, updateMask);
}
notificationConfig
- Required. The notification config to update.updateMask
- The FieldMask to use when updating the notification config.
If empty all mutable fields will be updated.
ApiException
- if the remote call failspublic final NotificationConfig updateNotificationConfig(UpdateNotificationConfigRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
UpdateNotificationConfigRequest request =
UpdateNotificationConfigRequest.newBuilder()
.setNotificationConfig(NotificationConfig.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
NotificationConfig response = securityCenterClient.updateNotificationConfig(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<UpdateNotificationConfigRequest,NotificationConfig> updateNotificationConfigCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
UpdateNotificationConfigRequest request =
UpdateNotificationConfigRequest.newBuilder()
.setNotificationConfig(NotificationConfig.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
ApiFuture<NotificationConfig> future =
securityCenterClient.updateNotificationConfigCallable().futureCall(request);
// Do something.
NotificationConfig response = future.get();
}
public final OrganizationSettings updateOrganizationSettings(OrganizationSettings organizationSettings)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
OrganizationSettings organizationSettings = OrganizationSettings.newBuilder().build();
OrganizationSettings response =
securityCenterClient.updateOrganizationSettings(organizationSettings);
}
organizationSettings
- Required. The organization settings resource to update.ApiException
- if the remote call failspublic final OrganizationSettings updateOrganizationSettings(UpdateOrganizationSettingsRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
UpdateOrganizationSettingsRequest request =
UpdateOrganizationSettingsRequest.newBuilder()
.setOrganizationSettings(OrganizationSettings.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
OrganizationSettings response = securityCenterClient.updateOrganizationSettings(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<UpdateOrganizationSettingsRequest,OrganizationSettings> updateOrganizationSettingsCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
UpdateOrganizationSettingsRequest request =
UpdateOrganizationSettingsRequest.newBuilder()
.setOrganizationSettings(OrganizationSettings.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
ApiFuture<OrganizationSettings> future =
securityCenterClient.updateOrganizationSettingsCallable().futureCall(request);
// Do something.
OrganizationSettings response = future.get();
}
public final Source updateSource(Source source)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
Source source = Source.newBuilder().build();
Source response = securityCenterClient.updateSource(source);
}
source
- Required. The source resource to update.ApiException
- if the remote call failspublic final Source updateSource(UpdateSourceRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
UpdateSourceRequest request =
UpdateSourceRequest.newBuilder()
.setSource(Source.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
Source response = securityCenterClient.updateSource(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<UpdateSourceRequest,Source> updateSourceCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
UpdateSourceRequest request =
UpdateSourceRequest.newBuilder()
.setSource(Source.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
ApiFuture<Source> future = securityCenterClient.updateSourceCallable().futureCall(request);
// Do something.
Source response = future.get();
}
public final SecurityMarks updateSecurityMarks(SecurityMarks securityMarks)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
SecurityMarks securityMarks = SecurityMarks.newBuilder().build();
SecurityMarks response = securityCenterClient.updateSecurityMarks(securityMarks);
}
securityMarks
- Required. The security marks resource to update.ApiException
- if the remote call failspublic final SecurityMarks updateSecurityMarks(UpdateSecurityMarksRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
UpdateSecurityMarksRequest request =
UpdateSecurityMarksRequest.newBuilder()
.setSecurityMarks(SecurityMarks.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.setStartTime(Timestamp.newBuilder().build())
.build();
SecurityMarks response = securityCenterClient.updateSecurityMarks(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<UpdateSecurityMarksRequest,SecurityMarks> updateSecurityMarksCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
UpdateSecurityMarksRequest request =
UpdateSecurityMarksRequest.newBuilder()
.setSecurityMarks(SecurityMarks.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.setStartTime(Timestamp.newBuilder().build())
.build();
ApiFuture<SecurityMarks> future =
securityCenterClient.updateSecurityMarksCallable().futureCall(request);
// Do something.
SecurityMarks response = future.get();
}
public final BigQueryExport createBigQueryExport(FolderName parent, BigQueryExport bigQueryExport, String bigQueryExportId)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
FolderName parent = FolderName.of("[FOLDER]");
BigQueryExport bigQueryExport = BigQueryExport.newBuilder().build();
String bigQueryExportId = "bigQueryExportId1024198583";
BigQueryExport response =
securityCenterClient.createBigQueryExport(parent, bigQueryExport, bigQueryExportId);
}
parent
- Required. Resource name of the new big query export's parent. Its format is
"organizations/[organization_id]", "folders/[folder_id]", or "projects/[project_id]".bigQueryExport
- Required. The big query export being created.bigQueryExportId
- Required. Unique identifier provided by the client within the parent
scope. It must consist of lower case letters, numbers, and hyphen, with the first character
a letter, the last a letter or a number, and a 63 character maximum.ApiException
- if the remote call failspublic final BigQueryExport createBigQueryExport(OrganizationName parent, BigQueryExport bigQueryExport, String bigQueryExportId)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
BigQueryExport bigQueryExport = BigQueryExport.newBuilder().build();
String bigQueryExportId = "bigQueryExportId1024198583";
BigQueryExport response =
securityCenterClient.createBigQueryExport(parent, bigQueryExport, bigQueryExportId);
}
parent
- Required. Resource name of the new big query export's parent. Its format is
"organizations/[organization_id]", "folders/[folder_id]", or "projects/[project_id]".bigQueryExport
- Required. The big query export being created.bigQueryExportId
- Required. Unique identifier provided by the client within the parent
scope. It must consist of lower case letters, numbers, and hyphen, with the first character
a letter, the last a letter or a number, and a 63 character maximum.ApiException
- if the remote call failspublic final BigQueryExport createBigQueryExport(ProjectName parent, BigQueryExport bigQueryExport, String bigQueryExportId)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
BigQueryExport bigQueryExport = BigQueryExport.newBuilder().build();
String bigQueryExportId = "bigQueryExportId1024198583";
BigQueryExport response =
securityCenterClient.createBigQueryExport(parent, bigQueryExport, bigQueryExportId);
}
parent
- Required. Resource name of the new big query export's parent. Its format is
"organizations/[organization_id]", "folders/[folder_id]", or "projects/[project_id]".bigQueryExport
- Required. The big query export being created.bigQueryExportId
- Required. Unique identifier provided by the client within the parent
scope. It must consist of lower case letters, numbers, and hyphen, with the first character
a letter, the last a letter or a number, and a 63 character maximum.ApiException
- if the remote call failspublic final BigQueryExport createBigQueryExport(String parent, BigQueryExport bigQueryExport, String bigQueryExportId)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
String parent = OrganizationName.of("[ORGANIZATION]").toString();
BigQueryExport bigQueryExport = BigQueryExport.newBuilder().build();
String bigQueryExportId = "bigQueryExportId1024198583";
BigQueryExport response =
securityCenterClient.createBigQueryExport(parent, bigQueryExport, bigQueryExportId);
}
parent
- Required. Resource name of the new big query export's parent. Its format is
"organizations/[organization_id]", "folders/[folder_id]", or "projects/[project_id]".bigQueryExport
- Required. The big query export being created.bigQueryExportId
- Required. Unique identifier provided by the client within the parent
scope. It must consist of lower case letters, numbers, and hyphen, with the first character
a letter, the last a letter or a number, and a 63 character maximum.ApiException
- if the remote call failspublic final BigQueryExport createBigQueryExport(CreateBigQueryExportRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
CreateBigQueryExportRequest request =
CreateBigQueryExportRequest.newBuilder()
.setParent(OrganizationName.of("[ORGANIZATION]").toString())
.setBigQueryExport(BigQueryExport.newBuilder().build())
.setBigQueryExportId("bigQueryExportId1024198583")
.build();
BigQueryExport response = securityCenterClient.createBigQueryExport(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<CreateBigQueryExportRequest,BigQueryExport> createBigQueryExportCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
CreateBigQueryExportRequest request =
CreateBigQueryExportRequest.newBuilder()
.setParent(OrganizationName.of("[ORGANIZATION]").toString())
.setBigQueryExport(BigQueryExport.newBuilder().build())
.setBigQueryExportId("bigQueryExportId1024198583")
.build();
ApiFuture<BigQueryExport> future =
securityCenterClient.createBigQueryExportCallable().futureCall(request);
// Do something.
BigQueryExport response = future.get();
}
public final void deleteBigQueryExport(BigQueryExportName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
BigQueryExportName name =
BigQueryExportName.ofOrganizationExportName("[ORGANIZATION]", "[EXPORT]");
securityCenterClient.deleteBigQueryExport(name);
}
name
- Required. Name of the big query export to delete. Its format is
organizations/{organization}/bigQueryExports/{export_id},
folders/{folder}/bigQueryExports/{export_id}, or
projects/{project}/bigQueryExports/{export_id}ApiException
- if the remote call failspublic final void deleteBigQueryExport(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
String name =
BigQueryExportName.ofOrganizationExportName("[ORGANIZATION]", "[EXPORT]").toString();
securityCenterClient.deleteBigQueryExport(name);
}
name
- Required. Name of the big query export to delete. Its format is
organizations/{organization}/bigQueryExports/{export_id},
folders/{folder}/bigQueryExports/{export_id}, or
projects/{project}/bigQueryExports/{export_id}ApiException
- if the remote call failspublic final void deleteBigQueryExport(DeleteBigQueryExportRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
DeleteBigQueryExportRequest request =
DeleteBigQueryExportRequest.newBuilder()
.setName(
BigQueryExportName.ofOrganizationExportName("[ORGANIZATION]", "[EXPORT]")
.toString())
.build();
securityCenterClient.deleteBigQueryExport(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<DeleteBigQueryExportRequest,Empty> deleteBigQueryExportCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
DeleteBigQueryExportRequest request =
DeleteBigQueryExportRequest.newBuilder()
.setName(
BigQueryExportName.ofOrganizationExportName("[ORGANIZATION]", "[EXPORT]")
.toString())
.build();
ApiFuture<Empty> future =
securityCenterClient.deleteBigQueryExportCallable().futureCall(request);
// Do something.
future.get();
}
public final BigQueryExport updateBigQueryExport(BigQueryExport bigQueryExport, FieldMask updateMask)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
BigQueryExport bigQueryExport = BigQueryExport.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
BigQueryExport response =
securityCenterClient.updateBigQueryExport(bigQueryExport, updateMask);
}
bigQueryExport
- Required. The BigQuery export being updated.updateMask
- The list of fields to be updated. If empty all mutable fields will be
updated.ApiException
- if the remote call failspublic final BigQueryExport updateBigQueryExport(UpdateBigQueryExportRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
UpdateBigQueryExportRequest request =
UpdateBigQueryExportRequest.newBuilder()
.setBigQueryExport(BigQueryExport.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
BigQueryExport response = securityCenterClient.updateBigQueryExport(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<UpdateBigQueryExportRequest,BigQueryExport> updateBigQueryExportCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
UpdateBigQueryExportRequest request =
UpdateBigQueryExportRequest.newBuilder()
.setBigQueryExport(BigQueryExport.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
ApiFuture<BigQueryExport> future =
securityCenterClient.updateBigQueryExportCallable().futureCall(request);
// Do something.
BigQueryExport response = future.get();
}
public final SecurityCenterClient.ListBigQueryExportsPagedResponse listBigQueryExports(FolderName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
FolderName parent = FolderName.of("[FOLDER]");
for (BigQueryExport element : securityCenterClient.listBigQueryExports(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent
- Required. The parent, which owns the collection of BigQuery exports. Its format
is "organizations/[organization_id]", "folders/[folder_id]", "projects/[project_id]".ApiException
- if the remote call failspublic final SecurityCenterClient.ListBigQueryExportsPagedResponse listBigQueryExports(OrganizationName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
for (BigQueryExport element : securityCenterClient.listBigQueryExports(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent
- Required. The parent, which owns the collection of BigQuery exports. Its format
is "organizations/[organization_id]", "folders/[folder_id]", "projects/[project_id]".ApiException
- if the remote call failspublic final SecurityCenterClient.ListBigQueryExportsPagedResponse listBigQueryExports(ProjectName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
for (BigQueryExport element : securityCenterClient.listBigQueryExports(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent
- Required. The parent, which owns the collection of BigQuery exports. Its format
is "organizations/[organization_id]", "folders/[folder_id]", "projects/[project_id]".ApiException
- if the remote call failspublic final SecurityCenterClient.ListBigQueryExportsPagedResponse listBigQueryExports(String parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
String parent = OrganizationName.of("[ORGANIZATION]").toString();
for (BigQueryExport element : securityCenterClient.listBigQueryExports(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent
- Required. The parent, which owns the collection of BigQuery exports. Its format
is "organizations/[organization_id]", "folders/[folder_id]", "projects/[project_id]".ApiException
- if the remote call failspublic final SecurityCenterClient.ListBigQueryExportsPagedResponse listBigQueryExports(ListBigQueryExportsRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
ListBigQueryExportsRequest request =
ListBigQueryExportsRequest.newBuilder()
.setParent(OrganizationName.of("[ORGANIZATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (BigQueryExport element :
securityCenterClient.listBigQueryExports(request).iterateAll()) {
// doThingsWith(element);
}
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<ListBigQueryExportsRequest,SecurityCenterClient.ListBigQueryExportsPagedResponse> listBigQueryExportsPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
ListBigQueryExportsRequest request =
ListBigQueryExportsRequest.newBuilder()
.setParent(OrganizationName.of("[ORGANIZATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<BigQueryExport> future =
securityCenterClient.listBigQueryExportsPagedCallable().futureCall(request);
// Do something.
for (BigQueryExport element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final UnaryCallable<ListBigQueryExportsRequest,ListBigQueryExportsResponse> listBigQueryExportsCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
ListBigQueryExportsRequest request =
ListBigQueryExportsRequest.newBuilder()
.setParent(OrganizationName.of("[ORGANIZATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
ListBigQueryExportsResponse response =
securityCenterClient.listBigQueryExportsCallable().call(request);
for (BigQueryExport element : response.getBigQueryExportsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final void close()
close
in interface AutoCloseable
public void shutdown()
shutdown
in interface BackgroundResource
public boolean isShutdown()
isShutdown
in interface BackgroundResource
public boolean isTerminated()
isTerminated
in interface BackgroundResource
public void shutdownNow()
shutdownNow
in interface BackgroundResource
public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException
awaitTermination
in interface BackgroundResource
InterruptedException
Copyright © 2022 Google LLC. All rights reserved.