Class AddressGroupServiceClient (0.77.0)

GitHub RepositoryProduct Reference

Service Description: AddressGroup is a resource that manages a collection of IP or Domain Names, it can be used in Firewall Policy to represent allow or deny traffic from all the IP or Domain Names from the Address Group.

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 (AddressGroupServiceClient addressGroupServiceClient = AddressGroupServiceClient.create()) {
   AddressGroupName name =
       AddressGroupName.ofProjectLocationAddressGroupName(
           "[PROJECT]", "[LOCATION]", "[ADDRESS_GROUP]");
   AddressGroup response = addressGroupServiceClient.getAddressGroup(name);
 }
 

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

Methods
Method Description Method Variants

ListAddressGroups

Lists address groups in a given project and location.

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

  • listAddressGroups(ListAddressGroupsRequest request)

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

  • listAddressGroups(LocationName parent)

  • listAddressGroups(String parent)

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

  • listAddressGroupsPagedCallable()

  • listAddressGroupsCallable()

GetAddressGroup

Gets details of a single address group.

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

  • getAddressGroup(GetAddressGroupRequest request)

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

  • getAddressGroup(AddressGroupName name)

  • getAddressGroup(String name)

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

  • getAddressGroupCallable()

CreateAddressGroup

Creates a new address group in a given project and location.

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

  • createAddressGroupAsync(CreateAddressGroupRequest request)

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

  • createAddressGroupAsync(LocationName parent, AddressGroup addressGroup, String addressGroupId)

  • createAddressGroupAsync(OrganizationLocationName parent, AddressGroup addressGroup, String addressGroupId)

  • createAddressGroupAsync(String parent, AddressGroup addressGroup, String addressGroupId)

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

  • createAddressGroupOperationCallable()

  • createAddressGroupCallable()

UpdateAddressGroup

Updates the parameters of a single address group.

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

  • updateAddressGroupAsync(UpdateAddressGroupRequest request)

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

  • updateAddressGroupAsync(AddressGroup addressGroup, FieldMask updateMask)

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

  • updateAddressGroupOperationCallable()

  • updateAddressGroupCallable()

AddAddressGroupItems

Adds items to an address group.

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

  • addAddressGroupItemsAsync(AddAddressGroupItemsRequest request)

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

  • addAddressGroupItemsAsync(AddressGroupName addressGroup, List<String> items)

  • addAddressGroupItemsAsync(String addressGroup, List<String> items)

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

  • addAddressGroupItemsOperationCallable()

  • addAddressGroupItemsCallable()

RemoveAddressGroupItems

Removes items from an address group.

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

  • removeAddressGroupItemsAsync(RemoveAddressGroupItemsRequest request)

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

  • removeAddressGroupItemsAsync(AddressGroupName addressGroup, List<String> items)

  • removeAddressGroupItemsAsync(String addressGroup, List<String> items)

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

  • removeAddressGroupItemsOperationCallable()

  • removeAddressGroupItemsCallable()

CloneAddressGroupItems

Clones items from one address group to another.

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

  • cloneAddressGroupItemsAsync(CloneAddressGroupItemsRequest request)

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

  • cloneAddressGroupItemsAsync(AddressGroupName addressGroup, AddressGroupName sourceAddressGroup)

  • cloneAddressGroupItemsAsync(AddressGroupName addressGroup, String sourceAddressGroup)

  • cloneAddressGroupItemsAsync(String addressGroup, AddressGroupName sourceAddressGroup)

  • cloneAddressGroupItemsAsync(String addressGroup, String sourceAddressGroup)

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

  • cloneAddressGroupItemsOperationCallable()

  • cloneAddressGroupItemsCallable()

DeleteAddressGroup

Deletes a single address group.

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

  • deleteAddressGroupAsync(DeleteAddressGroupRequest request)

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

  • deleteAddressGroupAsync(AddressGroupName name)

  • deleteAddressGroupAsync(String name)

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

  • deleteAddressGroupOperationCallable()

  • deleteAddressGroupCallable()

ListAddressGroupReferences

Lists references of an address group.

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

  • listAddressGroupReferences(ListAddressGroupReferencesRequest request)

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

  • listAddressGroupReferences(AddressGroupName addressGroup)

  • listAddressGroupReferences(String addressGroup)

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

  • listAddressGroupReferencesPagedCallable()

  • listAddressGroupReferencesCallable()

ListLocations

Lists information about the supported locations for this service.

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

  • listLocations(ListLocationsRequest request)

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

  • listLocationsPagedCallable()

  • listLocationsCallable()

GetLocation

Gets information about a location.

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

  • getLocation(GetLocationRequest request)

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

  • getLocationCallable()

SetIamPolicy

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

Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIEDerrors.

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

  • setIamPolicy(SetIamPolicyRequest request)

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

  • setIamPolicyCallable()

GetIamPolicy

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

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

  • getIamPolicy(GetIamPolicyRequest request)

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

  • getIamPolicyCallable()

TestIamPermissions

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

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

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

  • testIamPermissions(TestIamPermissionsRequest request)

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

  • testIamPermissionsCallable()

See the individual methods for example code.

Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.

This class can be customized by passing in a custom instance of AddressGroupServiceSettings 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
 AddressGroupServiceSettings addressGroupServiceSettings =
     AddressGroupServiceSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 AddressGroupServiceClient addressGroupServiceClient =
     AddressGroupServiceClient.create(addressGroupServiceSettings);
 

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
 AddressGroupServiceSettings addressGroupServiceSettings =
     AddressGroupServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
 AddressGroupServiceClient addressGroupServiceClient =
     AddressGroupServiceClient.create(addressGroupServiceSettings);
 

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

Inheritance

java.lang.Object > AddressGroupServiceClient

Static Methods

create()

public static final AddressGroupServiceClient create()

Constructs an instance of AddressGroupServiceClient with default settings.

Returns
Type Description
AddressGroupServiceClient
Exceptions
Type Description
IOException

create(AddressGroupServiceSettings settings)

public static final AddressGroupServiceClient create(AddressGroupServiceSettings settings)

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

Parameter
Name Description
settings AddressGroupServiceSettings
Returns
Type Description
AddressGroupServiceClient
Exceptions
Type Description
IOException

create(AddressGroupServiceStub stub)

public static final AddressGroupServiceClient create(AddressGroupServiceStub stub)

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

Parameter
Name Description
stub AddressGroupServiceStub
Returns
Type Description
AddressGroupServiceClient

