Class NetworkFirewallPoliciesClient (1.19.0)

public class NetworkFirewallPoliciesClient implements BackgroundResource

Service Description: The NetworkFirewallPolicies 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 (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
     NetworkFirewallPoliciesClient.create()) {
   String project = "project-309310695";
   String firewallPolicy = "firewallPolicy1819692626";
   FirewallPolicy response = networkFirewallPoliciesClient.get(project, firewallPolicy);
 }
 

Note: close() needs to be called on the NetworkFirewallPoliciesClient 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 NetworkFirewallPoliciesSettings 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
 NetworkFirewallPoliciesSettings networkFirewallPoliciesSettings =
     NetworkFirewallPoliciesSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
     NetworkFirewallPoliciesClient.create(networkFirewallPoliciesSettings);
 

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
 NetworkFirewallPoliciesSettings networkFirewallPoliciesSettings =
     NetworkFirewallPoliciesSettings.newBuilder().setEndpoint(myEndpoint).build();
 NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
     NetworkFirewallPoliciesClient.create(networkFirewallPoliciesSettings);
 

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

Inheritance

java.lang.Object > NetworkFirewallPoliciesClient

Implements

BackgroundResource

Static Methods

create()

public static final NetworkFirewallPoliciesClient create()

Constructs an instance of NetworkFirewallPoliciesClient with default settings.

Returns
TypeDescription
NetworkFirewallPoliciesClient
Exceptions
TypeDescription
IOException

create(NetworkFirewallPoliciesSettings settings)

public static final NetworkFirewallPoliciesClient create(NetworkFirewallPoliciesSettings settings)

Constructs an instance of NetworkFirewallPoliciesClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.

Parameter
NameDescription
settingsNetworkFirewallPoliciesSettings
Returns
TypeDescription
NetworkFirewallPoliciesClient
Exceptions
TypeDescription
IOException

create(NetworkFirewallPoliciesStub stub)

public static final NetworkFirewallPoliciesClient create(NetworkFirewallPoliciesStub stub)

Constructs an instance of NetworkFirewallPoliciesClient, using the given stub for making calls. This is for advanced usage - prefer using create(NetworkFirewallPoliciesSettings).

Parameter
NameDescription
stubNetworkFirewallPoliciesStub
Returns
TypeDescription
NetworkFirewallPoliciesClient

Constructors

NetworkFirewallPoliciesClient(NetworkFirewallPoliciesSettings settings)

protected NetworkFirewallPoliciesClient(NetworkFirewallPoliciesSettings settings)

Constructs an instance of NetworkFirewallPoliciesClient, 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.

Parameter
NameDescription
settingsNetworkFirewallPoliciesSettings

NetworkFirewallPoliciesClient(NetworkFirewallPoliciesStub stub)

protected NetworkFirewallPoliciesClient(NetworkFirewallPoliciesStub stub)
Parameter
NameDescription
stubNetworkFirewallPoliciesStub

Methods

addAssociationAsync(AddAssociationNetworkFirewallPolicyRequest request)

