Class NetworkSecurityClient (0.63.0)

GitHub RepositoryProduct Reference

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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){AuthorizationPolicyNamename=AuthorizationPolicyName.of("[PROJECT]","[LOCATION]","[AUTHORIZATION_POLICY]");AuthorizationPolicyresponse=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
MethodDescriptionMethod 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()

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()

ListLocations

Lists information about the supported locations for this service.

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_DENIEDerrors.

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

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

Inheritance

java.lang.Object > NetworkSecurityClient

Static Methods

create()

publicstaticfinalNetworkSecurityClientcreate()

Constructs an instance of NetworkSecurityClient with default settings.

Returns
TypeDescription
NetworkSecurityClient
Exceptions
TypeDescription
IOException

create(NetworkSecuritySettings settings)

publicstaticfinalNetworkSecurityClientcreate(NetworkSecuritySettingssettings)

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.

Parameter
NameDescription
settingsNetworkSecuritySettings
Returns
TypeDescription
NetworkSecurityClient
Exceptions
TypeDescription
IOException

create(NetworkSecurityStub stub)

publicstaticfinalNetworkSecurityClientcreate(NetworkSecurityStubstub)

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

Parameter
NameDescription
stubNetworkSecurityStub
Returns
TypeDescription
NetworkSecurityClient

Constructors

NetworkSecurityClient(NetworkSecuritySettings settings)

protectedNetworkSecurityClient(NetworkSecuritySettingssettings)

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.

Parameter
NameDescription
settingsNetworkSecuritySettings

NetworkSecurityClient(NetworkSecurityStub stub)

protectedNetworkSecurityClient(NetworkSecurityStubstub)
Parameter
NameDescription
stubNetworkSecurityStub

Methods

awaitTermination(long duration, TimeUnit unit)

publicbooleanawaitTermination(longduration,TimeUnitunit)
Parameters
NameDescription
durationlong
unitTimeUnit
Returns
TypeDescription
boolean
Exceptions
TypeDescription
InterruptedException

close()

publicfinalvoidclose()

createAuthorizationPolicyAsync(CreateAuthorizationPolicyRequest request)

publicfinalOperationFuture<AuthorizationPolicy,OperationMetadata>createAuthorizationPolicyAsync(CreateAuthorizationPolicyRequestrequest)

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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){CreateAuthorizationPolicyRequestrequest=CreateAuthorizationPolicyRequest.newBuilder().setParent(LocationName.of("[PROJECT]","[LOCATION]").toString()).setAuthorizationPolicyId("authorizationPolicyId1314252166").setAuthorizationPolicy(AuthorizationPolicy.newBuilder().build()).build();AuthorizationPolicyresponse=networkSecurityClient.createAuthorizationPolicyAsync(request).get();}
Parameter
NameDescription
requestCreateAuthorizationPolicyRequest

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

Returns
TypeDescription
OperationFuture<AuthorizationPolicy,OperationMetadata>

createAuthorizationPolicyAsync(LocationName parent, AuthorizationPolicy authorizationPolicy, String authorizationPolicyId)

publicfinalOperationFuture<AuthorizationPolicy,OperationMetadata>createAuthorizationPolicyAsync(LocationNameparent,AuthorizationPolicyauthorizationPolicy,StringauthorizationPolicyId)

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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){LocationNameparent=LocationName.of("[PROJECT]","[LOCATION]");AuthorizationPolicyauthorizationPolicy=AuthorizationPolicy.newBuilder().build();StringauthorizationPolicyId="authorizationPolicyId1314252166";AuthorizationPolicyresponse=networkSecurityClient.createAuthorizationPolicyAsync(parent,authorizationPolicy,authorizationPolicyId).get();}
Parameters
NameDescription
parentLocationName

Required. The parent resource of the AuthorizationPolicy. Must be in the format projects/{project}/locations/{location}.

authorizationPolicyAuthorizationPolicy

Required. AuthorizationPolicy resource to be created.

authorizationPolicyIdString

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".

Returns
TypeDescription
OperationFuture<AuthorizationPolicy,OperationMetadata>

createAuthorizationPolicyAsync(String parent, AuthorizationPolicy authorizationPolicy, String authorizationPolicyId)

publicfinalOperationFuture<AuthorizationPolicy,OperationMetadata>createAuthorizationPolicyAsync(Stringparent,AuthorizationPolicyauthorizationPolicy,StringauthorizationPolicyId)

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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){Stringparent=LocationName.of("[PROJECT]","[LOCATION]").toString();AuthorizationPolicyauthorizationPolicy=AuthorizationPolicy.newBuilder().build();StringauthorizationPolicyId="authorizationPolicyId1314252166";AuthorizationPolicyresponse=networkSecurityClient.createAuthorizationPolicyAsync(parent,authorizationPolicy,authorizationPolicyId).get();}
Parameters
NameDescription
parentString

Required. The parent resource of the AuthorizationPolicy. Must be in the format projects/{project}/locations/{location}.

authorizationPolicyAuthorizationPolicy

Required. AuthorizationPolicy resource to be created.

authorizationPolicyIdString

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".

Returns
TypeDescription
OperationFuture<AuthorizationPolicy,OperationMetadata>

createAuthorizationPolicyCallable()

publicfinalUnaryCallable<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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){CreateAuthorizationPolicyRequestrequest=CreateAuthorizationPolicyRequest.newBuilder().setParent(LocationName.of("[PROJECT]","[LOCATION]").toString()).setAuthorizationPolicyId("authorizationPolicyId1314252166").setAuthorizationPolicy(AuthorizationPolicy.newBuilder().build()).build();ApiFuture<Operation>future=networkSecurityClient.createAuthorizationPolicyCallable().futureCall(request);// Do something.Operationresponse=future.get();}
Returns
TypeDescription
UnaryCallable<CreateAuthorizationPolicyRequest,Operation>

createAuthorizationPolicyOperationCallable()

publicfinalOperationCallable<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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){CreateAuthorizationPolicyRequestrequest=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.AuthorizationPolicyresponse=future.get();}
Returns
TypeDescription
OperationCallable<CreateAuthorizationPolicyRequest,AuthorizationPolicy,OperationMetadata>

createClientTlsPolicyAsync(CreateClientTlsPolicyRequest request)

publicfinalOperationFuture<ClientTlsPolicy,OperationMetadata>createClientTlsPolicyAsync(CreateClientTlsPolicyRequestrequest)

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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){CreateClientTlsPolicyRequestrequest=CreateClientTlsPolicyRequest.newBuilder().setParent(LocationName.of("[PROJECT]","[LOCATION]").toString()).setClientTlsPolicyId("clientTlsPolicyId-188933315").setClientTlsPolicy(ClientTlsPolicy.newBuilder().build()).build();ClientTlsPolicyresponse=networkSecurityClient.createClientTlsPolicyAsync(request).get();}
Parameter
NameDescription
requestCreateClientTlsPolicyRequest

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

Returns
TypeDescription
OperationFuture<ClientTlsPolicy,OperationMetadata>

createClientTlsPolicyAsync(LocationName parent, ClientTlsPolicy clientTlsPolicy, String clientTlsPolicyId)

