Class NetworkSecurityClient
- All Implemented Interfaces:
BackgroundResource,AutoCloseable
This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
AuthorizationPolicyName name =
AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]");
AuthorizationPolicy response = networkSecurityClient.getAuthorizationPolicy(name);
}
Note: close() needs to be called on the NetworkSecurityClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().
| Method | Description | Method Variants |
|---|---|---|
ListAuthorizationPolicies |
Lists AuthorizationPolicies in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteAuthorizationPolicy |
Deletes a single AuthorizationPolicy. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListBackendAuthenticationConfigs |
Lists BackendAuthenticationConfigs in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetBackendAuthenticationConfig |
Gets details of a single BackendAuthenticationConfig to BackendAuthenticationConfig. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CreateBackendAuthenticationConfig |
Creates a new BackendAuthenticationConfig in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateBackendAuthenticationConfig |
Updates the parameters of a single BackendAuthenticationConfig to BackendAuthenticationConfig. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteBackendAuthenticationConfig |
Deletes a single BackendAuthenticationConfig to BackendAuthenticationConfig. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteServerTlsPolicy |
Deletes a single ServerTlsPolicy. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteClientTlsPolicy |
Deletes a single ClientTlsPolicy. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListGatewaySecurityPolicies |
Lists GatewaySecurityPolicies in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetGatewaySecurityPolicy |
Gets details of a single GatewaySecurityPolicy. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CreateGatewaySecurityPolicy |
Creates a new GatewaySecurityPolicy in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateGatewaySecurityPolicy |
Updates the parameters of a single GatewaySecurityPolicy. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteGatewaySecurityPolicy |
Deletes a single GatewaySecurityPolicy. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListGatewaySecurityPolicyRules |
Lists GatewaySecurityPolicyRules in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetGatewaySecurityPolicyRule |
Gets details of a single GatewaySecurityPolicyRule. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CreateGatewaySecurityPolicyRule |
Creates a new GatewaySecurityPolicy in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateGatewaySecurityPolicyRule |
Updates the parameters of a single GatewaySecurityPolicyRule. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteGatewaySecurityPolicyRule |
Deletes a single GatewaySecurityPolicyRule. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListUrlLists |
Lists UrlLists in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetUrlList |
Gets details of a single UrlList. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CreateUrlList |
Creates a new UrlList in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateUrlList |
Updates the parameters of a single UrlList. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteUrlList |
Deletes a single UrlList. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListTlsInspectionPolicies |
Lists TlsInspectionPolicies in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetTlsInspectionPolicy |
Gets details of a single TlsInspectionPolicy. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CreateTlsInspectionPolicy |
Creates a new TlsInspectionPolicy in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateTlsInspectionPolicy |
Updates the parameters of a single TlsInspectionPolicy. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteTlsInspectionPolicy |
Deletes a single TlsInspectionPolicy. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListAuthzPolicies |
Lists AuthzPolicies in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetAuthzPolicy |
Gets details of a single AuthzPolicy. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CreateAuthzPolicy |
Creates a new AuthzPolicy in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateAuthzPolicy |
Updates the parameters of a single AuthzPolicy. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteAuthzPolicy |
Deletes a single AuthzPolicy. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListLocations |
Lists information about the supported locations for this service. This method lists locations based on the resource scope provided inthe [ListLocationsRequest.name] field: * **Global locations**: If `name` is empty, the method lists thepublic locations available to all projects. * **Project-specificlocations**: If `name` follows the format`projects/{project}`, the method lists locations visible to thatspecific project. This includes public, private, or otherproject-specific locations enabled for the project. For gRPC and client library implementations, the resource name ispassed as the `name` field. For direct service calls, the resourcename isincorporated into the request path based on the specific serviceimplementation and version. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetLocation |
Gets information about a location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
SetIamPolicy |
Sets the access control policy on the specified resource. Replacesany existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
See the individual methods for example code.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.
This class can be customized by passing in a custom instance of NetworkSecuritySettings to create(). For example:
To customize credentials:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
NetworkSecuritySettings networkSecuritySettings =
NetworkSecuritySettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
NetworkSecurityClient networkSecurityClient =
NetworkSecurityClient.create(networkSecuritySettings);
To customize the endpoint:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
NetworkSecuritySettings networkSecuritySettings =
NetworkSecuritySettings.newBuilder().setEndpoint(myEndpoint).build();
NetworkSecurityClient networkSecurityClient =
NetworkSecurityClient.create(networkSecuritySettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic class -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedNetworkSecurityClient(NetworkSecuritySettings settings) Constructs an instance of NetworkSecurityClient, using the given settings.protected -
Method Summary
Modifier and TypeMethodDescriptionbooleanawaitTermination(long duration, TimeUnit unit) final voidclose()static final NetworkSecurityClientcreate()Constructs an instance of NetworkSecurityClient with default settings.static final NetworkSecurityClientcreate(NetworkSecuritySettings settings) Constructs an instance of NetworkSecurityClient, using the given settings.static final NetworkSecurityClientcreate(NetworkSecurityStub stub) Constructs an instance of NetworkSecurityClient, using the given stub for making calls.Creates a new AuthorizationPolicy in a given project and location.createAuthorizationPolicyAsync(LocationName parent, AuthorizationPolicy authorizationPolicy, String authorizationPolicyId) Creates a new AuthorizationPolicy in a given project and location.createAuthorizationPolicyAsync(String parent, AuthorizationPolicy authorizationPolicy, String authorizationPolicyId) Creates a new AuthorizationPolicy in a given project and location.Creates a new AuthorizationPolicy in a given project and location.Creates a new AuthorizationPolicy in a given project and location.Creates a new AuthzPolicy in a given project and location.createAuthzPolicyAsync(LocationName parent, AuthzPolicy authzPolicy, String authzPolicyId) Creates a new AuthzPolicy in a given project and location.createAuthzPolicyAsync(String parent, AuthzPolicy authzPolicy, String authzPolicyId) Creates a new AuthzPolicy in a given project and location.Creates a new AuthzPolicy in a given project and location.Creates a new AuthzPolicy in a given project and location.Creates a new BackendAuthenticationConfig in a given project and location.createBackendAuthenticationConfigAsync(LocationName parent, BackendAuthenticationConfig backendAuthenticationConfig, String backendAuthenticationConfigId) Creates a new BackendAuthenticationConfig in a given project and location.createBackendAuthenticationConfigAsync(String parent, BackendAuthenticationConfig backendAuthenticationConfig, String backendAuthenticationConfigId) Creates a new BackendAuthenticationConfig in a given project and location.Creates a new BackendAuthenticationConfig in a given project and location.final OperationCallable<CreateBackendAuthenticationConfigRequest,BackendAuthenticationConfig, OperationMetadata> Creates a new BackendAuthenticationConfig in a given project and location.Creates a new ClientTlsPolicy in a given project and location.createClientTlsPolicyAsync(LocationName parent, ClientTlsPolicy clientTlsPolicy, String clientTlsPolicyId) Creates a new ClientTlsPolicy in a given project and location.createClientTlsPolicyAsync(String parent, ClientTlsPolicy clientTlsPolicy, String clientTlsPolicyId) Creates a new ClientTlsPolicy in a given project and location.Creates a new ClientTlsPolicy in a given project and location.Creates a new ClientTlsPolicy in a given project and location.Creates a new GatewaySecurityPolicy in a given project and location.createGatewaySecurityPolicyAsync(LocationName parent, GatewaySecurityPolicy gatewaySecurityPolicy, String gatewaySecurityPolicyId) Creates a new GatewaySecurityPolicy in a given project and location.createGatewaySecurityPolicyAsync(String parent, GatewaySecurityPolicy gatewaySecurityPolicy, String gatewaySecurityPolicyId) Creates a new GatewaySecurityPolicy in a given project and location.Creates a new GatewaySecurityPolicy in a given project and location.Creates a new GatewaySecurityPolicy in a given project and location.Creates a new GatewaySecurityPolicy in a given project and location.createGatewaySecurityPolicyRuleAsync(GatewaySecurityPolicyName parent, GatewaySecurityPolicyRule gatewaySecurityPolicyRule, String gatewaySecurityPolicyRuleId) Creates a new GatewaySecurityPolicy in a given project and location.createGatewaySecurityPolicyRuleAsync(String parent, GatewaySecurityPolicyRule gatewaySecurityPolicyRule, String gatewaySecurityPolicyRuleId) Creates a new GatewaySecurityPolicy in a given project and location.Creates a new GatewaySecurityPolicy in a given project and location.final OperationCallable<CreateGatewaySecurityPolicyRuleRequest,GatewaySecurityPolicyRule, OperationMetadata> Creates a new GatewaySecurityPolicy in a given project and location.Creates a new ServerTlsPolicy in a given project and location.createServerTlsPolicyAsync(LocationName parent, ServerTlsPolicy serverTlsPolicy, String serverTlsPolicyId) Creates a new ServerTlsPolicy in a given project and location.createServerTlsPolicyAsync(String parent, ServerTlsPolicy serverTlsPolicy, String serverTlsPolicyId) Creates a new ServerTlsPolicy in a given project and location.Creates a new ServerTlsPolicy in a given project and location.Creates a new ServerTlsPolicy in a given project and location.Creates a new TlsInspectionPolicy in a given project and location.createTlsInspectionPolicyAsync(LocationName parent, TlsInspectionPolicy tlsInspectionPolicy, String tlsInspectionPolicyId) Creates a new TlsInspectionPolicy in a given project and location.createTlsInspectionPolicyAsync(String parent, TlsInspectionPolicy tlsInspectionPolicy, String tlsInspectionPolicyId) Creates a new TlsInspectionPolicy in a given project and location.Creates a new TlsInspectionPolicy in a given project and location.Creates a new TlsInspectionPolicy in a given project and location.createUrlListAsync(CreateUrlListRequest request) Creates a new UrlList in a given project and location.createUrlListAsync(LocationName parent, UrlList urlList, String urlListId) Creates a new UrlList in a given project and location.createUrlListAsync(String parent, UrlList urlList, String urlListId) Creates a new UrlList in a given project and location.Creates a new UrlList in a given project and location.Creates a new UrlList in a given project and location.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single AuthorizationPolicy.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single AuthorizationPolicy.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single AuthorizationPolicy.Deletes a single AuthorizationPolicy.final OperationCallable<DeleteAuthorizationPolicyRequest,com.google.protobuf.Empty, OperationMetadata> Deletes a single AuthorizationPolicy.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single AuthzPolicy.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single AuthzPolicy.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteAuthzPolicyAsync(String name) Deletes a single AuthzPolicy.Deletes a single AuthzPolicy.final OperationCallable<DeleteAuthzPolicyRequest,com.google.protobuf.Empty, OperationMetadata> Deletes a single AuthzPolicy.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single BackendAuthenticationConfig to BackendAuthenticationConfig.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single BackendAuthenticationConfig to BackendAuthenticationConfig.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single BackendAuthenticationConfig to BackendAuthenticationConfig.Deletes a single BackendAuthenticationConfig to BackendAuthenticationConfig.final OperationCallable<DeleteBackendAuthenticationConfigRequest,com.google.protobuf.Empty, OperationMetadata> Deletes a single BackendAuthenticationConfig to BackendAuthenticationConfig.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single ClientTlsPolicy.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single ClientTlsPolicy.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single ClientTlsPolicy.Deletes a single ClientTlsPolicy.final OperationCallable<DeleteClientTlsPolicyRequest,com.google.protobuf.Empty, OperationMetadata> Deletes a single ClientTlsPolicy.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single GatewaySecurityPolicy.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single GatewaySecurityPolicy.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single GatewaySecurityPolicy.Deletes a single GatewaySecurityPolicy.final OperationCallable<DeleteGatewaySecurityPolicyRequest,com.google.protobuf.Empty, OperationMetadata> Deletes a single GatewaySecurityPolicy.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single GatewaySecurityPolicyRule.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single GatewaySecurityPolicyRule.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single GatewaySecurityPolicyRule.Deletes a single GatewaySecurityPolicyRule.final OperationCallable<DeleteGatewaySecurityPolicyRuleRequest,com.google.protobuf.Empty, OperationMetadata> Deletes a single GatewaySecurityPolicyRule.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single ServerTlsPolicy.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single ServerTlsPolicy.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single ServerTlsPolicy.Deletes a single ServerTlsPolicy.final OperationCallable<DeleteServerTlsPolicyRequest,com.google.protobuf.Empty, OperationMetadata> Deletes a single ServerTlsPolicy.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single TlsInspectionPolicy.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single TlsInspectionPolicy.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single TlsInspectionPolicy.Deletes a single TlsInspectionPolicy.final OperationCallable<DeleteTlsInspectionPolicyRequest,com.google.protobuf.Empty, OperationMetadata> Deletes a single TlsInspectionPolicy.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteUrlListAsync(DeleteUrlListRequest request) Deletes a single UrlList.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single UrlList.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteUrlListAsync(String name) Deletes a single UrlList.Deletes a single UrlList.final OperationCallable<DeleteUrlListRequest,com.google.protobuf.Empty, OperationMetadata> Deletes a single UrlList.final AuthorizationPolicyGets details of a single AuthorizationPolicy.final AuthorizationPolicyGets details of a single AuthorizationPolicy.final AuthorizationPolicygetAuthorizationPolicy(String name) Gets details of a single AuthorizationPolicy.Gets details of a single AuthorizationPolicy.final AuthzPolicyGets details of a single AuthzPolicy.final AuthzPolicygetAuthzPolicy(GetAuthzPolicyRequest request) Gets details of a single AuthzPolicy.final AuthzPolicygetAuthzPolicy(String name) Gets details of a single AuthzPolicy.Gets details of a single AuthzPolicy.Gets details of a single BackendAuthenticationConfig to BackendAuthenticationConfig.Gets details of a single BackendAuthenticationConfig to BackendAuthenticationConfig.Gets details of a single BackendAuthenticationConfig to BackendAuthenticationConfig.Gets details of a single BackendAuthenticationConfig to BackendAuthenticationConfig.final ClientTlsPolicyGets details of a single ClientTlsPolicy.final ClientTlsPolicyGets details of a single ClientTlsPolicy.final ClientTlsPolicygetClientTlsPolicy(String name) Gets details of a single ClientTlsPolicy.Gets details of a single ClientTlsPolicy.final GatewaySecurityPolicyGets details of a single GatewaySecurityPolicy.final GatewaySecurityPolicyGets details of a single GatewaySecurityPolicy.final GatewaySecurityPolicyGets details of a single GatewaySecurityPolicy.Gets details of a single GatewaySecurityPolicy.Gets details of a single GatewaySecurityPolicyRule.Gets details of a single GatewaySecurityPolicyRule.Gets details of a single GatewaySecurityPolicyRule.Gets details of a single GatewaySecurityPolicyRule.final PolicygetIamPolicy(GetIamPolicyRequest request) Gets the access control policy for a resource.Gets the access control policy for a resource.final LocationgetLocation(GetLocationRequest request) Gets information about a location.Gets information about a location.final OperationsClientReturns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.final ServerTlsPolicyGets details of a single ServerTlsPolicy.final ServerTlsPolicyGets details of a single ServerTlsPolicy.final ServerTlsPolicygetServerTlsPolicy(String name) Gets details of a single ServerTlsPolicy.Gets details of a single ServerTlsPolicy.final NetworkSecuritySettingsgetStub()final TlsInspectionPolicyGets details of a single TlsInspectionPolicy.final TlsInspectionPolicyGets details of a single TlsInspectionPolicy.final TlsInspectionPolicygetTlsInspectionPolicy(String name) Gets details of a single TlsInspectionPolicy.Gets details of a single TlsInspectionPolicy.final UrlListgetUrlList(GetUrlListRequest request) Gets details of a single UrlList.final UrlListgetUrlList(UrlListName name) Gets details of a single UrlList.final UrlListgetUrlList(String name) Gets details of a single UrlList.Gets details of a single UrlList.booleanbooleanLists AuthorizationPolicies in a given project and location.Lists AuthorizationPolicies in a given project and location.listAuthorizationPolicies(String parent) Lists AuthorizationPolicies in a given project and location.Lists AuthorizationPolicies in a given project and location.final UnaryCallable<ListAuthorizationPoliciesRequest,NetworkSecurityClient.ListAuthorizationPoliciesPagedResponse> Lists AuthorizationPolicies in a given project and location.Lists AuthzPolicies in a given project and location.listAuthzPolicies(LocationName parent) Lists AuthzPolicies in a given project and location.listAuthzPolicies(String parent) Lists AuthzPolicies in a given project and location.Lists AuthzPolicies in a given project and location.Lists AuthzPolicies in a given project and location.Lists BackendAuthenticationConfigs in a given project and location.Lists BackendAuthenticationConfigs in a given project and location.Lists BackendAuthenticationConfigs in a given project and location.final UnaryCallable<ListBackendAuthenticationConfigsRequest,ListBackendAuthenticationConfigsResponse> Lists BackendAuthenticationConfigs in a given project and location.final UnaryCallable<ListBackendAuthenticationConfigsRequest,NetworkSecurityClient.ListBackendAuthenticationConfigsPagedResponse> Lists BackendAuthenticationConfigs in a given project and location.Lists ClientTlsPolicies in a given project and location.listClientTlsPolicies(LocationName parent) Lists ClientTlsPolicies in a given project and location.listClientTlsPolicies(String parent) Lists ClientTlsPolicies in a given project and location.Lists ClientTlsPolicies in a given project and location.final UnaryCallable<ListClientTlsPoliciesRequest,NetworkSecurityClient.ListClientTlsPoliciesPagedResponse> Lists ClientTlsPolicies in a given project and location.Lists GatewaySecurityPolicies in a given project and location.Lists GatewaySecurityPolicies in a given project and location.listGatewaySecurityPolicies(String parent) Lists GatewaySecurityPolicies in a given project and location.Lists GatewaySecurityPolicies in a given project and location.final UnaryCallable<ListGatewaySecurityPoliciesRequest,NetworkSecurityClient.ListGatewaySecurityPoliciesPagedResponse> Lists GatewaySecurityPolicies in a given project and location.Lists GatewaySecurityPolicyRules in a given project and location.Lists GatewaySecurityPolicyRules in a given project and location.listGatewaySecurityPolicyRules(String parent) Lists GatewaySecurityPolicyRules in a given project and location.Lists GatewaySecurityPolicyRules in a given project and location.final UnaryCallable<ListGatewaySecurityPolicyRulesRequest,NetworkSecurityClient.ListGatewaySecurityPolicyRulesPagedResponse> Lists GatewaySecurityPolicyRules in a given project and location.listLocations(ListLocationsRequest request) Lists information about the supported locations for this service.Lists information about the supported locations for this service.Lists information about the supported locations for this service.Lists ServerTlsPolicies in a given project and location.listServerTlsPolicies(LocationName parent) Lists ServerTlsPolicies in a given project and location.listServerTlsPolicies(String parent) Lists ServerTlsPolicies in a given project and location.Lists ServerTlsPolicies in a given project and location.final UnaryCallable<ListServerTlsPoliciesRequest,NetworkSecurityClient.ListServerTlsPoliciesPagedResponse> Lists ServerTlsPolicies in a given project and location.Lists TlsInspectionPolicies in a given project and location.Lists TlsInspectionPolicies in a given project and location.listTlsInspectionPolicies(String parent) Lists TlsInspectionPolicies in a given project and location.Lists TlsInspectionPolicies in a given project and location.final UnaryCallable<ListTlsInspectionPoliciesRequest,NetworkSecurityClient.ListTlsInspectionPoliciesPagedResponse> Lists TlsInspectionPolicies in a given project and location.listUrlLists(ListUrlListsRequest request) Lists UrlLists in a given project and location.listUrlLists(LocationName parent) Lists UrlLists in a given project and location.listUrlLists(String parent) Lists UrlLists in a given project and location.Lists UrlLists in a given project and location.Lists UrlLists in a given project and location.final PolicysetIamPolicy(SetIamPolicyRequest request) Sets the access control policy on the specified resource.Sets the access control policy on the specified resource.voidshutdown()voidReturns permissions that a caller has on the specified resource.Returns permissions that a caller has on the specified resource.updateAuthorizationPolicyAsync(AuthorizationPolicy authorizationPolicy, com.google.protobuf.FieldMask updateMask) Updates the parameters of a single AuthorizationPolicy.Updates the parameters of a single AuthorizationPolicy.Updates the parameters of a single AuthorizationPolicy.Updates the parameters of a single AuthorizationPolicy.updateAuthzPolicyAsync(AuthzPolicy authzPolicy, com.google.protobuf.FieldMask updateMask) Updates the parameters of a single AuthzPolicy.Updates the parameters of a single AuthzPolicy.Updates the parameters of a single AuthzPolicy.Updates the parameters of a single AuthzPolicy.updateBackendAuthenticationConfigAsync(BackendAuthenticationConfig backendAuthenticationConfig, com.google.protobuf.FieldMask updateMask) Updates the parameters of a single BackendAuthenticationConfig to BackendAuthenticationConfig.Updates the parameters of a single BackendAuthenticationConfig to BackendAuthenticationConfig.Updates the parameters of a single BackendAuthenticationConfig to BackendAuthenticationConfig.final OperationCallable<UpdateBackendAuthenticationConfigRequest,BackendAuthenticationConfig, OperationMetadata> Updates the parameters of a single BackendAuthenticationConfig to BackendAuthenticationConfig.updateClientTlsPolicyAsync(ClientTlsPolicy clientTlsPolicy, com.google.protobuf.FieldMask updateMask) Updates the parameters of a single ClientTlsPolicy.Updates the parameters of a single ClientTlsPolicy.Updates the parameters of a single ClientTlsPolicy.Updates the parameters of a single ClientTlsPolicy.updateGatewaySecurityPolicyAsync(GatewaySecurityPolicy gatewaySecurityPolicy, com.google.protobuf.FieldMask updateMask) Updates the parameters of a single GatewaySecurityPolicy.Updates the parameters of a single GatewaySecurityPolicy.Updates the parameters of a single GatewaySecurityPolicy.Updates the parameters of a single GatewaySecurityPolicy.updateGatewaySecurityPolicyRuleAsync(GatewaySecurityPolicyRule gatewaySecurityPolicyRule, com.google.protobuf.FieldMask updateMask) Updates the parameters of a single GatewaySecurityPolicyRule.Updates the parameters of a single GatewaySecurityPolicyRule.Updates the parameters of a single GatewaySecurityPolicyRule.final OperationCallable<UpdateGatewaySecurityPolicyRuleRequest,GatewaySecurityPolicyRule, OperationMetadata> Updates the parameters of a single GatewaySecurityPolicyRule.updateServerTlsPolicyAsync(ServerTlsPolicy serverTlsPolicy, com.google.protobuf.FieldMask updateMask) Updates the parameters of a single ServerTlsPolicy.Updates the parameters of a single ServerTlsPolicy.Updates the parameters of a single ServerTlsPolicy.Updates the parameters of a single ServerTlsPolicy.updateTlsInspectionPolicyAsync(TlsInspectionPolicy tlsInspectionPolicy, com.google.protobuf.FieldMask updateMask) Updates the parameters of a single TlsInspectionPolicy.Updates the parameters of a single TlsInspectionPolicy.Updates the parameters of a single TlsInspectionPolicy.Updates the parameters of a single TlsInspectionPolicy.updateUrlListAsync(UpdateUrlListRequest request) Updates the parameters of a single UrlList.updateUrlListAsync(UrlList urlList, com.google.protobuf.FieldMask updateMask) Updates the parameters of a single UrlList.Updates the parameters of a single UrlList.Updates the parameters of a single UrlList.
-
Constructor Details
-
NetworkSecurityClient
Constructs an instance of NetworkSecurityClient, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.- Throws:
IOException
-
NetworkSecurityClient
-
-
Method Details
-
create
Constructs an instance of NetworkSecurityClient with default settings.- Throws:
IOException
-
create
public static final NetworkSecurityClient create(NetworkSecuritySettings settings) throws IOException Constructs an instance of NetworkSecurityClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.- Throws:
IOException
-
create
Constructs an instance of NetworkSecurityClient, using the given stub for making calls. This is for advanced usage - prefer using create(NetworkSecuritySettings). -
getSettings
-
getStub
-
getOperationsClient
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call. -
listAuthorizationPolicies
public final NetworkSecurityClient.ListAuthorizationPoliciesPagedResponse listAuthorizationPolicies(LocationName parent) Lists AuthorizationPolicies in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); for (AuthorizationPolicy element : networkSecurityClient.listAuthorizationPolicies(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The project and location from which the AuthorizationPolicies should be listed, specified in the format `projects/{project}/locations/{location}`.- Throws:
ApiException- if the remote call fails
-
listAuthorizationPolicies
public final NetworkSecurityClient.ListAuthorizationPoliciesPagedResponse listAuthorizationPolicies(String parent) Lists AuthorizationPolicies in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); for (AuthorizationPolicy element : networkSecurityClient.listAuthorizationPolicies(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The project and location from which the AuthorizationPolicies should be listed, specified in the format `projects/{project}/locations/{location}`.- Throws:
ApiException- if the remote call fails
-
listAuthorizationPolicies
public final NetworkSecurityClient.ListAuthorizationPoliciesPagedResponse listAuthorizationPolicies(ListAuthorizationPoliciesRequest request) Lists AuthorizationPolicies in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { ListAuthorizationPoliciesRequest request = ListAuthorizationPoliciesRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (AuthorizationPolicy element : networkSecurityClient.listAuthorizationPolicies(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listAuthorizationPoliciesPagedCallable
public final UnaryCallable<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_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { ListAuthorizationPoliciesRequest request = ListAuthorizationPoliciesRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<AuthorizationPolicy> future = networkSecurityClient.listAuthorizationPoliciesPagedCallable().futureCall(request); // Do something. for (AuthorizationPolicy element : future.get().iterateAll()) { // doThingsWith(element); } } -
listAuthorizationPoliciesCallable
public final UnaryCallable<ListAuthorizationPoliciesRequest,ListAuthorizationPoliciesResponse> listAuthorizationPoliciesCallable()Lists AuthorizationPolicies in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { ListAuthorizationPoliciesRequest request = ListAuthorizationPoliciesRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListAuthorizationPoliciesResponse response = networkSecurityClient.listAuthorizationPoliciesCallable().call(request); for (AuthorizationPolicy element : response.getAuthorizationPoliciesList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
getAuthorizationPolicy
Gets details of a single AuthorizationPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { AuthorizationPolicyName name = AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]"); AuthorizationPolicy response = networkSecurityClient.getAuthorizationPolicy(name); }- Parameters:
name- Required. A name of the AuthorizationPolicy to get. Must be in the format `projects/{project}/locations/{location}/authorizationPolicies/*`.- Throws:
ApiException- if the remote call fails
-
getAuthorizationPolicy
Gets details of a single AuthorizationPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { String name = AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]") .toString(); AuthorizationPolicy response = networkSecurityClient.getAuthorizationPolicy(name); }- Parameters:
name- Required. A name of the AuthorizationPolicy to get. Must be in the format `projects/{project}/locations/{location}/authorizationPolicies/*`.- Throws:
ApiException- if the remote call fails
-
getAuthorizationPolicy
Gets details of a single AuthorizationPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { GetAuthorizationPolicyRequest request = GetAuthorizationPolicyRequest.newBuilder() .setName( AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]") .toString()) .build(); AuthorizationPolicy response = networkSecurityClient.getAuthorizationPolicy(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getAuthorizationPolicyCallable
public final UnaryCallable<GetAuthorizationPolicyRequest,AuthorizationPolicy> getAuthorizationPolicyCallable()Gets details of a single AuthorizationPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { GetAuthorizationPolicyRequest request = GetAuthorizationPolicyRequest.newBuilder() .setName( AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]") .toString()) .build(); ApiFuture<AuthorizationPolicy> future = networkSecurityClient.getAuthorizationPolicyCallable().futureCall(request); // Do something. AuthorizationPolicy response = future.get(); } -
createAuthorizationPolicyAsync
public final OperationFuture<AuthorizationPolicy,OperationMetadata> createAuthorizationPolicyAsync(LocationName parent, AuthorizationPolicy authorizationPolicy, String authorizationPolicyId) Creates a new AuthorizationPolicy in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); AuthorizationPolicy authorizationPolicy = AuthorizationPolicy.newBuilder().build(); String authorizationPolicyId = "authorizationPolicyId1314252166"; AuthorizationPolicy response = networkSecurityClient .createAuthorizationPolicyAsync(parent, authorizationPolicy, authorizationPolicyId) .get(); }- Parameters:
parent- Required. The parent resource of the AuthorizationPolicy. Must be in the format `projects/{project}/locations/{location}`.authorizationPolicy- Required. AuthorizationPolicy resource to be created.authorizationPolicyId- Required. Short name of the AuthorizationPolicy resource to be created. This value should be 1-63 characters long, containing only letters, numbers, hyphens, and underscores, and should not start with a number. E.g. "authz_policy".- Throws:
ApiException- if the remote call fails
-
createAuthorizationPolicyAsync
public final OperationFuture<AuthorizationPolicy,OperationMetadata> createAuthorizationPolicyAsync(String parent, AuthorizationPolicy authorizationPolicy, String authorizationPolicyId) Creates a new AuthorizationPolicy in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); AuthorizationPolicy authorizationPolicy = AuthorizationPolicy.newBuilder().build(); String authorizationPolicyId = "authorizationPolicyId1314252166"; AuthorizationPolicy response = networkSecurityClient .createAuthorizationPolicyAsync(parent, authorizationPolicy, authorizationPolicyId) .get(); }- Parameters:
parent- Required. The parent resource of the AuthorizationPolicy. Must be in the format `projects/{project}/locations/{location}`.authorizationPolicy- Required. AuthorizationPolicy resource to be created.authorizationPolicyId- Required. Short name of the AuthorizationPolicy resource to be created. This value should be 1-63 characters long, containing only letters, numbers, hyphens, and underscores, and should not start with a number. E.g. "authz_policy".- Throws:
ApiException- if the remote call fails
-
createAuthorizationPolicyAsync
public final OperationFuture<AuthorizationPolicy,OperationMetadata> createAuthorizationPolicyAsync(CreateAuthorizationPolicyRequest request) Creates a new AuthorizationPolicy in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { CreateAuthorizationPolicyRequest request = CreateAuthorizationPolicyRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setAuthorizationPolicyId("authorizationPolicyId1314252166") .setAuthorizationPolicy(AuthorizationPolicy.newBuilder().build()) .build(); AuthorizationPolicy response = networkSecurityClient.createAuthorizationPolicyAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createAuthorizationPolicyOperationCallable
public final OperationCallable<CreateAuthorizationPolicyRequest,AuthorizationPolicy, createAuthorizationPolicyOperationCallable()OperationMetadata> Creates a new AuthorizationPolicy in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { CreateAuthorizationPolicyRequest request = CreateAuthorizationPolicyRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setAuthorizationPolicyId("authorizationPolicyId1314252166") .setAuthorizationPolicy(AuthorizationPolicy.newBuilder().build()) .build(); OperationFuture<AuthorizationPolicy, OperationMetadata> future = networkSecurityClient.createAuthorizationPolicyOperationCallable().futureCall(request); // Do something. AuthorizationPolicy response = future.get(); } -
createAuthorizationPolicyCallable
public final UnaryCallable<CreateAuthorizationPolicyRequest,Operation> createAuthorizationPolicyCallable()Creates a new AuthorizationPolicy in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { CreateAuthorizationPolicyRequest request = CreateAuthorizationPolicyRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setAuthorizationPolicyId("authorizationPolicyId1314252166") .setAuthorizationPolicy(AuthorizationPolicy.newBuilder().build()) .build(); ApiFuture<Operation> future = networkSecurityClient.createAuthorizationPolicyCallable().futureCall(request); // Do something. Operation response = future.get(); } -
updateAuthorizationPolicyAsync
public final OperationFuture<AuthorizationPolicy,OperationMetadata> updateAuthorizationPolicyAsync(AuthorizationPolicy authorizationPolicy, com.google.protobuf.FieldMask updateMask) Updates the parameters of a single AuthorizationPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { AuthorizationPolicy authorizationPolicy = AuthorizationPolicy.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); AuthorizationPolicy response = networkSecurityClient .updateAuthorizationPolicyAsync(authorizationPolicy, updateMask) .get(); }- Parameters:
authorizationPolicy- Required. Updated AuthorizationPolicy resource.updateMask- Optional. Field mask is used to specify the fields to be overwritten in the AuthorizationPolicy resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten.- Throws:
ApiException- if the remote call fails
-
updateAuthorizationPolicyAsync
public final OperationFuture<AuthorizationPolicy,OperationMetadata> updateAuthorizationPolicyAsync(UpdateAuthorizationPolicyRequest request) Updates the parameters of a single AuthorizationPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { UpdateAuthorizationPolicyRequest request = UpdateAuthorizationPolicyRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setAuthorizationPolicy(AuthorizationPolicy.newBuilder().build()) .build(); AuthorizationPolicy response = networkSecurityClient.updateAuthorizationPolicyAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateAuthorizationPolicyOperationCallable
public final OperationCallable<UpdateAuthorizationPolicyRequest,AuthorizationPolicy, updateAuthorizationPolicyOperationCallable()OperationMetadata> Updates the parameters of a single AuthorizationPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { UpdateAuthorizationPolicyRequest request = UpdateAuthorizationPolicyRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setAuthorizationPolicy(AuthorizationPolicy.newBuilder().build()) .build(); OperationFuture<AuthorizationPolicy, OperationMetadata> future = networkSecurityClient.updateAuthorizationPolicyOperationCallable().futureCall(request); // Do something. AuthorizationPolicy response = future.get(); } -
updateAuthorizationPolicyCallable
public final UnaryCallable<UpdateAuthorizationPolicyRequest,Operation> updateAuthorizationPolicyCallable()Updates the parameters of a single AuthorizationPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { UpdateAuthorizationPolicyRequest request = UpdateAuthorizationPolicyRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setAuthorizationPolicy(AuthorizationPolicy.newBuilder().build()) .build(); ApiFuture<Operation> future = networkSecurityClient.updateAuthorizationPolicyCallable().futureCall(request); // Do something. Operation response = future.get(); } -
deleteAuthorizationPolicyAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteAuthorizationPolicyAsync(AuthorizationPolicyName name) Deletes a single AuthorizationPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { AuthorizationPolicyName name = AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]"); networkSecurityClient.deleteAuthorizationPolicyAsync(name).get(); }- Parameters:
name- Required. A name of the AuthorizationPolicy to delete. Must be in the format `projects/{project}/locations/{location}/authorizationPolicies/*`.- Throws:
ApiException- if the remote call fails
-
deleteAuthorizationPolicyAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteAuthorizationPolicyAsync(String name) Deletes a single AuthorizationPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { String name = AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]") .toString(); networkSecurityClient.deleteAuthorizationPolicyAsync(name).get(); }- Parameters:
name- Required. A name of the AuthorizationPolicy to delete. Must be in the format `projects/{project}/locations/{location}/authorizationPolicies/*`.- Throws:
ApiException- if the remote call fails
-
deleteAuthorizationPolicyAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteAuthorizationPolicyAsync(DeleteAuthorizationPolicyRequest request) Deletes a single AuthorizationPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { DeleteAuthorizationPolicyRequest request = DeleteAuthorizationPolicyRequest.newBuilder() .setName( AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]") .toString()) .build(); networkSecurityClient.deleteAuthorizationPolicyAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteAuthorizationPolicyOperationCallable
public final OperationCallable<DeleteAuthorizationPolicyRequest,com.google.protobuf.Empty, deleteAuthorizationPolicyOperationCallable()OperationMetadata> Deletes a single AuthorizationPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { DeleteAuthorizationPolicyRequest request = DeleteAuthorizationPolicyRequest.newBuilder() .setName( AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]") .toString()) .build(); OperationFuture<Empty, OperationMetadata> future = networkSecurityClient.deleteAuthorizationPolicyOperationCallable().futureCall(request); // Do something. future.get(); } -
deleteAuthorizationPolicyCallable
public final UnaryCallable<DeleteAuthorizationPolicyRequest,Operation> deleteAuthorizationPolicyCallable()Deletes a single AuthorizationPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { DeleteAuthorizationPolicyRequest request = DeleteAuthorizationPolicyRequest.newBuilder() .setName( AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]") .toString()) .build(); ApiFuture<Operation> future = networkSecurityClient.deleteAuthorizationPolicyCallable().futureCall(request); // Do something. future.get(); } -
listBackendAuthenticationConfigs
public final NetworkSecurityClient.ListBackendAuthenticationConfigsPagedResponse listBackendAuthenticationConfigs(LocationName parent) Lists BackendAuthenticationConfigs in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); for (BackendAuthenticationConfig element : networkSecurityClient.listBackendAuthenticationConfigs(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The project and location from which the BackendAuthenticationConfigs should be listed, specified in the format `projects/*/locations/{location}`.- Throws:
ApiException- if the remote call fails
-
listBackendAuthenticationConfigs
public final NetworkSecurityClient.ListBackendAuthenticationConfigsPagedResponse listBackendAuthenticationConfigs(String parent) Lists BackendAuthenticationConfigs in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); for (BackendAuthenticationConfig element : networkSecurityClient.listBackendAuthenticationConfigs(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The project and location from which the BackendAuthenticationConfigs should be listed, specified in the format `projects/*/locations/{location}`.- Throws:
ApiException- if the remote call fails
-
listBackendAuthenticationConfigs
public final NetworkSecurityClient.ListBackendAuthenticationConfigsPagedResponse listBackendAuthenticationConfigs(ListBackendAuthenticationConfigsRequest request) Lists BackendAuthenticationConfigs in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { ListBackendAuthenticationConfigsRequest request = ListBackendAuthenticationConfigsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (BackendAuthenticationConfig element : networkSecurityClient.listBackendAuthenticationConfigs(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listBackendAuthenticationConfigsPagedCallable
public final UnaryCallable<ListBackendAuthenticationConfigsRequest,NetworkSecurityClient.ListBackendAuthenticationConfigsPagedResponse> listBackendAuthenticationConfigsPagedCallable()Lists BackendAuthenticationConfigs in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { ListBackendAuthenticationConfigsRequest request = ListBackendAuthenticationConfigsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<BackendAuthenticationConfig> future = networkSecurityClient.listBackendAuthenticationConfigsPagedCallable().futureCall(request); // Do something. for (BackendAuthenticationConfig element : future.get().iterateAll()) { // doThingsWith(element); } } -
listBackendAuthenticationConfigsCallable
public final UnaryCallable<ListBackendAuthenticationConfigsRequest,ListBackendAuthenticationConfigsResponse> listBackendAuthenticationConfigsCallable()Lists BackendAuthenticationConfigs in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { ListBackendAuthenticationConfigsRequest request = ListBackendAuthenticationConfigsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListBackendAuthenticationConfigsResponse response = networkSecurityClient.listBackendAuthenticationConfigsCallable().call(request); for (BackendAuthenticationConfig element : response.getBackendAuthenticationConfigsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
getBackendAuthenticationConfig
public final BackendAuthenticationConfig getBackendAuthenticationConfig(BackendAuthenticationConfigName name) Gets details of a single BackendAuthenticationConfig to BackendAuthenticationConfig.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { BackendAuthenticationConfigName name = BackendAuthenticationConfigName.of( "[PROJECT]", "[LOCATION]", "[BACKEND_AUTHENTICATION_CONFIG]"); BackendAuthenticationConfig response = networkSecurityClient.getBackendAuthenticationConfig(name); }- Parameters:
name- Required. A name of the BackendAuthenticationConfig to get. Must be in the format `projects/*/locations/{location}/backendAuthenticationConfigs/*`.- Throws:
ApiException- if the remote call fails
-
getBackendAuthenticationConfig
Gets details of a single BackendAuthenticationConfig to BackendAuthenticationConfig.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { String name = BackendAuthenticationConfigName.of( "[PROJECT]", "[LOCATION]", "[BACKEND_AUTHENTICATION_CONFIG]") .toString(); BackendAuthenticationConfig response = networkSecurityClient.getBackendAuthenticationConfig(name); }- Parameters:
name- Required. A name of the BackendAuthenticationConfig to get. Must be in the format `projects/*/locations/{location}/backendAuthenticationConfigs/*`.- Throws:
ApiException- if the remote call fails
-
getBackendAuthenticationConfig
public final BackendAuthenticationConfig getBackendAuthenticationConfig(GetBackendAuthenticationConfigRequest request) Gets details of a single BackendAuthenticationConfig to BackendAuthenticationConfig.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { GetBackendAuthenticationConfigRequest request = GetBackendAuthenticationConfigRequest.newBuilder() .setName( BackendAuthenticationConfigName.of( "[PROJECT]", "[LOCATION]", "[BACKEND_AUTHENTICATION_CONFIG]") .toString()) .build(); BackendAuthenticationConfig response = networkSecurityClient.getBackendAuthenticationConfig(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getBackendAuthenticationConfigCallable
public final UnaryCallable<GetBackendAuthenticationConfigRequest,BackendAuthenticationConfig> getBackendAuthenticationConfigCallable()Gets details of a single BackendAuthenticationConfig to BackendAuthenticationConfig.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { GetBackendAuthenticationConfigRequest request = GetBackendAuthenticationConfigRequest.newBuilder() .setName( BackendAuthenticationConfigName.of( "[PROJECT]", "[LOCATION]", "[BACKEND_AUTHENTICATION_CONFIG]") .toString()) .build(); ApiFuture<BackendAuthenticationConfig> future = networkSecurityClient.getBackendAuthenticationConfigCallable().futureCall(request); // Do something. BackendAuthenticationConfig response = future.get(); } -
createBackendAuthenticationConfigAsync
public final OperationFuture<BackendAuthenticationConfig,OperationMetadata> createBackendAuthenticationConfigAsync(LocationName parent, BackendAuthenticationConfig backendAuthenticationConfig, String backendAuthenticationConfigId) Creates a new BackendAuthenticationConfig in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); BackendAuthenticationConfig backendAuthenticationConfig = BackendAuthenticationConfig.newBuilder().build(); String backendAuthenticationConfigId = "backendAuthenticationConfigId-396698039"; BackendAuthenticationConfig response = networkSecurityClient .createBackendAuthenticationConfigAsync( parent, backendAuthenticationConfig, backendAuthenticationConfigId) .get(); }- Parameters:
parent- Required. The parent resource of the BackendAuthenticationConfig. Must be in the format `projects/*/locations/{location}`.backendAuthenticationConfig- Required. BackendAuthenticationConfig resource to be created.backendAuthenticationConfigId- Required. Short name of the BackendAuthenticationConfig resource to be created. This value should be 1-63 characters long, containing only letters, numbers, hyphens, and underscores, and should not start with a number. E.g. "backend-auth-config".- Throws:
ApiException- if the remote call fails
-
createBackendAuthenticationConfigAsync
public final OperationFuture<BackendAuthenticationConfig,OperationMetadata> createBackendAuthenticationConfigAsync(String parent, BackendAuthenticationConfig backendAuthenticationConfig, String backendAuthenticationConfigId) Creates a new BackendAuthenticationConfig in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); BackendAuthenticationConfig backendAuthenticationConfig = BackendAuthenticationConfig.newBuilder().build(); String backendAuthenticationConfigId = "backendAuthenticationConfigId-396698039"; BackendAuthenticationConfig response = networkSecurityClient .createBackendAuthenticationConfigAsync( parent, backendAuthenticationConfig, backendAuthenticationConfigId) .get(); }- Parameters:
parent- Required. The parent resource of the BackendAuthenticationConfig. Must be in the format `projects/*/locations/{location}`.backendAuthenticationConfig- Required. BackendAuthenticationConfig resource to be created.backendAuthenticationConfigId- Required. Short name of the BackendAuthenticationConfig resource to be created. This value should be 1-63 characters long, containing only letters, numbers, hyphens, and underscores, and should not start with a number. E.g. "backend-auth-config".- Throws:
ApiException- if the remote call fails
-
createBackendAuthenticationConfigAsync
public final OperationFuture<BackendAuthenticationConfig,OperationMetadata> createBackendAuthenticationConfigAsync(CreateBackendAuthenticationConfigRequest request) Creates a new BackendAuthenticationConfig in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { CreateBackendAuthenticationConfigRequest request = CreateBackendAuthenticationConfigRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setBackendAuthenticationConfigId("backendAuthenticationConfigId-396698039") .setBackendAuthenticationConfig(BackendAuthenticationConfig.newBuilder().build()) .build(); BackendAuthenticationConfig response = networkSecurityClient.createBackendAuthenticationConfigAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createBackendAuthenticationConfigOperationCallable
public final OperationCallable<CreateBackendAuthenticationConfigRequest,BackendAuthenticationConfig, createBackendAuthenticationConfigOperationCallable()OperationMetadata> Creates a new BackendAuthenticationConfig in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { CreateBackendAuthenticationConfigRequest request = CreateBackendAuthenticationConfigRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setBackendAuthenticationConfigId("backendAuthenticationConfigId-396698039") .setBackendAuthenticationConfig(BackendAuthenticationConfig.newBuilder().build()) .build(); OperationFuture<BackendAuthenticationConfig, OperationMetadata> future = networkSecurityClient .createBackendAuthenticationConfigOperationCallable() .futureCall(request); // Do something. BackendAuthenticationConfig response = future.get(); } -
createBackendAuthenticationConfigCallable
public final UnaryCallable<CreateBackendAuthenticationConfigRequest,Operation> createBackendAuthenticationConfigCallable()Creates a new BackendAuthenticationConfig in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { CreateBackendAuthenticationConfigRequest request = CreateBackendAuthenticationConfigRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setBackendAuthenticationConfigId("backendAuthenticationConfigId-396698039") .setBackendAuthenticationConfig(BackendAuthenticationConfig.newBuilder().build()) .build(); ApiFuture<Operation> future = networkSecurityClient.createBackendAuthenticationConfigCallable().futureCall(request); // Do something. Operation response = future.get(); } -
updateBackendAuthenticationConfigAsync
public final OperationFuture<BackendAuthenticationConfig,OperationMetadata> updateBackendAuthenticationConfigAsync(BackendAuthenticationConfig backendAuthenticationConfig, com.google.protobuf.FieldMask updateMask) Updates the parameters of a single BackendAuthenticationConfig to BackendAuthenticationConfig.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { BackendAuthenticationConfig backendAuthenticationConfig = BackendAuthenticationConfig.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); BackendAuthenticationConfig response = networkSecurityClient .updateBackendAuthenticationConfigAsync(backendAuthenticationConfig, updateMask) .get(); }- Parameters:
backendAuthenticationConfig- Required. Updated BackendAuthenticationConfig resource.updateMask- Optional. Field mask is used to specify the fields to be overwritten in the BackendAuthenticationConfig resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten.- Throws:
ApiException- if the remote call fails
-
updateBackendAuthenticationConfigAsync
public final OperationFuture<BackendAuthenticationConfig,OperationMetadata> updateBackendAuthenticationConfigAsync(UpdateBackendAuthenticationConfigRequest request) Updates the parameters of a single BackendAuthenticationConfig to BackendAuthenticationConfig.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { UpdateBackendAuthenticationConfigRequest request = UpdateBackendAuthenticationConfigRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setBackendAuthenticationConfig(BackendAuthenticationConfig.newBuilder().build()) .build(); BackendAuthenticationConfig response = networkSecurityClient.updateBackendAuthenticationConfigAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateBackendAuthenticationConfigOperationCallable
public final OperationCallable<UpdateBackendAuthenticationConfigRequest,BackendAuthenticationConfig, updateBackendAuthenticationConfigOperationCallable()OperationMetadata> Updates the parameters of a single BackendAuthenticationConfig to BackendAuthenticationConfig.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { UpdateBackendAuthenticationConfigRequest request = UpdateBackendAuthenticationConfigRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setBackendAuthenticationConfig(BackendAuthenticationConfig.newBuilder().build()) .build(); OperationFuture<BackendAuthenticationConfig, OperationMetadata> future = networkSecurityClient .updateBackendAuthenticationConfigOperationCallable() .futureCall(request); // Do something. BackendAuthenticationConfig response = future.get(); } -
updateBackendAuthenticationConfigCallable
public final UnaryCallable<UpdateBackendAuthenticationConfigRequest,Operation> updateBackendAuthenticationConfigCallable()Updates the parameters of a single BackendAuthenticationConfig to BackendAuthenticationConfig.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { UpdateBackendAuthenticationConfigRequest request = UpdateBackendAuthenticationConfigRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setBackendAuthenticationConfig(BackendAuthenticationConfig.newBuilder().build()) .build(); ApiFuture<Operation> future = networkSecurityClient.updateBackendAuthenticationConfigCallable().futureCall(request); // Do something. Operation response = future.get(); } -
deleteBackendAuthenticationConfigAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteBackendAuthenticationConfigAsync(BackendAuthenticationConfigName name) Deletes a single BackendAuthenticationConfig to BackendAuthenticationConfig.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { BackendAuthenticationConfigName name = BackendAuthenticationConfigName.of( "[PROJECT]", "[LOCATION]", "[BACKEND_AUTHENTICATION_CONFIG]"); networkSecurityClient.deleteBackendAuthenticationConfigAsync(name).get(); }- Parameters:
name- Required. A name of the BackendAuthenticationConfig to delete. Must be in the format `projects/*/locations/{location}/backendAuthenticationConfigs/*`.- Throws:
ApiException- if the remote call fails
-
deleteBackendAuthenticationConfigAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteBackendAuthenticationConfigAsync(String name) Deletes a single BackendAuthenticationConfig to BackendAuthenticationConfig.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { String name = BackendAuthenticationConfigName.of( "[PROJECT]", "[LOCATION]", "[BACKEND_AUTHENTICATION_CONFIG]") .toString(); networkSecurityClient.deleteBackendAuthenticationConfigAsync(name).get(); }- Parameters:
name- Required. A name of the BackendAuthenticationConfig to delete. Must be in the format `projects/*/locations/{location}/backendAuthenticationConfigs/*`.- Throws:
ApiException- if the remote call fails
-
deleteBackendAuthenticationConfigAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteBackendAuthenticationConfigAsync(DeleteBackendAuthenticationConfigRequest request) Deletes a single BackendAuthenticationConfig to BackendAuthenticationConfig.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { DeleteBackendAuthenticationConfigRequest request = DeleteBackendAuthenticationConfigRequest.newBuilder() .setName( BackendAuthenticationConfigName.of( "[PROJECT]", "[LOCATION]", "[BACKEND_AUTHENTICATION_CONFIG]") .toString()) .setEtag("etag3123477") .build(); networkSecurityClient.deleteBackendAuthenticationConfigAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteBackendAuthenticationConfigOperationCallable
public final OperationCallable<DeleteBackendAuthenticationConfigRequest,com.google.protobuf.Empty, deleteBackendAuthenticationConfigOperationCallable()OperationMetadata> Deletes a single BackendAuthenticationConfig to BackendAuthenticationConfig.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { DeleteBackendAuthenticationConfigRequest request = DeleteBackendAuthenticationConfigRequest.newBuilder() .setName( BackendAuthenticationConfigName.of( "[PROJECT]", "[LOCATION]", "[BACKEND_AUTHENTICATION_CONFIG]") .toString()) .setEtag("etag3123477") .build(); OperationFuture<Empty, OperationMetadata> future = networkSecurityClient .deleteBackendAuthenticationConfigOperationCallable() .futureCall(request); // Do something. future.get(); } -
deleteBackendAuthenticationConfigCallable
public final UnaryCallable<DeleteBackendAuthenticationConfigRequest,Operation> deleteBackendAuthenticationConfigCallable()Deletes a single BackendAuthenticationConfig to BackendAuthenticationConfig.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { DeleteBackendAuthenticationConfigRequest request = DeleteBackendAuthenticationConfigRequest.newBuilder() .setName( BackendAuthenticationConfigName.of( "[PROJECT]", "[LOCATION]", "[BACKEND_AUTHENTICATION_CONFIG]") .toString()) .setEtag("etag3123477") .build(); ApiFuture<Operation> future = networkSecurityClient.deleteBackendAuthenticationConfigCallable().futureCall(request); // Do something. future.get(); } -
listServerTlsPolicies
public final NetworkSecurityClient.ListServerTlsPoliciesPagedResponse listServerTlsPolicies(LocationName parent) Lists ServerTlsPolicies in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); for (ServerTlsPolicy element : networkSecurityClient.listServerTlsPolicies(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The project and location from which the ServerTlsPolicies should be listed, specified in the format `projects/*/locations/{location}`.- Throws:
ApiException- if the remote call fails
-
listServerTlsPolicies
public final NetworkSecurityClient.ListServerTlsPoliciesPagedResponse listServerTlsPolicies(String parent) Lists ServerTlsPolicies in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); for (ServerTlsPolicy element : networkSecurityClient.listServerTlsPolicies(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The project and location from which the ServerTlsPolicies should be listed, specified in the format `projects/*/locations/{location}`.- Throws:
ApiException- if the remote call fails
-
listServerTlsPolicies
public final NetworkSecurityClient.ListServerTlsPoliciesPagedResponse listServerTlsPolicies(ListServerTlsPoliciesRequest request) Lists ServerTlsPolicies in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { ListServerTlsPoliciesRequest request = ListServerTlsPoliciesRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setReturnPartialSuccess(true) .build(); for (ServerTlsPolicy element : networkSecurityClient.listServerTlsPolicies(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listServerTlsPoliciesPagedCallable
public final UnaryCallable<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_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { ListServerTlsPoliciesRequest request = ListServerTlsPoliciesRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setReturnPartialSuccess(true) .build(); ApiFuture<ServerTlsPolicy> future = networkSecurityClient.listServerTlsPoliciesPagedCallable().futureCall(request); // Do something. for (ServerTlsPolicy element : future.get().iterateAll()) { // doThingsWith(element); } } -
listServerTlsPoliciesCallable
public final UnaryCallable<ListServerTlsPoliciesRequest,ListServerTlsPoliciesResponse> listServerTlsPoliciesCallable()Lists ServerTlsPolicies in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { ListServerTlsPoliciesRequest request = ListServerTlsPoliciesRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setReturnPartialSuccess(true) .build(); while (true) { ListServerTlsPoliciesResponse response = networkSecurityClient.listServerTlsPoliciesCallable().call(request); for (ServerTlsPolicy element : response.getServerTlsPoliciesList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
getServerTlsPolicy
Gets details of a single ServerTlsPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { ServerTlsPolicyName name = ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]"); ServerTlsPolicy response = networkSecurityClient.getServerTlsPolicy(name); }- Parameters:
name- Required. A name of the ServerTlsPolicy to get. Must be in the format `projects/*/locations/{location}/serverTlsPolicies/*`.- Throws:
ApiException- if the remote call fails
-
getServerTlsPolicy
Gets details of a single ServerTlsPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { String name = ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]").toString(); ServerTlsPolicy response = networkSecurityClient.getServerTlsPolicy(name); }- Parameters:
name- Required. A name of the ServerTlsPolicy to get. Must be in the format `projects/*/locations/{location}/serverTlsPolicies/*`.- Throws:
ApiException- if the remote call fails
-
getServerTlsPolicy
Gets details of a single ServerTlsPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { GetServerTlsPolicyRequest request = GetServerTlsPolicyRequest.newBuilder() .setName( ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]") .toString()) .build(); ServerTlsPolicy response = networkSecurityClient.getServerTlsPolicy(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getServerTlsPolicyCallable
Gets details of a single ServerTlsPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { GetServerTlsPolicyRequest request = GetServerTlsPolicyRequest.newBuilder() .setName( ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]") .toString()) .build(); ApiFuture<ServerTlsPolicy> future = networkSecurityClient.getServerTlsPolicyCallable().futureCall(request); // Do something. ServerTlsPolicy response = future.get(); } -
createServerTlsPolicyAsync
public final OperationFuture<ServerTlsPolicy,OperationMetadata> createServerTlsPolicyAsync(LocationName parent, ServerTlsPolicy serverTlsPolicy, String serverTlsPolicyId) Creates a new ServerTlsPolicy in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); ServerTlsPolicy serverTlsPolicy = ServerTlsPolicy.newBuilder().build(); String serverTlsPolicyId = "serverTlsPolicyId-1966046011"; ServerTlsPolicy response = networkSecurityClient .createServerTlsPolicyAsync(parent, serverTlsPolicy, serverTlsPolicyId) .get(); }- Parameters:
parent- Required. The parent resource of the ServerTlsPolicy. Must be in the format `projects/*/locations/{location}`.serverTlsPolicy- Required. ServerTlsPolicy resource to be created.serverTlsPolicyId- Required. Short name of the ServerTlsPolicy resource to be created. This value should be 1-63 characters long, containing only letters, numbers, hyphens, and underscores, and should not start with a number. E.g. "server_mtls_policy".- Throws:
ApiException- if the remote call fails
-
createServerTlsPolicyAsync
public final OperationFuture<ServerTlsPolicy,OperationMetadata> createServerTlsPolicyAsync(String parent, ServerTlsPolicy serverTlsPolicy, String serverTlsPolicyId) Creates a new ServerTlsPolicy in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); ServerTlsPolicy serverTlsPolicy = ServerTlsPolicy.newBuilder().build(); String serverTlsPolicyId = "serverTlsPolicyId-1966046011"; ServerTlsPolicy response = networkSecurityClient .createServerTlsPolicyAsync(parent, serverTlsPolicy, serverTlsPolicyId) .get(); }- Parameters:
parent- Required. The parent resource of the ServerTlsPolicy. Must be in the format `projects/*/locations/{location}`.serverTlsPolicy- Required. ServerTlsPolicy resource to be created.serverTlsPolicyId- Required. Short name of the ServerTlsPolicy resource to be created. This value should be 1-63 characters long, containing only letters, numbers, hyphens, and underscores, and should not start with a number. E.g. "server_mtls_policy".- Throws:
ApiException- if the remote call fails
-
createServerTlsPolicyAsync
public final OperationFuture<ServerTlsPolicy,OperationMetadata> createServerTlsPolicyAsync(CreateServerTlsPolicyRequest request) Creates a new ServerTlsPolicy in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { CreateServerTlsPolicyRequest request = CreateServerTlsPolicyRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setServerTlsPolicyId("serverTlsPolicyId-1966046011") .setServerTlsPolicy(ServerTlsPolicy.newBuilder().build()) .build(); ServerTlsPolicy response = networkSecurityClient.createServerTlsPolicyAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createServerTlsPolicyOperationCallable
public final OperationCallable<CreateServerTlsPolicyRequest,ServerTlsPolicy, createServerTlsPolicyOperationCallable()OperationMetadata> Creates a new ServerTlsPolicy in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { CreateServerTlsPolicyRequest request = CreateServerTlsPolicyRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setServerTlsPolicyId("serverTlsPolicyId-1966046011") .setServerTlsPolicy(ServerTlsPolicy.newBuilder().build()) .build(); OperationFuture<ServerTlsPolicy, OperationMetadata> future = networkSecurityClient.createServerTlsPolicyOperationCallable().futureCall(request); // Do something. ServerTlsPolicy response = future.get(); } -
createServerTlsPolicyCallable
Creates a new ServerTlsPolicy in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { CreateServerTlsPolicyRequest request = CreateServerTlsPolicyRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setServerTlsPolicyId("serverTlsPolicyId-1966046011") .setServerTlsPolicy(ServerTlsPolicy.newBuilder().build()) .build(); ApiFuture<Operation> future = networkSecurityClient.createServerTlsPolicyCallable().futureCall(request); // Do something. Operation response = future.get(); } -
updateServerTlsPolicyAsync
public final OperationFuture<ServerTlsPolicy,OperationMetadata> updateServerTlsPolicyAsync(ServerTlsPolicy serverTlsPolicy, com.google.protobuf.FieldMask updateMask) Updates the parameters of a single ServerTlsPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { ServerTlsPolicy serverTlsPolicy = ServerTlsPolicy.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); ServerTlsPolicy response = networkSecurityClient.updateServerTlsPolicyAsync(serverTlsPolicy, updateMask).get(); }- Parameters:
serverTlsPolicy- Required. Updated ServerTlsPolicy resource.updateMask- Optional. Field mask is used to specify the fields to be overwritten in the ServerTlsPolicy resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten.- Throws:
ApiException- if the remote call fails
-
updateServerTlsPolicyAsync
public final OperationFuture<ServerTlsPolicy,OperationMetadata> updateServerTlsPolicyAsync(UpdateServerTlsPolicyRequest request) Updates the parameters of a single ServerTlsPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { UpdateServerTlsPolicyRequest request = UpdateServerTlsPolicyRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setServerTlsPolicy(ServerTlsPolicy.newBuilder().build()) .build(); ServerTlsPolicy response = networkSecurityClient.updateServerTlsPolicyAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateServerTlsPolicyOperationCallable
public final OperationCallable<UpdateServerTlsPolicyRequest,ServerTlsPolicy, updateServerTlsPolicyOperationCallable()OperationMetadata> Updates the parameters of a single ServerTlsPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { UpdateServerTlsPolicyRequest request = UpdateServerTlsPolicyRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setServerTlsPolicy(ServerTlsPolicy.newBuilder().build()) .build(); OperationFuture<ServerTlsPolicy, OperationMetadata> future = networkSecurityClient.updateServerTlsPolicyOperationCallable().futureCall(request); // Do something. ServerTlsPolicy response = future.get(); } -
updateServerTlsPolicyCallable
Updates the parameters of a single ServerTlsPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { UpdateServerTlsPolicyRequest request = UpdateServerTlsPolicyRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setServerTlsPolicy(ServerTlsPolicy.newBuilder().build()) .build(); ApiFuture<Operation> future = networkSecurityClient.updateServerTlsPolicyCallable().futureCall(request); // Do something. Operation response = future.get(); } -
deleteServerTlsPolicyAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteServerTlsPolicyAsync(ServerTlsPolicyName name) Deletes a single ServerTlsPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { ServerTlsPolicyName name = ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]"); networkSecurityClient.deleteServerTlsPolicyAsync(name).get(); }- Parameters:
name- Required. A name of the ServerTlsPolicy to delete. Must be in the format `projects/*/locations/{location}/serverTlsPolicies/*`.- Throws:
ApiException- if the remote call fails
-
deleteServerTlsPolicyAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteServerTlsPolicyAsync(String name) Deletes a single ServerTlsPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { String name = ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]").toString(); networkSecurityClient.deleteServerTlsPolicyAsync(name).get(); }- Parameters:
name- Required. A name of the ServerTlsPolicy to delete. Must be in the format `projects/*/locations/{location}/serverTlsPolicies/*`.- Throws:
ApiException- if the remote call fails
-
deleteServerTlsPolicyAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteServerTlsPolicyAsync(DeleteServerTlsPolicyRequest request) Deletes a single ServerTlsPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { DeleteServerTlsPolicyRequest request = DeleteServerTlsPolicyRequest.newBuilder() .setName( ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]") .toString()) .build(); networkSecurityClient.deleteServerTlsPolicyAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteServerTlsPolicyOperationCallable
public final OperationCallable<DeleteServerTlsPolicyRequest,com.google.protobuf.Empty, deleteServerTlsPolicyOperationCallable()OperationMetadata> Deletes a single ServerTlsPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { DeleteServerTlsPolicyRequest request = DeleteServerTlsPolicyRequest.newBuilder() .setName( ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]") .toString()) .build(); OperationFuture<Empty, OperationMetadata> future = networkSecurityClient.deleteServerTlsPolicyOperationCallable().futureCall(request); // Do something. future.get(); } -
deleteServerTlsPolicyCallable
Deletes a single ServerTlsPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { DeleteServerTlsPolicyRequest request = DeleteServerTlsPolicyRequest.newBuilder() .setName( ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]") .toString()) .build(); ApiFuture<Operation> future = networkSecurityClient.deleteServerTlsPolicyCallable().futureCall(request); // Do something. future.get(); } -
listClientTlsPolicies
public final NetworkSecurityClient.ListClientTlsPoliciesPagedResponse listClientTlsPolicies(LocationName parent) Lists ClientTlsPolicies in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); for (ClientTlsPolicy element : networkSecurityClient.listClientTlsPolicies(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The project and location from which the ClientTlsPolicies should be listed, specified in the format `projects/*/locations/{location}`.- Throws:
ApiException- if the remote call fails
-
listClientTlsPolicies
public final NetworkSecurityClient.ListClientTlsPoliciesPagedResponse listClientTlsPolicies(String parent) Lists ClientTlsPolicies in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); for (ClientTlsPolicy element : networkSecurityClient.listClientTlsPolicies(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The project and location from which the ClientTlsPolicies should be listed, specified in the format `projects/*/locations/{location}`.- Throws:
ApiException- if the remote call fails
-
listClientTlsPolicies
public final NetworkSecurityClient.ListClientTlsPoliciesPagedResponse listClientTlsPolicies(ListClientTlsPoliciesRequest request) Lists ClientTlsPolicies in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { ListClientTlsPoliciesRequest request = ListClientTlsPoliciesRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (ClientTlsPolicy element : networkSecurityClient.listClientTlsPolicies(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listClientTlsPoliciesPagedCallable
public final UnaryCallable<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_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { ListClientTlsPoliciesRequest request = ListClientTlsPoliciesRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<ClientTlsPolicy> future = networkSecurityClient.listClientTlsPoliciesPagedCallable().futureCall(request); // Do something. for (ClientTlsPolicy element : future.get().iterateAll()) { // doThingsWith(element); } } -
listClientTlsPoliciesCallable
public final UnaryCallable<ListClientTlsPoliciesRequest,ListClientTlsPoliciesResponse> listClientTlsPoliciesCallable()Lists ClientTlsPolicies in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { ListClientTlsPoliciesRequest request = ListClientTlsPoliciesRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListClientTlsPoliciesResponse response = networkSecurityClient.listClientTlsPoliciesCallable().call(request); for (ClientTlsPolicy element : response.getClientTlsPoliciesList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
getClientTlsPolicy
Gets details of a single ClientTlsPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { ClientTlsPolicyName name = ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]"); ClientTlsPolicy response = networkSecurityClient.getClientTlsPolicy(name); }- Parameters:
name- Required. A name of the ClientTlsPolicy to get. Must be in the format `projects/*/locations/{location}/clientTlsPolicies/*`.- Throws:
ApiException- if the remote call fails
-
getClientTlsPolicy
Gets details of a single ClientTlsPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { String name = ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]").toString(); ClientTlsPolicy response = networkSecurityClient.getClientTlsPolicy(name); }- Parameters:
name- Required. A name of the ClientTlsPolicy to get. Must be in the format `projects/*/locations/{location}/clientTlsPolicies/*`.- Throws:
ApiException- if the remote call fails
-
getClientTlsPolicy
Gets details of a single ClientTlsPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { GetClientTlsPolicyRequest request = GetClientTlsPolicyRequest.newBuilder() .setName( ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]") .toString()) .build(); ClientTlsPolicy response = networkSecurityClient.getClientTlsPolicy(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getClientTlsPolicyCallable
Gets details of a single ClientTlsPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { GetClientTlsPolicyRequest request = GetClientTlsPolicyRequest.newBuilder() .setName( ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]") .toString()) .build(); ApiFuture<ClientTlsPolicy> future = networkSecurityClient.getClientTlsPolicyCallable().futureCall(request); // Do something. ClientTlsPolicy response = future.get(); } -
createClientTlsPolicyAsync
public final OperationFuture<ClientTlsPolicy,OperationMetadata> createClientTlsPolicyAsync(LocationName parent, ClientTlsPolicy clientTlsPolicy, String clientTlsPolicyId) Creates a new ClientTlsPolicy in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); ClientTlsPolicy clientTlsPolicy = ClientTlsPolicy.newBuilder().build(); String clientTlsPolicyId = "clientTlsPolicyId-188933315"; ClientTlsPolicy response = networkSecurityClient .createClientTlsPolicyAsync(parent, clientTlsPolicy, clientTlsPolicyId) .get(); }- Parameters:
parent- Required. The parent resource of the ClientTlsPolicy. Must be in the format `projects/*/locations/{location}`.clientTlsPolicy- Required. ClientTlsPolicy resource to be created.clientTlsPolicyId- Required. Short name of the ClientTlsPolicy resource to be created. This value should be 1-63 characters long, containing only letters, numbers, hyphens, and underscores, and should not start with a number. E.g. "client_mtls_policy".- Throws:
ApiException- if the remote call fails
-
createClientTlsPolicyAsync
public final OperationFuture<ClientTlsPolicy,OperationMetadata> createClientTlsPolicyAsync(String parent, ClientTlsPolicy clientTlsPolicy, String clientTlsPolicyId) Creates a new ClientTlsPolicy in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); ClientTlsPolicy clientTlsPolicy = ClientTlsPolicy.newBuilder().build(); String clientTlsPolicyId = "clientTlsPolicyId-188933315"; ClientTlsPolicy response = networkSecurityClient .createClientTlsPolicyAsync(parent, clientTlsPolicy, clientTlsPolicyId) .get(); }- Parameters:
parent- Required. The parent resource of the ClientTlsPolicy. Must be in the format `projects/*/locations/{location}`.clientTlsPolicy- Required. ClientTlsPolicy resource to be created.clientTlsPolicyId- Required. Short name of the ClientTlsPolicy resource to be created. This value should be 1-63 characters long, containing only letters, numbers, hyphens, and underscores, and should not start with a number. E.g. "client_mtls_policy".- Throws:
ApiException- if the remote call fails
-
createClientTlsPolicyAsync
public final OperationFuture<ClientTlsPolicy,OperationMetadata> createClientTlsPolicyAsync(CreateClientTlsPolicyRequest request) Creates a new ClientTlsPolicy in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { CreateClientTlsPolicyRequest request = CreateClientTlsPolicyRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setClientTlsPolicyId("clientTlsPolicyId-188933315") .setClientTlsPolicy(ClientTlsPolicy.newBuilder().build()) .build(); ClientTlsPolicy response = networkSecurityClient.createClientTlsPolicyAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createClientTlsPolicyOperationCallable
public final OperationCallable<CreateClientTlsPolicyRequest,ClientTlsPolicy, createClientTlsPolicyOperationCallable()OperationMetadata> Creates a new ClientTlsPolicy in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { CreateClientTlsPolicyRequest request = CreateClientTlsPolicyRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setClientTlsPolicyId("clientTlsPolicyId-188933315") .setClientTlsPolicy(ClientTlsPolicy.newBuilder().build()) .build(); OperationFuture<ClientTlsPolicy, OperationMetadata> future = networkSecurityClient.createClientTlsPolicyOperationCallable().futureCall(request); // Do something. ClientTlsPolicy response = future.get(); } -
createClientTlsPolicyCallable
Creates a new ClientTlsPolicy in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { CreateClientTlsPolicyRequest request = CreateClientTlsPolicyRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setClientTlsPolicyId("clientTlsPolicyId-188933315") .setClientTlsPolicy(ClientTlsPolicy.newBuilder().build()) .build(); ApiFuture<Operation> future = networkSecurityClient.createClientTlsPolicyCallable().futureCall(request); // Do something. Operation response = future.get(); } -
updateClientTlsPolicyAsync
public final OperationFuture<ClientTlsPolicy,OperationMetadata> updateClientTlsPolicyAsync(ClientTlsPolicy clientTlsPolicy, com.google.protobuf.FieldMask updateMask) Updates the parameters of a single ClientTlsPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { ClientTlsPolicy clientTlsPolicy = ClientTlsPolicy.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); ClientTlsPolicy response = networkSecurityClient.updateClientTlsPolicyAsync(clientTlsPolicy, updateMask).get(); }- Parameters:
clientTlsPolicy- Required. Updated ClientTlsPolicy resource.updateMask- Optional. Field mask is used to specify the fields to be overwritten in the ClientTlsPolicy resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten.- Throws:
ApiException- if the remote call fails
-
updateClientTlsPolicyAsync
public final OperationFuture<ClientTlsPolicy,OperationMetadata> updateClientTlsPolicyAsync(UpdateClientTlsPolicyRequest request) Updates the parameters of a single ClientTlsPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { UpdateClientTlsPolicyRequest request = UpdateClientTlsPolicyRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setClientTlsPolicy(ClientTlsPolicy.newBuilder().build()) .build(); ClientTlsPolicy response = networkSecurityClient.updateClientTlsPolicyAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateClientTlsPolicyOperationCallable
public final OperationCallable<UpdateClientTlsPolicyRequest,ClientTlsPolicy, updateClientTlsPolicyOperationCallable()OperationMetadata> Updates the parameters of a single ClientTlsPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { UpdateClientTlsPolicyRequest request = UpdateClientTlsPolicyRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setClientTlsPolicy(ClientTlsPolicy.newBuilder().build()) .build(); OperationFuture<ClientTlsPolicy, OperationMetadata> future = networkSecurityClient.updateClientTlsPolicyOperationCallable().futureCall(request); // Do something. ClientTlsPolicy response = future.get(); } -
updateClientTlsPolicyCallable
Updates the parameters of a single ClientTlsPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { UpdateClientTlsPolicyRequest request = UpdateClientTlsPolicyRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setClientTlsPolicy(ClientTlsPolicy.newBuilder().build()) .build(); ApiFuture<Operation> future = networkSecurityClient.updateClientTlsPolicyCallable().futureCall(request); // Do something. Operation response = future.get(); } -
deleteClientTlsPolicyAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteClientTlsPolicyAsync(ClientTlsPolicyName name) Deletes a single ClientTlsPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { ClientTlsPolicyName name = ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]"); networkSecurityClient.deleteClientTlsPolicyAsync(name).get(); }- Parameters:
name- Required. A name of the ClientTlsPolicy to delete. Must be in the format `projects/*/locations/{location}/clientTlsPolicies/*`.- Throws:
ApiException- if the remote call fails
-
deleteClientTlsPolicyAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteClientTlsPolicyAsync(String name) Deletes a single ClientTlsPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { String name = ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]").toString(); networkSecurityClient.deleteClientTlsPolicyAsync(name).get(); }- Parameters:
name- Required. A name of the ClientTlsPolicy to delete. Must be in the format `projects/*/locations/{location}/clientTlsPolicies/*`.- Throws:
ApiException- if the remote call fails
-
deleteClientTlsPolicyAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteClientTlsPolicyAsync(DeleteClientTlsPolicyRequest request) Deletes a single ClientTlsPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { DeleteClientTlsPolicyRequest request = DeleteClientTlsPolicyRequest.newBuilder() .setName( ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]") .toString()) .build(); networkSecurityClient.deleteClientTlsPolicyAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteClientTlsPolicyOperationCallable
public final OperationCallable<DeleteClientTlsPolicyRequest,com.google.protobuf.Empty, deleteClientTlsPolicyOperationCallable()OperationMetadata> Deletes a single ClientTlsPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { DeleteClientTlsPolicyRequest request = DeleteClientTlsPolicyRequest.newBuilder() .setName( ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]") .toString()) .build(); OperationFuture<Empty, OperationMetadata> future = networkSecurityClient.deleteClientTlsPolicyOperationCallable().futureCall(request); // Do something. future.get(); } -
deleteClientTlsPolicyCallable
Deletes a single ClientTlsPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { DeleteClientTlsPolicyRequest request = DeleteClientTlsPolicyRequest.newBuilder() .setName( ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]") .toString()) .build(); ApiFuture<Operation> future = networkSecurityClient.deleteClientTlsPolicyCallable().futureCall(request); // Do something. future.get(); } -
listGatewaySecurityPolicies
public final NetworkSecurityClient.ListGatewaySecurityPoliciesPagedResponse listGatewaySecurityPolicies(LocationName parent) Lists GatewaySecurityPolicies in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); for (GatewaySecurityPolicy element : networkSecurityClient.listGatewaySecurityPolicies(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The project and location from which the GatewaySecurityPolicies should be listed, specified in the format `projects/{project}/locations/{location}`.- Throws:
ApiException- if the remote call fails
-
listGatewaySecurityPolicies
public final NetworkSecurityClient.ListGatewaySecurityPoliciesPagedResponse listGatewaySecurityPolicies(String parent) Lists GatewaySecurityPolicies in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); for (GatewaySecurityPolicy element : networkSecurityClient.listGatewaySecurityPolicies(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The project and location from which the GatewaySecurityPolicies should be listed, specified in the format `projects/{project}/locations/{location}`.- Throws:
ApiException- if the remote call fails
-
listGatewaySecurityPolicies
public final NetworkSecurityClient.ListGatewaySecurityPoliciesPagedResponse listGatewaySecurityPolicies(ListGatewaySecurityPoliciesRequest request) Lists GatewaySecurityPolicies in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { ListGatewaySecurityPoliciesRequest request = ListGatewaySecurityPoliciesRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (GatewaySecurityPolicy element : networkSecurityClient.listGatewaySecurityPolicies(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listGatewaySecurityPoliciesPagedCallable
public final UnaryCallable<ListGatewaySecurityPoliciesRequest,NetworkSecurityClient.ListGatewaySecurityPoliciesPagedResponse> listGatewaySecurityPoliciesPagedCallable()Lists GatewaySecurityPolicies in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { ListGatewaySecurityPoliciesRequest request = ListGatewaySecurityPoliciesRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<GatewaySecurityPolicy> future = networkSecurityClient.listGatewaySecurityPoliciesPagedCallable().futureCall(request); // Do something. for (GatewaySecurityPolicy element : future.get().iterateAll()) { // doThingsWith(element); } } -
listGatewaySecurityPoliciesCallable
public final UnaryCallable<ListGatewaySecurityPoliciesRequest,ListGatewaySecurityPoliciesResponse> listGatewaySecurityPoliciesCallable()Lists GatewaySecurityPolicies in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { ListGatewaySecurityPoliciesRequest request = ListGatewaySecurityPoliciesRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListGatewaySecurityPoliciesResponse response = networkSecurityClient.listGatewaySecurityPoliciesCallable().call(request); for (GatewaySecurityPolicy element : response.getGatewaySecurityPoliciesList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
getGatewaySecurityPolicy
Gets details of a single GatewaySecurityPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { GatewaySecurityPolicyName name = GatewaySecurityPolicyName.of("[PROJECT]", "[LOCATION]", "[GATEWAY_SECURITY_POLICY]"); GatewaySecurityPolicy response = networkSecurityClient.getGatewaySecurityPolicy(name); }- Parameters:
name- Required. A name of the GatewaySecurityPolicy to get. Must be in the format `projects/{project}/locations/{location}/gatewaySecurityPolicies/*`.- Throws:
ApiException- if the remote call fails
-
getGatewaySecurityPolicy
Gets details of a single GatewaySecurityPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { String name = GatewaySecurityPolicyName.of("[PROJECT]", "[LOCATION]", "[GATEWAY_SECURITY_POLICY]") .toString(); GatewaySecurityPolicy response = networkSecurityClient.getGatewaySecurityPolicy(name); }- Parameters:
name- Required. A name of the GatewaySecurityPolicy to get. Must be in the format `projects/{project}/locations/{location}/gatewaySecurityPolicies/*`.- Throws:
ApiException- if the remote call fails
-
getGatewaySecurityPolicy
public final GatewaySecurityPolicy getGatewaySecurityPolicy(GetGatewaySecurityPolicyRequest request) Gets details of a single GatewaySecurityPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { GetGatewaySecurityPolicyRequest request = GetGatewaySecurityPolicyRequest.newBuilder() .setName( GatewaySecurityPolicyName.of( "[PROJECT]", "[LOCATION]", "[GATEWAY_SECURITY_POLICY]") .toString()) .build(); GatewaySecurityPolicy response = networkSecurityClient.getGatewaySecurityPolicy(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getGatewaySecurityPolicyCallable
public final UnaryCallable<GetGatewaySecurityPolicyRequest,GatewaySecurityPolicy> getGatewaySecurityPolicyCallable()Gets details of a single GatewaySecurityPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { GetGatewaySecurityPolicyRequest request = GetGatewaySecurityPolicyRequest.newBuilder() .setName( GatewaySecurityPolicyName.of( "[PROJECT]", "[LOCATION]", "[GATEWAY_SECURITY_POLICY]") .toString()) .build(); ApiFuture<GatewaySecurityPolicy> future = networkSecurityClient.getGatewaySecurityPolicyCallable().futureCall(request); // Do something. GatewaySecurityPolicy response = future.get(); } -
createGatewaySecurityPolicyAsync
public final OperationFuture<GatewaySecurityPolicy,OperationMetadata> createGatewaySecurityPolicyAsync(LocationName parent, GatewaySecurityPolicy gatewaySecurityPolicy, String gatewaySecurityPolicyId) Creates a new GatewaySecurityPolicy in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); GatewaySecurityPolicy gatewaySecurityPolicy = GatewaySecurityPolicy.newBuilder().build(); String gatewaySecurityPolicyId = "gatewaySecurityPolicyId2047625137"; GatewaySecurityPolicy response = networkSecurityClient .createGatewaySecurityPolicyAsync( parent, gatewaySecurityPolicy, gatewaySecurityPolicyId) .get(); }- Parameters:
parent- Required. The parent resource of the GatewaySecurityPolicy. Must be in the format `projects/{project}/locations/{location}`.gatewaySecurityPolicy- Required. GatewaySecurityPolicy resource to be created.gatewaySecurityPolicyId- Required. Short name of the GatewaySecurityPolicy resource to be created. This value should be 1-63 characters long, containing only letters, numbers, hyphens, and underscores, and should not start with a number. E.g. "gateway_security_policy1".- Throws:
ApiException- if the remote call fails
-
createGatewaySecurityPolicyAsync
public final OperationFuture<GatewaySecurityPolicy,OperationMetadata> createGatewaySecurityPolicyAsync(String parent, GatewaySecurityPolicy gatewaySecurityPolicy, String gatewaySecurityPolicyId) Creates a new GatewaySecurityPolicy in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); GatewaySecurityPolicy gatewaySecurityPolicy = GatewaySecurityPolicy.newBuilder().build(); String gatewaySecurityPolicyId = "gatewaySecurityPolicyId2047625137"; GatewaySecurityPolicy response = networkSecurityClient .createGatewaySecurityPolicyAsync( parent, gatewaySecurityPolicy, gatewaySecurityPolicyId) .get(); }- Parameters:
parent- Required. The parent resource of the GatewaySecurityPolicy. Must be in the format `projects/{project}/locations/{location}`.gatewaySecurityPolicy- Required. GatewaySecurityPolicy resource to be created.gatewaySecurityPolicyId- Required. Short name of the GatewaySecurityPolicy resource to be created. This value should be 1-63 characters long, containing only letters, numbers, hyphens, and underscores, and should not start with a number. E.g. "gateway_security_policy1".- Throws:
ApiException- if the remote call fails
-
createGatewaySecurityPolicyAsync
public final OperationFuture<GatewaySecurityPolicy,OperationMetadata> createGatewaySecurityPolicyAsync(CreateGatewaySecurityPolicyRequest request) Creates a new GatewaySecurityPolicy in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { CreateGatewaySecurityPolicyRequest request = CreateGatewaySecurityPolicyRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setGatewaySecurityPolicyId("gatewaySecurityPolicyId2047625137") .setGatewaySecurityPolicy(GatewaySecurityPolicy.newBuilder().build()) .build(); GatewaySecurityPolicy response = networkSecurityClient.createGatewaySecurityPolicyAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createGatewaySecurityPolicyOperationCallable
public final OperationCallable<CreateGatewaySecurityPolicyRequest,GatewaySecurityPolicy, createGatewaySecurityPolicyOperationCallable()OperationMetadata> Creates a new GatewaySecurityPolicy in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { CreateGatewaySecurityPolicyRequest request = CreateGatewaySecurityPolicyRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setGatewaySecurityPolicyId("gatewaySecurityPolicyId2047625137") .setGatewaySecurityPolicy(GatewaySecurityPolicy.newBuilder().build()) .build(); OperationFuture<GatewaySecurityPolicy, OperationMetadata> future = networkSecurityClient.createGatewaySecurityPolicyOperationCallable().futureCall(request); // Do something. GatewaySecurityPolicy response = future.get(); } -
createGatewaySecurityPolicyCallable
public final UnaryCallable<CreateGatewaySecurityPolicyRequest,Operation> createGatewaySecurityPolicyCallable()Creates a new GatewaySecurityPolicy in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { CreateGatewaySecurityPolicyRequest request = CreateGatewaySecurityPolicyRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setGatewaySecurityPolicyId("gatewaySecurityPolicyId2047625137") .setGatewaySecurityPolicy(GatewaySecurityPolicy.newBuilder().build()) .build(); ApiFuture<Operation> future = networkSecurityClient.createGatewaySecurityPolicyCallable().futureCall(request); // Do something. Operation response = future.get(); } -
updateGatewaySecurityPolicyAsync
public final OperationFuture<GatewaySecurityPolicy,OperationMetadata> updateGatewaySecurityPolicyAsync(GatewaySecurityPolicy gatewaySecurityPolicy, com.google.protobuf.FieldMask updateMask) Updates the parameters of a single GatewaySecurityPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { GatewaySecurityPolicy gatewaySecurityPolicy = GatewaySecurityPolicy.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); GatewaySecurityPolicy response = networkSecurityClient .updateGatewaySecurityPolicyAsync(gatewaySecurityPolicy, updateMask) .get(); }- Parameters:
gatewaySecurityPolicy- Required. Updated GatewaySecurityPolicy resource.updateMask- Optional. Field mask is used to specify the fields to be overwritten in the GatewaySecurityPolicy resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten.- Throws:
ApiException- if the remote call fails
-
updateGatewaySecurityPolicyAsync
public final OperationFuture<GatewaySecurityPolicy,OperationMetadata> updateGatewaySecurityPolicyAsync(UpdateGatewaySecurityPolicyRequest request) Updates the parameters of a single GatewaySecurityPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { UpdateGatewaySecurityPolicyRequest request = UpdateGatewaySecurityPolicyRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setGatewaySecurityPolicy(GatewaySecurityPolicy.newBuilder().build()) .build(); GatewaySecurityPolicy response = networkSecurityClient.updateGatewaySecurityPolicyAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateGatewaySecurityPolicyOperationCallable
public final OperationCallable<UpdateGatewaySecurityPolicyRequest,GatewaySecurityPolicy, updateGatewaySecurityPolicyOperationCallable()OperationMetadata> Updates the parameters of a single GatewaySecurityPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { UpdateGatewaySecurityPolicyRequest request = UpdateGatewaySecurityPolicyRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setGatewaySecurityPolicy(GatewaySecurityPolicy.newBuilder().build()) .build(); OperationFuture<GatewaySecurityPolicy, OperationMetadata> future = networkSecurityClient.updateGatewaySecurityPolicyOperationCallable().futureCall(request); // Do something. GatewaySecurityPolicy response = future.get(); } -
updateGatewaySecurityPolicyCallable
public final UnaryCallable<UpdateGatewaySecurityPolicyRequest,Operation> updateGatewaySecurityPolicyCallable()Updates the parameters of a single GatewaySecurityPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { UpdateGatewaySecurityPolicyRequest request = UpdateGatewaySecurityPolicyRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setGatewaySecurityPolicy(GatewaySecurityPolicy.newBuilder().build()) .build(); ApiFuture<Operation> future = networkSecurityClient.updateGatewaySecurityPolicyCallable().futureCall(request); // Do something. Operation response = future.get(); } -
deleteGatewaySecurityPolicyAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteGatewaySecurityPolicyAsync(GatewaySecurityPolicyName name) Deletes a single GatewaySecurityPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { GatewaySecurityPolicyName name = GatewaySecurityPolicyName.of("[PROJECT]", "[LOCATION]", "[GATEWAY_SECURITY_POLICY]"); networkSecurityClient.deleteGatewaySecurityPolicyAsync(name).get(); }- Parameters:
name- Required. A name of the GatewaySecurityPolicy to delete. Must be in the format `projects/{project}/locations/{location}/gatewaySecurityPolicies/*`.- Throws:
ApiException- if the remote call fails
-
deleteGatewaySecurityPolicyAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteGatewaySecurityPolicyAsync(String name) Deletes a single GatewaySecurityPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { String name = GatewaySecurityPolicyName.of("[PROJECT]", "[LOCATION]", "[GATEWAY_SECURITY_POLICY]") .toString(); networkSecurityClient.deleteGatewaySecurityPolicyAsync(name).get(); }- Parameters:
name- Required. A name of the GatewaySecurityPolicy to delete. Must be in the format `projects/{project}/locations/{location}/gatewaySecurityPolicies/*`.- Throws:
ApiException- if the remote call fails
-
deleteGatewaySecurityPolicyAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteGatewaySecurityPolicyAsync(DeleteGatewaySecurityPolicyRequest request) Deletes a single GatewaySecurityPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { DeleteGatewaySecurityPolicyRequest request = DeleteGatewaySecurityPolicyRequest.newBuilder() .setName( GatewaySecurityPolicyName.of( "[PROJECT]", "[LOCATION]", "[GATEWAY_SECURITY_POLICY]") .toString()) .build(); networkSecurityClient.deleteGatewaySecurityPolicyAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteGatewaySecurityPolicyOperationCallable
public final OperationCallable<DeleteGatewaySecurityPolicyRequest,com.google.protobuf.Empty, deleteGatewaySecurityPolicyOperationCallable()OperationMetadata> Deletes a single GatewaySecurityPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { DeleteGatewaySecurityPolicyRequest request = DeleteGatewaySecurityPolicyRequest.newBuilder() .setName( GatewaySecurityPolicyName.of( "[PROJECT]", "[LOCATION]", "[GATEWAY_SECURITY_POLICY]") .toString()) .build(); OperationFuture<Empty, OperationMetadata> future = networkSecurityClient.deleteGatewaySecurityPolicyOperationCallable().futureCall(request); // Do something. future.get(); } -
deleteGatewaySecurityPolicyCallable
public final UnaryCallable<DeleteGatewaySecurityPolicyRequest,Operation> deleteGatewaySecurityPolicyCallable()Deletes a single GatewaySecurityPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { DeleteGatewaySecurityPolicyRequest request = DeleteGatewaySecurityPolicyRequest.newBuilder() .setName( GatewaySecurityPolicyName.of( "[PROJECT]", "[LOCATION]", "[GATEWAY_SECURITY_POLICY]") .toString()) .build(); ApiFuture<Operation> future = networkSecurityClient.deleteGatewaySecurityPolicyCallable().futureCall(request); // Do something. future.get(); } -
listGatewaySecurityPolicyRules
public final NetworkSecurityClient.ListGatewaySecurityPolicyRulesPagedResponse listGatewaySecurityPolicyRules(GatewaySecurityPolicyName parent) Lists GatewaySecurityPolicyRules in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { GatewaySecurityPolicyName parent = GatewaySecurityPolicyName.of("[PROJECT]", "[LOCATION]", "[GATEWAY_SECURITY_POLICY]"); for (GatewaySecurityPolicyRule element : networkSecurityClient.listGatewaySecurityPolicyRules(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The project, location and GatewaySecurityPolicy from which the GatewaySecurityPolicyRules should be listed, specified in the format `projects/{project}/locations/{location}/gatewaySecurityPolicies/{gatewaySecurityPolicy}`.- Throws:
ApiException- if the remote call fails
-
listGatewaySecurityPolicyRules
public final NetworkSecurityClient.ListGatewaySecurityPolicyRulesPagedResponse listGatewaySecurityPolicyRules(String parent) Lists GatewaySecurityPolicyRules in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { String parent = GatewaySecurityPolicyName.of("[PROJECT]", "[LOCATION]", "[GATEWAY_SECURITY_POLICY]") .toString(); for (GatewaySecurityPolicyRule element : networkSecurityClient.listGatewaySecurityPolicyRules(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The project, location and GatewaySecurityPolicy from which the GatewaySecurityPolicyRules should be listed, specified in the format `projects/{project}/locations/{location}/gatewaySecurityPolicies/{gatewaySecurityPolicy}`.- Throws:
ApiException- if the remote call fails
-
listGatewaySecurityPolicyRules
public final NetworkSecurityClient.ListGatewaySecurityPolicyRulesPagedResponse listGatewaySecurityPolicyRules(ListGatewaySecurityPolicyRulesRequest request) Lists GatewaySecurityPolicyRules in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { ListGatewaySecurityPolicyRulesRequest request = ListGatewaySecurityPolicyRulesRequest.newBuilder() .setParent( GatewaySecurityPolicyName.of( "[PROJECT]", "[LOCATION]", "[GATEWAY_SECURITY_POLICY]") .toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (GatewaySecurityPolicyRule element : networkSecurityClient.listGatewaySecurityPolicyRules(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listGatewaySecurityPolicyRulesPagedCallable
public final UnaryCallable<ListGatewaySecurityPolicyRulesRequest,NetworkSecurityClient.ListGatewaySecurityPolicyRulesPagedResponse> listGatewaySecurityPolicyRulesPagedCallable()Lists GatewaySecurityPolicyRules in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { ListGatewaySecurityPolicyRulesRequest request = ListGatewaySecurityPolicyRulesRequest.newBuilder() .setParent( GatewaySecurityPolicyName.of( "[PROJECT]", "[LOCATION]", "[GATEWAY_SECURITY_POLICY]") .toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<GatewaySecurityPolicyRule> future = networkSecurityClient.listGatewaySecurityPolicyRulesPagedCallable().futureCall(request); // Do something. for (GatewaySecurityPolicyRule element : future.get().iterateAll()) { // doThingsWith(element); } } -
listGatewaySecurityPolicyRulesCallable
public final UnaryCallable<ListGatewaySecurityPolicyRulesRequest,ListGatewaySecurityPolicyRulesResponse> listGatewaySecurityPolicyRulesCallable()Lists GatewaySecurityPolicyRules in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { ListGatewaySecurityPolicyRulesRequest request = ListGatewaySecurityPolicyRulesRequest.newBuilder() .setParent( GatewaySecurityPolicyName.of( "[PROJECT]", "[LOCATION]", "[GATEWAY_SECURITY_POLICY]") .toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListGatewaySecurityPolicyRulesResponse response = networkSecurityClient.listGatewaySecurityPolicyRulesCallable().call(request); for (GatewaySecurityPolicyRule element : response.getGatewaySecurityPolicyRulesList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
getGatewaySecurityPolicyRule
public final GatewaySecurityPolicyRule getGatewaySecurityPolicyRule(GatewaySecurityPolicyRuleName name) Gets details of a single GatewaySecurityPolicyRule.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { GatewaySecurityPolicyRuleName name = GatewaySecurityPolicyRuleName.of( "[PROJECT]", "[LOCATION]", "[GATEWAY_SECURITY_POLICY]", "[RULE]"); GatewaySecurityPolicyRule response = networkSecurityClient.getGatewaySecurityPolicyRule(name); }- Parameters:
name- Required. The name of the GatewaySecurityPolicyRule to retrieve. Format: projects/{project}/location/{location}/gatewaySecurityPolicies/*/rules/*- Throws:
ApiException- if the remote call fails
-
getGatewaySecurityPolicyRule
Gets details of a single GatewaySecurityPolicyRule.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { String name = GatewaySecurityPolicyRuleName.of( "[PROJECT]", "[LOCATION]", "[GATEWAY_SECURITY_POLICY]", "[RULE]") .toString(); GatewaySecurityPolicyRule response = networkSecurityClient.getGatewaySecurityPolicyRule(name); }- Parameters:
name- Required. The name of the GatewaySecurityPolicyRule to retrieve. Format: projects/{project}/location/{location}/gatewaySecurityPolicies/*/rules/*- Throws:
ApiException- if the remote call fails
-
getGatewaySecurityPolicyRule
public final GatewaySecurityPolicyRule getGatewaySecurityPolicyRule(GetGatewaySecurityPolicyRuleRequest request) Gets details of a single GatewaySecurityPolicyRule.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { GetGatewaySecurityPolicyRuleRequest request = GetGatewaySecurityPolicyRuleRequest.newBuilder() .setName( GatewaySecurityPolicyRuleName.of( "[PROJECT]", "[LOCATION]", "[GATEWAY_SECURITY_POLICY]", "[RULE]") .toString()) .build(); GatewaySecurityPolicyRule response = networkSecurityClient.getGatewaySecurityPolicyRule(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getGatewaySecurityPolicyRuleCallable
public final UnaryCallable<GetGatewaySecurityPolicyRuleRequest,GatewaySecurityPolicyRule> getGatewaySecurityPolicyRuleCallable()Gets details of a single GatewaySecurityPolicyRule.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { GetGatewaySecurityPolicyRuleRequest request = GetGatewaySecurityPolicyRuleRequest.newBuilder() .setName( GatewaySecurityPolicyRuleName.of( "[PROJECT]", "[LOCATION]", "[GATEWAY_SECURITY_POLICY]", "[RULE]") .toString()) .build(); ApiFuture<GatewaySecurityPolicyRule> future = networkSecurityClient.getGatewaySecurityPolicyRuleCallable().futureCall(request); // Do something. GatewaySecurityPolicyRule response = future.get(); } -
createGatewaySecurityPolicyRuleAsync
public final OperationFuture<GatewaySecurityPolicyRule,OperationMetadata> createGatewaySecurityPolicyRuleAsync(GatewaySecurityPolicyName parent, GatewaySecurityPolicyRule gatewaySecurityPolicyRule, String gatewaySecurityPolicyRuleId) Creates a new GatewaySecurityPolicy in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { GatewaySecurityPolicyName parent = GatewaySecurityPolicyName.of("[PROJECT]", "[LOCATION]", "[GATEWAY_SECURITY_POLICY]"); GatewaySecurityPolicyRule gatewaySecurityPolicyRule = GatewaySecurityPolicyRule.newBuilder().build(); String gatewaySecurityPolicyRuleId = "gatewaySecurityPolicyRuleId-1764962099"; GatewaySecurityPolicyRule response = networkSecurityClient .createGatewaySecurityPolicyRuleAsync( parent, gatewaySecurityPolicyRule, gatewaySecurityPolicyRuleId) .get(); }- Parameters:
parent- Required. The parent where this rule will be created. Format : projects/{project}/location/{location}/gatewaySecurityPolicies/*gatewaySecurityPolicyRule- Required. The rule to be created.gatewaySecurityPolicyRuleId- The ID to use for the rule, which will become the final component of the rule's resource name. This value should be 4-63 characters, and valid characters are /[a-z][0-9]-/.- Throws:
ApiException- if the remote call fails
-
createGatewaySecurityPolicyRuleAsync
public final OperationFuture<GatewaySecurityPolicyRule,OperationMetadata> createGatewaySecurityPolicyRuleAsync(String parent, GatewaySecurityPolicyRule gatewaySecurityPolicyRule, String gatewaySecurityPolicyRuleId) Creates a new GatewaySecurityPolicy in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { String parent = GatewaySecurityPolicyName.of("[PROJECT]", "[LOCATION]", "[GATEWAY_SECURITY_POLICY]") .toString(); GatewaySecurityPolicyRule gatewaySecurityPolicyRule = GatewaySecurityPolicyRule.newBuilder().build(); String gatewaySecurityPolicyRuleId = "gatewaySecurityPolicyRuleId-1764962099"; GatewaySecurityPolicyRule response = networkSecurityClient .createGatewaySecurityPolicyRuleAsync( parent, gatewaySecurityPolicyRule, gatewaySecurityPolicyRuleId) .get(); }- Parameters:
parent- Required. The parent where this rule will be created. Format : projects/{project}/location/{location}/gatewaySecurityPolicies/*gatewaySecurityPolicyRule- Required. The rule to be created.gatewaySecurityPolicyRuleId- The ID to use for the rule, which will become the final component of the rule's resource name. This value should be 4-63 characters, and valid characters are /[a-z][0-9]-/.- Throws:
ApiException- if the remote call fails
-
createGatewaySecurityPolicyRuleAsync
public final OperationFuture<GatewaySecurityPolicyRule,OperationMetadata> createGatewaySecurityPolicyRuleAsync(CreateGatewaySecurityPolicyRuleRequest request) Creates a new GatewaySecurityPolicy in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { CreateGatewaySecurityPolicyRuleRequest request = CreateGatewaySecurityPolicyRuleRequest.newBuilder() .setParent( GatewaySecurityPolicyName.of( "[PROJECT]", "[LOCATION]", "[GATEWAY_SECURITY_POLICY]") .toString()) .setGatewaySecurityPolicyRule(GatewaySecurityPolicyRule.newBuilder().build()) .setGatewaySecurityPolicyRuleId("gatewaySecurityPolicyRuleId-1764962099") .build(); GatewaySecurityPolicyRule response = networkSecurityClient.createGatewaySecurityPolicyRuleAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createGatewaySecurityPolicyRuleOperationCallable
public final OperationCallable<CreateGatewaySecurityPolicyRuleRequest,GatewaySecurityPolicyRule, createGatewaySecurityPolicyRuleOperationCallable()OperationMetadata> Creates a new GatewaySecurityPolicy in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { CreateGatewaySecurityPolicyRuleRequest request = CreateGatewaySecurityPolicyRuleRequest.newBuilder() .setParent( GatewaySecurityPolicyName.of( "[PROJECT]", "[LOCATION]", "[GATEWAY_SECURITY_POLICY]") .toString()) .setGatewaySecurityPolicyRule(GatewaySecurityPolicyRule.newBuilder().build()) .setGatewaySecurityPolicyRuleId("gatewaySecurityPolicyRuleId-1764962099") .build(); OperationFuture<GatewaySecurityPolicyRule, OperationMetadata> future = networkSecurityClient .createGatewaySecurityPolicyRuleOperationCallable() .futureCall(request); // Do something. GatewaySecurityPolicyRule response = future.get(); } -
createGatewaySecurityPolicyRuleCallable
public final UnaryCallable<CreateGatewaySecurityPolicyRuleRequest,Operation> createGatewaySecurityPolicyRuleCallable()Creates a new GatewaySecurityPolicy in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { CreateGatewaySecurityPolicyRuleRequest request = CreateGatewaySecurityPolicyRuleRequest.newBuilder() .setParent( GatewaySecurityPolicyName.of( "[PROJECT]", "[LOCATION]", "[GATEWAY_SECURITY_POLICY]") .toString()) .setGatewaySecurityPolicyRule(GatewaySecurityPolicyRule.newBuilder().build()) .setGatewaySecurityPolicyRuleId("gatewaySecurityPolicyRuleId-1764962099") .build(); ApiFuture<Operation> future = networkSecurityClient.createGatewaySecurityPolicyRuleCallable().futureCall(request); // Do something. Operation response = future.get(); } -
updateGatewaySecurityPolicyRuleAsync
public final OperationFuture<GatewaySecurityPolicyRule,OperationMetadata> updateGatewaySecurityPolicyRuleAsync(GatewaySecurityPolicyRule gatewaySecurityPolicyRule, com.google.protobuf.FieldMask updateMask) Updates the parameters of a single GatewaySecurityPolicyRule.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { GatewaySecurityPolicyRule gatewaySecurityPolicyRule = GatewaySecurityPolicyRule.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); GatewaySecurityPolicyRule response = networkSecurityClient .updateGatewaySecurityPolicyRuleAsync(gatewaySecurityPolicyRule, updateMask) .get(); }- Parameters:
gatewaySecurityPolicyRule- Required. Updated GatewaySecurityPolicyRule resource.updateMask- Optional. Field mask is used to specify the fields to be overwritten in the GatewaySecurityPolicy resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten.- Throws:
ApiException- if the remote call fails
-
updateGatewaySecurityPolicyRuleAsync
public final OperationFuture<GatewaySecurityPolicyRule,OperationMetadata> updateGatewaySecurityPolicyRuleAsync(UpdateGatewaySecurityPolicyRuleRequest request) Updates the parameters of a single GatewaySecurityPolicyRule.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { UpdateGatewaySecurityPolicyRuleRequest request = UpdateGatewaySecurityPolicyRuleRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setGatewaySecurityPolicyRule(GatewaySecurityPolicyRule.newBuilder().build()) .build(); GatewaySecurityPolicyRule response = networkSecurityClient.updateGatewaySecurityPolicyRuleAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateGatewaySecurityPolicyRuleOperationCallable
public final OperationCallable<UpdateGatewaySecurityPolicyRuleRequest,GatewaySecurityPolicyRule, updateGatewaySecurityPolicyRuleOperationCallable()OperationMetadata> Updates the parameters of a single GatewaySecurityPolicyRule.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { UpdateGatewaySecurityPolicyRuleRequest request = UpdateGatewaySecurityPolicyRuleRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setGatewaySecurityPolicyRule(GatewaySecurityPolicyRule.newBuilder().build()) .build(); OperationFuture<GatewaySecurityPolicyRule, OperationMetadata> future = networkSecurityClient .updateGatewaySecurityPolicyRuleOperationCallable() .futureCall(request); // Do something. GatewaySecurityPolicyRule response = future.get(); } -
updateGatewaySecurityPolicyRuleCallable
public final UnaryCallable<UpdateGatewaySecurityPolicyRuleRequest,Operation> updateGatewaySecurityPolicyRuleCallable()Updates the parameters of a single GatewaySecurityPolicyRule.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { UpdateGatewaySecurityPolicyRuleRequest request = UpdateGatewaySecurityPolicyRuleRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setGatewaySecurityPolicyRule(GatewaySecurityPolicyRule.newBuilder().build()) .build(); ApiFuture<Operation> future = networkSecurityClient.updateGatewaySecurityPolicyRuleCallable().futureCall(request); // Do something. Operation response = future.get(); } -
deleteGatewaySecurityPolicyRuleAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteGatewaySecurityPolicyRuleAsync(GatewaySecurityPolicyRuleName name) Deletes a single GatewaySecurityPolicyRule.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { GatewaySecurityPolicyRuleName name = GatewaySecurityPolicyRuleName.of( "[PROJECT]", "[LOCATION]", "[GATEWAY_SECURITY_POLICY]", "[RULE]"); networkSecurityClient.deleteGatewaySecurityPolicyRuleAsync(name).get(); }- Parameters:
name- Required. A name of the GatewaySecurityPolicyRule to delete. Must be in the format `projects/{project}/locations/{location}/gatewaySecurityPolicies/{gatewaySecurityPolicy}/rules/*`.- Throws:
ApiException- if the remote call fails
-
deleteGatewaySecurityPolicyRuleAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteGatewaySecurityPolicyRuleAsync(String name) Deletes a single GatewaySecurityPolicyRule.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { String name = GatewaySecurityPolicyRuleName.of( "[PROJECT]", "[LOCATION]", "[GATEWAY_SECURITY_POLICY]", "[RULE]") .toString(); networkSecurityClient.deleteGatewaySecurityPolicyRuleAsync(name).get(); }- Parameters:
name- Required. A name of the GatewaySecurityPolicyRule to delete. Must be in the format `projects/{project}/locations/{location}/gatewaySecurityPolicies/{gatewaySecurityPolicy}/rules/*`.- Throws:
ApiException- if the remote call fails
-
deleteGatewaySecurityPolicyRuleAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteGatewaySecurityPolicyRuleAsync(DeleteGatewaySecurityPolicyRuleRequest request) Deletes a single GatewaySecurityPolicyRule.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { DeleteGatewaySecurityPolicyRuleRequest request = DeleteGatewaySecurityPolicyRuleRequest.newBuilder() .setName( GatewaySecurityPolicyRuleName.of( "[PROJECT]", "[LOCATION]", "[GATEWAY_SECURITY_POLICY]", "[RULE]") .toString()) .build(); networkSecurityClient.deleteGatewaySecurityPolicyRuleAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteGatewaySecurityPolicyRuleOperationCallable
public final OperationCallable<DeleteGatewaySecurityPolicyRuleRequest,com.google.protobuf.Empty, deleteGatewaySecurityPolicyRuleOperationCallable()OperationMetadata> Deletes a single GatewaySecurityPolicyRule.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { DeleteGatewaySecurityPolicyRuleRequest request = DeleteGatewaySecurityPolicyRuleRequest.newBuilder() .setName( GatewaySecurityPolicyRuleName.of( "[PROJECT]", "[LOCATION]", "[GATEWAY_SECURITY_POLICY]", "[RULE]") .toString()) .build(); OperationFuture<Empty, OperationMetadata> future = networkSecurityClient .deleteGatewaySecurityPolicyRuleOperationCallable() .futureCall(request); // Do something. future.get(); } -
deleteGatewaySecurityPolicyRuleCallable
public final UnaryCallable<DeleteGatewaySecurityPolicyRuleRequest,Operation> deleteGatewaySecurityPolicyRuleCallable()Deletes a single GatewaySecurityPolicyRule.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { DeleteGatewaySecurityPolicyRuleRequest request = DeleteGatewaySecurityPolicyRuleRequest.newBuilder() .setName( GatewaySecurityPolicyRuleName.of( "[PROJECT]", "[LOCATION]", "[GATEWAY_SECURITY_POLICY]", "[RULE]") .toString()) .build(); ApiFuture<Operation> future = networkSecurityClient.deleteGatewaySecurityPolicyRuleCallable().futureCall(request); // Do something. future.get(); } -
listUrlLists
Lists UrlLists in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); for (UrlList element : networkSecurityClient.listUrlLists(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The project and location from which the UrlLists should be listed, specified in the format `projects/{project}/locations/{location}`.- Throws:
ApiException- if the remote call fails
-
listUrlLists
Lists UrlLists in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); for (UrlList element : networkSecurityClient.listUrlLists(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The project and location from which the UrlLists should be listed, specified in the format `projects/{project}/locations/{location}`.- Throws:
ApiException- if the remote call fails
-
listUrlLists
public final NetworkSecurityClient.ListUrlListsPagedResponse listUrlLists(ListUrlListsRequest request) Lists UrlLists in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { ListUrlListsRequest request = ListUrlListsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (UrlList element : networkSecurityClient.listUrlLists(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listUrlListsPagedCallable
public final UnaryCallable<ListUrlListsRequest,NetworkSecurityClient.ListUrlListsPagedResponse> listUrlListsPagedCallable()Lists UrlLists in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { ListUrlListsRequest request = ListUrlListsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<UrlList> future = networkSecurityClient.listUrlListsPagedCallable().futureCall(request); // Do something. for (UrlList element : future.get().iterateAll()) { // doThingsWith(element); } } -
listUrlListsCallable
Lists UrlLists in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { ListUrlListsRequest request = ListUrlListsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListUrlListsResponse response = networkSecurityClient.listUrlListsCallable().call(request); for (UrlList element : response.getUrlListsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
getUrlList
Gets details of a single UrlList.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { UrlListName name = UrlListName.of("[PROJECT]", "[LOCATION]", "[URL_LIST]"); UrlList response = networkSecurityClient.getUrlList(name); }- Parameters:
name- Required. A name of the UrlList to get. Must be in the format `projects/*/locations/{location}/urlLists/*`.- Throws:
ApiException- if the remote call fails
-
getUrlList
Gets details of a single UrlList.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { String name = UrlListName.of("[PROJECT]", "[LOCATION]", "[URL_LIST]").toString(); UrlList response = networkSecurityClient.getUrlList(name); }- Parameters:
name- Required. A name of the UrlList to get. Must be in the format `projects/*/locations/{location}/urlLists/*`.- Throws:
ApiException- if the remote call fails
-
getUrlList
Gets details of a single UrlList.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { GetUrlListRequest request = GetUrlListRequest.newBuilder() .setName(UrlListName.of("[PROJECT]", "[LOCATION]", "[URL_LIST]").toString()) .build(); UrlList response = networkSecurityClient.getUrlList(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getUrlListCallable
Gets details of a single UrlList.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { GetUrlListRequest request = GetUrlListRequest.newBuilder() .setName(UrlListName.of("[PROJECT]", "[LOCATION]", "[URL_LIST]").toString()) .build(); ApiFuture<UrlList> future = networkSecurityClient.getUrlListCallable().futureCall(request); // Do something. UrlList response = future.get(); } -
createUrlListAsync
public final OperationFuture<UrlList,OperationMetadata> createUrlListAsync(LocationName parent, UrlList urlList, String urlListId) Creates a new UrlList in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); UrlList urlList = UrlList.newBuilder().build(); String urlListId = "urlListId-564417368"; UrlList response = networkSecurityClient.createUrlListAsync(parent, urlList, urlListId).get(); }- Parameters:
parent- Required. The parent resource of the UrlList. Must be in the format `projects/*/locations/{location}`.urlList- Required. UrlList resource to be created.urlListId- Required. Short name of the UrlList resource to be created. This value should be 1-63 characters long, containing only letters, numbers, hyphens, and underscores, and should not start with a number. E.g. "url_list".- Throws:
ApiException- if the remote call fails
-
createUrlListAsync
public final OperationFuture<UrlList,OperationMetadata> createUrlListAsync(String parent, UrlList urlList, String urlListId) Creates a new UrlList in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); UrlList urlList = UrlList.newBuilder().build(); String urlListId = "urlListId-564417368"; UrlList response = networkSecurityClient.createUrlListAsync(parent, urlList, urlListId).get(); }- Parameters:
parent- Required. The parent resource of the UrlList. Must be in the format `projects/*/locations/{location}`.urlList- Required. UrlList resource to be created.urlListId- Required. Short name of the UrlList resource to be created. This value should be 1-63 characters long, containing only letters, numbers, hyphens, and underscores, and should not start with a number. E.g. "url_list".- Throws:
ApiException- if the remote call fails
-
createUrlListAsync
public final OperationFuture<UrlList,OperationMetadata> createUrlListAsync(CreateUrlListRequest request) Creates a new UrlList in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { CreateUrlListRequest request = CreateUrlListRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setUrlListId("urlListId-564417368") .setUrlList(UrlList.newBuilder().build()) .build(); UrlList response = networkSecurityClient.createUrlListAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createUrlListOperationCallable
public final OperationCallable<CreateUrlListRequest,UrlList, createUrlListOperationCallable()OperationMetadata> Creates a new UrlList in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { CreateUrlListRequest request = CreateUrlListRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setUrlListId("urlListId-564417368") .setUrlList(UrlList.newBuilder().build()) .build(); OperationFuture<UrlList, OperationMetadata> future = networkSecurityClient.createUrlListOperationCallable().futureCall(request); // Do something. UrlList response = future.get(); } -
createUrlListCallable
Creates a new UrlList in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { CreateUrlListRequest request = CreateUrlListRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setUrlListId("urlListId-564417368") .setUrlList(UrlList.newBuilder().build()) .build(); ApiFuture<Operation> future = networkSecurityClient.createUrlListCallable().futureCall(request); // Do something. Operation response = future.get(); } -
updateUrlListAsync
public final OperationFuture<UrlList,OperationMetadata> updateUrlListAsync(UrlList urlList, com.google.protobuf.FieldMask updateMask) Updates the parameters of a single UrlList.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { UrlList urlList = UrlList.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); UrlList response = networkSecurityClient.updateUrlListAsync(urlList, updateMask).get(); }- Parameters:
urlList- Required. Updated UrlList resource.updateMask- Optional. Field mask is used to specify the fields to be overwritten in the UrlList resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten.- Throws:
ApiException- if the remote call fails
-
updateUrlListAsync
public final OperationFuture<UrlList,OperationMetadata> updateUrlListAsync(UpdateUrlListRequest request) Updates the parameters of a single UrlList.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { UpdateUrlListRequest request = UpdateUrlListRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setUrlList(UrlList.newBuilder().build()) .build(); UrlList response = networkSecurityClient.updateUrlListAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateUrlListOperationCallable
public final OperationCallable<UpdateUrlListRequest,UrlList, updateUrlListOperationCallable()OperationMetadata> Updates the parameters of a single UrlList.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { UpdateUrlListRequest request = UpdateUrlListRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setUrlList(UrlList.newBuilder().build()) .build(); OperationFuture<UrlList, OperationMetadata> future = networkSecurityClient.updateUrlListOperationCallable().futureCall(request); // Do something. UrlList response = future.get(); } -
updateUrlListCallable
Updates the parameters of a single UrlList.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { UpdateUrlListRequest request = UpdateUrlListRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setUrlList(UrlList.newBuilder().build()) .build(); ApiFuture<Operation> future = networkSecurityClient.updateUrlListCallable().futureCall(request); // Do something. Operation response = future.get(); } -
deleteUrlListAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteUrlListAsync(UrlListName name) Deletes a single UrlList.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { UrlListName name = UrlListName.of("[PROJECT]", "[LOCATION]", "[URL_LIST]"); networkSecurityClient.deleteUrlListAsync(name).get(); }- Parameters:
name- Required. A name of the UrlList to delete. Must be in the format `projects/*/locations/{location}/urlLists/*`.- Throws:
ApiException- if the remote call fails
-
deleteUrlListAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteUrlListAsync(String name) Deletes a single UrlList.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { String name = UrlListName.of("[PROJECT]", "[LOCATION]", "[URL_LIST]").toString(); networkSecurityClient.deleteUrlListAsync(name).get(); }- Parameters:
name- Required. A name of the UrlList to delete. Must be in the format `projects/*/locations/{location}/urlLists/*`.- Throws:
ApiException- if the remote call fails
-
deleteUrlListAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteUrlListAsync(DeleteUrlListRequest request) Deletes a single UrlList.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { DeleteUrlListRequest request = DeleteUrlListRequest.newBuilder() .setName(UrlListName.of("[PROJECT]", "[LOCATION]", "[URL_LIST]").toString()) .build(); networkSecurityClient.deleteUrlListAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteUrlListOperationCallable
public final OperationCallable<DeleteUrlListRequest,com.google.protobuf.Empty, deleteUrlListOperationCallable()OperationMetadata> Deletes a single UrlList.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { DeleteUrlListRequest request = DeleteUrlListRequest.newBuilder() .setName(UrlListName.of("[PROJECT]", "[LOCATION]", "[URL_LIST]").toString()) .build(); OperationFuture<Empty, OperationMetadata> future = networkSecurityClient.deleteUrlListOperationCallable().futureCall(request); // Do something. future.get(); } -
deleteUrlListCallable
Deletes a single UrlList.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { DeleteUrlListRequest request = DeleteUrlListRequest.newBuilder() .setName(UrlListName.of("[PROJECT]", "[LOCATION]", "[URL_LIST]").toString()) .build(); ApiFuture<Operation> future = networkSecurityClient.deleteUrlListCallable().futureCall(request); // Do something. future.get(); } -
listTlsInspectionPolicies
public final NetworkSecurityClient.ListTlsInspectionPoliciesPagedResponse listTlsInspectionPolicies(LocationName parent) Lists TlsInspectionPolicies in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); for (TlsInspectionPolicy element : networkSecurityClient.listTlsInspectionPolicies(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The project and location from which the TlsInspectionPolicies should be listed, specified in the format `projects/{project}/locations/{location}`.- Throws:
ApiException- if the remote call fails
-
listTlsInspectionPolicies
public final NetworkSecurityClient.ListTlsInspectionPoliciesPagedResponse listTlsInspectionPolicies(String parent) Lists TlsInspectionPolicies in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); for (TlsInspectionPolicy element : networkSecurityClient.listTlsInspectionPolicies(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The project and location from which the TlsInspectionPolicies should be listed, specified in the format `projects/{project}/locations/{location}`.- Throws:
ApiException- if the remote call fails
-
listTlsInspectionPolicies
public final NetworkSecurityClient.ListTlsInspectionPoliciesPagedResponse listTlsInspectionPolicies(ListTlsInspectionPoliciesRequest request) Lists TlsInspectionPolicies in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { ListTlsInspectionPoliciesRequest request = ListTlsInspectionPoliciesRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (TlsInspectionPolicy element : networkSecurityClient.listTlsInspectionPolicies(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listTlsInspectionPoliciesPagedCallable
public final UnaryCallable<ListTlsInspectionPoliciesRequest,NetworkSecurityClient.ListTlsInspectionPoliciesPagedResponse> listTlsInspectionPoliciesPagedCallable()Lists TlsInspectionPolicies in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { ListTlsInspectionPoliciesRequest request = ListTlsInspectionPoliciesRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<TlsInspectionPolicy> future = networkSecurityClient.listTlsInspectionPoliciesPagedCallable().futureCall(request); // Do something. for (TlsInspectionPolicy element : future.get().iterateAll()) { // doThingsWith(element); } } -
listTlsInspectionPoliciesCallable
public final UnaryCallable<ListTlsInspectionPoliciesRequest,ListTlsInspectionPoliciesResponse> listTlsInspectionPoliciesCallable()Lists TlsInspectionPolicies in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { ListTlsInspectionPoliciesRequest request = ListTlsInspectionPoliciesRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListTlsInspectionPoliciesResponse response = networkSecurityClient.listTlsInspectionPoliciesCallable().call(request); for (TlsInspectionPolicy element : response.getTlsInspectionPoliciesList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
getTlsInspectionPolicy
Gets details of a single TlsInspectionPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { TlsInspectionPolicyName name = TlsInspectionPolicyName.of("[PROJECT]", "[LOCATION]", "[TLS_INSPECTION_POLICY]"); TlsInspectionPolicy response = networkSecurityClient.getTlsInspectionPolicy(name); }- Parameters:
name- Required. A name of the TlsInspectionPolicy to get. Must be in the format `projects/{project}/locations/{location}/tlsInspectionPolicies/{tls_inspection_policy}`.- Throws:
ApiException- if the remote call fails
-
getTlsInspectionPolicy
Gets details of a single TlsInspectionPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { String name = TlsInspectionPolicyName.of("[PROJECT]", "[LOCATION]", "[TLS_INSPECTION_POLICY]") .toString(); TlsInspectionPolicy response = networkSecurityClient.getTlsInspectionPolicy(name); }- Parameters:
name- Required. A name of the TlsInspectionPolicy to get. Must be in the format `projects/{project}/locations/{location}/tlsInspectionPolicies/{tls_inspection_policy}`.- Throws:
ApiException- if the remote call fails
-
getTlsInspectionPolicy
Gets details of a single TlsInspectionPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { GetTlsInspectionPolicyRequest request = GetTlsInspectionPolicyRequest.newBuilder() .setName( TlsInspectionPolicyName.of("[PROJECT]", "[LOCATION]", "[TLS_INSPECTION_POLICY]") .toString()) .build(); TlsInspectionPolicy response = networkSecurityClient.getTlsInspectionPolicy(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getTlsInspectionPolicyCallable
public final UnaryCallable<GetTlsInspectionPolicyRequest,TlsInspectionPolicy> getTlsInspectionPolicyCallable()Gets details of a single TlsInspectionPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { GetTlsInspectionPolicyRequest request = GetTlsInspectionPolicyRequest.newBuilder() .setName( TlsInspectionPolicyName.of("[PROJECT]", "[LOCATION]", "[TLS_INSPECTION_POLICY]") .toString()) .build(); ApiFuture<TlsInspectionPolicy> future = networkSecurityClient.getTlsInspectionPolicyCallable().futureCall(request); // Do something. TlsInspectionPolicy response = future.get(); } -
createTlsInspectionPolicyAsync
public final OperationFuture<TlsInspectionPolicy,OperationMetadata> createTlsInspectionPolicyAsync(LocationName parent, TlsInspectionPolicy tlsInspectionPolicy, String tlsInspectionPolicyId) Creates a new TlsInspectionPolicy in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); TlsInspectionPolicy tlsInspectionPolicy = TlsInspectionPolicy.newBuilder().build(); String tlsInspectionPolicyId = "tlsInspectionPolicyId-647545892"; TlsInspectionPolicy response = networkSecurityClient .createTlsInspectionPolicyAsync(parent, tlsInspectionPolicy, tlsInspectionPolicyId) .get(); }- Parameters:
parent- Required. The parent resource of the TlsInspectionPolicy. Must be in the format `projects/{project}/locations/{location}`.tlsInspectionPolicy- Required. TlsInspectionPolicy resource to be created.tlsInspectionPolicyId- Required. Short name of the TlsInspectionPolicy resource to be created. This value should be 1-63 characters long, containing only letters, numbers, hyphens, and underscores, and should not start with a number. E.g. "tls_inspection_policy1".- Throws:
ApiException- if the remote call fails
-
createTlsInspectionPolicyAsync
public final OperationFuture<TlsInspectionPolicy,OperationMetadata> createTlsInspectionPolicyAsync(String parent, TlsInspectionPolicy tlsInspectionPolicy, String tlsInspectionPolicyId) Creates a new TlsInspectionPolicy in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); TlsInspectionPolicy tlsInspectionPolicy = TlsInspectionPolicy.newBuilder().build(); String tlsInspectionPolicyId = "tlsInspectionPolicyId-647545892"; TlsInspectionPolicy response = networkSecurityClient .createTlsInspectionPolicyAsync(parent, tlsInspectionPolicy, tlsInspectionPolicyId) .get(); }- Parameters:
parent- Required. The parent resource of the TlsInspectionPolicy. Must be in the format `projects/{project}/locations/{location}`.tlsInspectionPolicy- Required. TlsInspectionPolicy resource to be created.tlsInspectionPolicyId- Required. Short name of the TlsInspectionPolicy resource to be created. This value should be 1-63 characters long, containing only letters, numbers, hyphens, and underscores, and should not start with a number. E.g. "tls_inspection_policy1".- Throws:
ApiException- if the remote call fails
-
createTlsInspectionPolicyAsync
public final OperationFuture<TlsInspectionPolicy,OperationMetadata> createTlsInspectionPolicyAsync(CreateTlsInspectionPolicyRequest request) Creates a new TlsInspectionPolicy in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { CreateTlsInspectionPolicyRequest request = CreateTlsInspectionPolicyRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setTlsInspectionPolicyId("tlsInspectionPolicyId-647545892") .setTlsInspectionPolicy(TlsInspectionPolicy.newBuilder().build()) .build(); TlsInspectionPolicy response = networkSecurityClient.createTlsInspectionPolicyAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createTlsInspectionPolicyOperationCallable
public final OperationCallable<CreateTlsInspectionPolicyRequest,TlsInspectionPolicy, createTlsInspectionPolicyOperationCallable()OperationMetadata> Creates a new TlsInspectionPolicy in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { CreateTlsInspectionPolicyRequest request = CreateTlsInspectionPolicyRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setTlsInspectionPolicyId("tlsInspectionPolicyId-647545892") .setTlsInspectionPolicy(TlsInspectionPolicy.newBuilder().build()) .build(); OperationFuture<TlsInspectionPolicy, OperationMetadata> future = networkSecurityClient.createTlsInspectionPolicyOperationCallable().futureCall(request); // Do something. TlsInspectionPolicy response = future.get(); } -
createTlsInspectionPolicyCallable
public final UnaryCallable<CreateTlsInspectionPolicyRequest,Operation> createTlsInspectionPolicyCallable()Creates a new TlsInspectionPolicy in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { CreateTlsInspectionPolicyRequest request = CreateTlsInspectionPolicyRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setTlsInspectionPolicyId("tlsInspectionPolicyId-647545892") .setTlsInspectionPolicy(TlsInspectionPolicy.newBuilder().build()) .build(); ApiFuture<Operation> future = networkSecurityClient.createTlsInspectionPolicyCallable().futureCall(request); // Do something. Operation response = future.get(); } -
updateTlsInspectionPolicyAsync
public final OperationFuture<TlsInspectionPolicy,OperationMetadata> updateTlsInspectionPolicyAsync(TlsInspectionPolicy tlsInspectionPolicy, com.google.protobuf.FieldMask updateMask) Updates the parameters of a single TlsInspectionPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { TlsInspectionPolicy tlsInspectionPolicy = TlsInspectionPolicy.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); TlsInspectionPolicy response = networkSecurityClient .updateTlsInspectionPolicyAsync(tlsInspectionPolicy, updateMask) .get(); }- Parameters:
tlsInspectionPolicy- Required. Updated TlsInspectionPolicy resource.updateMask- Optional. Field mask is used to specify the fields to be overwritten in the TlsInspectionPolicy resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten.- Throws:
ApiException- if the remote call fails
-
updateTlsInspectionPolicyAsync
public final OperationFuture<TlsInspectionPolicy,OperationMetadata> updateTlsInspectionPolicyAsync(UpdateTlsInspectionPolicyRequest request) Updates the parameters of a single TlsInspectionPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { UpdateTlsInspectionPolicyRequest request = UpdateTlsInspectionPolicyRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setTlsInspectionPolicy(TlsInspectionPolicy.newBuilder().build()) .build(); TlsInspectionPolicy response = networkSecurityClient.updateTlsInspectionPolicyAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateTlsInspectionPolicyOperationCallable
public final OperationCallable<UpdateTlsInspectionPolicyRequest,TlsInspectionPolicy, updateTlsInspectionPolicyOperationCallable()OperationMetadata> Updates the parameters of a single TlsInspectionPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { UpdateTlsInspectionPolicyRequest request = UpdateTlsInspectionPolicyRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setTlsInspectionPolicy(TlsInspectionPolicy.newBuilder().build()) .build(); OperationFuture<TlsInspectionPolicy, OperationMetadata> future = networkSecurityClient.updateTlsInspectionPolicyOperationCallable().futureCall(request); // Do something. TlsInspectionPolicy response = future.get(); } -
updateTlsInspectionPolicyCallable
public final UnaryCallable<UpdateTlsInspectionPolicyRequest,Operation> updateTlsInspectionPolicyCallable()Updates the parameters of a single TlsInspectionPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { UpdateTlsInspectionPolicyRequest request = UpdateTlsInspectionPolicyRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setTlsInspectionPolicy(TlsInspectionPolicy.newBuilder().build()) .build(); ApiFuture<Operation> future = networkSecurityClient.updateTlsInspectionPolicyCallable().futureCall(request); // Do something. Operation response = future.get(); } -
deleteTlsInspectionPolicyAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteTlsInspectionPolicyAsync(TlsInspectionPolicyName name) Deletes a single TlsInspectionPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { TlsInspectionPolicyName name = TlsInspectionPolicyName.of("[PROJECT]", "[LOCATION]", "[TLS_INSPECTION_POLICY]"); networkSecurityClient.deleteTlsInspectionPolicyAsync(name).get(); }- Parameters:
name- Required. A name of the TlsInspectionPolicy to delete. Must be in the format `projects/{project}/locations/{location}/tlsInspectionPolicies/{tls_inspection_policy}`.- Throws:
ApiException- if the remote call fails
-
deleteTlsInspectionPolicyAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteTlsInspectionPolicyAsync(String name) Deletes a single TlsInspectionPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { String name = TlsInspectionPolicyName.of("[PROJECT]", "[LOCATION]", "[TLS_INSPECTION_POLICY]") .toString(); networkSecurityClient.deleteTlsInspectionPolicyAsync(name).get(); }- Parameters:
name- Required. A name of the TlsInspectionPolicy to delete. Must be in the format `projects/{project}/locations/{location}/tlsInspectionPolicies/{tls_inspection_policy}`.- Throws:
ApiException- if the remote call fails
-
deleteTlsInspectionPolicyAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteTlsInspectionPolicyAsync(DeleteTlsInspectionPolicyRequest request) Deletes a single TlsInspectionPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { DeleteTlsInspectionPolicyRequest request = DeleteTlsInspectionPolicyRequest.newBuilder() .setName( TlsInspectionPolicyName.of("[PROJECT]", "[LOCATION]", "[TLS_INSPECTION_POLICY]") .toString()) .setForce(true) .build(); networkSecurityClient.deleteTlsInspectionPolicyAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteTlsInspectionPolicyOperationCallable
public final OperationCallable<DeleteTlsInspectionPolicyRequest,com.google.protobuf.Empty, deleteTlsInspectionPolicyOperationCallable()OperationMetadata> Deletes a single TlsInspectionPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { DeleteTlsInspectionPolicyRequest request = DeleteTlsInspectionPolicyRequest.newBuilder() .setName( TlsInspectionPolicyName.of("[PROJECT]", "[LOCATION]", "[TLS_INSPECTION_POLICY]") .toString()) .setForce(true) .build(); OperationFuture<Empty, OperationMetadata> future = networkSecurityClient.deleteTlsInspectionPolicyOperationCallable().futureCall(request); // Do something. future.get(); } -
deleteTlsInspectionPolicyCallable
public final UnaryCallable<DeleteTlsInspectionPolicyRequest,Operation> deleteTlsInspectionPolicyCallable()Deletes a single TlsInspectionPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { DeleteTlsInspectionPolicyRequest request = DeleteTlsInspectionPolicyRequest.newBuilder() .setName( TlsInspectionPolicyName.of("[PROJECT]", "[LOCATION]", "[TLS_INSPECTION_POLICY]") .toString()) .setForce(true) .build(); ApiFuture<Operation> future = networkSecurityClient.deleteTlsInspectionPolicyCallable().futureCall(request); // Do something. future.get(); } -
listAuthzPolicies
public final NetworkSecurityClient.ListAuthzPoliciesPagedResponse listAuthzPolicies(LocationName parent) Lists AuthzPolicies in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); for (AuthzPolicy element : networkSecurityClient.listAuthzPolicies(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The project and location from which the `AuthzPolicy` resources are listed, specified in the following format: `projects/{project}/locations/{location}`.- Throws:
ApiException- if the remote call fails
-
listAuthzPolicies
Lists AuthzPolicies in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); for (AuthzPolicy element : networkSecurityClient.listAuthzPolicies(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The project and location from which the `AuthzPolicy` resources are listed, specified in the following format: `projects/{project}/locations/{location}`.- Throws:
ApiException- if the remote call fails
-
listAuthzPolicies
public final NetworkSecurityClient.ListAuthzPoliciesPagedResponse listAuthzPolicies(ListAuthzPoliciesRequest request) Lists AuthzPolicies in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { ListAuthzPoliciesRequest request = ListAuthzPoliciesRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); for (AuthzPolicy element : networkSecurityClient.listAuthzPolicies(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listAuthzPoliciesPagedCallable
public final UnaryCallable<ListAuthzPoliciesRequest,NetworkSecurityClient.ListAuthzPoliciesPagedResponse> listAuthzPoliciesPagedCallable()Lists AuthzPolicies in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { ListAuthzPoliciesRequest request = ListAuthzPoliciesRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); ApiFuture<AuthzPolicy> future = networkSecurityClient.listAuthzPoliciesPagedCallable().futureCall(request); // Do something. for (AuthzPolicy element : future.get().iterateAll()) { // doThingsWith(element); } } -
listAuthzPoliciesCallable
public final UnaryCallable<ListAuthzPoliciesRequest,ListAuthzPoliciesResponse> listAuthzPoliciesCallable()Lists AuthzPolicies in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { ListAuthzPoliciesRequest request = ListAuthzPoliciesRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); while (true) { ListAuthzPoliciesResponse response = networkSecurityClient.listAuthzPoliciesCallable().call(request); for (AuthzPolicy element : response.getAuthzPoliciesList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
getAuthzPolicy
Gets details of a single AuthzPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { AuthzPolicyName name = AuthzPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHZ_POLICY]"); AuthzPolicy response = networkSecurityClient.getAuthzPolicy(name); }- Parameters:
name- Required. A name of the `AuthzPolicy` resource to get. Must be in the format `projects/{project}/locations/{location}/authzPolicies/{authz_policy}`.- Throws:
ApiException- if the remote call fails
-
getAuthzPolicy
Gets details of a single AuthzPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { String name = AuthzPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHZ_POLICY]").toString(); AuthzPolicy response = networkSecurityClient.getAuthzPolicy(name); }- Parameters:
name- Required. A name of the `AuthzPolicy` resource to get. Must be in the format `projects/{project}/locations/{location}/authzPolicies/{authz_policy}`.- Throws:
ApiException- if the remote call fails
-
getAuthzPolicy
Gets details of a single AuthzPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { GetAuthzPolicyRequest request = GetAuthzPolicyRequest.newBuilder() .setName(AuthzPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHZ_POLICY]").toString()) .build(); AuthzPolicy response = networkSecurityClient.getAuthzPolicy(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getAuthzPolicyCallable
Gets details of a single AuthzPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { GetAuthzPolicyRequest request = GetAuthzPolicyRequest.newBuilder() .setName(AuthzPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHZ_POLICY]").toString()) .build(); ApiFuture<AuthzPolicy> future = networkSecurityClient.getAuthzPolicyCallable().futureCall(request); // Do something. AuthzPolicy response = future.get(); } -
createAuthzPolicyAsync
public final OperationFuture<AuthzPolicy,OperationMetadata> createAuthzPolicyAsync(LocationName parent, AuthzPolicy authzPolicy, String authzPolicyId) Creates a new AuthzPolicy in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); AuthzPolicy authzPolicy = AuthzPolicy.newBuilder().build(); String authzPolicyId = "authzPolicyId1717400543"; AuthzPolicy response = networkSecurityClient.createAuthzPolicyAsync(parent, authzPolicy, authzPolicyId).get(); }- Parameters:
parent- Required. The parent resource of the `AuthzPolicy` resource. Must be in the format `projects/{project}/locations/{location}`.authzPolicy- Required. `AuthzPolicy` resource to be created.authzPolicyId- Required. User-provided ID of the `AuthzPolicy` resource to be created.- Throws:
ApiException- if the remote call fails
-
createAuthzPolicyAsync
public final OperationFuture<AuthzPolicy,OperationMetadata> createAuthzPolicyAsync(String parent, AuthzPolicy authzPolicy, String authzPolicyId) Creates a new AuthzPolicy in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); AuthzPolicy authzPolicy = AuthzPolicy.newBuilder().build(); String authzPolicyId = "authzPolicyId1717400543"; AuthzPolicy response = networkSecurityClient.createAuthzPolicyAsync(parent, authzPolicy, authzPolicyId).get(); }- Parameters:
parent- Required. The parent resource of the `AuthzPolicy` resource. Must be in the format `projects/{project}/locations/{location}`.authzPolicy- Required. `AuthzPolicy` resource to be created.authzPolicyId- Required. User-provided ID of the `AuthzPolicy` resource to be created.- Throws:
ApiException- if the remote call fails
-
createAuthzPolicyAsync
public final OperationFuture<AuthzPolicy,OperationMetadata> createAuthzPolicyAsync(CreateAuthzPolicyRequest request) Creates a new AuthzPolicy in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { CreateAuthzPolicyRequest request = CreateAuthzPolicyRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setAuthzPolicyId("authzPolicyId1717400543") .setAuthzPolicy(AuthzPolicy.newBuilder().build()) .setRequestId("requestId693933066") .build(); AuthzPolicy response = networkSecurityClient.createAuthzPolicyAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createAuthzPolicyOperationCallable
public final OperationCallable<CreateAuthzPolicyRequest,AuthzPolicy, createAuthzPolicyOperationCallable()OperationMetadata> Creates a new AuthzPolicy in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { CreateAuthzPolicyRequest request = CreateAuthzPolicyRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setAuthzPolicyId("authzPolicyId1717400543") .setAuthzPolicy(AuthzPolicy.newBuilder().build()) .setRequestId("requestId693933066") .build(); OperationFuture<AuthzPolicy, OperationMetadata> future = networkSecurityClient.createAuthzPolicyOperationCallable().futureCall(request); // Do something. AuthzPolicy response = future.get(); } -
createAuthzPolicyCallable
Creates a new AuthzPolicy in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { CreateAuthzPolicyRequest request = CreateAuthzPolicyRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setAuthzPolicyId("authzPolicyId1717400543") .setAuthzPolicy(AuthzPolicy.newBuilder().build()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = networkSecurityClient.createAuthzPolicyCallable().futureCall(request); // Do something. Operation response = future.get(); } -
updateAuthzPolicyAsync
public final OperationFuture<AuthzPolicy,OperationMetadata> updateAuthzPolicyAsync(AuthzPolicy authzPolicy, com.google.protobuf.FieldMask updateMask) Updates the parameters of a single AuthzPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { AuthzPolicy authzPolicy = AuthzPolicy.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); AuthzPolicy response = networkSecurityClient.updateAuthzPolicyAsync(authzPolicy, updateMask).get(); }- Parameters:
authzPolicy- Required. `AuthzPolicy` resource being updated.updateMask- Required. Used to specify the fields to be overwritten in the `AuthzPolicy` resource by the update. The fields specified in the `update_mask` are relative to the resource, not the full request. A field is overwritten if it is in the mask. If the user does not specify a mask, then all fields are overwritten.- Throws:
ApiException- if the remote call fails
-
updateAuthzPolicyAsync
public final OperationFuture<AuthzPolicy,OperationMetadata> updateAuthzPolicyAsync(UpdateAuthzPolicyRequest request) Updates the parameters of a single AuthzPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { UpdateAuthzPolicyRequest request = UpdateAuthzPolicyRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setAuthzPolicy(AuthzPolicy.newBuilder().build()) .setRequestId("requestId693933066") .build(); AuthzPolicy response = networkSecurityClient.updateAuthzPolicyAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateAuthzPolicyOperationCallable
public final OperationCallable<UpdateAuthzPolicyRequest,AuthzPolicy, updateAuthzPolicyOperationCallable()OperationMetadata> Updates the parameters of a single AuthzPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { UpdateAuthzPolicyRequest request = UpdateAuthzPolicyRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setAuthzPolicy(AuthzPolicy.newBuilder().build()) .setRequestId("requestId693933066") .build(); OperationFuture<AuthzPolicy, OperationMetadata> future = networkSecurityClient.updateAuthzPolicyOperationCallable().futureCall(request); // Do something. AuthzPolicy response = future.get(); } -
updateAuthzPolicyCallable
Updates the parameters of a single AuthzPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { UpdateAuthzPolicyRequest request = UpdateAuthzPolicyRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setAuthzPolicy(AuthzPolicy.newBuilder().build()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = networkSecurityClient.updateAuthzPolicyCallable().futureCall(request); // Do something. Operation response = future.get(); } -
deleteAuthzPolicyAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteAuthzPolicyAsync(AuthzPolicyName name) Deletes a single AuthzPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { AuthzPolicyName name = AuthzPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHZ_POLICY]"); networkSecurityClient.deleteAuthzPolicyAsync(name).get(); }- Parameters:
name- Required. The name of the `AuthzPolicy` resource to delete. Must be in the format `projects/{project}/locations/{location}/authzPolicies/{authz_policy}`.- Throws:
ApiException- if the remote call fails
-
deleteAuthzPolicyAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteAuthzPolicyAsync(String name) Deletes a single AuthzPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { String name = AuthzPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHZ_POLICY]").toString(); networkSecurityClient.deleteAuthzPolicyAsync(name).get(); }- Parameters:
name- Required. The name of the `AuthzPolicy` resource to delete. Must be in the format `projects/{project}/locations/{location}/authzPolicies/{authz_policy}`.- Throws:
ApiException- if the remote call fails
-
deleteAuthzPolicyAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteAuthzPolicyAsync(DeleteAuthzPolicyRequest request) Deletes a single AuthzPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { DeleteAuthzPolicyRequest request = DeleteAuthzPolicyRequest.newBuilder() .setName(AuthzPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHZ_POLICY]").toString()) .setRequestId("requestId693933066") .build(); networkSecurityClient.deleteAuthzPolicyAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteAuthzPolicyOperationCallable
public final OperationCallable<DeleteAuthzPolicyRequest,com.google.protobuf.Empty, deleteAuthzPolicyOperationCallable()OperationMetadata> Deletes a single AuthzPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { DeleteAuthzPolicyRequest request = DeleteAuthzPolicyRequest.newBuilder() .setName(AuthzPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHZ_POLICY]").toString()) .setRequestId("requestId693933066") .build(); OperationFuture<Empty, OperationMetadata> future = networkSecurityClient.deleteAuthzPolicyOperationCallable().futureCall(request); // Do something. future.get(); } -
deleteAuthzPolicyCallable
Deletes a single AuthzPolicy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { DeleteAuthzPolicyRequest request = DeleteAuthzPolicyRequest.newBuilder() .setName(AuthzPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHZ_POLICY]").toString()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = networkSecurityClient.deleteAuthzPolicyCallable().futureCall(request); // Do something. future.get(); } -
listLocations
public final NetworkSecurityClient.ListLocationsPagedResponse listLocations(ListLocationsRequest request) Lists information about the supported locations for this service.This method lists locations based on the resource scope provided inthe [ListLocationsRequest.name] field:
* **Global locations**: If `name` is empty, the method lists thepublic locations available to all projects. * **Project-specificlocations**: If `name` follows the format`projects/{project}`, the method lists locations visible to thatspecific project. This includes public, private, or otherproject-specific locations enabled for the project.
For gRPC and client library implementations, the resource name ispassed as the `name` field. For direct service calls, the resourcename isincorporated into the request path based on the specific serviceimplementation and version.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (Location element : networkSecurityClient.listLocations(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listLocationsPagedCallable
public final UnaryCallable<ListLocationsRequest,NetworkSecurityClient.ListLocationsPagedResponse> listLocationsPagedCallable()Lists information about the supported locations for this service.This method lists locations based on the resource scope provided inthe [ListLocationsRequest.name] field:
* **Global locations**: If `name` is empty, the method lists thepublic locations available to all projects. * **Project-specificlocations**: If `name` follows the format`projects/{project}`, the method lists locations visible to thatspecific project. This includes public, private, or otherproject-specific locations enabled for the project.
For gRPC and client library implementations, the resource name ispassed as the `name` field. For direct service calls, the resourcename isincorporated into the request path based on the specific serviceimplementation and version.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<Location> future = networkSecurityClient.listLocationsPagedCallable().futureCall(request); // Do something. for (Location element : future.get().iterateAll()) { // doThingsWith(element); } } -
listLocationsCallable
Lists information about the supported locations for this service.This method lists locations based on the resource scope provided inthe [ListLocationsRequest.name] field:
* **Global locations**: If `name` is empty, the method lists thepublic locations available to all projects. * **Project-specificlocations**: If `name` follows the format`projects/{project}`, the method lists locations visible to thatspecific project. This includes public, private, or otherproject-specific locations enabled for the project.
For gRPC and client library implementations, the resource name ispassed as the `name` field. For direct service calls, the resourcename isincorporated into the request path based on the specific serviceimplementation and version.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListLocationsResponse response = networkSecurityClient.listLocationsCallable().call(request); for (Location element : response.getLocationsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
getLocation
Gets information about a location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); Location response = networkSecurityClient.getLocation(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getLocationCallable
Gets information about a location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); ApiFuture<Location> future = networkSecurityClient.getLocationCallable().futureCall(request); // Do something. Location response = future.get(); } -
setIamPolicy
Sets the access control policy on the specified resource. Replacesany existing policy.Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { SetIamPolicyRequest request = SetIamPolicyRequest.newBuilder() .setResource( AddressGroupName.ofProjectLocationAddressGroupName( "[PROJECT]", "[LOCATION]", "[ADDRESS_GROUP]") .toString()) .setPolicy(Policy.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); Policy response = networkSecurityClient.setIamPolicy(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
setIamPolicyCallable
Sets the access control policy on the specified resource. Replacesany existing policy.Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { SetIamPolicyRequest request = SetIamPolicyRequest.newBuilder() .setResource( AddressGroupName.ofProjectLocationAddressGroupName( "[PROJECT]", "[LOCATION]", "[ADDRESS_GROUP]") .toString()) .setPolicy(Policy.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); ApiFuture<Policy> future = networkSecurityClient.setIamPolicyCallable().futureCall(request); // Do something. Policy response = future.get(); } -
getIamPolicy
Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder() .setResource( AddressGroupName.ofProjectLocationAddressGroupName( "[PROJECT]", "[LOCATION]", "[ADDRESS_GROUP]") .toString()) .setOptions(GetPolicyOptions.newBuilder().build()) .build(); Policy response = networkSecurityClient.getIamPolicy(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getIamPolicyCallable
Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder() .setResource( AddressGroupName.ofProjectLocationAddressGroupName( "[PROJECT]", "[LOCATION]", "[ADDRESS_GROUP]") .toString()) .setOptions(GetPolicyOptions.newBuilder().build()) .build(); ApiFuture<Policy> future = networkSecurityClient.getIamPolicyCallable().futureCall(request); // Do something. Policy response = future.get(); } -
testIamPermissions
Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a `NOT_FOUND` error.Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { TestIamPermissionsRequest request = TestIamPermissionsRequest.newBuilder() .setResource( AddressGroupName.ofProjectLocationAddressGroupName( "[PROJECT]", "[LOCATION]", "[ADDRESS_GROUP]") .toString()) .addAllPermissions(new ArrayList<String>()) .build(); TestIamPermissionsResponse response = networkSecurityClient.testIamPermissions(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
testIamPermissionsCallable
public final UnaryCallable<TestIamPermissionsRequest,TestIamPermissionsResponse> testIamPermissionsCallable()Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a `NOT_FOUND` error.Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { TestIamPermissionsRequest request = TestIamPermissionsRequest.newBuilder() .setResource( AddressGroupName.ofProjectLocationAddressGroupName( "[PROJECT]", "[LOCATION]", "[ADDRESS_GROUP]") .toString()) .addAllPermissions(new ArrayList<String>()) .build(); ApiFuture<TestIamPermissionsResponse> future = networkSecurityClient.testIamPermissionsCallable().futureCall(request); // Do something. TestIamPermissionsResponse response = future.get(); } -
close
public final void close()- Specified by:
closein interfaceAutoCloseable
-
shutdown
public void shutdown()- Specified by:
shutdownin interfaceBackgroundResource
-
isShutdown
public boolean isShutdown()- Specified by:
isShutdownin interfaceBackgroundResource
-
isTerminated
public boolean isTerminated()- Specified by:
isTerminatedin interfaceBackgroundResource
-
shutdownNow
public void shutdownNow()- Specified by:
shutdownNowin interfaceBackgroundResource
-
awaitTermination
- Specified by:
awaitTerminationin interfaceBackgroundResource- Throws:
InterruptedException
-