@Generated(value="by gapic-generator-java") public class OrganizationSecurityPoliciesClient extends Object implements com.google.api.gax.core.BackgroundResource
This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (OrganizationSecurityPoliciesClient organizationSecurityPoliciesClient =
OrganizationSecurityPoliciesClient.create()) {
String securityPolicy = "securityPolicy-788621166";
SecurityPolicy response = organizationSecurityPoliciesClient.get(securityPolicy);
}
Note: close() needs to be called on the OrganizationSecurityPoliciesClient 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 |
|---|---|---|
AddAssociation |
Inserts an association for the specified security policy. This has billing implications. Projects in the hierarchy with effective hierarchical security policies will be automatically enrolled into Cloud Armor Enterprise if not already enrolled. Use of this API to modify firewall policies is deprecated. Use firewallPolicies.addAssociation instead if possible. |
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.
|
AddRule |
Inserts a rule into a security policy. |
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.
|
CopyRules |
Copies rules to the specified security policy. Use of this API to modify firewall policies is deprecated. Use firewallPolicies.copyRules instead. |
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.
|
Delete |
Deletes the specified policy. Use of this API to remove firewall policies is deprecated. Use firewallPolicies.delete instead. |
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.
|
Get |
List all of the ordered rules present in a single specified policy. Use of this API to read firewall policies is deprecated. Use firewallPolicies.get instead. |
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.
|
GetAssociation |
Gets an association with the specified name. Use of this API to read firewall policies is deprecated. Use firewallPolicies.getAssociation instead if possible. |
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.
|
GetRule |
Gets a rule at the specified priority. Use of this API to read firewall policies is deprecated. Use firewallPolicies.getRule instead. |
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.
|
Insert |
Creates a new policy in the specified project using the data included in the request. Use of this API to insert firewall policies is deprecated. Use firewallPolicies.insert instead. |
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.
|
List |
List all the policies that have been configured for the specified project. Use of this API to read firewall policies is deprecated. Use firewallPolicies.list instead. |
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.
|
ListAssociations |
Lists associations of a specified target, i.e., organization or folder. Use of this API to read firewall policies is deprecated. Use firewallPolicies.listAssociations instead if possible. |
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.
|
ListPreconfiguredExpressionSets |
Gets the current list of preconfigured Web Application Firewall (WAF) expressions. |
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.
|
Move |
Moves the specified security policy. Use of this API to modify firewall policies is deprecated. Use firewallPolicies.move instead. |
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.
|
Patch |
Patches the specified policy with the data included in the request. Use of this API to modify firewall policies is deprecated. Use firewallPolicies.patch instead. |
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.
|
PatchRule |
Patches a rule at the specified priority. Use of this API to modify firewall policies is deprecated. Use firewallPolicies.patchRule instead. |
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.
|
RemoveAssociation |
Removes an association for the specified security policy. Use of this API to modify firewall policies is deprecated. Use firewallPolicies.removeAssociation instead if possible. |
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.
|
RemoveRule |
Deletes a rule at the specified priority. |
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.
|
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 OrganizationSecurityPoliciesSettings 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
OrganizationSecurityPoliciesSettings organizationSecurityPoliciesSettings =
OrganizationSecurityPoliciesSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
OrganizationSecurityPoliciesClient organizationSecurityPoliciesClient =
OrganizationSecurityPoliciesClient.create(organizationSecurityPoliciesSettings);
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
OrganizationSecurityPoliciesSettings organizationSecurityPoliciesSettings =
OrganizationSecurityPoliciesSettings.newBuilder().setEndpoint(myEndpoint).build();
OrganizationSecurityPoliciesClient organizationSecurityPoliciesClient =
OrganizationSecurityPoliciesClient.create(organizationSecurityPoliciesSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
| Modifier and Type | Class and Description |
|---|---|
static class |
OrganizationSecurityPoliciesClient.ListFixedSizeCollection |
static class |
OrganizationSecurityPoliciesClient.ListPage |
static class |
OrganizationSecurityPoliciesClient.ListPagedResponse |
| Modifier | Constructor and Description |
|---|---|
protected |
OrganizationSecurityPoliciesClient(OrganizationSecurityPoliciesSettings settings)
Constructs an instance of OrganizationSecurityPoliciesClient, using the given settings.
|
protected |
OrganizationSecurityPoliciesClient(OrganizationSecurityPoliciesStub stub) |
| Modifier and Type | Method and Description |
|---|---|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
addAssociationAsync(AddAssociationOrganizationSecurityPolicyRequest request)
Inserts an association for the specified security policy.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
addAssociationAsync(String securityPolicy,
SecurityPolicyAssociation securityPolicyAssociationResource)
Inserts an association for the specified security policy.
|
com.google.api.gax.rpc.UnaryCallable<AddAssociationOrganizationSecurityPolicyRequest,Operation> |
addAssociationCallable()
Inserts an association for the specified security policy.
|
com.google.api.gax.rpc.OperationCallable<AddAssociationOrganizationSecurityPolicyRequest,Operation,Operation> |
addAssociationOperationCallable()
Inserts an association for the specified security policy.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
addRuleAsync(AddRuleOrganizationSecurityPolicyRequest request)
Inserts a rule into a security policy.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
addRuleAsync(String securityPolicy,
SecurityPolicyRule securityPolicyRuleResource)
Inserts a rule into a security policy.
|
com.google.api.gax.rpc.UnaryCallable<AddRuleOrganizationSecurityPolicyRequest,Operation> |
addRuleCallable()
Inserts a rule into a security policy.
|
com.google.api.gax.rpc.OperationCallable<AddRuleOrganizationSecurityPolicyRequest,Operation,Operation> |
addRuleOperationCallable()
Inserts a rule into a security policy.
|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
void |
close() |
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
copyRulesAsync(CopyRulesOrganizationSecurityPolicyRequest request)
Copies rules to the specified security policy.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
copyRulesAsync(String securityPolicy)
Copies rules to the specified security policy.
|
com.google.api.gax.rpc.UnaryCallable<CopyRulesOrganizationSecurityPolicyRequest,Operation> |
copyRulesCallable()
Copies rules to the specified security policy.
|
com.google.api.gax.rpc.OperationCallable<CopyRulesOrganizationSecurityPolicyRequest,Operation,Operation> |
copyRulesOperationCallable()
Copies rules to the specified security policy.
|
static OrganizationSecurityPoliciesClient |
create()
Constructs an instance of OrganizationSecurityPoliciesClient with default settings.
|
static OrganizationSecurityPoliciesClient |
create(OrganizationSecurityPoliciesSettings settings)
Constructs an instance of OrganizationSecurityPoliciesClient, using the given settings.
|
static OrganizationSecurityPoliciesClient |
create(OrganizationSecurityPoliciesStub stub)
Constructs an instance of OrganizationSecurityPoliciesClient, using the given stub for making
calls.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
deleteAsync(DeleteOrganizationSecurityPolicyRequest request)
Deletes the specified policy.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
deleteAsync(String securityPolicy)
Deletes the specified policy.
|
com.google.api.gax.rpc.UnaryCallable<DeleteOrganizationSecurityPolicyRequest,Operation> |
deleteCallable()
Deletes the specified policy.
|
com.google.api.gax.rpc.OperationCallable<DeleteOrganizationSecurityPolicyRequest,Operation,Operation> |
deleteOperationCallable()
Deletes the specified policy.
|
SecurityPolicy |
get(GetOrganizationSecurityPolicyRequest request)
List all of the ordered rules present in a single specified policy.
|
SecurityPolicy |
get(String securityPolicy)
List all of the ordered rules present in a single specified policy.
|
SecurityPolicyAssociation |
getAssociation(GetAssociationOrganizationSecurityPolicyRequest request)
Gets an association with the specified name.
|
SecurityPolicyAssociation |
getAssociation(String securityPolicy)
Gets an association with the specified name.
|
com.google.api.gax.rpc.UnaryCallable<GetAssociationOrganizationSecurityPolicyRequest,SecurityPolicyAssociation> |
getAssociationCallable()
Gets an association with the specified name.
|
com.google.api.gax.rpc.UnaryCallable<GetOrganizationSecurityPolicyRequest,SecurityPolicy> |
getCallable()
List all of the ordered rules present in a single specified policy.
|
SecurityPolicyRule |
getRule(GetRuleOrganizationSecurityPolicyRequest request)
Gets a rule at the specified priority.
|
SecurityPolicyRule |
getRule(String securityPolicy)
Gets a rule at the specified priority.
|
com.google.api.gax.rpc.UnaryCallable<GetRuleOrganizationSecurityPolicyRequest,SecurityPolicyRule> |
getRuleCallable()
Gets a rule at the specified priority.
|
OrganizationSecurityPoliciesSettings |
getSettings() |
OrganizationSecurityPoliciesStub |
getStub() |
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
insertAsync(InsertOrganizationSecurityPolicyRequest request)
Creates a new policy in the specified project using the data included in the request.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
insertAsync(SecurityPolicy securityPolicyResource)
Creates a new policy in the specified project using the data included in the request.
|
com.google.api.gax.rpc.UnaryCallable<InsertOrganizationSecurityPolicyRequest,Operation> |
insertCallable()
Creates a new policy in the specified project using the data included in the request.
|
com.google.api.gax.rpc.OperationCallable<InsertOrganizationSecurityPolicyRequest,Operation,Operation> |
insertOperationCallable()
Creates a new policy in the specified project using the data included in the request.
|
boolean |
isShutdown() |
boolean |
isTerminated() |
OrganizationSecurityPoliciesClient.ListPagedResponse |
list()
List all the policies that have been configured for the specified project.
|
OrganizationSecurityPoliciesClient.ListPagedResponse |
list(ListOrganizationSecurityPoliciesRequest request)
List all the policies that have been configured for the specified project.
|
OrganizationSecurityPoliciesListAssociationsResponse |
listAssociations()
Lists associations of a specified target, i.e., organization or folder.
|
OrganizationSecurityPoliciesListAssociationsResponse |
listAssociations(ListAssociationsOrganizationSecurityPolicyRequest request)
Lists associations of a specified target, i.e., organization or folder.
|
com.google.api.gax.rpc.UnaryCallable<ListAssociationsOrganizationSecurityPolicyRequest,OrganizationSecurityPoliciesListAssociationsResponse> |
listAssociationsCallable()
Lists associations of a specified target, i.e., organization or folder.
|
com.google.api.gax.rpc.UnaryCallable<ListOrganizationSecurityPoliciesRequest,SecurityPolicyList> |
listCallable()
List all the policies that have been configured for the specified project.
|
com.google.api.gax.rpc.UnaryCallable<ListOrganizationSecurityPoliciesRequest,OrganizationSecurityPoliciesClient.ListPagedResponse> |
listPagedCallable()
List all the policies that have been configured for the specified project.
|
SecurityPoliciesListPreconfiguredExpressionSetsResponse |
listPreconfiguredExpressionSets()
Gets the current list of preconfigured Web Application Firewall (WAF) expressions.
|
SecurityPoliciesListPreconfiguredExpressionSetsResponse |
listPreconfiguredExpressionSets(ListPreconfiguredExpressionSetsOrganizationSecurityPoliciesRequest request)
Gets the current list of preconfigured Web Application Firewall (WAF) expressions.
|
com.google.api.gax.rpc.UnaryCallable<ListPreconfiguredExpressionSetsOrganizationSecurityPoliciesRequest,SecurityPoliciesListPreconfiguredExpressionSetsResponse> |
listPreconfiguredExpressionSetsCallable()
Gets the current list of preconfigured Web Application Firewall (WAF) expressions.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
moveAsync(MoveOrganizationSecurityPolicyRequest request)
Moves the specified security policy.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
moveAsync(String securityPolicy)
Moves the specified security policy.
|
com.google.api.gax.rpc.UnaryCallable<MoveOrganizationSecurityPolicyRequest,Operation> |
moveCallable()
Moves the specified security policy.
|
com.google.api.gax.rpc.OperationCallable<MoveOrganizationSecurityPolicyRequest,Operation,Operation> |
moveOperationCallable()
Moves the specified security policy.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
patchAsync(PatchOrganizationSecurityPolicyRequest request)
Patches the specified policy with the data included in the request.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
patchAsync(String securityPolicy,
SecurityPolicy securityPolicyResource)
Patches the specified policy with the data included in the request.
|
com.google.api.gax.rpc.UnaryCallable<PatchOrganizationSecurityPolicyRequest,Operation> |
patchCallable()
Patches the specified policy with the data included in the request.
|
com.google.api.gax.rpc.OperationCallable<PatchOrganizationSecurityPolicyRequest,Operation,Operation> |
patchOperationCallable()
Patches the specified policy with the data included in the request.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
patchRuleAsync(PatchRuleOrganizationSecurityPolicyRequest request)
Patches a rule at the specified priority.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
patchRuleAsync(String securityPolicy,
SecurityPolicyRule securityPolicyRuleResource)
Patches a rule at the specified priority.
|
com.google.api.gax.rpc.UnaryCallable<PatchRuleOrganizationSecurityPolicyRequest,Operation> |
patchRuleCallable()
Patches a rule at the specified priority.
|
com.google.api.gax.rpc.OperationCallable<PatchRuleOrganizationSecurityPolicyRequest,Operation,Operation> |
patchRuleOperationCallable()
Patches a rule at the specified priority.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
removeAssociationAsync(RemoveAssociationOrganizationSecurityPolicyRequest request)
Removes an association for the specified security policy.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
removeAssociationAsync(String securityPolicy)
Removes an association for the specified security policy.
|
com.google.api.gax.rpc.UnaryCallable<RemoveAssociationOrganizationSecurityPolicyRequest,Operation> |
removeAssociationCallable()
Removes an association for the specified security policy.
|
com.google.api.gax.rpc.OperationCallable<RemoveAssociationOrganizationSecurityPolicyRequest,Operation,Operation> |
removeAssociationOperationCallable()
Removes an association for the specified security policy.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
removeRuleAsync(RemoveRuleOrganizationSecurityPolicyRequest request)
Deletes a rule at the specified priority.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
removeRuleAsync(String securityPolicy)
Deletes a rule at the specified priority.
|
com.google.api.gax.rpc.UnaryCallable<RemoveRuleOrganizationSecurityPolicyRequest,Operation> |
removeRuleCallable()
Deletes a rule at the specified priority.
|
com.google.api.gax.rpc.OperationCallable<RemoveRuleOrganizationSecurityPolicyRequest,Operation,Operation> |
removeRuleOperationCallable()
Deletes a rule at the specified priority.
|
void |
shutdown() |
void |
shutdownNow() |
protected OrganizationSecurityPoliciesClient(OrganizationSecurityPoliciesSettings settings) throws IOException
IOExceptionprotected OrganizationSecurityPoliciesClient(OrganizationSecurityPoliciesStub stub)
public static final OrganizationSecurityPoliciesClient create() throws IOException
IOExceptionpublic static final OrganizationSecurityPoliciesClient create(OrganizationSecurityPoliciesSettings settings) throws IOException
IOExceptionpublic static final OrganizationSecurityPoliciesClient create(OrganizationSecurityPoliciesStub stub)
public final OrganizationSecurityPoliciesSettings getSettings()
public OrganizationSecurityPoliciesStub getStub()
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> addAssociationAsync(String securityPolicy, SecurityPolicyAssociation securityPolicyAssociationResource)
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 (OrganizationSecurityPoliciesClient organizationSecurityPoliciesClient =
OrganizationSecurityPoliciesClient.create()) {
String securityPolicy = "securityPolicy-788621166";
SecurityPolicyAssociation securityPolicyAssociationResource =
SecurityPolicyAssociation.newBuilder().build();
Operation response =
organizationSecurityPoliciesClient
.addAssociationAsync(securityPolicy, securityPolicyAssociationResource)
.get();
}
securityPolicy - Name of the security policy to update.securityPolicyAssociationResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> addAssociationAsync(AddAssociationOrganizationSecurityPolicyRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (OrganizationSecurityPoliciesClient organizationSecurityPoliciesClient =
OrganizationSecurityPoliciesClient.create()) {
AddAssociationOrganizationSecurityPolicyRequest request =
AddAssociationOrganizationSecurityPolicyRequest.newBuilder()
.setReplaceExistingAssociation(true)
.setRequestId("requestId693933066")
.setSecurityPolicy("securityPolicy-788621166")
.setSecurityPolicyAssociationResource(SecurityPolicyAssociation.newBuilder().build())
.build();
Operation response = organizationSecurityPoliciesClient.addAssociationAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<AddAssociationOrganizationSecurityPolicyRequest,Operation,Operation> addAssociationOperationCallable()
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 (OrganizationSecurityPoliciesClient organizationSecurityPoliciesClient =
OrganizationSecurityPoliciesClient.create()) {
AddAssociationOrganizationSecurityPolicyRequest request =
AddAssociationOrganizationSecurityPolicyRequest.newBuilder()
.setReplaceExistingAssociation(true)
.setRequestId("requestId693933066")
.setSecurityPolicy("securityPolicy-788621166")
.setSecurityPolicyAssociationResource(SecurityPolicyAssociation.newBuilder().build())
.build();
OperationFuture<Operation, Operation> future =
organizationSecurityPoliciesClient.addAssociationOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<AddAssociationOrganizationSecurityPolicyRequest,Operation> addAssociationCallable()
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 (OrganizationSecurityPoliciesClient organizationSecurityPoliciesClient =
OrganizationSecurityPoliciesClient.create()) {
AddAssociationOrganizationSecurityPolicyRequest request =
AddAssociationOrganizationSecurityPolicyRequest.newBuilder()
.setReplaceExistingAssociation(true)
.setRequestId("requestId693933066")
.setSecurityPolicy("securityPolicy-788621166")
.setSecurityPolicyAssociationResource(SecurityPolicyAssociation.newBuilder().build())
.build();
ApiFuture<Operation> future =
organizationSecurityPoliciesClient.addAssociationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> addRuleAsync(String securityPolicy, SecurityPolicyRule securityPolicyRuleResource)
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 (OrganizationSecurityPoliciesClient organizationSecurityPoliciesClient =
OrganizationSecurityPoliciesClient.create()) {
String securityPolicy = "securityPolicy-788621166";
SecurityPolicyRule securityPolicyRuleResource = SecurityPolicyRule.newBuilder().build();
Operation response =
organizationSecurityPoliciesClient
.addRuleAsync(securityPolicy, securityPolicyRuleResource)
.get();
}
securityPolicy - Name of the security policy to update.securityPolicyRuleResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> addRuleAsync(AddRuleOrganizationSecurityPolicyRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (OrganizationSecurityPoliciesClient organizationSecurityPoliciesClient =
OrganizationSecurityPoliciesClient.create()) {
AddRuleOrganizationSecurityPolicyRequest request =
AddRuleOrganizationSecurityPolicyRequest.newBuilder()
.setRequestId("requestId693933066")
.setSecurityPolicy("securityPolicy-788621166")
.setSecurityPolicyRuleResource(SecurityPolicyRule.newBuilder().build())
.build();
Operation response = organizationSecurityPoliciesClient.addRuleAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<AddRuleOrganizationSecurityPolicyRequest,Operation,Operation> addRuleOperationCallable()
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 (OrganizationSecurityPoliciesClient organizationSecurityPoliciesClient =
OrganizationSecurityPoliciesClient.create()) {
AddRuleOrganizationSecurityPolicyRequest request =
AddRuleOrganizationSecurityPolicyRequest.newBuilder()
.setRequestId("requestId693933066")
.setSecurityPolicy("securityPolicy-788621166")
.setSecurityPolicyRuleResource(SecurityPolicyRule.newBuilder().build())
.build();
OperationFuture<Operation, Operation> future =
organizationSecurityPoliciesClient.addRuleOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<AddRuleOrganizationSecurityPolicyRequest,Operation> addRuleCallable()
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 (OrganizationSecurityPoliciesClient organizationSecurityPoliciesClient =
OrganizationSecurityPoliciesClient.create()) {
AddRuleOrganizationSecurityPolicyRequest request =
AddRuleOrganizationSecurityPolicyRequest.newBuilder()
.setRequestId("requestId693933066")
.setSecurityPolicy("securityPolicy-788621166")
.setSecurityPolicyRuleResource(SecurityPolicyRule.newBuilder().build())
.build();
ApiFuture<Operation> future =
organizationSecurityPoliciesClient.addRuleCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> copyRulesAsync(String securityPolicy)
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 (OrganizationSecurityPoliciesClient organizationSecurityPoliciesClient =
OrganizationSecurityPoliciesClient.create()) {
String securityPolicy = "securityPolicy-788621166";
Operation response = organizationSecurityPoliciesClient.copyRulesAsync(securityPolicy).get();
}
securityPolicy - Name of the security policy to update.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> copyRulesAsync(CopyRulesOrganizationSecurityPolicyRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (OrganizationSecurityPoliciesClient organizationSecurityPoliciesClient =
OrganizationSecurityPoliciesClient.create()) {
CopyRulesOrganizationSecurityPolicyRequest request =
CopyRulesOrganizationSecurityPolicyRequest.newBuilder()
.setRequestId("requestId693933066")
.setSecurityPolicy("securityPolicy-788621166")
.setSourceSecurityPolicy("sourceSecurityPolicy1092878733")
.build();
Operation response = organizationSecurityPoliciesClient.copyRulesAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<CopyRulesOrganizationSecurityPolicyRequest,Operation,Operation> copyRulesOperationCallable()
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 (OrganizationSecurityPoliciesClient organizationSecurityPoliciesClient =
OrganizationSecurityPoliciesClient.create()) {
CopyRulesOrganizationSecurityPolicyRequest request =
CopyRulesOrganizationSecurityPolicyRequest.newBuilder()
.setRequestId("requestId693933066")
.setSecurityPolicy("securityPolicy-788621166")
.setSourceSecurityPolicy("sourceSecurityPolicy1092878733")
.build();
OperationFuture<Operation, Operation> future =
organizationSecurityPoliciesClient.copyRulesOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<CopyRulesOrganizationSecurityPolicyRequest,Operation> copyRulesCallable()
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 (OrganizationSecurityPoliciesClient organizationSecurityPoliciesClient =
OrganizationSecurityPoliciesClient.create()) {
CopyRulesOrganizationSecurityPolicyRequest request =
CopyRulesOrganizationSecurityPolicyRequest.newBuilder()
.setRequestId("requestId693933066")
.setSecurityPolicy("securityPolicy-788621166")
.setSourceSecurityPolicy("sourceSecurityPolicy1092878733")
.build();
ApiFuture<Operation> future =
organizationSecurityPoliciesClient.copyRulesCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> deleteAsync(String securityPolicy)
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 (OrganizationSecurityPoliciesClient organizationSecurityPoliciesClient =
OrganizationSecurityPoliciesClient.create()) {
String securityPolicy = "securityPolicy-788621166";
Operation response = organizationSecurityPoliciesClient.deleteAsync(securityPolicy).get();
}
securityPolicy - Name of the security policy to delete.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> deleteAsync(DeleteOrganizationSecurityPolicyRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (OrganizationSecurityPoliciesClient organizationSecurityPoliciesClient =
OrganizationSecurityPoliciesClient.create()) {
DeleteOrganizationSecurityPolicyRequest request =
DeleteOrganizationSecurityPolicyRequest.newBuilder()
.setRequestId("requestId693933066")
.setSecurityPolicy("securityPolicy-788621166")
.build();
Operation response = organizationSecurityPoliciesClient.deleteAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<DeleteOrganizationSecurityPolicyRequest,Operation,Operation> deleteOperationCallable()
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 (OrganizationSecurityPoliciesClient organizationSecurityPoliciesClient =
OrganizationSecurityPoliciesClient.create()) {
DeleteOrganizationSecurityPolicyRequest request =
DeleteOrganizationSecurityPolicyRequest.newBuilder()
.setRequestId("requestId693933066")
.setSecurityPolicy("securityPolicy-788621166")
.build();
OperationFuture<Operation, Operation> future =
organizationSecurityPoliciesClient.deleteOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<DeleteOrganizationSecurityPolicyRequest,Operation> deleteCallable()
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 (OrganizationSecurityPoliciesClient organizationSecurityPoliciesClient =
OrganizationSecurityPoliciesClient.create()) {
DeleteOrganizationSecurityPolicyRequest request =
DeleteOrganizationSecurityPolicyRequest.newBuilder()
.setRequestId("requestId693933066")
.setSecurityPolicy("securityPolicy-788621166")
.build();
ApiFuture<Operation> future =
organizationSecurityPoliciesClient.deleteCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final SecurityPolicy get(String securityPolicy)
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 (OrganizationSecurityPoliciesClient organizationSecurityPoliciesClient =
OrganizationSecurityPoliciesClient.create()) {
String securityPolicy = "securityPolicy-788621166";
SecurityPolicy response = organizationSecurityPoliciesClient.get(securityPolicy);
}
securityPolicy - Name of the security policy to get.com.google.api.gax.rpc.ApiException - if the remote call failspublic final SecurityPolicy get(GetOrganizationSecurityPolicyRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (OrganizationSecurityPoliciesClient organizationSecurityPoliciesClient =
OrganizationSecurityPoliciesClient.create()) {
GetOrganizationSecurityPolicyRequest request =
GetOrganizationSecurityPolicyRequest.newBuilder()
.setSecurityPolicy("securityPolicy-788621166")
.build();
SecurityPolicy response = organizationSecurityPoliciesClient.get(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetOrganizationSecurityPolicyRequest,SecurityPolicy> getCallable()
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 (OrganizationSecurityPoliciesClient organizationSecurityPoliciesClient =
OrganizationSecurityPoliciesClient.create()) {
GetOrganizationSecurityPolicyRequest request =
GetOrganizationSecurityPolicyRequest.newBuilder()
.setSecurityPolicy("securityPolicy-788621166")
.build();
ApiFuture<SecurityPolicy> future =
organizationSecurityPoliciesClient.getCallable().futureCall(request);
// Do something.
SecurityPolicy response = future.get();
}
public final SecurityPolicyAssociation getAssociation(String securityPolicy)
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 (OrganizationSecurityPoliciesClient organizationSecurityPoliciesClient =
OrganizationSecurityPoliciesClient.create()) {
String securityPolicy = "securityPolicy-788621166";
SecurityPolicyAssociation response =
organizationSecurityPoliciesClient.getAssociation(securityPolicy);
}
securityPolicy - Name of the security policy to which the queried rule belongs.com.google.api.gax.rpc.ApiException - if the remote call failspublic final SecurityPolicyAssociation getAssociation(GetAssociationOrganizationSecurityPolicyRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (OrganizationSecurityPoliciesClient organizationSecurityPoliciesClient =
OrganizationSecurityPoliciesClient.create()) {
GetAssociationOrganizationSecurityPolicyRequest request =
GetAssociationOrganizationSecurityPolicyRequest.newBuilder()
.setName("name3373707")
.setSecurityPolicy("securityPolicy-788621166")
.build();
SecurityPolicyAssociation response =
organizationSecurityPoliciesClient.getAssociation(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetAssociationOrganizationSecurityPolicyRequest,SecurityPolicyAssociation> getAssociationCallable()
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 (OrganizationSecurityPoliciesClient organizationSecurityPoliciesClient =
OrganizationSecurityPoliciesClient.create()) {
GetAssociationOrganizationSecurityPolicyRequest request =
GetAssociationOrganizationSecurityPolicyRequest.newBuilder()
.setName("name3373707")
.setSecurityPolicy("securityPolicy-788621166")
.build();
ApiFuture<SecurityPolicyAssociation> future =
organizationSecurityPoliciesClient.getAssociationCallable().futureCall(request);
// Do something.
SecurityPolicyAssociation response = future.get();
}
public final SecurityPolicyRule getRule(String securityPolicy)
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 (OrganizationSecurityPoliciesClient organizationSecurityPoliciesClient =
OrganizationSecurityPoliciesClient.create()) {
String securityPolicy = "securityPolicy-788621166";
SecurityPolicyRule response = organizationSecurityPoliciesClient.getRule(securityPolicy);
}
securityPolicy - Name of the security policy to which the queried rule belongs.com.google.api.gax.rpc.ApiException - if the remote call failspublic final SecurityPolicyRule getRule(GetRuleOrganizationSecurityPolicyRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (OrganizationSecurityPoliciesClient organizationSecurityPoliciesClient =
OrganizationSecurityPoliciesClient.create()) {
GetRuleOrganizationSecurityPolicyRequest request =
GetRuleOrganizationSecurityPolicyRequest.newBuilder()
.setPriority(-1165461084)
.setSecurityPolicy("securityPolicy-788621166")
.build();
SecurityPolicyRule response = organizationSecurityPoliciesClient.getRule(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetRuleOrganizationSecurityPolicyRequest,SecurityPolicyRule> getRuleCallable()
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 (OrganizationSecurityPoliciesClient organizationSecurityPoliciesClient =
OrganizationSecurityPoliciesClient.create()) {
GetRuleOrganizationSecurityPolicyRequest request =
GetRuleOrganizationSecurityPolicyRequest.newBuilder()
.setPriority(-1165461084)
.setSecurityPolicy("securityPolicy-788621166")
.build();
ApiFuture<SecurityPolicyRule> future =
organizationSecurityPoliciesClient.getRuleCallable().futureCall(request);
// Do something.
SecurityPolicyRule response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> insertAsync(SecurityPolicy securityPolicyResource)
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 (OrganizationSecurityPoliciesClient organizationSecurityPoliciesClient =
OrganizationSecurityPoliciesClient.create()) {
SecurityPolicy securityPolicyResource = SecurityPolicy.newBuilder().build();
Operation response =
organizationSecurityPoliciesClient.insertAsync(securityPolicyResource).get();
}
securityPolicyResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> insertAsync(InsertOrganizationSecurityPolicyRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (OrganizationSecurityPoliciesClient organizationSecurityPoliciesClient =
OrganizationSecurityPoliciesClient.create()) {
InsertOrganizationSecurityPolicyRequest request =
InsertOrganizationSecurityPolicyRequest.newBuilder()
.setParentId("parentId1175162725")
.setRequestId("requestId693933066")
.setSecurityPolicyResource(SecurityPolicy.newBuilder().build())
.build();
Operation response = organizationSecurityPoliciesClient.insertAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<InsertOrganizationSecurityPolicyRequest,Operation,Operation> insertOperationCallable()
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 (OrganizationSecurityPoliciesClient organizationSecurityPoliciesClient =
OrganizationSecurityPoliciesClient.create()) {
InsertOrganizationSecurityPolicyRequest request =
InsertOrganizationSecurityPolicyRequest.newBuilder()
.setParentId("parentId1175162725")
.setRequestId("requestId693933066")
.setSecurityPolicyResource(SecurityPolicy.newBuilder().build())
.build();
OperationFuture<Operation, Operation> future =
organizationSecurityPoliciesClient.insertOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<InsertOrganizationSecurityPolicyRequest,Operation> insertCallable()
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 (OrganizationSecurityPoliciesClient organizationSecurityPoliciesClient =
OrganizationSecurityPoliciesClient.create()) {
InsertOrganizationSecurityPolicyRequest request =
InsertOrganizationSecurityPolicyRequest.newBuilder()
.setParentId("parentId1175162725")
.setRequestId("requestId693933066")
.setSecurityPolicyResource(SecurityPolicy.newBuilder().build())
.build();
ApiFuture<Operation> future =
organizationSecurityPoliciesClient.insertCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final OrganizationSecurityPoliciesClient.ListPagedResponse list()
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 (OrganizationSecurityPoliciesClient organizationSecurityPoliciesClient =
OrganizationSecurityPoliciesClient.create()) {
for (SecurityPolicy element : organizationSecurityPoliciesClient.list().iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final OrganizationSecurityPoliciesClient.ListPagedResponse list(ListOrganizationSecurityPoliciesRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (OrganizationSecurityPoliciesClient organizationSecurityPoliciesClient =
OrganizationSecurityPoliciesClient.create()) {
ListOrganizationSecurityPoliciesRequest request =
ListOrganizationSecurityPoliciesRequest.newBuilder()
.setFilter("filter-1274492040")
.setMaxResults(1128457243)
.setOrderBy("orderBy-1207110587")
.setPageToken("pageToken873572522")
.setParentId("parentId1175162725")
.setReturnPartialSuccess(true)
.build();
for (SecurityPolicy element : organizationSecurityPoliciesClient.list(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListOrganizationSecurityPoliciesRequest,OrganizationSecurityPoliciesClient.ListPagedResponse> listPagedCallable()
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 (OrganizationSecurityPoliciesClient organizationSecurityPoliciesClient =
OrganizationSecurityPoliciesClient.create()) {
ListOrganizationSecurityPoliciesRequest request =
ListOrganizationSecurityPoliciesRequest.newBuilder()
.setFilter("filter-1274492040")
.setMaxResults(1128457243)
.setOrderBy("orderBy-1207110587")
.setPageToken("pageToken873572522")
.setParentId("parentId1175162725")
.setReturnPartialSuccess(true)
.build();
ApiFuture<SecurityPolicy> future =
organizationSecurityPoliciesClient.listPagedCallable().futureCall(request);
// Do something.
for (SecurityPolicy element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListOrganizationSecurityPoliciesRequest,SecurityPolicyList> listCallable()
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 (OrganizationSecurityPoliciesClient organizationSecurityPoliciesClient =
OrganizationSecurityPoliciesClient.create()) {
ListOrganizationSecurityPoliciesRequest request =
ListOrganizationSecurityPoliciesRequest.newBuilder()
.setFilter("filter-1274492040")
.setMaxResults(1128457243)
.setOrderBy("orderBy-1207110587")
.setPageToken("pageToken873572522")
.setParentId("parentId1175162725")
.setReturnPartialSuccess(true)
.build();
while (true) {
SecurityPolicyList response =
organizationSecurityPoliciesClient.listCallable().call(request);
for (SecurityPolicy element : response.getItemsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final OrganizationSecurityPoliciesListAssociationsResponse listAssociations()
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 (OrganizationSecurityPoliciesClient organizationSecurityPoliciesClient =
OrganizationSecurityPoliciesClient.create()) {
OrganizationSecurityPoliciesListAssociationsResponse response =
organizationSecurityPoliciesClient.listAssociations();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final OrganizationSecurityPoliciesListAssociationsResponse listAssociations(ListAssociationsOrganizationSecurityPolicyRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (OrganizationSecurityPoliciesClient organizationSecurityPoliciesClient =
OrganizationSecurityPoliciesClient.create()) {
ListAssociationsOrganizationSecurityPolicyRequest request =
ListAssociationsOrganizationSecurityPolicyRequest.newBuilder()
.setTargetResource("targetResource-1933150017")
.build();
OrganizationSecurityPoliciesListAssociationsResponse response =
organizationSecurityPoliciesClient.listAssociations(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListAssociationsOrganizationSecurityPolicyRequest,OrganizationSecurityPoliciesListAssociationsResponse> listAssociationsCallable()
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 (OrganizationSecurityPoliciesClient organizationSecurityPoliciesClient =
OrganizationSecurityPoliciesClient.create()) {
ListAssociationsOrganizationSecurityPolicyRequest request =
ListAssociationsOrganizationSecurityPolicyRequest.newBuilder()
.setTargetResource("targetResource-1933150017")
.build();
ApiFuture<OrganizationSecurityPoliciesListAssociationsResponse> future =
organizationSecurityPoliciesClient.listAssociationsCallable().futureCall(request);
// Do something.
OrganizationSecurityPoliciesListAssociationsResponse response = future.get();
}
public final SecurityPoliciesListPreconfiguredExpressionSetsResponse listPreconfiguredExpressionSets()
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 (OrganizationSecurityPoliciesClient organizationSecurityPoliciesClient =
OrganizationSecurityPoliciesClient.create()) {
SecurityPoliciesListPreconfiguredExpressionSetsResponse response =
organizationSecurityPoliciesClient.listPreconfiguredExpressionSets();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final SecurityPoliciesListPreconfiguredExpressionSetsResponse listPreconfiguredExpressionSets(ListPreconfiguredExpressionSetsOrganizationSecurityPoliciesRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (OrganizationSecurityPoliciesClient organizationSecurityPoliciesClient =
OrganizationSecurityPoliciesClient.create()) {
ListPreconfiguredExpressionSetsOrganizationSecurityPoliciesRequest request =
ListPreconfiguredExpressionSetsOrganizationSecurityPoliciesRequest.newBuilder()
.setFilter("filter-1274492040")
.setMaxResults(1128457243)
.setOrderBy("orderBy-1207110587")
.setPageToken("pageToken873572522")
.setParentId("parentId1175162725")
.setReturnPartialSuccess(true)
.build();
SecurityPoliciesListPreconfiguredExpressionSetsResponse response =
organizationSecurityPoliciesClient.listPreconfiguredExpressionSets(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListPreconfiguredExpressionSetsOrganizationSecurityPoliciesRequest,SecurityPoliciesListPreconfiguredExpressionSetsResponse> listPreconfiguredExpressionSetsCallable()
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 (OrganizationSecurityPoliciesClient organizationSecurityPoliciesClient =
OrganizationSecurityPoliciesClient.create()) {
ListPreconfiguredExpressionSetsOrganizationSecurityPoliciesRequest request =
ListPreconfiguredExpressionSetsOrganizationSecurityPoliciesRequest.newBuilder()
.setFilter("filter-1274492040")
.setMaxResults(1128457243)
.setOrderBy("orderBy-1207110587")
.setPageToken("pageToken873572522")
.setParentId("parentId1175162725")
.setReturnPartialSuccess(true)
.build();
ApiFuture<SecurityPoliciesListPreconfiguredExpressionSetsResponse> future =
organizationSecurityPoliciesClient
.listPreconfiguredExpressionSetsCallable()
.futureCall(request);
// Do something.
SecurityPoliciesListPreconfiguredExpressionSetsResponse response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> moveAsync(String securityPolicy)
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 (OrganizationSecurityPoliciesClient organizationSecurityPoliciesClient =
OrganizationSecurityPoliciesClient.create()) {
String securityPolicy = "securityPolicy-788621166";
Operation response = organizationSecurityPoliciesClient.moveAsync(securityPolicy).get();
}
securityPolicy - Name of the security policy to update.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> moveAsync(MoveOrganizationSecurityPolicyRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (OrganizationSecurityPoliciesClient organizationSecurityPoliciesClient =
OrganizationSecurityPoliciesClient.create()) {
MoveOrganizationSecurityPolicyRequest request =
MoveOrganizationSecurityPolicyRequest.newBuilder()
.setParentId("parentId1175162725")
.setRequestId("requestId693933066")
.setSecurityPolicy("securityPolicy-788621166")
.build();
Operation response = organizationSecurityPoliciesClient.moveAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<MoveOrganizationSecurityPolicyRequest,Operation,Operation> moveOperationCallable()
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 (OrganizationSecurityPoliciesClient organizationSecurityPoliciesClient =
OrganizationSecurityPoliciesClient.create()) {
MoveOrganizationSecurityPolicyRequest request =
MoveOrganizationSecurityPolicyRequest.newBuilder()
.setParentId("parentId1175162725")
.setRequestId("requestId693933066")
.setSecurityPolicy("securityPolicy-788621166")
.build();
OperationFuture<Operation, Operation> future =
organizationSecurityPoliciesClient.moveOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<MoveOrganizationSecurityPolicyRequest,Operation> moveCallable()
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 (OrganizationSecurityPoliciesClient organizationSecurityPoliciesClient =
OrganizationSecurityPoliciesClient.create()) {
MoveOrganizationSecurityPolicyRequest request =
MoveOrganizationSecurityPolicyRequest.newBuilder()
.setParentId("parentId1175162725")
.setRequestId("requestId693933066")
.setSecurityPolicy("securityPolicy-788621166")
.build();
ApiFuture<Operation> future =
organizationSecurityPoliciesClient.moveCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> patchAsync(String securityPolicy, SecurityPolicy securityPolicyResource)
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 (OrganizationSecurityPoliciesClient organizationSecurityPoliciesClient =
OrganizationSecurityPoliciesClient.create()) {
String securityPolicy = "securityPolicy-788621166";
SecurityPolicy securityPolicyResource = SecurityPolicy.newBuilder().build();
Operation response =
organizationSecurityPoliciesClient
.patchAsync(securityPolicy, securityPolicyResource)
.get();
}
securityPolicy - Name of the security policy to update.securityPolicyResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> patchAsync(PatchOrganizationSecurityPolicyRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (OrganizationSecurityPoliciesClient organizationSecurityPoliciesClient =
OrganizationSecurityPoliciesClient.create()) {
PatchOrganizationSecurityPolicyRequest request =
PatchOrganizationSecurityPolicyRequest.newBuilder()
.setRequestId("requestId693933066")
.setSecurityPolicy("securityPolicy-788621166")
.setSecurityPolicyResource(SecurityPolicy.newBuilder().build())
.build();
Operation response = organizationSecurityPoliciesClient.patchAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<PatchOrganizationSecurityPolicyRequest,Operation,Operation> patchOperationCallable()
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 (OrganizationSecurityPoliciesClient organizationSecurityPoliciesClient =
OrganizationSecurityPoliciesClient.create()) {
PatchOrganizationSecurityPolicyRequest request =
PatchOrganizationSecurityPolicyRequest.newBuilder()
.setRequestId("requestId693933066")
.setSecurityPolicy("securityPolicy-788621166")
.setSecurityPolicyResource(SecurityPolicy.newBuilder().build())
.build();
OperationFuture<Operation, Operation> future =
organizationSecurityPoliciesClient.patchOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<PatchOrganizationSecurityPolicyRequest,Operation> patchCallable()
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 (OrganizationSecurityPoliciesClient organizationSecurityPoliciesClient =
OrganizationSecurityPoliciesClient.create()) {
PatchOrganizationSecurityPolicyRequest request =
PatchOrganizationSecurityPolicyRequest.newBuilder()
.setRequestId("requestId693933066")
.setSecurityPolicy("securityPolicy-788621166")
.setSecurityPolicyResource(SecurityPolicy.newBuilder().build())
.build();
ApiFuture<Operation> future =
organizationSecurityPoliciesClient.patchCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> patchRuleAsync(String securityPolicy, SecurityPolicyRule securityPolicyRuleResource)
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 (OrganizationSecurityPoliciesClient organizationSecurityPoliciesClient =
OrganizationSecurityPoliciesClient.create()) {
String securityPolicy = "securityPolicy-788621166";
SecurityPolicyRule securityPolicyRuleResource = SecurityPolicyRule.newBuilder().build();
Operation response =
organizationSecurityPoliciesClient
.patchRuleAsync(securityPolicy, securityPolicyRuleResource)
.get();
}
securityPolicy - Name of the security policy to update.securityPolicyRuleResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> patchRuleAsync(PatchRuleOrganizationSecurityPolicyRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (OrganizationSecurityPoliciesClient organizationSecurityPoliciesClient =
OrganizationSecurityPoliciesClient.create()) {
PatchRuleOrganizationSecurityPolicyRequest request =
PatchRuleOrganizationSecurityPolicyRequest.newBuilder()
.setPriority(-1165461084)
.setRequestId("requestId693933066")
.setSecurityPolicy("securityPolicy-788621166")
.setSecurityPolicyRuleResource(SecurityPolicyRule.newBuilder().build())
.build();
Operation response = organizationSecurityPoliciesClient.patchRuleAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<PatchRuleOrganizationSecurityPolicyRequest,Operation,Operation> patchRuleOperationCallable()
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 (OrganizationSecurityPoliciesClient organizationSecurityPoliciesClient =
OrganizationSecurityPoliciesClient.create()) {
PatchRuleOrganizationSecurityPolicyRequest request =
PatchRuleOrganizationSecurityPolicyRequest.newBuilder()
.setPriority(-1165461084)
.setRequestId("requestId693933066")
.setSecurityPolicy("securityPolicy-788621166")
.setSecurityPolicyRuleResource(SecurityPolicyRule.newBuilder().build())
.build();
OperationFuture<Operation, Operation> future =
organizationSecurityPoliciesClient.patchRuleOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<PatchRuleOrganizationSecurityPolicyRequest,Operation> patchRuleCallable()
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 (OrganizationSecurityPoliciesClient organizationSecurityPoliciesClient =
OrganizationSecurityPoliciesClient.create()) {
PatchRuleOrganizationSecurityPolicyRequest request =
PatchRuleOrganizationSecurityPolicyRequest.newBuilder()
.setPriority(-1165461084)
.setRequestId("requestId693933066")
.setSecurityPolicy("securityPolicy-788621166")
.setSecurityPolicyRuleResource(SecurityPolicyRule.newBuilder().build())
.build();
ApiFuture<Operation> future =
organizationSecurityPoliciesClient.patchRuleCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> removeAssociationAsync(String securityPolicy)
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 (OrganizationSecurityPoliciesClient organizationSecurityPoliciesClient =
OrganizationSecurityPoliciesClient.create()) {
String securityPolicy = "securityPolicy-788621166";
Operation response =
organizationSecurityPoliciesClient.removeAssociationAsync(securityPolicy).get();
}
securityPolicy - Name of the security policy to update.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> removeAssociationAsync(RemoveAssociationOrganizationSecurityPolicyRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (OrganizationSecurityPoliciesClient organizationSecurityPoliciesClient =
OrganizationSecurityPoliciesClient.create()) {
RemoveAssociationOrganizationSecurityPolicyRequest request =
RemoveAssociationOrganizationSecurityPolicyRequest.newBuilder()
.setName("name3373707")
.setRequestId("requestId693933066")
.setSecurityPolicy("securityPolicy-788621166")
.build();
Operation response = organizationSecurityPoliciesClient.removeAssociationAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<RemoveAssociationOrganizationSecurityPolicyRequest,Operation,Operation> removeAssociationOperationCallable()
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 (OrganizationSecurityPoliciesClient organizationSecurityPoliciesClient =
OrganizationSecurityPoliciesClient.create()) {
RemoveAssociationOrganizationSecurityPolicyRequest request =
RemoveAssociationOrganizationSecurityPolicyRequest.newBuilder()
.setName("name3373707")
.setRequestId("requestId693933066")
.setSecurityPolicy("securityPolicy-788621166")
.build();
OperationFuture<Operation, Operation> future =
organizationSecurityPoliciesClient
.removeAssociationOperationCallable()
.futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<RemoveAssociationOrganizationSecurityPolicyRequest,Operation> removeAssociationCallable()
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 (OrganizationSecurityPoliciesClient organizationSecurityPoliciesClient =
OrganizationSecurityPoliciesClient.create()) {
RemoveAssociationOrganizationSecurityPolicyRequest request =
RemoveAssociationOrganizationSecurityPolicyRequest.newBuilder()
.setName("name3373707")
.setRequestId("requestId693933066")
.setSecurityPolicy("securityPolicy-788621166")
.build();
ApiFuture<Operation> future =
organizationSecurityPoliciesClient.removeAssociationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> removeRuleAsync(String securityPolicy)
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 (OrganizationSecurityPoliciesClient organizationSecurityPoliciesClient =
OrganizationSecurityPoliciesClient.create()) {
String securityPolicy = "securityPolicy-788621166";
Operation response = organizationSecurityPoliciesClient.removeRuleAsync(securityPolicy).get();
}
securityPolicy - Name of the security policy to update.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> removeRuleAsync(RemoveRuleOrganizationSecurityPolicyRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (OrganizationSecurityPoliciesClient organizationSecurityPoliciesClient =
OrganizationSecurityPoliciesClient.create()) {
RemoveRuleOrganizationSecurityPolicyRequest request =
RemoveRuleOrganizationSecurityPolicyRequest.newBuilder()
.setPriority(-1165461084)
.setRequestId("requestId693933066")
.setSecurityPolicy("securityPolicy-788621166")
.build();
Operation response = organizationSecurityPoliciesClient.removeRuleAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<RemoveRuleOrganizationSecurityPolicyRequest,Operation,Operation> removeRuleOperationCallable()
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 (OrganizationSecurityPoliciesClient organizationSecurityPoliciesClient =
OrganizationSecurityPoliciesClient.create()) {
RemoveRuleOrganizationSecurityPolicyRequest request =
RemoveRuleOrganizationSecurityPolicyRequest.newBuilder()
.setPriority(-1165461084)
.setRequestId("requestId693933066")
.setSecurityPolicy("securityPolicy-788621166")
.build();
OperationFuture<Operation, Operation> future =
organizationSecurityPoliciesClient.removeRuleOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<RemoveRuleOrganizationSecurityPolicyRequest,Operation> removeRuleCallable()
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 (OrganizationSecurityPoliciesClient organizationSecurityPoliciesClient =
OrganizationSecurityPoliciesClient.create()) {
RemoveRuleOrganizationSecurityPolicyRequest request =
RemoveRuleOrganizationSecurityPolicyRequest.newBuilder()
.setPriority(-1165461084)
.setRequestId("requestId693933066")
.setSecurityPolicy("securityPolicy-788621166")
.build();
ApiFuture<Operation> future =
organizationSecurityPoliciesClient.removeRuleCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final void close()
close in interface AutoCloseablepublic void shutdown()
shutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isShutdown()
isShutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isTerminated()
isTerminated in interface com.google.api.gax.core.BackgroundResourcepublic void shutdownNow()
shutdownNow in interface com.google.api.gax.core.BackgroundResourcepublic boolean awaitTermination(long duration,
TimeUnit unit)
throws InterruptedException
awaitTermination in interface com.google.api.gax.core.BackgroundResourceInterruptedExceptionCopyright © 2025 Google LLC. All rights reserved.