Class ManagedIdentitiesServiceClient

java.lang.Object
com.google.cloud.managedidentities.v1.ManagedIdentitiesServiceClient
All Implemented Interfaces:
BackgroundResource, AutoCloseable

@Generated("by gapic-generator-java") public class ManagedIdentitiesServiceClient extends Object implements BackgroundResource
Service Description: API Overview

The `managedidentites.googleapis.com` service implements the Google Cloud Managed Identites API for identity services (e.g. Microsoft Active Directory).

The Managed Identities service provides methods to manage (create/read/update/delete) domains, reset managed identities admin password, add/remove domain controllers in GCP regions and add/remove VPC peering.

Data Model

The Managed Identities service exposes the following resources:

  • Locations as global, named as follows: `projects/{project_id}/locations/global`.
  • Domains, named as follows: `/projects/{project_id}/locations/global/domain/{domain_name}`.

The `{domain_name}` refers to fully qualified domain name in the customer project e.g. mydomain.myorganization.com, with the following restrictions:

* Must contain only lowercase letters, numbers, periods and hyphens. * Must start with a letter. * Must contain between 2-64 characters. * Must end with a number or a letter. * Must not start with period. * First segement length (mydomain form example above) shouldn't exceed 15 chars. * The last segment cannot be fully numeric. * Must be unique within the customer project.

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 (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
     ManagedIdentitiesServiceClient.create()) {
   DomainName name = DomainName.of("[PROJECT]", "[LOCATION]", "[DOMAIN]");
   ResetAdminPasswordResponse response = managedIdentitiesServiceClient.resetAdminPassword(name);
 }
 

Note: close() needs to be called on the ManagedIdentitiesServiceClient 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

CreateMicrosoftAdDomain

Creates a Microsoft AD domain.

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

  • createMicrosoftAdDomainAsync(CreateMicrosoftAdDomainRequest request)

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

  • createMicrosoftAdDomainAsync(LocationName parent, String domainName, Domain domain)

  • createMicrosoftAdDomainAsync(String parent, String domainName, Domain domain)

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

  • createMicrosoftAdDomainOperationCallable()

  • createMicrosoftAdDomainCallable()

ResetAdminPassword