Constructors

AddressGroupServiceClient(AddressGroupServiceSettings settings)

protected AddressGroupServiceClient(AddressGroupServiceSettings settings)

Constructs an instance of AddressGroupServiceClient, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.

Parameter
Name Description
settings AddressGroupServiceSettings

AddressGroupServiceClient(AddressGroupServiceStub stub)

protected AddressGroupServiceClient(AddressGroupServiceStub stub)
Parameter
Name Description
stub AddressGroupServiceStub

Methods

addAddressGroupItemsAsync(AddAddressGroupItemsRequest request)

public final OperationFuture<AddressGroup,OperationMetadata> addAddressGroupItemsAsync(AddAddressGroupItemsRequest request)

Adds items to an address group.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AddressGroupServiceClient addressGroupServiceClient = AddressGroupServiceClient.create()) {
   AddAddressGroupItemsRequest request =
       AddAddressGroupItemsRequest.newBuilder()
           .setAddressGroup(
               AddressGroupName.ofProjectLocationAddressGroupName(
                       "[PROJECT]", "[LOCATION]", "[ADDRESS_GROUP]")
                   .toString())
           .addAllItems(new ArrayList<String>())
           .setRequestId("requestId693933066")
           .build();
   AddressGroup response = addressGroupServiceClient.addAddressGroupItemsAsync(request).get();
 }
 
Parameter
Name Description
request AddAddressGroupItemsRequest

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

Returns
Type Description
OperationFuture<AddressGroup,OperationMetadata>

addAddressGroupItemsAsync(AddressGroupName addressGroup, List<String> items)

public final OperationFuture<AddressGroup,OperationMetadata> addAddressGroupItemsAsync(AddressGroupName addressGroup, List<String> items)

Adds items to an address group.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AddressGroupServiceClient addressGroupServiceClient = AddressGroupServiceClient.create()) {
   AddressGroupName addressGroup =
       AddressGroupName.ofProjectLocationAddressGroupName(
           "[PROJECT]", "[LOCATION]", "[ADDRESS_GROUP]");
   List<String> items = new ArrayList<>();
   AddressGroup response =
       addressGroupServiceClient.addAddressGroupItemsAsync(addressGroup, items).get();
 }
 
Parameters
Name Description
addressGroup AddressGroupName

