Class GSuiteAddOnsClient

java.lang.Object
com.google.cloud.gsuiteaddons.v1.GSuiteAddOnsClient
All Implemented Interfaces:
BackgroundResource, AutoCloseable

@Generated("by gapic-generator-java") public class GSuiteAddOnsClient extends Object implements BackgroundResource
Service Description: A service for managing Google Workspace add-ons deployments.

A Google Workspace add-on is a third-party embedded component that can be installed in Google Workspace Applications like Gmail, Calendar, Drive, and the Google Docs, Sheets, and Slides editors. Google Workspace add-ons can display UI cards, receive contextual information from the host application, and perform actions in the host application (See: https://developers.google.com/gsuite/add-ons/overview for more information).

A Google Workspace add-on deployment resource specifies metadata about the add-on, including a specification of the entry points in the host application that trigger add-on executions (see: https://developers.google.com/gsuite/add-ons/concepts/gsuite-manifests). Add-on deployments defined via the Google Workspace add-ons API define their entrypoints using HTTPS URLs (See: https://developers.google.com/gsuite/add-ons/guides/alternate-runtimes),

A Google Workspace add-on deployment can be installed in developer mode, which allows an add-on developer to test the experience an end-user would see when installing and running the add-on in their G Suite applications. When running in developer mode, more detailed error messages are exposed in the add-on UI to aid in debugging.

A Google Workspace add-on deployment can be published to Google Workspace Marketplace, which allows other Google Workspace users to discover and install the add-on. See: https://developers.google.com/gsuite/add-ons/how-tos/publish-add-on-overview for details.

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 (GSuiteAddOnsClient gSuiteAddOnsClient = GSuiteAddOnsClient.create()) {
   AuthorizationName name = AuthorizationName.of("[PROJECT]");
   Authorization response = gSuiteAddOnsClient.getAuthorization(name);
 }
 

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

GetAuthorization

Gets the authorization information for deployments in a given project.

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

  • getAuthorization(GetAuthorizationRequest request)

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

  • getAuthorization(AuthorizationName name)

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

  • getAuthorizationCallable()

CreateDeployment

Creates a deployment with the specified name and configuration.

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

  • createDeployment(CreateDeploymentRequest request)

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

  • createDeployment(ProjectName parent, Deployment deployment, String deploymentId)

  • createDeployment(String parent, Deployment deployment, String deploymentId)

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

  • createDeploymentCallable()

ReplaceDeployment

Creates or replaces a deployment with the specified name.

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

  • replaceDeployment(ReplaceDeploymentRequest request)

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

  • replaceDeployment(Deployment deployment)

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

  • replaceDeploymentCallable()

GetDeployment

Gets the deployment with the specified name.

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

  • getDeployment(GetDeploymentRequest request)

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

  • getDeployment(DeploymentName name)

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

  • getDeploymentCallable()

ListDeployments

Lists all deployments in a particular project.

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

  • listDeployments(ListDeploymentsRequest request)

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

  • listDeployments(ProjectName parent)

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

  • listDeploymentsPagedCallable()

  • listDeploymentsCallable()

DeleteDeployment

Deletes the deployment with the given name.

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

  • deleteDeployment(DeleteDeploymentRequest request)

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

  • deleteDeployment(DeploymentName name)

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

  • deleteDeploymentCallable()

InstallDeployment

Installs a deployment in developer mode. See: https://developers.google.com/gsuite/add-ons/how-tos/testing-gsuite-addons.

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

  • installDeployment(InstallDeploymentRequest request)

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

  • installDeployment(DeploymentName name)

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

  • installDeploymentCallable()

UninstallDeployment

Uninstalls a developer mode deployment. See: https://developers.google.com/gsuite/add-ons/how-tos/testing-gsuite-addons.

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

  • uninstallDeployment(UninstallDeploymentRequest request)

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

  • uninstallDeployment(DeploymentName name)

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

  • uninstallDeploymentCallable()

GetInstallStatus

Fetches the install status of a developer mode deployment.

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

  • getInstallStatus(GetInstallStatusRequest request)

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

  • getInstallStatus(InstallStatusName name)

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

  • getInstallStatusCallable()

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 GSuiteAddOnsSettings 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
 GSuiteAddOnsSettings gSuiteAddOnsSettings =
     GSuiteAddOnsSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 GSuiteAddOnsClient gSuiteAddOnsClient = GSuiteAddOnsClient.create(gSuiteAddOnsSettings);
 

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
 GSuiteAddOnsSettings gSuiteAddOnsSettings =
     GSuiteAddOnsSettings.newBuilder().setEndpoint(myEndpoint).build();
 GSuiteAddOnsClient gSuiteAddOnsClient = GSuiteAddOnsClient.create(gSuiteAddOnsSettings);
 

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over the wire:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 GSuiteAddOnsSettings gSuiteAddOnsSettings = GSuiteAddOnsSettings.newHttpJsonBuilder().build();
 GSuiteAddOnsClient gSuiteAddOnsClient = GSuiteAddOnsClient.create(gSuiteAddOnsSettings);
 

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

  • Constructor Details

    • GSuiteAddOnsClient

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

      protected GSuiteAddOnsClient(GSuiteAddOnsStub stub)
  • Method Details

    • create

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

      public static final GSuiteAddOnsClient create(GSuiteAddOnsSettings settings) throws IOException
      Constructs an instance of GSuiteAddOnsClient, 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

      public static final GSuiteAddOnsClient create(GSuiteAddOnsStub stub)
      Constructs an instance of GSuiteAddOnsClient, using the given stub for making calls. This is for advanced usage - prefer using create(GSuiteAddOnsSettings).
    • getSettings

      public final GSuiteAddOnsSettings getSettings()
    • getStub

      public GSuiteAddOnsStub getStub()
    • getAuthorization

      public final Authorization getAuthorization(AuthorizationName name)
      Gets the authorization information for deployments in a given 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 (GSuiteAddOnsClient gSuiteAddOnsClient = GSuiteAddOnsClient.create()) {
         AuthorizationName name = AuthorizationName.of("[PROJECT]");
         Authorization response = gSuiteAddOnsClient.getAuthorization(name);
       }
       
      Parameters:
      name - Required. Name of the project for which to get the Google Workspace add-ons authorization information.

      Example: `projects/my_project/authorization`.

      Throws:
      ApiException - if the remote call fails
    • getAuthorization

      public final Authorization getAuthorization(String name)
      Gets the authorization information for deployments in a given 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 (GSuiteAddOnsClient gSuiteAddOnsClient = GSuiteAddOnsClient.create()) {
         String name = AuthorizationName.of("[PROJECT]").toString();
         Authorization response = gSuiteAddOnsClient.getAuthorization(name);
       }
       
      Parameters:
      name - Required. Name of the project for which to get the Google Workspace add-ons authorization information.

      Example: `projects/my_project/authorization`.

      Throws:
      ApiException - if the remote call fails
    • getAuthorization

      public final Authorization getAuthorization(GetAuthorizationRequest request)
      Gets the authorization information for deployments in a given 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 (GSuiteAddOnsClient gSuiteAddOnsClient = GSuiteAddOnsClient.create()) {
         GetAuthorizationRequest request =
             GetAuthorizationRequest.newBuilder()
                 .setName(AuthorizationName.of("[PROJECT]").toString())
                 .build();
         Authorization response = gSuiteAddOnsClient.getAuthorization(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • getAuthorizationCallable

      public final UnaryCallable<GetAuthorizationRequest,Authorization> getAuthorizationCallable()
      Gets the authorization information for deployments in a given 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 (GSuiteAddOnsClient gSuiteAddOnsClient = GSuiteAddOnsClient.create()) {
         GetAuthorizationRequest request =
             GetAuthorizationRequest.newBuilder()
                 .setName(AuthorizationName.of("[PROJECT]").toString())
                 .build();
         ApiFuture<Authorization> future =
             gSuiteAddOnsClient.getAuthorizationCallable().futureCall(request);
         // Do something.
         Authorization response = future.get();
       }
       
    • createDeployment

      public final Deployment createDeployment(ProjectName parent, Deployment deployment, String deploymentId)
      Creates a deployment with the specified name and configuration.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (GSuiteAddOnsClient gSuiteAddOnsClient = GSuiteAddOnsClient.create()) {
         ProjectName parent = ProjectName.of("[PROJECT]");
         Deployment deployment = Deployment.newBuilder().build();
         String deploymentId = "deploymentId-136894784";
         Deployment response = gSuiteAddOnsClient.createDeployment(parent, deployment, deploymentId);
       }
       
      Parameters:
      parent - Required. Name of the project in which to create the deployment.

      Example: `projects/my_project`.

      deployment - Required. The deployment to create (deployment.name cannot be set).
      deploymentId - Required. The id to use for this deployment. The full name of the created resource will be `projects/<project_number>/deployments/<deployment_id>`.
      Throws:
      ApiException - if the remote call fails
    • createDeployment

      public final Deployment createDeployment(String parent, Deployment deployment, String deploymentId)
      Creates a deployment with the specified name and configuration.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (GSuiteAddOnsClient gSuiteAddOnsClient = GSuiteAddOnsClient.create()) {
         String parent = ProjectName.of("[PROJECT]").toString();
         Deployment deployment = Deployment.newBuilder().build();
         String deploymentId = "deploymentId-136894784";
         Deployment response = gSuiteAddOnsClient.createDeployment(parent, deployment, deploymentId);
       }
       
      Parameters:
      parent - Required. Name of the project in which to create the deployment.

      Example: `projects/my_project`.

      deployment - Required. The deployment to create (deployment.name cannot be set).
      deploymentId - Required. The id to use for this deployment. The full name of the created resource will be `projects/<project_number>/deployments/<deployment_id>`.
      Throws:
      ApiException - if the remote call fails
    • createDeployment

      public final Deployment createDeployment(CreateDeploymentRequest request)
      Creates a deployment with the specified name and configuration.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (GSuiteAddOnsClient gSuiteAddOnsClient = GSuiteAddOnsClient.create()) {
         CreateDeploymentRequest request =
             CreateDeploymentRequest.newBuilder()
                 .setParent(ProjectName.of("[PROJECT]").toString())
                 .setDeploymentId("deploymentId-136894784")
                 .setDeployment(Deployment.newBuilder().build())
                 .build();
         Deployment response = gSuiteAddOnsClient.createDeployment(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • createDeploymentCallable

      public final UnaryCallable<CreateDeploymentRequest,Deployment> createDeploymentCallable()
      Creates a deployment with the specified name and configuration.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (GSuiteAddOnsClient gSuiteAddOnsClient = GSuiteAddOnsClient.create()) {
         CreateDeploymentRequest request =
             CreateDeploymentRequest.newBuilder()
                 .setParent(ProjectName.of("[PROJECT]").toString())
                 .setDeploymentId("deploymentId-136894784")
                 .setDeployment(Deployment.newBuilder().build())
                 .build();
         ApiFuture<Deployment> future =
             gSuiteAddOnsClient.createDeploymentCallable().futureCall(request);
         // Do something.
         Deployment response = future.get();
       }
       
    • replaceDeployment

      public final Deployment replaceDeployment(Deployment deployment)
      Creates or replaces a deployment with the specified name.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (GSuiteAddOnsClient gSuiteAddOnsClient = GSuiteAddOnsClient.create()) {
         Deployment deployment = Deployment.newBuilder().build();
         Deployment response = gSuiteAddOnsClient.replaceDeployment(deployment);
       }
       
      Parameters:
      deployment - Required. The deployment to create or replace.
      Throws:
      ApiException - if the remote call fails
    • replaceDeployment

      public final Deployment replaceDeployment(ReplaceDeploymentRequest request)
      Creates or replaces a deployment with the specified name.

      Sample code:

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

      public final UnaryCallable<ReplaceDeploymentRequest,Deployment> replaceDeploymentCallable()
      Creates or replaces a deployment with the specified name.

      Sample code:

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

      public final Deployment getDeployment(DeploymentName name)
      Gets the deployment with the specified name.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (GSuiteAddOnsClient gSuiteAddOnsClient = GSuiteAddOnsClient.create()) {
         DeploymentName name = DeploymentName.of("[PROJECT]", "[DEPLOYMENT]");
         Deployment response = gSuiteAddOnsClient.getDeployment(name);
       }
       
      Parameters:
      name - Required. The full resource name of the deployment to get.

      Example: `projects/my_project/deployments/my_deployment`.

      Throws:
      ApiException - if the remote call fails
    • getDeployment

      public final Deployment getDeployment(String name)
      Gets the deployment with the specified name.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (GSuiteAddOnsClient gSuiteAddOnsClient = GSuiteAddOnsClient.create()) {
         String name = DeploymentName.of("[PROJECT]", "[DEPLOYMENT]").toString();
         Deployment response = gSuiteAddOnsClient.getDeployment(name);
       }
       
      Parameters:
      name - Required. The full resource name of the deployment to get.

      Example: `projects/my_project/deployments/my_deployment`.

      Throws:
      ApiException - if the remote call fails
    • getDeployment

      public final Deployment getDeployment(GetDeploymentRequest request)
      Gets the deployment with the specified name.

      Sample code:

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

      public final UnaryCallable<GetDeploymentRequest,Deployment> getDeploymentCallable()
      Gets the deployment with the specified name.

      Sample code:

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

      public final GSuiteAddOnsClient.ListDeploymentsPagedResponse listDeployments(ProjectName parent)
      Lists all deployments in a particular 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 (GSuiteAddOnsClient gSuiteAddOnsClient = GSuiteAddOnsClient.create()) {
         ProjectName parent = ProjectName.of("[PROJECT]");
         for (Deployment element : gSuiteAddOnsClient.listDeployments(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. Name of the project in which to create the deployment.

      Example: `projects/my_project`.

      Throws:
      ApiException - if the remote call fails
    • listDeployments

      public final GSuiteAddOnsClient.ListDeploymentsPagedResponse listDeployments(String parent)
      Lists all deployments in a particular 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 (GSuiteAddOnsClient gSuiteAddOnsClient = GSuiteAddOnsClient.create()) {
         String parent = ProjectName.of("[PROJECT]").toString();
         for (Deployment element : gSuiteAddOnsClient.listDeployments(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. Name of the project in which to create the deployment.

      Example: `projects/my_project`.

      Throws:
      ApiException - if the remote call fails
    • listDeployments

      Lists all deployments in a particular 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 (GSuiteAddOnsClient gSuiteAddOnsClient = GSuiteAddOnsClient.create()) {
         ListDeploymentsRequest request =
             ListDeploymentsRequest.newBuilder()
                 .setParent(ProjectName.of("[PROJECT]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         for (Deployment element : gSuiteAddOnsClient.listDeployments(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
    • listDeploymentsPagedCallable

      Lists all deployments in a particular 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 (GSuiteAddOnsClient gSuiteAddOnsClient = GSuiteAddOnsClient.create()) {
         ListDeploymentsRequest request =
             ListDeploymentsRequest.newBuilder()
                 .setParent(ProjectName.of("[PROJECT]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         ApiFuture<Deployment> future =
             gSuiteAddOnsClient.listDeploymentsPagedCallable().futureCall(request);
         // Do something.
         for (Deployment element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • listDeploymentsCallable

      public final UnaryCallable<ListDeploymentsRequest,ListDeploymentsResponse> listDeploymentsCallable()
      Lists all deployments in a particular 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 (GSuiteAddOnsClient gSuiteAddOnsClient = GSuiteAddOnsClient.create()) {
         ListDeploymentsRequest request =
             ListDeploymentsRequest.newBuilder()
                 .setParent(ProjectName.of("[PROJECT]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         while (true) {
           ListDeploymentsResponse response =
               gSuiteAddOnsClient.listDeploymentsCallable().call(request);
           for (Deployment element : response.getDeploymentsList()) {
             // doThingsWith(element);
           }
           String nextPageToken = response.getNextPageToken();
           if (!Strings.isNullOrEmpty(nextPageToken)) {
             request = request.toBuilder().setPageToken(nextPageToken).build();
           } else {
             break;
           }
         }
       }
       
    • deleteDeployment

      public final void deleteDeployment(DeploymentName name)
      Deletes the deployment with the given name.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (GSuiteAddOnsClient gSuiteAddOnsClient = GSuiteAddOnsClient.create()) {
         DeploymentName name = DeploymentName.of("[PROJECT]", "[DEPLOYMENT]");
         gSuiteAddOnsClient.deleteDeployment(name);
       }
       
      Parameters:
      name - Required. The full resource name of the deployment to delete.

      Example: `projects/my_project/deployments/my_deployment`.

      Throws:
      ApiException - if the remote call fails
    • deleteDeployment

      public final void deleteDeployment(String name)
      Deletes the deployment with the given name.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (GSuiteAddOnsClient gSuiteAddOnsClient = GSuiteAddOnsClient.create()) {
         String name = DeploymentName.of("[PROJECT]", "[DEPLOYMENT]").toString();
         gSuiteAddOnsClient.deleteDeployment(name);
       }
       
      Parameters:
      name - Required. The full resource name of the deployment to delete.

      Example: `projects/my_project/deployments/my_deployment`.

      Throws:
      ApiException - if the remote call fails
    • deleteDeployment

      public final void deleteDeployment(DeleteDeploymentRequest request)
      Deletes the deployment with the given name.

      Sample code:

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

      public final UnaryCallable<DeleteDeploymentRequest,com.google.protobuf.Empty> deleteDeploymentCallable()
      Deletes the deployment with the given name.

      Sample code:

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

      public final void installDeployment(DeploymentName name)
      Installs a deployment in developer mode. See: https://developers.google.com/gsuite/add-ons/how-tos/testing-gsuite-addons.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (GSuiteAddOnsClient gSuiteAddOnsClient = GSuiteAddOnsClient.create()) {
         DeploymentName name = DeploymentName.of("[PROJECT]", "[DEPLOYMENT]");
         gSuiteAddOnsClient.installDeployment(name);
       }
       
      Parameters:
      name - Required. The full resource name of the deployment to install.

      Example: `projects/my_project/deployments/my_deployment`.

      Throws:
      ApiException - if the remote call fails
    • installDeployment

      public final void installDeployment(String name)
      Installs a deployment in developer mode. See: https://developers.google.com/gsuite/add-ons/how-tos/testing-gsuite-addons.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (GSuiteAddOnsClient gSuiteAddOnsClient = GSuiteAddOnsClient.create()) {
         String name = DeploymentName.of("[PROJECT]", "[DEPLOYMENT]").toString();
         gSuiteAddOnsClient.installDeployment(name);
       }
       
      Parameters:
      name - Required. The full resource name of the deployment to install.

      Example: `projects/my_project/deployments/my_deployment`.

      Throws:
      ApiException - if the remote call fails
    • installDeployment

      public final void installDeployment(InstallDeploymentRequest request)
      Installs a deployment in developer mode. See: https://developers.google.com/gsuite/add-ons/how-tos/testing-gsuite-addons.

      Sample code:

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

      public final UnaryCallable<InstallDeploymentRequest,com.google.protobuf.Empty> installDeploymentCallable()
      Installs a deployment in developer mode. See: https://developers.google.com/gsuite/add-ons/how-tos/testing-gsuite-addons.

      Sample code:

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

      public final void uninstallDeployment(DeploymentName name)
      Uninstalls a developer mode deployment. See: https://developers.google.com/gsuite/add-ons/how-tos/testing-gsuite-addons.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (GSuiteAddOnsClient gSuiteAddOnsClient = GSuiteAddOnsClient.create()) {
         DeploymentName name = DeploymentName.of("[PROJECT]", "[DEPLOYMENT]");
         gSuiteAddOnsClient.uninstallDeployment(name);
       }
       
      Parameters:
      name - Required. The full resource name of the deployment to install.

      Example: `projects/my_project/deployments/my_deployment`.

      Throws:
      ApiException - if the remote call fails
    • uninstallDeployment

      public final void uninstallDeployment(String name)
      Uninstalls a developer mode deployment. See: https://developers.google.com/gsuite/add-ons/how-tos/testing-gsuite-addons.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (GSuiteAddOnsClient gSuiteAddOnsClient = GSuiteAddOnsClient.create()) {
         String name = DeploymentName.of("[PROJECT]", "[DEPLOYMENT]").toString();
         gSuiteAddOnsClient.uninstallDeployment(name);
       }
       
      Parameters:
      name - Required. The full resource name of the deployment to install.

      Example: `projects/my_project/deployments/my_deployment`.

      Throws:
      ApiException - if the remote call fails
    • uninstallDeployment

      public final void uninstallDeployment(UninstallDeploymentRequest request)
      Uninstalls a developer mode deployment. See: https://developers.google.com/gsuite/add-ons/how-tos/testing-gsuite-addons.

      Sample code:

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

      public final UnaryCallable<UninstallDeploymentRequest,com.google.protobuf.Empty> uninstallDeploymentCallable()
      Uninstalls a developer mode deployment. See: https://developers.google.com/gsuite/add-ons/how-tos/testing-gsuite-addons.

      Sample code:

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

      public final InstallStatus getInstallStatus(InstallStatusName name)
      Fetches the install status of a developer mode deployment.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (GSuiteAddOnsClient gSuiteAddOnsClient = GSuiteAddOnsClient.create()) {
         InstallStatusName name = InstallStatusName.of("[PROJECT]", "[DEPLOYMENT]");
         InstallStatus response = gSuiteAddOnsClient.getInstallStatus(name);
       }
       
      Parameters:
      name - Required. The full resource name of the deployment.

      Example: `projects/my_project/deployments/my_deployment/installStatus`.

      Throws:
      ApiException - if the remote call fails
    • getInstallStatus

      public final InstallStatus getInstallStatus(String name)
      Fetches the install status of a developer mode deployment.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (GSuiteAddOnsClient gSuiteAddOnsClient = GSuiteAddOnsClient.create()) {
         String name = InstallStatusName.of("[PROJECT]", "[DEPLOYMENT]").toString();
         InstallStatus response = gSuiteAddOnsClient.getInstallStatus(name);
       }
       
      Parameters:
      name - Required. The full resource name of the deployment.

      Example: `projects/my_project/deployments/my_deployment/installStatus`.

      Throws:
      ApiException - if the remote call fails
    • getInstallStatus

      public final InstallStatus getInstallStatus(GetInstallStatusRequest request)
      Fetches the install status of a developer mode deployment.

      Sample code:

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

      public final UnaryCallable<GetInstallStatusRequest,InstallStatus> getInstallStatusCallable()
      Fetches the install status of a developer mode deployment.

      Sample code:

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