Class OrganizationAddressGroupServiceClient

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

@Generated("by gapic-generator-java") public class OrganizationAddressGroupServiceClient extends Object implements BackgroundResource
Service Description: Organization AddressGroup is created under organization. Requests against Organization AddressGroup will use project from request credential for activation/quota/visibility check.

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 (OrganizationAddressGroupServiceClient organizationAddressGroupServiceClient =
     OrganizationAddressGroupServiceClient.create()) {
   AddressGroupName name =
       AddressGroupName.ofOrganizationLocationAddressGroupName(
           "[ORGANIZATION]", "[LOCATION]", "[ADDRESS_GROUP]");
   AddressGroup response = organizationAddressGroupServiceClient.getAddressGroup(name);
 }
 

Note: close() needs to be called on the OrganizationAddressGroupServiceClient 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 parameters of an 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 an 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.

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

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

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

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

  • listLocations(ListLocationsRequest request)

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

  • listLocationsPagedCallable()

  • listLocationsCallable()

GetLocation

Gets information about a location.

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

  • getLocation(GetLocationRequest request)

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

  • getLocationCallable()

SetIamPolicy

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

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

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

  • setIamPolicy(SetIamPolicyRequest request)

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

  • setIamPolicyCallable()

GetIamPolicy

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

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

  • getIamPolicy(GetIamPolicyRequest request)

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

  • getIamPolicyCallable()

TestIamPermissions

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

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

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

  • testIamPermissions(TestIamPermissionsRequest request)

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

  • testIamPermissionsCallable()

See the individual methods for example code.

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

