Class NetworkSecurityClient

java.lang.Object
com.google.cloud.networksecurity.v1.NetworkSecurityClient
All Implemented Interfaces:
BackgroundResource, AutoCloseable

@Generated("by gapic-generator-java") public class NetworkSecurityClient extends Object implements BackgroundResource
Service Description: Network Security API provides resources to configure authentication and authorization policies. Refer to per API resource documentation for more information.

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 (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
   AuthorizationPolicyName name =
       AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]");
   AuthorizationPolicy response = networkSecurityClient.getAuthorizationPolicy(name);
 }
 

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

Methods
Method Description Method Variants

ListAuthorizationPolicies

Lists AuthorizationPolicies in a given project and location.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listAuthorizationPolicies(ListAuthorizationPoliciesRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listAuthorizationPolicies(LocationName parent)

  • listAuthorizationPolicies(String parent)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listAuthorizationPoliciesPagedCallable()

  • listAuthorizationPoliciesCallable()

GetAuthorizationPolicy

Gets details of a single AuthorizationPolicy.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getAuthorizationPolicy(GetAuthorizationPolicyRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getAuthorizationPolicy(AuthorizationPolicyName name)

  • getAuthorizationPolicy(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getAuthorizationPolicyCallable()

CreateAuthorizationPolicy

Creates a new AuthorizationPolicy in a given project and location.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • createAuthorizationPolicyAsync(CreateAuthorizationPolicyRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • createAuthorizationPolicyAsync(LocationName parent, AuthorizationPolicy authorizationPolicy, String authorizationPolicyId)

  • createAuthorizationPolicyAsync(String parent, AuthorizationPolicy authorizationPolicy, String authorizationPolicyId)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • createAuthorizationPolicyOperationCallable()

  • createAuthorizationPolicyCallable()

UpdateAuthorizationPolicy

Updates the parameters of a single AuthorizationPolicy.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • updateAuthorizationPolicyAsync(UpdateAuthorizationPolicyRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • updateAuthorizationPolicyAsync(AuthorizationPolicy authorizationPolicy, FieldMask updateMask)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • updateAuthorizationPolicyOperationCallable()

  • updateAuthorizationPolicyCallable()

DeleteAuthorizationPolicy

Deletes a single AuthorizationPolicy.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • deleteAuthorizationPolicyAsync(DeleteAuthorizationPolicyRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • deleteAuthorizationPolicyAsync(AuthorizationPolicyName name)

  • deleteAuthorizationPolicyAsync(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • deleteAuthorizationPolicyOperationCallable()

  • deleteAuthorizationPolicyCallable()

ListBackendAuthenticationConfigs

Lists BackendAuthenticationConfigs in a given project and location.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listBackendAuthenticationConfigs(ListBackendAuthenticationConfigsRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listBackendAuthenticationConfigs(LocationName parent)

  • listBackendAuthenticationConfigs(String parent)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listBackendAuthenticationConfigsPagedCallable()

  • listBackendAuthenticationConfigsCallable()

GetBackendAuthenticationConfig

Gets details of a single BackendAuthenticationConfig to BackendAuthenticationConfig.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getBackendAuthenticationConfig(GetBackendAuthenticationConfigRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getBackendAuthenticationConfig(BackendAuthenticationConfigName name)

  • getBackendAuthenticationConfig(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getBackendAuthenticationConfigCallable()

CreateBackendAuthenticationConfig

Creates a new BackendAuthenticationConfig in a given project and location.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • createBackendAuthenticationConfigAsync(CreateBackendAuthenticationConfigRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • createBackendAuthenticationConfigAsync(LocationName parent, BackendAuthenticationConfig backendAuthenticationConfig, String backendAuthenticationConfigId)

  • createBackendAuthenticationConfigAsync(String parent, BackendAuthenticationConfig backendAuthenticationConfig, String backendAuthenticationConfigId)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • createBackendAuthenticationConfigOperationCallable()

  • createBackendAuthenticationConfigCallable()

UpdateBackendAuthenticationConfig

Updates the parameters of a single BackendAuthenticationConfig to BackendAuthenticationConfig.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • updateBackendAuthenticationConfigAsync(UpdateBackendAuthenticationConfigRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • updateBackendAuthenticationConfigAsync(BackendAuthenticationConfig backendAuthenticationConfig, FieldMask updateMask)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • updateBackendAuthenticationConfigOperationCallable()

  • updateBackendAuthenticationConfigCallable()

DeleteBackendAuthenticationConfig

Deletes a single BackendAuthenticationConfig to BackendAuthenticationConfig.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • deleteBackendAuthenticationConfigAsync(DeleteBackendAuthenticationConfigRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • deleteBackendAuthenticationConfigAsync(BackendAuthenticationConfigName name)

  • deleteBackendAuthenticationConfigAsync(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • deleteBackendAuthenticationConfigOperationCallable()

  • deleteBackendAuthenticationConfigCallable()

ListServerTlsPolicies

Lists ServerTlsPolicies in a given project and location.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listServerTlsPolicies(ListServerTlsPoliciesRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listServerTlsPolicies(LocationName parent)

  • listServerTlsPolicies(String parent)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listServerTlsPoliciesPagedCallable()

  • listServerTlsPoliciesCallable()

GetServerTlsPolicy

Gets details of a single ServerTlsPolicy.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getServerTlsPolicy(GetServerTlsPolicyRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getServerTlsPolicy(ServerTlsPolicyName name)

  • getServerTlsPolicy(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getServerTlsPolicyCallable()

CreateServerTlsPolicy

Creates a new ServerTlsPolicy in a given project and location.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • createServerTlsPolicyAsync(CreateServerTlsPolicyRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • createServerTlsPolicyAsync(LocationName parent, ServerTlsPolicy serverTlsPolicy, String serverTlsPolicyId)

  • createServerTlsPolicyAsync(String parent, ServerTlsPolicy serverTlsPolicy, String serverTlsPolicyId)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • createServerTlsPolicyOperationCallable()

  • createServerTlsPolicyCallable()

UpdateServerTlsPolicy

Updates the parameters of a single ServerTlsPolicy.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • updateServerTlsPolicyAsync(UpdateServerTlsPolicyRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • updateServerTlsPolicyAsync(ServerTlsPolicy serverTlsPolicy, FieldMask updateMask)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • updateServerTlsPolicyOperationCallable()

  • updateServerTlsPolicyCallable()

DeleteServerTlsPolicy

Deletes a single ServerTlsPolicy.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • deleteServerTlsPolicyAsync(DeleteServerTlsPolicyRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • deleteServerTlsPolicyAsync(ServerTlsPolicyName name)

  • deleteServerTlsPolicyAsync(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • deleteServerTlsPolicyOperationCallable()

  • deleteServerTlsPolicyCallable()

ListClientTlsPolicies

Lists ClientTlsPolicies in a given project and location.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listClientTlsPolicies(ListClientTlsPoliciesRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listClientTlsPolicies(LocationName parent)

  • listClientTlsPolicies(String parent)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listClientTlsPoliciesPagedCallable()

  • listClientTlsPoliciesCallable()

GetClientTlsPolicy

Gets details of a single ClientTlsPolicy.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getClientTlsPolicy(GetClientTlsPolicyRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getClientTlsPolicy(ClientTlsPolicyName name)

  • getClientTlsPolicy(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getClientTlsPolicyCallable()

CreateClientTlsPolicy

Creates a new ClientTlsPolicy in a given project and location.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • createClientTlsPolicyAsync(CreateClientTlsPolicyRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • createClientTlsPolicyAsync(LocationName parent, ClientTlsPolicy clientTlsPolicy, String clientTlsPolicyId)

  • createClientTlsPolicyAsync(String parent, ClientTlsPolicy clientTlsPolicy, String clientTlsPolicyId)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • createClientTlsPolicyOperationCallable()

  • createClientTlsPolicyCallable()

UpdateClientTlsPolicy

Updates the parameters of a single ClientTlsPolicy.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • updateClientTlsPolicyAsync(UpdateClientTlsPolicyRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • updateClientTlsPolicyAsync(ClientTlsPolicy clientTlsPolicy, FieldMask updateMask)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • updateClientTlsPolicyOperationCallable()

  • updateClientTlsPolicyCallable()

DeleteClientTlsPolicy

Deletes a single ClientTlsPolicy.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • deleteClientTlsPolicyAsync(DeleteClientTlsPolicyRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • deleteClientTlsPolicyAsync(ClientTlsPolicyName name)

  • deleteClientTlsPolicyAsync(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • deleteClientTlsPolicyOperationCallable()

  • deleteClientTlsPolicyCallable()

ListGatewaySecurityPolicies

Lists GatewaySecurityPolicies in a given project and location.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listGatewaySecurityPolicies(ListGatewaySecurityPoliciesRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listGatewaySecurityPolicies(LocationName parent)

  • listGatewaySecurityPolicies(String parent)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listGatewaySecurityPoliciesPagedCallable()

  • listGatewaySecurityPoliciesCallable()

GetGatewaySecurityPolicy

Gets details of a single GatewaySecurityPolicy.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getGatewaySecurityPolicy(GetGatewaySecurityPolicyRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getGatewaySecurityPolicy(GatewaySecurityPolicyName name)

  • getGatewaySecurityPolicy(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getGatewaySecurityPolicyCallable()

CreateGatewaySecurityPolicy

Creates a new GatewaySecurityPolicy in a given project and location.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • createGatewaySecurityPolicyAsync(CreateGatewaySecurityPolicyRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • createGatewaySecurityPolicyAsync(LocationName parent, GatewaySecurityPolicy gatewaySecurityPolicy, String gatewaySecurityPolicyId)

  • createGatewaySecurityPolicyAsync(String parent, GatewaySecurityPolicy gatewaySecurityPolicy, String gatewaySecurityPolicyId)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • createGatewaySecurityPolicyOperationCallable()

  • createGatewaySecurityPolicyCallable()

UpdateGatewaySecurityPolicy

Updates the parameters of a single GatewaySecurityPolicy.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • updateGatewaySecurityPolicyAsync(UpdateGatewaySecurityPolicyRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • updateGatewaySecurityPolicyAsync(GatewaySecurityPolicy gatewaySecurityPolicy, FieldMask updateMask)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • updateGatewaySecurityPolicyOperationCallable()

  • updateGatewaySecurityPolicyCallable()

DeleteGatewaySecurityPolicy

Deletes a single GatewaySecurityPolicy.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • deleteGatewaySecurityPolicyAsync(DeleteGatewaySecurityPolicyRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • deleteGatewaySecurityPolicyAsync(GatewaySecurityPolicyName name)

  • deleteGatewaySecurityPolicyAsync(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • deleteGatewaySecurityPolicyOperationCallable()

  • deleteGatewaySecurityPolicyCallable()

ListGatewaySecurityPolicyRules

Lists GatewaySecurityPolicyRules in a given project and location.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listGatewaySecurityPolicyRules(ListGatewaySecurityPolicyRulesRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listGatewaySecurityPolicyRules(GatewaySecurityPolicyName parent)

  • listGatewaySecurityPolicyRules(String parent)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listGatewaySecurityPolicyRulesPagedCallable()

  • listGatewaySecurityPolicyRulesCallable()

GetGatewaySecurityPolicyRule

Gets details of a single GatewaySecurityPolicyRule.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getGatewaySecurityPolicyRule(GetGatewaySecurityPolicyRuleRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getGatewaySecurityPolicyRule(GatewaySecurityPolicyRuleName name)

  • getGatewaySecurityPolicyRule(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getGatewaySecurityPolicyRuleCallable()

CreateGatewaySecurityPolicyRule

Creates a new GatewaySecurityPolicy in a given project and location.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • createGatewaySecurityPolicyRuleAsync(CreateGatewaySecurityPolicyRuleRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • createGatewaySecurityPolicyRuleAsync(GatewaySecurityPolicyName parent, GatewaySecurityPolicyRule gatewaySecurityPolicyRule, String gatewaySecurityPolicyRuleId)

  • createGatewaySecurityPolicyRuleAsync(String parent, GatewaySecurityPolicyRule gatewaySecurityPolicyRule, String gatewaySecurityPolicyRuleId)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • createGatewaySecurityPolicyRuleOperationCallable()

  • createGatewaySecurityPolicyRuleCallable()

UpdateGatewaySecurityPolicyRule

Updates the parameters of a single GatewaySecurityPolicyRule.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • updateGatewaySecurityPolicyRuleAsync(UpdateGatewaySecurityPolicyRuleRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • updateGatewaySecurityPolicyRuleAsync(GatewaySecurityPolicyRule gatewaySecurityPolicyRule, FieldMask updateMask)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • updateGatewaySecurityPolicyRuleOperationCallable()

  • updateGatewaySecurityPolicyRuleCallable()

DeleteGatewaySecurityPolicyRule

Deletes a single GatewaySecurityPolicyRule.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • deleteGatewaySecurityPolicyRuleAsync(DeleteGatewaySecurityPolicyRuleRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • deleteGatewaySecurityPolicyRuleAsync(GatewaySecurityPolicyRuleName name)

  • deleteGatewaySecurityPolicyRuleAsync(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • deleteGatewaySecurityPolicyRuleOperationCallable()

  • deleteGatewaySecurityPolicyRuleCallable()

ListUrlLists

Lists UrlLists in a given project and location.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listUrlLists(ListUrlListsRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listUrlLists(LocationName parent)

  • listUrlLists(String parent)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listUrlListsPagedCallable()

  • listUrlListsCallable()

GetUrlList

Gets details of a single UrlList.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getUrlList(GetUrlListRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getUrlList(UrlListName name)

  • getUrlList(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getUrlListCallable()

CreateUrlList

Creates a new UrlList in a given project and location.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • createUrlListAsync(CreateUrlListRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • createUrlListAsync(LocationName parent, UrlList urlList, String urlListId)

  • createUrlListAsync(String parent, UrlList urlList, String urlListId)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • createUrlListOperationCallable()

  • createUrlListCallable()

UpdateUrlList

Updates the parameters of a single UrlList.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • updateUrlListAsync(UpdateUrlListRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • updateUrlListAsync(UrlList urlList, FieldMask updateMask)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • updateUrlListOperationCallable()

  • updateUrlListCallable()

DeleteUrlList

Deletes a single UrlList.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • deleteUrlListAsync(DeleteUrlListRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • deleteUrlListAsync(UrlListName name)

  • deleteUrlListAsync(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • deleteUrlListOperationCallable()

  • deleteUrlListCallable()

ListTlsInspectionPolicies

Lists TlsInspectionPolicies in a given project and location.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listTlsInspectionPolicies(ListTlsInspectionPoliciesRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listTlsInspectionPolicies(LocationName parent)

  • listTlsInspectionPolicies(String parent)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listTlsInspectionPoliciesPagedCallable()

  • listTlsInspectionPoliciesCallable()

GetTlsInspectionPolicy

Gets details of a single TlsInspectionPolicy.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getTlsInspectionPolicy(GetTlsInspectionPolicyRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getTlsInspectionPolicy(TlsInspectionPolicyName name)

  • getTlsInspectionPolicy(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getTlsInspectionPolicyCallable()

CreateTlsInspectionPolicy

Creates a new TlsInspectionPolicy in a given project and location.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • createTlsInspectionPolicyAsync(CreateTlsInspectionPolicyRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • createTlsInspectionPolicyAsync(LocationName parent, TlsInspectionPolicy tlsInspectionPolicy, String tlsInspectionPolicyId)

  • createTlsInspectionPolicyAsync(String parent, TlsInspectionPolicy tlsInspectionPolicy, String tlsInspectionPolicyId)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • createTlsInspectionPolicyOperationCallable()

  • createTlsInspectionPolicyCallable()

UpdateTlsInspectionPolicy

Updates the parameters of a single TlsInspectionPolicy.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • updateTlsInspectionPolicyAsync(UpdateTlsInspectionPolicyRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • updateTlsInspectionPolicyAsync(TlsInspectionPolicy tlsInspectionPolicy, FieldMask updateMask)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • updateTlsInspectionPolicyOperationCallable()

  • updateTlsInspectionPolicyCallable()

DeleteTlsInspectionPolicy

Deletes a single TlsInspectionPolicy.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • deleteTlsInspectionPolicyAsync(DeleteTlsInspectionPolicyRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • deleteTlsInspectionPolicyAsync(TlsInspectionPolicyName name)

  • deleteTlsInspectionPolicyAsync(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • deleteTlsInspectionPolicyOperationCallable()

  • deleteTlsInspectionPolicyCallable()

ListAuthzPolicies

Lists AuthzPolicies in a given project and location.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listAuthzPolicies(ListAuthzPoliciesRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listAuthzPolicies(LocationName parent)

  • listAuthzPolicies(String parent)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listAuthzPoliciesPagedCallable()

  • listAuthzPoliciesCallable()

GetAuthzPolicy

Gets details of a single AuthzPolicy.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getAuthzPolicy(GetAuthzPolicyRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getAuthzPolicy(AuthzPolicyName name)

  • getAuthzPolicy(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getAuthzPolicyCallable()

CreateAuthzPolicy

Creates a new AuthzPolicy in a given project and location.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • createAuthzPolicyAsync(CreateAuthzPolicyRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • createAuthzPolicyAsync(LocationName parent, AuthzPolicy authzPolicy, String authzPolicyId)

  • createAuthzPolicyAsync(String parent, AuthzPolicy authzPolicy, String authzPolicyId)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • createAuthzPolicyOperationCallable()

  • createAuthzPolicyCallable()

UpdateAuthzPolicy

Updates the parameters of a single AuthzPolicy.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • updateAuthzPolicyAsync(UpdateAuthzPolicyRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • updateAuthzPolicyAsync(AuthzPolicy authzPolicy, FieldMask updateMask)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • updateAuthzPolicyOperationCallable()

  • updateAuthzPolicyCallable()

DeleteAuthzPolicy

Deletes a single AuthzPolicy.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • deleteAuthzPolicyAsync(DeleteAuthzPolicyRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • deleteAuthzPolicyAsync(AuthzPolicyName name)

  • deleteAuthzPolicyAsync(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • deleteAuthzPolicyOperationCallable()

  • deleteAuthzPolicyCallable()

ListLocations

Lists information about the supported locations for this service.

This method lists locations based on the resource scope provided inthe [ListLocationsRequest.name] field:

* **Global locations**: If `name` is empty, the method lists thepublic locations available to all projects. * **Project-specificlocations**: If `name` follows the format`projects/{project}`, the method lists locations visible to thatspecific project. This includes public, private, or otherproject-specific locations enabled for the project.

For gRPC and client library implementations, the resource name ispassed as the `name` field. For direct service calls, the resourcename isincorporated into the request path based on the specific serviceimplementation and version.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listLocations(ListLocationsRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listLocationsPagedCallable()

  • listLocationsCallable()

GetLocation

Gets information about a location.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getLocation(GetLocationRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getLocationCallable()

SetIamPolicy

Sets the access control policy on the specified resource. Replacesany existing policy.

Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • setIamPolicy(SetIamPolicyRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • setIamPolicyCallable()

GetIamPolicy

Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getIamPolicy(GetIamPolicyRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getIamPolicyCallable()

TestIamPermissions

Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a `NOT_FOUND` error.

Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • testIamPermissions(TestIamPermissionsRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • testIamPermissionsCallable()

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 NetworkSecuritySettings 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
 NetworkSecuritySettings networkSecuritySettings =
     NetworkSecuritySettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 NetworkSecurityClient networkSecurityClient =
     NetworkSecurityClient.create(networkSecuritySettings);
 

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
 NetworkSecuritySettings networkSecuritySettings =
     NetworkSecuritySettings.newBuilder().setEndpoint(myEndpoint).build();
 NetworkSecurityClient networkSecurityClient =
     NetworkSecurityClient.create(networkSecuritySettings);
 

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

  • Constructor Details

    • NetworkSecurityClient

      protected NetworkSecurityClient(NetworkSecuritySettings settings) throws IOException
      Constructs an instance of NetworkSecurityClient, 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
    • NetworkSecurityClient

      protected NetworkSecurityClient(NetworkSecurityStub stub)
  • Method Details

    • create

      public static final NetworkSecurityClient create() throws IOException
      Constructs an instance of NetworkSecurityClient with default settings.
      Throws:
      IOException
    • create

      public static final NetworkSecurityClient create(NetworkSecuritySettings settings) throws IOException
      Constructs an instance of NetworkSecurityClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.
      Throws:
      IOException
    • create

      public static final NetworkSecurityClient create(NetworkSecurityStub stub)
      Constructs an instance of NetworkSecurityClient, using the given stub for making calls. This is for advanced usage - prefer using create(NetworkSecuritySettings).
    • getSettings

      public final NetworkSecuritySettings getSettings()
    • getStub

      public NetworkSecurityStub getStub()
    • getOperationsClient

      public final OperationsClient getOperationsClient()
      Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
    • listAuthorizationPolicies

      public final NetworkSecurityClient.ListAuthorizationPoliciesPagedResponse listAuthorizationPolicies(LocationName parent)
      Lists AuthorizationPolicies in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         for (AuthorizationPolicy element :
             networkSecurityClient.listAuthorizationPolicies(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. The project and location from which the AuthorizationPolicies should be listed, specified in the format `projects/{project}/locations/{location}`.
      Throws:
      ApiException - if the remote call fails
    • listAuthorizationPolicies

      public final NetworkSecurityClient.ListAuthorizationPoliciesPagedResponse listAuthorizationPolicies(String parent)
      Lists AuthorizationPolicies in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         for (AuthorizationPolicy element :
             networkSecurityClient.listAuthorizationPolicies(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. The project and location from which the AuthorizationPolicies should be listed, specified in the format `projects/{project}/locations/{location}`.
      Throws:
      ApiException - if the remote call fails
    • listAuthorizationPolicies

      Lists AuthorizationPolicies in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         ListAuthorizationPoliciesRequest request =
             ListAuthorizationPoliciesRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         for (AuthorizationPolicy element :
             networkSecurityClient.listAuthorizationPolicies(request).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • listAuthorizationPoliciesPagedCallable

      Lists AuthorizationPolicies in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         ListAuthorizationPoliciesRequest request =
             ListAuthorizationPoliciesRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         ApiFuture<AuthorizationPolicy> future =
             networkSecurityClient.listAuthorizationPoliciesPagedCallable().futureCall(request);
         // Do something.
         for (AuthorizationPolicy element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • listAuthorizationPoliciesCallable

      public final UnaryCallable<ListAuthorizationPoliciesRequest,ListAuthorizationPoliciesResponse> listAuthorizationPoliciesCallable()
      Lists AuthorizationPolicies in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         ListAuthorizationPoliciesRequest request =
             ListAuthorizationPoliciesRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         while (true) {
           ListAuthorizationPoliciesResponse response =
               networkSecurityClient.listAuthorizationPoliciesCallable().call(request);
           for (AuthorizationPolicy element : response.getAuthorizationPoliciesList()) {
             // doThingsWith(element);
           }
           String nextPageToken = response.getNextPageToken();
           if (!Strings.isNullOrEmpty(nextPageToken)) {
             request = request.toBuilder().setPageToken(nextPageToken).build();
           } else {
             break;
           }
         }
       }
       
    • getAuthorizationPolicy

      public final AuthorizationPolicy getAuthorizationPolicy(AuthorizationPolicyName name)
      Gets details of a single AuthorizationPolicy.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         AuthorizationPolicyName name =
             AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]");
         AuthorizationPolicy response = networkSecurityClient.getAuthorizationPolicy(name);
       }
       
      Parameters:
      name - Required. A name of the AuthorizationPolicy to get. Must be in the format `projects/{project}/locations/{location}/authorizationPolicies/*`.
      Throws:
      ApiException - if the remote call fails
    • getAuthorizationPolicy

      public final AuthorizationPolicy getAuthorizationPolicy(String name)
      Gets details of a single AuthorizationPolicy.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         String name =
             AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]")
                 .toString();
         AuthorizationPolicy response = networkSecurityClient.getAuthorizationPolicy(name);
       }
       
      Parameters:
      name - Required. A name of the AuthorizationPolicy to get. Must be in the format `projects/{project}/locations/{location}/authorizationPolicies/*`.
      Throws:
      ApiException - if the remote call fails
    • getAuthorizationPolicy

      public final AuthorizationPolicy getAuthorizationPolicy(GetAuthorizationPolicyRequest request)
      Gets details of a single AuthorizationPolicy.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         GetAuthorizationPolicyRequest request =
             GetAuthorizationPolicyRequest.newBuilder()
                 .setName(
                     AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]")
                         .toString())
                 .build();
         AuthorizationPolicy response = networkSecurityClient.getAuthorizationPolicy(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • getAuthorizationPolicyCallable

      public final UnaryCallable<GetAuthorizationPolicyRequest,AuthorizationPolicy> getAuthorizationPolicyCallable()
      Gets details of a single AuthorizationPolicy.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         GetAuthorizationPolicyRequest request =
             GetAuthorizationPolicyRequest.newBuilder()
                 .setName(
                     AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]")
                         .toString())
                 .build();
         ApiFuture<AuthorizationPolicy> future =
             networkSecurityClient.getAuthorizationPolicyCallable().futureCall(request);
         // Do something.
         AuthorizationPolicy response = future.get();
       }
       
    • createAuthorizationPolicyAsync

      public final OperationFuture<AuthorizationPolicy,OperationMetadata> createAuthorizationPolicyAsync(LocationName parent, AuthorizationPolicy authorizationPolicy, String authorizationPolicyId)
      Creates a new AuthorizationPolicy in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         AuthorizationPolicy authorizationPolicy = AuthorizationPolicy.newBuilder().build();
         String authorizationPolicyId = "authorizationPolicyId1314252166";
         AuthorizationPolicy response =
             networkSecurityClient
                 .createAuthorizationPolicyAsync(parent, authorizationPolicy, authorizationPolicyId)
                 .get();
       }
       
      Parameters:
      parent - Required. The parent resource of the AuthorizationPolicy. Must be in the format `projects/{project}/locations/{location}`.
      authorizationPolicy - Required. AuthorizationPolicy resource to be created.
      authorizationPolicyId - Required. Short name of the AuthorizationPolicy resource to be created. This value should be 1-63 characters long, containing only letters, numbers, hyphens, and underscores, and should not start with a number. E.g. "authz_policy".
      Throws:
      ApiException - if the remote call fails
    • createAuthorizationPolicyAsync

      public final OperationFuture<AuthorizationPolicy,OperationMetadata> createAuthorizationPolicyAsync(String parent, AuthorizationPolicy authorizationPolicy, String authorizationPolicyId)
      Creates a new AuthorizationPolicy in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         AuthorizationPolicy authorizationPolicy = AuthorizationPolicy.newBuilder().build();
         String authorizationPolicyId = "authorizationPolicyId1314252166";
         AuthorizationPolicy response =
             networkSecurityClient
                 .createAuthorizationPolicyAsync(parent, authorizationPolicy, authorizationPolicyId)
                 .get();
       }
       
      Parameters:
      parent - Required. The parent resource of the AuthorizationPolicy. Must be in the format `projects/{project}/locations/{location}`.
      authorizationPolicy - Required. AuthorizationPolicy resource to be created.
      authorizationPolicyId - Required. Short name of the AuthorizationPolicy resource to be created. This value should be 1-63 characters long, containing only letters, numbers, hyphens, and underscores, and should not start with a number. E.g. "authz_policy".
      Throws:
      ApiException - if the remote call fails
    • createAuthorizationPolicyAsync

      public final OperationFuture<AuthorizationPolicy,OperationMetadata> createAuthorizationPolicyAsync(CreateAuthorizationPolicyRequest request)
      Creates a new AuthorizationPolicy in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         CreateAuthorizationPolicyRequest request =
             CreateAuthorizationPolicyRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setAuthorizationPolicyId("authorizationPolicyId1314252166")
                 .setAuthorizationPolicy(AuthorizationPolicy.newBuilder().build())
                 .build();
         AuthorizationPolicy response =
             networkSecurityClient.createAuthorizationPolicyAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • createAuthorizationPolicyOperationCallable

      public final OperationCallable<CreateAuthorizationPolicyRequest,AuthorizationPolicy,OperationMetadata> createAuthorizationPolicyOperationCallable()
      Creates a new AuthorizationPolicy in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         CreateAuthorizationPolicyRequest request =
             CreateAuthorizationPolicyRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setAuthorizationPolicyId("authorizationPolicyId1314252166")
                 .setAuthorizationPolicy(AuthorizationPolicy.newBuilder().build())
                 .build();
         OperationFuture<AuthorizationPolicy, OperationMetadata> future =
             networkSecurityClient.createAuthorizationPolicyOperationCallable().futureCall(request);
         // Do something.
         AuthorizationPolicy response = future.get();
       }
       
    • createAuthorizationPolicyCallable

      public final UnaryCallable<CreateAuthorizationPolicyRequest,Operation> createAuthorizationPolicyCallable()
      Creates a new AuthorizationPolicy in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         CreateAuthorizationPolicyRequest request =
             CreateAuthorizationPolicyRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setAuthorizationPolicyId("authorizationPolicyId1314252166")
                 .setAuthorizationPolicy(AuthorizationPolicy.newBuilder().build())
                 .build();
         ApiFuture<Operation> future =
             networkSecurityClient.createAuthorizationPolicyCallable().futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • updateAuthorizationPolicyAsync

      public final OperationFuture<AuthorizationPolicy,OperationMetadata> updateAuthorizationPolicyAsync(AuthorizationPolicy authorizationPolicy, com.google.protobuf.FieldMask updateMask)
      Updates the parameters of a single AuthorizationPolicy.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         AuthorizationPolicy authorizationPolicy = AuthorizationPolicy.newBuilder().build();
         FieldMask updateMask = FieldMask.newBuilder().build();
         AuthorizationPolicy response =
             networkSecurityClient
                 .updateAuthorizationPolicyAsync(authorizationPolicy, updateMask)
                 .get();
       }
       
      Parameters:
      authorizationPolicy - Required. Updated AuthorizationPolicy resource.
      updateMask - Optional. Field mask is used to specify the fields to be overwritten in the AuthorizationPolicy resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten.
      Throws:
      ApiException - if the remote call fails
    • updateAuthorizationPolicyAsync

      public final OperationFuture<AuthorizationPolicy,OperationMetadata> updateAuthorizationPolicyAsync(UpdateAuthorizationPolicyRequest request)
      Updates the parameters of a single AuthorizationPolicy.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         UpdateAuthorizationPolicyRequest request =
             UpdateAuthorizationPolicyRequest.newBuilder()
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .setAuthorizationPolicy(AuthorizationPolicy.newBuilder().build())
                 .build();
         AuthorizationPolicy response =
             networkSecurityClient.updateAuthorizationPolicyAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • updateAuthorizationPolicyOperationCallable

      public final OperationCallable<UpdateAuthorizationPolicyRequest,AuthorizationPolicy,OperationMetadata> updateAuthorizationPolicyOperationCallable()
      Updates the parameters of a single AuthorizationPolicy.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         UpdateAuthorizationPolicyRequest request =
             UpdateAuthorizationPolicyRequest.newBuilder()
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .setAuthorizationPolicy(AuthorizationPolicy.newBuilder().build())
                 .build();
         OperationFuture<AuthorizationPolicy, OperationMetadata> future =
             networkSecurityClient.updateAuthorizationPolicyOperationCallable().futureCall(request);
         // Do something.
         AuthorizationPolicy response = future.get();
       }
       
    • updateAuthorizationPolicyCallable

      public final UnaryCallable<UpdateAuthorizationPolicyRequest,Operation> updateAuthorizationPolicyCallable()
      Updates the parameters of a single AuthorizationPolicy.

      Sample code:

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

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteAuthorizationPolicyAsync(AuthorizationPolicyName name)
      Deletes a single AuthorizationPolicy.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         AuthorizationPolicyName name =
             AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]");
         networkSecurityClient.deleteAuthorizationPolicyAsync(name).get();
       }
       
      Parameters:
      name - Required. A name of the AuthorizationPolicy to delete. Must be in the format `projects/{project}/locations/{location}/authorizationPolicies/*`.
      Throws:
      ApiException - if the remote call fails
    • deleteAuthorizationPolicyAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteAuthorizationPolicyAsync(String name)
      Deletes a single AuthorizationPolicy.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         String name =
             AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]")
                 .toString();
         networkSecurityClient.deleteAuthorizationPolicyAsync(name).get();
       }
       
      Parameters:
      name - Required. A name of the AuthorizationPolicy to delete. Must be in the format `projects/{project}/locations/{location}/authorizationPolicies/*`.
      Throws:
      ApiException - if the remote call fails
    • deleteAuthorizationPolicyAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteAuthorizationPolicyAsync(DeleteAuthorizationPolicyRequest request)
      Deletes a single AuthorizationPolicy.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         DeleteAuthorizationPolicyRequest request =
             DeleteAuthorizationPolicyRequest.newBuilder()
                 .setName(
                     AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]")
                         .toString())
                 .build();
         networkSecurityClient.deleteAuthorizationPolicyAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • deleteAuthorizationPolicyOperationCallable

      public final OperationCallable<DeleteAuthorizationPolicyRequest,com.google.protobuf.Empty,OperationMetadata> deleteAuthorizationPolicyOperationCallable()
      Deletes a single AuthorizationPolicy.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         DeleteAuthorizationPolicyRequest request =
             DeleteAuthorizationPolicyRequest.newBuilder()
                 .setName(
                     AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]")
                         .toString())
                 .build();
         OperationFuture<Empty, OperationMetadata> future =
             networkSecurityClient.deleteAuthorizationPolicyOperationCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • deleteAuthorizationPolicyCallable

      public final UnaryCallable<DeleteAuthorizationPolicyRequest,Operation> deleteAuthorizationPolicyCallable()
      Deletes a single AuthorizationPolicy.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         DeleteAuthorizationPolicyRequest request =
             DeleteAuthorizationPolicyRequest.newBuilder()
                 .setName(
                     AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]")
                         .toString())
                 .build();
         ApiFuture<Operation> future =
             networkSecurityClient.deleteAuthorizationPolicyCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • listBackendAuthenticationConfigs

      public final NetworkSecurityClient.ListBackendAuthenticationConfigsPagedResponse listBackendAuthenticationConfigs(LocationName parent)
      Lists BackendAuthenticationConfigs in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         for (BackendAuthenticationConfig element :
             networkSecurityClient.listBackendAuthenticationConfigs(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. The project and location from which the BackendAuthenticationConfigs should be listed, specified in the format `projects/*/locations/{location}`.
      Throws:
      ApiException - if the remote call fails
    • listBackendAuthenticationConfigs

      public final NetworkSecurityClient.ListBackendAuthenticationConfigsPagedResponse listBackendAuthenticationConfigs(String parent)
      Lists BackendAuthenticationConfigs in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         for (BackendAuthenticationConfig element :
             networkSecurityClient.listBackendAuthenticationConfigs(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. The project and location from which the BackendAuthenticationConfigs should be listed, specified in the format `projects/*/locations/{location}`.
      Throws:
      ApiException - if the remote call fails
    • listBackendAuthenticationConfigs

      Lists BackendAuthenticationConfigs in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         ListBackendAuthenticationConfigsRequest request =
             ListBackendAuthenticationConfigsRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         for (BackendAuthenticationConfig element :
             networkSecurityClient.listBackendAuthenticationConfigs(request).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • listBackendAuthenticationConfigsPagedCallable

      Lists BackendAuthenticationConfigs in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         ListBackendAuthenticationConfigsRequest request =
             ListBackendAuthenticationConfigsRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         ApiFuture<BackendAuthenticationConfig> future =
             networkSecurityClient.listBackendAuthenticationConfigsPagedCallable().futureCall(request);
         // Do something.
         for (BackendAuthenticationConfig element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • listBackendAuthenticationConfigsCallable

      Lists BackendAuthenticationConfigs in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         ListBackendAuthenticationConfigsRequest request =
             ListBackendAuthenticationConfigsRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         while (true) {
           ListBackendAuthenticationConfigsResponse response =
               networkSecurityClient.listBackendAuthenticationConfigsCallable().call(request);
           for (BackendAuthenticationConfig element : response.getBackendAuthenticationConfigsList()) {
             // doThingsWith(element);
           }
           String nextPageToken = response.getNextPageToken();
           if (!Strings.isNullOrEmpty(nextPageToken)) {
             request = request.toBuilder().setPageToken(nextPageToken).build();
           } else {
             break;
           }
         }
       }
       
    • getBackendAuthenticationConfig

      public final BackendAuthenticationConfig getBackendAuthenticationConfig(BackendAuthenticationConfigName name)
      Gets details of a single BackendAuthenticationConfig to BackendAuthenticationConfig.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         BackendAuthenticationConfigName name =
             BackendAuthenticationConfigName.of(
                 "[PROJECT]", "[LOCATION]", "[BACKEND_AUTHENTICATION_CONFIG]");
         BackendAuthenticationConfig response =
             networkSecurityClient.getBackendAuthenticationConfig(name);
       }
       
      Parameters:
      name - Required. A name of the BackendAuthenticationConfig to get. Must be in the format `projects/*/locations/{location}/backendAuthenticationConfigs/*`.
      Throws:
      ApiException - if the remote call fails
    • getBackendAuthenticationConfig

      public final BackendAuthenticationConfig getBackendAuthenticationConfig(String name)
      Gets details of a single BackendAuthenticationConfig to BackendAuthenticationConfig.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         String name =
             BackendAuthenticationConfigName.of(
                     "[PROJECT]", "[LOCATION]", "[BACKEND_AUTHENTICATION_CONFIG]")
                 .toString();
         BackendAuthenticationConfig response =
             networkSecurityClient.getBackendAuthenticationConfig(name);
       }
       
      Parameters:
      name - Required. A name of the BackendAuthenticationConfig to get. Must be in the format `projects/*/locations/{location}/backendAuthenticationConfigs/*`.
      Throws:
      ApiException - if the remote call fails
    • getBackendAuthenticationConfig

      public final BackendAuthenticationConfig getBackendAuthenticationConfig(GetBackendAuthenticationConfigRequest request)
      Gets details of a single BackendAuthenticationConfig to BackendAuthenticationConfig.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         GetBackendAuthenticationConfigRequest request =
             GetBackendAuthenticationConfigRequest.newBuilder()
                 .setName(
                     BackendAuthenticationConfigName.of(
                             "[PROJECT]", "[LOCATION]", "[BACKEND_AUTHENTICATION_CONFIG]")
                         .toString())
                 .build();
         BackendAuthenticationConfig response =
             networkSecurityClient.getBackendAuthenticationConfig(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • getBackendAuthenticationConfigCallable

      public final UnaryCallable<GetBackendAuthenticationConfigRequest,BackendAuthenticationConfig> getBackendAuthenticationConfigCallable()
      Gets details of a single BackendAuthenticationConfig to BackendAuthenticationConfig.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         GetBackendAuthenticationConfigRequest request =
             GetBackendAuthenticationConfigRequest.newBuilder()
                 .setName(
                     BackendAuthenticationConfigName.of(
                             "[PROJECT]", "[LOCATION]", "[BACKEND_AUTHENTICATION_CONFIG]")
                         .toString())
                 .build();
         ApiFuture<BackendAuthenticationConfig> future =
             networkSecurityClient.getBackendAuthenticationConfigCallable().futureCall(request);
         // Do something.
         BackendAuthenticationConfig response = future.get();
       }
       
    • createBackendAuthenticationConfigAsync

      public final OperationFuture<BackendAuthenticationConfig,OperationMetadata> createBackendAuthenticationConfigAsync(LocationName parent, BackendAuthenticationConfig backendAuthenticationConfig, String backendAuthenticationConfigId)
      Creates a new BackendAuthenticationConfig in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         BackendAuthenticationConfig backendAuthenticationConfig =
             BackendAuthenticationConfig.newBuilder().build();
         String backendAuthenticationConfigId = "backendAuthenticationConfigId-396698039";
         BackendAuthenticationConfig response =
             networkSecurityClient
                 .createBackendAuthenticationConfigAsync(
                     parent, backendAuthenticationConfig, backendAuthenticationConfigId)
                 .get();
       }
       
      Parameters:
      parent - Required. The parent resource of the BackendAuthenticationConfig. Must be in the format `projects/*/locations/{location}`.
      backendAuthenticationConfig - Required. BackendAuthenticationConfig resource to be created.
      backendAuthenticationConfigId - Required. Short name of the BackendAuthenticationConfig resource to be created. This value should be 1-63 characters long, containing only letters, numbers, hyphens, and underscores, and should not start with a number. E.g. "backend-auth-config".
      Throws:
      ApiException - if the remote call fails
    • createBackendAuthenticationConfigAsync

      public final OperationFuture<BackendAuthenticationConfig,OperationMetadata> createBackendAuthenticationConfigAsync(String parent, BackendAuthenticationConfig backendAuthenticationConfig, String backendAuthenticationConfigId)
      Creates a new BackendAuthenticationConfig in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         BackendAuthenticationConfig backendAuthenticationConfig =
             BackendAuthenticationConfig.newBuilder().build();
         String backendAuthenticationConfigId = "backendAuthenticationConfigId-396698039";
         BackendAuthenticationConfig response =
             networkSecurityClient
                 .createBackendAuthenticationConfigAsync(
                     parent, backendAuthenticationConfig, backendAuthenticationConfigId)
                 .get();
       }
       
      Parameters:
      parent - Required. The parent resource of the BackendAuthenticationConfig. Must be in the format `projects/*/locations/{location}`.
      backendAuthenticationConfig - Required. BackendAuthenticationConfig resource to be created.
      backendAuthenticationConfigId - Required. Short name of the BackendAuthenticationConfig resource to be created. This value should be 1-63 characters long, containing only letters, numbers, hyphens, and underscores, and should not start with a number. E.g. "backend-auth-config".
      Throws:
      ApiException - if the remote call fails
    • createBackendAuthenticationConfigAsync

      public final OperationFuture<BackendAuthenticationConfig,OperationMetadata> createBackendAuthenticationConfigAsync(CreateBackendAuthenticationConfigRequest request)
      Creates a new BackendAuthenticationConfig in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         CreateBackendAuthenticationConfigRequest request =
             CreateBackendAuthenticationConfigRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setBackendAuthenticationConfigId("backendAuthenticationConfigId-396698039")
                 .setBackendAuthenticationConfig(BackendAuthenticationConfig.newBuilder().build())
                 .build();
         BackendAuthenticationConfig response =
             networkSecurityClient.createBackendAuthenticationConfigAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • createBackendAuthenticationConfigOperationCallable

      public final OperationCallable<CreateBackendAuthenticationConfigRequest,BackendAuthenticationConfig,OperationMetadata> createBackendAuthenticationConfigOperationCallable()
      Creates a new BackendAuthenticationConfig in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         CreateBackendAuthenticationConfigRequest request =
             CreateBackendAuthenticationConfigRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setBackendAuthenticationConfigId("backendAuthenticationConfigId-396698039")
                 .setBackendAuthenticationConfig(BackendAuthenticationConfig.newBuilder().build())
                 .build();
         OperationFuture<BackendAuthenticationConfig, OperationMetadata> future =
             networkSecurityClient
                 .createBackendAuthenticationConfigOperationCallable()
                 .futureCall(request);
         // Do something.
         BackendAuthenticationConfig response = future.get();
       }
       
    • createBackendAuthenticationConfigCallable

      public final UnaryCallable<CreateBackendAuthenticationConfigRequest,Operation> createBackendAuthenticationConfigCallable()
      Creates a new BackendAuthenticationConfig in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         CreateBackendAuthenticationConfigRequest request =
             CreateBackendAuthenticationConfigRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setBackendAuthenticationConfigId("backendAuthenticationConfigId-396698039")
                 .setBackendAuthenticationConfig(BackendAuthenticationConfig.newBuilder().build())
                 .build();
         ApiFuture<Operation> future =
             networkSecurityClient.createBackendAuthenticationConfigCallable().futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • updateBackendAuthenticationConfigAsync

      public final OperationFuture<BackendAuthenticationConfig,OperationMetadata> updateBackendAuthenticationConfigAsync(BackendAuthenticationConfig backendAuthenticationConfig, com.google.protobuf.FieldMask updateMask)
      Updates the parameters of a single BackendAuthenticationConfig to BackendAuthenticationConfig.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         BackendAuthenticationConfig backendAuthenticationConfig =
             BackendAuthenticationConfig.newBuilder().build();
         FieldMask updateMask = FieldMask.newBuilder().build();
         BackendAuthenticationConfig response =
             networkSecurityClient
                 .updateBackendAuthenticationConfigAsync(backendAuthenticationConfig, updateMask)
                 .get();
       }
       
      Parameters:
      backendAuthenticationConfig - Required. Updated BackendAuthenticationConfig resource.
      updateMask - Optional. Field mask is used to specify the fields to be overwritten in the BackendAuthenticationConfig resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten.
      Throws:
      ApiException - if the remote call fails
    • updateBackendAuthenticationConfigAsync

      public final OperationFuture<BackendAuthenticationConfig,OperationMetadata> updateBackendAuthenticationConfigAsync(UpdateBackendAuthenticationConfigRequest request)
      Updates the parameters of a single BackendAuthenticationConfig to BackendAuthenticationConfig.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         UpdateBackendAuthenticationConfigRequest request =
             UpdateBackendAuthenticationConfigRequest.newBuilder()
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .setBackendAuthenticationConfig(BackendAuthenticationConfig.newBuilder().build())
                 .build();
         BackendAuthenticationConfig response =
             networkSecurityClient.updateBackendAuthenticationConfigAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • updateBackendAuthenticationConfigOperationCallable

      public final OperationCallable<UpdateBackendAuthenticationConfigRequest,BackendAuthenticationConfig,OperationMetadata> updateBackendAuthenticationConfigOperationCallable()
      Updates the parameters of a single BackendAuthenticationConfig to BackendAuthenticationConfig.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         UpdateBackendAuthenticationConfigRequest request =
             UpdateBackendAuthenticationConfigRequest.newBuilder()
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .setBackendAuthenticationConfig(BackendAuthenticationConfig.newBuilder().build())
                 .build();
         OperationFuture<BackendAuthenticationConfig, OperationMetadata> future =
             networkSecurityClient
                 .updateBackendAuthenticationConfigOperationCallable()
                 .futureCall(request);
         // Do something.
         BackendAuthenticationConfig response = future.get();
       }
       
    • updateBackendAuthenticationConfigCallable

      public final UnaryCallable<UpdateBackendAuthenticationConfigRequest,Operation> updateBackendAuthenticationConfigCallable()
      Updates the parameters of a single BackendAuthenticationConfig to BackendAuthenticationConfig.

      Sample code:

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

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteBackendAuthenticationConfigAsync(BackendAuthenticationConfigName name)
      Deletes a single BackendAuthenticationConfig to BackendAuthenticationConfig.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         BackendAuthenticationConfigName name =
             BackendAuthenticationConfigName.of(
                 "[PROJECT]", "[LOCATION]", "[BACKEND_AUTHENTICATION_CONFIG]");
         networkSecurityClient.deleteBackendAuthenticationConfigAsync(name).get();
       }
       
      Parameters:
      name - Required. A name of the BackendAuthenticationConfig to delete. Must be in the format `projects/*/locations/{location}/backendAuthenticationConfigs/*`.
      Throws:
      ApiException - if the remote call fails
    • deleteBackendAuthenticationConfigAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteBackendAuthenticationConfigAsync(String name)
      Deletes a single BackendAuthenticationConfig to BackendAuthenticationConfig.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         String name =
             BackendAuthenticationConfigName.of(
                     "[PROJECT]", "[LOCATION]", "[BACKEND_AUTHENTICATION_CONFIG]")
                 .toString();
         networkSecurityClient.deleteBackendAuthenticationConfigAsync(name).get();
       }
       
      Parameters:
      name - Required. A name of the BackendAuthenticationConfig to delete. Must be in the format `projects/*/locations/{location}/backendAuthenticationConfigs/*`.
      Throws:
      ApiException - if the remote call fails
    • deleteBackendAuthenticationConfigAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteBackendAuthenticationConfigAsync(DeleteBackendAuthenticationConfigRequest request)
      Deletes a single BackendAuthenticationConfig to BackendAuthenticationConfig.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         DeleteBackendAuthenticationConfigRequest request =
             DeleteBackendAuthenticationConfigRequest.newBuilder()
                 .setName(
                     BackendAuthenticationConfigName.of(
                             "[PROJECT]", "[LOCATION]", "[BACKEND_AUTHENTICATION_CONFIG]")
                         .toString())
                 .setEtag("etag3123477")
                 .build();
         networkSecurityClient.deleteBackendAuthenticationConfigAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • deleteBackendAuthenticationConfigOperationCallable

      public final OperationCallable<DeleteBackendAuthenticationConfigRequest,com.google.protobuf.Empty,OperationMetadata> deleteBackendAuthenticationConfigOperationCallable()
      Deletes a single BackendAuthenticationConfig to BackendAuthenticationConfig.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         DeleteBackendAuthenticationConfigRequest request =
             DeleteBackendAuthenticationConfigRequest.newBuilder()
                 .setName(
                     BackendAuthenticationConfigName.of(
                             "[PROJECT]", "[LOCATION]", "[BACKEND_AUTHENTICATION_CONFIG]")
                         .toString())
                 .setEtag("etag3123477")
                 .build();
         OperationFuture<Empty, OperationMetadata> future =
             networkSecurityClient
                 .deleteBackendAuthenticationConfigOperationCallable()
                 .futureCall(request);
         // Do something.
         future.get();
       }
       
    • deleteBackendAuthenticationConfigCallable

      public final UnaryCallable<DeleteBackendAuthenticationConfigRequest,Operation> deleteBackendAuthenticationConfigCallable()
      Deletes a single BackendAuthenticationConfig to BackendAuthenticationConfig.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         DeleteBackendAuthenticationConfigRequest request =
             DeleteBackendAuthenticationConfigRequest.newBuilder()
                 .setName(
                     BackendAuthenticationConfigName.of(
                             "[PROJECT]", "[LOCATION]", "[BACKEND_AUTHENTICATION_CONFIG]")
                         .toString())
                 .setEtag("etag3123477")
                 .build();
         ApiFuture<Operation> future =
             networkSecurityClient.deleteBackendAuthenticationConfigCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • listServerTlsPolicies

      public final NetworkSecurityClient.ListServerTlsPoliciesPagedResponse listServerTlsPolicies(LocationName parent)
      Lists ServerTlsPolicies in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         for (ServerTlsPolicy element :
             networkSecurityClient.listServerTlsPolicies(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. The project and location from which the ServerTlsPolicies should be listed, specified in the format `projects/*/locations/{location}`.
      Throws:
      ApiException - if the remote call fails
    • listServerTlsPolicies

      public final NetworkSecurityClient.ListServerTlsPoliciesPagedResponse listServerTlsPolicies(String parent)
      Lists ServerTlsPolicies in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         for (ServerTlsPolicy element :
             networkSecurityClient.listServerTlsPolicies(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. The project and location from which the ServerTlsPolicies should be listed, specified in the format `projects/*/locations/{location}`.
      Throws:
      ApiException - if the remote call fails
    • listServerTlsPolicies

      Lists ServerTlsPolicies in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         ListServerTlsPoliciesRequest request =
             ListServerTlsPoliciesRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setReturnPartialSuccess(true)
                 .build();
         for (ServerTlsPolicy element :
             networkSecurityClient.listServerTlsPolicies(request).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • listServerTlsPoliciesPagedCallable

      Lists ServerTlsPolicies in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         ListServerTlsPoliciesRequest request =
             ListServerTlsPoliciesRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setReturnPartialSuccess(true)
                 .build();
         ApiFuture<ServerTlsPolicy> future =
             networkSecurityClient.listServerTlsPoliciesPagedCallable().futureCall(request);
         // Do something.
         for (ServerTlsPolicy element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • listServerTlsPoliciesCallable

      public final UnaryCallable<ListServerTlsPoliciesRequest,ListServerTlsPoliciesResponse> listServerTlsPoliciesCallable()
      Lists ServerTlsPolicies in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         ListServerTlsPoliciesRequest request =
             ListServerTlsPoliciesRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setReturnPartialSuccess(true)
                 .build();
         while (true) {
           ListServerTlsPoliciesResponse response =
               networkSecurityClient.listServerTlsPoliciesCallable().call(request);
           for (ServerTlsPolicy element : response.getServerTlsPoliciesList()) {
             // doThingsWith(element);
           }
           String nextPageToken = response.getNextPageToken();
           if (!Strings.isNullOrEmpty(nextPageToken)) {
             request = request.toBuilder().setPageToken(nextPageToken).build();
           } else {
             break;
           }
         }
       }
       
    • getServerTlsPolicy

      public final ServerTlsPolicy getServerTlsPolicy(ServerTlsPolicyName name)
      Gets details of a single ServerTlsPolicy.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         ServerTlsPolicyName name =
             ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]");
         ServerTlsPolicy response = networkSecurityClient.getServerTlsPolicy(name);
       }
       
      Parameters:
      name - Required. A name of the ServerTlsPolicy to get. Must be in the format `projects/*/locations/{location}/serverTlsPolicies/*`.
      Throws:
      ApiException - if the remote call fails
    • getServerTlsPolicy

      public final ServerTlsPolicy getServerTlsPolicy(String name)
      Gets details of a single ServerTlsPolicy.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         String name =
             ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]").toString();
         ServerTlsPolicy response = networkSecurityClient.getServerTlsPolicy(name);
       }
       
      Parameters:
      name - Required. A name of the ServerTlsPolicy to get. Must be in the format `projects/*/locations/{location}/serverTlsPolicies/*`.
      Throws:
      ApiException - if the remote call fails
    • getServerTlsPolicy

      public final ServerTlsPolicy getServerTlsPolicy(GetServerTlsPolicyRequest request)
      Gets details of a single ServerTlsPolicy.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         GetServerTlsPolicyRequest request =
             GetServerTlsPolicyRequest.newBuilder()
                 .setName(
                     ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]")
                         .toString())
                 .build();
         ServerTlsPolicy response = networkSecurityClient.getServerTlsPolicy(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • getServerTlsPolicyCallable

      public final UnaryCallable<GetServerTlsPolicyRequest,ServerTlsPolicy> getServerTlsPolicyCallable()
      Gets details of a single ServerTlsPolicy.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         GetServerTlsPolicyRequest request =
             GetServerTlsPolicyRequest.newBuilder()
                 .setName(
                     ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]")
                         .toString())
                 .build();
         ApiFuture<ServerTlsPolicy> future =
             networkSecurityClient.getServerTlsPolicyCallable().futureCall(request);
         // Do something.
         ServerTlsPolicy response = future.get();
       }
       
    • createServerTlsPolicyAsync

      public final OperationFuture<ServerTlsPolicy,OperationMetadata> createServerTlsPolicyAsync(LocationName parent, ServerTlsPolicy serverTlsPolicy, String serverTlsPolicyId)
      Creates a new ServerTlsPolicy in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         ServerTlsPolicy serverTlsPolicy = ServerTlsPolicy.newBuilder().build();
         String serverTlsPolicyId = "serverTlsPolicyId-1966046011";
         ServerTlsPolicy response =
             networkSecurityClient
                 .createServerTlsPolicyAsync(parent, serverTlsPolicy, serverTlsPolicyId)
                 .get();
       }
       
      Parameters:
      parent - Required. The parent resource of the ServerTlsPolicy. Must be in the format `projects/*/locations/{location}`.
      serverTlsPolicy - Required. ServerTlsPolicy resource to be created.
      serverTlsPolicyId - Required. Short name of the ServerTlsPolicy resource to be created. This value should be 1-63 characters long, containing only letters, numbers, hyphens, and underscores, and should not start with a number. E.g. "server_mtls_policy".
      Throws:
      ApiException - if the remote call fails
    • createServerTlsPolicyAsync

      public final OperationFuture<ServerTlsPolicy,OperationMetadata> createServerTlsPolicyAsync(String parent, ServerTlsPolicy serverTlsPolicy, String serverTlsPolicyId)
      Creates a new ServerTlsPolicy in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         ServerTlsPolicy serverTlsPolicy = ServerTlsPolicy.newBuilder().build();
         String serverTlsPolicyId = "serverTlsPolicyId-1966046011";
         ServerTlsPolicy response =
             networkSecurityClient
                 .createServerTlsPolicyAsync(parent, serverTlsPolicy, serverTlsPolicyId)
                 .get();
       }
       
      Parameters:
      parent - Required. The parent resource of the ServerTlsPolicy. Must be in the format `projects/*/locations/{location}`.
      serverTlsPolicy - Required. ServerTlsPolicy resource to be created.
      serverTlsPolicyId - Required. Short name of the ServerTlsPolicy resource to be created. This value should be 1-63 characters long, containing only letters, numbers, hyphens, and underscores, and should not start with a number. E.g. "server_mtls_policy".
      Throws:
      ApiException - if the remote call fails
    • createServerTlsPolicyAsync

      public final OperationFuture<ServerTlsPolicy,OperationMetadata> createServerTlsPolicyAsync(CreateServerTlsPolicyRequest request)
      Creates a new ServerTlsPolicy in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         CreateServerTlsPolicyRequest request =
             CreateServerTlsPolicyRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setServerTlsPolicyId("serverTlsPolicyId-1966046011")
                 .setServerTlsPolicy(ServerTlsPolicy.newBuilder().build())
                 .build();
         ServerTlsPolicy response = networkSecurityClient.createServerTlsPolicyAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • createServerTlsPolicyOperationCallable

      public final OperationCallable<CreateServerTlsPolicyRequest,ServerTlsPolicy,OperationMetadata> createServerTlsPolicyOperationCallable()
      Creates a new ServerTlsPolicy in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         CreateServerTlsPolicyRequest request =
             CreateServerTlsPolicyRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setServerTlsPolicyId("serverTlsPolicyId-1966046011")
                 .setServerTlsPolicy(ServerTlsPolicy.newBuilder().build())
                 .build();
         OperationFuture<ServerTlsPolicy, OperationMetadata> future =
             networkSecurityClient.createServerTlsPolicyOperationCallable().futureCall(request);
         // Do something.
         ServerTlsPolicy response = future.get();
       }
       
    • createServerTlsPolicyCallable

      public final UnaryCallable<CreateServerTlsPolicyRequest,Operation> createServerTlsPolicyCallable()
      Creates a new ServerTlsPolicy in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         CreateServerTlsPolicyRequest request =
             CreateServerTlsPolicyRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setServerTlsPolicyId("serverTlsPolicyId-1966046011")
                 .setServerTlsPolicy(ServerTlsPolicy.newBuilder().build())
                 .build();
         ApiFuture<Operation> future =
             networkSecurityClient.createServerTlsPolicyCallable().futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • updateServerTlsPolicyAsync

      public final OperationFuture<ServerTlsPolicy,OperationMetadata> updateServerTlsPolicyAsync(ServerTlsPolicy serverTlsPolicy, com.google.protobuf.FieldMask updateMask)
      Updates the parameters of a single ServerTlsPolicy.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         ServerTlsPolicy serverTlsPolicy = ServerTlsPolicy.newBuilder().build();
         FieldMask updateMask = FieldMask.newBuilder().build();
         ServerTlsPolicy response =
             networkSecurityClient.updateServerTlsPolicyAsync(serverTlsPolicy, updateMask).get();
       }
       
      Parameters:
      serverTlsPolicy - Required. Updated ServerTlsPolicy resource.
      updateMask - Optional. Field mask is used to specify the fields to be overwritten in the ServerTlsPolicy resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten.
      Throws:
      ApiException - if the remote call fails
    • updateServerTlsPolicyAsync

      public final OperationFuture<ServerTlsPolicy,OperationMetadata> updateServerTlsPolicyAsync(UpdateServerTlsPolicyRequest request)
      Updates the parameters of a single ServerTlsPolicy.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         UpdateServerTlsPolicyRequest request =
             UpdateServerTlsPolicyRequest.newBuilder()
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .setServerTlsPolicy(ServerTlsPolicy.newBuilder().build())
                 .build();
         ServerTlsPolicy response = networkSecurityClient.updateServerTlsPolicyAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • updateServerTlsPolicyOperationCallable

      public final OperationCallable<UpdateServerTlsPolicyRequest,ServerTlsPolicy,OperationMetadata> updateServerTlsPolicyOperationCallable()
      Updates the parameters of a single ServerTlsPolicy.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         UpdateServerTlsPolicyRequest request =
             UpdateServerTlsPolicyRequest.newBuilder()
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .setServerTlsPolicy(ServerTlsPolicy.newBuilder().build())
                 .build();
         OperationFuture<ServerTlsPolicy, OperationMetadata> future =
             networkSecurityClient.updateServerTlsPolicyOperationCallable().futureCall(request);
         // Do something.
         ServerTlsPolicy response = future.get();
       }
       
    • updateServerTlsPolicyCallable

      public final UnaryCallable<UpdateServerTlsPolicyRequest,Operation> updateServerTlsPolicyCallable()
      Updates the parameters of a single ServerTlsPolicy.

      Sample code:

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

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteServerTlsPolicyAsync(ServerTlsPolicyName name)
      Deletes a single ServerTlsPolicy.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         ServerTlsPolicyName name =
             ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]");
         networkSecurityClient.deleteServerTlsPolicyAsync(name).get();
       }
       
      Parameters:
      name - Required. A name of the ServerTlsPolicy to delete. Must be in the format `projects/*/locations/{location}/serverTlsPolicies/*`.
      Throws:
      ApiException - if the remote call fails
    • deleteServerTlsPolicyAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteServerTlsPolicyAsync(String name)
      Deletes a single ServerTlsPolicy.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         String name =
             ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]").toString();
         networkSecurityClient.deleteServerTlsPolicyAsync(name).get();
       }
       
      Parameters:
      name - Required. A name of the ServerTlsPolicy to delete. Must be in the format `projects/*/locations/{location}/serverTlsPolicies/*`.
      Throws:
      ApiException - if the remote call fails
    • deleteServerTlsPolicyAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteServerTlsPolicyAsync(DeleteServerTlsPolicyRequest request)
      Deletes a single ServerTlsPolicy.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         DeleteServerTlsPolicyRequest request =
             DeleteServerTlsPolicyRequest.newBuilder()
                 .setName(
                     ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]")
                         .toString())
                 .build();
         networkSecurityClient.deleteServerTlsPolicyAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • deleteServerTlsPolicyOperationCallable

      public final OperationCallable<DeleteServerTlsPolicyRequest,com.google.protobuf.Empty,OperationMetadata> deleteServerTlsPolicyOperationCallable()
      Deletes a single ServerTlsPolicy.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         DeleteServerTlsPolicyRequest request =
             DeleteServerTlsPolicyRequest.newBuilder()
                 .setName(
                     ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]")
                         .toString())
                 .build();
         OperationFuture<Empty, OperationMetadata> future =
             networkSecurityClient.deleteServerTlsPolicyOperationCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • deleteServerTlsPolicyCallable

      public final UnaryCallable<DeleteServerTlsPolicyRequest,Operation> deleteServerTlsPolicyCallable()
      Deletes a single ServerTlsPolicy.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         DeleteServerTlsPolicyRequest request =
             DeleteServerTlsPolicyRequest.newBuilder()
                 .setName(
                     ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]")
                         .toString())
                 .build();
         ApiFuture<Operation> future =
             networkSecurityClient.deleteServerTlsPolicyCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • listClientTlsPolicies

      public final NetworkSecurityClient.ListClientTlsPoliciesPagedResponse listClientTlsPolicies(LocationName parent)
      Lists ClientTlsPolicies in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         for (ClientTlsPolicy element :
             networkSecurityClient.listClientTlsPolicies(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. The project and location from which the ClientTlsPolicies should be listed, specified in the format `projects/*/locations/{location}`.
      Throws:
      ApiException - if the remote call fails
    • listClientTlsPolicies

      public final NetworkSecurityClient.ListClientTlsPoliciesPagedResponse listClientTlsPolicies(String parent)
      Lists ClientTlsPolicies in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         for (ClientTlsPolicy element :
             networkSecurityClient.listClientTlsPolicies(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. The project and location from which the ClientTlsPolicies should be listed, specified in the format `projects/*/locations/{location}`.
      Throws:
      ApiException - if the remote call fails
    • listClientTlsPolicies

      Lists ClientTlsPolicies in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         ListClientTlsPoliciesRequest request =
             ListClientTlsPoliciesRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         for (ClientTlsPolicy element :
             networkSecurityClient.listClientTlsPolicies(request).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • listClientTlsPoliciesPagedCallable

      Lists ClientTlsPolicies in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         ListClientTlsPoliciesRequest request =
             ListClientTlsPoliciesRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         ApiFuture<ClientTlsPolicy> future =
             networkSecurityClient.listClientTlsPoliciesPagedCallable().futureCall(request);
         // Do something.
         for (ClientTlsPolicy element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • listClientTlsPoliciesCallable

      public final UnaryCallable<ListClientTlsPoliciesRequest,ListClientTlsPoliciesResponse> listClientTlsPoliciesCallable()
      Lists ClientTlsPolicies in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         ListClientTlsPoliciesRequest request =
             ListClientTlsPoliciesRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         while (true) {
           ListClientTlsPoliciesResponse response =
               networkSecurityClient.listClientTlsPoliciesCallable().call(request);
           for (ClientTlsPolicy element : response.getClientTlsPoliciesList()) {
             // doThingsWith(element);
           }
           String nextPageToken = response.getNextPageToken();
           if (!Strings.isNullOrEmpty(nextPageToken)) {
             request = request.toBuilder().setPageToken(nextPageToken).build();
           } else {
             break;
           }
         }
       }
       
    • getClientTlsPolicy

      public final ClientTlsPolicy getClientTlsPolicy(ClientTlsPolicyName name)
      Gets details of a single ClientTlsPolicy.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         ClientTlsPolicyName name =
             ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]");
         ClientTlsPolicy response = networkSecurityClient.getClientTlsPolicy(name);
       }
       
      Parameters:
      name - Required. A name of the ClientTlsPolicy to get. Must be in the format `projects/*/locations/{location}/clientTlsPolicies/*`.
      Throws:
      ApiException - if the remote call fails
    • getClientTlsPolicy

      public final ClientTlsPolicy getClientTlsPolicy(String name)
      Gets details of a single ClientTlsPolicy.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         String name =
             ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]").toString();
         ClientTlsPolicy response = networkSecurityClient.getClientTlsPolicy(name);
       }
       
      Parameters:
      name - Required. A name of the ClientTlsPolicy to get. Must be in the format `projects/*/locations/{location}/clientTlsPolicies/*`.
      Throws:
      ApiException - if the remote call fails
    • getClientTlsPolicy

      public final ClientTlsPolicy getClientTlsPolicy(GetClientTlsPolicyRequest request)
      Gets details of a single ClientTlsPolicy.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         GetClientTlsPolicyRequest request =
             GetClientTlsPolicyRequest.newBuilder()
                 .setName(
                     ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]")
                         .toString())
                 .build();
         ClientTlsPolicy response = networkSecurityClient.getClientTlsPolicy(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • getClientTlsPolicyCallable

      public final UnaryCallable<GetClientTlsPolicyRequest,ClientTlsPolicy> getClientTlsPolicyCallable()
      Gets details of a single ClientTlsPolicy.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         GetClientTlsPolicyRequest request =
             GetClientTlsPolicyRequest.newBuilder()
                 .setName(
                     ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]")
                         .toString())
                 .build();
         ApiFuture<ClientTlsPolicy> future =
             networkSecurityClient.getClientTlsPolicyCallable().futureCall(request);
         // Do something.
         ClientTlsPolicy response = future.get();
       }
       
    • createClientTlsPolicyAsync

      public final OperationFuture<ClientTlsPolicy,OperationMetadata> createClientTlsPolicyAsync(LocationName parent, ClientTlsPolicy clientTlsPolicy, String clientTlsPolicyId)
      Creates a new ClientTlsPolicy in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         ClientTlsPolicy clientTlsPolicy = ClientTlsPolicy.newBuilder().build();
         String clientTlsPolicyId = "clientTlsPolicyId-188933315";
         ClientTlsPolicy response =
             networkSecurityClient
                 .createClientTlsPolicyAsync(parent, clientTlsPolicy, clientTlsPolicyId)
                 .get();
       }
       
      Parameters:
      parent - Required. The parent resource of the ClientTlsPolicy. Must be in the format `projects/*/locations/{location}`.
      clientTlsPolicy - Required. ClientTlsPolicy resource to be created.
      clientTlsPolicyId - Required. Short name of the ClientTlsPolicy resource to be created. This value should be 1-63 characters long, containing only letters, numbers, hyphens, and underscores, and should not start with a number. E.g. "client_mtls_policy".
      Throws:
      ApiException - if the remote call fails
    • createClientTlsPolicyAsync

      public final OperationFuture<ClientTlsPolicy,OperationMetadata> createClientTlsPolicyAsync(String parent, ClientTlsPolicy clientTlsPolicy, String clientTlsPolicyId)
      Creates a new ClientTlsPolicy in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         ClientTlsPolicy clientTlsPolicy = ClientTlsPolicy.newBuilder().build();
         String clientTlsPolicyId = "clientTlsPolicyId-188933315";
         ClientTlsPolicy response =
             networkSecurityClient
                 .createClientTlsPolicyAsync(parent, clientTlsPolicy, clientTlsPolicyId)
                 .get();
       }
       
      Parameters:
      parent - Required. The parent resource of the ClientTlsPolicy. Must be in the format `projects/*/locations/{location}`.
      clientTlsPolicy - Required. ClientTlsPolicy resource to be created.
      clientTlsPolicyId - Required. Short name of the ClientTlsPolicy resource to be created. This value should be 1-63 characters long, containing only letters, numbers, hyphens, and underscores, and should not start with a number. E.g. "client_mtls_policy".
      Throws:
      ApiException - if the remote call fails
    • createClientTlsPolicyAsync

      public final OperationFuture<ClientTlsPolicy,OperationMetadata> createClientTlsPolicyAsync(CreateClientTlsPolicyRequest request)
      Creates a new ClientTlsPolicy in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         CreateClientTlsPolicyRequest request =
             CreateClientTlsPolicyRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setClientTlsPolicyId("clientTlsPolicyId-188933315")
                 .setClientTlsPolicy(ClientTlsPolicy.newBuilder().build())
                 .build();
         ClientTlsPolicy response = networkSecurityClient.createClientTlsPolicyAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • createClientTlsPolicyOperationCallable

      public final OperationCallable<CreateClientTlsPolicyRequest,ClientTlsPolicy,OperationMetadata> createClientTlsPolicyOperationCallable()
      Creates a new ClientTlsPolicy in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         CreateClientTlsPolicyRequest request =
             CreateClientTlsPolicyRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setClientTlsPolicyId("clientTlsPolicyId-188933315")
                 .setClientTlsPolicy(ClientTlsPolicy.newBuilder().build())
                 .build();
         OperationFuture<ClientTlsPolicy, OperationMetadata> future =
             networkSecurityClient.createClientTlsPolicyOperationCallable().futureCall(request);
         // Do something.
         ClientTlsPolicy response = future.get();
       }
       
    • createClientTlsPolicyCallable

      public final UnaryCallable<CreateClientTlsPolicyRequest,Operation> createClientTlsPolicyCallable()
      Creates a new ClientTlsPolicy in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         CreateClientTlsPolicyRequest request =
             CreateClientTlsPolicyRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setClientTlsPolicyId("clientTlsPolicyId-188933315")
                 .setClientTlsPolicy(ClientTlsPolicy.newBuilder().build())
                 .build();
         ApiFuture<Operation> future =
             networkSecurityClient.createClientTlsPolicyCallable().futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • updateClientTlsPolicyAsync

      public final OperationFuture<ClientTlsPolicy,OperationMetadata> updateClientTlsPolicyAsync(ClientTlsPolicy clientTlsPolicy, com.google.protobuf.FieldMask updateMask)
      Updates the parameters of a single ClientTlsPolicy.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         ClientTlsPolicy clientTlsPolicy = ClientTlsPolicy.newBuilder().build();
         FieldMask updateMask = FieldMask.newBuilder().build();
         ClientTlsPolicy response =
             networkSecurityClient.updateClientTlsPolicyAsync(clientTlsPolicy, updateMask).get();
       }
       
      Parameters:
      clientTlsPolicy - Required. Updated ClientTlsPolicy resource.
      updateMask - Optional. Field mask is used to specify the fields to be overwritten in the ClientTlsPolicy resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten.
      Throws:
      ApiException - if the remote call fails
    • updateClientTlsPolicyAsync

      public final OperationFuture<ClientTlsPolicy,OperationMetadata> updateClientTlsPolicyAsync(UpdateClientTlsPolicyRequest request)
      Updates the parameters of a single ClientTlsPolicy.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         UpdateClientTlsPolicyRequest request =
             UpdateClientTlsPolicyRequest.newBuilder()
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .setClientTlsPolicy(ClientTlsPolicy.newBuilder().build())
                 .build();
         ClientTlsPolicy response = networkSecurityClient.updateClientTlsPolicyAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • updateClientTlsPolicyOperationCallable

      public final OperationCallable<UpdateClientTlsPolicyRequest,ClientTlsPolicy,OperationMetadata> updateClientTlsPolicyOperationCallable()
      Updates the parameters of a single ClientTlsPolicy.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         UpdateClientTlsPolicyRequest request =
             UpdateClientTlsPolicyRequest.newBuilder()
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .setClientTlsPolicy(ClientTlsPolicy.newBuilder().build())
                 .build();
         OperationFuture<ClientTlsPolicy, OperationMetadata> future =
             networkSecurityClient.updateClientTlsPolicyOperationCallable().futureCall(request);
         // Do something.
         ClientTlsPolicy response = future.get();
       }
       
    • updateClientTlsPolicyCallable

      public final UnaryCallable<UpdateClientTlsPolicyRequest,Operation> updateClientTlsPolicyCallable()
      Updates the parameters of a single ClientTlsPolicy.

      Sample code:

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

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteClientTlsPolicyAsync(ClientTlsPolicyName name)
      Deletes a single ClientTlsPolicy.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         ClientTlsPolicyName name =
             ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]");
         networkSecurityClient.deleteClientTlsPolicyAsync(name).get();
       }
       
      Parameters:
      name - Required. A name of the ClientTlsPolicy to delete. Must be in the format `projects/*/locations/{location}/clientTlsPolicies/*`.
      Throws:
      ApiException - if the remote call fails
    • deleteClientTlsPolicyAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteClientTlsPolicyAsync(String name)
      Deletes a single ClientTlsPolicy.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         String name =
             ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]").toString();
         networkSecurityClient.deleteClientTlsPolicyAsync(name).get();
       }
       
      Parameters:
      name - Required. A name of the ClientTlsPolicy to delete. Must be in the format `projects/*/locations/{location}/clientTlsPolicies/*`.
      Throws:
      ApiException - if the remote call fails
    • deleteClientTlsPolicyAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteClientTlsPolicyAsync(DeleteClientTlsPolicyRequest request)
      Deletes a single ClientTlsPolicy.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         DeleteClientTlsPolicyRequest request =
             DeleteClientTlsPolicyRequest.newBuilder()
                 .setName(
                     ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]")
                         .toString())
                 .build();
         networkSecurityClient.deleteClientTlsPolicyAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • deleteClientTlsPolicyOperationCallable

      public final OperationCallable<DeleteClientTlsPolicyRequest,com.google.protobuf.Empty,OperationMetadata> deleteClientTlsPolicyOperationCallable()
      Deletes a single ClientTlsPolicy.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         DeleteClientTlsPolicyRequest request =
             DeleteClientTlsPolicyRequest.newBuilder()
                 .setName(
                     ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]")
                         .toString())
                 .build();
         OperationFuture<Empty, OperationMetadata> future =
             networkSecurityClient.deleteClientTlsPolicyOperationCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • deleteClientTlsPolicyCallable

      public final UnaryCallable<DeleteClientTlsPolicyRequest,Operation> deleteClientTlsPolicyCallable()
      Deletes a single ClientTlsPolicy.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         DeleteClientTlsPolicyRequest request =
             DeleteClientTlsPolicyRequest.newBuilder()
                 .setName(
                     ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]")
                         .toString())
                 .build();
         ApiFuture<Operation> future =
             networkSecurityClient.deleteClientTlsPolicyCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • listGatewaySecurityPolicies

      public final NetworkSecurityClient.ListGatewaySecurityPoliciesPagedResponse listGatewaySecurityPolicies(LocationName parent)
      Lists GatewaySecurityPolicies in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         for (GatewaySecurityPolicy element :
             networkSecurityClient.listGatewaySecurityPolicies(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. The project and location from which the GatewaySecurityPolicies should be listed, specified in the format `projects/{project}/locations/{location}`.
      Throws:
      ApiException - if the remote call fails
    • listGatewaySecurityPolicies

      public final NetworkSecurityClient.ListGatewaySecurityPoliciesPagedResponse listGatewaySecurityPolicies(String parent)
      Lists GatewaySecurityPolicies in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         for (GatewaySecurityPolicy element :
             networkSecurityClient.listGatewaySecurityPolicies(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. The project and location from which the GatewaySecurityPolicies should be listed, specified in the format `projects/{project}/locations/{location}`.
      Throws:
      ApiException - if the remote call fails
    • listGatewaySecurityPolicies

      Lists GatewaySecurityPolicies in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         ListGatewaySecurityPoliciesRequest request =
             ListGatewaySecurityPoliciesRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         for (GatewaySecurityPolicy element :
             networkSecurityClient.listGatewaySecurityPolicies(request).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • listGatewaySecurityPoliciesPagedCallable

      Lists GatewaySecurityPolicies in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         ListGatewaySecurityPoliciesRequest request =
             ListGatewaySecurityPoliciesRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         ApiFuture<GatewaySecurityPolicy> future =
             networkSecurityClient.listGatewaySecurityPoliciesPagedCallable().futureCall(request);
         // Do something.
         for (GatewaySecurityPolicy element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • listGatewaySecurityPoliciesCallable

      public final UnaryCallable<ListGatewaySecurityPoliciesRequest,ListGatewaySecurityPoliciesResponse> listGatewaySecurityPoliciesCallable()
      Lists GatewaySecurityPolicies in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         ListGatewaySecurityPoliciesRequest request =
             ListGatewaySecurityPoliciesRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         while (true) {
           ListGatewaySecurityPoliciesResponse response =
               networkSecurityClient.listGatewaySecurityPoliciesCallable().call(request);
           for (GatewaySecurityPolicy element : response.getGatewaySecurityPoliciesList()) {
             // doThingsWith(element);
           }
           String nextPageToken = response.getNextPageToken();
           if (!Strings.isNullOrEmpty(nextPageToken)) {
             request = request.toBuilder().setPageToken(nextPageToken).build();
           } else {
             break;
           }
         }
       }
       
    • getGatewaySecurityPolicy

      public final GatewaySecurityPolicy getGatewaySecurityPolicy(GatewaySecurityPolicyName name)
      Gets details of a single GatewaySecurityPolicy.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         GatewaySecurityPolicyName name =
             GatewaySecurityPolicyName.of("[PROJECT]", "[LOCATION]", "[GATEWAY_SECURITY_POLICY]");
         GatewaySecurityPolicy response = networkSecurityClient.getGatewaySecurityPolicy(name);
       }
       
      Parameters:
      name - Required. A name of the GatewaySecurityPolicy to get. Must be in the format `projects/{project}/locations/{location}/gatewaySecurityPolicies/*`.
      Throws:
      ApiException - if the remote call fails
    • getGatewaySecurityPolicy

      public final GatewaySecurityPolicy getGatewaySecurityPolicy(String name)
      Gets details of a single GatewaySecurityPolicy.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         String name =
             GatewaySecurityPolicyName.of("[PROJECT]", "[LOCATION]", "[GATEWAY_SECURITY_POLICY]")
                 .toString();
         GatewaySecurityPolicy response = networkSecurityClient.getGatewaySecurityPolicy(name);
       }
       
      Parameters:
      name - Required. A name of the GatewaySecurityPolicy to get. Must be in the format `projects/{project}/locations/{location}/gatewaySecurityPolicies/*`.
      Throws:
      ApiException - if the remote call fails
    • getGatewaySecurityPolicy

      public final GatewaySecurityPolicy getGatewaySecurityPolicy(GetGatewaySecurityPolicyRequest request)
      Gets details of a single GatewaySecurityPolicy.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         GetGatewaySecurityPolicyRequest request =
             GetGatewaySecurityPolicyRequest.newBuilder()
                 .setName(
                     GatewaySecurityPolicyName.of(
                             "[PROJECT]", "[LOCATION]", "[GATEWAY_SECURITY_POLICY]")
                         .toString())
                 .build();
         GatewaySecurityPolicy response = networkSecurityClient.getGatewaySecurityPolicy(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • getGatewaySecurityPolicyCallable

      public final UnaryCallable<GetGatewaySecurityPolicyRequest,GatewaySecurityPolicy> getGatewaySecurityPolicyCallable()
      Gets details of a single GatewaySecurityPolicy.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         GetGatewaySecurityPolicyRequest request =
             GetGatewaySecurityPolicyRequest.newBuilder()
                 .setName(
                     GatewaySecurityPolicyName.of(
                             "[PROJECT]", "[LOCATION]", "[GATEWAY_SECURITY_POLICY]")
                         .toString())
                 .build();
         ApiFuture<GatewaySecurityPolicy> future =
             networkSecurityClient.getGatewaySecurityPolicyCallable().futureCall(request);
         // Do something.
         GatewaySecurityPolicy response = future.get();
       }
       
    • createGatewaySecurityPolicyAsync

      public final OperationFuture<GatewaySecurityPolicy,OperationMetadata> createGatewaySecurityPolicyAsync(LocationName parent, GatewaySecurityPolicy gatewaySecurityPolicy, String gatewaySecurityPolicyId)
      Creates a new GatewaySecurityPolicy in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         GatewaySecurityPolicy gatewaySecurityPolicy = GatewaySecurityPolicy.newBuilder().build();
         String gatewaySecurityPolicyId = "gatewaySecurityPolicyId2047625137";
         GatewaySecurityPolicy response =
             networkSecurityClient
                 .createGatewaySecurityPolicyAsync(
                     parent, gatewaySecurityPolicy, gatewaySecurityPolicyId)
                 .get();
       }
       
      Parameters:
      parent - Required. The parent resource of the GatewaySecurityPolicy. Must be in the format `projects/{project}/locations/{location}`.
      gatewaySecurityPolicy - Required. GatewaySecurityPolicy resource to be created.
      gatewaySecurityPolicyId - Required. Short name of the GatewaySecurityPolicy resource to be created. This value should be 1-63 characters long, containing only letters, numbers, hyphens, and underscores, and should not start with a number. E.g. "gateway_security_policy1".
      Throws:
      ApiException - if the remote call fails
    • createGatewaySecurityPolicyAsync

      public final OperationFuture<GatewaySecurityPolicy,OperationMetadata> createGatewaySecurityPolicyAsync(String parent, GatewaySecurityPolicy gatewaySecurityPolicy, String gatewaySecurityPolicyId)
      Creates a new GatewaySecurityPolicy in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         GatewaySecurityPolicy gatewaySecurityPolicy = GatewaySecurityPolicy.newBuilder().build();
         String gatewaySecurityPolicyId = "gatewaySecurityPolicyId2047625137";
         GatewaySecurityPolicy response =
             networkSecurityClient
                 .createGatewaySecurityPolicyAsync(
                     parent, gatewaySecurityPolicy, gatewaySecurityPolicyId)
                 .get();
       }
       
      Parameters:
      parent - Required. The parent resource of the GatewaySecurityPolicy. Must be in the format `projects/{project}/locations/{location}`.
      gatewaySecurityPolicy - Required. GatewaySecurityPolicy resource to be created.
      gatewaySecurityPolicyId - Required. Short name of the GatewaySecurityPolicy resource to be created. This value should be 1-63 characters long, containing only letters, numbers, hyphens, and underscores, and should not start with a number. E.g. "gateway_security_policy1".
      Throws:
      ApiException - if the remote call fails
    • createGatewaySecurityPolicyAsync

      public final OperationFuture<GatewaySecurityPolicy,OperationMetadata> createGatewaySecurityPolicyAsync(CreateGatewaySecurityPolicyRequest request)
      Creates a new GatewaySecurityPolicy in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         CreateGatewaySecurityPolicyRequest request =
             CreateGatewaySecurityPolicyRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setGatewaySecurityPolicyId("gatewaySecurityPolicyId2047625137")
                 .setGatewaySecurityPolicy(GatewaySecurityPolicy.newBuilder().build())
                 .build();
         GatewaySecurityPolicy response =
             networkSecurityClient.createGatewaySecurityPolicyAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • createGatewaySecurityPolicyOperationCallable

      public final OperationCallable<CreateGatewaySecurityPolicyRequest,GatewaySecurityPolicy,OperationMetadata> createGatewaySecurityPolicyOperationCallable()
      Creates a new GatewaySecurityPolicy in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         CreateGatewaySecurityPolicyRequest request =
             CreateGatewaySecurityPolicyRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setGatewaySecurityPolicyId("gatewaySecurityPolicyId2047625137")
                 .setGatewaySecurityPolicy(GatewaySecurityPolicy.newBuilder().build())
                 .build();
         OperationFuture<GatewaySecurityPolicy, OperationMetadata> future =
             networkSecurityClient.createGatewaySecurityPolicyOperationCallable().futureCall(request);
         // Do something.
         GatewaySecurityPolicy response = future.get();
       }
       
    • createGatewaySecurityPolicyCallable

      public final UnaryCallable<CreateGatewaySecurityPolicyRequest,Operation> createGatewaySecurityPolicyCallable()
      Creates a new GatewaySecurityPolicy in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         CreateGatewaySecurityPolicyRequest request =
             CreateGatewaySecurityPolicyRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setGatewaySecurityPolicyId("gatewaySecurityPolicyId2047625137")
                 .setGatewaySecurityPolicy(GatewaySecurityPolicy.newBuilder().build())
                 .build();
         ApiFuture<Operation> future =
             networkSecurityClient.createGatewaySecurityPolicyCallable().futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • updateGatewaySecurityPolicyAsync

      public final OperationFuture<GatewaySecurityPolicy,OperationMetadata> updateGatewaySecurityPolicyAsync(GatewaySecurityPolicy gatewaySecurityPolicy, com.google.protobuf.FieldMask updateMask)
      Updates the parameters of a single GatewaySecurityPolicy.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         GatewaySecurityPolicy gatewaySecurityPolicy = GatewaySecurityPolicy.newBuilder().build();
         FieldMask updateMask = FieldMask.newBuilder().build();
         GatewaySecurityPolicy response =
             networkSecurityClient
                 .updateGatewaySecurityPolicyAsync(gatewaySecurityPolicy, updateMask)
                 .get();
       }
       
      Parameters:
      gatewaySecurityPolicy - Required. Updated GatewaySecurityPolicy resource.
      updateMask - Optional. Field mask is used to specify the fields to be overwritten in the GatewaySecurityPolicy resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten.
      Throws:
      ApiException - if the remote call fails
    • updateGatewaySecurityPolicyAsync

      public final OperationFuture<GatewaySecurityPolicy,OperationMetadata> updateGatewaySecurityPolicyAsync(UpdateGatewaySecurityPolicyRequest request)
      Updates the parameters of a single GatewaySecurityPolicy.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         UpdateGatewaySecurityPolicyRequest request =
             UpdateGatewaySecurityPolicyRequest.newBuilder()
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .setGatewaySecurityPolicy(GatewaySecurityPolicy.newBuilder().build())
                 .build();
         GatewaySecurityPolicy response =
             networkSecurityClient.updateGatewaySecurityPolicyAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • updateGatewaySecurityPolicyOperationCallable

      public final OperationCallable<UpdateGatewaySecurityPolicyRequest,GatewaySecurityPolicy,OperationMetadata> updateGatewaySecurityPolicyOperationCallable()
      Updates the parameters of a single GatewaySecurityPolicy.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         UpdateGatewaySecurityPolicyRequest request =
             UpdateGatewaySecurityPolicyRequest.newBuilder()
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .setGatewaySecurityPolicy(GatewaySecurityPolicy.newBuilder().build())
                 .build();
         OperationFuture<GatewaySecurityPolicy, OperationMetadata> future =
             networkSecurityClient.updateGatewaySecurityPolicyOperationCallable().futureCall(request);
         // Do something.
         GatewaySecurityPolicy response = future.get();
       }
       
    • updateGatewaySecurityPolicyCallable

      public final UnaryCallable<UpdateGatewaySecurityPolicyRequest,Operation> updateGatewaySecurityPolicyCallable()
      Updates the parameters of a single GatewaySecurityPolicy.

      Sample code:

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

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteGatewaySecurityPolicyAsync(GatewaySecurityPolicyName name)
      Deletes a single GatewaySecurityPolicy.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         GatewaySecurityPolicyName name =
             GatewaySecurityPolicyName.of("[PROJECT]", "[LOCATION]", "[GATEWAY_SECURITY_POLICY]");
         networkSecurityClient.deleteGatewaySecurityPolicyAsync(name).get();
       }
       
      Parameters:
      name - Required. A name of the GatewaySecurityPolicy to delete. Must be in the format `projects/{project}/locations/{location}/gatewaySecurityPolicies/*`.
      Throws:
      ApiException - if the remote call fails
    • deleteGatewaySecurityPolicyAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteGatewaySecurityPolicyAsync(String name)
      Deletes a single GatewaySecurityPolicy.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         String name =
             GatewaySecurityPolicyName.of("[PROJECT]", "[LOCATION]", "[GATEWAY_SECURITY_POLICY]")
                 .toString();
         networkSecurityClient.deleteGatewaySecurityPolicyAsync(name).get();
       }
       
      Parameters:
      name - Required. A name of the GatewaySecurityPolicy to delete. Must be in the format `projects/{project}/locations/{location}/gatewaySecurityPolicies/*`.
      Throws:
      ApiException - if the remote call fails
    • deleteGatewaySecurityPolicyAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteGatewaySecurityPolicyAsync(DeleteGatewaySecurityPolicyRequest request)
      Deletes a single GatewaySecurityPolicy.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         DeleteGatewaySecurityPolicyRequest request =
             DeleteGatewaySecurityPolicyRequest.newBuilder()
                 .setName(
                     GatewaySecurityPolicyName.of(
                             "[PROJECT]", "[LOCATION]", "[GATEWAY_SECURITY_POLICY]")
                         .toString())
                 .build();
         networkSecurityClient.deleteGatewaySecurityPolicyAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • deleteGatewaySecurityPolicyOperationCallable

      public final OperationCallable<DeleteGatewaySecurityPolicyRequest,com.google.protobuf.Empty,OperationMetadata> deleteGatewaySecurityPolicyOperationCallable()
      Deletes a single GatewaySecurityPolicy.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         DeleteGatewaySecurityPolicyRequest request =
             DeleteGatewaySecurityPolicyRequest.newBuilder()
                 .setName(
                     GatewaySecurityPolicyName.of(
                             "[PROJECT]", "[LOCATION]", "[GATEWAY_SECURITY_POLICY]")
                         .toString())
                 .build();
         OperationFuture<Empty, OperationMetadata> future =
             networkSecurityClient.deleteGatewaySecurityPolicyOperationCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • deleteGatewaySecurityPolicyCallable

      public final UnaryCallable<DeleteGatewaySecurityPolicyRequest,Operation> deleteGatewaySecurityPolicyCallable()
      Deletes a single GatewaySecurityPolicy.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         DeleteGatewaySecurityPolicyRequest request =
             DeleteGatewaySecurityPolicyRequest.newBuilder()
                 .setName(
                     GatewaySecurityPolicyName.of(
                             "[PROJECT]", "[LOCATION]", "[GATEWAY_SECURITY_POLICY]")
                         .toString())
                 .build();
         ApiFuture<Operation> future =
             networkSecurityClient.deleteGatewaySecurityPolicyCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • listGatewaySecurityPolicyRules

      Lists GatewaySecurityPolicyRules in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         GatewaySecurityPolicyName parent =
             GatewaySecurityPolicyName.of("[PROJECT]", "[LOCATION]", "[GATEWAY_SECURITY_POLICY]");
         for (GatewaySecurityPolicyRule element :
             networkSecurityClient.listGatewaySecurityPolicyRules(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. The project, location and GatewaySecurityPolicy from which the GatewaySecurityPolicyRules should be listed, specified in the format `projects/{project}/locations/{location}/gatewaySecurityPolicies/{gatewaySecurityPolicy}`.
      Throws:
      ApiException - if the remote call fails
    • listGatewaySecurityPolicyRules

      public final NetworkSecurityClient.ListGatewaySecurityPolicyRulesPagedResponse listGatewaySecurityPolicyRules(String parent)
      Lists GatewaySecurityPolicyRules in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         String parent =
             GatewaySecurityPolicyName.of("[PROJECT]", "[LOCATION]", "[GATEWAY_SECURITY_POLICY]")
                 .toString();
         for (GatewaySecurityPolicyRule element :
             networkSecurityClient.listGatewaySecurityPolicyRules(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. The project, location and GatewaySecurityPolicy from which the GatewaySecurityPolicyRules should be listed, specified in the format `projects/{project}/locations/{location}/gatewaySecurityPolicies/{gatewaySecurityPolicy}`.
      Throws:
      ApiException - if the remote call fails
    • listGatewaySecurityPolicyRules

      Lists GatewaySecurityPolicyRules in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         ListGatewaySecurityPolicyRulesRequest request =
             ListGatewaySecurityPolicyRulesRequest.newBuilder()
                 .setParent(
                     GatewaySecurityPolicyName.of(
                             "[PROJECT]", "[LOCATION]", "[GATEWAY_SECURITY_POLICY]")
                         .toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         for (GatewaySecurityPolicyRule element :
             networkSecurityClient.listGatewaySecurityPolicyRules(request).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • listGatewaySecurityPolicyRulesPagedCallable

      Lists GatewaySecurityPolicyRules in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         ListGatewaySecurityPolicyRulesRequest request =
             ListGatewaySecurityPolicyRulesRequest.newBuilder()
                 .setParent(
                     GatewaySecurityPolicyName.of(
                             "[PROJECT]", "[LOCATION]", "[GATEWAY_SECURITY_POLICY]")
                         .toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         ApiFuture<GatewaySecurityPolicyRule> future =
             networkSecurityClient.listGatewaySecurityPolicyRulesPagedCallable().futureCall(request);
         // Do something.
         for (GatewaySecurityPolicyRule element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • listGatewaySecurityPolicyRulesCallable

      public final UnaryCallable<ListGatewaySecurityPolicyRulesRequest,ListGatewaySecurityPolicyRulesResponse> listGatewaySecurityPolicyRulesCallable()
      Lists GatewaySecurityPolicyRules in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         ListGatewaySecurityPolicyRulesRequest request =
             ListGatewaySecurityPolicyRulesRequest.newBuilder()
                 .setParent(
                     GatewaySecurityPolicyName.of(
                             "[PROJECT]", "[LOCATION]", "[GATEWAY_SECURITY_POLICY]")
                         .toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         while (true) {
           ListGatewaySecurityPolicyRulesResponse response =
               networkSecurityClient.listGatewaySecurityPolicyRulesCallable().call(request);
           for (GatewaySecurityPolicyRule element : response.getGatewaySecurityPolicyRulesList()) {
             // doThingsWith(element);
           }
           String nextPageToken = response.getNextPageToken();
           if (!Strings.isNullOrEmpty(nextPageToken)) {
             request = request.toBuilder().setPageToken(nextPageToken).build();
           } else {
             break;
           }
         }
       }
       
    • getGatewaySecurityPolicyRule

      public final GatewaySecurityPolicyRule getGatewaySecurityPolicyRule(GatewaySecurityPolicyRuleName name)
      Gets details of a single GatewaySecurityPolicyRule.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         GatewaySecurityPolicyRuleName name =
             GatewaySecurityPolicyRuleName.of(
                 "[PROJECT]", "[LOCATION]", "[GATEWAY_SECURITY_POLICY]", "[RULE]");
         GatewaySecurityPolicyRule response = networkSecurityClient.getGatewaySecurityPolicyRule(name);
       }
       
      Parameters:
      name - Required. The name of the GatewaySecurityPolicyRule to retrieve. Format: projects/{project}/location/{location}/gatewaySecurityPolicies/*/rules/*
      Throws:
      ApiException - if the remote call fails
    • getGatewaySecurityPolicyRule

      public final GatewaySecurityPolicyRule getGatewaySecurityPolicyRule(String name)
      Gets details of a single GatewaySecurityPolicyRule.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         String name =
             GatewaySecurityPolicyRuleName.of(
                     "[PROJECT]", "[LOCATION]", "[GATEWAY_SECURITY_POLICY]", "[RULE]")
                 .toString();
         GatewaySecurityPolicyRule response = networkSecurityClient.getGatewaySecurityPolicyRule(name);
       }
       
      Parameters:
      name - Required. The name of the GatewaySecurityPolicyRule to retrieve. Format: projects/{project}/location/{location}/gatewaySecurityPolicies/*/rules/*
      Throws:
      ApiException - if the remote call fails
    • getGatewaySecurityPolicyRule

      public final GatewaySecurityPolicyRule getGatewaySecurityPolicyRule(GetGatewaySecurityPolicyRuleRequest request)
      Gets details of a single GatewaySecurityPolicyRule.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         GetGatewaySecurityPolicyRuleRequest request =
             GetGatewaySecurityPolicyRuleRequest.newBuilder()
                 .setName(
                     GatewaySecurityPolicyRuleName.of(
                             "[PROJECT]", "[LOCATION]", "[GATEWAY_SECURITY_POLICY]", "[RULE]")
                         .toString())
                 .build();
         GatewaySecurityPolicyRule response =
             networkSecurityClient.getGatewaySecurityPolicyRule(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • getGatewaySecurityPolicyRuleCallable

      public final UnaryCallable<GetGatewaySecurityPolicyRuleRequest,GatewaySecurityPolicyRule> getGatewaySecurityPolicyRuleCallable()
      Gets details of a single GatewaySecurityPolicyRule.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         GetGatewaySecurityPolicyRuleRequest request =
             GetGatewaySecurityPolicyRuleRequest.newBuilder()
                 .setName(
                     GatewaySecurityPolicyRuleName.of(
                             "[PROJECT]", "[LOCATION]", "[GATEWAY_SECURITY_POLICY]", "[RULE]")
                         .toString())
                 .build();
         ApiFuture<GatewaySecurityPolicyRule> future =
             networkSecurityClient.getGatewaySecurityPolicyRuleCallable().futureCall(request);
         // Do something.
         GatewaySecurityPolicyRule response = future.get();
       }
       
    • createGatewaySecurityPolicyRuleAsync

      public final OperationFuture<GatewaySecurityPolicyRule,OperationMetadata> createGatewaySecurityPolicyRuleAsync(GatewaySecurityPolicyName parent, GatewaySecurityPolicyRule gatewaySecurityPolicyRule, String gatewaySecurityPolicyRuleId)
      Creates a new GatewaySecurityPolicy in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         GatewaySecurityPolicyName parent =
             GatewaySecurityPolicyName.of("[PROJECT]", "[LOCATION]", "[GATEWAY_SECURITY_POLICY]");
         GatewaySecurityPolicyRule gatewaySecurityPolicyRule =
             GatewaySecurityPolicyRule.newBuilder().build();
         String gatewaySecurityPolicyRuleId = "gatewaySecurityPolicyRuleId-1764962099";
         GatewaySecurityPolicyRule response =
             networkSecurityClient
                 .createGatewaySecurityPolicyRuleAsync(
                     parent, gatewaySecurityPolicyRule, gatewaySecurityPolicyRuleId)
                 .get();
       }
       
      Parameters:
      parent - Required. The parent where this rule will be created. Format : projects/{project}/location/{location}/gatewaySecurityPolicies/*
      gatewaySecurityPolicyRule - Required. The rule to be created.
      gatewaySecurityPolicyRuleId - The ID to use for the rule, which will become the final component of the rule's resource name. This value should be 4-63 characters, and valid characters are /[a-z][0-9]-/.
      Throws:
      ApiException - if the remote call fails
    • createGatewaySecurityPolicyRuleAsync

      public final OperationFuture<GatewaySecurityPolicyRule,OperationMetadata> createGatewaySecurityPolicyRuleAsync(String parent, GatewaySecurityPolicyRule gatewaySecurityPolicyRule, String gatewaySecurityPolicyRuleId)
      Creates a new GatewaySecurityPolicy in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         String parent =
             GatewaySecurityPolicyName.of("[PROJECT]", "[LOCATION]", "[GATEWAY_SECURITY_POLICY]")
                 .toString();
         GatewaySecurityPolicyRule gatewaySecurityPolicyRule =
             GatewaySecurityPolicyRule.newBuilder().build();
         String gatewaySecurityPolicyRuleId = "gatewaySecurityPolicyRuleId-1764962099";
         GatewaySecurityPolicyRule response =
             networkSecurityClient
                 .createGatewaySecurityPolicyRuleAsync(
                     parent, gatewaySecurityPolicyRule, gatewaySecurityPolicyRuleId)
                 .get();
       }
       
      Parameters:
      parent - Required. The parent where this rule will be created. Format : projects/{project}/location/{location}/gatewaySecurityPolicies/*
      gatewaySecurityPolicyRule - Required. The rule to be created.
      gatewaySecurityPolicyRuleId - The ID to use for the rule, which will become the final component of the rule's resource name. This value should be 4-63 characters, and valid characters are /[a-z][0-9]-/.
      Throws:
      ApiException - if the remote call fails
    • createGatewaySecurityPolicyRuleAsync

      public final OperationFuture<GatewaySecurityPolicyRule,OperationMetadata> createGatewaySecurityPolicyRuleAsync(CreateGatewaySecurityPolicyRuleRequest request)
      Creates a new GatewaySecurityPolicy in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         CreateGatewaySecurityPolicyRuleRequest request =
             CreateGatewaySecurityPolicyRuleRequest.newBuilder()
                 .setParent(
                     GatewaySecurityPolicyName.of(
                             "[PROJECT]", "[LOCATION]", "[GATEWAY_SECURITY_POLICY]")
                         .toString())
                 .setGatewaySecurityPolicyRule(GatewaySecurityPolicyRule.newBuilder().build())
                 .setGatewaySecurityPolicyRuleId("gatewaySecurityPolicyRuleId-1764962099")
                 .build();
         GatewaySecurityPolicyRule response =
             networkSecurityClient.createGatewaySecurityPolicyRuleAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • createGatewaySecurityPolicyRuleOperationCallable

      public final OperationCallable<CreateGatewaySecurityPolicyRuleRequest,GatewaySecurityPolicyRule,OperationMetadata> createGatewaySecurityPolicyRuleOperationCallable()
      Creates a new GatewaySecurityPolicy in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         CreateGatewaySecurityPolicyRuleRequest request =
             CreateGatewaySecurityPolicyRuleRequest.newBuilder()
                 .setParent(
                     GatewaySecurityPolicyName.of(
                             "[PROJECT]", "[LOCATION]", "[GATEWAY_SECURITY_POLICY]")
                         .toString())
                 .setGatewaySecurityPolicyRule(GatewaySecurityPolicyRule.newBuilder().build())
                 .setGatewaySecurityPolicyRuleId("gatewaySecurityPolicyRuleId-1764962099")
                 .build();
         OperationFuture<GatewaySecurityPolicyRule, OperationMetadata> future =
             networkSecurityClient
                 .createGatewaySecurityPolicyRuleOperationCallable()
                 .futureCall(request);
         // Do something.
         GatewaySecurityPolicyRule response = future.get();
       }
       
    • createGatewaySecurityPolicyRuleCallable

      public final UnaryCallable<CreateGatewaySecurityPolicyRuleRequest,Operation> createGatewaySecurityPolicyRuleCallable()
      Creates a new GatewaySecurityPolicy in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         CreateGatewaySecurityPolicyRuleRequest request =
             CreateGatewaySecurityPolicyRuleRequest.newBuilder()
                 .setParent(
                     GatewaySecurityPolicyName.of(
                             "[PROJECT]", "[LOCATION]", "[GATEWAY_SECURITY_POLICY]")
                         .toString())
                 .setGatewaySecurityPolicyRule(GatewaySecurityPolicyRule.newBuilder().build())
                 .setGatewaySecurityPolicyRuleId("gatewaySecurityPolicyRuleId-1764962099")
                 .build();
         ApiFuture<Operation> future =
             networkSecurityClient.createGatewaySecurityPolicyRuleCallable().futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • updateGatewaySecurityPolicyRuleAsync

      public final OperationFuture<GatewaySecurityPolicyRule,OperationMetadata> updateGatewaySecurityPolicyRuleAsync(GatewaySecurityPolicyRule gatewaySecurityPolicyRule, com.google.protobuf.FieldMask updateMask)
      Updates the parameters of a single GatewaySecurityPolicyRule.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         GatewaySecurityPolicyRule gatewaySecurityPolicyRule =
             GatewaySecurityPolicyRule.newBuilder().build();
         FieldMask updateMask = FieldMask.newBuilder().build();
         GatewaySecurityPolicyRule response =
             networkSecurityClient
                 .updateGatewaySecurityPolicyRuleAsync(gatewaySecurityPolicyRule, updateMask)
                 .get();
       }
       
      Parameters:
      gatewaySecurityPolicyRule - Required. Updated GatewaySecurityPolicyRule resource.
      updateMask - Optional. Field mask is used to specify the fields to be overwritten in the GatewaySecurityPolicy resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten.
      Throws:
      ApiException - if the remote call fails
    • updateGatewaySecurityPolicyRuleAsync

      public final OperationFuture<GatewaySecurityPolicyRule,OperationMetadata> updateGatewaySecurityPolicyRuleAsync(UpdateGatewaySecurityPolicyRuleRequest request)
      Updates the parameters of a single GatewaySecurityPolicyRule.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         UpdateGatewaySecurityPolicyRuleRequest request =
             UpdateGatewaySecurityPolicyRuleRequest.newBuilder()
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .setGatewaySecurityPolicyRule(GatewaySecurityPolicyRule.newBuilder().build())
                 .build();
         GatewaySecurityPolicyRule response =
             networkSecurityClient.updateGatewaySecurityPolicyRuleAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • updateGatewaySecurityPolicyRuleOperationCallable

      public final OperationCallable<UpdateGatewaySecurityPolicyRuleRequest,GatewaySecurityPolicyRule,OperationMetadata> updateGatewaySecurityPolicyRuleOperationCallable()
      Updates the parameters of a single GatewaySecurityPolicyRule.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         UpdateGatewaySecurityPolicyRuleRequest request =
             UpdateGatewaySecurityPolicyRuleRequest.newBuilder()
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .setGatewaySecurityPolicyRule(GatewaySecurityPolicyRule.newBuilder().build())
                 .build();
         OperationFuture<GatewaySecurityPolicyRule, OperationMetadata> future =
             networkSecurityClient
                 .updateGatewaySecurityPolicyRuleOperationCallable()
                 .futureCall(request);
         // Do something.
         GatewaySecurityPolicyRule response = future.get();
       }
       
    • updateGatewaySecurityPolicyRuleCallable

      public final UnaryCallable<UpdateGatewaySecurityPolicyRuleRequest,Operation> updateGatewaySecurityPolicyRuleCallable()
      Updates the parameters of a single GatewaySecurityPolicyRule.

      Sample code:

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

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteGatewaySecurityPolicyRuleAsync(GatewaySecurityPolicyRuleName name)
      Deletes a single GatewaySecurityPolicyRule.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         GatewaySecurityPolicyRuleName name =
             GatewaySecurityPolicyRuleName.of(
                 "[PROJECT]", "[LOCATION]", "[GATEWAY_SECURITY_POLICY]", "[RULE]");
         networkSecurityClient.deleteGatewaySecurityPolicyRuleAsync(name).get();
       }
       
      Parameters:
      name - Required. A name of the GatewaySecurityPolicyRule to delete. Must be in the format `projects/{project}/locations/{location}/gatewaySecurityPolicies/{gatewaySecurityPolicy}/rules/*`.
      Throws:
      ApiException - if the remote call fails
    • deleteGatewaySecurityPolicyRuleAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteGatewaySecurityPolicyRuleAsync(String name)
      Deletes a single GatewaySecurityPolicyRule.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         String name =
             GatewaySecurityPolicyRuleName.of(
                     "[PROJECT]", "[LOCATION]", "[GATEWAY_SECURITY_POLICY]", "[RULE]")
                 .toString();
         networkSecurityClient.deleteGatewaySecurityPolicyRuleAsync(name).get();
       }
       
      Parameters:
      name - Required. A name of the GatewaySecurityPolicyRule to delete. Must be in the format `projects/{project}/locations/{location}/gatewaySecurityPolicies/{gatewaySecurityPolicy}/rules/*`.
      Throws:
      ApiException - if the remote call fails
    • deleteGatewaySecurityPolicyRuleAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteGatewaySecurityPolicyRuleAsync(DeleteGatewaySecurityPolicyRuleRequest request)
      Deletes a single GatewaySecurityPolicyRule.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         DeleteGatewaySecurityPolicyRuleRequest request =
             DeleteGatewaySecurityPolicyRuleRequest.newBuilder()
                 .setName(
                     GatewaySecurityPolicyRuleName.of(
                             "[PROJECT]", "[LOCATION]", "[GATEWAY_SECURITY_POLICY]", "[RULE]")
                         .toString())
                 .build();
         networkSecurityClient.deleteGatewaySecurityPolicyRuleAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • deleteGatewaySecurityPolicyRuleOperationCallable

      public final OperationCallable<DeleteGatewaySecurityPolicyRuleRequest,com.google.protobuf.Empty,OperationMetadata> deleteGatewaySecurityPolicyRuleOperationCallable()
      Deletes a single GatewaySecurityPolicyRule.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         DeleteGatewaySecurityPolicyRuleRequest request =
             DeleteGatewaySecurityPolicyRuleRequest.newBuilder()
                 .setName(
                     GatewaySecurityPolicyRuleName.of(
                             "[PROJECT]", "[LOCATION]", "[GATEWAY_SECURITY_POLICY]", "[RULE]")
                         .toString())
                 .build();
         OperationFuture<Empty, OperationMetadata> future =
             networkSecurityClient
                 .deleteGatewaySecurityPolicyRuleOperationCallable()
                 .futureCall(request);
         // Do something.
         future.get();
       }
       
    • deleteGatewaySecurityPolicyRuleCallable

      public final UnaryCallable<DeleteGatewaySecurityPolicyRuleRequest,Operation> deleteGatewaySecurityPolicyRuleCallable()
      Deletes a single GatewaySecurityPolicyRule.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         DeleteGatewaySecurityPolicyRuleRequest request =
             DeleteGatewaySecurityPolicyRuleRequest.newBuilder()
                 .setName(
                     GatewaySecurityPolicyRuleName.of(
                             "[PROJECT]", "[LOCATION]", "[GATEWAY_SECURITY_POLICY]", "[RULE]")
                         .toString())
                 .build();
         ApiFuture<Operation> future =
             networkSecurityClient.deleteGatewaySecurityPolicyRuleCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • listUrlLists

      Lists UrlLists in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         for (UrlList element : networkSecurityClient.listUrlLists(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. The project and location from which the UrlLists should be listed, specified in the format `projects/{project}/locations/{location}`.
      Throws:
      ApiException - if the remote call fails
    • listUrlLists

      public final NetworkSecurityClient.ListUrlListsPagedResponse listUrlLists(String parent)
      Lists UrlLists in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         for (UrlList element : networkSecurityClient.listUrlLists(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. The project and location from which the UrlLists should be listed, specified in the format `projects/{project}/locations/{location}`.
      Throws:
      ApiException - if the remote call fails
    • listUrlLists

      Lists UrlLists in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         ListUrlListsRequest request =
             ListUrlListsRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         for (UrlList element : networkSecurityClient.listUrlLists(request).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • listUrlListsPagedCallable

      Lists UrlLists in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         ListUrlListsRequest request =
             ListUrlListsRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         ApiFuture<UrlList> future =
             networkSecurityClient.listUrlListsPagedCallable().futureCall(request);
         // Do something.
         for (UrlList element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • listUrlListsCallable

      public final UnaryCallable<ListUrlListsRequest,ListUrlListsResponse> listUrlListsCallable()
      Lists UrlLists in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         ListUrlListsRequest request =
             ListUrlListsRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         while (true) {
           ListUrlListsResponse response = networkSecurityClient.listUrlListsCallable().call(request);
           for (UrlList element : response.getUrlListsList()) {
             // doThingsWith(element);
           }
           String nextPageToken = response.getNextPageToken();
           if (!Strings.isNullOrEmpty(nextPageToken)) {
             request = request.toBuilder().setPageToken(nextPageToken).build();
           } else {
             break;
           }
         }
       }
       
    • getUrlList

      public final UrlList getUrlList(UrlListName name)
      Gets details of a single UrlList.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         UrlListName name = UrlListName.of("[PROJECT]", "[LOCATION]", "[URL_LIST]");
         UrlList response = networkSecurityClient.getUrlList(name);
       }
       
      Parameters:
      name - Required. A name of the UrlList to get. Must be in the format `projects/*/locations/{location}/urlLists/*`.
      Throws:
      ApiException - if the remote call fails
    • getUrlList

      public final UrlList getUrlList(String name)
      Gets details of a single UrlList.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         String name = UrlListName.of("[PROJECT]", "[LOCATION]", "[URL_LIST]").toString();
         UrlList response = networkSecurityClient.getUrlList(name);
       }
       
      Parameters:
      name - Required. A name of the UrlList to get. Must be in the format `projects/*/locations/{location}/urlLists/*`.
      Throws:
      ApiException - if the remote call fails
    • getUrlList

      public final UrlList getUrlList(GetUrlListRequest request)
      Gets details of a single UrlList.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         GetUrlListRequest request =
             GetUrlListRequest.newBuilder()
                 .setName(UrlListName.of("[PROJECT]", "[LOCATION]", "[URL_LIST]").toString())
                 .build();
         UrlList response = networkSecurityClient.getUrlList(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • getUrlListCallable

      public final UnaryCallable<GetUrlListRequest,UrlList> getUrlListCallable()
      Gets details of a single UrlList.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         GetUrlListRequest request =
             GetUrlListRequest.newBuilder()
                 .setName(UrlListName.of("[PROJECT]", "[LOCATION]", "[URL_LIST]").toString())
                 .build();
         ApiFuture<UrlList> future = networkSecurityClient.getUrlListCallable().futureCall(request);
         // Do something.
         UrlList response = future.get();
       }
       
    • createUrlListAsync

      public final OperationFuture<UrlList,OperationMetadata> createUrlListAsync(LocationName parent, UrlList urlList, String urlListId)
      Creates a new UrlList in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         UrlList urlList = UrlList.newBuilder().build();
         String urlListId = "urlListId-564417368";
         UrlList response = networkSecurityClient.createUrlListAsync(parent, urlList, urlListId).get();
       }
       
      Parameters:
      parent - Required. The parent resource of the UrlList. Must be in the format `projects/*/locations/{location}`.
      urlList - Required. UrlList resource to be created.
      urlListId - Required. Short name of the UrlList resource to be created. This value should be 1-63 characters long, containing only letters, numbers, hyphens, and underscores, and should not start with a number. E.g. "url_list".
      Throws:
      ApiException - if the remote call fails
    • createUrlListAsync

      public final OperationFuture<UrlList,OperationMetadata> createUrlListAsync(String parent, UrlList urlList, String urlListId)
      Creates a new UrlList in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         UrlList urlList = UrlList.newBuilder().build();
         String urlListId = "urlListId-564417368";
         UrlList response = networkSecurityClient.createUrlListAsync(parent, urlList, urlListId).get();
       }
       
      Parameters:
      parent - Required. The parent resource of the UrlList. Must be in the format `projects/*/locations/{location}`.
      urlList - Required. UrlList resource to be created.
      urlListId - Required. Short name of the UrlList resource to be created. This value should be 1-63 characters long, containing only letters, numbers, hyphens, and underscores, and should not start with a number. E.g. "url_list".
      Throws:
      ApiException - if the remote call fails
    • createUrlListAsync

      public final OperationFuture<UrlList,OperationMetadata> createUrlListAsync(CreateUrlListRequest request)
      Creates a new UrlList in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         CreateUrlListRequest request =
             CreateUrlListRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setUrlListId("urlListId-564417368")
                 .setUrlList(UrlList.newBuilder().build())
                 .build();
         UrlList response = networkSecurityClient.createUrlListAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • createUrlListOperationCallable

      public final OperationCallable<CreateUrlListRequest,UrlList,OperationMetadata> createUrlListOperationCallable()
      Creates a new UrlList in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         CreateUrlListRequest request =
             CreateUrlListRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setUrlListId("urlListId-564417368")
                 .setUrlList(UrlList.newBuilder().build())
                 .build();
         OperationFuture<UrlList, OperationMetadata> future =
             networkSecurityClient.createUrlListOperationCallable().futureCall(request);
         // Do something.
         UrlList response = future.get();
       }
       
    • createUrlListCallable

      public final UnaryCallable<CreateUrlListRequest,Operation> createUrlListCallable()
      Creates a new UrlList in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         CreateUrlListRequest request =
             CreateUrlListRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setUrlListId("urlListId-564417368")
                 .setUrlList(UrlList.newBuilder().build())
                 .build();
         ApiFuture<Operation> future =
             networkSecurityClient.createUrlListCallable().futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • updateUrlListAsync

      public final OperationFuture<UrlList,OperationMetadata> updateUrlListAsync(UrlList urlList, com.google.protobuf.FieldMask updateMask)
      Updates the parameters of a single UrlList.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         UrlList urlList = UrlList.newBuilder().build();
         FieldMask updateMask = FieldMask.newBuilder().build();
         UrlList response = networkSecurityClient.updateUrlListAsync(urlList, updateMask).get();
       }
       
      Parameters:
      urlList - Required. Updated UrlList resource.
      updateMask - Optional. Field mask is used to specify the fields to be overwritten in the UrlList resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten.
      Throws:
      ApiException - if the remote call fails
    • updateUrlListAsync

      public final OperationFuture<UrlList,OperationMetadata> updateUrlListAsync(UpdateUrlListRequest request)
      Updates the parameters of a single UrlList.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         UpdateUrlListRequest request =
             UpdateUrlListRequest.newBuilder()
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .setUrlList(UrlList.newBuilder().build())
                 .build();
         UrlList response = networkSecurityClient.updateUrlListAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • updateUrlListOperationCallable

      public final OperationCallable<UpdateUrlListRequest,UrlList,OperationMetadata> updateUrlListOperationCallable()
      Updates the parameters of a single UrlList.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         UpdateUrlListRequest request =
             UpdateUrlListRequest.newBuilder()
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .setUrlList(UrlList.newBuilder().build())
                 .build();
         OperationFuture<UrlList, OperationMetadata> future =
             networkSecurityClient.updateUrlListOperationCallable().futureCall(request);
         // Do something.
         UrlList response = future.get();
       }
       
    • updateUrlListCallable

      public final UnaryCallable<UpdateUrlListRequest,Operation> updateUrlListCallable()
      Updates the parameters of a single UrlList.

      Sample code:

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

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteUrlListAsync(UrlListName name)
      Deletes a single UrlList.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         UrlListName name = UrlListName.of("[PROJECT]", "[LOCATION]", "[URL_LIST]");
         networkSecurityClient.deleteUrlListAsync(name).get();
       }
       
      Parameters:
      name - Required. A name of the UrlList to delete. Must be in the format `projects/*/locations/{location}/urlLists/*`.
      Throws:
      ApiException - if the remote call fails
    • deleteUrlListAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteUrlListAsync(String name)
      Deletes a single UrlList.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         String name = UrlListName.of("[PROJECT]", "[LOCATION]", "[URL_LIST]").toString();
         networkSecurityClient.deleteUrlListAsync(name).get();
       }
       
      Parameters:
      name - Required. A name of the UrlList to delete. Must be in the format `projects/*/locations/{location}/urlLists/*`.
      Throws:
      ApiException - if the remote call fails
    • deleteUrlListAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteUrlListAsync(DeleteUrlListRequest request)
      Deletes a single UrlList.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         DeleteUrlListRequest request =
             DeleteUrlListRequest.newBuilder()
                 .setName(UrlListName.of("[PROJECT]", "[LOCATION]", "[URL_LIST]").toString())
                 .build();
         networkSecurityClient.deleteUrlListAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • deleteUrlListOperationCallable

      public final OperationCallable<DeleteUrlListRequest,com.google.protobuf.Empty,OperationMetadata> deleteUrlListOperationCallable()
      Deletes a single UrlList.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         DeleteUrlListRequest request =
             DeleteUrlListRequest.newBuilder()
                 .setName(UrlListName.of("[PROJECT]", "[LOCATION]", "[URL_LIST]").toString())
                 .build();
         OperationFuture<Empty, OperationMetadata> future =
             networkSecurityClient.deleteUrlListOperationCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • deleteUrlListCallable

      public final UnaryCallable<DeleteUrlListRequest,Operation> deleteUrlListCallable()
      Deletes a single UrlList.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         DeleteUrlListRequest request =
             DeleteUrlListRequest.newBuilder()
                 .setName(UrlListName.of("[PROJECT]", "[LOCATION]", "[URL_LIST]").toString())
                 .build();
         ApiFuture<Operation> future =
             networkSecurityClient.deleteUrlListCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • listTlsInspectionPolicies

      public final NetworkSecurityClient.ListTlsInspectionPoliciesPagedResponse listTlsInspectionPolicies(LocationName parent)
      Lists TlsInspectionPolicies in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         for (TlsInspectionPolicy element :
             networkSecurityClient.listTlsInspectionPolicies(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. The project and location from which the TlsInspectionPolicies should be listed, specified in the format `projects/{project}/locations/{location}`.
      Throws:
      ApiException - if the remote call fails
    • listTlsInspectionPolicies

      public final NetworkSecurityClient.ListTlsInspectionPoliciesPagedResponse listTlsInspectionPolicies(String parent)
      Lists TlsInspectionPolicies in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         for (TlsInspectionPolicy element :
             networkSecurityClient.listTlsInspectionPolicies(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. The project and location from which the TlsInspectionPolicies should be listed, specified in the format `projects/{project}/locations/{location}`.
      Throws:
      ApiException - if the remote call fails
    • listTlsInspectionPolicies

      Lists TlsInspectionPolicies in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         ListTlsInspectionPoliciesRequest request =
             ListTlsInspectionPoliciesRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         for (TlsInspectionPolicy element :
             networkSecurityClient.listTlsInspectionPolicies(request).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • listTlsInspectionPoliciesPagedCallable

      Lists TlsInspectionPolicies in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         ListTlsInspectionPoliciesRequest request =
             ListTlsInspectionPoliciesRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         ApiFuture<TlsInspectionPolicy> future =
             networkSecurityClient.listTlsInspectionPoliciesPagedCallable().futureCall(request);
         // Do something.
         for (TlsInspectionPolicy element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • listTlsInspectionPoliciesCallable

      public final UnaryCallable<ListTlsInspectionPoliciesRequest,ListTlsInspectionPoliciesResponse> listTlsInspectionPoliciesCallable()
      Lists TlsInspectionPolicies in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         ListTlsInspectionPoliciesRequest request =
             ListTlsInspectionPoliciesRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         while (true) {
           ListTlsInspectionPoliciesResponse response =
               networkSecurityClient.listTlsInspectionPoliciesCallable().call(request);
           for (TlsInspectionPolicy element : response.getTlsInspectionPoliciesList()) {
             // doThingsWith(element);
           }
           String nextPageToken = response.getNextPageToken();
           if (!Strings.isNullOrEmpty(nextPageToken)) {
             request = request.toBuilder().setPageToken(nextPageToken).build();
           } else {
             break;
           }
         }
       }
       
    • getTlsInspectionPolicy

      public final TlsInspectionPolicy getTlsInspectionPolicy(TlsInspectionPolicyName name)
      Gets details of a single TlsInspectionPolicy.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         TlsInspectionPolicyName name =
             TlsInspectionPolicyName.of("[PROJECT]", "[LOCATION]", "[TLS_INSPECTION_POLICY]");
         TlsInspectionPolicy response = networkSecurityClient.getTlsInspectionPolicy(name);
       }
       
      Parameters:
      name - Required. A name of the TlsInspectionPolicy to get. Must be in the format `projects/{project}/locations/{location}/tlsInspectionPolicies/{tls_inspection_policy}`.
      Throws:
      ApiException - if the remote call fails
    • getTlsInspectionPolicy

      public final TlsInspectionPolicy getTlsInspectionPolicy(String name)
      Gets details of a single TlsInspectionPolicy.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         String name =
             TlsInspectionPolicyName.of("[PROJECT]", "[LOCATION]", "[TLS_INSPECTION_POLICY]")
                 .toString();
         TlsInspectionPolicy response = networkSecurityClient.getTlsInspectionPolicy(name);
       }
       
      Parameters:
      name - Required. A name of the TlsInspectionPolicy to get. Must be in the format `projects/{project}/locations/{location}/tlsInspectionPolicies/{tls_inspection_policy}`.
      Throws:
      ApiException - if the remote call fails
    • getTlsInspectionPolicy

      public final TlsInspectionPolicy getTlsInspectionPolicy(GetTlsInspectionPolicyRequest request)
      Gets details of a single TlsInspectionPolicy.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         GetTlsInspectionPolicyRequest request =
             GetTlsInspectionPolicyRequest.newBuilder()
                 .setName(
                     TlsInspectionPolicyName.of("[PROJECT]", "[LOCATION]", "[TLS_INSPECTION_POLICY]")
                         .toString())
                 .build();
         TlsInspectionPolicy response = networkSecurityClient.getTlsInspectionPolicy(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • getTlsInspectionPolicyCallable

      public final UnaryCallable<GetTlsInspectionPolicyRequest,TlsInspectionPolicy> getTlsInspectionPolicyCallable()
      Gets details of a single TlsInspectionPolicy.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         GetTlsInspectionPolicyRequest request =
             GetTlsInspectionPolicyRequest.newBuilder()
                 .setName(
                     TlsInspectionPolicyName.of("[PROJECT]", "[LOCATION]", "[TLS_INSPECTION_POLICY]")
                         .toString())
                 .build();
         ApiFuture<TlsInspectionPolicy> future =
             networkSecurityClient.getTlsInspectionPolicyCallable().futureCall(request);
         // Do something.
         TlsInspectionPolicy response = future.get();
       }
       
    • createTlsInspectionPolicyAsync

      public final OperationFuture<TlsInspectionPolicy,OperationMetadata> createTlsInspectionPolicyAsync(LocationName parent, TlsInspectionPolicy tlsInspectionPolicy, String tlsInspectionPolicyId)
      Creates a new TlsInspectionPolicy in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         TlsInspectionPolicy tlsInspectionPolicy = TlsInspectionPolicy.newBuilder().build();
         String tlsInspectionPolicyId = "tlsInspectionPolicyId-647545892";
         TlsInspectionPolicy response =
             networkSecurityClient
                 .createTlsInspectionPolicyAsync(parent, tlsInspectionPolicy, tlsInspectionPolicyId)
                 .get();
       }
       
      Parameters:
      parent - Required. The parent resource of the TlsInspectionPolicy. Must be in the format `projects/{project}/locations/{location}`.
      tlsInspectionPolicy - Required. TlsInspectionPolicy resource to be created.
      tlsInspectionPolicyId - Required. Short name of the TlsInspectionPolicy resource to be created. This value should be 1-63 characters long, containing only letters, numbers, hyphens, and underscores, and should not start with a number. E.g. "tls_inspection_policy1".
      Throws:
      ApiException - if the remote call fails
    • createTlsInspectionPolicyAsync

      public final OperationFuture<TlsInspectionPolicy,OperationMetadata> createTlsInspectionPolicyAsync(String parent, TlsInspectionPolicy tlsInspectionPolicy, String tlsInspectionPolicyId)
      Creates a new TlsInspectionPolicy in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         TlsInspectionPolicy tlsInspectionPolicy = TlsInspectionPolicy.newBuilder().build();
         String tlsInspectionPolicyId = "tlsInspectionPolicyId-647545892";
         TlsInspectionPolicy response =
             networkSecurityClient
                 .createTlsInspectionPolicyAsync(parent, tlsInspectionPolicy, tlsInspectionPolicyId)
                 .get();
       }
       
      Parameters:
      parent - Required. The parent resource of the TlsInspectionPolicy. Must be in the format `projects/{project}/locations/{location}`.
      tlsInspectionPolicy - Required. TlsInspectionPolicy resource to be created.
      tlsInspectionPolicyId - Required. Short name of the TlsInspectionPolicy resource to be created. This value should be 1-63 characters long, containing only letters, numbers, hyphens, and underscores, and should not start with a number. E.g. "tls_inspection_policy1".
      Throws:
      ApiException - if the remote call fails
    • createTlsInspectionPolicyAsync

      public final OperationFuture<TlsInspectionPolicy,OperationMetadata> createTlsInspectionPolicyAsync(CreateTlsInspectionPolicyRequest request)
      Creates a new TlsInspectionPolicy in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         CreateTlsInspectionPolicyRequest request =
             CreateTlsInspectionPolicyRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setTlsInspectionPolicyId("tlsInspectionPolicyId-647545892")
                 .setTlsInspectionPolicy(TlsInspectionPolicy.newBuilder().build())
                 .build();
         TlsInspectionPolicy response =
             networkSecurityClient.createTlsInspectionPolicyAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • createTlsInspectionPolicyOperationCallable

      public final OperationCallable<CreateTlsInspectionPolicyRequest,TlsInspectionPolicy,OperationMetadata> createTlsInspectionPolicyOperationCallable()
      Creates a new TlsInspectionPolicy in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         CreateTlsInspectionPolicyRequest request =
             CreateTlsInspectionPolicyRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setTlsInspectionPolicyId("tlsInspectionPolicyId-647545892")
                 .setTlsInspectionPolicy(TlsInspectionPolicy.newBuilder().build())
                 .build();
         OperationFuture<TlsInspectionPolicy, OperationMetadata> future =
             networkSecurityClient.createTlsInspectionPolicyOperationCallable().futureCall(request);
         // Do something.
         TlsInspectionPolicy response = future.get();
       }
       
    • createTlsInspectionPolicyCallable

      public final UnaryCallable<CreateTlsInspectionPolicyRequest,Operation> createTlsInspectionPolicyCallable()
      Creates a new TlsInspectionPolicy in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         CreateTlsInspectionPolicyRequest request =
             CreateTlsInspectionPolicyRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setTlsInspectionPolicyId("tlsInspectionPolicyId-647545892")
                 .setTlsInspectionPolicy(TlsInspectionPolicy.newBuilder().build())
                 .build();
         ApiFuture<Operation> future =
             networkSecurityClient.createTlsInspectionPolicyCallable().futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • updateTlsInspectionPolicyAsync

      public final OperationFuture<TlsInspectionPolicy,OperationMetadata> updateTlsInspectionPolicyAsync(TlsInspectionPolicy tlsInspectionPolicy, com.google.protobuf.FieldMask updateMask)
      Updates the parameters of a single TlsInspectionPolicy.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         TlsInspectionPolicy tlsInspectionPolicy = TlsInspectionPolicy.newBuilder().build();
         FieldMask updateMask = FieldMask.newBuilder().build();
         TlsInspectionPolicy response =
             networkSecurityClient
                 .updateTlsInspectionPolicyAsync(tlsInspectionPolicy, updateMask)
                 .get();
       }
       
      Parameters:
      tlsInspectionPolicy - Required. Updated TlsInspectionPolicy resource.
      updateMask - Optional. Field mask is used to specify the fields to be overwritten in the TlsInspectionPolicy resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten.
      Throws:
      ApiException - if the remote call fails
    • updateTlsInspectionPolicyAsync

      public final OperationFuture<TlsInspectionPolicy,OperationMetadata> updateTlsInspectionPolicyAsync(UpdateTlsInspectionPolicyRequest request)
      Updates the parameters of a single TlsInspectionPolicy.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         UpdateTlsInspectionPolicyRequest request =
             UpdateTlsInspectionPolicyRequest.newBuilder()
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .setTlsInspectionPolicy(TlsInspectionPolicy.newBuilder().build())
                 .build();
         TlsInspectionPolicy response =
             networkSecurityClient.updateTlsInspectionPolicyAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • updateTlsInspectionPolicyOperationCallable

      public final OperationCallable<UpdateTlsInspectionPolicyRequest,TlsInspectionPolicy,OperationMetadata> updateTlsInspectionPolicyOperationCallable()
      Updates the parameters of a single TlsInspectionPolicy.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         UpdateTlsInspectionPolicyRequest request =
             UpdateTlsInspectionPolicyRequest.newBuilder()
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .setTlsInspectionPolicy(TlsInspectionPolicy.newBuilder().build())
                 .build();
         OperationFuture<TlsInspectionPolicy, OperationMetadata> future =
             networkSecurityClient.updateTlsInspectionPolicyOperationCallable().futureCall(request);
         // Do something.
         TlsInspectionPolicy response = future.get();
       }
       
    • updateTlsInspectionPolicyCallable

      public final UnaryCallable<UpdateTlsInspectionPolicyRequest,Operation> updateTlsInspectionPolicyCallable()
      Updates the parameters of a single TlsInspectionPolicy.

      Sample code:

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

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteTlsInspectionPolicyAsync(TlsInspectionPolicyName name)
      Deletes a single TlsInspectionPolicy.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         TlsInspectionPolicyName name =
             TlsInspectionPolicyName.of("[PROJECT]", "[LOCATION]", "[TLS_INSPECTION_POLICY]");
         networkSecurityClient.deleteTlsInspectionPolicyAsync(name).get();
       }
       
      Parameters:
      name - Required. A name of the TlsInspectionPolicy to delete. Must be in the format `projects/{project}/locations/{location}/tlsInspectionPolicies/{tls_inspection_policy}`.
      Throws:
      ApiException - if the remote call fails
    • deleteTlsInspectionPolicyAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteTlsInspectionPolicyAsync(String name)
      Deletes a single TlsInspectionPolicy.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         String name =
             TlsInspectionPolicyName.of("[PROJECT]", "[LOCATION]", "[TLS_INSPECTION_POLICY]")
                 .toString();
         networkSecurityClient.deleteTlsInspectionPolicyAsync(name).get();
       }
       
      Parameters:
      name - Required. A name of the TlsInspectionPolicy to delete. Must be in the format `projects/{project}/locations/{location}/tlsInspectionPolicies/{tls_inspection_policy}`.
      Throws:
      ApiException - if the remote call fails
    • deleteTlsInspectionPolicyAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteTlsInspectionPolicyAsync(DeleteTlsInspectionPolicyRequest request)
      Deletes a single TlsInspectionPolicy.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         DeleteTlsInspectionPolicyRequest request =
             DeleteTlsInspectionPolicyRequest.newBuilder()
                 .setName(
                     TlsInspectionPolicyName.of("[PROJECT]", "[LOCATION]", "[TLS_INSPECTION_POLICY]")
                         .toString())
                 .setForce(true)
                 .build();
         networkSecurityClient.deleteTlsInspectionPolicyAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • deleteTlsInspectionPolicyOperationCallable

      public final OperationCallable<DeleteTlsInspectionPolicyRequest,com.google.protobuf.Empty,OperationMetadata> deleteTlsInspectionPolicyOperationCallable()
      Deletes a single TlsInspectionPolicy.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         DeleteTlsInspectionPolicyRequest request =
             DeleteTlsInspectionPolicyRequest.newBuilder()
                 .setName(
                     TlsInspectionPolicyName.of("[PROJECT]", "[LOCATION]", "[TLS_INSPECTION_POLICY]")
                         .toString())
                 .setForce(true)
                 .build();
         OperationFuture<Empty, OperationMetadata> future =
             networkSecurityClient.deleteTlsInspectionPolicyOperationCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • deleteTlsInspectionPolicyCallable

      public final UnaryCallable<DeleteTlsInspectionPolicyRequest,Operation> deleteTlsInspectionPolicyCallable()
      Deletes a single TlsInspectionPolicy.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         DeleteTlsInspectionPolicyRequest request =
             DeleteTlsInspectionPolicyRequest.newBuilder()
                 .setName(
                     TlsInspectionPolicyName.of("[PROJECT]", "[LOCATION]", "[TLS_INSPECTION_POLICY]")
                         .toString())
                 .setForce(true)
                 .build();
         ApiFuture<Operation> future =
             networkSecurityClient.deleteTlsInspectionPolicyCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • listAuthzPolicies

      public final NetworkSecurityClient.ListAuthzPoliciesPagedResponse listAuthzPolicies(LocationName parent)
      Lists AuthzPolicies in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         for (AuthzPolicy element : networkSecurityClient.listAuthzPolicies(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. The project and location from which the `AuthzPolicy` resources are listed, specified in the following format: `projects/{project}/locations/{location}`.
      Throws:
      ApiException - if the remote call fails
    • listAuthzPolicies

      public final NetworkSecurityClient.ListAuthzPoliciesPagedResponse listAuthzPolicies(String parent)
      Lists AuthzPolicies in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         for (AuthzPolicy element : networkSecurityClient.listAuthzPolicies(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. The project and location from which the `AuthzPolicy` resources are listed, specified in the following format: `projects/{project}/locations/{location}`.
      Throws:
      ApiException - if the remote call fails
    • listAuthzPolicies

      Lists AuthzPolicies in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         ListAuthzPoliciesRequest request =
             ListAuthzPoliciesRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         for (AuthzPolicy element : networkSecurityClient.listAuthzPolicies(request).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • listAuthzPoliciesPagedCallable

      Lists AuthzPolicies in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         ListAuthzPoliciesRequest request =
             ListAuthzPoliciesRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         ApiFuture<AuthzPolicy> future =
             networkSecurityClient.listAuthzPoliciesPagedCallable().futureCall(request);
         // Do something.
         for (AuthzPolicy element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • listAuthzPoliciesCallable

      public final UnaryCallable<ListAuthzPoliciesRequest,ListAuthzPoliciesResponse> listAuthzPoliciesCallable()
      Lists AuthzPolicies in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         ListAuthzPoliciesRequest request =
             ListAuthzPoliciesRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         while (true) {
           ListAuthzPoliciesResponse response =
               networkSecurityClient.listAuthzPoliciesCallable().call(request);
           for (AuthzPolicy element : response.getAuthzPoliciesList()) {
             // doThingsWith(element);
           }
           String nextPageToken = response.getNextPageToken();
           if (!Strings.isNullOrEmpty(nextPageToken)) {
             request = request.toBuilder().setPageToken(nextPageToken).build();
           } else {
             break;
           }
         }
       }
       
    • getAuthzPolicy

      public final AuthzPolicy getAuthzPolicy(AuthzPolicyName name)
      Gets details of a single AuthzPolicy.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         AuthzPolicyName name = AuthzPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHZ_POLICY]");
         AuthzPolicy response = networkSecurityClient.getAuthzPolicy(name);
       }
       
      Parameters:
      name - Required. A name of the `AuthzPolicy` resource to get. Must be in the format `projects/{project}/locations/{location}/authzPolicies/{authz_policy}`.
      Throws:
      ApiException - if the remote call fails
    • getAuthzPolicy

      public final AuthzPolicy getAuthzPolicy(String name)
      Gets details of a single AuthzPolicy.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         String name = AuthzPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHZ_POLICY]").toString();
         AuthzPolicy response = networkSecurityClient.getAuthzPolicy(name);
       }
       
      Parameters:
      name - Required. A name of the `AuthzPolicy` resource to get. Must be in the format `projects/{project}/locations/{location}/authzPolicies/{authz_policy}`.
      Throws:
      ApiException - if the remote call fails
    • getAuthzPolicy

      public final AuthzPolicy getAuthzPolicy(GetAuthzPolicyRequest request)
      Gets details of a single AuthzPolicy.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         GetAuthzPolicyRequest request =
             GetAuthzPolicyRequest.newBuilder()
                 .setName(AuthzPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHZ_POLICY]").toString())
                 .build();
         AuthzPolicy response = networkSecurityClient.getAuthzPolicy(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • getAuthzPolicyCallable

      public final UnaryCallable<GetAuthzPolicyRequest,AuthzPolicy> getAuthzPolicyCallable()
      Gets details of a single AuthzPolicy.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         GetAuthzPolicyRequest request =
             GetAuthzPolicyRequest.newBuilder()
                 .setName(AuthzPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHZ_POLICY]").toString())
                 .build();
         ApiFuture<AuthzPolicy> future =
             networkSecurityClient.getAuthzPolicyCallable().futureCall(request);
         // Do something.
         AuthzPolicy response = future.get();
       }
       
    • createAuthzPolicyAsync

      public final OperationFuture<AuthzPolicy,OperationMetadata> createAuthzPolicyAsync(LocationName parent, AuthzPolicy authzPolicy, String authzPolicyId)
      Creates a new AuthzPolicy in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         AuthzPolicy authzPolicy = AuthzPolicy.newBuilder().build();
         String authzPolicyId = "authzPolicyId1717400543";
         AuthzPolicy response =
             networkSecurityClient.createAuthzPolicyAsync(parent, authzPolicy, authzPolicyId).get();
       }
       
      Parameters:
      parent - Required. The parent resource of the `AuthzPolicy` resource. Must be in the format `projects/{project}/locations/{location}`.
      authzPolicy - Required. `AuthzPolicy` resource to be created.
      authzPolicyId - Required. User-provided ID of the `AuthzPolicy` resource to be created.
      Throws:
      ApiException - if the remote call fails
    • createAuthzPolicyAsync

      public final OperationFuture<AuthzPolicy,OperationMetadata> createAuthzPolicyAsync(String parent, AuthzPolicy authzPolicy, String authzPolicyId)
      Creates a new AuthzPolicy in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         AuthzPolicy authzPolicy = AuthzPolicy.newBuilder().build();
         String authzPolicyId = "authzPolicyId1717400543";
         AuthzPolicy response =
             networkSecurityClient.createAuthzPolicyAsync(parent, authzPolicy, authzPolicyId).get();
       }
       
      Parameters:
      parent - Required. The parent resource of the `AuthzPolicy` resource. Must be in the format `projects/{project}/locations/{location}`.
      authzPolicy - Required. `AuthzPolicy` resource to be created.
      authzPolicyId - Required. User-provided ID of the `AuthzPolicy` resource to be created.
      Throws:
      ApiException - if the remote call fails
    • createAuthzPolicyAsync

      public final OperationFuture<AuthzPolicy,OperationMetadata> createAuthzPolicyAsync(CreateAuthzPolicyRequest request)
      Creates a new AuthzPolicy in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         CreateAuthzPolicyRequest request =
             CreateAuthzPolicyRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setAuthzPolicyId("authzPolicyId1717400543")
                 .setAuthzPolicy(AuthzPolicy.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         AuthzPolicy response = networkSecurityClient.createAuthzPolicyAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • createAuthzPolicyOperationCallable

      public final OperationCallable<CreateAuthzPolicyRequest,AuthzPolicy,OperationMetadata> createAuthzPolicyOperationCallable()
      Creates a new AuthzPolicy in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         CreateAuthzPolicyRequest request =
             CreateAuthzPolicyRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setAuthzPolicyId("authzPolicyId1717400543")
                 .setAuthzPolicy(AuthzPolicy.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         OperationFuture<AuthzPolicy, OperationMetadata> future =
             networkSecurityClient.createAuthzPolicyOperationCallable().futureCall(request);
         // Do something.
         AuthzPolicy response = future.get();
       }
       
    • createAuthzPolicyCallable

      public final UnaryCallable<CreateAuthzPolicyRequest,Operation> createAuthzPolicyCallable()
      Creates a new AuthzPolicy in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         CreateAuthzPolicyRequest request =
             CreateAuthzPolicyRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setAuthzPolicyId("authzPolicyId1717400543")
                 .setAuthzPolicy(AuthzPolicy.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         ApiFuture<Operation> future =
             networkSecurityClient.createAuthzPolicyCallable().futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • updateAuthzPolicyAsync

      public final OperationFuture<AuthzPolicy,OperationMetadata> updateAuthzPolicyAsync(AuthzPolicy authzPolicy, com.google.protobuf.FieldMask updateMask)
      Updates the parameters of a single AuthzPolicy.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         AuthzPolicy authzPolicy = AuthzPolicy.newBuilder().build();
         FieldMask updateMask = FieldMask.newBuilder().build();
         AuthzPolicy response =
             networkSecurityClient.updateAuthzPolicyAsync(authzPolicy, updateMask).get();
       }
       
      Parameters:
      authzPolicy - Required. `AuthzPolicy` resource being updated.
      updateMask - Required. Used to specify the fields to be overwritten in the `AuthzPolicy` resource by the update. The fields specified in the `update_mask` are relative to the resource, not the full request. A field is overwritten if it is in the mask. If the user does not specify a mask, then all fields are overwritten.
      Throws:
      ApiException - if the remote call fails
    • updateAuthzPolicyAsync

      public final OperationFuture<AuthzPolicy,OperationMetadata> updateAuthzPolicyAsync(UpdateAuthzPolicyRequest request)
      Updates the parameters of a single AuthzPolicy.

      Sample code:

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

      public final OperationCallable<UpdateAuthzPolicyRequest,AuthzPolicy,OperationMetadata> updateAuthzPolicyOperationCallable()
      Updates the parameters of a single AuthzPolicy.

      Sample code:

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

      public final UnaryCallable<UpdateAuthzPolicyRequest,Operation> updateAuthzPolicyCallable()
      Updates the parameters of a single AuthzPolicy.

      Sample code:

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

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteAuthzPolicyAsync(AuthzPolicyName name)
      Deletes a single AuthzPolicy.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         AuthzPolicyName name = AuthzPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHZ_POLICY]");
         networkSecurityClient.deleteAuthzPolicyAsync(name).get();
       }
       
      Parameters:
      name - Required. The name of the `AuthzPolicy` resource to delete. Must be in the format `projects/{project}/locations/{location}/authzPolicies/{authz_policy}`.
      Throws:
      ApiException - if the remote call fails
    • deleteAuthzPolicyAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteAuthzPolicyAsync(String name)
      Deletes a single AuthzPolicy.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         String name = AuthzPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHZ_POLICY]").toString();
         networkSecurityClient.deleteAuthzPolicyAsync(name).get();
       }
       
      Parameters:
      name - Required. The name of the `AuthzPolicy` resource to delete. Must be in the format `projects/{project}/locations/{location}/authzPolicies/{authz_policy}`.
      Throws:
      ApiException - if the remote call fails
    • deleteAuthzPolicyAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteAuthzPolicyAsync(DeleteAuthzPolicyRequest request)
      Deletes a single AuthzPolicy.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         DeleteAuthzPolicyRequest request =
             DeleteAuthzPolicyRequest.newBuilder()
                 .setName(AuthzPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHZ_POLICY]").toString())
                 .setRequestId("requestId693933066")
                 .build();
         networkSecurityClient.deleteAuthzPolicyAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • deleteAuthzPolicyOperationCallable

      public final OperationCallable<DeleteAuthzPolicyRequest,com.google.protobuf.Empty,OperationMetadata> deleteAuthzPolicyOperationCallable()
      Deletes a single AuthzPolicy.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         DeleteAuthzPolicyRequest request =
             DeleteAuthzPolicyRequest.newBuilder()
                 .setName(AuthzPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHZ_POLICY]").toString())
                 .setRequestId("requestId693933066")
                 .build();
         OperationFuture<Empty, OperationMetadata> future =
             networkSecurityClient.deleteAuthzPolicyOperationCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • deleteAuthzPolicyCallable

      public final UnaryCallable<DeleteAuthzPolicyRequest,Operation> deleteAuthzPolicyCallable()
      Deletes a single AuthzPolicy.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         DeleteAuthzPolicyRequest request =
             DeleteAuthzPolicyRequest.newBuilder()
                 .setName(AuthzPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHZ_POLICY]").toString())
                 .setRequestId("requestId693933066")
                 .build();
         ApiFuture<Operation> future =
             networkSecurityClient.deleteAuthzPolicyCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • listLocations

      Lists information about the supported locations for this service.

      This method lists locations based on the resource scope provided inthe [ListLocationsRequest.name] field:

      * **Global locations**: If `name` is empty, the method lists thepublic locations available to all projects. * **Project-specificlocations**: If `name` follows the format`projects/{project}`, the method lists locations visible to thatspecific project. This includes public, private, or otherproject-specific locations enabled for the project.

      For gRPC and client library implementations, the resource name ispassed as the `name` field. For direct service calls, the resourcename isincorporated into the request path based on the specific serviceimplementation and version.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         ListLocationsRequest request =
             ListLocationsRequest.newBuilder()
                 .setName("name3373707")
                 .setFilter("filter-1274492040")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         for (Location element : networkSecurityClient.listLocations(request).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • listLocationsPagedCallable

      Lists information about the supported locations for this service.

      This method lists locations based on the resource scope provided inthe [ListLocationsRequest.name] field:

      * **Global locations**: If `name` is empty, the method lists thepublic locations available to all projects. * **Project-specificlocations**: If `name` follows the format`projects/{project}`, the method lists locations visible to thatspecific project. This includes public, private, or otherproject-specific locations enabled for the project.

      For gRPC and client library implementations, the resource name ispassed as the `name` field. For direct service calls, the resourcename isincorporated into the request path based on the specific serviceimplementation and version.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         ListLocationsRequest request =
             ListLocationsRequest.newBuilder()
                 .setName("name3373707")
                 .setFilter("filter-1274492040")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         ApiFuture<Location> future =
             networkSecurityClient.listLocationsPagedCallable().futureCall(request);
         // Do something.
         for (Location element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • listLocationsCallable

      public final UnaryCallable<ListLocationsRequest,ListLocationsResponse> listLocationsCallable()
      Lists information about the supported locations for this service.

      This method lists locations based on the resource scope provided inthe [ListLocationsRequest.name] field:

      * **Global locations**: If `name` is empty, the method lists thepublic locations available to all projects. * **Project-specificlocations**: If `name` follows the format`projects/{project}`, the method lists locations visible to thatspecific project. This includes public, private, or otherproject-specific locations enabled for the project.

      For gRPC and client library implementations, the resource name ispassed as the `name` field. For direct service calls, the resourcename isincorporated into the request path based on the specific serviceimplementation and version.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         ListLocationsRequest request =
             ListLocationsRequest.newBuilder()
                 .setName("name3373707")
                 .setFilter("filter-1274492040")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         while (true) {
           ListLocationsResponse response =
               networkSecurityClient.listLocationsCallable().call(request);
           for (Location element : response.getLocationsList()) {
             // doThingsWith(element);
           }
           String nextPageToken = response.getNextPageToken();
           if (!Strings.isNullOrEmpty(nextPageToken)) {
             request = request.toBuilder().setPageToken(nextPageToken).build();
           } else {
             break;
           }
         }
       }
       
    • getLocation

      public final Location getLocation(GetLocationRequest request)
      Gets information about a location.

      Sample code:

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

      public final UnaryCallable<GetLocationRequest,Location> getLocationCallable()
      Gets information about a location.

      Sample code:

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

      public final Policy setIamPolicy(SetIamPolicyRequest request)
      Sets the access control policy on the specified resource. Replacesany existing policy.

      Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         SetIamPolicyRequest request =
             SetIamPolicyRequest.newBuilder()
                 .setResource(
                     AddressGroupName.ofProjectLocationAddressGroupName(
                             "[PROJECT]", "[LOCATION]", "[ADDRESS_GROUP]")
                         .toString())
                 .setPolicy(Policy.newBuilder().build())
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .build();
         Policy response = networkSecurityClient.setIamPolicy(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • setIamPolicyCallable

      public final UnaryCallable<SetIamPolicyRequest,Policy> setIamPolicyCallable()
      Sets the access control policy on the specified resource. Replacesany existing policy.

      Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         SetIamPolicyRequest request =
             SetIamPolicyRequest.newBuilder()
                 .setResource(
                     AddressGroupName.ofProjectLocationAddressGroupName(
                             "[PROJECT]", "[LOCATION]", "[ADDRESS_GROUP]")
                         .toString())
                 .setPolicy(Policy.newBuilder().build())
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .build();
         ApiFuture<Policy> future = networkSecurityClient.setIamPolicyCallable().futureCall(request);
         // Do something.
         Policy response = future.get();
       }
       
    • getIamPolicy

      public final Policy getIamPolicy(GetIamPolicyRequest request)
      Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         GetIamPolicyRequest request =
             GetIamPolicyRequest.newBuilder()
                 .setResource(
                     AddressGroupName.ofProjectLocationAddressGroupName(
                             "[PROJECT]", "[LOCATION]", "[ADDRESS_GROUP]")
                         .toString())
                 .setOptions(GetPolicyOptions.newBuilder().build())
                 .build();
         Policy response = networkSecurityClient.getIamPolicy(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • getIamPolicyCallable

      public final UnaryCallable<GetIamPolicyRequest,Policy> getIamPolicyCallable()
      Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         GetIamPolicyRequest request =
             GetIamPolicyRequest.newBuilder()
                 .setResource(
                     AddressGroupName.ofProjectLocationAddressGroupName(
                             "[PROJECT]", "[LOCATION]", "[ADDRESS_GROUP]")
                         .toString())
                 .setOptions(GetPolicyOptions.newBuilder().build())
                 .build();
         ApiFuture<Policy> future = networkSecurityClient.getIamPolicyCallable().futureCall(request);
         // Do something.
         Policy response = future.get();
       }
       
    • testIamPermissions

      public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request)
      Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a `NOT_FOUND` error.

      Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         TestIamPermissionsRequest request =
             TestIamPermissionsRequest.newBuilder()
                 .setResource(
                     AddressGroupName.ofProjectLocationAddressGroupName(
                             "[PROJECT]", "[LOCATION]", "[ADDRESS_GROUP]")
                         .toString())
                 .addAllPermissions(new ArrayList<String>())
                 .build();
         TestIamPermissionsResponse response = networkSecurityClient.testIamPermissions(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • testIamPermissionsCallable

      public final UnaryCallable<TestIamPermissionsRequest,TestIamPermissionsResponse> testIamPermissionsCallable()
      Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a `NOT_FOUND` error.

      Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
         TestIamPermissionsRequest request =
             TestIamPermissionsRequest.newBuilder()
                 .setResource(
                     AddressGroupName.ofProjectLocationAddressGroupName(
                             "[PROJECT]", "[LOCATION]", "[ADDRESS_GROUP]")
                         .toString())
                 .addAllPermissions(new ArrayList<String>())
                 .build();
         ApiFuture<TestIamPermissionsResponse> future =
             networkSecurityClient.testIamPermissionsCallable().futureCall(request);
         // Do something.
         TestIamPermissionsResponse response = future.get();
       }
       
    • close

      public final void close()
      Specified by:
      close in interface AutoCloseable
    • shutdown

      public void shutdown()
      Specified by:
      shutdown in interface BackgroundResource
    • isShutdown

      public boolean isShutdown()
      Specified by:
      isShutdown in interface BackgroundResource
    • isTerminated

      public boolean isTerminated()
      Specified by:
      isTerminated in interface BackgroundResource
    • shutdownNow

      public void shutdownNow()
      Specified by:
      shutdownNow in interface BackgroundResource
    • awaitTermination

      public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException
      Specified by:
      awaitTermination in interface BackgroundResource
      Throws:
      InterruptedException