publicfinalOperationFuture<ClientTlsPolicy,OperationMetadata>createClientTlsPolicyAsync(LocationNameparent,ClientTlsPolicyclientTlsPolicy,StringclientTlsPolicyId)

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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){LocationNameparent=LocationName.of("[PROJECT]","[LOCATION]");ClientTlsPolicyclientTlsPolicy=ClientTlsPolicy.newBuilder().build();StringclientTlsPolicyId="clientTlsPolicyId-188933315";ClientTlsPolicyresponse=networkSecurityClient.createClientTlsPolicyAsync(parent,clientTlsPolicy,clientTlsPolicyId).get();}
Parameters
NameDescription
parentLocationName

Required. The parent resource of the ClientTlsPolicy. Must be in the format projects/*/locations/{location}.

clientTlsPolicyClientTlsPolicy

Required. ClientTlsPolicy resource to be created.

clientTlsPolicyIdString

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".

Returns
TypeDescription
OperationFuture<ClientTlsPolicy,OperationMetadata>

createClientTlsPolicyAsync(String parent, ClientTlsPolicy clientTlsPolicy, String clientTlsPolicyId)

publicfinalOperationFuture<ClientTlsPolicy,OperationMetadata>createClientTlsPolicyAsync(Stringparent,ClientTlsPolicyclientTlsPolicy,StringclientTlsPolicyId)

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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){Stringparent=LocationName.of("[PROJECT]","[LOCATION]").toString();ClientTlsPolicyclientTlsPolicy=ClientTlsPolicy.newBuilder().build();StringclientTlsPolicyId="clientTlsPolicyId-188933315";ClientTlsPolicyresponse=networkSecurityClient.createClientTlsPolicyAsync(parent,clientTlsPolicy,clientTlsPolicyId).get();}
Parameters
NameDescription
parentString

Required. The parent resource of the ClientTlsPolicy. Must be in the format projects/*/locations/{location}.

clientTlsPolicyClientTlsPolicy

Required. ClientTlsPolicy resource to be created.

clientTlsPolicyIdString

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".

Returns
TypeDescription
OperationFuture<ClientTlsPolicy,OperationMetadata>

createClientTlsPolicyCallable()

publicfinalUnaryCallable<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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){CreateClientTlsPolicyRequestrequest=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.Operationresponse=future.get();}
Returns
TypeDescription
UnaryCallable<CreateClientTlsPolicyRequest,Operation>

createClientTlsPolicyOperationCallable()

publicfinalOperationCallable<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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){CreateClientTlsPolicyRequestrequest=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.ClientTlsPolicyresponse=future.get();}
Returns
TypeDescription
OperationCallable<CreateClientTlsPolicyRequest,ClientTlsPolicy,OperationMetadata>

createServerTlsPolicyAsync(CreateServerTlsPolicyRequest request)

publicfinalOperationFuture<ServerTlsPolicy,OperationMetadata>createServerTlsPolicyAsync(CreateServerTlsPolicyRequestrequest)

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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){CreateServerTlsPolicyRequestrequest=CreateServerTlsPolicyRequest.newBuilder().setParent(LocationName.of("[PROJECT]","[LOCATION]").toString()).setServerTlsPolicyId("serverTlsPolicyId-1966046011").setServerTlsPolicy(ServerTlsPolicy.newBuilder().build()).build();ServerTlsPolicyresponse=networkSecurityClient.createServerTlsPolicyAsync(request).get();}
Parameter
NameDescription
requestCreateServerTlsPolicyRequest

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

Returns
TypeDescription
OperationFuture<ServerTlsPolicy,OperationMetadata>

createServerTlsPolicyAsync(LocationName parent, ServerTlsPolicy serverTlsPolicy, String serverTlsPolicyId)

publicfinalOperationFuture<ServerTlsPolicy,OperationMetadata>createServerTlsPolicyAsync(LocationNameparent,ServerTlsPolicyserverTlsPolicy,StringserverTlsPolicyId)

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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){LocationNameparent=LocationName.of("[PROJECT]","[LOCATION]");ServerTlsPolicyserverTlsPolicy=ServerTlsPolicy.newBuilder().build();StringserverTlsPolicyId="serverTlsPolicyId-1966046011";ServerTlsPolicyresponse=networkSecurityClient.createServerTlsPolicyAsync(parent,serverTlsPolicy,serverTlsPolicyId).get();}
Parameters
NameDescription
parentLocationName

Required. The parent resource of the ServerTlsPolicy. Must be in the format projects/*/locations/{location}.

serverTlsPolicyServerTlsPolicy

Required. ServerTlsPolicy resource to be created.

serverTlsPolicyIdString

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".

Returns
TypeDescription
OperationFuture<ServerTlsPolicy,OperationMetadata>

createServerTlsPolicyAsync(String parent, ServerTlsPolicy serverTlsPolicy, String serverTlsPolicyId)

publicfinalOperationFuture<ServerTlsPolicy,OperationMetadata>createServerTlsPolicyAsync(Stringparent,ServerTlsPolicyserverTlsPolicy,StringserverTlsPolicyId)

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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){Stringparent=LocationName.of("[PROJECT]","[LOCATION]").toString();ServerTlsPolicyserverTlsPolicy=ServerTlsPolicy.newBuilder().build();StringserverTlsPolicyId="serverTlsPolicyId-1966046011";ServerTlsPolicyresponse=networkSecurityClient.createServerTlsPolicyAsync(parent,serverTlsPolicy,serverTlsPolicyId).get();}
Parameters
NameDescription
parentString

Required. The parent resource of the ServerTlsPolicy. Must be in the format projects/*/locations/{location}.

serverTlsPolicyServerTlsPolicy

Required. ServerTlsPolicy resource to be created.

serverTlsPolicyIdString

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".

Returns
TypeDescription
OperationFuture<ServerTlsPolicy,OperationMetadata>

createServerTlsPolicyCallable()

publicfinalUnaryCallable<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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){CreateServerTlsPolicyRequestrequest=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.Operationresponse=future.get();}
Returns
TypeDescription
UnaryCallable<CreateServerTlsPolicyRequest,Operation>

createServerTlsPolicyOperationCallable()

publicfinalOperationCallable<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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){CreateServerTlsPolicyRequestrequest=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.ServerTlsPolicyresponse=future.get();}
Returns
TypeDescription
OperationCallable<CreateServerTlsPolicyRequest,ServerTlsPolicy,OperationMetadata>

deleteAuthorizationPolicyAsync(AuthorizationPolicyName name)

publicfinalOperationFuture<Empty,OperationMetadata>deleteAuthorizationPolicyAsync(AuthorizationPolicyNamename)

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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){AuthorizationPolicyNamename=AuthorizationPolicyName.of("[PROJECT]","[LOCATION]","[AUTHORIZATION_POLICY]");networkSecurityClient.deleteAuthorizationPolicyAsync(name).get();}
Parameter
NameDescription
nameAuthorizationPolicyName