Required. A name of the AddressGroup to add items to. Must be in the format projects|organization/*/locations/{location}/addressGroups/*.

items List<String>

Required. List of items to add.

Returns
Type Description
OperationFuture<AddressGroup,OperationMetadata>

addAddressGroupItemsAsync(String addressGroup, List<String> items)

public final OperationFuture<AddressGroup,OperationMetadata> addAddressGroupItemsAsync(String addressGroup, List<String> items)

Adds items to an address group.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AddressGroupServiceClient addressGroupServiceClient = AddressGroupServiceClient.create()) {
   String addressGroup =
       AddressGroupName.ofProjectLocationAddressGroupName(
               "[PROJECT]", "[LOCATION]", "[ADDRESS_GROUP]")
           .toString();
   List<String> items = new ArrayList<>();
   AddressGroup response =
       addressGroupServiceClient.addAddressGroupItemsAsync(addressGroup, items).get();
 }
 
Parameters
Name Description
addressGroup String

Required. A name of the AddressGroup to add items to. Must be in the format projects|organization/*/locations/{location}/addressGroups/*.

items List<String>

Required. List of items to add.

Returns
Type Description
OperationFuture<AddressGroup,OperationMetadata>

addAddressGroupItemsCallable()

public final UnaryCallable<AddAddressGroupItemsRequest,Operation> addAddressGroupItemsCallable()

Adds items to an address group.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AddressGroupServiceClient addressGroupServiceClient = AddressGroupServiceClient.create()) {
   AddAddressGroupItemsRequest request =
       AddAddressGroupItemsRequest.newBuilder()
           .setAddressGroup(
               AddressGroupName.ofProjectLocationAddressGroupName(
                       "[PROJECT]", "[LOCATION]", "[ADDRESS_GROUP]")
                   .toString())
           .addAllItems(new ArrayList<String>())
           .setRequestId("requestId693933066")
           .build();
   ApiFuture<Operation> future =
       addressGroupServiceClient.addAddressGroupItemsCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<AddAddressGroupItemsRequest,Operation>

addAddressGroupItemsOperationCallable()

public final OperationCallable<AddAddressGroupItemsRequest,AddressGroup,OperationMetadata> addAddressGroupItemsOperationCallable()

Adds items to an address group.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AddressGroupServiceClient addressGroupServiceClient = AddressGroupServiceClient.create()) {
   AddAddressGroupItemsRequest request =
       AddAddressGroupItemsRequest.newBuilder()
           .setAddressGroup(
               AddressGroupName.ofProjectLocationAddressGroupName(
                       "[PROJECT]", "[LOCATION]", "[ADDRESS_GROUP]")
                   .toString())
           .addAllItems(new ArrayList<String>())
           .setRequestId("requestId693933066")
           .build();
   OperationFuture<AddressGroup, OperationMetadata> future =
       addressGroupServiceClient.addAddressGroupItemsOperationCallable().futureCall(request);
   // Do something.
   AddressGroup response = future.get();
 }
 
Returns
Type Description
OperationCallable<AddAddressGroupItemsRequest,AddressGroup,OperationMetadata>

awaitTermination(long duration, TimeUnit unit)

public boolean awaitTermination(long duration, TimeUnit unit)
Parameters
Name Description
duration long
unit TimeUnit
Returns
Type Description
boolean
Exceptions
Type Description
InterruptedException

cloneAddressGroupItemsAsync(AddressGroupName addressGroup, AddressGroupName sourceAddressGroup)

public final OperationFuture<AddressGroup,OperationMetadata> cloneAddressGroupItemsAsync(AddressGroupName addressGroup, AddressGroupName sourceAddressGroup)

Clones items from one address group to another.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AddressGroupServiceClient addressGroupServiceClient = AddressGroupServiceClient.create()) {
   AddressGroupName addressGroup =
       AddressGroupName.ofProjectLocationAddressGroupName(
           "[PROJECT]", "[LOCATION]", "[ADDRESS_GROUP]");
   AddressGroupName sourceAddressGroup =
       AddressGroupName.ofProjectLocationAddressGroupName(
           "[PROJECT]", "[LOCATION]", "[ADDRESS_GROUP]");
   AddressGroup response =
       addressGroupServiceClient
           .cloneAddressGroupItemsAsync(addressGroup, sourceAddressGroup)
           .get();
 }
 
Parameters
Name Description
addressGroup AddressGroupName

Required. A name of the AddressGroup to clone items to. Must be in the format projects|organization/*/locations/{location}/addressGroups/*.

sourceAddressGroup AddressGroupName

Required. Source address group to clone items from.

Returns
Type Description
OperationFuture<AddressGroup,OperationMetadata>

cloneAddressGroupItemsAsync(AddressGroupName addressGroup, String sourceAddressGroup)

public final OperationFuture<AddressGroup,OperationMetadata> cloneAddressGroupItemsAsync(AddressGroupName addressGroup, String sourceAddressGroup)

Clones items from one address group to another.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AddressGroupServiceClient addressGroupServiceClient = AddressGroupServiceClient.create()) {
   AddressGroupName addressGroup =
       AddressGroupName.ofProjectLocationAddressGroupName(
           "[PROJECT]", "[LOCATION]", "[ADDRESS_GROUP]");
   String sourceAddressGroup =
       AddressGroupName.ofProjectLocationAddressGroupName(
               "[PROJECT]", "[LOCATION]", "[ADDRESS_GROUP]")
           .toString();
   AddressGroup response =
       addressGroupServiceClient
           .cloneAddressGroupItemsAsync(addressGroup, sourceAddressGroup)
           .get();
 }
 
Parameters
Name Description
addressGroup AddressGroupName

Required. A name of the AddressGroup to clone items to. Must be in the format projects|organization/*/locations/{location}/addressGroups/*.

sourceAddressGroup String

Required. Source address group to clone items from.

Returns
Type Description
OperationFuture<AddressGroup,OperationMetadata>

cloneAddressGroupItemsAsync(CloneAddressGroupItemsRequest request)

public final OperationFuture<AddressGroup,OperationMetadata> cloneAddressGroupItemsAsync(CloneAddressGroupItemsRequest request)

Clones items from one address group to another.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AddressGroupServiceClient addressGroupServiceClient = AddressGroupServiceClient.create()) {
   CloneAddressGroupItemsRequest request =
       CloneAddressGroupItemsRequest.newBuilder()
           .setAddressGroup(
               AddressGroupName.ofProjectLocationAddressGroupName(
                       "[PROJECT]", "[LOCATION]", "[ADDRESS_GROUP]")
                   .toString())
           .setSourceAddressGroup(
               AddressGroupName.ofProjectLocationAddressGroupName(
                       "[PROJECT]", "[LOCATION]", "[ADDRESS_GROUP]")
                   .toString())
           .setRequestId("requestId693933066")
           .build();
   AddressGroup response = addressGroupServiceClient.cloneAddressGroupItemsAsync(request).get();
 }
 
Parameter
Name Description
request CloneAddressGroupItemsRequest

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

Returns
Type Description
OperationFuture<AddressGroup,OperationMetadata>

cloneAddressGroupItemsAsync(String addressGroup, AddressGroupName sourceAddressGroup)

public final OperationFuture<AddressGroup,OperationMetadata> cloneAddressGroupItemsAsync(String addressGroup, AddressGroupName sourceAddressGroup)

Clones items from one address group to another.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AddressGroupServiceClient addressGroupServiceClient = AddressGroupServiceClient.create()) {
   String addressGroup =
       AddressGroupName.ofProjectLocationAddressGroupName(
               "[PROJECT]", "[LOCATION]", "[ADDRESS_GROUP]")
           .toString();
   AddressGroupName sourceAddressGroup =
       AddressGroupName.ofProjectLocationAddressGroupName(
           "[PROJECT]", "[LOCATION]", "[ADDRESS_GROUP]");
   AddressGroup response =
       addressGroupServiceClient
           .cloneAddressGroupItemsAsync(addressGroup, sourceAddressGroup)
           .get();
 }
 
Parameters
Name Description
addressGroup String

Required. A name of the AddressGroup to clone items to. Must be in the format projects|organization/*/locations/{location}/addressGroups/*.

sourceAddressGroup AddressGroupName

Required. Source address group to clone items from.

Returns
Type Description
OperationFuture<AddressGroup,OperationMetadata>

cloneAddressGroupItemsAsync(String addressGroup, String sourceAddressGroup)

public final OperationFuture<AddressGroup,OperationMetadata> cloneAddressGroupItemsAsync(String addressGroup, String sourceAddressGroup)

Clones items from one address group to another.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AddressGroupServiceClient addressGroupServiceClient = AddressGroupServiceClient.create()) {
   String addressGroup =
       AddressGroupName.ofProjectLocationAddressGroupName(
               "[PROJECT]", "[LOCATION]", "[ADDRESS_GROUP]")
           .toString();
   String sourceAddressGroup =
       AddressGroupName.ofProjectLocationAddressGroupName(
               "[PROJECT]", "[LOCATION]", "[ADDRESS_GROUP]")
           .toString();
   AddressGroup response =
       addressGroupServiceClient
           .cloneAddressGroupItemsAsync(addressGroup, sourceAddressGroup)
           .get();
 }
 
Parameters
Name Description
addressGroup String

Required. A name of the AddressGroup to clone items to. Must be in the format projects|organization/*/locations/{location}/addressGroups/*.

sourceAddressGroup String

Required. Source address group to clone items from.

Returns
Type Description
OperationFuture<AddressGroup,OperationMetadata>

cloneAddressGroupItemsCallable()

public final UnaryCallable<CloneAddressGroupItemsRequest,Operation> cloneAddressGroupItemsCallable()

Clones items from one address group to another.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AddressGroupServiceClient addressGroupServiceClient = AddressGroupServiceClient.create()) {
   CloneAddressGroupItemsRequest request =
       CloneAddressGroupItemsRequest.newBuilder()
           .setAddressGroup(
               AddressGroupName.ofProjectLocationAddressGroupName(
                       "[PROJECT]", "[LOCATION]", "[ADDRESS_GROUP]")
                   .toString())
           .setSourceAddressGroup(
               AddressGroupName.ofProjectLocationAddressGroupName(
                       "[PROJECT]", "[LOCATION]", "[ADDRESS_GROUP]")
                   .toString())
           .setRequestId("requestId693933066")
           .build();
   ApiFuture<Operation> future =
       addressGroupServiceClient.cloneAddressGroupItemsCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<CloneAddressGroupItemsRequest,Operation>

cloneAddressGroupItemsOperationCallable()

public final OperationCallable<CloneAddressGroupItemsRequest,AddressGroup,OperationMetadata> cloneAddressGroupItemsOperationCallable()

Clones items from one address group to another.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AddressGroupServiceClient addressGroupServiceClient = AddressGroupServiceClient.create()) {
   CloneAddressGroupItemsRequest request =
       CloneAddressGroupItemsRequest.newBuilder()
           .setAddressGroup(
               AddressGroupName.ofProjectLocationAddressGroupName(
                       "[PROJECT]", "[LOCATION]", "[ADDRESS_GROUP]")
                   .toString())
           .setSourceAddressGroup(
               AddressGroupName.ofProjectLocationAddressGroupName(
                       "[PROJECT]", "[LOCATION]", "[ADDRESS_GROUP]")
                   .toString())
           .setRequestId("requestId693933066")
           .build();
   OperationFuture<AddressGroup, OperationMetadata> future =
       addressGroupServiceClient.cloneAddressGroupItemsOperationCallable().futureCall(request);
   // Do something.
   AddressGroup response = future.get();
 }
 
Returns
Type Description
OperationCallable<CloneAddressGroupItemsRequest,AddressGroup,OperationMetadata>

close()

public final void close()

createAddressGroupAsync(CreateAddressGroupRequest request)

public final OperationFuture<AddressGroup,OperationMetadata> createAddressGroupAsync(CreateAddressGroupRequest request)

Creates a new address group 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 (AddressGroupServiceClient addressGroupServiceClient = AddressGroupServiceClient.create()) {
   CreateAddressGroupRequest request =
       CreateAddressGroupRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setAddressGroupId("addressGroupId705215846")
           .setAddressGroup(AddressGroup.newBuilder().build())
           .setRequestId("requestId693933066")
           .build();
   AddressGroup response = addressGroupServiceClient.createAddressGroupAsync(request).get();
 }
 
Parameter
Name Description
request CreateAddressGroupRequest

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

Returns
Type Description
OperationFuture<AddressGroup,OperationMetadata>

createAddressGroupAsync(LocationName parent, AddressGroup addressGroup, String addressGroupId)

public final OperationFuture<AddressGroup,OperationMetadata> createAddressGroupAsync(LocationName parent, AddressGroup addressGroup, String addressGroupId)

Creates a new address group 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 (AddressGroupServiceClient addressGroupServiceClient = AddressGroupServiceClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   AddressGroup addressGroup = AddressGroup.newBuilder().build();
   String addressGroupId = "addressGroupId705215846";
   AddressGroup response =
       addressGroupServiceClient
           .createAddressGroupAsync(parent, addressGroup, addressGroupId)
           .get();
 }
 
Parameters
Name Description
parent LocationName

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

addressGroup AddressGroup

Required. AddressGroup resource to be created.

addressGroupId String

Required. Short name of the AddressGroup resource to be created. This value should be 1-63 characters long, containing only letters, numbers, hyphens, and underscores, and should not start with a number. E.g. "authz_policy".

Returns
Type Description
OperationFuture<AddressGroup,OperationMetadata>

createAddressGroupAsync(OrganizationLocationName parent, AddressGroup addressGroup, String addressGroupId)

public final OperationFuture<AddressGroup,OperationMetadata> createAddressGroupAsync(OrganizationLocationName parent, AddressGroup addressGroup, String addressGroupId)

Creates a new address group 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 (AddressGroupServiceClient addressGroupServiceClient = AddressGroupServiceClient.create()) {
   OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]");
   AddressGroup addressGroup = AddressGroup.newBuilder().build();
   String addressGroupId = "addressGroupId705215846";
   AddressGroup response =
       addressGroupServiceClient
           .createAddressGroupAsync(parent, addressGroup, addressGroupId)
           .get();
 }
 
Parameters
Name Description
parent OrganizationLocationName

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

addressGroup AddressGroup

Required. AddressGroup resource to be created.

addressGroupId String

Required. Short name of the AddressGroup resource to be created. This value should be 1-63 characters long, containing only letters, numbers, hyphens, and underscores, and should not start with a number. E.g. "authz_policy".

Returns
Type Description
OperationFuture<AddressGroup,OperationMetadata>

createAddressGroupAsync(String parent, AddressGroup addressGroup, String addressGroupId)

public final OperationFuture<AddressGroup,OperationMetadata> createAddressGroupAsync(String parent, AddressGroup addressGroup, String addressGroupId)

Creates a new address group 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 (AddressGroupServiceClient addressGroupServiceClient = AddressGroupServiceClient.create()) {
   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
   AddressGroup addressGroup = AddressGroup.newBuilder().build();
   String addressGroupId = "addressGroupId705215846";
   AddressGroup response =
       addressGroupServiceClient
           .createAddressGroupAsync(parent, addressGroup, addressGroupId)
           .get();
 }
 
Parameters
Name Description
parent String

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

addressGroup AddressGroup

Required. AddressGroup resource to be created.

addressGroupId String

Required. Short name of the AddressGroup resource to be created. This value should be 1-63 characters long, containing only letters, numbers, hyphens, and underscores, and should not start with a number. E.g. "authz_policy".

Returns
Type Description
OperationFuture<AddressGroup,OperationMetadata>

createAddressGroupCallable()

public final UnaryCallable<CreateAddressGroupRequest,Operation> createAddressGroupCallable()

Creates a new address group 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 (AddressGroupServiceClient addressGroupServiceClient = AddressGroupServiceClient.create()) {
   CreateAddressGroupRequest request =
       CreateAddressGroupRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setAddressGroupId("addressGroupId705215846")
           .setAddressGroup(AddressGroup.newBuilder().build())
           .setRequestId("requestId693933066")
           .build();
   ApiFuture<Operation> future =
       addressGroupServiceClient.createAddressGroupCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<CreateAddressGroupRequest,Operation>

createAddressGroupOperationCallable()

public final OperationCallable<CreateAddressGroupRequest,AddressGroup,OperationMetadata> createAddressGroupOperationCallable()

Creates a new address group 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 (AddressGroupServiceClient addressGroupServiceClient = AddressGroupServiceClient.create()) {
   CreateAddressGroupRequest request =
       CreateAddressGroupRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setAddressGroupId("addressGroupId705215846")
           .setAddressGroup(AddressGroup.newBuilder().build())
           .setRequestId("requestId693933066")
           .build();
   OperationFuture<AddressGroup, OperationMetadata> future =
       addressGroupServiceClient.createAddressGroupOperationCallable().futureCall(request);
   // Do something.
   AddressGroup response = future.get();
 }
 
Returns
Type Description
OperationCallable<CreateAddressGroupRequest,AddressGroup,OperationMetadata>

deleteAddressGroupAsync(AddressGroupName name)

public final OperationFuture<Empty,OperationMetadata> deleteAddressGroupAsync(AddressGroupName name)

Deletes a single address group.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AddressGroupServiceClient addressGroupServiceClient = AddressGroupServiceClient.create()) {
   AddressGroupName name =
       AddressGroupName.ofProjectLocationAddressGroupName(
           "[PROJECT]", "[LOCATION]", "[ADDRESS_GROUP]");
   addressGroupServiceClient.deleteAddressGroupAsync(name).get();
 }
 
Parameter
Name Description
name AddressGroupName

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

Returns
Type Description
OperationFuture<Empty,OperationMetadata>

deleteAddressGroupAsync(DeleteAddressGroupRequest request)

public final OperationFuture<Empty,OperationMetadata> deleteAddressGroupAsync(DeleteAddressGroupRequest request)

Deletes a single address group.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AddressGroupServiceClient addressGroupServiceClient = AddressGroupServiceClient.create()) {
   DeleteAddressGroupRequest request =
       DeleteAddressGroupRequest.newBuilder()
           .setName(
               AddressGroupName.ofProjectLocationAddressGroupName(
                       "[PROJECT]", "[LOCATION]", "[ADDRESS_GROUP]")
                   .toString())
           .setRequestId("requestId693933066")
           .build();
   addressGroupServiceClient.deleteAddressGroupAsync(request).get();
 }
 
Parameter
Name Description
request DeleteAddressGroupRequest

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

Returns
Type Description
OperationFuture<Empty,OperationMetadata>

deleteAddressGroupAsync(String name)

public final OperationFuture<Empty,OperationMetadata> deleteAddressGroupAsync(String name)

Deletes a single address group.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AddressGroupServiceClient addressGroupServiceClient = AddressGroupServiceClient.create()) {
   String name =
       AddressGroupName.ofProjectLocationAddressGroupName(
               "[PROJECT]", "[LOCATION]", "[ADDRESS_GROUP]")
           .toString();
   addressGroupServiceClient.deleteAddressGroupAsync(name).get();
 }
 
Parameter
Name Description
name String

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

Returns
Type Description
OperationFuture<Empty,OperationMetadata>

deleteAddressGroupCallable()

public final UnaryCallable<DeleteAddressGroupRequest,Operation> deleteAddressGroupCallable()

Deletes a single address group.

Sample code:


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

deleteAddressGroupOperationCallable()

public final OperationCallable<DeleteAddressGroupRequest,Empty,OperationMetadata> deleteAddressGroupOperationCallable()

Deletes a single address group.

Sample code:


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

getAddressGroup(AddressGroupName name)

public final AddressGroup getAddressGroup(AddressGroupName name)

Gets details of a single address group.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AddressGroupServiceClient addressGroupServiceClient = AddressGroupServiceClient.create()) {
   AddressGroupName name =
       AddressGroupName.ofProjectLocationAddressGroupName(
           "[PROJECT]", "[LOCATION]", "[ADDRESS_GROUP]");
   AddressGroup response = addressGroupServiceClient.getAddressGroup(name);
 }
 
Parameter
Name Description
name AddressGroupName

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

Returns
Type Description
AddressGroup

getAddressGroup(GetAddressGroupRequest request)

public final AddressGroup getAddressGroup(GetAddressGroupRequest request)

Gets details of a single address group.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AddressGroupServiceClient addressGroupServiceClient = AddressGroupServiceClient.create()) {
   GetAddressGroupRequest request =
       GetAddressGroupRequest.newBuilder()
           .setName(
               AddressGroupName.ofProjectLocationAddressGroupName(
                       "[PROJECT]", "[LOCATION]", "[ADDRESS_GROUP]")
                   .toString())
           .build();
   AddressGroup response = addressGroupServiceClient.getAddressGroup(request);
 }
 
Parameter
Name Description
request GetAddressGroupRequest

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

Returns
Type Description
AddressGroup

getAddressGroup(String name)

public final AddressGroup getAddressGroup(String name)

Gets details of a single address group.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AddressGroupServiceClient addressGroupServiceClient = AddressGroupServiceClient.create()) {
   String name =
       AddressGroupName.ofProjectLocationAddressGroupName(
               "[PROJECT]", "[LOCATION]", "[ADDRESS_GROUP]")
           .toString();
   AddressGroup response = addressGroupServiceClient.getAddressGroup(name);
 }
 
Parameter
Name Description
name String

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

Returns
Type Description
AddressGroup

getAddressGroupCallable()

public final UnaryCallable<GetAddressGroupRequest,AddressGroup> getAddressGroupCallable()

Gets details of a single address group.

Sample code:


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

getIamPolicy(GetIamPolicyRequest request)

public final Policy getIamPolicy(GetIamPolicyRequest request)

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

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AddressGroupServiceClient addressGroupServiceClient = AddressGroupServiceClient.create()) {
   GetIamPolicyRequest request =
       GetIamPolicyRequest.newBuilder()
           .setResource(
               AddressGroupName.ofProjectLocationAddressGroupName(
                       "[PROJECT]", "[LOCATION]", "[ADDRESS_GROUP]")
                   .toString())
           .setOptions(GetPolicyOptions.newBuilder().build())
           .build();
   Policy response = addressGroupServiceClient.getIamPolicy(request);
 }
 
Parameter
Name Description
request com.google.iam.v1.GetIamPolicyRequest

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

Returns
Type Description
com.google.iam.v1.Policy

getIamPolicyCallable()

public final UnaryCallable<GetIamPolicyRequest,Policy> getIamPolicyCallable()

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

Sample code:


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

getLocation(GetLocationRequest request)

public final Location getLocation(GetLocationRequest request)

Gets information about a location.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AddressGroupServiceClient addressGroupServiceClient = AddressGroupServiceClient.create()) {
   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
   Location response = addressGroupServiceClient.getLocation(request);
 }
 
Parameter
Name Description
request com.google.cloud.location.GetLocationRequest

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

Returns
Type Description
com.google.cloud.location.Location

getLocationCallable()

public final UnaryCallable<GetLocationRequest,Location> getLocationCallable()

Gets information about a location.

Sample code:


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

getOperationsClient()

public final OperationsClient getOperationsClient()

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

Returns
Type Description
OperationsClient

getSettings()

public final AddressGroupServiceSettings getSettings()
Returns
Type Description
AddressGroupServiceSettings

getStub()

public AddressGroupServiceStub getStub()
Returns
Type Description
AddressGroupServiceStub

isShutdown()

public boolean isShutdown()
Returns
Type Description
boolean

isTerminated()

public boolean isTerminated()
Returns
Type Description
boolean

listAddressGroupReferences(AddressGroupName addressGroup)

public final AddressGroupServiceClient.ListAddressGroupReferencesPagedResponse listAddressGroupReferences(AddressGroupName addressGroup)

Lists references of an address group.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AddressGroupServiceClient addressGroupServiceClient = AddressGroupServiceClient.create()) {
   AddressGroupName addressGroup =
       AddressGroupName.ofProjectLocationAddressGroupName(
           "[PROJECT]", "[LOCATION]", "[ADDRESS_GROUP]");
   for (ListAddressGroupReferencesResponse.AddressGroupReference element :
       addressGroupServiceClient.listAddressGroupReferences(addressGroup).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
addressGroup AddressGroupName

Required. A name of the AddressGroup to clone items to. Must be in the format projects|organization/*/locations/{location}/addressGroups/*.

Returns
Type Description
AddressGroupServiceClient.ListAddressGroupReferencesPagedResponse

listAddressGroupReferences(ListAddressGroupReferencesRequest request)

public final AddressGroupServiceClient.ListAddressGroupReferencesPagedResponse listAddressGroupReferences(ListAddressGroupReferencesRequest request)

Lists references of an address group.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AddressGroupServiceClient addressGroupServiceClient = AddressGroupServiceClient.create()) {
   ListAddressGroupReferencesRequest request =
       ListAddressGroupReferencesRequest.newBuilder()
           .setAddressGroup(
               AddressGroupName.ofProjectLocationAddressGroupName(
                       "[PROJECT]", "[LOCATION]", "[ADDRESS_GROUP]")
                   .toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   for (ListAddressGroupReferencesResponse.AddressGroupReference element :
       addressGroupServiceClient.listAddressGroupReferences(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
request ListAddressGroupReferencesRequest

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

Returns
Type Description
AddressGroupServiceClient.ListAddressGroupReferencesPagedResponse

listAddressGroupReferences(String addressGroup)

public final AddressGroupServiceClient.ListAddressGroupReferencesPagedResponse listAddressGroupReferences(String addressGroup)

Lists references of an address group.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AddressGroupServiceClient addressGroupServiceClient = AddressGroupServiceClient.create()) {
   String addressGroup =
       AddressGroupName.ofProjectLocationAddressGroupName(
               "[PROJECT]", "[LOCATION]", "[ADDRESS_GROUP]")
           .toString();
   for (ListAddressGroupReferencesResponse.AddressGroupReference element :
       addressGroupServiceClient.listAddressGroupReferences(addressGroup).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
addressGroup String

Required. A name of the AddressGroup to clone items to. Must be in the format projects|organization/*/locations/{location}/addressGroups/*.

Returns
Type Description
AddressGroupServiceClient.ListAddressGroupReferencesPagedResponse

listAddressGroupReferencesCallable()

public final UnaryCallable<ListAddressGroupReferencesRequest,ListAddressGroupReferencesResponse> listAddressGroupReferencesCallable()

Lists references of an address group.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AddressGroupServiceClient addressGroupServiceClient = AddressGroupServiceClient.create()) {
   ListAddressGroupReferencesRequest request =
       ListAddressGroupReferencesRequest.newBuilder()
           .setAddressGroup(
               AddressGroupName.ofProjectLocationAddressGroupName(
                       "[PROJECT]", "[LOCATION]", "[ADDRESS_GROUP]")
                   .toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   while (true) {
     ListAddressGroupReferencesResponse response =
         addressGroupServiceClient.listAddressGroupReferencesCallable().call(request);
     for (ListAddressGroupReferencesResponse.AddressGroupReference element :
         response.getAddressGroupReferencesList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
Type Description
UnaryCallable<ListAddressGroupReferencesRequest,ListAddressGroupReferencesResponse>

listAddressGroupReferencesPagedCallable()

public final UnaryCallable<ListAddressGroupReferencesRequest,AddressGroupServiceClient.ListAddressGroupReferencesPagedResponse> listAddressGroupReferencesPagedCallable()

Lists references of an address group.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AddressGroupServiceClient addressGroupServiceClient = AddressGroupServiceClient.create()) {
   ListAddressGroupReferencesRequest request =
       ListAddressGroupReferencesRequest.newBuilder()
           .setAddressGroup(
               AddressGroupName.ofProjectLocationAddressGroupName(
                       "[PROJECT]", "[LOCATION]", "[ADDRESS_GROUP]")
                   .toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   ApiFuture<ListAddressGroupReferencesResponse.AddressGroupReference> future =
       addressGroupServiceClient.listAddressGroupReferencesPagedCallable().futureCall(request);
   // Do something.
   for (ListAddressGroupReferencesResponse.AddressGroupReference element :
       future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
Type Description
UnaryCallable<ListAddressGroupReferencesRequest,ListAddressGroupReferencesPagedResponse>

listAddressGroups(ListAddressGroupsRequest request)

public final AddressGroupServiceClient.ListAddressGroupsPagedResponse listAddressGroups(ListAddressGroupsRequest request)

Lists address groups 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 (AddressGroupServiceClient addressGroupServiceClient = AddressGroupServiceClient.create()) {
   ListAddressGroupsRequest request =
       ListAddressGroupsRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setReturnPartialSuccess(true)
           .build();
   for (AddressGroup element :
       addressGroupServiceClient.listAddressGroups(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
request ListAddressGroupsRequest

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

Returns
Type Description
AddressGroupServiceClient.ListAddressGroupsPagedResponse

listAddressGroups(LocationName parent)

public final AddressGroupServiceClient.ListAddressGroupsPagedResponse listAddressGroups(LocationName parent)

Lists address groups 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 (AddressGroupServiceClient addressGroupServiceClient = AddressGroupServiceClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   for (AddressGroup element :
       addressGroupServiceClient.listAddressGroups(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent LocationName

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

Returns
Type Description
AddressGroupServiceClient.ListAddressGroupsPagedResponse

listAddressGroups(String parent)

public final AddressGroupServiceClient.ListAddressGroupsPagedResponse listAddressGroups(String parent)

Lists address groups 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 (AddressGroupServiceClient addressGroupServiceClient = AddressGroupServiceClient.create()) {
   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
   for (AddressGroup element :
       addressGroupServiceClient.listAddressGroups(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent String

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

Returns
Type Description
AddressGroupServiceClient.ListAddressGroupsPagedResponse

listAddressGroupsCallable()

public final UnaryCallable<ListAddressGroupsRequest,ListAddressGroupsResponse> listAddressGroupsCallable()

Lists address groups 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 (AddressGroupServiceClient addressGroupServiceClient = AddressGroupServiceClient.create()) {
   ListAddressGroupsRequest request =
       ListAddressGroupsRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setReturnPartialSuccess(true)
           .build();
   while (true) {
     ListAddressGroupsResponse response =
         addressGroupServiceClient.listAddressGroupsCallable().call(request);
     for (AddressGroup element : response.getAddressGroupsList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
Type Description
UnaryCallable<ListAddressGroupsRequest,ListAddressGroupsResponse>

listAddressGroupsPagedCallable()

public final UnaryCallable<ListAddressGroupsRequest,AddressGroupServiceClient.ListAddressGroupsPagedResponse> listAddressGroupsPagedCallable()

Lists address groups 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 (AddressGroupServiceClient addressGroupServiceClient = AddressGroupServiceClient.create()) {
   ListAddressGroupsRequest request =
       ListAddressGroupsRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setReturnPartialSuccess(true)
           .build();
   ApiFuture<AddressGroup> future =
       addressGroupServiceClient.listAddressGroupsPagedCallable().futureCall(request);
   // Do something.
   for (AddressGroup element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
Type Description
UnaryCallable<ListAddressGroupsRequest,ListAddressGroupsPagedResponse>

listLocations(ListLocationsRequest request)

public final AddressGroupServiceClient.ListLocationsPagedResponse listLocations(ListLocationsRequest request)

Lists information about the supported locations for this service.

Sample code:


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

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

Returns
Type Description
AddressGroupServiceClient.ListLocationsPagedResponse

listLocationsCallable()

public final UnaryCallable<ListLocationsRequest,ListLocationsResponse> listLocationsCallable()

Lists information about the supported locations for this service.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AddressGroupServiceClient addressGroupServiceClient = AddressGroupServiceClient.create()) {
   ListLocationsRequest request =
       ListLocationsRequest.newBuilder()
           .setName("name3373707")
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   while (true) {
     ListLocationsResponse response =
         addressGroupServiceClient.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;
     }
   }
 }
 
Returns
Type Description
UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse>

listLocationsPagedCallable()

public final UnaryCallable<ListLocationsRequest,AddressGroupServiceClient.ListLocationsPagedResponse> listLocationsPagedCallable()

Lists information about the supported locations for this service.

Sample code:


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

removeAddressGroupItemsAsync(AddressGroupName addressGroup, List<String> items)

public final OperationFuture<AddressGroup,OperationMetadata> removeAddressGroupItemsAsync(AddressGroupName addressGroup, List<String> items)

Removes items from an address group.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AddressGroupServiceClient addressGroupServiceClient = AddressGroupServiceClient.create()) {
   AddressGroupName addressGroup =
       AddressGroupName.ofProjectLocationAddressGroupName(
           "[PROJECT]", "[LOCATION]", "[ADDRESS_GROUP]");
   List<String> items = new ArrayList<>();
   AddressGroup response =
       addressGroupServiceClient.removeAddressGroupItemsAsync(addressGroup, items).get();
 }
 
Parameters
Name Description
addressGroup AddressGroupName

Required. A name of the AddressGroup to remove items from. Must be in the format projects|organization/*/locations/{location}/addressGroups/*.

items List<String>

Required. List of items to remove.

Returns
Type Description
OperationFuture<AddressGroup,OperationMetadata>

removeAddressGroupItemsAsync(RemoveAddressGroupItemsRequest request)

public final OperationFuture<AddressGroup,OperationMetadata> removeAddressGroupItemsAsync(RemoveAddressGroupItemsRequest request)

Removes items from an address group.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AddressGroupServiceClient addressGroupServiceClient = AddressGroupServiceClient.create()) {
   RemoveAddressGroupItemsRequest request =
       RemoveAddressGroupItemsRequest.newBuilder()
           .setAddressGroup(
               AddressGroupName.ofProjectLocationAddressGroupName(
                       "[PROJECT]", "[LOCATION]", "[ADDRESS_GROUP]")
                   .toString())
           .addAllItems(new ArrayList<String>())
           .setRequestId("requestId693933066")
           .build();
   AddressGroup response = addressGroupServiceClient.removeAddressGroupItemsAsync(request).get();
 }
 
Parameter
Name Description
request RemoveAddressGroupItemsRequest

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

Returns
Type Description
OperationFuture<AddressGroup,OperationMetadata>

removeAddressGroupItemsAsync(String addressGroup, List<String> items)

public final OperationFuture<AddressGroup,OperationMetadata> removeAddressGroupItemsAsync(String addressGroup, List<String> items)

Removes items from an address group.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AddressGroupServiceClient addressGroupServiceClient = AddressGroupServiceClient.create()) {
   String addressGroup =
       AddressGroupName.ofProjectLocationAddressGroupName(
               "[PROJECT]", "[LOCATION]", "[ADDRESS_GROUP]")
           .toString();
   List<String> items = new ArrayList<>();
   AddressGroup response =
       addressGroupServiceClient.removeAddressGroupItemsAsync(addressGroup, items).get();
 }
 
Parameters
Name Description
addressGroup String

Required. A name of the AddressGroup to remove items from. Must be in the format projects|organization/*/locations/{location}/addressGroups/*.

items List<String>

Required. List of items to remove.

Returns
Type Description
OperationFuture<AddressGroup,OperationMetadata>

removeAddressGroupItemsCallable()

public final UnaryCallable<RemoveAddressGroupItemsRequest,Operation> removeAddressGroupItemsCallable()

Removes items from an address group.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AddressGroupServiceClient addressGroupServiceClient = AddressGroupServiceClient.create()) {
   RemoveAddressGroupItemsRequest request =
       RemoveAddressGroupItemsRequest.newBuilder()
           .setAddressGroup(
               AddressGroupName.ofProjectLocationAddressGroupName(
                       "[PROJECT]", "[LOCATION]", "[ADDRESS_GROUP]")
                   .toString())
           .addAllItems(new ArrayList<String>())
           .setRequestId("requestId693933066")
           .build();
   ApiFuture<Operation> future =
       addressGroupServiceClient.removeAddressGroupItemsCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<RemoveAddressGroupItemsRequest,Operation>

removeAddressGroupItemsOperationCallable()

public final OperationCallable<RemoveAddressGroupItemsRequest,AddressGroup,OperationMetadata> removeAddressGroupItemsOperationCallable()

Removes items from an address group.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AddressGroupServiceClient addressGroupServiceClient = AddressGroupServiceClient.create()) {
   RemoveAddressGroupItemsRequest request =
       RemoveAddressGroupItemsRequest.newBuilder()
           .setAddressGroup(
               AddressGroupName.ofProjectLocationAddressGroupName(
                       "[PROJECT]", "[LOCATION]", "[ADDRESS_GROUP]")
                   .toString())
           .addAllItems(new ArrayList<String>())
           .setRequestId("requestId693933066")
           .build();
   OperationFuture<AddressGroup, OperationMetadata> future =
       addressGroupServiceClient.removeAddressGroupItemsOperationCallable().futureCall(request);
   // Do something.
   AddressGroup response = future.get();
 }
 
Returns
Type Description
OperationCallable<RemoveAddressGroupItemsRequest,AddressGroup,OperationMetadata>

setIamPolicy(SetIamPolicyRequest request)

public final Policy setIamPolicy(SetIamPolicyRequest request)

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

Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIEDerrors.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AddressGroupServiceClient addressGroupServiceClient = AddressGroupServiceClient.create()) {
   SetIamPolicyRequest request =
       SetIamPolicyRequest.newBuilder()
           .setResource(
               AddressGroupName.ofProjectLocationAddressGroupName(
                       "[PROJECT]", "[LOCATION]", "[ADDRESS_GROUP]")
                   .toString())
           .setPolicy(Policy.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   Policy response = addressGroupServiceClient.setIamPolicy(request);
 }
 
Parameter
Name Description
request com.google.iam.v1.SetIamPolicyRequest

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

Returns
Type Description
com.google.iam.v1.Policy

setIamPolicyCallable()

public final UnaryCallable<SetIamPolicyRequest,Policy> setIamPolicyCallable()

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

Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIEDerrors.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AddressGroupServiceClient addressGroupServiceClient = AddressGroupServiceClient.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 =
       addressGroupServiceClient.setIamPolicyCallable().futureCall(request);
   // Do something.
   Policy response = future.get();
 }
 
Returns
Type Description
UnaryCallable<com.google.iam.v1.SetIamPolicyRequest,com.google.iam.v1.Policy>

shutdown()

public void shutdown()

shutdownNow()

public void shutdownNow()

testIamPermissions(TestIamPermissionsRequest request)

public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request)

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

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

Sample code:


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

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

Returns
Type Description
com.google.iam.v1.TestIamPermissionsResponse

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 (AddressGroupServiceClient addressGroupServiceClient = AddressGroupServiceClient.create()) {
   TestIamPermissionsRequest request =
       TestIamPermissionsRequest.newBuilder()
           .setResource(
               AddressGroupName.ofProjectLocationAddressGroupName(
                       "[PROJECT]", "[LOCATION]", "[ADDRESS_GROUP]")
                   .toString())
           .addAllPermissions(new ArrayList<String>())
           .build();
   ApiFuture<TestIamPermissionsResponse> future =
       addressGroupServiceClient.testIamPermissionsCallable().futureCall(request);
   // Do something.
   TestIamPermissionsResponse response = future.get();
 }
 
Returns
Type Description
UnaryCallable<com.google.iam.v1.TestIamPermissionsRequest,com.google.iam.v1.TestIamPermissionsResponse>

updateAddressGroupAsync(AddressGroup addressGroup, FieldMask updateMask)

public final OperationFuture<AddressGroup,OperationMetadata> updateAddressGroupAsync(AddressGroup addressGroup, FieldMask updateMask)

Updates the parameters of a single address group.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AddressGroupServiceClient addressGroupServiceClient = AddressGroupServiceClient.create()) {
   AddressGroup addressGroup = AddressGroup.newBuilder().build();
   FieldMask updateMask = FieldMask.newBuilder().build();
   AddressGroup response =
       addressGroupServiceClient.updateAddressGroupAsync(addressGroup, updateMask).get();
 }
 
Parameters
Name Description
addressGroup AddressGroup

Required. Updated AddressGroup resource.

updateMask FieldMask

Optional. Field mask is used to specify the fields to be overwritten in the AddressGroup resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten.

Returns
Type Description
OperationFuture<AddressGroup,OperationMetadata>

updateAddressGroupAsync(UpdateAddressGroupRequest request)

public final OperationFuture<AddressGroup,OperationMetadata> updateAddressGroupAsync(UpdateAddressGroupRequest request)

Updates the parameters of a single address group.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AddressGroupServiceClient addressGroupServiceClient = AddressGroupServiceClient.create()) {
   UpdateAddressGroupRequest request =
       UpdateAddressGroupRequest.newBuilder()
           .setUpdateMask(FieldMask.newBuilder().build())
           .setAddressGroup(AddressGroup.newBuilder().build())
           .setRequestId("requestId693933066")
           .build();
   AddressGroup response = addressGroupServiceClient.updateAddressGroupAsync(request).get();
 }
 
Parameter
Name Description
request UpdateAddressGroupRequest

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

Returns
Type Description
OperationFuture<AddressGroup,OperationMetadata>

updateAddressGroupCallable()

public final UnaryCallable<UpdateAddressGroupRequest,Operation> updateAddressGroupCallable()

Updates the parameters of a single address group.

Sample code:


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

updateAddressGroupOperationCallable()

public final OperationCallable<UpdateAddressGroupRequest,AddressGroup,OperationMetadata> updateAddressGroupOperationCallable()

Updates the parameters of a single address group.

Sample code:


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