Class FirewallPoliciesClient

  • All Implemented Interfaces:
    com.google.api.gax.core.BackgroundResource, AutoCloseable

    @Generated("by gapic-generator-java")
    public class FirewallPoliciesClient
    extends Object
    implements com.google.api.gax.core.BackgroundResource
    Service Description: The FirewallPolicies API.

    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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
       String firewallPolicy = "firewallPolicy1819692626";
       FirewallPolicy response = firewallPoliciesClient.get(firewallPolicy);
     }
     

    Note: close() needs to be called on the FirewallPoliciesClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().

    The surface of this class includes several types of Java methods for each of the API's methods:

    1. A "flattened" method. With this type of method, the fields of the request type have been converted into function parameters. It may be the case that not all fields are available as parameters, and not every API method will have a flattened method entry point.
    2. A "request object" method. This type of method only takes one parameter, a request object, which must be constructed before the call. Not every API method will have a request object method.
    3. A "callable" method. This type of method takes no parameters and returns 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 FirewallPoliciesSettings 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
     FirewallPoliciesSettings firewallPoliciesSettings =
         FirewallPoliciesSettings.newBuilder()
             .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
             .build();
     FirewallPoliciesClient firewallPoliciesClient =
         FirewallPoliciesClient.create(firewallPoliciesSettings);
     

    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
     FirewallPoliciesSettings firewallPoliciesSettings =
         FirewallPoliciesSettings.newBuilder().setEndpoint(myEndpoint).build();
     FirewallPoliciesClient firewallPoliciesClient =
         FirewallPoliciesClient.create(firewallPoliciesSettings);
     

    Please refer to the GitHub repository's samples for more quickstart code snippets.

    • Constructor Detail

      • FirewallPoliciesClient

        protected FirewallPoliciesClient​(FirewallPoliciesSettings settings)
                                  throws IOException
        Constructs an instance of FirewallPoliciesClient, 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
    • Method Detail

      • create

        public static final FirewallPoliciesClient create​(FirewallPoliciesStub stub)
        Constructs an instance of FirewallPoliciesClient, using the given stub for making calls. This is for advanced usage - prefer using create(FirewallPoliciesSettings).
      • addAssociationAsync

        public final com.google.api.gax.longrunning.OperationFuture<Operation,​Operation> addAssociationAsync​(String firewallPolicy,
                                                                                                                   FirewallPolicyAssociation firewallPolicyAssociationResource)
        Inserts an association for the specified firewall policy.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
           String firewallPolicy = "firewallPolicy1819692626";
           FirewallPolicyAssociation firewallPolicyAssociationResource =
               FirewallPolicyAssociation.newBuilder().build();
           Operation response =
               firewallPoliciesClient
                   .addAssociationAsync(firewallPolicy, firewallPolicyAssociationResource)
                   .get();
         }
         
        Parameters:
        firewallPolicy - Name of the firewall policy to update.
        firewallPolicyAssociationResource - The body resource for this request
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • addAssociationAsync

        @BetaApi("The surface for long-running operations is not stable yet and may change in the future.")
        public final com.google.api.gax.longrunning.OperationFuture<Operation,​Operation> addAssociationAsync​(AddAssociationFirewallPolicyRequest request)
        Inserts an association for the specified firewall policy.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
           AddAssociationFirewallPolicyRequest request =
               AddAssociationFirewallPolicyRequest.newBuilder()
                   .setFirewallPolicy("firewallPolicy1819692626")
                   .setFirewallPolicyAssociationResource(FirewallPolicyAssociation.newBuilder().build())
                   .setReplaceExistingAssociation(true)
                   .setRequestId("requestId693933066")
                   .build();
           Operation response = firewallPoliciesClient.addAssociationAsync(request).get();
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • addAssociationOperationCallable

        public final com.google.api.gax.rpc.OperationCallable<AddAssociationFirewallPolicyRequest,​Operation,​Operation> addAssociationOperationCallable()
        Inserts an association for the specified firewall policy.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
           AddAssociationFirewallPolicyRequest request =
               AddAssociationFirewallPolicyRequest.newBuilder()
                   .setFirewallPolicy("firewallPolicy1819692626")
                   .setFirewallPolicyAssociationResource(FirewallPolicyAssociation.newBuilder().build())
                   .setReplaceExistingAssociation(true)
                   .setRequestId("requestId693933066")
                   .build();
           OperationFuture<Operation, Operation> future =
               firewallPoliciesClient.addAssociationOperationCallable().futureCall(request);
           // Do something.
           Operation response = future.get();
         }
         
      • addAssociationCallable

        public final com.google.api.gax.rpc.UnaryCallable<AddAssociationFirewallPolicyRequest,​Operation> addAssociationCallable()
        Inserts an association for the specified firewall policy.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
           AddAssociationFirewallPolicyRequest request =
               AddAssociationFirewallPolicyRequest.newBuilder()
                   .setFirewallPolicy("firewallPolicy1819692626")
                   .setFirewallPolicyAssociationResource(FirewallPolicyAssociation.newBuilder().build())
                   .setReplaceExistingAssociation(true)
                   .setRequestId("requestId693933066")
                   .build();
           ApiFuture<Operation> future =
               firewallPoliciesClient.addAssociationCallable().futureCall(request);
           // Do something.
           Operation response = future.get();
         }
         
      • addRuleAsync

        public final com.google.api.gax.longrunning.OperationFuture<Operation,​Operation> addRuleAsync​(String firewallPolicy,
                                                                                                            FirewallPolicyRule firewallPolicyRuleResource)
        Inserts a rule into a firewall policy.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
           String firewallPolicy = "firewallPolicy1819692626";
           FirewallPolicyRule firewallPolicyRuleResource = FirewallPolicyRule.newBuilder().build();
           Operation response =
               firewallPoliciesClient.addRuleAsync(firewallPolicy, firewallPolicyRuleResource).get();
         }
         
        Parameters:
        firewallPolicy - Name of the firewall policy to update.
        firewallPolicyRuleResource - The body resource for this request
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • addRuleAsync

        @BetaApi("The surface for long-running operations is not stable yet and may change in the future.")
        public final com.google.api.gax.longrunning.OperationFuture<Operation,​Operation> addRuleAsync​(AddRuleFirewallPolicyRequest request)
        Inserts a rule into a firewall policy.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
           AddRuleFirewallPolicyRequest request =
               AddRuleFirewallPolicyRequest.newBuilder()
                   .setFirewallPolicy("firewallPolicy1819692626")
                   .setFirewallPolicyRuleResource(FirewallPolicyRule.newBuilder().build())
                   .setRequestId("requestId693933066")
                   .build();
           Operation response = firewallPoliciesClient.addRuleAsync(request).get();
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • addRuleOperationCallable

        public final com.google.api.gax.rpc.OperationCallable<AddRuleFirewallPolicyRequest,​Operation,​Operation> addRuleOperationCallable()
        Inserts a rule into a firewall policy.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
           AddRuleFirewallPolicyRequest request =
               AddRuleFirewallPolicyRequest.newBuilder()
                   .setFirewallPolicy("firewallPolicy1819692626")
                   .setFirewallPolicyRuleResource(FirewallPolicyRule.newBuilder().build())
                   .setRequestId("requestId693933066")
                   .build();
           OperationFuture<Operation, Operation> future =
               firewallPoliciesClient.addRuleOperationCallable().futureCall(request);
           // Do something.
           Operation response = future.get();
         }
         
      • addRuleCallable

        public final com.google.api.gax.rpc.UnaryCallable<AddRuleFirewallPolicyRequest,​Operation> addRuleCallable()
        Inserts a rule into a firewall policy.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
           AddRuleFirewallPolicyRequest request =
               AddRuleFirewallPolicyRequest.newBuilder()
                   .setFirewallPolicy("firewallPolicy1819692626")
                   .setFirewallPolicyRuleResource(FirewallPolicyRule.newBuilder().build())
                   .setRequestId("requestId693933066")
                   .build();
           ApiFuture<Operation> future = firewallPoliciesClient.addRuleCallable().futureCall(request);
           // Do something.
           Operation response = future.get();
         }
         
      • cloneRulesAsync

        public final com.google.api.gax.longrunning.OperationFuture<Operation,​Operation> cloneRulesAsync​(String firewallPolicy)
        Copies rules to the specified firewall policy.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
           String firewallPolicy = "firewallPolicy1819692626";
           Operation response = firewallPoliciesClient.cloneRulesAsync(firewallPolicy).get();
         }
         
        Parameters:
        firewallPolicy - Name of the firewall policy to update.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • cloneRulesAsync

        @BetaApi("The surface for long-running operations is not stable yet and may change in the future.")
        public final com.google.api.gax.longrunning.OperationFuture<Operation,​Operation> cloneRulesAsync​(CloneRulesFirewallPolicyRequest request)
        Copies rules to the specified firewall policy.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
           CloneRulesFirewallPolicyRequest request =
               CloneRulesFirewallPolicyRequest.newBuilder()
                   .setFirewallPolicy("firewallPolicy1819692626")
                   .setRequestId("requestId693933066")
                   .setSourceFirewallPolicy("sourceFirewallPolicy-593774771")
                   .build();
           Operation response = firewallPoliciesClient.cloneRulesAsync(request).get();
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • cloneRulesOperationCallable

        public final com.google.api.gax.rpc.OperationCallable<CloneRulesFirewallPolicyRequest,​Operation,​Operation> cloneRulesOperationCallable()
        Copies rules to the specified firewall policy.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
           CloneRulesFirewallPolicyRequest request =
               CloneRulesFirewallPolicyRequest.newBuilder()
                   .setFirewallPolicy("firewallPolicy1819692626")
                   .setRequestId("requestId693933066")
                   .setSourceFirewallPolicy("sourceFirewallPolicy-593774771")
                   .build();
           OperationFuture<Operation, Operation> future =
               firewallPoliciesClient.cloneRulesOperationCallable().futureCall(request);
           // Do something.
           Operation response = future.get();
         }
         
      • cloneRulesCallable

        public final com.google.api.gax.rpc.UnaryCallable<CloneRulesFirewallPolicyRequest,​Operation> cloneRulesCallable()
        Copies rules to the specified firewall policy.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
           CloneRulesFirewallPolicyRequest request =
               CloneRulesFirewallPolicyRequest.newBuilder()
                   .setFirewallPolicy("firewallPolicy1819692626")
                   .setRequestId("requestId693933066")
                   .setSourceFirewallPolicy("sourceFirewallPolicy-593774771")
                   .build();
           ApiFuture<Operation> future = firewallPoliciesClient.cloneRulesCallable().futureCall(request);
           // Do something.
           Operation response = future.get();
         }
         
      • deleteAsync

        public final com.google.api.gax.longrunning.OperationFuture<Operation,​Operation> deleteAsync​(String firewallPolicy)
        Deletes the specified policy.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
           String firewallPolicy = "firewallPolicy1819692626";
           Operation response = firewallPoliciesClient.deleteAsync(firewallPolicy).get();
         }
         
        Parameters:
        firewallPolicy - Name of the firewall policy to delete.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • deleteAsync

        @BetaApi("The surface for long-running operations is not stable yet and may change in the future.")
        public final com.google.api.gax.longrunning.OperationFuture<Operation,​Operation> deleteAsync​(DeleteFirewallPolicyRequest request)
        Deletes the specified policy.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
           DeleteFirewallPolicyRequest request =
               DeleteFirewallPolicyRequest.newBuilder()
                   .setFirewallPolicy("firewallPolicy1819692626")
                   .setRequestId("requestId693933066")
                   .build();
           Operation response = firewallPoliciesClient.deleteAsync(request).get();
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • deleteOperationCallable

        public final com.google.api.gax.rpc.OperationCallable<DeleteFirewallPolicyRequest,​Operation,​Operation> deleteOperationCallable()
        Deletes the specified policy.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
           DeleteFirewallPolicyRequest request =
               DeleteFirewallPolicyRequest.newBuilder()
                   .setFirewallPolicy("firewallPolicy1819692626")
                   .setRequestId("requestId693933066")
                   .build();
           OperationFuture<Operation, Operation> future =
               firewallPoliciesClient.deleteOperationCallable().futureCall(request);
           // Do something.
           Operation response = future.get();
         }
         
      • deleteCallable

        public final com.google.api.gax.rpc.UnaryCallable<DeleteFirewallPolicyRequest,​Operation> deleteCallable()
        Deletes the specified policy.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
           DeleteFirewallPolicyRequest request =
               DeleteFirewallPolicyRequest.newBuilder()
                   .setFirewallPolicy("firewallPolicy1819692626")
                   .setRequestId("requestId693933066")
                   .build();
           ApiFuture<Operation> future = firewallPoliciesClient.deleteCallable().futureCall(request);
           // Do something.
           Operation response = future.get();
         }
         
      • get

        public final FirewallPolicy get​(String firewallPolicy)
        Returns the specified firewall policy.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
           String firewallPolicy = "firewallPolicy1819692626";
           FirewallPolicy response = firewallPoliciesClient.get(firewallPolicy);
         }
         
        Parameters:
        firewallPolicy - Name of the firewall policy to get.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • get

        public final FirewallPolicy get​(GetFirewallPolicyRequest request)
        Returns the specified firewall policy.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
           GetFirewallPolicyRequest request =
               GetFirewallPolicyRequest.newBuilder()
                   .setFirewallPolicy("firewallPolicy1819692626")
                   .build();
           FirewallPolicy response = firewallPoliciesClient.get(request);
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • getCallable

        public final com.google.api.gax.rpc.UnaryCallable<GetFirewallPolicyRequest,​FirewallPolicy> getCallable()
        Returns the specified firewall policy.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
           GetFirewallPolicyRequest request =
               GetFirewallPolicyRequest.newBuilder()
                   .setFirewallPolicy("firewallPolicy1819692626")
                   .build();
           ApiFuture<FirewallPolicy> future = firewallPoliciesClient.getCallable().futureCall(request);
           // Do something.
           FirewallPolicy response = future.get();
         }
         
      • getAssociation

        public final FirewallPolicyAssociation getAssociation​(String firewallPolicy)
        Gets an association with the specified name.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
           String firewallPolicy = "firewallPolicy1819692626";
           FirewallPolicyAssociation response = firewallPoliciesClient.getAssociation(firewallPolicy);
         }
         
        Parameters:
        firewallPolicy - Name of the firewall policy to which the queried rule belongs.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • getAssociation

        public final FirewallPolicyAssociation getAssociation​(GetAssociationFirewallPolicyRequest request)
        Gets an association with the specified name.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
           GetAssociationFirewallPolicyRequest request =
               GetAssociationFirewallPolicyRequest.newBuilder()
                   .setFirewallPolicy("firewallPolicy1819692626")
                   .setName("name3373707")
                   .build();
           FirewallPolicyAssociation response = firewallPoliciesClient.getAssociation(request);
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • getAssociationCallable

        public final com.google.api.gax.rpc.UnaryCallable<GetAssociationFirewallPolicyRequest,​FirewallPolicyAssociation> getAssociationCallable()
        Gets an association with the specified name.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
           GetAssociationFirewallPolicyRequest request =
               GetAssociationFirewallPolicyRequest.newBuilder()
                   .setFirewallPolicy("firewallPolicy1819692626")
                   .setName("name3373707")
                   .build();
           ApiFuture<FirewallPolicyAssociation> future =
               firewallPoliciesClient.getAssociationCallable().futureCall(request);
           // Do something.
           FirewallPolicyAssociation response = future.get();
         }
         
      • getIamPolicy

        public final Policy getIamPolicy​(String resource)
        Gets the access control policy for a resource. May be empty if no such policy or resource exists.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
           String resource = "resource-341064690";
           Policy response = firewallPoliciesClient.getIamPolicy(resource);
         }
         
        Parameters:
        resource - Name or id of the resource for this request.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • getIamPolicy

        public final Policy getIamPolicy​(GetIamPolicyFirewallPolicyRequest request)
        Gets the access control policy for a resource. May be empty if no such policy or resource exists.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
           GetIamPolicyFirewallPolicyRequest request =
               GetIamPolicyFirewallPolicyRequest.newBuilder()
                   .setOptionsRequestedPolicyVersion(-574521795)
                   .setResource("resource-341064690")
                   .build();
           Policy response = firewallPoliciesClient.getIamPolicy(request);
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • getIamPolicyCallable

        public final com.google.api.gax.rpc.UnaryCallable<GetIamPolicyFirewallPolicyRequest,​Policy> getIamPolicyCallable()
        Gets the access control policy for a resource. May be empty if no such policy or resource exists.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
           GetIamPolicyFirewallPolicyRequest request =
               GetIamPolicyFirewallPolicyRequest.newBuilder()
                   .setOptionsRequestedPolicyVersion(-574521795)
                   .setResource("resource-341064690")
                   .build();
           ApiFuture<Policy> future = firewallPoliciesClient.getIamPolicyCallable().futureCall(request);
           // Do something.
           Policy response = future.get();
         }
         
      • getRule

        public final FirewallPolicyRule getRule​(String firewallPolicy)
        Gets a rule of the specified priority.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
           String firewallPolicy = "firewallPolicy1819692626";
           FirewallPolicyRule response = firewallPoliciesClient.getRule(firewallPolicy);
         }
         
        Parameters:
        firewallPolicy - Name of the firewall policy to which the queried rule belongs.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • getRule

        public final FirewallPolicyRule getRule​(GetRuleFirewallPolicyRequest request)
        Gets a rule of the specified priority.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
           GetRuleFirewallPolicyRequest request =
               GetRuleFirewallPolicyRequest.newBuilder()
                   .setFirewallPolicy("firewallPolicy1819692626")
                   .setPriority(-1165461084)
                   .build();
           FirewallPolicyRule response = firewallPoliciesClient.getRule(request);
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • getRuleCallable

        public final com.google.api.gax.rpc.UnaryCallable<GetRuleFirewallPolicyRequest,​FirewallPolicyRule> getRuleCallable()
        Gets a rule of the specified priority.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
           GetRuleFirewallPolicyRequest request =
               GetRuleFirewallPolicyRequest.newBuilder()
                   .setFirewallPolicy("firewallPolicy1819692626")
                   .setPriority(-1165461084)
                   .build();
           ApiFuture<FirewallPolicyRule> future =
               firewallPoliciesClient.getRuleCallable().futureCall(request);
           // Do something.
           FirewallPolicyRule response = future.get();
         }
         
      • insertAsync

        public final com.google.api.gax.longrunning.OperationFuture<Operation,​Operation> insertAsync​(String parentId,
                                                                                                           FirewallPolicy firewallPolicyResource)
        Creates a new policy in the specified project using the data included in the 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
           String parentId = "parentId1175162725";
           FirewallPolicy firewallPolicyResource = FirewallPolicy.newBuilder().build();
           Operation response =
               firewallPoliciesClient.insertAsync(parentId, firewallPolicyResource).get();
         }
         
        Parameters:
        parentId - Parent ID for this request. The ID can be either be "folders/[FOLDER_ID]" if the parent is a folder or "organizations/[ORGANIZATION_ID]" if the parent is an organization.
        firewallPolicyResource - The body resource for this request
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • insertAsync

        @BetaApi("The surface for long-running operations is not stable yet and may change in the future.")
        public final com.google.api.gax.longrunning.OperationFuture<Operation,​Operation> insertAsync​(InsertFirewallPolicyRequest request)
        Creates a new policy in the specified project using the data included in the 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
           InsertFirewallPolicyRequest request =
               InsertFirewallPolicyRequest.newBuilder()
                   .setFirewallPolicyResource(FirewallPolicy.newBuilder().build())
                   .setParentId("parentId1175162725")
                   .setRequestId("requestId693933066")
                   .build();
           Operation response = firewallPoliciesClient.insertAsync(request).get();
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • insertOperationCallable

        public final com.google.api.gax.rpc.OperationCallable<InsertFirewallPolicyRequest,​Operation,​Operation> insertOperationCallable()
        Creates a new policy in the specified project using the data included in the 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
           InsertFirewallPolicyRequest request =
               InsertFirewallPolicyRequest.newBuilder()
                   .setFirewallPolicyResource(FirewallPolicy.newBuilder().build())
                   .setParentId("parentId1175162725")
                   .setRequestId("requestId693933066")
                   .build();
           OperationFuture<Operation, Operation> future =
               firewallPoliciesClient.insertOperationCallable().futureCall(request);
           // Do something.
           Operation response = future.get();
         }
         
      • insertCallable

        public final com.google.api.gax.rpc.UnaryCallable<InsertFirewallPolicyRequest,​Operation> insertCallable()
        Creates a new policy in the specified project using the data included in the 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
           InsertFirewallPolicyRequest request =
               InsertFirewallPolicyRequest.newBuilder()
                   .setFirewallPolicyResource(FirewallPolicy.newBuilder().build())
                   .setParentId("parentId1175162725")
                   .setRequestId("requestId693933066")
                   .build();
           ApiFuture<Operation> future = firewallPoliciesClient.insertCallable().futureCall(request);
           // Do something.
           Operation response = future.get();
         }
         
      • list

        public final FirewallPoliciesClient.ListPagedResponse list()
        Lists all the policies that have been configured for the specified folder or organization.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
           for (FirewallPolicy element : firewallPoliciesClient.list().iterateAll()) {
             // doThingsWith(element);
           }
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • list

        public final FirewallPoliciesClient.ListPagedResponse list​(ListFirewallPoliciesRequest request)
        Lists all the policies that have been configured for the specified folder or organization.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
           ListFirewallPoliciesRequest request =
               ListFirewallPoliciesRequest.newBuilder()
                   .setFilter("filter-1274492040")
                   .setMaxResults(1128457243)
                   .setOrderBy("orderBy-1207110587")
                   .setPageToken("pageToken873572522")
                   .setParentId("parentId1175162725")
                   .setReturnPartialSuccess(true)
                   .build();
           for (FirewallPolicy element : firewallPoliciesClient.list(request).iterateAll()) {
             // doThingsWith(element);
           }
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • listPagedCallable

        public final com.google.api.gax.rpc.UnaryCallable<ListFirewallPoliciesRequest,​FirewallPoliciesClient.ListPagedResponse> listPagedCallable()
        Lists all the policies that have been configured for the specified folder or organization.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
           ListFirewallPoliciesRequest request =
               ListFirewallPoliciesRequest.newBuilder()
                   .setFilter("filter-1274492040")
                   .setMaxResults(1128457243)
                   .setOrderBy("orderBy-1207110587")
                   .setPageToken("pageToken873572522")
                   .setParentId("parentId1175162725")
                   .setReturnPartialSuccess(true)
                   .build();
           ApiFuture<FirewallPolicy> future =
               firewallPoliciesClient.listPagedCallable().futureCall(request);
           // Do something.
           for (FirewallPolicy element : future.get().iterateAll()) {
             // doThingsWith(element);
           }
         }
         
      • listCallable

        public final com.google.api.gax.rpc.UnaryCallable<ListFirewallPoliciesRequest,​FirewallPolicyList> listCallable()
        Lists all the policies that have been configured for the specified folder or organization.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
           ListFirewallPoliciesRequest request =
               ListFirewallPoliciesRequest.newBuilder()
                   .setFilter("filter-1274492040")
                   .setMaxResults(1128457243)
                   .setOrderBy("orderBy-1207110587")
                   .setPageToken("pageToken873572522")
                   .setParentId("parentId1175162725")
                   .setReturnPartialSuccess(true)
                   .build();
           while (true) {
             FirewallPolicyList response = firewallPoliciesClient.listCallable().call(request);
             for (FirewallPolicy element : response.getItemsList()) {
               // doThingsWith(element);
             }
             String nextPageToken = response.getNextPageToken();
             if (!Strings.isNullOrEmpty(nextPageToken)) {
               request = request.toBuilder().setPageToken(nextPageToken).build();
             } else {
               break;
             }
           }
         }
         
      • listAssociations

        public final FirewallPoliciesListAssociationsResponse listAssociations()
        Lists associations of a specified target, i.e., organization or folder.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
           FirewallPoliciesListAssociationsResponse response = firewallPoliciesClient.listAssociations();
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • listAssociations

        public final FirewallPoliciesListAssociationsResponse listAssociations​(ListAssociationsFirewallPolicyRequest request)
        Lists associations of a specified target, i.e., organization or folder.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
           ListAssociationsFirewallPolicyRequest request =
               ListAssociationsFirewallPolicyRequest.newBuilder()
                   .setTargetResource("targetResource-1933150017")
                   .build();
           FirewallPoliciesListAssociationsResponse response =
               firewallPoliciesClient.listAssociations(request);
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • listAssociationsCallable

        public final com.google.api.gax.rpc.UnaryCallable<ListAssociationsFirewallPolicyRequest,​FirewallPoliciesListAssociationsResponse> listAssociationsCallable()
        Lists associations of a specified target, i.e., organization or folder.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
           ListAssociationsFirewallPolicyRequest request =
               ListAssociationsFirewallPolicyRequest.newBuilder()
                   .setTargetResource("targetResource-1933150017")
                   .build();
           ApiFuture<FirewallPoliciesListAssociationsResponse> future =
               firewallPoliciesClient.listAssociationsCallable().futureCall(request);
           // Do something.
           FirewallPoliciesListAssociationsResponse response = future.get();
         }
         
      • moveAsync

        public final com.google.api.gax.longrunning.OperationFuture<Operation,​Operation> moveAsync​(String firewallPolicy,
                                                                                                         String parentId)
        Moves the specified firewall policy.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
           String firewallPolicy = "firewallPolicy1819692626";
           String parentId = "parentId1175162725";
           Operation response = firewallPoliciesClient.moveAsync(firewallPolicy, parentId).get();
         }
         
        Parameters:
        firewallPolicy - Name of the firewall policy to update.
        parentId - The new parent of the firewall policy. The ID can be either be "folders/[FOLDER_ID]" if the parent is a folder or "organizations/[ORGANIZATION_ID]" if the parent is an organization.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • moveAsync

        @BetaApi("The surface for long-running operations is not stable yet and may change in the future.")
        public final com.google.api.gax.longrunning.OperationFuture<Operation,​Operation> moveAsync​(MoveFirewallPolicyRequest request)
        Moves the specified firewall policy.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
           MoveFirewallPolicyRequest request =
               MoveFirewallPolicyRequest.newBuilder()
                   .setFirewallPolicy("firewallPolicy1819692626")
                   .setParentId("parentId1175162725")
                   .setRequestId("requestId693933066")
                   .build();
           Operation response = firewallPoliciesClient.moveAsync(request).get();
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • moveOperationCallable

        public final com.google.api.gax.rpc.OperationCallable<MoveFirewallPolicyRequest,​Operation,​Operation> moveOperationCallable()
        Moves the specified firewall policy.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
           MoveFirewallPolicyRequest request =
               MoveFirewallPolicyRequest.newBuilder()
                   .setFirewallPolicy("firewallPolicy1819692626")
                   .setParentId("parentId1175162725")
                   .setRequestId("requestId693933066")
                   .build();
           OperationFuture<Operation, Operation> future =
               firewallPoliciesClient.moveOperationCallable().futureCall(request);
           // Do something.
           Operation response = future.get();
         }
         
      • moveCallable

        public final com.google.api.gax.rpc.UnaryCallable<MoveFirewallPolicyRequest,​Operation> moveCallable()
        Moves the specified firewall policy.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
           MoveFirewallPolicyRequest request =
               MoveFirewallPolicyRequest.newBuilder()
                   .setFirewallPolicy("firewallPolicy1819692626")
                   .setParentId("parentId1175162725")
                   .setRequestId("requestId693933066")
                   .build();
           ApiFuture<Operation> future = firewallPoliciesClient.moveCallable().futureCall(request);
           // Do something.
           Operation response = future.get();
         }
         
      • patchAsync

        public final com.google.api.gax.longrunning.OperationFuture<Operation,​Operation> patchAsync​(String firewallPolicy,
                                                                                                          FirewallPolicy firewallPolicyResource)
        Patches the specified policy with the data included in the 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
           String firewallPolicy = "firewallPolicy1819692626";
           FirewallPolicy firewallPolicyResource = FirewallPolicy.newBuilder().build();
           Operation response =
               firewallPoliciesClient.patchAsync(firewallPolicy, firewallPolicyResource).get();
         }
         
        Parameters:
        firewallPolicy - Name of the firewall policy to update.
        firewallPolicyResource - The body resource for this request
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • patchAsync

        @BetaApi("The surface for long-running operations is not stable yet and may change in the future.")
        public final com.google.api.gax.longrunning.OperationFuture<Operation,​Operation> patchAsync​(PatchFirewallPolicyRequest request)
        Patches the specified policy with the data included in the 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
           PatchFirewallPolicyRequest request =
               PatchFirewallPolicyRequest.newBuilder()
                   .setFirewallPolicy("firewallPolicy1819692626")
                   .setFirewallPolicyResource(FirewallPolicy.newBuilder().build())
                   .setRequestId("requestId693933066")
                   .build();
           Operation response = firewallPoliciesClient.patchAsync(request).get();
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • patchOperationCallable

        public final com.google.api.gax.rpc.OperationCallable<PatchFirewallPolicyRequest,​Operation,​Operation> patchOperationCallable()
        Patches the specified policy with the data included in the 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
           PatchFirewallPolicyRequest request =
               PatchFirewallPolicyRequest.newBuilder()
                   .setFirewallPolicy("firewallPolicy1819692626")
                   .setFirewallPolicyResource(FirewallPolicy.newBuilder().build())
                   .setRequestId("requestId693933066")
                   .build();
           OperationFuture<Operation, Operation> future =
               firewallPoliciesClient.patchOperationCallable().futureCall(request);
           // Do something.
           Operation response = future.get();
         }
         
      • patchCallable

        public final com.google.api.gax.rpc.UnaryCallable<PatchFirewallPolicyRequest,​Operation> patchCallable()
        Patches the specified policy with the data included in the 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
           PatchFirewallPolicyRequest request =
               PatchFirewallPolicyRequest.newBuilder()
                   .setFirewallPolicy("firewallPolicy1819692626")
                   .setFirewallPolicyResource(FirewallPolicy.newBuilder().build())
                   .setRequestId("requestId693933066")
                   .build();
           ApiFuture<Operation> future = firewallPoliciesClient.patchCallable().futureCall(request);
           // Do something.
           Operation response = future.get();
         }
         
      • patchRuleAsync

        public final com.google.api.gax.longrunning.OperationFuture<Operation,​Operation> patchRuleAsync​(String firewallPolicy,
                                                                                                              FirewallPolicyRule firewallPolicyRuleResource)
        Patches a rule of the specified priority.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
           String firewallPolicy = "firewallPolicy1819692626";
           FirewallPolicyRule firewallPolicyRuleResource = FirewallPolicyRule.newBuilder().build();
           Operation response =
               firewallPoliciesClient.patchRuleAsync(firewallPolicy, firewallPolicyRuleResource).get();
         }
         
        Parameters:
        firewallPolicy - Name of the firewall policy to update.
        firewallPolicyRuleResource - The body resource for this request
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • patchRuleAsync

        @BetaApi("The surface for long-running operations is not stable yet and may change in the future.")
        public final com.google.api.gax.longrunning.OperationFuture<Operation,​Operation> patchRuleAsync​(PatchRuleFirewallPolicyRequest request)
        Patches a rule of the specified priority.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
           PatchRuleFirewallPolicyRequest request =
               PatchRuleFirewallPolicyRequest.newBuilder()
                   .setFirewallPolicy("firewallPolicy1819692626")
                   .setFirewallPolicyRuleResource(FirewallPolicyRule.newBuilder().build())
                   .setPriority(-1165461084)
                   .setRequestId("requestId693933066")
                   .build();
           Operation response = firewallPoliciesClient.patchRuleAsync(request).get();
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • patchRuleOperationCallable

        public final com.google.api.gax.rpc.OperationCallable<PatchRuleFirewallPolicyRequest,​Operation,​Operation> patchRuleOperationCallable()
        Patches a rule of the specified priority.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
           PatchRuleFirewallPolicyRequest request =
               PatchRuleFirewallPolicyRequest.newBuilder()
                   .setFirewallPolicy("firewallPolicy1819692626")
                   .setFirewallPolicyRuleResource(FirewallPolicyRule.newBuilder().build())
                   .setPriority(-1165461084)
                   .setRequestId("requestId693933066")
                   .build();
           OperationFuture<Operation, Operation> future =
               firewallPoliciesClient.patchRuleOperationCallable().futureCall(request);
           // Do something.
           Operation response = future.get();
         }
         
      • patchRuleCallable

        public final com.google.api.gax.rpc.UnaryCallable<PatchRuleFirewallPolicyRequest,​Operation> patchRuleCallable()
        Patches a rule of the specified priority.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
           PatchRuleFirewallPolicyRequest request =
               PatchRuleFirewallPolicyRequest.newBuilder()
                   .setFirewallPolicy("firewallPolicy1819692626")
                   .setFirewallPolicyRuleResource(FirewallPolicyRule.newBuilder().build())
                   .setPriority(-1165461084)
                   .setRequestId("requestId693933066")
                   .build();
           ApiFuture<Operation> future = firewallPoliciesClient.patchRuleCallable().futureCall(request);
           // Do something.
           Operation response = future.get();
         }
         
      • removeAssociationAsync

        public final com.google.api.gax.longrunning.OperationFuture<Operation,​Operation> removeAssociationAsync​(String firewallPolicy)
        Removes an association for the specified firewall policy.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
           String firewallPolicy = "firewallPolicy1819692626";
           Operation response = firewallPoliciesClient.removeAssociationAsync(firewallPolicy).get();
         }
         
        Parameters:
        firewallPolicy - Name of the firewall policy to update.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • removeAssociationAsync

        @BetaApi("The surface for long-running operations is not stable yet and may change in the future.")
        public final com.google.api.gax.longrunning.OperationFuture<Operation,​Operation> removeAssociationAsync​(RemoveAssociationFirewallPolicyRequest request)
        Removes an association for the specified firewall policy.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
           RemoveAssociationFirewallPolicyRequest request =
               RemoveAssociationFirewallPolicyRequest.newBuilder()
                   .setFirewallPolicy("firewallPolicy1819692626")
                   .setName("name3373707")
                   .setRequestId("requestId693933066")
                   .build();
           Operation response = firewallPoliciesClient.removeAssociationAsync(request).get();
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • removeAssociationOperationCallable

        public final com.google.api.gax.rpc.OperationCallable<RemoveAssociationFirewallPolicyRequest,​Operation,​Operation> removeAssociationOperationCallable()
        Removes an association for the specified firewall policy.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
           RemoveAssociationFirewallPolicyRequest request =
               RemoveAssociationFirewallPolicyRequest.newBuilder()
                   .setFirewallPolicy("firewallPolicy1819692626")
                   .setName("name3373707")
                   .setRequestId("requestId693933066")
                   .build();
           OperationFuture<Operation, Operation> future =
               firewallPoliciesClient.removeAssociationOperationCallable().futureCall(request);
           // Do something.
           Operation response = future.get();
         }
         
      • removeAssociationCallable

        public final com.google.api.gax.rpc.UnaryCallable<RemoveAssociationFirewallPolicyRequest,​Operation> removeAssociationCallable()
        Removes an association for the specified firewall policy.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
           RemoveAssociationFirewallPolicyRequest request =
               RemoveAssociationFirewallPolicyRequest.newBuilder()
                   .setFirewallPolicy("firewallPolicy1819692626")
                   .setName("name3373707")
                   .setRequestId("requestId693933066")
                   .build();
           ApiFuture<Operation> future =
               firewallPoliciesClient.removeAssociationCallable().futureCall(request);
           // Do something.
           Operation response = future.get();
         }
         
      • removeRuleAsync

        public final com.google.api.gax.longrunning.OperationFuture<Operation,​Operation> removeRuleAsync​(String firewallPolicy)
        Deletes a rule of the specified priority.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
           String firewallPolicy = "firewallPolicy1819692626";
           Operation response = firewallPoliciesClient.removeRuleAsync(firewallPolicy).get();
         }
         
        Parameters:
        firewallPolicy - Name of the firewall policy to update.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • removeRuleAsync

        @BetaApi("The surface for long-running operations is not stable yet and may change in the future.")
        public final com.google.api.gax.longrunning.OperationFuture<Operation,​Operation> removeRuleAsync​(RemoveRuleFirewallPolicyRequest request)
        Deletes a rule of the specified priority.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
           RemoveRuleFirewallPolicyRequest request =
               RemoveRuleFirewallPolicyRequest.newBuilder()
                   .setFirewallPolicy("firewallPolicy1819692626")
                   .setPriority(-1165461084)
                   .setRequestId("requestId693933066")
                   .build();
           Operation response = firewallPoliciesClient.removeRuleAsync(request).get();
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • removeRuleOperationCallable

        public final com.google.api.gax.rpc.OperationCallable<RemoveRuleFirewallPolicyRequest,​Operation,​Operation> removeRuleOperationCallable()
        Deletes a rule of the specified priority.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
           RemoveRuleFirewallPolicyRequest request =
               RemoveRuleFirewallPolicyRequest.newBuilder()
                   .setFirewallPolicy("firewallPolicy1819692626")
                   .setPriority(-1165461084)
                   .setRequestId("requestId693933066")
                   .build();
           OperationFuture<Operation, Operation> future =
               firewallPoliciesClient.removeRuleOperationCallable().futureCall(request);
           // Do something.
           Operation response = future.get();
         }
         
      • removeRuleCallable

        public final com.google.api.gax.rpc.UnaryCallable<RemoveRuleFirewallPolicyRequest,​Operation> removeRuleCallable()
        Deletes a rule of the specified priority.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
           RemoveRuleFirewallPolicyRequest request =
               RemoveRuleFirewallPolicyRequest.newBuilder()
                   .setFirewallPolicy("firewallPolicy1819692626")
                   .setPriority(-1165461084)
                   .setRequestId("requestId693933066")
                   .build();
           ApiFuture<Operation> future = firewallPoliciesClient.removeRuleCallable().futureCall(request);
           // Do something.
           Operation response = future.get();
         }
         
      • setIamPolicy

        public final Policy setIamPolicy​(String resource,
                                         GlobalOrganizationSetPolicyRequest globalOrganizationSetPolicyRequestResource)
        Sets the access control policy on the specified resource. Replaces any existing policy.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
           String resource = "resource-341064690";
           GlobalOrganizationSetPolicyRequest globalOrganizationSetPolicyRequestResource =
               GlobalOrganizationSetPolicyRequest.newBuilder().build();
           Policy response =
               firewallPoliciesClient.setIamPolicy(resource, globalOrganizationSetPolicyRequestResource);
         }
         
        Parameters:
        resource - Name or id of the resource for this request.
        globalOrganizationSetPolicyRequestResource - The body resource for this request
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • setIamPolicy

        public final Policy setIamPolicy​(SetIamPolicyFirewallPolicyRequest request)
        Sets the access control policy on the specified resource. Replaces any existing policy.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
           SetIamPolicyFirewallPolicyRequest request =
               SetIamPolicyFirewallPolicyRequest.newBuilder()
                   .setGlobalOrganizationSetPolicyRequestResource(
                       GlobalOrganizationSetPolicyRequest.newBuilder().build())
                   .setResource("resource-341064690")
                   .build();
           Policy response = firewallPoliciesClient.setIamPolicy(request);
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • setIamPolicyCallable

        public final com.google.api.gax.rpc.UnaryCallable<SetIamPolicyFirewallPolicyRequest,​Policy> setIamPolicyCallable()
        Sets the access control policy on the specified resource. Replaces any existing policy.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
           SetIamPolicyFirewallPolicyRequest request =
               SetIamPolicyFirewallPolicyRequest.newBuilder()
                   .setGlobalOrganizationSetPolicyRequestResource(
                       GlobalOrganizationSetPolicyRequest.newBuilder().build())
                   .setResource("resource-341064690")
                   .build();
           ApiFuture<Policy> future = firewallPoliciesClient.setIamPolicyCallable().futureCall(request);
           // Do something.
           Policy response = future.get();
         }
         
      • testIamPermissions

        public final TestPermissionsResponse testIamPermissions​(String resource,
                                                                TestPermissionsRequest testPermissionsRequestResource)
        Returns permissions that a caller has on the specified resource.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
           String resource = "resource-341064690";
           TestPermissionsRequest testPermissionsRequestResource =
               TestPermissionsRequest.newBuilder().build();
           TestPermissionsResponse response =
               firewallPoliciesClient.testIamPermissions(resource, testPermissionsRequestResource);
         }
         
        Parameters:
        resource - Name or id of the resource for this request.
        testPermissionsRequestResource - The body resource for this request
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • testIamPermissions

        public final TestPermissionsResponse testIamPermissions​(TestIamPermissionsFirewallPolicyRequest request)
        Returns permissions that a caller has on the specified resource.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
           TestIamPermissionsFirewallPolicyRequest request =
               TestIamPermissionsFirewallPolicyRequest.newBuilder()
                   .setResource("resource-341064690")
                   .setTestPermissionsRequestResource(TestPermissionsRequest.newBuilder().build())
                   .build();
           TestPermissionsResponse response = firewallPoliciesClient.testIamPermissions(request);
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • testIamPermissionsCallable

        public final com.google.api.gax.rpc.UnaryCallable<TestIamPermissionsFirewallPolicyRequest,​TestPermissionsResponse> testIamPermissionsCallable()
        Returns permissions that a caller has on the specified resource.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
           TestIamPermissionsFirewallPolicyRequest request =
               TestIamPermissionsFirewallPolicyRequest.newBuilder()
                   .setResource("resource-341064690")
                   .setTestPermissionsRequestResource(TestPermissionsRequest.newBuilder().build())
                   .build();
           ApiFuture<TestPermissionsResponse> future =
               firewallPoliciesClient.testIamPermissionsCallable().futureCall(request);
           // Do something.
           TestPermissionsResponse response = future.get();
         }
         
      • shutdown

        public void shutdown()
        Specified by:
        shutdown in interface com.google.api.gax.core.BackgroundResource
      • isShutdown

        public boolean isShutdown()
        Specified by:
        isShutdown in interface com.google.api.gax.core.BackgroundResource
      • isTerminated

        public boolean isTerminated()
        Specified by:
        isTerminated in interface com.google.api.gax.core.BackgroundResource
      • shutdownNow

        public void shutdownNow()
        Specified by:
        shutdownNow in interface com.google.api.gax.core.BackgroundResource