Required. A name of the AuthorizationPolicy to delete. Must be in the format projects/{project}/locations/{location}/authorizationPolicies/*.

Returns
TypeDescription
OperationFuture<Empty,OperationMetadata>

deleteAuthorizationPolicyAsync(DeleteAuthorizationPolicyRequest request)

publicfinalOperationFuture<Empty,OperationMetadata>deleteAuthorizationPolicyAsync(DeleteAuthorizationPolicyRequestrequest)

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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){DeleteAuthorizationPolicyRequestrequest=DeleteAuthorizationPolicyRequest.newBuilder().setName(AuthorizationPolicyName.of("[PROJECT]","[LOCATION]","[AUTHORIZATION_POLICY]").toString()).build();networkSecurityClient.deleteAuthorizationPolicyAsync(request).get();}
Parameter
NameDescription
requestDeleteAuthorizationPolicyRequest

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

Returns
TypeDescription
OperationFuture<Empty,OperationMetadata>

deleteAuthorizationPolicyAsync(String name)

publicfinalOperationFuture<Empty,OperationMetadata>deleteAuthorizationPolicyAsync(Stringname)

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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){Stringname=AuthorizationPolicyName.of("[PROJECT]","[LOCATION]","[AUTHORIZATION_POLICY]").toString();networkSecurityClient.deleteAuthorizationPolicyAsync(name).get();}
Parameter
NameDescription
nameString

Required. A name of the AuthorizationPolicy to delete. Must be in the format projects/{project}/locations/{location}/authorizationPolicies/*.

Returns
TypeDescription
OperationFuture<Empty,OperationMetadata>

deleteAuthorizationPolicyCallable()

publicfinalUnaryCallable<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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){DeleteAuthorizationPolicyRequestrequest=DeleteAuthorizationPolicyRequest.newBuilder().setName(AuthorizationPolicyName.of("[PROJECT]","[LOCATION]","[AUTHORIZATION_POLICY]").toString()).build();ApiFuture<Operation>future=networkSecurityClient.deleteAuthorizationPolicyCallable().futureCall(request);// Do something.future.get();}
Returns
TypeDescription
UnaryCallable<DeleteAuthorizationPolicyRequest,Operation>

deleteAuthorizationPolicyOperationCallable()

publicfinalOperationCallable<DeleteAuthorizationPolicyRequest,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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){DeleteAuthorizationPolicyRequestrequest=DeleteAuthorizationPolicyRequest.newBuilder().setName(AuthorizationPolicyName.of("[PROJECT]","[LOCATION]","[AUTHORIZATION_POLICY]").toString()).build();OperationFuture<Empty,OperationMetadata>future=networkSecurityClient.deleteAuthorizationPolicyOperationCallable().futureCall(request);// Do something.future.get();}
Returns
TypeDescription
OperationCallable<DeleteAuthorizationPolicyRequest,Empty,OperationMetadata>

deleteClientTlsPolicyAsync(ClientTlsPolicyName name)

publicfinalOperationFuture<Empty,OperationMetadata>deleteClientTlsPolicyAsync(ClientTlsPolicyNamename)

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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){ClientTlsPolicyNamename=ClientTlsPolicyName.of("[PROJECT]","[LOCATION]","[CLIENT_TLS_POLICY]");networkSecurityClient.deleteClientTlsPolicyAsync(name).get();}
Parameter
NameDescription
nameClientTlsPolicyName

Required. A name of the ClientTlsPolicy to delete. Must be in the format projects/*/locations/{location}/clientTlsPolicies/*.

Returns
TypeDescription
OperationFuture<Empty,OperationMetadata>

deleteClientTlsPolicyAsync(DeleteClientTlsPolicyRequest request)

publicfinalOperationFuture<Empty,OperationMetadata>deleteClientTlsPolicyAsync(DeleteClientTlsPolicyRequestrequest)

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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){DeleteClientTlsPolicyRequestrequest=DeleteClientTlsPolicyRequest.newBuilder().setName(ClientTlsPolicyName.of("[PROJECT]","[LOCATION]","[CLIENT_TLS_POLICY]").toString()).build();networkSecurityClient.deleteClientTlsPolicyAsync(request).get();}
Parameter
NameDescription
requestDeleteClientTlsPolicyRequest

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

Returns
TypeDescription
OperationFuture<Empty,OperationMetadata>

deleteClientTlsPolicyAsync(String name)

publicfinalOperationFuture<Empty,OperationMetadata>deleteClientTlsPolicyAsync(Stringname)

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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){Stringname=ClientTlsPolicyName.of("[PROJECT]","[LOCATION]","[CLIENT_TLS_POLICY]").toString();networkSecurityClient.deleteClientTlsPolicyAsync(name).get();}
Parameter
NameDescription
nameString

Required. A name of the ClientTlsPolicy to delete. Must be in the format projects/*/locations/{location}/clientTlsPolicies/*.

Returns
TypeDescription
OperationFuture<Empty,OperationMetadata>

deleteClientTlsPolicyCallable()

publicfinalUnaryCallable<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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){DeleteClientTlsPolicyRequestrequest=DeleteClientTlsPolicyRequest.newBuilder().setName(ClientTlsPolicyName.of("[PROJECT]","[LOCATION]","[CLIENT_TLS_POLICY]").toString()).build();ApiFuture<Operation>future=networkSecurityClient.deleteClientTlsPolicyCallable().futureCall(request);// Do something.future.get();}
Returns
TypeDescription
UnaryCallable<DeleteClientTlsPolicyRequest,Operation>

deleteClientTlsPolicyOperationCallable()

publicfinalOperationCallable<DeleteClientTlsPolicyRequest,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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){DeleteClientTlsPolicyRequestrequest=DeleteClientTlsPolicyRequest.newBuilder().setName(ClientTlsPolicyName.of("[PROJECT]","[LOCATION]","[CLIENT_TLS_POLICY]").toString()).build();OperationFuture<Empty,OperationMetadata>future=networkSecurityClient.deleteClientTlsPolicyOperationCallable().futureCall(request);// Do something.future.get();}
Returns
TypeDescription
OperationCallable<DeleteClientTlsPolicyRequest,Empty,OperationMetadata>

deleteServerTlsPolicyAsync(DeleteServerTlsPolicyRequest request)

publicfinalOperationFuture<Empty,OperationMetadata>deleteServerTlsPolicyAsync(DeleteServerTlsPolicyRequestrequest)

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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){DeleteServerTlsPolicyRequestrequest=DeleteServerTlsPolicyRequest.newBuilder().setName(ServerTlsPolicyName.of("[PROJECT]","[LOCATION]","[SERVER_TLS_POLICY]").toString()).build();networkSecurityClient.deleteServerTlsPolicyAsync(request).get();}
Parameter
NameDescription
requestDeleteServerTlsPolicyRequest

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

Returns
TypeDescription
OperationFuture<Empty,OperationMetadata>

deleteServerTlsPolicyAsync(ServerTlsPolicyName name)

publicfinalOperationFuture<Empty,OperationMetadata>deleteServerTlsPolicyAsync(ServerTlsPolicyNamename)

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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){ServerTlsPolicyNamename=ServerTlsPolicyName.of("[PROJECT]","[LOCATION]","[SERVER_TLS_POLICY]");networkSecurityClient.deleteServerTlsPolicyAsync(name).get();}
Parameter
NameDescription
nameServerTlsPolicyName

Required. A name of the ServerTlsPolicy to delete. Must be in the format projects/*/locations/{location}/serverTlsPolicies/*.

Returns
TypeDescription
OperationFuture<Empty,OperationMetadata>

deleteServerTlsPolicyAsync(String name)

publicfinalOperationFuture<Empty,OperationMetadata>deleteServerTlsPolicyAsync(Stringname)

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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){Stringname=ServerTlsPolicyName.of("[PROJECT]","[LOCATION]","[SERVER_TLS_POLICY]").toString();networkSecurityClient.deleteServerTlsPolicyAsync(name).get();}
Parameter
NameDescription
nameString

Required. A name of the ServerTlsPolicy to delete. Must be in the format projects/*/locations/{location}/serverTlsPolicies/*.

Returns
TypeDescription
OperationFuture<Empty,OperationMetadata>

deleteServerTlsPolicyCallable()

publicfinalUnaryCallable<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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){DeleteServerTlsPolicyRequestrequest=DeleteServerTlsPolicyRequest.newBuilder().setName(ServerTlsPolicyName.of("[PROJECT]","[LOCATION]","[SERVER_TLS_POLICY]").toString()).build();ApiFuture<Operation>future=networkSecurityClient.deleteServerTlsPolicyCallable().futureCall(request);// Do something.future.get();}
Returns
TypeDescription
UnaryCallable<DeleteServerTlsPolicyRequest,Operation>

deleteServerTlsPolicyOperationCallable()

publicfinalOperationCallable<DeleteServerTlsPolicyRequest,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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){DeleteServerTlsPolicyRequestrequest=DeleteServerTlsPolicyRequest.newBuilder().setName(ServerTlsPolicyName.of("[PROJECT]","[LOCATION]","[SERVER_TLS_POLICY]").toString()).build();OperationFuture<Empty,OperationMetadata>future=networkSecurityClient.deleteServerTlsPolicyOperationCallable().futureCall(request);// Do something.future.get();}
Returns
TypeDescription
OperationCallable<DeleteServerTlsPolicyRequest,Empty,OperationMetadata>

getAuthorizationPolicy(AuthorizationPolicyName name)

publicfinalAuthorizationPolicygetAuthorizationPolicy(AuthorizationPolicyNamename)

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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){AuthorizationPolicyNamename=AuthorizationPolicyName.of("[PROJECT]","[LOCATION]","[AUTHORIZATION_POLICY]");AuthorizationPolicyresponse=networkSecurityClient.getAuthorizationPolicy(name);}
Parameter
NameDescription
nameAuthorizationPolicyName

Required. A name of the AuthorizationPolicy to get. Must be in the format projects/{project}/locations/{location}/authorizationPolicies/*.

Returns
TypeDescription
AuthorizationPolicy

getAuthorizationPolicy(GetAuthorizationPolicyRequest request)

publicfinalAuthorizationPolicygetAuthorizationPolicy(GetAuthorizationPolicyRequestrequest)

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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){GetAuthorizationPolicyRequestrequest=GetAuthorizationPolicyRequest.newBuilder().setName(AuthorizationPolicyName.of("[PROJECT]","[LOCATION]","[AUTHORIZATION_POLICY]").toString()).build();AuthorizationPolicyresponse=networkSecurityClient.getAuthorizationPolicy(request);}
Parameter
NameDescription
requestGetAuthorizationPolicyRequest

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

Returns
TypeDescription
AuthorizationPolicy

getAuthorizationPolicy(String name)

publicfinalAuthorizationPolicygetAuthorizationPolicy(Stringname)

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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){Stringname=AuthorizationPolicyName.of("[PROJECT]","[LOCATION]","[AUTHORIZATION_POLICY]").toString();AuthorizationPolicyresponse=networkSecurityClient.getAuthorizationPolicy(name);}
Parameter
NameDescription
nameString

Required. A name of the AuthorizationPolicy to get. Must be in the format projects/{project}/locations/{location}/authorizationPolicies/*.

Returns
TypeDescription
AuthorizationPolicy

getAuthorizationPolicyCallable()

publicfinalUnaryCallable<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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){GetAuthorizationPolicyRequestrequest=GetAuthorizationPolicyRequest.newBuilder().setName(AuthorizationPolicyName.of("[PROJECT]","[LOCATION]","[AUTHORIZATION_POLICY]").toString()).build();ApiFuture<AuthorizationPolicy>future=networkSecurityClient.getAuthorizationPolicyCallable().futureCall(request);// Do something.AuthorizationPolicyresponse=future.get();}
Returns
TypeDescription
UnaryCallable<GetAuthorizationPolicyRequest,AuthorizationPolicy>

getClientTlsPolicy(ClientTlsPolicyName name)

publicfinalClientTlsPolicygetClientTlsPolicy(ClientTlsPolicyNamename)

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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){ClientTlsPolicyNamename=ClientTlsPolicyName.of("[PROJECT]","[LOCATION]","[CLIENT_TLS_POLICY]");ClientTlsPolicyresponse=networkSecurityClient.getClientTlsPolicy(name);}
Parameter
NameDescription
nameClientTlsPolicyName

Required. A name of the ClientTlsPolicy to get. Must be in the format projects/*/locations/{location}/clientTlsPolicies/*.

Returns
TypeDescription
ClientTlsPolicy

getClientTlsPolicy(GetClientTlsPolicyRequest request)

publicfinalClientTlsPolicygetClientTlsPolicy(GetClientTlsPolicyRequestrequest)

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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){GetClientTlsPolicyRequestrequest=GetClientTlsPolicyRequest.newBuilder().setName(ClientTlsPolicyName.of("[PROJECT]","[LOCATION]","[CLIENT_TLS_POLICY]").toString()).build();ClientTlsPolicyresponse=networkSecurityClient.getClientTlsPolicy(request);}
Parameter
NameDescription
requestGetClientTlsPolicyRequest

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

Returns
TypeDescription
ClientTlsPolicy

getClientTlsPolicy(String name)

publicfinalClientTlsPolicygetClientTlsPolicy(Stringname)

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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){Stringname=ClientTlsPolicyName.of("[PROJECT]","[LOCATION]","[CLIENT_TLS_POLICY]").toString();ClientTlsPolicyresponse=networkSecurityClient.getClientTlsPolicy(name);}
Parameter
NameDescription
nameString

Required. A name of the ClientTlsPolicy to get. Must be in the format projects/*/locations/{location}/clientTlsPolicies/*.

Returns
TypeDescription
ClientTlsPolicy

getClientTlsPolicyCallable()

publicfinalUnaryCallable<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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){GetClientTlsPolicyRequestrequest=GetClientTlsPolicyRequest.newBuilder().setName(ClientTlsPolicyName.of("[PROJECT]","[LOCATION]","[CLIENT_TLS_POLICY]").toString()).build();ApiFuture<ClientTlsPolicy>future=networkSecurityClient.getClientTlsPolicyCallable().futureCall(request);// Do something.ClientTlsPolicyresponse=future.get();}
Returns
TypeDescription
UnaryCallable<GetClientTlsPolicyRequest,ClientTlsPolicy>

getIamPolicy(GetIamPolicyRequest request)

publicfinalPolicygetIamPolicy(GetIamPolicyRequestrequest)

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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){GetIamPolicyRequestrequest=GetIamPolicyRequest.newBuilder().setResource(AuthorizationPolicyName.of("[PROJECT]","[LOCATION]","[AUTHORIZATION_POLICY]").toString()).setOptions(GetPolicyOptions.newBuilder().build()).build();Policyresponse=networkSecurityClient.getIamPolicy(request);}
Parameter
NameDescription
requestcom.google.iam.v1.GetIamPolicyRequest

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

Returns
TypeDescription
com.google.iam.v1.Policy

getIamPolicyCallable()

publicfinalUnaryCallable<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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){GetIamPolicyRequestrequest=GetIamPolicyRequest.newBuilder().setResource(AuthorizationPolicyName.of("[PROJECT]","[LOCATION]","[AUTHORIZATION_POLICY]").toString()).setOptions(GetPolicyOptions.newBuilder().build()).build();ApiFuture<Policy>future=networkSecurityClient.getIamPolicyCallable().futureCall(request);// Do something.Policyresponse=future.get();}
Returns
TypeDescription
UnaryCallable<com.google.iam.v1.GetIamPolicyRequest,com.google.iam.v1.Policy>

getLocation(GetLocationRequest request)

publicfinalLocationgetLocation(GetLocationRequestrequest)

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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){GetLocationRequestrequest=GetLocationRequest.newBuilder().setName("name3373707").build();Locationresponse=networkSecurityClient.getLocation(request);}
Parameter
NameDescription
requestcom.google.cloud.location.GetLocationRequest

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

Returns
TypeDescription
com.google.cloud.location.Location

getLocationCallable()

publicfinalUnaryCallable<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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){GetLocationRequestrequest=GetLocationRequest.newBuilder().setName("name3373707").build();ApiFuture<Location>future=networkSecurityClient.getLocationCallable().futureCall(request);// Do something.Locationresponse=future.get();}
Returns
TypeDescription
UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location>

getOperationsClient()

publicfinalOperationsClientgetOperationsClient()

Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.

Returns
TypeDescription
OperationsClient

getServerTlsPolicy(GetServerTlsPolicyRequest request)

publicfinalServerTlsPolicygetServerTlsPolicy(GetServerTlsPolicyRequestrequest)

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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){GetServerTlsPolicyRequestrequest=GetServerTlsPolicyRequest.newBuilder().setName(ServerTlsPolicyName.of("[PROJECT]","[LOCATION]","[SERVER_TLS_POLICY]").toString()).build();ServerTlsPolicyresponse=networkSecurityClient.getServerTlsPolicy(request);}
Parameter
NameDescription
requestGetServerTlsPolicyRequest

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

Returns
TypeDescription
ServerTlsPolicy

getServerTlsPolicy(ServerTlsPolicyName name)

publicfinalServerTlsPolicygetServerTlsPolicy(ServerTlsPolicyNamename)

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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){ServerTlsPolicyNamename=ServerTlsPolicyName.of("[PROJECT]","[LOCATION]","[SERVER_TLS_POLICY]");ServerTlsPolicyresponse=networkSecurityClient.getServerTlsPolicy(name);}
Parameter
NameDescription
nameServerTlsPolicyName

Required. A name of the ServerTlsPolicy to get. Must be in the format projects/*/locations/{location}/serverTlsPolicies/*.

Returns
TypeDescription
ServerTlsPolicy

getServerTlsPolicy(String name)

publicfinalServerTlsPolicygetServerTlsPolicy(Stringname)

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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){Stringname=ServerTlsPolicyName.of("[PROJECT]","[LOCATION]","[SERVER_TLS_POLICY]").toString();ServerTlsPolicyresponse=networkSecurityClient.getServerTlsPolicy(name);}
Parameter
NameDescription
nameString

Required. A name of the ServerTlsPolicy to get. Must be in the format projects/*/locations/{location}/serverTlsPolicies/*.

Returns
TypeDescription
ServerTlsPolicy

getServerTlsPolicyCallable()

publicfinalUnaryCallable<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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){GetServerTlsPolicyRequestrequest=GetServerTlsPolicyRequest.newBuilder().setName(ServerTlsPolicyName.of("[PROJECT]","[LOCATION]","[SERVER_TLS_POLICY]").toString()).build();ApiFuture<ServerTlsPolicy>future=networkSecurityClient.getServerTlsPolicyCallable().futureCall(request);// Do something.ServerTlsPolicyresponse=future.get();}
Returns
TypeDescription
UnaryCallable<GetServerTlsPolicyRequest,ServerTlsPolicy>

getSettings()

publicfinalNetworkSecuritySettingsgetSettings()
Returns
TypeDescription
NetworkSecuritySettings

getStub()

publicNetworkSecurityStubgetStub()
Returns
TypeDescription
NetworkSecurityStub

isShutdown()

publicbooleanisShutdown()
Returns
TypeDescription
boolean

isTerminated()

publicbooleanisTerminated()
Returns
TypeDescription
boolean

listAuthorizationPolicies(ListAuthorizationPoliciesRequest request)

publicfinalNetworkSecurityClient.ListAuthorizationPoliciesPagedResponselistAuthorizationPolicies(ListAuthorizationPoliciesRequestrequest)

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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){ListAuthorizationPoliciesRequestrequest=ListAuthorizationPoliciesRequest.newBuilder().setParent(LocationName.of("[PROJECT]","[LOCATION]").toString()).setPageSize(883849137).setPageToken("pageToken873572522").build();for(AuthorizationPolicyelement:networkSecurityClient.listAuthorizationPolicies(request).iterateAll()){// doThingsWith(element);}}
Parameter
NameDescription
requestListAuthorizationPoliciesRequest

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

Returns
TypeDescription
NetworkSecurityClient.ListAuthorizationPoliciesPagedResponse

listAuthorizationPolicies(LocationName parent)

publicfinalNetworkSecurityClient.ListAuthorizationPoliciesPagedResponselistAuthorizationPolicies(LocationNameparent)

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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){LocationNameparent=LocationName.of("[PROJECT]","[LOCATION]");for(AuthorizationPolicyelement:networkSecurityClient.listAuthorizationPolicies(parent).iterateAll()){// doThingsWith(element);}}
Parameter
NameDescription
parentLocationName

Required. The project and location from which the AuthorizationPolicies should be listed, specified in the format projects/{project}/locations/{location}.

Returns
TypeDescription
NetworkSecurityClient.ListAuthorizationPoliciesPagedResponse

listAuthorizationPolicies(String parent)

publicfinalNetworkSecurityClient.ListAuthorizationPoliciesPagedResponselistAuthorizationPolicies(Stringparent)

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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){Stringparent=LocationName.of("[PROJECT]","[LOCATION]").toString();for(AuthorizationPolicyelement:networkSecurityClient.listAuthorizationPolicies(parent).iterateAll()){// doThingsWith(element);}}
Parameter
NameDescription
parentString

Required. The project and location from which the AuthorizationPolicies should be listed, specified in the format projects/{project}/locations/{location}.

Returns
TypeDescription
NetworkSecurityClient.ListAuthorizationPoliciesPagedResponse

listAuthorizationPoliciesCallable()

publicfinalUnaryCallable<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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){ListAuthorizationPoliciesRequestrequest=ListAuthorizationPoliciesRequest.newBuilder().setParent(LocationName.of("[PROJECT]","[LOCATION]").toString()).setPageSize(883849137).setPageToken("pageToken873572522").build();while(true){ListAuthorizationPoliciesResponseresponse=networkSecurityClient.listAuthorizationPoliciesCallable().call(request);for(AuthorizationPolicyelement:response.getAuthorizationPoliciesList()){// doThingsWith(element);}StringnextPageToken=response.getNextPageToken();if(!Strings.isNullOrEmpty(nextPageToken)){request=request.toBuilder().setPageToken(nextPageToken).build();}else{break;}}}
Returns
TypeDescription
UnaryCallable<ListAuthorizationPoliciesRequest,ListAuthorizationPoliciesResponse>

listAuthorizationPoliciesPagedCallable()

publicfinalUnaryCallable<ListAuthorizationPoliciesRequest,NetworkSecurityClient.ListAuthorizationPoliciesPagedResponse>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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){ListAuthorizationPoliciesRequestrequest=ListAuthorizationPoliciesRequest.newBuilder().setParent(LocationName.of("[PROJECT]","[LOCATION]").toString()).setPageSize(883849137).setPageToken("pageToken873572522").build();ApiFuture<AuthorizationPolicy>future=networkSecurityClient.listAuthorizationPoliciesPagedCallable().futureCall(request);// Do something.for(AuthorizationPolicyelement:future.get().iterateAll()){// doThingsWith(element);}}
Returns
TypeDescription
UnaryCallable<ListAuthorizationPoliciesRequest,ListAuthorizationPoliciesPagedResponse>

listClientTlsPolicies(ListClientTlsPoliciesRequest request)

publicfinalNetworkSecurityClient.ListClientTlsPoliciesPagedResponselistClientTlsPolicies(ListClientTlsPoliciesRequestrequest)

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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){ListClientTlsPoliciesRequestrequest=ListClientTlsPoliciesRequest.newBuilder().setParent(LocationName.of("[PROJECT]","[LOCATION]").toString()).setPageSize(883849137).setPageToken("pageToken873572522").build();for(ClientTlsPolicyelement:networkSecurityClient.listClientTlsPolicies(request).iterateAll()){// doThingsWith(element);}}
Parameter
NameDescription
requestListClientTlsPoliciesRequest

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

Returns
TypeDescription
NetworkSecurityClient.ListClientTlsPoliciesPagedResponse

listClientTlsPolicies(LocationName parent)

publicfinalNetworkSecurityClient.ListClientTlsPoliciesPagedResponselistClientTlsPolicies(LocationNameparent)

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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){LocationNameparent=LocationName.of("[PROJECT]","[LOCATION]");for(ClientTlsPolicyelement:networkSecurityClient.listClientTlsPolicies(parent).iterateAll()){// doThingsWith(element);}}
Parameter
NameDescription
parentLocationName

Required. The project and location from which the ClientTlsPolicies should be listed, specified in the format projects/*/locations/{location}.