This class can be customized by passing in a custom instance of OrganizationAddressGroupServiceSettings 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
 OrganizationAddressGroupServiceSettings organizationAddressGroupServiceSettings =
     OrganizationAddressGroupServiceSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 OrganizationAddressGroupServiceClient organizationAddressGroupServiceClient =
     OrganizationAddressGroupServiceClient.create(organizationAddressGroupServiceSettings);
 

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
 OrganizationAddressGroupServiceSettings organizationAddressGroupServiceSettings =
     OrganizationAddressGroupServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
 OrganizationAddressGroupServiceClient organizationAddressGroupServiceClient =
     OrganizationAddressGroupServiceClient.create(organizationAddressGroupServiceSettings);
 

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

  • Constructor Details

    • OrganizationAddressGroupServiceClient

      protected OrganizationAddressGroupServiceClient(OrganizationAddressGroupServiceSettings settings) throws IOException
      Constructs an instance of OrganizationAddressGroupServiceClient, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.
      Throws:
      IOException
    • OrganizationAddressGroupServiceClient

      protected OrganizationAddressGroupServiceClient(OrganizationAddressGroupServiceStub stub)
  • Method Details

    • create

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

      Constructs an instance of OrganizationAddressGroupServiceClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.
      Throws:
      IOException
    • create

      Constructs an instance of OrganizationAddressGroupServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(OrganizationAddressGroupServiceSettings).
    • getSettings

      public final OrganizationAddressGroupServiceSettings getSettings()
    • getStub

    • getOperationsClient

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

      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 (OrganizationAddressGroupServiceClient organizationAddressGroupServiceClient =
           OrganizationAddressGroupServiceClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         for (AddressGroup element :
             organizationAddressGroupServiceClient.listAddressGroups(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. The project and location from which the AddressGroups should be listed, specified in the format `projects/*/locations/{location}`.
      Throws:
      ApiException - if the remote call fails
    • listAddressGroups

      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 (OrganizationAddressGroupServiceClient organizationAddressGroupServiceClient =
           OrganizationAddressGroupServiceClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         for (AddressGroup element :
             organizationAddressGroupServiceClient.listAddressGroups(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. The project and location from which the AddressGroups should be listed, specified in the format `projects/*/locations/{location}`.
      Throws:
      ApiException - if the remote call fails
    • listAddressGroups

      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 (OrganizationAddressGroupServiceClient organizationAddressGroupServiceClient =
           OrganizationAddressGroupServiceClient.create()) {
         ListAddressGroupsRequest request =
             ListAddressGroupsRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setReturnPartialSuccess(true)
                 .build();
         for (AddressGroup element :
             organizationAddressGroupServiceClient.listAddressGroups(request).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • 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 (OrganizationAddressGroupServiceClient organizationAddressGroupServiceClient =
           OrganizationAddressGroupServiceClient.create()) {
         ListAddressGroupsRequest request =
             ListAddressGroupsRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setReturnPartialSuccess(true)
                 .build();
         ApiFuture<AddressGroup> future =
             organizationAddressGroupServiceClient
                 .listAddressGroupsPagedCallable()
                 .futureCall(request);
         // Do something.
         for (AddressGroup element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • 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 (OrganizationAddressGroupServiceClient organizationAddressGroupServiceClient =
           OrganizationAddressGroupServiceClient.create()) {
         ListAddressGroupsRequest request =
             ListAddressGroupsRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setReturnPartialSuccess(true)
                 .build();
         while (true) {
           ListAddressGroupsResponse response =
               organizationAddressGroupServiceClient.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;
           }
         }
       }
       
    • getAddressGroup

      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 (OrganizationAddressGroupServiceClient organizationAddressGroupServiceClient =
           OrganizationAddressGroupServiceClient.create()) {
         AddressGroupName name =
             AddressGroupName.ofOrganizationLocationAddressGroupName(
                 "[ORGANIZATION]", "[LOCATION]", "[ADDRESS_GROUP]");
         AddressGroup response = organizationAddressGroupServiceClient.getAddressGroup(name);
       }
       
      Parameters:
      name - Required. A name of the AddressGroup to get. Must be in the format `projects/*/locations/{location}/addressGroups/*`.
      Throws:
      ApiException - if the remote call fails
    • getAddressGroup

      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 (OrganizationAddressGroupServiceClient organizationAddressGroupServiceClient =
           OrganizationAddressGroupServiceClient.create()) {
         String name =
             AddressGroupName.ofProjectLocationAddressGroupName(
                     "[PROJECT]", "[LOCATION]", "[ADDRESS_GROUP]")
                 .toString();
         AddressGroup response = organizationAddressGroupServiceClient.getAddressGroup(name);
       }
       
      Parameters:
      name - Required. A name of the AddressGroup to get. Must be in the format `projects/*/locations/{location}/addressGroups/*`.
      Throws:
      ApiException - if the remote call fails
    • getAddressGroup

      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 (OrganizationAddressGroupServiceClient organizationAddressGroupServiceClient =
           OrganizationAddressGroupServiceClient.create()) {
         GetAddressGroupRequest request =
             GetAddressGroupRequest.newBuilder()
                 .setName(
                     AddressGroupName.ofOrganizationLocationAddressGroupName(
                             "[ORGANIZATION]", "[LOCATION]", "[ADDRESS_GROUP]")
                         .toString())
                 .build();
         AddressGroup response = organizationAddressGroupServiceClient.getAddressGroup(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • 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 (OrganizationAddressGroupServiceClient organizationAddressGroupServiceClient =
           OrganizationAddressGroupServiceClient.create()) {
         GetAddressGroupRequest request =
             GetAddressGroupRequest.newBuilder()
                 .setName(
                     AddressGroupName.ofOrganizationLocationAddressGroupName(
                             "[ORGANIZATION]", "[LOCATION]", "[ADDRESS_GROUP]")
                         .toString())
                 .build();
         ApiFuture<AddressGroup> future =
             organizationAddressGroupServiceClient.getAddressGroupCallable().futureCall(request);
         // Do something.
         AddressGroup response = future.get();
       }
       
    • createAddressGroupAsync

      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 (OrganizationAddressGroupServiceClient organizationAddressGroupServiceClient =
           OrganizationAddressGroupServiceClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         AddressGroup addressGroup = AddressGroup.newBuilder().build();
         String addressGroupId = "addressGroupId705215846";
         AddressGroup response =
             organizationAddressGroupServiceClient
                 .createAddressGroupAsync(parent, addressGroup, addressGroupId)
                 .get();
       }
       
      Parameters:
      parent - Required. The parent resource of the AddressGroup. Must be in the format `projects/*/locations/{location}`.
      addressGroup - Required. AddressGroup resource to be created.
      addressGroupId - 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".
      Throws:
      ApiException - if the remote call fails
    • createAddressGroupAsync

      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 (OrganizationAddressGroupServiceClient organizationAddressGroupServiceClient =
           OrganizationAddressGroupServiceClient.create()) {
         OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]");
         AddressGroup addressGroup = AddressGroup.newBuilder().build();
         String addressGroupId = "addressGroupId705215846";
         AddressGroup response =
             organizationAddressGroupServiceClient
                 .createAddressGroupAsync(parent, addressGroup, addressGroupId)
                 .get();
       }
       
      Parameters:
      parent - Required. The parent resource of the AddressGroup. Must be in the format `projects/*/locations/{location}`.
      addressGroup - Required. AddressGroup resource to be created.
      addressGroupId - 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".
      Throws:
      ApiException - if the remote call fails
    • createAddressGroupAsync

      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 (OrganizationAddressGroupServiceClient organizationAddressGroupServiceClient =
           OrganizationAddressGroupServiceClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         AddressGroup addressGroup = AddressGroup.newBuilder().build();
         String addressGroupId = "addressGroupId705215846";
         AddressGroup response =
             organizationAddressGroupServiceClient
                 .createAddressGroupAsync(parent, addressGroup, addressGroupId)
                 .get();
       }
       
      Parameters:
      parent - Required. The parent resource of the AddressGroup. Must be in the format `projects/*/locations/{location}`.
      addressGroup - Required. AddressGroup resource to be created.
      addressGroupId - 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".
      Throws:
      ApiException - if the remote call fails
    • createAddressGroupAsync

      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 (OrganizationAddressGroupServiceClient organizationAddressGroupServiceClient =
           OrganizationAddressGroupServiceClient.create()) {
         CreateAddressGroupRequest request =
             CreateAddressGroupRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setAddressGroupId("addressGroupId705215846")
                 .setAddressGroup(AddressGroup.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         AddressGroup response =
             organizationAddressGroupServiceClient.createAddressGroupAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • 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 (OrganizationAddressGroupServiceClient organizationAddressGroupServiceClient =
           OrganizationAddressGroupServiceClient.create()) {
         CreateAddressGroupRequest request =
             CreateAddressGroupRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setAddressGroupId("addressGroupId705215846")
                 .setAddressGroup(AddressGroup.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         OperationFuture<AddressGroup, OperationMetadata> future =
             organizationAddressGroupServiceClient
                 .createAddressGroupOperationCallable()
                 .futureCall(request);
         // Do something.
         AddressGroup response = future.get();
       }
       
    • 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 (OrganizationAddressGroupServiceClient organizationAddressGroupServiceClient =
           OrganizationAddressGroupServiceClient.create()) {
         CreateAddressGroupRequest request =
             CreateAddressGroupRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setAddressGroupId("addressGroupId705215846")
                 .setAddressGroup(AddressGroup.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         ApiFuture<Operation> future =
             organizationAddressGroupServiceClient.createAddressGroupCallable().futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • updateAddressGroupAsync

      public final OperationFuture<AddressGroup,OperationMetadata> updateAddressGroupAsync(AddressGroup addressGroup, com.google.protobuf.FieldMask updateMask)
      Updates parameters 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 (OrganizationAddressGroupServiceClient organizationAddressGroupServiceClient =
           OrganizationAddressGroupServiceClient.create()) {
         AddressGroup addressGroup = AddressGroup.newBuilder().build();
         FieldMask updateMask = FieldMask.newBuilder().build();
         AddressGroup response =
             organizationAddressGroupServiceClient
                 .updateAddressGroupAsync(addressGroup, updateMask)
                 .get();
       }
       
      Parameters:
      addressGroup - Required. Updated AddressGroup resource.
      updateMask - 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.
      Throws:
      ApiException - if the remote call fails
    • updateAddressGroupAsync

      public final OperationFuture<AddressGroup,OperationMetadata> updateAddressGroupAsync(UpdateAddressGroupRequest request)
      Updates parameters 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 (OrganizationAddressGroupServiceClient organizationAddressGroupServiceClient =
           OrganizationAddressGroupServiceClient.create()) {
         UpdateAddressGroupRequest request =
             UpdateAddressGroupRequest.newBuilder()
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .setAddressGroup(AddressGroup.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         AddressGroup response =
             organizationAddressGroupServiceClient.updateAddressGroupAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • updateAddressGroupOperationCallable

      public final OperationCallable<UpdateAddressGroupRequest,AddressGroup,OperationMetadata> updateAddressGroupOperationCallable()
      Updates parameters 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 (OrganizationAddressGroupServiceClient organizationAddressGroupServiceClient =
           OrganizationAddressGroupServiceClient.create()) {
         UpdateAddressGroupRequest request =
             UpdateAddressGroupRequest.newBuilder()
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .setAddressGroup(AddressGroup.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         OperationFuture<AddressGroup, OperationMetadata> future =
             organizationAddressGroupServiceClient
                 .updateAddressGroupOperationCallable()
                 .futureCall(request);
         // Do something.
         AddressGroup response = future.get();
       }
       
    • updateAddressGroupCallable

      public final UnaryCallable<UpdateAddressGroupRequest,Operation> updateAddressGroupCallable()
      Updates parameters 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 (OrganizationAddressGroupServiceClient organizationAddressGroupServiceClient =
           OrganizationAddressGroupServiceClient.create()) {
         UpdateAddressGroupRequest request =
             UpdateAddressGroupRequest.newBuilder()
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .setAddressGroup(AddressGroup.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         ApiFuture<Operation> future =
             organizationAddressGroupServiceClient.updateAddressGroupCallable().futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • addAddressGroupItemsAsync

      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 (OrganizationAddressGroupServiceClient organizationAddressGroupServiceClient =
           OrganizationAddressGroupServiceClient.create()) {
         AddressGroupName addressGroup =
             AddressGroupName.ofOrganizationLocationAddressGroupName(
                 "[ORGANIZATION]", "[LOCATION]", "[ADDRESS_GROUP]");
         List<String> items = new ArrayList<>();
         AddressGroup response =
             organizationAddressGroupServiceClient
                 .addAddressGroupItemsAsync(addressGroup, items)
                 .get();
       }
       
      Parameters:
      addressGroup - Required. A name of the AddressGroup to add items to. Must be in the format `projects|organization/*/locations/{location}/addressGroups/*`.
      items - Required. List of items to add.
      Throws:
      ApiException - if the remote call fails
    • addAddressGroupItemsAsync

      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 (OrganizationAddressGroupServiceClient organizationAddressGroupServiceClient =
           OrganizationAddressGroupServiceClient.create()) {
         String addressGroup =
             AddressGroupName.ofProjectLocationAddressGroupName(
                     "[PROJECT]", "[LOCATION]", "[ADDRESS_GROUP]")
                 .toString();
         List<String> items = new ArrayList<>();
         AddressGroup response =
             organizationAddressGroupServiceClient
                 .addAddressGroupItemsAsync(addressGroup, items)
                 .get();
       }
       
      Parameters:
      addressGroup - Required. A name of the AddressGroup to add items to. Must be in the format `projects|organization/*/locations/{location}/addressGroups/*`.
      items - Required. List of items to add.
      Throws:
      ApiException - if the remote call fails
    • addAddressGroupItemsAsync

      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 (OrganizationAddressGroupServiceClient organizationAddressGroupServiceClient =
           OrganizationAddressGroupServiceClient.create()) {
         AddAddressGroupItemsRequest request =
             AddAddressGroupItemsRequest.newBuilder()
                 .setAddressGroup(
                     AddressGroupName.ofOrganizationLocationAddressGroupName(
                             "[ORGANIZATION]", "[LOCATION]", "[ADDRESS_GROUP]")
                         .toString())
                 .addAllItems(new ArrayList<String>())
                 .setRequestId("requestId693933066")
                 .build();
         AddressGroup response =
             organizationAddressGroupServiceClient.addAddressGroupItemsAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • 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 (OrganizationAddressGroupServiceClient organizationAddressGroupServiceClient =
           OrganizationAddressGroupServiceClient.create()) {
         AddAddressGroupItemsRequest request =
             AddAddressGroupItemsRequest.newBuilder()
                 .setAddressGroup(
                     AddressGroupName.ofOrganizationLocationAddressGroupName(
                             "[ORGANIZATION]", "[LOCATION]", "[ADDRESS_GROUP]")
                         .toString())
                 .addAllItems(new ArrayList<String>())
                 .setRequestId("requestId693933066")
                 .build();
         OperationFuture<AddressGroup, OperationMetadata> future =
             organizationAddressGroupServiceClient
                 .addAddressGroupItemsOperationCallable()
                 .futureCall(request);
         // Do something.
         AddressGroup response = future.get();
       }
       
    • 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 (OrganizationAddressGroupServiceClient organizationAddressGroupServiceClient =
           OrganizationAddressGroupServiceClient.create()) {
         AddAddressGroupItemsRequest request =
             AddAddressGroupItemsRequest.newBuilder()
                 .setAddressGroup(
                     AddressGroupName.ofOrganizationLocationAddressGroupName(
                             "[ORGANIZATION]", "[LOCATION]", "[ADDRESS_GROUP]")
                         .toString())
                 .addAllItems(new ArrayList<String>())
                 .setRequestId("requestId693933066")
                 .build();
         ApiFuture<Operation> future =
             organizationAddressGroupServiceClient.addAddressGroupItemsCallable().futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • removeAddressGroupItemsAsync

      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 (OrganizationAddressGroupServiceClient organizationAddressGroupServiceClient =
           OrganizationAddressGroupServiceClient.create()) {
         AddressGroupName addressGroup =
             AddressGroupName.ofOrganizationLocationAddressGroupName(
                 "[ORGANIZATION]", "[LOCATION]", "[ADDRESS_GROUP]");
         List<String> items = new ArrayList<>();
         AddressGroup response =
             organizationAddressGroupServiceClient
                 .removeAddressGroupItemsAsync(addressGroup, items)
                 .get();
       }
       
      Parameters:
      addressGroup - Required. A name of the AddressGroup to remove items from. Must be in the format `projects|organization/*/locations/{location}/addressGroups/*`.
      items - Required. List of items to remove.
      Throws:
      ApiException - if the remote call fails
    • removeAddressGroupItemsAsync

      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 (OrganizationAddressGroupServiceClient organizationAddressGroupServiceClient =
           OrganizationAddressGroupServiceClient.create()) {
         String addressGroup =
             AddressGroupName.ofProjectLocationAddressGroupName(
                     "[PROJECT]", "[LOCATION]", "[ADDRESS_GROUP]")
                 .toString();
         List<String> items = new ArrayList<>();
         AddressGroup response =
             organizationAddressGroupServiceClient
                 .removeAddressGroupItemsAsync(addressGroup, items)
                 .get();
       }
       
      Parameters:
      addressGroup - Required. A name of the AddressGroup to remove items from. Must be in the format `projects|organization/*/locations/{location}/addressGroups/*`.
      items - Required. List of items to remove.
      Throws:
      ApiException - if the remote call fails
    • removeAddressGroupItemsAsync

      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 (OrganizationAddressGroupServiceClient organizationAddressGroupServiceClient =
           OrganizationAddressGroupServiceClient.create()) {
         RemoveAddressGroupItemsRequest request =
             RemoveAddressGroupItemsRequest.newBuilder()
                 .setAddressGroup(
                     AddressGroupName.ofOrganizationLocationAddressGroupName(
                             "[ORGANIZATION]", "[LOCATION]", "[ADDRESS_GROUP]")
                         .toString())
                 .addAllItems(new ArrayList<String>())
                 .setRequestId("requestId693933066")
                 .build();
         AddressGroup response =
             organizationAddressGroupServiceClient.removeAddressGroupItemsAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • 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 (OrganizationAddressGroupServiceClient organizationAddressGroupServiceClient =
           OrganizationAddressGroupServiceClient.create()) {
         RemoveAddressGroupItemsRequest request =
             RemoveAddressGroupItemsRequest.newBuilder()
                 .setAddressGroup(
                     AddressGroupName.ofOrganizationLocationAddressGroupName(
                             "[ORGANIZATION]", "[LOCATION]", "[ADDRESS_GROUP]")
                         .toString())
                 .addAllItems(new ArrayList<String>())
                 .setRequestId("requestId693933066")
                 .build();
         OperationFuture<AddressGroup, OperationMetadata> future =
             organizationAddressGroupServiceClient
                 .removeAddressGroupItemsOperationCallable()
                 .futureCall(request);
         // Do something.
         AddressGroup response = future.get();
       }
       
    • 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 (OrganizationAddressGroupServiceClient organizationAddressGroupServiceClient =
           OrganizationAddressGroupServiceClient.create()) {
         RemoveAddressGroupItemsRequest request =
             RemoveAddressGroupItemsRequest.newBuilder()
                 .setAddressGroup(
                     AddressGroupName.ofOrganizationLocationAddressGroupName(
                             "[ORGANIZATION]", "[LOCATION]", "[ADDRESS_GROUP]")
                         .toString())
                 .addAllItems(new ArrayList<String>())
                 .setRequestId("requestId693933066")
                 .build();
         ApiFuture<Operation> future =
             organizationAddressGroupServiceClient
                 .removeAddressGroupItemsCallable()
                 .futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • cloneAddressGroupItemsAsync

      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 (OrganizationAddressGroupServiceClient organizationAddressGroupServiceClient =
           OrganizationAddressGroupServiceClient.create()) {
         AddressGroupName addressGroup =
             AddressGroupName.ofOrganizationLocationAddressGroupName(
                 "[ORGANIZATION]", "[LOCATION]", "[ADDRESS_GROUP]");
         AddressGroupName sourceAddressGroup =
             AddressGroupName.ofOrganizationLocationAddressGroupName(
                 "[ORGANIZATION]", "[LOCATION]", "[ADDRESS_GROUP]");
         AddressGroup response =
             organizationAddressGroupServiceClient
                 .cloneAddressGroupItemsAsync(addressGroup, sourceAddressGroup)
                 .get();
       }
       
      Parameters:
      addressGroup - Required. A name of the AddressGroup to clone items to. Must be in the format `projects|organization/*/locations/{location}/addressGroups/*`.
      sourceAddressGroup - Required. Source address group to clone items from.
      Throws:
      ApiException - if the remote call fails
    • cloneAddressGroupItemsAsync

      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 (OrganizationAddressGroupServiceClient organizationAddressGroupServiceClient =
           OrganizationAddressGroupServiceClient.create()) {
         AddressGroupName addressGroup =
             AddressGroupName.ofOrganizationLocationAddressGroupName(
                 "[ORGANIZATION]", "[LOCATION]", "[ADDRESS_GROUP]");
         String sourceAddressGroup =
             AddressGroupName.ofProjectLocationAddressGroupName(
                     "[PROJECT]", "[LOCATION]", "[ADDRESS_GROUP]")
                 .toString();
         AddressGroup response =
             organizationAddressGroupServiceClient
                 .cloneAddressGroupItemsAsync(addressGroup, sourceAddressGroup)
                 .get();
       }
       
      Parameters:
      addressGroup - Required. A name of the AddressGroup to clone items to. Must be in the format `projects|organization/*/locations/{location}/addressGroups/*`.
      sourceAddressGroup - Required. Source address group to clone items from.
      Throws:
      ApiException - if the remote call fails
    • cloneAddressGroupItemsAsync

      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 (OrganizationAddressGroupServiceClient organizationAddressGroupServiceClient =
           OrganizationAddressGroupServiceClient.create()) {
         String addressGroup =
             AddressGroupName.ofProjectLocationAddressGroupName(
                     "[PROJECT]", "[LOCATION]", "[ADDRESS_GROUP]")
                 .toString();
         AddressGroupName sourceAddressGroup =
             AddressGroupName.ofOrganizationLocationAddressGroupName(
                 "[ORGANIZATION]", "[LOCATION]", "[ADDRESS_GROUP]");
         AddressGroup response =
             organizationAddressGroupServiceClient
                 .cloneAddressGroupItemsAsync(addressGroup, sourceAddressGroup)
                 .get();
       }
       
      Parameters:
      addressGroup - Required. A name of the AddressGroup to clone items to. Must be in the format `projects|organization/*/locations/{location}/addressGroups/*`.
      sourceAddressGroup - Required. Source address group to clone items from.
      Throws:
      ApiException - if the remote call fails
    • cloneAddressGroupItemsAsync

      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 (OrganizationAddressGroupServiceClient organizationAddressGroupServiceClient =
           OrganizationAddressGroupServiceClient.create()) {
         String addressGroup =
             AddressGroupName.ofProjectLocationAddressGroupName(
                     "[PROJECT]", "[LOCATION]", "[ADDRESS_GROUP]")
                 .toString();
         String sourceAddressGroup =
             AddressGroupName.ofProjectLocationAddressGroupName(
                     "[PROJECT]", "[LOCATION]", "[ADDRESS_GROUP]")
                 .toString();
         AddressGroup response =
             organizationAddressGroupServiceClient
                 .cloneAddressGroupItemsAsync(addressGroup, sourceAddressGroup)
                 .get();
       }
       
      Parameters:
      addressGroup - Required. A name of the AddressGroup to clone items to. Must be in the format `projects|organization/*/locations/{location}/addressGroups/*`.
      sourceAddressGroup - Required. Source address group to clone items from.
      Throws:
      ApiException - if the remote call fails
    • cloneAddressGroupItemsAsync

      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 (OrganizationAddressGroupServiceClient organizationAddressGroupServiceClient =
           OrganizationAddressGroupServiceClient.create()) {
         CloneAddressGroupItemsRequest request =
             CloneAddressGroupItemsRequest.newBuilder()
                 .setAddressGroup(
                     AddressGroupName.ofOrganizationLocationAddressGroupName(
                             "[ORGANIZATION]", "[LOCATION]", "[ADDRESS_GROUP]")
                         .toString())
                 .setSourceAddressGroup(
                     AddressGroupName.ofOrganizationLocationAddressGroupName(
                             "[ORGANIZATION]", "[LOCATION]", "[ADDRESS_GROUP]")
                         .toString())
                 .setRequestId("requestId693933066")
                 .build();
         AddressGroup response =
             organizationAddressGroupServiceClient.cloneAddressGroupItemsAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • 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 (OrganizationAddressGroupServiceClient organizationAddressGroupServiceClient =
           OrganizationAddressGroupServiceClient.create()) {
         CloneAddressGroupItemsRequest request =
             CloneAddressGroupItemsRequest.newBuilder()
                 .setAddressGroup(
                     AddressGroupName.ofOrganizationLocationAddressGroupName(
                             "[ORGANIZATION]", "[LOCATION]", "[ADDRESS_GROUP]")
                         .toString())
                 .setSourceAddressGroup(
                     AddressGroupName.ofOrganizationLocationAddressGroupName(
                             "[ORGANIZATION]", "[LOCATION]", "[ADDRESS_GROUP]")
                         .toString())
                 .setRequestId("requestId693933066")
                 .build();
         OperationFuture<AddressGroup, OperationMetadata> future =
             organizationAddressGroupServiceClient
                 .cloneAddressGroupItemsOperationCallable()
                 .futureCall(request);
         // Do something.
         AddressGroup response = future.get();
       }
       
    • 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 (OrganizationAddressGroupServiceClient organizationAddressGroupServiceClient =
           OrganizationAddressGroupServiceClient.create()) {
         CloneAddressGroupItemsRequest request =
             CloneAddressGroupItemsRequest.newBuilder()
                 .setAddressGroup(
                     AddressGroupName.ofOrganizationLocationAddressGroupName(
                             "[ORGANIZATION]", "[LOCATION]", "[ADDRESS_GROUP]")
                         .toString())
                 .setSourceAddressGroup(
                     AddressGroupName.ofOrganizationLocationAddressGroupName(
                             "[ORGANIZATION]", "[LOCATION]", "[ADDRESS_GROUP]")
                         .toString())
                 .setRequestId("requestId693933066")
                 .build();
         ApiFuture<Operation> future =
             organizationAddressGroupServiceClient
                 .cloneAddressGroupItemsCallable()
                 .futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • deleteAddressGroupAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteAddressGroupAsync(AddressGroupName name)
      Deletes 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 (OrganizationAddressGroupServiceClient organizationAddressGroupServiceClient =
           OrganizationAddressGroupServiceClient.create()) {
         AddressGroupName name =
             AddressGroupName.ofOrganizationLocationAddressGroupName(
                 "[ORGANIZATION]", "[LOCATION]", "[ADDRESS_GROUP]");
         organizationAddressGroupServiceClient.deleteAddressGroupAsync(name).get();
       }
       
      Parameters:
      name - Required. A name of the AddressGroup to delete. Must be in the format `projects/*/locations/{location}/addressGroups/*`.
      Throws:
      ApiException - if the remote call fails
    • deleteAddressGroupAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteAddressGroupAsync(String name)
      Deletes 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 (OrganizationAddressGroupServiceClient organizationAddressGroupServiceClient =
           OrganizationAddressGroupServiceClient.create()) {
         String name =
             AddressGroupName.ofProjectLocationAddressGroupName(
                     "[PROJECT]", "[LOCATION]", "[ADDRESS_GROUP]")
                 .toString();
         organizationAddressGroupServiceClient.deleteAddressGroupAsync(name).get();
       }
       
      Parameters:
      name - Required. A name of the AddressGroup to delete. Must be in the format `projects/*/locations/{location}/addressGroups/*`.
      Throws:
      ApiException - if the remote call fails
    • deleteAddressGroupAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteAddressGroupAsync(DeleteAddressGroupRequest request)
      Deletes 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 (OrganizationAddressGroupServiceClient organizationAddressGroupServiceClient =
           OrganizationAddressGroupServiceClient.create()) {
         DeleteAddressGroupRequest request =
             DeleteAddressGroupRequest.newBuilder()
                 .setName(
                     AddressGroupName.ofOrganizationLocationAddressGroupName(
                             "[ORGANIZATION]", "[LOCATION]", "[ADDRESS_GROUP]")
                         .toString())
                 .setRequestId("requestId693933066")
                 .build();
         organizationAddressGroupServiceClient.deleteAddressGroupAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • deleteAddressGroupOperationCallable

      public final OperationCallable<DeleteAddressGroupRequest,com.google.protobuf.Empty,OperationMetadata> deleteAddressGroupOperationCallable()
      Deletes 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 (OrganizationAddressGroupServiceClient organizationAddressGroupServiceClient =
           OrganizationAddressGroupServiceClient.create()) {
         DeleteAddressGroupRequest request =
             DeleteAddressGroupRequest.newBuilder()
                 .setName(
                     AddressGroupName.ofOrganizationLocationAddressGroupName(
                             "[ORGANIZATION]", "[LOCATION]", "[ADDRESS_GROUP]")
                         .toString())
                 .setRequestId("requestId693933066")
                 .build();
         OperationFuture<Empty, OperationMetadata> future =
             organizationAddressGroupServiceClient
                 .deleteAddressGroupOperationCallable()
                 .futureCall(request);
         // Do something.
         future.get();
       }
       
    • deleteAddressGroupCallable

      public final UnaryCallable<DeleteAddressGroupRequest,Operation> deleteAddressGroupCallable()
      Deletes 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 (OrganizationAddressGroupServiceClient organizationAddressGroupServiceClient =
           OrganizationAddressGroupServiceClient.create()) {
         DeleteAddressGroupRequest request =
             DeleteAddressGroupRequest.newBuilder()
                 .setName(
                     AddressGroupName.ofOrganizationLocationAddressGroupName(
                             "[ORGANIZATION]", "[LOCATION]", "[ADDRESS_GROUP]")
                         .toString())
                 .setRequestId("requestId693933066")
                 .build();
         ApiFuture<Operation> future =
             organizationAddressGroupServiceClient.deleteAddressGroupCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • listAddressGroupReferences

      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 (OrganizationAddressGroupServiceClient organizationAddressGroupServiceClient =
           OrganizationAddressGroupServiceClient.create()) {
         AddressGroupName addressGroup =
             AddressGroupName.ofOrganizationLocationAddressGroupName(
                 "[ORGANIZATION]", "[LOCATION]", "[ADDRESS_GROUP]");
         for (ListAddressGroupReferencesResponse.AddressGroupReference element :
             organizationAddressGroupServiceClient
                 .listAddressGroupReferences(addressGroup)
                 .iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      addressGroup - Required. A name of the AddressGroup to clone items to. Must be in the format `projects|organization/*/locations/{location}/addressGroups/*`.
      Throws:
      ApiException - if the remote call fails
    • listAddressGroupReferences

      public final OrganizationAddressGroupServiceClient.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 (OrganizationAddressGroupServiceClient organizationAddressGroupServiceClient =
           OrganizationAddressGroupServiceClient.create()) {
         String addressGroup =
             AddressGroupName.ofProjectLocationAddressGroupName(
                     "[PROJECT]", "[LOCATION]", "[ADDRESS_GROUP]")
                 .toString();
         for (ListAddressGroupReferencesResponse.AddressGroupReference element :
             organizationAddressGroupServiceClient
                 .listAddressGroupReferences(addressGroup)
                 .iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      addressGroup - Required. A name of the AddressGroup to clone items to. Must be in the format `projects|organization/*/locations/{location}/addressGroups/*`.
      Throws:
      ApiException - if the remote call fails
    • listAddressGroupReferences

      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 (OrganizationAddressGroupServiceClient organizationAddressGroupServiceClient =
           OrganizationAddressGroupServiceClient.create()) {
         ListAddressGroupReferencesRequest request =
             ListAddressGroupReferencesRequest.newBuilder()
                 .setAddressGroup(
                     AddressGroupName.ofOrganizationLocationAddressGroupName(
                             "[ORGANIZATION]", "[LOCATION]", "[ADDRESS_GROUP]")
                         .toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         for (ListAddressGroupReferencesResponse.AddressGroupReference element :
             organizationAddressGroupServiceClient.listAddressGroupReferences(request).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • 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 (OrganizationAddressGroupServiceClient organizationAddressGroupServiceClient =
           OrganizationAddressGroupServiceClient.create()) {
         ListAddressGroupReferencesRequest request =
             ListAddressGroupReferencesRequest.newBuilder()
                 .setAddressGroup(
                     AddressGroupName.ofOrganizationLocationAddressGroupName(
                             "[ORGANIZATION]", "[LOCATION]", "[ADDRESS_GROUP]")
                         .toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         ApiFuture<ListAddressGroupReferencesResponse.AddressGroupReference> future =
             organizationAddressGroupServiceClient
                 .listAddressGroupReferencesPagedCallable()
                 .futureCall(request);
         // Do something.
         for (ListAddressGroupReferencesResponse.AddressGroupReference element :
             future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • 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 (OrganizationAddressGroupServiceClient organizationAddressGroupServiceClient =
           OrganizationAddressGroupServiceClient.create()) {
         ListAddressGroupReferencesRequest request =
             ListAddressGroupReferencesRequest.newBuilder()
                 .setAddressGroup(
                     AddressGroupName.ofOrganizationLocationAddressGroupName(
                             "[ORGANIZATION]", "[LOCATION]", "[ADDRESS_GROUP]")
                         .toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         while (true) {
           ListAddressGroupReferencesResponse response =
               organizationAddressGroupServiceClient
                   .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;
           }
         }
       }
       
    • listLocations

      Lists information about the supported locations for this service.

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

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

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

      Sample code:

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

      Lists information about the supported locations for this service.

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

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

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

      Sample code:

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

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

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

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

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

      Sample code:

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

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

      Sample code:

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

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

      Sample code:

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

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

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

      Sample code:

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

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

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

      Sample code:

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

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

      Sample code:

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

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

      Sample code:

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

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

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

      Sample code:

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

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

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

      Sample code:

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

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

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

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

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

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

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