Class OrganizationSecurityProfileGroupServiceClient
- All Implemented Interfaces:
BackgroundResource,AutoCloseable
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 (OrganizationSecurityProfileGroupServiceClient
organizationSecurityProfileGroupServiceClient =
OrganizationSecurityProfileGroupServiceClient.create()) {
SecurityProfileGroupName name =
SecurityProfileGroupName.ofOrganizationLocationSecurityProfileGroupName(
"[ORGANIZATION]", "[LOCATION]", "[SECURITY_PROFILE_GROUP]");
SecurityProfileGroup response =
organizationSecurityProfileGroupServiceClient.getSecurityProfileGroup(name);
}
Note: close() needs to be called on the OrganizationSecurityProfileGroupServiceClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().
| Method | Description | Method Variants |
|---|---|---|
ListSecurityProfileGroups |
Lists SecurityProfileGroups in a given organization and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetSecurityProfileGroup |
Gets details of a single SecurityProfileGroup. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CreateSecurityProfileGroup |
Creates a new SecurityProfileGroup in a given organization and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateSecurityProfileGroup |
Updates the parameters of a single SecurityProfileGroup. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteSecurityProfileGroup |
Deletes a single SecurityProfileGroup. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListSecurityProfiles |
Lists SecurityProfiles in a given organization and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetSecurityProfile |
Gets details of a single SecurityProfile. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CreateSecurityProfile |
Creates a new SecurityProfile in a given organization and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateSecurityProfile |
Updates the parameters of a single SecurityProfile. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteSecurityProfile |
Deletes a single SecurityProfile. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListLocations |
Lists information about the supported locations for this service. This method lists locations based on the resource scope provided inthe [ListLocationsRequest.name] field: * **Global locations**: If `name` is empty, the method lists thepublic locations available to all projects. * **Project-specificlocations**: If `name` follows the format`projects/{project}`, the method lists locations visible to thatspecific project. This includes public, private, or otherproject-specific locations enabled for the project. For gRPC and client library implementations, the resource name ispassed as the `name` field. For direct service calls, the resourcename isincorporated into the request path based on the specific serviceimplementation and version. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetLocation |
Gets information about a location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
SetIamPolicy |
Sets the access control policy on the specified resource. Replacesany existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetIamPolicy |
Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
TestIamPermissions |
Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a `NOT_FOUND` error. Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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 OrganizationSecurityProfileGroupServiceSettings 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
OrganizationSecurityProfileGroupServiceSettings
organizationSecurityProfileGroupServiceSettings =
OrganizationSecurityProfileGroupServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
OrganizationSecurityProfileGroupServiceClient organizationSecurityProfileGroupServiceClient =
OrganizationSecurityProfileGroupServiceClient.create(
organizationSecurityProfileGroupServiceSettings);
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
OrganizationSecurityProfileGroupServiceSettings
organizationSecurityProfileGroupServiceSettings =
OrganizationSecurityProfileGroupServiceSettings.newBuilder()
.setEndpoint(myEndpoint)
.build();
OrganizationSecurityProfileGroupServiceClient organizationSecurityProfileGroupServiceClient =
OrganizationSecurityProfileGroupServiceClient.create(
organizationSecurityProfileGroupServiceSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic class -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedOrganizationSecurityProfileGroupServiceClient(OrganizationSecurityProfileGroupServiceSettings settings) Constructs an instance of OrganizationSecurityProfileGroupServiceClient, using the given settings.protected -
Method Summary
Modifier and TypeMethodDescriptionbooleanawaitTermination(long duration, TimeUnit unit) final voidclose()static final OrganizationSecurityProfileGroupServiceClientcreate()Constructs an instance of OrganizationSecurityProfileGroupServiceClient with default settings.static final OrganizationSecurityProfileGroupServiceClientConstructs an instance of OrganizationSecurityProfileGroupServiceClient, using the given settings.static final OrganizationSecurityProfileGroupServiceClientConstructs an instance of OrganizationSecurityProfileGroupServiceClient, using the given stub for making calls.Creates a new SecurityProfile in a given organization and location.createSecurityProfileAsync(LocationName parent, SecurityProfile securityProfile, String securityProfileId) Creates a new SecurityProfile in a given organization and location.createSecurityProfileAsync(OrganizationLocationName parent, SecurityProfile securityProfile, String securityProfileId) Creates a new SecurityProfile in a given organization and location.createSecurityProfileAsync(String parent, SecurityProfile securityProfile, String securityProfileId) Creates a new SecurityProfile in a given organization and location.Creates a new SecurityProfile in a given organization and location.Creates a new SecurityProfileGroup in a given organization and location.createSecurityProfileGroupAsync(LocationName parent, SecurityProfileGroup securityProfileGroup, String securityProfileGroupId) Creates a new SecurityProfileGroup in a given organization and location.createSecurityProfileGroupAsync(OrganizationLocationName parent, SecurityProfileGroup securityProfileGroup, String securityProfileGroupId) Creates a new SecurityProfileGroup in a given organization and location.createSecurityProfileGroupAsync(String parent, SecurityProfileGroup securityProfileGroup, String securityProfileGroupId) Creates a new SecurityProfileGroup in a given organization and location.Creates a new SecurityProfileGroup in a given organization and location.Creates a new SecurityProfileGroup in a given organization and location.Creates a new SecurityProfile in a given organization and location.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single SecurityProfile.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single SecurityProfile.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single SecurityProfile.Deletes a single SecurityProfile.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single SecurityProfileGroup.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single SecurityProfileGroup.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single SecurityProfileGroup.Deletes a single SecurityProfileGroup.final OperationCallable<DeleteSecurityProfileGroupRequest,com.google.protobuf.Empty, OperationMetadata> Deletes a single SecurityProfileGroup.final OperationCallable<DeleteSecurityProfileRequest,com.google.protobuf.Empty, OperationMetadata> Deletes a single SecurityProfile.final PolicygetIamPolicy(GetIamPolicyRequest request) Gets the access control policy for a resource.Gets the access control policy for a resource.final LocationgetLocation(GetLocationRequest request) Gets information about a location.Gets information about a location.final OperationsClientReturns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.final SecurityProfileGets details of a single SecurityProfile.final SecurityProfileGets details of a single SecurityProfile.final SecurityProfilegetSecurityProfile(String name) Gets details of a single SecurityProfile.Gets details of a single SecurityProfile.final SecurityProfileGroupGets details of a single SecurityProfileGroup.final SecurityProfileGroupGets details of a single SecurityProfileGroup.final SecurityProfileGroupGets details of a single SecurityProfileGroup.Gets details of a single SecurityProfileGroup.getStub()booleanbooleanlistLocations(ListLocationsRequest request) Lists information about the supported locations for this service.Lists information about the supported locations for this service.final UnaryCallable<ListLocationsRequest,OrganizationSecurityProfileGroupServiceClient.ListLocationsPagedResponse> Lists information about the supported locations for this service.Lists SecurityProfileGroups in a given organization and location.Lists SecurityProfileGroups in a given organization and location.Lists SecurityProfileGroups in a given organization and location.listSecurityProfileGroups(String parent) Lists SecurityProfileGroups in a given organization and location.Lists SecurityProfileGroups in a given organization and location.final UnaryCallable<ListSecurityProfileGroupsRequest,OrganizationSecurityProfileGroupServiceClient.ListSecurityProfileGroupsPagedResponse> Lists SecurityProfileGroups in a given organization and location.Lists SecurityProfiles in a given organization and location.listSecurityProfiles(LocationName parent) Lists SecurityProfiles in a given organization and location.Lists SecurityProfiles in a given organization and location.listSecurityProfiles(String parent) Lists SecurityProfiles in a given organization and location.Lists SecurityProfiles in a given organization and location.final UnaryCallable<ListSecurityProfilesRequest,OrganizationSecurityProfileGroupServiceClient.ListSecurityProfilesPagedResponse> Lists SecurityProfiles in a given organization and location.final PolicysetIamPolicy(SetIamPolicyRequest request) Sets the access control policy on the specified resource.Sets the access control policy on the specified resource.voidshutdown()voidReturns permissions that a caller has on the specified resource.Returns permissions that a caller has on the specified resource.updateSecurityProfileAsync(SecurityProfile securityProfile, com.google.protobuf.FieldMask updateMask) Updates the parameters of a single SecurityProfile.Updates the parameters of a single SecurityProfile.Updates the parameters of a single SecurityProfile.updateSecurityProfileGroupAsync(SecurityProfileGroup securityProfileGroup, com.google.protobuf.FieldMask updateMask) Updates the parameters of a single SecurityProfileGroup.Updates the parameters of a single SecurityProfileGroup.Updates the parameters of a single SecurityProfileGroup.Updates the parameters of a single SecurityProfileGroup.Updates the parameters of a single SecurityProfile.
-
Constructor Details
-
OrganizationSecurityProfileGroupServiceClient
protected OrganizationSecurityProfileGroupServiceClient(OrganizationSecurityProfileGroupServiceSettings settings) throws IOException Constructs an instance of OrganizationSecurityProfileGroupServiceClient, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.- Throws:
IOException
-
OrganizationSecurityProfileGroupServiceClient
protected OrganizationSecurityProfileGroupServiceClient(OrganizationSecurityProfileGroupServiceStub stub)
-
-
Method Details
-
create
Constructs an instance of OrganizationSecurityProfileGroupServiceClient with default settings.- Throws:
IOException
-
create
public static final OrganizationSecurityProfileGroupServiceClient create(OrganizationSecurityProfileGroupServiceSettings settings) throws IOException Constructs an instance of OrganizationSecurityProfileGroupServiceClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.- Throws:
IOException
-
create
public static final OrganizationSecurityProfileGroupServiceClient create(OrganizationSecurityProfileGroupServiceStub stub) Constructs an instance of OrganizationSecurityProfileGroupServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(OrganizationSecurityProfileGroupServiceSettings). -
getSettings
-
getStub
-
getOperationsClient
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call. -
listSecurityProfileGroups
public final OrganizationSecurityProfileGroupServiceClient.ListSecurityProfileGroupsPagedResponse listSecurityProfileGroups(LocationName parent) Lists SecurityProfileGroups in a given organization and location.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 (OrganizationSecurityProfileGroupServiceClient organizationSecurityProfileGroupServiceClient = OrganizationSecurityProfileGroupServiceClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); for (SecurityProfileGroup element : organizationSecurityProfileGroupServiceClient .listSecurityProfileGroups(parent) .iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The project or organization and location from which the SecurityProfileGroups should be listed, specified in the format `projects|organizations/*/locations/{location}`.- Throws:
ApiException- if the remote call fails
-
listSecurityProfileGroups
public final OrganizationSecurityProfileGroupServiceClient.ListSecurityProfileGroupsPagedResponse listSecurityProfileGroups(OrganizationLocationName parent) Lists SecurityProfileGroups in a given organization and location.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 (OrganizationSecurityProfileGroupServiceClient organizationSecurityProfileGroupServiceClient = OrganizationSecurityProfileGroupServiceClient.create()) { OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]"); for (SecurityProfileGroup element : organizationSecurityProfileGroupServiceClient .listSecurityProfileGroups(parent) .iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The project or organization and location from which the SecurityProfileGroups should be listed, specified in the format `projects|organizations/*/locations/{location}`.- Throws:
ApiException- if the remote call fails
-
listSecurityProfileGroups
public final OrganizationSecurityProfileGroupServiceClient.ListSecurityProfileGroupsPagedResponse listSecurityProfileGroups(String parent) Lists SecurityProfileGroups in a given organization and location.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 (OrganizationSecurityProfileGroupServiceClient organizationSecurityProfileGroupServiceClient = OrganizationSecurityProfileGroupServiceClient.create()) { String parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]").toString(); for (SecurityProfileGroup element : organizationSecurityProfileGroupServiceClient .listSecurityProfileGroups(parent) .iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The project or organization and location from which the SecurityProfileGroups should be listed, specified in the format `projects|organizations/*/locations/{location}`.- Throws:
ApiException- if the remote call fails
-
listSecurityProfileGroups
public final OrganizationSecurityProfileGroupServiceClient.ListSecurityProfileGroupsPagedResponse listSecurityProfileGroups(ListSecurityProfileGroupsRequest request) Lists SecurityProfileGroups in a given organization and location.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 (OrganizationSecurityProfileGroupServiceClient organizationSecurityProfileGroupServiceClient = OrganizationSecurityProfileGroupServiceClient.create()) { ListSecurityProfileGroupsRequest request = ListSecurityProfileGroupsRequest.newBuilder() .setParent(OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (SecurityProfileGroup element : organizationSecurityProfileGroupServiceClient .listSecurityProfileGroups(request) .iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listSecurityProfileGroupsPagedCallable
public final UnaryCallable<ListSecurityProfileGroupsRequest,OrganizationSecurityProfileGroupServiceClient.ListSecurityProfileGroupsPagedResponse> listSecurityProfileGroupsPagedCallable()Lists SecurityProfileGroups in a given organization and location.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 (OrganizationSecurityProfileGroupServiceClient organizationSecurityProfileGroupServiceClient = OrganizationSecurityProfileGroupServiceClient.create()) { ListSecurityProfileGroupsRequest request = ListSecurityProfileGroupsRequest.newBuilder() .setParent(OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<SecurityProfileGroup> future = organizationSecurityProfileGroupServiceClient .listSecurityProfileGroupsPagedCallable() .futureCall(request); // Do something. for (SecurityProfileGroup element : future.get().iterateAll()) { // doThingsWith(element); } } -
listSecurityProfileGroupsCallable
public final UnaryCallable<ListSecurityProfileGroupsRequest,ListSecurityProfileGroupsResponse> listSecurityProfileGroupsCallable()Lists SecurityProfileGroups in a given organization and location.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 (OrganizationSecurityProfileGroupServiceClient organizationSecurityProfileGroupServiceClient = OrganizationSecurityProfileGroupServiceClient.create()) { ListSecurityProfileGroupsRequest request = ListSecurityProfileGroupsRequest.newBuilder() .setParent(OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListSecurityProfileGroupsResponse response = organizationSecurityProfileGroupServiceClient .listSecurityProfileGroupsCallable() .call(request); for (SecurityProfileGroup element : response.getSecurityProfileGroupsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
getSecurityProfileGroup
Gets details of a single SecurityProfileGroup.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 (OrganizationSecurityProfileGroupServiceClient organizationSecurityProfileGroupServiceClient = OrganizationSecurityProfileGroupServiceClient.create()) { SecurityProfileGroupName name = SecurityProfileGroupName.ofOrganizationLocationSecurityProfileGroupName( "[ORGANIZATION]", "[LOCATION]", "[SECURITY_PROFILE_GROUP]"); SecurityProfileGroup response = organizationSecurityProfileGroupServiceClient.getSecurityProfileGroup(name); }- Parameters:
name- Required. A name of the SecurityProfileGroup to get. Must be in the format `projects|organizations/*/locations/{location}/securityProfileGroups/{security_profile_group}`.- Throws:
ApiException- if the remote call fails
-
getSecurityProfileGroup
Gets details of a single SecurityProfileGroup.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 (OrganizationSecurityProfileGroupServiceClient organizationSecurityProfileGroupServiceClient = OrganizationSecurityProfileGroupServiceClient.create()) { String name = SecurityProfileGroupName.ofOrganizationLocationSecurityProfileGroupName( "[ORGANIZATION]", "[LOCATION]", "[SECURITY_PROFILE_GROUP]") .toString(); SecurityProfileGroup response = organizationSecurityProfileGroupServiceClient.getSecurityProfileGroup(name); }- Parameters:
name- Required. A name of the SecurityProfileGroup to get. Must be in the format `projects|organizations/*/locations/{location}/securityProfileGroups/{security_profile_group}`.- Throws:
ApiException- if the remote call fails
-
getSecurityProfileGroup
Gets details of a single SecurityProfileGroup.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 (OrganizationSecurityProfileGroupServiceClient organizationSecurityProfileGroupServiceClient = OrganizationSecurityProfileGroupServiceClient.create()) { GetSecurityProfileGroupRequest request = GetSecurityProfileGroupRequest.newBuilder() .setName( SecurityProfileGroupName.ofOrganizationLocationSecurityProfileGroupName( "[ORGANIZATION]", "[LOCATION]", "[SECURITY_PROFILE_GROUP]") .toString()) .build(); SecurityProfileGroup response = organizationSecurityProfileGroupServiceClient.getSecurityProfileGroup(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getSecurityProfileGroupCallable
public final UnaryCallable<GetSecurityProfileGroupRequest,SecurityProfileGroup> getSecurityProfileGroupCallable()Gets details of a single SecurityProfileGroup.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 (OrganizationSecurityProfileGroupServiceClient organizationSecurityProfileGroupServiceClient = OrganizationSecurityProfileGroupServiceClient.create()) { GetSecurityProfileGroupRequest request = GetSecurityProfileGroupRequest.newBuilder() .setName( SecurityProfileGroupName.ofOrganizationLocationSecurityProfileGroupName( "[ORGANIZATION]", "[LOCATION]", "[SECURITY_PROFILE_GROUP]") .toString()) .build(); ApiFuture<SecurityProfileGroup> future = organizationSecurityProfileGroupServiceClient .getSecurityProfileGroupCallable() .futureCall(request); // Do something. SecurityProfileGroup response = future.get(); } -
createSecurityProfileGroupAsync
public final OperationFuture<SecurityProfileGroup,OperationMetadata> createSecurityProfileGroupAsync(LocationName parent, SecurityProfileGroup securityProfileGroup, String securityProfileGroupId) Creates a new SecurityProfileGroup in a given organization and location.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 (OrganizationSecurityProfileGroupServiceClient organizationSecurityProfileGroupServiceClient = OrganizationSecurityProfileGroupServiceClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); SecurityProfileGroup securityProfileGroup = SecurityProfileGroup.newBuilder().build(); String securityProfileGroupId = "securityProfileGroupId-357991055"; SecurityProfileGroup response = organizationSecurityProfileGroupServiceClient .createSecurityProfileGroupAsync(parent, securityProfileGroup, securityProfileGroupId) .get(); }- Parameters:
parent- Required. The parent resource of the SecurityProfileGroup. Must be in the format `projects|organizations/*/locations/{location}`.securityProfileGroup- Required. SecurityProfileGroup resource to be created.securityProfileGroupId- Required. Short name of the SecurityProfileGroup resource to be created. This value should be 1-63 characters long, containing only letters, numbers, hyphens, and underscores, and should not start with a number. E.g. "security_profile_group1".- Throws:
ApiException- if the remote call fails
-
createSecurityProfileGroupAsync
public final OperationFuture<SecurityProfileGroup,OperationMetadata> createSecurityProfileGroupAsync(OrganizationLocationName parent, SecurityProfileGroup securityProfileGroup, String securityProfileGroupId) Creates a new SecurityProfileGroup in a given organization and location.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 (OrganizationSecurityProfileGroupServiceClient organizationSecurityProfileGroupServiceClient = OrganizationSecurityProfileGroupServiceClient.create()) { OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]"); SecurityProfileGroup securityProfileGroup = SecurityProfileGroup.newBuilder().build(); String securityProfileGroupId = "securityProfileGroupId-357991055"; SecurityProfileGroup response = organizationSecurityProfileGroupServiceClient .createSecurityProfileGroupAsync(parent, securityProfileGroup, securityProfileGroupId) .get(); }- Parameters:
parent- Required. The parent resource of the SecurityProfileGroup. Must be in the format `projects|organizations/*/locations/{location}`.securityProfileGroup- Required. SecurityProfileGroup resource to be created.securityProfileGroupId- Required. Short name of the SecurityProfileGroup resource to be created. This value should be 1-63 characters long, containing only letters, numbers, hyphens, and underscores, and should not start with a number. E.g. "security_profile_group1".- Throws:
ApiException- if the remote call fails
-
createSecurityProfileGroupAsync
public final OperationFuture<SecurityProfileGroup,OperationMetadata> createSecurityProfileGroupAsync(String parent, SecurityProfileGroup securityProfileGroup, String securityProfileGroupId) Creates a new SecurityProfileGroup in a given organization and location.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 (OrganizationSecurityProfileGroupServiceClient organizationSecurityProfileGroupServiceClient = OrganizationSecurityProfileGroupServiceClient.create()) { String parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]").toString(); SecurityProfileGroup securityProfileGroup = SecurityProfileGroup.newBuilder().build(); String securityProfileGroupId = "securityProfileGroupId-357991055"; SecurityProfileGroup response = organizationSecurityProfileGroupServiceClient .createSecurityProfileGroupAsync(parent, securityProfileGroup, securityProfileGroupId) .get(); }- Parameters:
parent- Required. The parent resource of the SecurityProfileGroup. Must be in the format `projects|organizations/*/locations/{location}`.securityProfileGroup- Required. SecurityProfileGroup resource to be created.securityProfileGroupId- Required. Short name of the SecurityProfileGroup resource to be created. This value should be 1-63 characters long, containing only letters, numbers, hyphens, and underscores, and should not start with a number. E.g. "security_profile_group1".- Throws:
ApiException- if the remote call fails
-
createSecurityProfileGroupAsync
public final OperationFuture<SecurityProfileGroup,OperationMetadata> createSecurityProfileGroupAsync(CreateSecurityProfileGroupRequest request) Creates a new SecurityProfileGroup in a given organization and location.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 (OrganizationSecurityProfileGroupServiceClient organizationSecurityProfileGroupServiceClient = OrganizationSecurityProfileGroupServiceClient.create()) { CreateSecurityProfileGroupRequest request = CreateSecurityProfileGroupRequest.newBuilder() .setParent(OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]").toString()) .setSecurityProfileGroupId("securityProfileGroupId-357991055") .setSecurityProfileGroup(SecurityProfileGroup.newBuilder().build()) .build(); SecurityProfileGroup response = organizationSecurityProfileGroupServiceClient .createSecurityProfileGroupAsync(request) .get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createSecurityProfileGroupOperationCallable
public final OperationCallable<CreateSecurityProfileGroupRequest,SecurityProfileGroup, createSecurityProfileGroupOperationCallable()OperationMetadata> Creates a new SecurityProfileGroup in a given organization and location.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 (OrganizationSecurityProfileGroupServiceClient organizationSecurityProfileGroupServiceClient = OrganizationSecurityProfileGroupServiceClient.create()) { CreateSecurityProfileGroupRequest request = CreateSecurityProfileGroupRequest.newBuilder() .setParent(OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]").toString()) .setSecurityProfileGroupId("securityProfileGroupId-357991055") .setSecurityProfileGroup(SecurityProfileGroup.newBuilder().build()) .build(); OperationFuture<SecurityProfileGroup, OperationMetadata> future = organizationSecurityProfileGroupServiceClient .createSecurityProfileGroupOperationCallable() .futureCall(request); // Do something. SecurityProfileGroup response = future.get(); } -
createSecurityProfileGroupCallable
public final UnaryCallable<CreateSecurityProfileGroupRequest,Operation> createSecurityProfileGroupCallable()Creates a new SecurityProfileGroup in a given organization and location.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 (OrganizationSecurityProfileGroupServiceClient organizationSecurityProfileGroupServiceClient = OrganizationSecurityProfileGroupServiceClient.create()) { CreateSecurityProfileGroupRequest request = CreateSecurityProfileGroupRequest.newBuilder() .setParent(OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]").toString()) .setSecurityProfileGroupId("securityProfileGroupId-357991055") .setSecurityProfileGroup(SecurityProfileGroup.newBuilder().build()) .build(); ApiFuture<Operation> future = organizationSecurityProfileGroupServiceClient .createSecurityProfileGroupCallable() .futureCall(request); // Do something. Operation response = future.get(); } -
updateSecurityProfileGroupAsync
public final OperationFuture<SecurityProfileGroup,OperationMetadata> updateSecurityProfileGroupAsync(SecurityProfileGroup securityProfileGroup, com.google.protobuf.FieldMask updateMask) Updates the parameters of a single SecurityProfileGroup.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 (OrganizationSecurityProfileGroupServiceClient organizationSecurityProfileGroupServiceClient = OrganizationSecurityProfileGroupServiceClient.create()) { SecurityProfileGroup securityProfileGroup = SecurityProfileGroup.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); SecurityProfileGroup response = organizationSecurityProfileGroupServiceClient .updateSecurityProfileGroupAsync(securityProfileGroup, updateMask) .get(); }- Parameters:
securityProfileGroup- Required. Updated SecurityProfileGroup resource.updateMask- Required. Field mask is used to specify the fields to be overwritten in the SecurityProfileGroup resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask.- Throws:
ApiException- if the remote call fails
-
updateSecurityProfileGroupAsync
public final OperationFuture<SecurityProfileGroup,OperationMetadata> updateSecurityProfileGroupAsync(UpdateSecurityProfileGroupRequest request) Updates the parameters of a single SecurityProfileGroup.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 (OrganizationSecurityProfileGroupServiceClient organizationSecurityProfileGroupServiceClient = OrganizationSecurityProfileGroupServiceClient.create()) { UpdateSecurityProfileGroupRequest request = UpdateSecurityProfileGroupRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setSecurityProfileGroup(SecurityProfileGroup.newBuilder().build()) .build(); SecurityProfileGroup response = organizationSecurityProfileGroupServiceClient .updateSecurityProfileGroupAsync(request) .get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateSecurityProfileGroupOperationCallable
public final OperationCallable<UpdateSecurityProfileGroupRequest,SecurityProfileGroup, updateSecurityProfileGroupOperationCallable()OperationMetadata> Updates the parameters of a single SecurityProfileGroup.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 (OrganizationSecurityProfileGroupServiceClient organizationSecurityProfileGroupServiceClient = OrganizationSecurityProfileGroupServiceClient.create()) { UpdateSecurityProfileGroupRequest request = UpdateSecurityProfileGroupRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setSecurityProfileGroup(SecurityProfileGroup.newBuilder().build()) .build(); OperationFuture<SecurityProfileGroup, OperationMetadata> future = organizationSecurityProfileGroupServiceClient .updateSecurityProfileGroupOperationCallable() .futureCall(request); // Do something. SecurityProfileGroup response = future.get(); } -
updateSecurityProfileGroupCallable
public final UnaryCallable<UpdateSecurityProfileGroupRequest,Operation> updateSecurityProfileGroupCallable()Updates the parameters of a single SecurityProfileGroup.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 (OrganizationSecurityProfileGroupServiceClient organizationSecurityProfileGroupServiceClient = OrganizationSecurityProfileGroupServiceClient.create()) { UpdateSecurityProfileGroupRequest request = UpdateSecurityProfileGroupRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setSecurityProfileGroup(SecurityProfileGroup.newBuilder().build()) .build(); ApiFuture<Operation> future = organizationSecurityProfileGroupServiceClient .updateSecurityProfileGroupCallable() .futureCall(request); // Do something. Operation response = future.get(); } -
deleteSecurityProfileGroupAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteSecurityProfileGroupAsync(SecurityProfileGroupName name) Deletes a single SecurityProfileGroup.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 (OrganizationSecurityProfileGroupServiceClient organizationSecurityProfileGroupServiceClient = OrganizationSecurityProfileGroupServiceClient.create()) { SecurityProfileGroupName name = SecurityProfileGroupName.ofOrganizationLocationSecurityProfileGroupName( "[ORGANIZATION]", "[LOCATION]", "[SECURITY_PROFILE_GROUP]"); organizationSecurityProfileGroupServiceClient.deleteSecurityProfileGroupAsync(name).get(); }- Parameters:
name- Required. A name of the SecurityProfileGroup to delete. Must be in the format `projects|organizations/*/locations/{location}/securityProfileGroups/{security_profile_group}`.- Throws:
ApiException- if the remote call fails
-
deleteSecurityProfileGroupAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteSecurityProfileGroupAsync(String name) Deletes a single SecurityProfileGroup.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 (OrganizationSecurityProfileGroupServiceClient organizationSecurityProfileGroupServiceClient = OrganizationSecurityProfileGroupServiceClient.create()) { String name = SecurityProfileGroupName.ofOrganizationLocationSecurityProfileGroupName( "[ORGANIZATION]", "[LOCATION]", "[SECURITY_PROFILE_GROUP]") .toString(); organizationSecurityProfileGroupServiceClient.deleteSecurityProfileGroupAsync(name).get(); }- Parameters:
name- Required. A name of the SecurityProfileGroup to delete. Must be in the format `projects|organizations/*/locations/{location}/securityProfileGroups/{security_profile_group}`.- Throws:
ApiException- if the remote call fails
-
deleteSecurityProfileGroupAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteSecurityProfileGroupAsync(DeleteSecurityProfileGroupRequest request) Deletes a single SecurityProfileGroup.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 (OrganizationSecurityProfileGroupServiceClient organizationSecurityProfileGroupServiceClient = OrganizationSecurityProfileGroupServiceClient.create()) { DeleteSecurityProfileGroupRequest request = DeleteSecurityProfileGroupRequest.newBuilder() .setName( SecurityProfileGroupName.ofOrganizationLocationSecurityProfileGroupName( "[ORGANIZATION]", "[LOCATION]", "[SECURITY_PROFILE_GROUP]") .toString()) .setEtag("etag3123477") .build(); organizationSecurityProfileGroupServiceClient.deleteSecurityProfileGroupAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteSecurityProfileGroupOperationCallable
public final OperationCallable<DeleteSecurityProfileGroupRequest,com.google.protobuf.Empty, deleteSecurityProfileGroupOperationCallable()OperationMetadata> Deletes a single SecurityProfileGroup.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 (OrganizationSecurityProfileGroupServiceClient organizationSecurityProfileGroupServiceClient = OrganizationSecurityProfileGroupServiceClient.create()) { DeleteSecurityProfileGroupRequest request = DeleteSecurityProfileGroupRequest.newBuilder() .setName( SecurityProfileGroupName.ofOrganizationLocationSecurityProfileGroupName( "[ORGANIZATION]", "[LOCATION]", "[SECURITY_PROFILE_GROUP]") .toString()) .setEtag("etag3123477") .build(); OperationFuture<Empty, OperationMetadata> future = organizationSecurityProfileGroupServiceClient .deleteSecurityProfileGroupOperationCallable() .futureCall(request); // Do something. future.get(); } -
deleteSecurityProfileGroupCallable
public final UnaryCallable<DeleteSecurityProfileGroupRequest,Operation> deleteSecurityProfileGroupCallable()Deletes a single SecurityProfileGroup.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 (OrganizationSecurityProfileGroupServiceClient organizationSecurityProfileGroupServiceClient = OrganizationSecurityProfileGroupServiceClient.create()) { DeleteSecurityProfileGroupRequest request = DeleteSecurityProfileGroupRequest.newBuilder() .setName( SecurityProfileGroupName.ofOrganizationLocationSecurityProfileGroupName( "[ORGANIZATION]", "[LOCATION]", "[SECURITY_PROFILE_GROUP]") .toString()) .setEtag("etag3123477") .build(); ApiFuture<Operation> future = organizationSecurityProfileGroupServiceClient .deleteSecurityProfileGroupCallable() .futureCall(request); // Do something. future.get(); } -
listSecurityProfiles
public final OrganizationSecurityProfileGroupServiceClient.ListSecurityProfilesPagedResponse listSecurityProfiles(LocationName parent) Lists SecurityProfiles in a given organization and location.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 (OrganizationSecurityProfileGroupServiceClient organizationSecurityProfileGroupServiceClient = OrganizationSecurityProfileGroupServiceClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); for (SecurityProfile element : organizationSecurityProfileGroupServiceClient.listSecurityProfiles(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The project or organization and location from which the SecurityProfiles should be listed, specified in the format `projects|organizations/*/locations/{location}`.- Throws:
ApiException- if the remote call fails
-
listSecurityProfiles
public final OrganizationSecurityProfileGroupServiceClient.ListSecurityProfilesPagedResponse listSecurityProfiles(OrganizationLocationName parent) Lists SecurityProfiles in a given organization and location.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 (OrganizationSecurityProfileGroupServiceClient organizationSecurityProfileGroupServiceClient = OrganizationSecurityProfileGroupServiceClient.create()) { OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]"); for (SecurityProfile element : organizationSecurityProfileGroupServiceClient.listSecurityProfiles(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The project or organization and location from which the SecurityProfiles should be listed, specified in the format `projects|organizations/*/locations/{location}`.- Throws:
ApiException- if the remote call fails
-
listSecurityProfiles
public final OrganizationSecurityProfileGroupServiceClient.ListSecurityProfilesPagedResponse listSecurityProfiles(String parent) Lists SecurityProfiles in a given organization and location.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 (OrganizationSecurityProfileGroupServiceClient organizationSecurityProfileGroupServiceClient = OrganizationSecurityProfileGroupServiceClient.create()) { String parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]").toString(); for (SecurityProfile element : organizationSecurityProfileGroupServiceClient.listSecurityProfiles(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The project or organization and location from which the SecurityProfiles should be listed, specified in the format `projects|organizations/*/locations/{location}`.- Throws:
ApiException- if the remote call fails
-
listSecurityProfiles
public final OrganizationSecurityProfileGroupServiceClient.ListSecurityProfilesPagedResponse listSecurityProfiles(ListSecurityProfilesRequest request) Lists SecurityProfiles in a given organization and location.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 (OrganizationSecurityProfileGroupServiceClient organizationSecurityProfileGroupServiceClient = OrganizationSecurityProfileGroupServiceClient.create()) { ListSecurityProfilesRequest request = ListSecurityProfilesRequest.newBuilder() .setParent(OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (SecurityProfile element : organizationSecurityProfileGroupServiceClient .listSecurityProfiles(request) .iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listSecurityProfilesPagedCallable
public final UnaryCallable<ListSecurityProfilesRequest,OrganizationSecurityProfileGroupServiceClient.ListSecurityProfilesPagedResponse> listSecurityProfilesPagedCallable()Lists SecurityProfiles in a given organization and location.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 (OrganizationSecurityProfileGroupServiceClient organizationSecurityProfileGroupServiceClient = OrganizationSecurityProfileGroupServiceClient.create()) { ListSecurityProfilesRequest request = ListSecurityProfilesRequest.newBuilder() .setParent(OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<SecurityProfile> future = organizationSecurityProfileGroupServiceClient .listSecurityProfilesPagedCallable() .futureCall(request); // Do something. for (SecurityProfile element : future.get().iterateAll()) { // doThingsWith(element); } } -
listSecurityProfilesCallable
public final UnaryCallable<ListSecurityProfilesRequest,ListSecurityProfilesResponse> listSecurityProfilesCallable()Lists SecurityProfiles in a given organization and location.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 (OrganizationSecurityProfileGroupServiceClient organizationSecurityProfileGroupServiceClient = OrganizationSecurityProfileGroupServiceClient.create()) { ListSecurityProfilesRequest request = ListSecurityProfilesRequest.newBuilder() .setParent(OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListSecurityProfilesResponse response = organizationSecurityProfileGroupServiceClient .listSecurityProfilesCallable() .call(request); for (SecurityProfile element : response.getSecurityProfilesList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
getSecurityProfile
Gets details of a single SecurityProfile.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 (OrganizationSecurityProfileGroupServiceClient organizationSecurityProfileGroupServiceClient = OrganizationSecurityProfileGroupServiceClient.create()) { SecurityProfileName name = SecurityProfileName.ofOrganizationLocationSecurityProfileName( "[ORGANIZATION]", "[LOCATION]", "[SECURITY_PROFILE]"); SecurityProfile response = organizationSecurityProfileGroupServiceClient.getSecurityProfile(name); }- Parameters:
name- Required. A name of the SecurityProfile to get. Must be in the format `projects|organizations/*/locations/{location}/securityProfiles/{security_profile_id}`.- Throws:
ApiException- if the remote call fails
-
getSecurityProfile
Gets details of a single SecurityProfile.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 (OrganizationSecurityProfileGroupServiceClient organizationSecurityProfileGroupServiceClient = OrganizationSecurityProfileGroupServiceClient.create()) { String name = SecurityProfileName.ofOrganizationLocationSecurityProfileName( "[ORGANIZATION]", "[LOCATION]", "[SECURITY_PROFILE]") .toString(); SecurityProfile response = organizationSecurityProfileGroupServiceClient.getSecurityProfile(name); }- Parameters:
name- Required. A name of the SecurityProfile to get. Must be in the format `projects|organizations/*/locations/{location}/securityProfiles/{security_profile_id}`.- Throws:
ApiException- if the remote call fails
-
getSecurityProfile
Gets details of a single SecurityProfile.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 (OrganizationSecurityProfileGroupServiceClient organizationSecurityProfileGroupServiceClient = OrganizationSecurityProfileGroupServiceClient.create()) { GetSecurityProfileRequest request = GetSecurityProfileRequest.newBuilder() .setName( SecurityProfileName.ofOrganizationLocationSecurityProfileName( "[ORGANIZATION]", "[LOCATION]", "[SECURITY_PROFILE]") .toString()) .build(); SecurityProfile response = organizationSecurityProfileGroupServiceClient.getSecurityProfile(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getSecurityProfileCallable
Gets details of a single SecurityProfile.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 (OrganizationSecurityProfileGroupServiceClient organizationSecurityProfileGroupServiceClient = OrganizationSecurityProfileGroupServiceClient.create()) { GetSecurityProfileRequest request = GetSecurityProfileRequest.newBuilder() .setName( SecurityProfileName.ofOrganizationLocationSecurityProfileName( "[ORGANIZATION]", "[LOCATION]", "[SECURITY_PROFILE]") .toString()) .build(); ApiFuture<SecurityProfile> future = organizationSecurityProfileGroupServiceClient .getSecurityProfileCallable() .futureCall(request); // Do something. SecurityProfile response = future.get(); } -
createSecurityProfileAsync
public final OperationFuture<SecurityProfile,OperationMetadata> createSecurityProfileAsync(LocationName parent, SecurityProfile securityProfile, String securityProfileId) Creates a new SecurityProfile in a given organization and location.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 (OrganizationSecurityProfileGroupServiceClient organizationSecurityProfileGroupServiceClient = OrganizationSecurityProfileGroupServiceClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); SecurityProfile securityProfile = SecurityProfile.newBuilder().build(); String securityProfileId = "securityProfileId-1121673916"; SecurityProfile response = organizationSecurityProfileGroupServiceClient .createSecurityProfileAsync(parent, securityProfile, securityProfileId) .get(); }- Parameters:
parent- Required. The parent resource of the SecurityProfile. Must be in the format `projects|organizations/*/locations/{location}`.securityProfile- Required. SecurityProfile resource to be created.securityProfileId- Required. Short name of the SecurityProfile resource to be created. This value should be 1-63 characters long, containing only letters, numbers, hyphens, and underscores, and should not start with a number. E.g. "security_profile1".- Throws:
ApiException- if the remote call fails
-
createSecurityProfileAsync
public final OperationFuture<SecurityProfile,OperationMetadata> createSecurityProfileAsync(OrganizationLocationName parent, SecurityProfile securityProfile, String securityProfileId) Creates a new SecurityProfile in a given organization and location.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 (OrganizationSecurityProfileGroupServiceClient organizationSecurityProfileGroupServiceClient = OrganizationSecurityProfileGroupServiceClient.create()) { OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]"); SecurityProfile securityProfile = SecurityProfile.newBuilder().build(); String securityProfileId = "securityProfileId-1121673916"; SecurityProfile response = organizationSecurityProfileGroupServiceClient .createSecurityProfileAsync(parent, securityProfile, securityProfileId) .get(); }- Parameters:
parent- Required. The parent resource of the SecurityProfile. Must be in the format `projects|organizations/*/locations/{location}`.securityProfile- Required. SecurityProfile resource to be created.securityProfileId- Required. Short name of the SecurityProfile resource to be created. This value should be 1-63 characters long, containing only letters, numbers, hyphens, and underscores, and should not start with a number. E.g. "security_profile1".- Throws:
ApiException- if the remote call fails
-
createSecurityProfileAsync
public final OperationFuture<SecurityProfile,OperationMetadata> createSecurityProfileAsync(String parent, SecurityProfile securityProfile, String securityProfileId) Creates a new SecurityProfile in a given organization and location.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 (OrganizationSecurityProfileGroupServiceClient organizationSecurityProfileGroupServiceClient = OrganizationSecurityProfileGroupServiceClient.create()) { String parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]").toString(); SecurityProfile securityProfile = SecurityProfile.newBuilder().build(); String securityProfileId = "securityProfileId-1121673916"; SecurityProfile response = organizationSecurityProfileGroupServiceClient .createSecurityProfileAsync(parent, securityProfile, securityProfileId) .get(); }- Parameters:
parent- Required. The parent resource of the SecurityProfile. Must be in the format `projects|organizations/*/locations/{location}`.securityProfile- Required. SecurityProfile resource to be created.securityProfileId- Required. Short name of the SecurityProfile resource to be created. This value should be 1-63 characters long, containing only letters, numbers, hyphens, and underscores, and should not start with a number. E.g. "security_profile1".- Throws:
ApiException- if the remote call fails
-
createSecurityProfileAsync
public final OperationFuture<SecurityProfile,OperationMetadata> createSecurityProfileAsync(CreateSecurityProfileRequest request) Creates a new SecurityProfile in a given organization and location.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 (OrganizationSecurityProfileGroupServiceClient organizationSecurityProfileGroupServiceClient = OrganizationSecurityProfileGroupServiceClient.create()) { CreateSecurityProfileRequest request = CreateSecurityProfileRequest.newBuilder() .setParent(OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]").toString()) .setSecurityProfileId("securityProfileId-1121673916") .setSecurityProfile(SecurityProfile.newBuilder().build()) .build(); SecurityProfile response = organizationSecurityProfileGroupServiceClient.createSecurityProfileAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createSecurityProfileOperationCallable
public final OperationCallable<CreateSecurityProfileRequest,SecurityProfile, createSecurityProfileOperationCallable()OperationMetadata> Creates a new SecurityProfile in a given organization and location.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 (OrganizationSecurityProfileGroupServiceClient organizationSecurityProfileGroupServiceClient = OrganizationSecurityProfileGroupServiceClient.create()) { CreateSecurityProfileRequest request = CreateSecurityProfileRequest.newBuilder() .setParent(OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]").toString()) .setSecurityProfileId("securityProfileId-1121673916") .setSecurityProfile(SecurityProfile.newBuilder().build()) .build(); OperationFuture<SecurityProfile, OperationMetadata> future = organizationSecurityProfileGroupServiceClient .createSecurityProfileOperationCallable() .futureCall(request); // Do something. SecurityProfile response = future.get(); } -
createSecurityProfileCallable
Creates a new SecurityProfile in a given organization and location.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 (OrganizationSecurityProfileGroupServiceClient organizationSecurityProfileGroupServiceClient = OrganizationSecurityProfileGroupServiceClient.create()) { CreateSecurityProfileRequest request = CreateSecurityProfileRequest.newBuilder() .setParent(OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]").toString()) .setSecurityProfileId("securityProfileId-1121673916") .setSecurityProfile(SecurityProfile.newBuilder().build()) .build(); ApiFuture<Operation> future = organizationSecurityProfileGroupServiceClient .createSecurityProfileCallable() .futureCall(request); // Do something. Operation response = future.get(); } -
updateSecurityProfileAsync
public final OperationFuture<SecurityProfile,OperationMetadata> updateSecurityProfileAsync(SecurityProfile securityProfile, com.google.protobuf.FieldMask updateMask) Updates the parameters of a single SecurityProfile.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 (OrganizationSecurityProfileGroupServiceClient organizationSecurityProfileGroupServiceClient = OrganizationSecurityProfileGroupServiceClient.create()) { SecurityProfile securityProfile = SecurityProfile.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); SecurityProfile response = organizationSecurityProfileGroupServiceClient .updateSecurityProfileAsync(securityProfile, updateMask) .get(); }- Parameters:
securityProfile- Required. Updated SecurityProfile resource.updateMask- Required. Field mask is used to specify the fields to be overwritten in the SecurityProfile resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask.- Throws:
ApiException- if the remote call fails
-
updateSecurityProfileAsync
public final OperationFuture<SecurityProfile,OperationMetadata> updateSecurityProfileAsync(UpdateSecurityProfileRequest request) Updates the parameters of a single SecurityProfile.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 (OrganizationSecurityProfileGroupServiceClient organizationSecurityProfileGroupServiceClient = OrganizationSecurityProfileGroupServiceClient.create()) { UpdateSecurityProfileRequest request = UpdateSecurityProfileRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setSecurityProfile(SecurityProfile.newBuilder().build()) .build(); SecurityProfile response = organizationSecurityProfileGroupServiceClient.updateSecurityProfileAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateSecurityProfileOperationCallable
public final OperationCallable<UpdateSecurityProfileRequest,SecurityProfile, updateSecurityProfileOperationCallable()OperationMetadata> Updates the parameters of a single SecurityProfile.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 (OrganizationSecurityProfileGroupServiceClient organizationSecurityProfileGroupServiceClient = OrganizationSecurityProfileGroupServiceClient.create()) { UpdateSecurityProfileRequest request = UpdateSecurityProfileRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setSecurityProfile(SecurityProfile.newBuilder().build()) .build(); OperationFuture<SecurityProfile, OperationMetadata> future = organizationSecurityProfileGroupServiceClient .updateSecurityProfileOperationCallable() .futureCall(request); // Do something. SecurityProfile response = future.get(); } -
updateSecurityProfileCallable
Updates the parameters of a single SecurityProfile.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 (OrganizationSecurityProfileGroupServiceClient organizationSecurityProfileGroupServiceClient = OrganizationSecurityProfileGroupServiceClient.create()) { UpdateSecurityProfileRequest request = UpdateSecurityProfileRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setSecurityProfile(SecurityProfile.newBuilder().build()) .build(); ApiFuture<Operation> future = organizationSecurityProfileGroupServiceClient .updateSecurityProfileCallable() .futureCall(request); // Do something. Operation response = future.get(); } -
deleteSecurityProfileAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteSecurityProfileAsync(SecurityProfileName name) Deletes a single SecurityProfile.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 (OrganizationSecurityProfileGroupServiceClient organizationSecurityProfileGroupServiceClient = OrganizationSecurityProfileGroupServiceClient.create()) { SecurityProfileName name = SecurityProfileName.ofOrganizationLocationSecurityProfileName( "[ORGANIZATION]", "[LOCATION]", "[SECURITY_PROFILE]"); organizationSecurityProfileGroupServiceClient.deleteSecurityProfileAsync(name).get(); }- Parameters:
name- Required. A name of the SecurityProfile to delete. Must be in the format `projects|organizations/*/locations/{location}/securityProfiles/{security_profile_id}`.- Throws:
ApiException- if the remote call fails
-
deleteSecurityProfileAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteSecurityProfileAsync(String name) Deletes a single SecurityProfile.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 (OrganizationSecurityProfileGroupServiceClient organizationSecurityProfileGroupServiceClient = OrganizationSecurityProfileGroupServiceClient.create()) { String name = SecurityProfileName.ofOrganizationLocationSecurityProfileName( "[ORGANIZATION]", "[LOCATION]", "[SECURITY_PROFILE]") .toString(); organizationSecurityProfileGroupServiceClient.deleteSecurityProfileAsync(name).get(); }- Parameters:
name- Required. A name of the SecurityProfile to delete. Must be in the format `projects|organizations/*/locations/{location}/securityProfiles/{security_profile_id}`.- Throws:
ApiException- if the remote call fails
-
deleteSecurityProfileAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteSecurityProfileAsync(DeleteSecurityProfileRequest request) Deletes a single SecurityProfile.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 (OrganizationSecurityProfileGroupServiceClient organizationSecurityProfileGroupServiceClient = OrganizationSecurityProfileGroupServiceClient.create()) { DeleteSecurityProfileRequest request = DeleteSecurityProfileRequest.newBuilder() .setName( SecurityProfileName.ofOrganizationLocationSecurityProfileName( "[ORGANIZATION]", "[LOCATION]", "[SECURITY_PROFILE]") .toString()) .setEtag("etag3123477") .build(); organizationSecurityProfileGroupServiceClient.deleteSecurityProfileAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteSecurityProfileOperationCallable
public final OperationCallable<DeleteSecurityProfileRequest,com.google.protobuf.Empty, deleteSecurityProfileOperationCallable()OperationMetadata> Deletes a single SecurityProfile.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 (OrganizationSecurityProfileGroupServiceClient organizationSecurityProfileGroupServiceClient = OrganizationSecurityProfileGroupServiceClient.create()) { DeleteSecurityProfileRequest request = DeleteSecurityProfileRequest.newBuilder() .setName( SecurityProfileName.ofOrganizationLocationSecurityProfileName( "[ORGANIZATION]", "[LOCATION]", "[SECURITY_PROFILE]") .toString()) .setEtag("etag3123477") .build(); OperationFuture<Empty, OperationMetadata> future = organizationSecurityProfileGroupServiceClient .deleteSecurityProfileOperationCallable() .futureCall(request); // Do something. future.get(); } -
deleteSecurityProfileCallable
Deletes a single SecurityProfile.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 (OrganizationSecurityProfileGroupServiceClient organizationSecurityProfileGroupServiceClient = OrganizationSecurityProfileGroupServiceClient.create()) { DeleteSecurityProfileRequest request = DeleteSecurityProfileRequest.newBuilder() .setName( SecurityProfileName.ofOrganizationLocationSecurityProfileName( "[ORGANIZATION]", "[LOCATION]", "[SECURITY_PROFILE]") .toString()) .setEtag("etag3123477") .build(); ApiFuture<Operation> future = organizationSecurityProfileGroupServiceClient .deleteSecurityProfileCallable() .futureCall(request); // Do something. future.get(); } -
listLocations
public final OrganizationSecurityProfileGroupServiceClient.ListLocationsPagedResponse listLocations(ListLocationsRequest request) Lists information about the supported locations for this service.This method lists locations based on the resource scope provided inthe [ListLocationsRequest.name] field:
* **Global locations**: If `name` is empty, the method lists thepublic locations available to all projects. * **Project-specificlocations**: If `name` follows the format`projects/{project}`, the method lists locations visible to thatspecific project. This includes public, private, or otherproject-specific locations enabled for the project.
For gRPC and client library implementations, the resource name ispassed as the `name` field. For direct service calls, the resourcename isincorporated into the request path based on the specific serviceimplementation and version.
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 (OrganizationSecurityProfileGroupServiceClient organizationSecurityProfileGroupServiceClient = OrganizationSecurityProfileGroupServiceClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (Location element : organizationSecurityProfileGroupServiceClient.listLocations(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listLocationsPagedCallable
public final UnaryCallable<ListLocationsRequest,OrganizationSecurityProfileGroupServiceClient.ListLocationsPagedResponse> listLocationsPagedCallable()Lists information about the supported locations for this service.This method lists locations based on the resource scope provided inthe [ListLocationsRequest.name] field:
* **Global locations**: If `name` is empty, the method lists thepublic locations available to all projects. * **Project-specificlocations**: If `name` follows the format`projects/{project}`, the method lists locations visible to thatspecific project. This includes public, private, or otherproject-specific locations enabled for the project.
For gRPC and client library implementations, the resource name ispassed as the `name` field. For direct service calls, the resourcename isincorporated into the request path based on the specific serviceimplementation and version.
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 (OrganizationSecurityProfileGroupServiceClient organizationSecurityProfileGroupServiceClient = OrganizationSecurityProfileGroupServiceClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<Location> future = organizationSecurityProfileGroupServiceClient .listLocationsPagedCallable() .futureCall(request); // Do something. for (Location element : future.get().iterateAll()) { // doThingsWith(element); } } -
listLocationsCallable
Lists information about the supported locations for this service.This method lists locations based on the resource scope provided inthe [ListLocationsRequest.name] field:
* **Global locations**: If `name` is empty, the method lists thepublic locations available to all projects. * **Project-specificlocations**: If `name` follows the format`projects/{project}`, the method lists locations visible to thatspecific project. This includes public, private, or otherproject-specific locations enabled for the project.
For gRPC and client library implementations, the resource name ispassed as the `name` field. For direct service calls, the resourcename isincorporated into the request path based on the specific serviceimplementation and version.
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 (OrganizationSecurityProfileGroupServiceClient organizationSecurityProfileGroupServiceClient = OrganizationSecurityProfileGroupServiceClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListLocationsResponse response = organizationSecurityProfileGroupServiceClient.listLocationsCallable().call(request); for (Location element : response.getLocationsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
getLocation
Gets information about a location.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 (OrganizationSecurityProfileGroupServiceClient organizationSecurityProfileGroupServiceClient = OrganizationSecurityProfileGroupServiceClient.create()) { GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); Location response = organizationSecurityProfileGroupServiceClient.getLocation(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getLocationCallable
Gets information about a location.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 (OrganizationSecurityProfileGroupServiceClient organizationSecurityProfileGroupServiceClient = OrganizationSecurityProfileGroupServiceClient.create()) { GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); ApiFuture<Location> future = organizationSecurityProfileGroupServiceClient.getLocationCallable().futureCall(request); // Do something. Location response = future.get(); } -
setIamPolicy
Sets the access control policy on the specified resource. Replacesany existing policy.Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.
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 (OrganizationSecurityProfileGroupServiceClient organizationSecurityProfileGroupServiceClient = OrganizationSecurityProfileGroupServiceClient.create()) { SetIamPolicyRequest request = SetIamPolicyRequest.newBuilder() .setResource( AddressGroupName.ofProjectLocationAddressGroupName( "[PROJECT]", "[LOCATION]", "[ADDRESS_GROUP]") .toString()) .setPolicy(Policy.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); Policy response = organizationSecurityProfileGroupServiceClient.setIamPolicy(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
setIamPolicyCallable
Sets the access control policy on the specified resource. Replacesany existing policy.Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.
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 (OrganizationSecurityProfileGroupServiceClient organizationSecurityProfileGroupServiceClient = OrganizationSecurityProfileGroupServiceClient.create()) { SetIamPolicyRequest request = SetIamPolicyRequest.newBuilder() .setResource( AddressGroupName.ofProjectLocationAddressGroupName( "[PROJECT]", "[LOCATION]", "[ADDRESS_GROUP]") .toString()) .setPolicy(Policy.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); ApiFuture<Policy> future = organizationSecurityProfileGroupServiceClient.setIamPolicyCallable().futureCall(request); // Do something. Policy response = future.get(); } -
getIamPolicy
Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.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 (OrganizationSecurityProfileGroupServiceClient organizationSecurityProfileGroupServiceClient = OrganizationSecurityProfileGroupServiceClient.create()) { GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder() .setResource( AddressGroupName.ofProjectLocationAddressGroupName( "[PROJECT]", "[LOCATION]", "[ADDRESS_GROUP]") .toString()) .setOptions(GetPolicyOptions.newBuilder().build()) .build(); Policy response = organizationSecurityProfileGroupServiceClient.getIamPolicy(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getIamPolicyCallable
Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.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 (OrganizationSecurityProfileGroupServiceClient organizationSecurityProfileGroupServiceClient = OrganizationSecurityProfileGroupServiceClient.create()) { GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder() .setResource( AddressGroupName.ofProjectLocationAddressGroupName( "[PROJECT]", "[LOCATION]", "[ADDRESS_GROUP]") .toString()) .setOptions(GetPolicyOptions.newBuilder().build()) .build(); ApiFuture<Policy> future = organizationSecurityProfileGroupServiceClient.getIamPolicyCallable().futureCall(request); // Do something. Policy response = future.get(); } -
testIamPermissions
Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a `NOT_FOUND` error.Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.
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 (OrganizationSecurityProfileGroupServiceClient organizationSecurityProfileGroupServiceClient = OrganizationSecurityProfileGroupServiceClient.create()) { TestIamPermissionsRequest request = TestIamPermissionsRequest.newBuilder() .setResource( AddressGroupName.ofProjectLocationAddressGroupName( "[PROJECT]", "[LOCATION]", "[ADDRESS_GROUP]") .toString()) .addAllPermissions(new ArrayList<String>()) .build(); TestIamPermissionsResponse response = organizationSecurityProfileGroupServiceClient.testIamPermissions(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
testIamPermissionsCallable
public final UnaryCallable<TestIamPermissionsRequest,TestIamPermissionsResponse> testIamPermissionsCallable()Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a `NOT_FOUND` error.Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.
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 (OrganizationSecurityProfileGroupServiceClient organizationSecurityProfileGroupServiceClient = OrganizationSecurityProfileGroupServiceClient.create()) { TestIamPermissionsRequest request = TestIamPermissionsRequest.newBuilder() .setResource( AddressGroupName.ofProjectLocationAddressGroupName( "[PROJECT]", "[LOCATION]", "[ADDRESS_GROUP]") .toString()) .addAllPermissions(new ArrayList<String>()) .build(); ApiFuture<TestIamPermissionsResponse> future = organizationSecurityProfileGroupServiceClient .testIamPermissionsCallable() .futureCall(request); // Do something. TestIamPermissionsResponse response = future.get(); } -
close
public final void close()- Specified by:
closein interfaceAutoCloseable
-
shutdown
public void shutdown()- Specified by:
shutdownin interfaceBackgroundResource
-
isShutdown
public boolean isShutdown()- Specified by:
isShutdownin interfaceBackgroundResource
-
isTerminated
public boolean isTerminated()- Specified by:
isTerminatedin interfaceBackgroundResource
-
shutdownNow
public void shutdownNow()- Specified by:
shutdownNowin interfaceBackgroundResource
-
awaitTermination
- Specified by:
awaitTerminationin interfaceBackgroundResource- Throws:
InterruptedException
-