Returns
TypeDescription
NetworkSecurityClient.ListClientTlsPoliciesPagedResponse

listClientTlsPolicies(String parent)

publicfinalNetworkSecurityClient.ListClientTlsPoliciesPagedResponselistClientTlsPolicies(Stringparent)

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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){Stringparent=LocationName.of("[PROJECT]","[LOCATION]").toString();for(ClientTlsPolicyelement:networkSecurityClient.listClientTlsPolicies(parent).iterateAll()){// doThingsWith(element);}}
Parameter
NameDescription
parentString

Required. The project and location from which the ClientTlsPolicies should be listed, specified in the format projects/*/locations/{location}.

Returns
TypeDescription
NetworkSecurityClient.ListClientTlsPoliciesPagedResponse

listClientTlsPoliciesCallable()

publicfinalUnaryCallable<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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){ListClientTlsPoliciesRequestrequest=ListClientTlsPoliciesRequest.newBuilder().setParent(LocationName.of("[PROJECT]","[LOCATION]").toString()).setPageSize(883849137).setPageToken("pageToken873572522").build();while(true){ListClientTlsPoliciesResponseresponse=networkSecurityClient.listClientTlsPoliciesCallable().call(request);for(ClientTlsPolicyelement:response.getClientTlsPoliciesList()){// doThingsWith(element);}StringnextPageToken=response.getNextPageToken();if(!Strings.isNullOrEmpty(nextPageToken)){request=request.toBuilder().setPageToken(nextPageToken).build();}else{break;}}}
Returns
TypeDescription
UnaryCallable<ListClientTlsPoliciesRequest,ListClientTlsPoliciesResponse>

listClientTlsPoliciesPagedCallable()

publicfinalUnaryCallable<ListClientTlsPoliciesRequest,NetworkSecurityClient.ListClientTlsPoliciesPagedResponse>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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){ListClientTlsPoliciesRequestrequest=ListClientTlsPoliciesRequest.newBuilder().setParent(LocationName.of("[PROJECT]","[LOCATION]").toString()).setPageSize(883849137).setPageToken("pageToken873572522").build();ApiFuture<ClientTlsPolicy>future=networkSecurityClient.listClientTlsPoliciesPagedCallable().futureCall(request);// Do something.for(ClientTlsPolicyelement:future.get().iterateAll()){// doThingsWith(element);}}
Returns
TypeDescription
UnaryCallable<ListClientTlsPoliciesRequest,ListClientTlsPoliciesPagedResponse>

listLocations(ListLocationsRequest request)

publicfinalNetworkSecurityClient.ListLocationsPagedResponselistLocations(ListLocationsRequestrequest)

Lists information about the supported locations for this service.

Sample code:

// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){ListLocationsRequestrequest=ListLocationsRequest.newBuilder().setName("name3373707").setFilter("filter-1274492040").setPageSize(883849137).setPageToken("pageToken873572522").build();for(Locationelement:networkSecurityClient.listLocations(request).iterateAll()){// doThingsWith(element);}}
Parameter
NameDescription
requestcom.google.cloud.location.ListLocationsRequest

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

Returns
TypeDescription
NetworkSecurityClient.ListLocationsPagedResponse

listLocationsCallable()

publicfinalUnaryCallable<ListLocationsRequest,ListLocationsResponse>listLocationsCallable()

Lists information about the supported locations for this service.

Sample code:

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

listLocationsPagedCallable()

publicfinalUnaryCallable<ListLocationsRequest,NetworkSecurityClient.ListLocationsPagedResponse>listLocationsPagedCallable()

Lists information about the supported locations for this service.

Sample code:

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

listServerTlsPolicies(ListServerTlsPoliciesRequest request)

publicfinalNetworkSecurityClient.ListServerTlsPoliciesPagedResponselistServerTlsPolicies(ListServerTlsPoliciesRequestrequest)

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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){ListServerTlsPoliciesRequestrequest=ListServerTlsPoliciesRequest.newBuilder().setParent(LocationName.of("[PROJECT]","[LOCATION]").toString()).setPageSize(883849137).setPageToken("pageToken873572522").build();for(ServerTlsPolicyelement:networkSecurityClient.listServerTlsPolicies(request).iterateAll()){// doThingsWith(element);}}
Parameter
NameDescription
requestListServerTlsPoliciesRequest

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

Returns
TypeDescription
NetworkSecurityClient.ListServerTlsPoliciesPagedResponse

listServerTlsPolicies(LocationName parent)

publicfinalNetworkSecurityClient.ListServerTlsPoliciesPagedResponselistServerTlsPolicies(LocationNameparent)

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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){LocationNameparent=LocationName.of("[PROJECT]","[LOCATION]");for(ServerTlsPolicyelement:networkSecurityClient.listServerTlsPolicies(parent).iterateAll()){// doThingsWith(element);}}
Parameter
NameDescription
parentLocationName

Required. The project and location from which the ServerTlsPolicies should be listed, specified in the format projects/*/locations/{location}.

Returns
TypeDescription
NetworkSecurityClient.ListServerTlsPoliciesPagedResponse

listServerTlsPolicies(String parent)

publicfinalNetworkSecurityClient.ListServerTlsPoliciesPagedResponselistServerTlsPolicies(Stringparent)

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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){Stringparent=LocationName.of("[PROJECT]","[LOCATION]").toString();for(ServerTlsPolicyelement:networkSecurityClient.listServerTlsPolicies(parent).iterateAll()){// doThingsWith(element);}}
Parameter
NameDescription
parentString

Required. The project and location from which the ServerTlsPolicies should be listed, specified in the format projects/*/locations/{location}.

Returns
TypeDescription
NetworkSecurityClient.ListServerTlsPoliciesPagedResponse

listServerTlsPoliciesCallable()

publicfinalUnaryCallable<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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){ListServerTlsPoliciesRequestrequest=ListServerTlsPoliciesRequest.newBuilder().setParent(LocationName.of("[PROJECT]","[LOCATION]").toString()).setPageSize(883849137).setPageToken("pageToken873572522").build();while(true){ListServerTlsPoliciesResponseresponse=networkSecurityClient.listServerTlsPoliciesCallable().call(request);for(ServerTlsPolicyelement:response.getServerTlsPoliciesList()){// doThingsWith(element);}StringnextPageToken=response.getNextPageToken();if(!Strings.isNullOrEmpty(nextPageToken)){request=request.toBuilder().setPageToken(nextPageToken).build();}else{break;}}}
Returns
TypeDescription
UnaryCallable<ListServerTlsPoliciesRequest,ListServerTlsPoliciesResponse>

listServerTlsPoliciesPagedCallable()

publicfinalUnaryCallable<ListServerTlsPoliciesRequest,NetworkSecurityClient.ListServerTlsPoliciesPagedResponse>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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){ListServerTlsPoliciesRequestrequest=ListServerTlsPoliciesRequest.newBuilder().setParent(LocationName.of("[PROJECT]","[LOCATION]").toString()).setPageSize(883849137).setPageToken("pageToken873572522").build();ApiFuture<ServerTlsPolicy>future=networkSecurityClient.listServerTlsPoliciesPagedCallable().futureCall(request);// Do something.for(ServerTlsPolicyelement:future.get().iterateAll()){// doThingsWith(element);}}
Returns
TypeDescription
UnaryCallable<ListServerTlsPoliciesRequest,ListServerTlsPoliciesPagedResponse>

setIamPolicy(SetIamPolicyRequest request)

publicfinalPolicysetIamPolicy(SetIamPolicyRequestrequest)

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

Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIEDerrors.

Sample code:

// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){SetIamPolicyRequestrequest=SetIamPolicyRequest.newBuilder().setResource(AuthorizationPolicyName.of("[PROJECT]","[LOCATION]","[AUTHORIZATION_POLICY]").toString()).setPolicy(Policy.newBuilder().build()).setUpdateMask(FieldMask.newBuilder().build()).build();Policyresponse=networkSecurityClient.setIamPolicy(request);}
Parameter
NameDescription
requestcom.google.iam.v1.SetIamPolicyRequest

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

Returns
TypeDescription
com.google.iam.v1.Policy

setIamPolicyCallable()

publicfinalUnaryCallable<SetIamPolicyRequest,Policy>setIamPolicyCallable()

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

Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIEDerrors.

Sample code:

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

shutdown()

publicvoidshutdown()

shutdownNow()

publicvoidshutdownNow()

testIamPermissions(TestIamPermissionsRequest request)

publicfinalTestIamPermissionsResponsetestIamPermissions(TestIamPermissionsRequestrequest)

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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){TestIamPermissionsRequestrequest=TestIamPermissionsRequest.newBuilder().setResource(AuthorizationPolicyName.of("[PROJECT]","[LOCATION]","[AUTHORIZATION_POLICY]").toString()).addAllPermissions(newArrayList<String>()).build();TestIamPermissionsResponseresponse=networkSecurityClient.testIamPermissions(request);}
Parameter
NameDescription
requestcom.google.iam.v1.TestIamPermissionsRequest

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

Returns
TypeDescription
com.google.iam.v1.TestIamPermissionsResponse

testIamPermissionsCallable()

publicfinalUnaryCallable<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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){TestIamPermissionsRequestrequest=TestIamPermissionsRequest.newBuilder().setResource(AuthorizationPolicyName.of("[PROJECT]","[LOCATION]","[AUTHORIZATION_POLICY]").toString()).addAllPermissions(newArrayList<String>()).build();ApiFuture<TestIamPermissionsResponse>future=networkSecurityClient.testIamPermissionsCallable().futureCall(request);// Do something.TestIamPermissionsResponseresponse=future.get();}
Returns
TypeDescription
UnaryCallable<com.google.iam.v1.TestIamPermissionsRequest,com.google.iam.v1.TestIamPermissionsResponse>

updateAuthorizationPolicyAsync(AuthorizationPolicy authorizationPolicy, FieldMask updateMask)

publicfinalOperationFuture<AuthorizationPolicy,OperationMetadata>updateAuthorizationPolicyAsync(AuthorizationPolicyauthorizationPolicy,FieldMaskupdateMask)

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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){AuthorizationPolicyauthorizationPolicy=AuthorizationPolicy.newBuilder().build();FieldMaskupdateMask=FieldMask.newBuilder().build();AuthorizationPolicyresponse=networkSecurityClient.updateAuthorizationPolicyAsync(authorizationPolicy,updateMask).get();}
Parameters
NameDescription
authorizationPolicyAuthorizationPolicy

Required. Updated AuthorizationPolicy resource.

updateMaskFieldMask

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.

Returns
TypeDescription
OperationFuture<AuthorizationPolicy,OperationMetadata>

updateAuthorizationPolicyAsync(UpdateAuthorizationPolicyRequest request)

publicfinalOperationFuture<AuthorizationPolicy,OperationMetadata>updateAuthorizationPolicyAsync(UpdateAuthorizationPolicyRequestrequest)

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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){UpdateAuthorizationPolicyRequestrequest=UpdateAuthorizationPolicyRequest.newBuilder().setUpdateMask(FieldMask.newBuilder().build()).setAuthorizationPolicy(AuthorizationPolicy.newBuilder().build()).build();AuthorizationPolicyresponse=networkSecurityClient.updateAuthorizationPolicyAsync(request).get();}
Parameter
NameDescription
requestUpdateAuthorizationPolicyRequest

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

Returns
TypeDescription
OperationFuture<AuthorizationPolicy,OperationMetadata>

updateAuthorizationPolicyCallable()

publicfinalUnaryCallable<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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){UpdateAuthorizationPolicyRequestrequest=UpdateAuthorizationPolicyRequest.newBuilder().setUpdateMask(FieldMask.newBuilder().build()).setAuthorizationPolicy(AuthorizationPolicy.newBuilder().build()).build();ApiFuture<Operation>future=networkSecurityClient.updateAuthorizationPolicyCallable().futureCall(request);// Do something.Operationresponse=future.get();}
Returns
TypeDescription
UnaryCallable<UpdateAuthorizationPolicyRequest,Operation>

updateAuthorizationPolicyOperationCallable()

publicfinalOperationCallable<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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){UpdateAuthorizationPolicyRequestrequest=UpdateAuthorizationPolicyRequest.newBuilder().setUpdateMask(FieldMask.newBuilder().build()).setAuthorizationPolicy(AuthorizationPolicy.newBuilder().build()).build();OperationFuture<AuthorizationPolicy,OperationMetadata>future=networkSecurityClient.updateAuthorizationPolicyOperationCallable().futureCall(request);// Do something.AuthorizationPolicyresponse=future.get();}
Returns
TypeDescription
OperationCallable<UpdateAuthorizationPolicyRequest,AuthorizationPolicy,OperationMetadata>

updateClientTlsPolicyAsync(ClientTlsPolicy clientTlsPolicy, FieldMask updateMask)

publicfinalOperationFuture<ClientTlsPolicy,OperationMetadata>updateClientTlsPolicyAsync(ClientTlsPolicyclientTlsPolicy,FieldMaskupdateMask)

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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){ClientTlsPolicyclientTlsPolicy=ClientTlsPolicy.newBuilder().build();FieldMaskupdateMask=FieldMask.newBuilder().build();ClientTlsPolicyresponse=networkSecurityClient.updateClientTlsPolicyAsync(clientTlsPolicy,updateMask).get();}
Parameters
NameDescription
clientTlsPolicyClientTlsPolicy

Required. Updated ClientTlsPolicy resource.

updateMaskFieldMask

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.

Returns
TypeDescription
OperationFuture<ClientTlsPolicy,OperationMetadata>

updateClientTlsPolicyAsync(UpdateClientTlsPolicyRequest request)

publicfinalOperationFuture<ClientTlsPolicy,OperationMetadata>updateClientTlsPolicyAsync(UpdateClientTlsPolicyRequestrequest)

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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){UpdateClientTlsPolicyRequestrequest=UpdateClientTlsPolicyRequest.newBuilder().setUpdateMask(FieldMask.newBuilder().build()).setClientTlsPolicy(ClientTlsPolicy.newBuilder().build()).build();ClientTlsPolicyresponse=networkSecurityClient.updateClientTlsPolicyAsync(request).get();}
Parameter
NameDescription
requestUpdateClientTlsPolicyRequest

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

Returns
TypeDescription
OperationFuture<ClientTlsPolicy,OperationMetadata>

updateClientTlsPolicyCallable()

publicfinalUnaryCallable<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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){UpdateClientTlsPolicyRequestrequest=UpdateClientTlsPolicyRequest.newBuilder().setUpdateMask(FieldMask.newBuilder().build()).setClientTlsPolicy(ClientTlsPolicy.newBuilder().build()).build();ApiFuture<Operation>future=networkSecurityClient.updateClientTlsPolicyCallable().futureCall(request);// Do something.Operationresponse=future.get();}
Returns
TypeDescription
UnaryCallable<UpdateClientTlsPolicyRequest,Operation>

updateClientTlsPolicyOperationCallable()

publicfinalOperationCallable<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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){UpdateClientTlsPolicyRequestrequest=UpdateClientTlsPolicyRequest.newBuilder().setUpdateMask(FieldMask.newBuilder().build()).setClientTlsPolicy(ClientTlsPolicy.newBuilder().build()).build();OperationFuture<ClientTlsPolicy,OperationMetadata>future=networkSecurityClient.updateClientTlsPolicyOperationCallable().futureCall(request);// Do something.ClientTlsPolicyresponse=future.get();}
Returns
TypeDescription
OperationCallable<UpdateClientTlsPolicyRequest,ClientTlsPolicy,OperationMetadata>

updateServerTlsPolicyAsync(ServerTlsPolicy serverTlsPolicy, FieldMask updateMask)

publicfinalOperationFuture<ServerTlsPolicy,OperationMetadata>updateServerTlsPolicyAsync(ServerTlsPolicyserverTlsPolicy,FieldMaskupdateMask)

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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){ServerTlsPolicyserverTlsPolicy=ServerTlsPolicy.newBuilder().build();FieldMaskupdateMask=FieldMask.newBuilder().build();ServerTlsPolicyresponse=networkSecurityClient.updateServerTlsPolicyAsync(serverTlsPolicy,updateMask).get();}
Parameters
NameDescription
serverTlsPolicyServerTlsPolicy

Required. Updated ServerTlsPolicy resource.

updateMaskFieldMask

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.

Returns
TypeDescription
OperationFuture<ServerTlsPolicy,OperationMetadata>

updateServerTlsPolicyAsync(UpdateServerTlsPolicyRequest request)

publicfinalOperationFuture<ServerTlsPolicy,OperationMetadata>updateServerTlsPolicyAsync(UpdateServerTlsPolicyRequestrequest)

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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){UpdateServerTlsPolicyRequestrequest=UpdateServerTlsPolicyRequest.newBuilder().setUpdateMask(FieldMask.newBuilder().build()).setServerTlsPolicy(ServerTlsPolicy.newBuilder().build()).build();ServerTlsPolicyresponse=networkSecurityClient.updateServerTlsPolicyAsync(request).get();}
Parameter
NameDescription
requestUpdateServerTlsPolicyRequest

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

Returns
TypeDescription
OperationFuture<ServerTlsPolicy,OperationMetadata>

updateServerTlsPolicyCallable()

publicfinalUnaryCallable<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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){UpdateServerTlsPolicyRequestrequest=UpdateServerTlsPolicyRequest.newBuilder().setUpdateMask(FieldMask.newBuilder().build()).setServerTlsPolicy(ServerTlsPolicy.newBuilder().build()).build();ApiFuture<Operation>future=networkSecurityClient.updateServerTlsPolicyCallable().futureCall(request);// Do something.Operationresponse=future.get();}
Returns
TypeDescription
UnaryCallable<UpdateServerTlsPolicyRequest,Operation>

updateServerTlsPolicyOperationCallable()

publicfinalOperationCallable<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_librarytry(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){UpdateServerTlsPolicyRequestrequest=UpdateServerTlsPolicyRequest.newBuilder().setUpdateMask(FieldMask.newBuilder().build()).setServerTlsPolicy(ServerTlsPolicy.newBuilder().build()).build();OperationFuture<ServerTlsPolicy,OperationMetadata>future=networkSecurityClient.updateServerTlsPolicyOperationCallable().futureCall(request);// Do something.ServerTlsPolicyresponse=future.get();}
Returns
TypeDescription
OperationCallable<UpdateServerTlsPolicyRequest,ServerTlsPolicy,OperationMetadata>