public final OperationFuture<Operation,Operation> addAssociationAsync(AddAssociationNetworkFirewallPolicyRequest 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 (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
     NetworkFirewallPoliciesClient.create()) {
   AddAssociationNetworkFirewallPolicyRequest request =
       AddAssociationNetworkFirewallPolicyRequest.newBuilder()
           .setFirewallPolicy("firewallPolicy1819692626")
           .setFirewallPolicyAssociationResource(FirewallPolicyAssociation.newBuilder().build())
           .setProject("project-309310695")
           .setReplaceExistingAssociation(true)
           .setRequestId("requestId693933066")
           .build();
   Operation response = networkFirewallPoliciesClient.addAssociationAsync(request).get();
 }
 
Parameter
NameDescription
requestAddAssociationNetworkFirewallPolicyRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
OperationFuture<Operation,Operation>

addAssociationAsync(String project, String firewallPolicy, FirewallPolicyAssociation firewallPolicyAssociationResource)

public final OperationFuture<Operation,Operation> addAssociationAsync(String project, 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 (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
     NetworkFirewallPoliciesClient.create()) {
   String project = "project-309310695";
   String firewallPolicy = "firewallPolicy1819692626";
   FirewallPolicyAssociation firewallPolicyAssociationResource =
       FirewallPolicyAssociation.newBuilder().build();
   Operation response =
       networkFirewallPoliciesClient
           .addAssociationAsync(project, firewallPolicy, firewallPolicyAssociationResource)
           .get();
 }
 
Parameters
NameDescription
projectString

Project ID for this request.

firewallPolicyString

Name of the firewall policy to update.

firewallPolicyAssociationResourceFirewallPolicyAssociation

The body resource for this request

Returns
TypeDescription
OperationFuture<Operation,Operation>

addAssociationCallable()

public final UnaryCallable<AddAssociationNetworkFirewallPolicyRequest,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 (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
     NetworkFirewallPoliciesClient.create()) {
   AddAssociationNetworkFirewallPolicyRequest request =
       AddAssociationNetworkFirewallPolicyRequest.newBuilder()
           .setFirewallPolicy("firewallPolicy1819692626")
           .setFirewallPolicyAssociationResource(FirewallPolicyAssociation.newBuilder().build())
           .setProject("project-309310695")
           .setReplaceExistingAssociation(true)
           .setRequestId("requestId693933066")
           .build();
   ApiFuture<Operation> future =
       networkFirewallPoliciesClient.addAssociationCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<AddAssociationNetworkFirewallPolicyRequest,Operation>

addAssociationOperationCallable()

public final OperationCallable<AddAssociationNetworkFirewallPolicyRequest,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 (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
     NetworkFirewallPoliciesClient.create()) {
   AddAssociationNetworkFirewallPolicyRequest request =
       AddAssociationNetworkFirewallPolicyRequest.newBuilder()
           .setFirewallPolicy("firewallPolicy1819692626")
           .setFirewallPolicyAssociationResource(FirewallPolicyAssociation.newBuilder().build())
           .setProject("project-309310695")
           .setReplaceExistingAssociation(true)
           .setRequestId("requestId693933066")
           .build();
   OperationFuture<Operation, Operation> future =
       networkFirewallPoliciesClient.addAssociationOperationCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
OperationCallable<AddAssociationNetworkFirewallPolicyRequest,Operation,Operation>

addRuleAsync(AddRuleNetworkFirewallPolicyRequest request)

public final OperationFuture<Operation,Operation> addRuleAsync(AddRuleNetworkFirewallPolicyRequest 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 (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
     NetworkFirewallPoliciesClient.create()) {
   AddRuleNetworkFirewallPolicyRequest request =
       AddRuleNetworkFirewallPolicyRequest.newBuilder()
           .setFirewallPolicy("firewallPolicy1819692626")
           .setFirewallPolicyRuleResource(FirewallPolicyRule.newBuilder().build())
           .setMaxPriority(-207235553)
           .setMinPriority(267190513)
           .setProject("project-309310695")
           .setRequestId("requestId693933066")
           .build();
   Operation response = networkFirewallPoliciesClient.addRuleAsync(request).get();
 }
 
Parameter
NameDescription
requestAddRuleNetworkFirewallPolicyRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
OperationFuture<Operation,Operation>

addRuleAsync(String project, String firewallPolicy, FirewallPolicyRule firewallPolicyRuleResource)

public final OperationFuture<Operation,Operation> addRuleAsync(String project, 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 (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
     NetworkFirewallPoliciesClient.create()) {
   String project = "project-309310695";
   String firewallPolicy = "firewallPolicy1819692626";
   FirewallPolicyRule firewallPolicyRuleResource = FirewallPolicyRule.newBuilder().build();
   Operation response =
       networkFirewallPoliciesClient
           .addRuleAsync(project, firewallPolicy, firewallPolicyRuleResource)
           .get();
 }
 
Parameters
NameDescription
projectString

Project ID for this request.

firewallPolicyString

Name of the firewall policy to update.

firewallPolicyRuleResourceFirewallPolicyRule

The body resource for this request

Returns
TypeDescription
OperationFuture<Operation,Operation>

addRuleCallable()

public final UnaryCallable<AddRuleNetworkFirewallPolicyRequest,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 (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
     NetworkFirewallPoliciesClient.create()) {
   AddRuleNetworkFirewallPolicyRequest request =
       AddRuleNetworkFirewallPolicyRequest.newBuilder()
           .setFirewallPolicy("firewallPolicy1819692626")
           .setFirewallPolicyRuleResource(FirewallPolicyRule.newBuilder().build())
           .setMaxPriority(-207235553)
           .setMinPriority(267190513)
           .setProject("project-309310695")
           .setRequestId("requestId693933066")
           .build();
   ApiFuture<Operation> future =
       networkFirewallPoliciesClient.addRuleCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<AddRuleNetworkFirewallPolicyRequest,Operation>

addRuleOperationCallable()

public final OperationCallable<AddRuleNetworkFirewallPolicyRequest,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 (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
     NetworkFirewallPoliciesClient.create()) {
   AddRuleNetworkFirewallPolicyRequest request =
       AddRuleNetworkFirewallPolicyRequest.newBuilder()
           .setFirewallPolicy("firewallPolicy1819692626")
           .setFirewallPolicyRuleResource(FirewallPolicyRule.newBuilder().build())
           .setMaxPriority(-207235553)
           .setMinPriority(267190513)
           .setProject("project-309310695")
           .setRequestId("requestId693933066")
           .build();
   OperationFuture<Operation, Operation> future =
       networkFirewallPoliciesClient.addRuleOperationCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
OperationCallable<AddRuleNetworkFirewallPolicyRequest,Operation,Operation>

awaitTermination(long duration, TimeUnit unit)

public boolean awaitTermination(long duration, TimeUnit unit)
Parameters
NameDescription
durationlong
unitTimeUnit
Returns
TypeDescription
boolean
Exceptions
TypeDescription
InterruptedException

cloneRulesAsync(CloneRulesNetworkFirewallPolicyRequest request)

public final OperationFuture<Operation,Operation> cloneRulesAsync(CloneRulesNetworkFirewallPolicyRequest 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 (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
     NetworkFirewallPoliciesClient.create()) {
   CloneRulesNetworkFirewallPolicyRequest request =
       CloneRulesNetworkFirewallPolicyRequest.newBuilder()
           .setFirewallPolicy("firewallPolicy1819692626")
           .setProject("project-309310695")
           .setRequestId("requestId693933066")
           .setSourceFirewallPolicy("sourceFirewallPolicy-593774771")
           .build();
   Operation response = networkFirewallPoliciesClient.cloneRulesAsync(request).get();
 }
 
Parameter
NameDescription
requestCloneRulesNetworkFirewallPolicyRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
OperationFuture<Operation,Operation>

cloneRulesAsync(String project, String firewallPolicy)

public final OperationFuture<Operation,Operation> cloneRulesAsync(String project, 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 (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
     NetworkFirewallPoliciesClient.create()) {
   String project = "project-309310695";
   String firewallPolicy = "firewallPolicy1819692626";
   Operation response =
       networkFirewallPoliciesClient.cloneRulesAsync(project, firewallPolicy).get();
 }
 
Parameters
NameDescription
projectString

Project ID for this request.

firewallPolicyString

Name of the firewall policy to update.

Returns
TypeDescription
OperationFuture<Operation,Operation>

cloneRulesCallable()

public final UnaryCallable<CloneRulesNetworkFirewallPolicyRequest,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 (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
     NetworkFirewallPoliciesClient.create()) {
   CloneRulesNetworkFirewallPolicyRequest request =
       CloneRulesNetworkFirewallPolicyRequest.newBuilder()
           .setFirewallPolicy("firewallPolicy1819692626")
           .setProject("project-309310695")
           .setRequestId("requestId693933066")
           .setSourceFirewallPolicy("sourceFirewallPolicy-593774771")
           .build();
   ApiFuture<Operation> future =
       networkFirewallPoliciesClient.cloneRulesCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<CloneRulesNetworkFirewallPolicyRequest,Operation>

cloneRulesOperationCallable()

public final OperationCallable<CloneRulesNetworkFirewallPolicyRequest,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 (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
     NetworkFirewallPoliciesClient.create()) {
   CloneRulesNetworkFirewallPolicyRequest request =
       CloneRulesNetworkFirewallPolicyRequest.newBuilder()
           .setFirewallPolicy("firewallPolicy1819692626")
           .setProject("project-309310695")
           .setRequestId("requestId693933066")
           .setSourceFirewallPolicy("sourceFirewallPolicy-593774771")
           .build();
   OperationFuture<Operation, Operation> future =
       networkFirewallPoliciesClient.cloneRulesOperationCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
OperationCallable<CloneRulesNetworkFirewallPolicyRequest,Operation,Operation>

close()

public final void close()

deleteAsync(DeleteNetworkFirewallPolicyRequest request)

public final OperationFuture<Operation,Operation> deleteAsync(DeleteNetworkFirewallPolicyRequest 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 (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
     NetworkFirewallPoliciesClient.create()) {
   DeleteNetworkFirewallPolicyRequest request =
       DeleteNetworkFirewallPolicyRequest.newBuilder()
           .setFirewallPolicy("firewallPolicy1819692626")
           .setProject("project-309310695")
           .setRequestId("requestId693933066")
           .build();
   Operation response = networkFirewallPoliciesClient.deleteAsync(request).get();
 }
 
Parameter
NameDescription
requestDeleteNetworkFirewallPolicyRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
OperationFuture<Operation,Operation>

deleteAsync(String project, String firewallPolicy)

public final OperationFuture<Operation,Operation> deleteAsync(String project, 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 (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
     NetworkFirewallPoliciesClient.create()) {
   String project = "project-309310695";
   String firewallPolicy = "firewallPolicy1819692626";
   Operation response = networkFirewallPoliciesClient.deleteAsync(project, firewallPolicy).get();
 }
 
Parameters
NameDescription
projectString

Project ID for this request.

firewallPolicyString

Name of the firewall policy to delete.

Returns
TypeDescription
OperationFuture<Operation,Operation>

deleteCallable()

public final UnaryCallable<DeleteNetworkFirewallPolicyRequest,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 (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
     NetworkFirewallPoliciesClient.create()) {
   DeleteNetworkFirewallPolicyRequest request =
       DeleteNetworkFirewallPolicyRequest.newBuilder()
           .setFirewallPolicy("firewallPolicy1819692626")
           .setProject("project-309310695")
           .setRequestId("requestId693933066")
           .build();
   ApiFuture<Operation> future =
       networkFirewallPoliciesClient.deleteCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<DeleteNetworkFirewallPolicyRequest,Operation>

deleteOperationCallable()

public final OperationCallable<DeleteNetworkFirewallPolicyRequest,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 (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
     NetworkFirewallPoliciesClient.create()) {
   DeleteNetworkFirewallPolicyRequest request =
       DeleteNetworkFirewallPolicyRequest.newBuilder()
           .setFirewallPolicy("firewallPolicy1819692626")
           .setProject("project-309310695")
           .setRequestId("requestId693933066")
           .build();
   OperationFuture<Operation, Operation> future =
       networkFirewallPoliciesClient.deleteOperationCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
OperationCallable<DeleteNetworkFirewallPolicyRequest,Operation,Operation>

get(GetNetworkFirewallPolicyRequest request)

public final FirewallPolicy get(GetNetworkFirewallPolicyRequest request)

Returns the specified network 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 (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
     NetworkFirewallPoliciesClient.create()) {
   GetNetworkFirewallPolicyRequest request =
       GetNetworkFirewallPolicyRequest.newBuilder()
           .setFirewallPolicy("firewallPolicy1819692626")
           .setProject("project-309310695")
           .build();
   FirewallPolicy response = networkFirewallPoliciesClient.get(request);
 }
 
Parameter
NameDescription
requestGetNetworkFirewallPolicyRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
FirewallPolicy

get(String project, String firewallPolicy)

public final FirewallPolicy get(String project, String firewallPolicy)

Returns the specified network 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 (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
     NetworkFirewallPoliciesClient.create()) {
   String project = "project-309310695";
   String firewallPolicy = "firewallPolicy1819692626";
   FirewallPolicy response = networkFirewallPoliciesClient.get(project, firewallPolicy);
 }
 
Parameters
NameDescription
projectString

Project ID for this request.

firewallPolicyString

Name of the firewall policy to get.

Returns
TypeDescription
FirewallPolicy

getAssociation(GetAssociationNetworkFirewallPolicyRequest request)

public final FirewallPolicyAssociation getAssociation(GetAssociationNetworkFirewallPolicyRequest 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 (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
     NetworkFirewallPoliciesClient.create()) {
   GetAssociationNetworkFirewallPolicyRequest request =
       GetAssociationNetworkFirewallPolicyRequest.newBuilder()
           .setFirewallPolicy("firewallPolicy1819692626")
           .setName("name3373707")
           .setProject("project-309310695")
           .build();
   FirewallPolicyAssociation response = networkFirewallPoliciesClient.getAssociation(request);
 }
 
Parameter
NameDescription
requestGetAssociationNetworkFirewallPolicyRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
FirewallPolicyAssociation

getAssociation(String project, String firewallPolicy)

public final FirewallPolicyAssociation getAssociation(String project, 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 (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
     NetworkFirewallPoliciesClient.create()) {
   String project = "project-309310695";
   String firewallPolicy = "firewallPolicy1819692626";
   FirewallPolicyAssociation response =
       networkFirewallPoliciesClient.getAssociation(project, firewallPolicy);
 }
 
Parameters
NameDescription
projectString

Project ID for this request.

firewallPolicyString

Name of the firewall policy to which the queried association belongs.

Returns
TypeDescription
FirewallPolicyAssociation

getAssociationCallable()

public final UnaryCallable<GetAssociationNetworkFirewallPolicyRequest,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 (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
     NetworkFirewallPoliciesClient.create()) {
   GetAssociationNetworkFirewallPolicyRequest request =
       GetAssociationNetworkFirewallPolicyRequest.newBuilder()
           .setFirewallPolicy("firewallPolicy1819692626")
           .setName("name3373707")
           .setProject("project-309310695")
           .build();
   ApiFuture<FirewallPolicyAssociation> future =
       networkFirewallPoliciesClient.getAssociationCallable().futureCall(request);
   // Do something.
   FirewallPolicyAssociation response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<GetAssociationNetworkFirewallPolicyRequest,FirewallPolicyAssociation>

getCallable()

public final UnaryCallable<GetNetworkFirewallPolicyRequest,FirewallPolicy> getCallable()

Returns the specified network 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 (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
     NetworkFirewallPoliciesClient.create()) {
   GetNetworkFirewallPolicyRequest request =
       GetNetworkFirewallPolicyRequest.newBuilder()
           .setFirewallPolicy("firewallPolicy1819692626")
           .setProject("project-309310695")
           .build();
   ApiFuture<FirewallPolicy> future =
       networkFirewallPoliciesClient.getCallable().futureCall(request);
   // Do something.
   FirewallPolicy response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<GetNetworkFirewallPolicyRequest,FirewallPolicy>

getIamPolicy(GetIamPolicyNetworkFirewallPolicyRequest request)

public final Policy getIamPolicy(GetIamPolicyNetworkFirewallPolicyRequest 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 (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
     NetworkFirewallPoliciesClient.create()) {
   GetIamPolicyNetworkFirewallPolicyRequest request =
       GetIamPolicyNetworkFirewallPolicyRequest.newBuilder()
           .setOptionsRequestedPolicyVersion(-574521795)
           .setProject("project-309310695")
           .setResource("resource-341064690")
           .build();
   Policy response = networkFirewallPoliciesClient.getIamPolicy(request);
 }
 
Parameter
NameDescription
requestGetIamPolicyNetworkFirewallPolicyRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
Policy

getIamPolicy(String project, String resource)

public final Policy getIamPolicy(String project, 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 (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
     NetworkFirewallPoliciesClient.create()) {
   String project = "project-309310695";
   String resource = "resource-341064690";
   Policy response = networkFirewallPoliciesClient.getIamPolicy(project, resource);
 }
 
Parameters
NameDescription
projectString

Project ID for this request.

resourceString

Name or id of the resource for this request.

Returns
TypeDescription
Policy

getIamPolicyCallable()

public final UnaryCallable<GetIamPolicyNetworkFirewallPolicyRequest,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 (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
     NetworkFirewallPoliciesClient.create()) {
   GetIamPolicyNetworkFirewallPolicyRequest request =
       GetIamPolicyNetworkFirewallPolicyRequest.newBuilder()
           .setOptionsRequestedPolicyVersion(-574521795)
           .setProject("project-309310695")
           .setResource("resource-341064690")
           .build();
   ApiFuture<Policy> future =
       networkFirewallPoliciesClient.getIamPolicyCallable().futureCall(request);
   // Do something.
   Policy response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<GetIamPolicyNetworkFirewallPolicyRequest,Policy>

getRule(GetRuleNetworkFirewallPolicyRequest request)

public final FirewallPolicyRule getRule(GetRuleNetworkFirewallPolicyRequest 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 (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
     NetworkFirewallPoliciesClient.create()) {
   GetRuleNetworkFirewallPolicyRequest request =
       GetRuleNetworkFirewallPolicyRequest.newBuilder()
           .setFirewallPolicy("firewallPolicy1819692626")
           .setPriority(-1165461084)
           .setProject("project-309310695")
           .build();
   FirewallPolicyRule response = networkFirewallPoliciesClient.getRule(request);
 }
 
Parameter
NameDescription
requestGetRuleNetworkFirewallPolicyRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
FirewallPolicyRule

getRule(String project, String firewallPolicy)

public final FirewallPolicyRule getRule(String project, 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 (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
     NetworkFirewallPoliciesClient.create()) {
   String project = "project-309310695";
   String firewallPolicy = "firewallPolicy1819692626";
   FirewallPolicyRule response = networkFirewallPoliciesClient.getRule(project, firewallPolicy);
 }
 
Parameters
NameDescription
projectString

Project ID for this request.

firewallPolicyString

Name of the firewall policy to which the queried rule belongs.

Returns
TypeDescription
FirewallPolicyRule

getRuleCallable()

public final UnaryCallable<GetRuleNetworkFirewallPolicyRequest,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 (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
     NetworkFirewallPoliciesClient.create()) {
   GetRuleNetworkFirewallPolicyRequest request =
       GetRuleNetworkFirewallPolicyRequest.newBuilder()
           .setFirewallPolicy("firewallPolicy1819692626")
           .setPriority(-1165461084)
           .setProject("project-309310695")
           .build();
   ApiFuture<FirewallPolicyRule> future =
       networkFirewallPoliciesClient.getRuleCallable().futureCall(request);
   // Do something.
   FirewallPolicyRule response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<GetRuleNetworkFirewallPolicyRequest,FirewallPolicyRule>

getSettings()

public final NetworkFirewallPoliciesSettings getSettings()
Returns
TypeDescription
NetworkFirewallPoliciesSettings

getStub()

public NetworkFirewallPoliciesStub getStub()
Returns
TypeDescription
NetworkFirewallPoliciesStub

insertAsync(InsertNetworkFirewallPolicyRequest request)

public final OperationFuture<Operation,Operation> insertAsync(InsertNetworkFirewallPolicyRequest 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 (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
     NetworkFirewallPoliciesClient.create()) {
   InsertNetworkFirewallPolicyRequest request =
       InsertNetworkFirewallPolicyRequest.newBuilder()
           .setFirewallPolicyResource(FirewallPolicy.newBuilder().build())
           .setProject("project-309310695")
           .setRequestId("requestId693933066")
           .build();
   Operation response = networkFirewallPoliciesClient.insertAsync(request).get();
 }
 
Parameter
NameDescription
requestInsertNetworkFirewallPolicyRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
OperationFuture<Operation,Operation>

insertAsync(String project, FirewallPolicy firewallPolicyResource)

public final OperationFuture<Operation,Operation> insertAsync(String project, 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 (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
     NetworkFirewallPoliciesClient.create()) {
   String project = "project-309310695";
   FirewallPolicy firewallPolicyResource = FirewallPolicy.newBuilder().build();
   Operation response =
       networkFirewallPoliciesClient.insertAsync(project, firewallPolicyResource).get();
 }
 
Parameters
NameDescription
projectString

Project ID for this request.

firewallPolicyResourceFirewallPolicy

The body resource for this request

Returns
TypeDescription
OperationFuture<Operation,Operation>

insertCallable()

public final UnaryCallable<InsertNetworkFirewallPolicyRequest,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 (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
     NetworkFirewallPoliciesClient.create()) {
   InsertNetworkFirewallPolicyRequest request =
       InsertNetworkFirewallPolicyRequest.newBuilder()
           .setFirewallPolicyResource(FirewallPolicy.newBuilder().build())
           .setProject("project-309310695")
           .setRequestId("requestId693933066")
           .build();
   ApiFuture<Operation> future =
       networkFirewallPoliciesClient.insertCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<InsertNetworkFirewallPolicyRequest,Operation>

insertOperationCallable()

public final OperationCallable<InsertNetworkFirewallPolicyRequest,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 (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
     NetworkFirewallPoliciesClient.create()) {
   InsertNetworkFirewallPolicyRequest request =
       InsertNetworkFirewallPolicyRequest.newBuilder()
           .setFirewallPolicyResource(FirewallPolicy.newBuilder().build())
           .setProject("project-309310695")
           .setRequestId("requestId693933066")
           .build();
   OperationFuture<Operation, Operation> future =
       networkFirewallPoliciesClient.insertOperationCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
OperationCallable<InsertNetworkFirewallPolicyRequest,Operation,Operation>

isShutdown()

public boolean isShutdown()
Returns
TypeDescription
boolean

isTerminated()

public boolean isTerminated()
Returns
TypeDescription
boolean

list(ListNetworkFirewallPoliciesRequest request)

public final NetworkFirewallPoliciesClient.ListPagedResponse list(ListNetworkFirewallPoliciesRequest request)

Lists all the policies that have been configured for the specified project.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
     NetworkFirewallPoliciesClient.create()) {
   ListNetworkFirewallPoliciesRequest request =
       ListNetworkFirewallPoliciesRequest.newBuilder()
           .setFilter("filter-1274492040")
           .setMaxResults(1128457243)
           .setOrderBy("orderBy-1207110587")
           .setPageToken("pageToken873572522")
           .setProject("project-309310695")
           .setReturnPartialSuccess(true)
           .build();
   for (FirewallPolicy element : networkFirewallPoliciesClient.list(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
requestListNetworkFirewallPoliciesRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
NetworkFirewallPoliciesClient.ListPagedResponse

list(String project)

public final NetworkFirewallPoliciesClient.ListPagedResponse list(String project)

Lists all the policies that have been configured for the specified project.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
     NetworkFirewallPoliciesClient.create()) {
   String project = "project-309310695";
   for (FirewallPolicy element : networkFirewallPoliciesClient.list(project).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
projectString

Project ID for this request.

Returns
TypeDescription
NetworkFirewallPoliciesClient.ListPagedResponse

listCallable()

public final UnaryCallable<ListNetworkFirewallPoliciesRequest,FirewallPolicyList> listCallable()

Lists all the policies that have been configured for the specified project.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
     NetworkFirewallPoliciesClient.create()) {
   ListNetworkFirewallPoliciesRequest request =
       ListNetworkFirewallPoliciesRequest.newBuilder()
           .setFilter("filter-1274492040")
           .setMaxResults(1128457243)
           .setOrderBy("orderBy-1207110587")
           .setPageToken("pageToken873572522")
           .setProject("project-309310695")
           .setReturnPartialSuccess(true)
           .build();
   while (true) {
     FirewallPolicyList response = networkFirewallPoliciesClient.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;
     }
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListNetworkFirewallPoliciesRequest,FirewallPolicyList>

listPagedCallable()

public final UnaryCallable<ListNetworkFirewallPoliciesRequest,NetworkFirewallPoliciesClient.ListPagedResponse> listPagedCallable()

Lists all the policies that have been configured for the specified project.

Sample code:


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

patchAsync(PatchNetworkFirewallPolicyRequest request)

public final OperationFuture<Operation,Operation> patchAsync(PatchNetworkFirewallPolicyRequest 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 (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
     NetworkFirewallPoliciesClient.create()) {
   PatchNetworkFirewallPolicyRequest request =
       PatchNetworkFirewallPolicyRequest.newBuilder()
           .setFirewallPolicy("firewallPolicy1819692626")
           .setFirewallPolicyResource(FirewallPolicy.newBuilder().build())
           .setProject("project-309310695")
           .setRequestId("requestId693933066")
           .build();
   Operation response = networkFirewallPoliciesClient.patchAsync(request).get();
 }
 
Parameter
NameDescription
requestPatchNetworkFirewallPolicyRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
OperationFuture<Operation,Operation>

patchAsync(String project, String firewallPolicy, FirewallPolicy firewallPolicyResource)

public final OperationFuture<Operation,Operation> patchAsync(String project, 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 (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
     NetworkFirewallPoliciesClient.create()) {
   String project = "project-309310695";
   String firewallPolicy = "firewallPolicy1819692626";
   FirewallPolicy firewallPolicyResource = FirewallPolicy.newBuilder().build();
   Operation response =
       networkFirewallPoliciesClient
           .patchAsync(project, firewallPolicy, firewallPolicyResource)
           .get();
 }
 
Parameters
NameDescription
projectString

Project ID for this request.

firewallPolicyString

Name of the firewall policy to update.

firewallPolicyResourceFirewallPolicy

The body resource for this request

Returns
TypeDescription
OperationFuture<Operation,Operation>

patchCallable()

public final UnaryCallable<PatchNetworkFirewallPolicyRequest,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 (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
     NetworkFirewallPoliciesClient.create()) {
   PatchNetworkFirewallPolicyRequest request =
       PatchNetworkFirewallPolicyRequest.newBuilder()
           .setFirewallPolicy("firewallPolicy1819692626")
           .setFirewallPolicyResource(FirewallPolicy.newBuilder().build())
           .setProject("project-309310695")
           .setRequestId("requestId693933066")
           .build();
   ApiFuture<Operation> future =
       networkFirewallPoliciesClient.patchCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<PatchNetworkFirewallPolicyRequest,Operation>

patchOperationCallable()

public final OperationCallable<PatchNetworkFirewallPolicyRequest,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 (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
     NetworkFirewallPoliciesClient.create()) {
   PatchNetworkFirewallPolicyRequest request =
       PatchNetworkFirewallPolicyRequest.newBuilder()
           .setFirewallPolicy("firewallPolicy1819692626")
           .setFirewallPolicyResource(FirewallPolicy.newBuilder().build())
           .setProject("project-309310695")
           .setRequestId("requestId693933066")
           .build();
   OperationFuture<Operation, Operation> future =
       networkFirewallPoliciesClient.patchOperationCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
OperationCallable<PatchNetworkFirewallPolicyRequest,Operation,Operation>

patchRuleAsync(PatchRuleNetworkFirewallPolicyRequest request)

public final OperationFuture<Operation,Operation> patchRuleAsync(PatchRuleNetworkFirewallPolicyRequest 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 (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
     NetworkFirewallPoliciesClient.create()) {
   PatchRuleNetworkFirewallPolicyRequest request =
       PatchRuleNetworkFirewallPolicyRequest.newBuilder()
           .setFirewallPolicy("firewallPolicy1819692626")
           .setFirewallPolicyRuleResource(FirewallPolicyRule.newBuilder().build())
           .setPriority(-1165461084)
           .setProject("project-309310695")
           .setRequestId("requestId693933066")
           .build();
   Operation response = networkFirewallPoliciesClient.patchRuleAsync(request).get();
 }
 
Parameter
NameDescription
requestPatchRuleNetworkFirewallPolicyRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
OperationFuture<Operation,Operation>

patchRuleAsync(String project, String firewallPolicy, FirewallPolicyRule firewallPolicyRuleResource)

public final OperationFuture<Operation,Operation> patchRuleAsync(String project, 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 (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
     NetworkFirewallPoliciesClient.create()) {
   String project = "project-309310695";
   String firewallPolicy = "firewallPolicy1819692626";
   FirewallPolicyRule firewallPolicyRuleResource = FirewallPolicyRule.newBuilder().build();
   Operation response =
       networkFirewallPoliciesClient
           .patchRuleAsync(project, firewallPolicy, firewallPolicyRuleResource)
           .get();
 }
 
Parameters
NameDescription
projectString

Project ID for this request.

firewallPolicyString

Name of the firewall policy to update.

firewallPolicyRuleResourceFirewallPolicyRule

The body resource for this request

Returns
TypeDescription
OperationFuture<Operation,Operation>

patchRuleCallable()

public final UnaryCallable<PatchRuleNetworkFirewallPolicyRequest,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 (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
     NetworkFirewallPoliciesClient.create()) {
   PatchRuleNetworkFirewallPolicyRequest request =
       PatchRuleNetworkFirewallPolicyRequest.newBuilder()
           .setFirewallPolicy("firewallPolicy1819692626")
           .setFirewallPolicyRuleResource(FirewallPolicyRule.newBuilder().build())
           .setPriority(-1165461084)
           .setProject("project-309310695")
           .setRequestId("requestId693933066")
           .build();
   ApiFuture<Operation> future =
       networkFirewallPoliciesClient.patchRuleCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<PatchRuleNetworkFirewallPolicyRequest,Operation>

patchRuleOperationCallable()

public final OperationCallable<PatchRuleNetworkFirewallPolicyRequest,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 (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
     NetworkFirewallPoliciesClient.create()) {
   PatchRuleNetworkFirewallPolicyRequest request =
       PatchRuleNetworkFirewallPolicyRequest.newBuilder()
           .setFirewallPolicy("firewallPolicy1819692626")
           .setFirewallPolicyRuleResource(FirewallPolicyRule.newBuilder().build())
           .setPriority(-1165461084)
           .setProject("project-309310695")
           .setRequestId("requestId693933066")
           .build();
   OperationFuture<Operation, Operation> future =
       networkFirewallPoliciesClient.patchRuleOperationCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
OperationCallable<PatchRuleNetworkFirewallPolicyRequest,Operation,Operation>

removeAssociationAsync(RemoveAssociationNetworkFirewallPolicyRequest request)

public final OperationFuture<Operation,Operation> removeAssociationAsync(RemoveAssociationNetworkFirewallPolicyRequest 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 (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
     NetworkFirewallPoliciesClient.create()) {
   RemoveAssociationNetworkFirewallPolicyRequest request =
       RemoveAssociationNetworkFirewallPolicyRequest.newBuilder()
           .setFirewallPolicy("firewallPolicy1819692626")
           .setName("name3373707")
           .setProject("project-309310695")
           .setRequestId("requestId693933066")
           .build();
   Operation response = networkFirewallPoliciesClient.removeAssociationAsync(request).get();
 }
 
Parameter
NameDescription
requestRemoveAssociationNetworkFirewallPolicyRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
OperationFuture<Operation,Operation>

removeAssociationAsync(String project, String firewallPolicy)

public final OperationFuture<Operation,Operation> removeAssociationAsync(String project, 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 (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
     NetworkFirewallPoliciesClient.create()) {
   String project = "project-309310695";
   String firewallPolicy = "firewallPolicy1819692626";
   Operation response =
       networkFirewallPoliciesClient.removeAssociationAsync(project, firewallPolicy).get();
 }
 
Parameters
NameDescription
projectString

Project ID for this request.

firewallPolicyString

Name of the firewall policy to update.

Returns
TypeDescription
OperationFuture<Operation,Operation>

removeAssociationCallable()

public final UnaryCallable<RemoveAssociationNetworkFirewallPolicyRequest,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 (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
     NetworkFirewallPoliciesClient.create()) {
   RemoveAssociationNetworkFirewallPolicyRequest request =
       RemoveAssociationNetworkFirewallPolicyRequest.newBuilder()
           .setFirewallPolicy("firewallPolicy1819692626")
           .setName("name3373707")
           .setProject("project-309310695")
           .setRequestId("requestId693933066")
           .build();
   ApiFuture<Operation> future =
       networkFirewallPoliciesClient.removeAssociationCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<RemoveAssociationNetworkFirewallPolicyRequest,Operation>

removeAssociationOperationCallable()

public final OperationCallable<RemoveAssociationNetworkFirewallPolicyRequest,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 (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
     NetworkFirewallPoliciesClient.create()) {
   RemoveAssociationNetworkFirewallPolicyRequest request =
       RemoveAssociationNetworkFirewallPolicyRequest.newBuilder()
           .setFirewallPolicy("firewallPolicy1819692626")
           .setName("name3373707")
           .setProject("project-309310695")
           .setRequestId("requestId693933066")
           .build();
   OperationFuture<Operation, Operation> future =
       networkFirewallPoliciesClient.removeAssociationOperationCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
OperationCallable<RemoveAssociationNetworkFirewallPolicyRequest,Operation,Operation>

removeRuleAsync(RemoveRuleNetworkFirewallPolicyRequest request)

public final OperationFuture<Operation,Operation> removeRuleAsync(RemoveRuleNetworkFirewallPolicyRequest 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 (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
     NetworkFirewallPoliciesClient.create()) {
   RemoveRuleNetworkFirewallPolicyRequest request =
       RemoveRuleNetworkFirewallPolicyRequest.newBuilder()
           .setFirewallPolicy("firewallPolicy1819692626")
           .setPriority(-1165461084)
           .setProject("project-309310695")
           .setRequestId("requestId693933066")
           .build();
   Operation response = networkFirewallPoliciesClient.removeRuleAsync(request).get();
 }
 
Parameter
NameDescription
requestRemoveRuleNetworkFirewallPolicyRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
OperationFuture<Operation,Operation>

removeRuleAsync(String project, String firewallPolicy)

public final OperationFuture<Operation,Operation> removeRuleAsync(String project, 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 (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
     NetworkFirewallPoliciesClient.create()) {
   String project = "project-309310695";
   String firewallPolicy = "firewallPolicy1819692626";
   Operation response =
       networkFirewallPoliciesClient.removeRuleAsync(project, firewallPolicy).get();
 }
 
Parameters
NameDescription
projectString

Project ID for this request.

firewallPolicyString

Name of the firewall policy to update.

Returns
TypeDescription
OperationFuture<Operation,Operation>

removeRuleCallable()

public final UnaryCallable<RemoveRuleNetworkFirewallPolicyRequest,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 (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
     NetworkFirewallPoliciesClient.create()) {
   RemoveRuleNetworkFirewallPolicyRequest request =
       RemoveRuleNetworkFirewallPolicyRequest.newBuilder()
           .setFirewallPolicy("firewallPolicy1819692626")
           .setPriority(-1165461084)
           .setProject("project-309310695")
           .setRequestId("requestId693933066")
           .build();
   ApiFuture<Operation> future =
       networkFirewallPoliciesClient.removeRuleCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<RemoveRuleNetworkFirewallPolicyRequest,Operation>

removeRuleOperationCallable()

public final OperationCallable<RemoveRuleNetworkFirewallPolicyRequest,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 (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
     NetworkFirewallPoliciesClient.create()) {
   RemoveRuleNetworkFirewallPolicyRequest request =
       RemoveRuleNetworkFirewallPolicyRequest.newBuilder()
           .setFirewallPolicy("firewallPolicy1819692626")
           .setPriority(-1165461084)
           .setProject("project-309310695")
           .setRequestId("requestId693933066")
           .build();
   OperationFuture<Operation, Operation> future =
       networkFirewallPoliciesClient.removeRuleOperationCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
OperationCallable<RemoveRuleNetworkFirewallPolicyRequest,Operation,Operation>

setIamPolicy(SetIamPolicyNetworkFirewallPolicyRequest request)

public final Policy setIamPolicy(SetIamPolicyNetworkFirewallPolicyRequest 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 (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
     NetworkFirewallPoliciesClient.create()) {
   SetIamPolicyNetworkFirewallPolicyRequest request =
       SetIamPolicyNetworkFirewallPolicyRequest.newBuilder()
           .setGlobalSetPolicyRequestResource(GlobalSetPolicyRequest.newBuilder().build())
           .setProject("project-309310695")
           .setResource("resource-341064690")
           .build();
   Policy response = networkFirewallPoliciesClient.setIamPolicy(request);
 }
 
Parameter
NameDescription
requestSetIamPolicyNetworkFirewallPolicyRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
Policy

setIamPolicy(String project, String resource, GlobalSetPolicyRequest globalSetPolicyRequestResource)

public final Policy setIamPolicy(String project, String resource, GlobalSetPolicyRequest globalSetPolicyRequestResource)

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 (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
     NetworkFirewallPoliciesClient.create()) {
   String project = "project-309310695";
   String resource = "resource-341064690";
   GlobalSetPolicyRequest globalSetPolicyRequestResource =
       GlobalSetPolicyRequest.newBuilder().build();
   Policy response =
       networkFirewallPoliciesClient.setIamPolicy(
           project, resource, globalSetPolicyRequestResource);
 }
 
Parameters
NameDescription
projectString

Project ID for this request.

resourceString

Name or id of the resource for this request.

globalSetPolicyRequestResourceGlobalSetPolicyRequest

The body resource for this request

Returns
TypeDescription
Policy

setIamPolicyCallable()

public final UnaryCallable<SetIamPolicyNetworkFirewallPolicyRequest,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 (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
     NetworkFirewallPoliciesClient.create()) {
   SetIamPolicyNetworkFirewallPolicyRequest request =
       SetIamPolicyNetworkFirewallPolicyRequest.newBuilder()
           .setGlobalSetPolicyRequestResource(GlobalSetPolicyRequest.newBuilder().build())
           .setProject("project-309310695")
           .setResource("resource-341064690")
           .build();
   ApiFuture<Policy> future =
       networkFirewallPoliciesClient.setIamPolicyCallable().futureCall(request);
   // Do something.
   Policy response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<SetIamPolicyNetworkFirewallPolicyRequest,Policy>

shutdown()

public void shutdown()

shutdownNow()

public void shutdownNow()

testIamPermissions(TestIamPermissionsNetworkFirewallPolicyRequest request)

public final TestPermissionsResponse testIamPermissions(TestIamPermissionsNetworkFirewallPolicyRequest 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 (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
     NetworkFirewallPoliciesClient.create()) {
   TestIamPermissionsNetworkFirewallPolicyRequest request =
       TestIamPermissionsNetworkFirewallPolicyRequest.newBuilder()
           .setProject("project-309310695")
           .setResource("resource-341064690")
           .setTestPermissionsRequestResource(TestPermissionsRequest.newBuilder().build())
           .build();
   TestPermissionsResponse response = networkFirewallPoliciesClient.testIamPermissions(request);
 }
 
Parameter
NameDescription
requestTestIamPermissionsNetworkFirewallPolicyRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
TestPermissionsResponse

testIamPermissions(String project, String resource, TestPermissionsRequest testPermissionsRequestResource)

public final TestPermissionsResponse testIamPermissions(String project, 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 (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
     NetworkFirewallPoliciesClient.create()) {
   String project = "project-309310695";
   String resource = "resource-341064690";
   TestPermissionsRequest testPermissionsRequestResource =
       TestPermissionsRequest.newBuilder().build();
   TestPermissionsResponse response =
       networkFirewallPoliciesClient.testIamPermissions(
           project, resource, testPermissionsRequestResource);
 }
 
Parameters
NameDescription
projectString

Project ID for this request.

resourceString

Name or id of the resource for this request.

testPermissionsRequestResourceTestPermissionsRequest

The body resource for this request

Returns
TypeDescription
TestPermissionsResponse

testIamPermissionsCallable()

public final UnaryCallable<TestIamPermissionsNetworkFirewallPolicyRequest,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 (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
     NetworkFirewallPoliciesClient.create()) {
   TestIamPermissionsNetworkFirewallPolicyRequest request =
       TestIamPermissionsNetworkFirewallPolicyRequest.newBuilder()
           .setProject("project-309310695")
           .setResource("resource-341064690")
           .setTestPermissionsRequestResource(TestPermissionsRequest.newBuilder().build())
           .build();
   ApiFuture<TestPermissionsResponse> future =
       networkFirewallPoliciesClient.testIamPermissionsCallable().futureCall(request);
   // Do something.
   TestPermissionsResponse response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<TestIamPermissionsNetworkFirewallPolicyRequest,TestPermissionsResponse>