Resets a domain's administrator password.

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

  • resetAdminPassword(ResetAdminPasswordRequest request)

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

  • resetAdminPassword(DomainName name)

  • resetAdminPassword(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.

  • resetAdminPasswordCallable()

ListDomains

Lists domains in a project.

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

  • listDomains(ListDomainsRequest request)

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

  • listDomains(LocationName parent)

  • listDomains(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.

  • listDomainsPagedCallable()

  • listDomainsCallable()

GetDomain

Gets information about a domain.

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

  • getDomain(GetDomainRequest request)

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

  • getDomain(DomainName name)

  • getDomain(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.

  • getDomainCallable()

UpdateDomain

Updates the metadata and configuration of a domain.

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

  • updateDomainAsync(UpdateDomainRequest request)

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

  • updateDomainAsync(Domain domain, 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.

  • updateDomainOperationCallable()

  • updateDomainCallable()

DeleteDomain

Deletes a domain.

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

  • deleteDomainAsync(DeleteDomainRequest request)

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

  • deleteDomainAsync(DomainName name)

  • deleteDomainAsync(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.

  • deleteDomainOperationCallable()

  • deleteDomainCallable()

AttachTrust

Adds an AD trust to a domain.

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

  • attachTrustAsync(AttachTrustRequest request)

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

  • attachTrustAsync(DomainName name, Trust trust)

  • attachTrustAsync(String name, Trust trust)

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

  • attachTrustOperationCallable()

  • attachTrustCallable()

ReconfigureTrust

Updates the DNS conditional forwarder.

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

  • reconfigureTrustAsync(ReconfigureTrustRequest request)

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

  • reconfigureTrustAsync(DomainName name, String targetDomainName, List<String> targetDnsIpAddresses)

  • reconfigureTrustAsync(String name, String targetDomainName, List<String> targetDnsIpAddresses)

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

  • reconfigureTrustOperationCallable()

  • reconfigureTrustCallable()

DetachTrust

Removes an AD trust.

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

  • detachTrustAsync(DetachTrustRequest request)

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

  • detachTrustAsync(DomainName name, Trust trust)

  • detachTrustAsync(String name, Trust trust)

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

  • detachTrustOperationCallable()

  • detachTrustCallable()

ValidateTrust

Validates a trust state, that the target domain is reachable, and that the target domain is able to accept incoming trust requests.

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

  • validateTrustAsync(ValidateTrustRequest request)

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

  • validateTrustAsync(DomainName name, Trust trust)

  • validateTrustAsync(String name, Trust trust)

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

  • validateTrustOperationCallable()

  • validateTrustCallable()

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 ManagedIdentitiesServiceSettings 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
 ManagedIdentitiesServiceSettings managedIdentitiesServiceSettings =
     ManagedIdentitiesServiceSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
     ManagedIdentitiesServiceClient.create(managedIdentitiesServiceSettings);
 

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
 ManagedIdentitiesServiceSettings managedIdentitiesServiceSettings =
     ManagedIdentitiesServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
 ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
     ManagedIdentitiesServiceClient.create(managedIdentitiesServiceSettings);
 

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

  • Constructor Details

    • ManagedIdentitiesServiceClient

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

      protected ManagedIdentitiesServiceClient(ManagedIdentitiesServiceStub stub)
  • Method Details

    • create

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

      public static final ManagedIdentitiesServiceClient create(ManagedIdentitiesServiceSettings settings) throws IOException
      Constructs an instance of ManagedIdentitiesServiceClient, 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 ManagedIdentitiesServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(ManagedIdentitiesServiceSettings).
    • getSettings

      public final ManagedIdentitiesServiceSettings getSettings()
    • getStub

      public ManagedIdentitiesServiceStub 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.
    • createMicrosoftAdDomainAsync

      public final OperationFuture<Domain,OpMetadata> createMicrosoftAdDomainAsync(LocationName parent, String domainName, Domain domain)
      Creates a Microsoft AD domain.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
           ManagedIdentitiesServiceClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         String domainName = "domainName-1244085905";
         Domain domain = Domain.newBuilder().build();
         Domain response =
             managedIdentitiesServiceClient
                 .createMicrosoftAdDomainAsync(parent, domainName, domain)
                 .get();
       }
       
      Parameters:
      parent - Required. The resource project name and location using the form: `projects/{project_id}/locations/global`
      domainName - Required. The fully qualified domain name. e.g. mydomain.myorganization.com, with the following restrictions:

      * Must contain only lowercase letters, numbers, periods and hyphens. * Must start with a letter. * Must contain between 2-64 characters. * Must end with a number or a letter. * Must not start with period. * First segement length (mydomain form example above) shouldn't exceed 15 chars. * The last segment cannot be fully numeric. * Must be unique within the customer project.

      domain - Required. A Managed Identity domain resource.
      Throws:
      ApiException - if the remote call fails
    • createMicrosoftAdDomainAsync

      public final OperationFuture<Domain,OpMetadata> createMicrosoftAdDomainAsync(String parent, String domainName, Domain domain)
      Creates a Microsoft AD domain.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
           ManagedIdentitiesServiceClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         String domainName = "domainName-1244085905";
         Domain domain = Domain.newBuilder().build();
         Domain response =
             managedIdentitiesServiceClient
                 .createMicrosoftAdDomainAsync(parent, domainName, domain)
                 .get();
       }
       
      Parameters:
      parent - Required. The resource project name and location using the form: `projects/{project_id}/locations/global`
      domainName - Required. The fully qualified domain name. e.g. mydomain.myorganization.com, with the following restrictions:

      * Must contain only lowercase letters, numbers, periods and hyphens. * Must start with a letter. * Must contain between 2-64 characters. * Must end with a number or a letter. * Must not start with period. * First segement length (mydomain form example above) shouldn't exceed 15 chars. * The last segment cannot be fully numeric. * Must be unique within the customer project.

      domain - Required. A Managed Identity domain resource.
      Throws:
      ApiException - if the remote call fails
    • createMicrosoftAdDomainAsync

      public final OperationFuture<Domain,OpMetadata> createMicrosoftAdDomainAsync(CreateMicrosoftAdDomainRequest request)
      Creates a Microsoft AD domain.

      Sample code:

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

      public final OperationCallable<CreateMicrosoftAdDomainRequest,Domain,OpMetadata> createMicrosoftAdDomainOperationCallable()
      Creates a Microsoft AD domain.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
           ManagedIdentitiesServiceClient.create()) {
         CreateMicrosoftAdDomainRequest request =
             CreateMicrosoftAdDomainRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setDomainName("domainName-1244085905")
                 .setDomain(Domain.newBuilder().build())
                 .build();
         OperationFuture<Domain, OpMetadata> future =
             managedIdentitiesServiceClient
                 .createMicrosoftAdDomainOperationCallable()
                 .futureCall(request);
         // Do something.
         Domain response = future.get();
       }
       
    • createMicrosoftAdDomainCallable

      public final UnaryCallable<CreateMicrosoftAdDomainRequest,Operation> createMicrosoftAdDomainCallable()
      Creates a Microsoft AD domain.

      Sample code:

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

      public final ResetAdminPasswordResponse resetAdminPassword(DomainName name)
      Resets a domain's administrator password.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
           ManagedIdentitiesServiceClient.create()) {
         DomainName name = DomainName.of("[PROJECT]", "[LOCATION]", "[DOMAIN]");
         ResetAdminPasswordResponse response = managedIdentitiesServiceClient.resetAdminPassword(name);
       }
       
      Parameters:
      name - Required. The domain resource name using the form: `projects/{project_id}/locations/global/domains/{domain_name}`
      Throws:
      ApiException - if the remote call fails
    • resetAdminPassword

      public final ResetAdminPasswordResponse resetAdminPassword(String name)
      Resets a domain's administrator password.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
           ManagedIdentitiesServiceClient.create()) {
         String name = DomainName.of("[PROJECT]", "[LOCATION]", "[DOMAIN]").toString();
         ResetAdminPasswordResponse response = managedIdentitiesServiceClient.resetAdminPassword(name);
       }
       
      Parameters:
      name - Required. The domain resource name using the form: `projects/{project_id}/locations/global/domains/{domain_name}`
      Throws:
      ApiException - if the remote call fails
    • resetAdminPassword

      public final ResetAdminPasswordResponse resetAdminPassword(ResetAdminPasswordRequest request)
      Resets a domain's administrator password.

      Sample code:

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

      public final UnaryCallable<ResetAdminPasswordRequest,ResetAdminPasswordResponse> resetAdminPasswordCallable()
      Resets a domain's administrator password.

      Sample code:

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

      Lists domains in a project.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
           ManagedIdentitiesServiceClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         for (Domain element : managedIdentitiesServiceClient.listDomains(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. The resource name of the domain location using the form: `projects/{project_id}/locations/global`
      Throws:
      ApiException - if the remote call fails
    • listDomains

      Lists domains in a project.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
           ManagedIdentitiesServiceClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         for (Domain element : managedIdentitiesServiceClient.listDomains(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. The resource name of the domain location using the form: `projects/{project_id}/locations/global`
      Throws:
      ApiException - if the remote call fails
    • listDomains

      Lists domains in a project.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
           ManagedIdentitiesServiceClient.create()) {
         ListDomainsRequest request =
             ListDomainsRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         for (Domain element : managedIdentitiesServiceClient.listDomains(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
    • listDomainsPagedCallable

      Lists domains in a project.

      Sample code:

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

      public final UnaryCallable<ListDomainsRequest,ListDomainsResponse> listDomainsCallable()
      Lists domains in a project.

      Sample code:

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

      public final Domain getDomain(DomainName name)
      Gets information about a domain.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
           ManagedIdentitiesServiceClient.create()) {
         DomainName name = DomainName.of("[PROJECT]", "[LOCATION]", "[DOMAIN]");
         Domain response = managedIdentitiesServiceClient.getDomain(name);
       }
       
      Parameters:
      name - Required. The domain resource name using the form: `projects/{project_id}/locations/global/domains/{domain_name}`
      Throws:
      ApiException - if the remote call fails
    • getDomain

      public final Domain getDomain(String name)
      Gets information about a domain.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
           ManagedIdentitiesServiceClient.create()) {
         String name = DomainName.of("[PROJECT]", "[LOCATION]", "[DOMAIN]").toString();
         Domain response = managedIdentitiesServiceClient.getDomain(name);
       }
       
      Parameters:
      name - Required. The domain resource name using the form: `projects/{project_id}/locations/global/domains/{domain_name}`
      Throws:
      ApiException - if the remote call fails
    • getDomain

      public final Domain getDomain(GetDomainRequest request)
      Gets information about a domain.

      Sample code:

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

      public final UnaryCallable<GetDomainRequest,Domain> getDomainCallable()
      Gets information about a domain.

      Sample code:

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

      public final OperationFuture<Domain,OpMetadata> updateDomainAsync(Domain domain, com.google.protobuf.FieldMask updateMask)
      Updates the metadata and configuration of a domain.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
           ManagedIdentitiesServiceClient.create()) {
         Domain domain = Domain.newBuilder().build();
         FieldMask updateMask = FieldMask.newBuilder().build();
         Domain response = managedIdentitiesServiceClient.updateDomainAsync(domain, updateMask).get();
       }
       
      Parameters:
      domain - Required. Domain message with updated fields. Only supported fields specified in update_mask are updated.
      updateMask - Required. Mask of fields to update. At least one path must be supplied in this field. The elements of the repeated paths field may only include fields from [Domain][google.cloud.managedidentities.v1.Domain]: * `labels` * `locations` * `authorized_networks`
      Throws:
      ApiException - if the remote call fails
    • updateDomainAsync

      public final OperationFuture<Domain,OpMetadata> updateDomainAsync(UpdateDomainRequest request)
      Updates the metadata and configuration of a domain.

      Sample code:

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

      public final OperationCallable<UpdateDomainRequest,Domain,OpMetadata> updateDomainOperationCallable()
      Updates the metadata and configuration of a domain.

      Sample code:

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

      public final UnaryCallable<UpdateDomainRequest,Operation> updateDomainCallable()
      Updates the metadata and configuration of a domain.

      Sample code:

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

      public final OperationFuture<com.google.protobuf.Empty,OpMetadata> deleteDomainAsync(DomainName name)
      Deletes a domain.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
           ManagedIdentitiesServiceClient.create()) {
         DomainName name = DomainName.of("[PROJECT]", "[LOCATION]", "[DOMAIN]");
         managedIdentitiesServiceClient.deleteDomainAsync(name).get();
       }
       
      Parameters:
      name - Required. The domain resource name using the form: `projects/{project_id}/locations/global/domains/{domain_name}`
      Throws:
      ApiException - if the remote call fails
    • deleteDomainAsync

      public final OperationFuture<com.google.protobuf.Empty,OpMetadata> deleteDomainAsync(String name)
      Deletes a domain.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
           ManagedIdentitiesServiceClient.create()) {
         String name = DomainName.of("[PROJECT]", "[LOCATION]", "[DOMAIN]").toString();
         managedIdentitiesServiceClient.deleteDomainAsync(name).get();
       }
       
      Parameters:
      name - Required. The domain resource name using the form: `projects/{project_id}/locations/global/domains/{domain_name}`
      Throws:
      ApiException - if the remote call fails
    • deleteDomainAsync

      public final OperationFuture<com.google.protobuf.Empty,OpMetadata> deleteDomainAsync(DeleteDomainRequest request)
      Deletes a domain.

      Sample code:

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

      public final OperationCallable<DeleteDomainRequest,com.google.protobuf.Empty,OpMetadata> deleteDomainOperationCallable()
      Deletes a domain.

      Sample code:

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

      public final UnaryCallable<DeleteDomainRequest,Operation> deleteDomainCallable()
      Deletes a domain.

      Sample code:

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

      public final OperationFuture<Domain,OpMetadata> attachTrustAsync(DomainName name, Trust trust)
      Adds an AD trust to a domain.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
           ManagedIdentitiesServiceClient.create()) {
         DomainName name = DomainName.of("[PROJECT]", "[LOCATION]", "[DOMAIN]");
         Trust trust = Trust.newBuilder().build();
         Domain response = managedIdentitiesServiceClient.attachTrustAsync(name, trust).get();
       }
       
      Parameters:
      name - Required. The resource domain name, project name and location using the form: `projects/{project_id}/locations/global/domains/{domain_name}`
      trust - Required. The domain trust resource.
      Throws:
      ApiException - if the remote call fails
    • attachTrustAsync

      public final OperationFuture<Domain,OpMetadata> attachTrustAsync(String name, Trust trust)
      Adds an AD trust to a domain.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
           ManagedIdentitiesServiceClient.create()) {
         String name = DomainName.of("[PROJECT]", "[LOCATION]", "[DOMAIN]").toString();
         Trust trust = Trust.newBuilder().build();
         Domain response = managedIdentitiesServiceClient.attachTrustAsync(name, trust).get();
       }
       
      Parameters:
      name - Required. The resource domain name, project name and location using the form: `projects/{project_id}/locations/global/domains/{domain_name}`
      trust - Required. The domain trust resource.
      Throws:
      ApiException - if the remote call fails
    • attachTrustAsync

      public final OperationFuture<Domain,OpMetadata> attachTrustAsync(AttachTrustRequest request)
      Adds an AD trust to a domain.

      Sample code:

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

      public final OperationCallable<AttachTrustRequest,Domain,OpMetadata> attachTrustOperationCallable()
      Adds an AD trust to a domain.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
           ManagedIdentitiesServiceClient.create()) {
         AttachTrustRequest request =
             AttachTrustRequest.newBuilder()
                 .setName(DomainName.of("[PROJECT]", "[LOCATION]", "[DOMAIN]").toString())
                 .setTrust(Trust.newBuilder().build())
                 .build();
         OperationFuture<Domain, OpMetadata> future =
             managedIdentitiesServiceClient.attachTrustOperationCallable().futureCall(request);
         // Do something.
         Domain response = future.get();
       }
       
    • attachTrustCallable

      public final UnaryCallable<AttachTrustRequest,Operation> attachTrustCallable()
      Adds an AD trust to a domain.

      Sample code:

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

      public final OperationFuture<Domain,OpMetadata> reconfigureTrustAsync(DomainName name, String targetDomainName, List<String> targetDnsIpAddresses)
      Updates the DNS conditional forwarder.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
           ManagedIdentitiesServiceClient.create()) {
         DomainName name = DomainName.of("[PROJECT]", "[LOCATION]", "[DOMAIN]");
         String targetDomainName = "targetDomainName2065239520";
         List<String> targetDnsIpAddresses = new ArrayList<>();
         Domain response =
             managedIdentitiesServiceClient
                 .reconfigureTrustAsync(name, targetDomainName, targetDnsIpAddresses)
                 .get();
       }
       
      Parameters:
      name - Required. The resource domain name, project name and location using the form: `projects/{project_id}/locations/global/domains/{domain_name}`
      targetDomainName - Required. The fully-qualified target domain name which will be in trust with current domain.
      targetDnsIpAddresses - Required. The target DNS server IP addresses to resolve the remote domain involved in the trust.
      Throws:
      ApiException - if the remote call fails
    • reconfigureTrustAsync

      public final OperationFuture<Domain,OpMetadata> reconfigureTrustAsync(String name, String targetDomainName, List<String> targetDnsIpAddresses)
      Updates the DNS conditional forwarder.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
           ManagedIdentitiesServiceClient.create()) {
         String name = DomainName.of("[PROJECT]", "[LOCATION]", "[DOMAIN]").toString();
         String targetDomainName = "targetDomainName2065239520";
         List<String> targetDnsIpAddresses = new ArrayList<>();
         Domain response =
             managedIdentitiesServiceClient
                 .reconfigureTrustAsync(name, targetDomainName, targetDnsIpAddresses)
                 .get();
       }
       
      Parameters:
      name - Required. The resource domain name, project name and location using the form: `projects/{project_id}/locations/global/domains/{domain_name}`
      targetDomainName - Required. The fully-qualified target domain name which will be in trust with current domain.
      targetDnsIpAddresses - Required. The target DNS server IP addresses to resolve the remote domain involved in the trust.
      Throws:
      ApiException - if the remote call fails
    • reconfigureTrustAsync

      public final OperationFuture<Domain,OpMetadata> reconfigureTrustAsync(ReconfigureTrustRequest request)
      Updates the DNS conditional forwarder.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
           ManagedIdentitiesServiceClient.create()) {
         ReconfigureTrustRequest request =
             ReconfigureTrustRequest.newBuilder()
                 .setName(DomainName.of("[PROJECT]", "[LOCATION]", "[DOMAIN]").toString())
                 .setTargetDomainName("targetDomainName2065239520")
                 .addAllTargetDnsIpAddresses(new ArrayList<String>())
                 .build();
         Domain response = managedIdentitiesServiceClient.reconfigureTrustAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • reconfigureTrustOperationCallable

      public final OperationCallable<ReconfigureTrustRequest,Domain,OpMetadata> reconfigureTrustOperationCallable()
      Updates the DNS conditional forwarder.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
           ManagedIdentitiesServiceClient.create()) {
         ReconfigureTrustRequest request =
             ReconfigureTrustRequest.newBuilder()
                 .setName(DomainName.of("[PROJECT]", "[LOCATION]", "[DOMAIN]").toString())
                 .setTargetDomainName("targetDomainName2065239520")
                 .addAllTargetDnsIpAddresses(new ArrayList<String>())
                 .build();
         OperationFuture<Domain, OpMetadata> future =
             managedIdentitiesServiceClient.reconfigureTrustOperationCallable().futureCall(request);
         // Do something.
         Domain response = future.get();
       }
       
    • reconfigureTrustCallable

      public final UnaryCallable<ReconfigureTrustRequest,Operation> reconfigureTrustCallable()
      Updates the DNS conditional forwarder.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
           ManagedIdentitiesServiceClient.create()) {
         ReconfigureTrustRequest request =
             ReconfigureTrustRequest.newBuilder()
                 .setName(DomainName.of("[PROJECT]", "[LOCATION]", "[DOMAIN]").toString())
                 .setTargetDomainName("targetDomainName2065239520")
                 .addAllTargetDnsIpAddresses(new ArrayList<String>())
                 .build();
         ApiFuture<Operation> future =
             managedIdentitiesServiceClient.reconfigureTrustCallable().futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • detachTrustAsync

      public final OperationFuture<Domain,OpMetadata> detachTrustAsync(DomainName name, Trust trust)
      Removes an AD trust.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
           ManagedIdentitiesServiceClient.create()) {
         DomainName name = DomainName.of("[PROJECT]", "[LOCATION]", "[DOMAIN]");
         Trust trust = Trust.newBuilder().build();
         Domain response = managedIdentitiesServiceClient.detachTrustAsync(name, trust).get();
       }
       
      Parameters:
      name - Required. The resource domain name, project name, and location using the form: `projects/{project_id}/locations/global/domains/{domain_name}`
      trust - Required. The domain trust resource to removed.
      Throws:
      ApiException - if the remote call fails
    • detachTrustAsync

      public final OperationFuture<Domain,OpMetadata> detachTrustAsync(String name, Trust trust)
      Removes an AD trust.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
           ManagedIdentitiesServiceClient.create()) {
         String name = DomainName.of("[PROJECT]", "[LOCATION]", "[DOMAIN]").toString();
         Trust trust = Trust.newBuilder().build();
         Domain response = managedIdentitiesServiceClient.detachTrustAsync(name, trust).get();
       }
       
      Parameters:
      name - Required. The resource domain name, project name, and location using the form: `projects/{project_id}/locations/global/domains/{domain_name}`
      trust - Required. The domain trust resource to removed.
      Throws:
      ApiException - if the remote call fails
    • detachTrustAsync

      public final OperationFuture<Domain,OpMetadata> detachTrustAsync(DetachTrustRequest request)
      Removes an AD trust.

      Sample code:

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

      public final OperationCallable<DetachTrustRequest,Domain,OpMetadata> detachTrustOperationCallable()
      Removes an AD trust.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
           ManagedIdentitiesServiceClient.create()) {
         DetachTrustRequest request =
             DetachTrustRequest.newBuilder()
                 .setName(DomainName.of("[PROJECT]", "[LOCATION]", "[DOMAIN]").toString())
                 .setTrust(Trust.newBuilder().build())
                 .build();
         OperationFuture<Domain, OpMetadata> future =
             managedIdentitiesServiceClient.detachTrustOperationCallable().futureCall(request);
         // Do something.
         Domain response = future.get();
       }
       
    • detachTrustCallable

      public final UnaryCallable<DetachTrustRequest,Operation> detachTrustCallable()
      Removes an AD trust.

      Sample code:

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

      public final OperationFuture<Domain,OpMetadata> validateTrustAsync(DomainName name, Trust trust)
      Validates a trust state, that the target domain is reachable, and that the target domain is able to accept incoming trust requests.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
           ManagedIdentitiesServiceClient.create()) {
         DomainName name = DomainName.of("[PROJECT]", "[LOCATION]", "[DOMAIN]");
         Trust trust = Trust.newBuilder().build();
         Domain response = managedIdentitiesServiceClient.validateTrustAsync(name, trust).get();
       }
       
      Parameters:
      name - Required. The resource domain name, project name, and location using the form: `projects/{project_id}/locations/global/domains/{domain_name}`
      trust - Required. The domain trust to validate trust state for.
      Throws:
      ApiException - if the remote call fails
    • validateTrustAsync

      public final OperationFuture<Domain,OpMetadata> validateTrustAsync(String name, Trust trust)
      Validates a trust state, that the target domain is reachable, and that the target domain is able to accept incoming trust requests.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
           ManagedIdentitiesServiceClient.create()) {
         String name = DomainName.of("[PROJECT]", "[LOCATION]", "[DOMAIN]").toString();
         Trust trust = Trust.newBuilder().build();
         Domain response = managedIdentitiesServiceClient.validateTrustAsync(name, trust).get();
       }
       
      Parameters:
      name - Required. The resource domain name, project name, and location using the form: `projects/{project_id}/locations/global/domains/{domain_name}`
      trust - Required. The domain trust to validate trust state for.
      Throws:
      ApiException - if the remote call fails
    • validateTrustAsync

      public final OperationFuture<Domain,OpMetadata> validateTrustAsync(ValidateTrustRequest request)
      Validates a trust state, that the target domain is reachable, and that the target domain is able to accept incoming trust requests.

      Sample code:

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

      public final OperationCallable<ValidateTrustRequest,Domain,OpMetadata> validateTrustOperationCallable()
      Validates a trust state, that the target domain is reachable, and that the target domain is able to accept incoming trust requests.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
           ManagedIdentitiesServiceClient.create()) {
         ValidateTrustRequest request =
             ValidateTrustRequest.newBuilder()
                 .setName(DomainName.of("[PROJECT]", "[LOCATION]", "[DOMAIN]").toString())
                 .setTrust(Trust.newBuilder().build())
                 .build();
         OperationFuture<Domain, OpMetadata> future =
             managedIdentitiesServiceClient.validateTrustOperationCallable().futureCall(request);
         // Do something.
         Domain response = future.get();
       }
       
    • validateTrustCallable

      public final UnaryCallable<ValidateTrustRequest,Operation> validateTrustCallable()
      Validates a trust state, that the target domain is reachable, and that the target domain is able to accept incoming trust requests.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
           ManagedIdentitiesServiceClient.create()) {
         ValidateTrustRequest request =
             ValidateTrustRequest.newBuilder()
                 .setName(DomainName.of("[PROJECT]", "[LOCATION]", "[DOMAIN]").toString())
                 .setTrust(Trust.newBuilder().build())
                 .build();
         ApiFuture<Operation> future =
             managedIdentitiesServiceClient.validateTrustCallable().futureCall(request);
         // Do something.
         Operation 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