Google Workspace Add-ons V1 API - Class Google::Cloud::GSuiteAddOns::V1::GSuiteAddOns::Rest::Client (v1.0.0)

Reference documentation and code samples for the Google Workspace Add-ons V1 API class Google::Cloud::GSuiteAddOns::V1::GSuiteAddOns::Rest::Client.

REST client for the GSuiteAddOns service.

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.

Inherits

  • Object

Methods

.configure

def self.configure() { |config| ... } -> Client::Configuration

Configure the GSuiteAddOns Client class.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter
Example
# Modify the configuration for all GSuiteAddOns clients
::Google::Cloud::GSuiteAddOns::V1::GSuiteAddOns::Rest::Client.configure do |config|
  config.timeout = 10.0
end

#configure

def configure() { |config| ... } -> Client::Configuration

Configure the GSuiteAddOns Client instance.

The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on Client.configure.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter

#create_deployment

def create_deployment(request, options = nil) -> ::Google::Cloud::GSuiteAddOns::V1::Deployment
def create_deployment(parent: nil, deployment_id: nil, deployment: nil) -> ::Google::Cloud::GSuiteAddOns::V1::Deployment

Creates a deployment with the specified name and configuration.

Overloads
def create_deployment(request, options = nil) -> ::Google::Cloud::GSuiteAddOns::V1::Deployment
Pass arguments to create_deployment via a request object, either of type CreateDeploymentRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::GSuiteAddOns::V1::CreateDeploymentRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def create_deployment(parent: nil, deployment_id: nil, deployment: nil) -> ::Google::Cloud::GSuiteAddOns::V1::Deployment
Pass arguments to create_deployment via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. Name of the project in which to create the deployment.

    Example: projects/my_project.

  • deployment_id (::String) — Required. The id to use for this deployment. The full name of the created resource will be projects/<project_number>/deployments/<deployment_id>.
  • deployment (::Google::Cloud::GSuiteAddOns::V1::Deployment, ::Hash) — Required. The deployment to create (deployment.name cannot be set).
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require "google/cloud/gsuite_add_ons/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::GSuiteAddOns::V1::GSuiteAddOns::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::GSuiteAddOns::V1::CreateDeploymentRequest.new

# Call the create_deployment method.
result = client.create_deployment request

# The returned object is of type Google::Cloud::GSuiteAddOns::V1::Deployment.
p result

#delete_deployment

def delete_deployment(request, options = nil) -> ::Google::Protobuf::Empty
def delete_deployment(name: nil, etag: nil) -> ::Google::Protobuf::Empty

Deletes the deployment with the given name.

Overloads
def delete_deployment(request, options = nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_deployment via a request object, either of type DeleteDeploymentRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::GSuiteAddOns::V1::DeleteDeploymentRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def delete_deployment(name: nil, etag: nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_deployment via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • name (::String) — Required. The full resource name of the deployment to delete.

    Example: projects/my_project/deployments/my_deployment.

  • etag (::String) — The etag of the deployment to delete. If this is provided, it must match the server's etag.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require "google/cloud/gsuite_add_ons/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::GSuiteAddOns::V1::GSuiteAddOns::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::GSuiteAddOns::V1::DeleteDeploymentRequest.new

# Call the delete_deployment method.
result = client.delete_deployment request

# The returned object is of type Google::Protobuf::Empty.
p result

#get_authorization

def get_authorization(request, options = nil) -> ::Google::Cloud::GSuiteAddOns::V1::Authorization
def get_authorization(name: nil) -> ::Google::Cloud::GSuiteAddOns::V1::Authorization

Gets the authorization information for deployments in a given project.

Overloads
def get_authorization(request, options = nil) -> ::Google::Cloud::GSuiteAddOns::V1::Authorization
Pass arguments to get_authorization via a request object, either of type Google::Cloud::GSuiteAddOns::V1::GetAuthorizationRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::GSuiteAddOns::V1::GetAuthorizationRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def get_authorization(name: nil) -> ::Google::Cloud::GSuiteAddOns::V1::Authorization
Pass arguments to get_authorization via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. Name of the project for which to get the Google Workspace Add-ons authorization information.

    Example: projects/my_project/authorization.

Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require "google/cloud/gsuite_add_ons/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::GSuiteAddOns::V1::GSuiteAddOns::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::GSuiteAddOns::V1::GetAuthorizationRequest.new

# Call the get_authorization method.
result = client.get_authorization request

# The returned object is of type Google::Cloud::GSuiteAddOns::V1::Authorization.
p result

#get_deployment

def get_deployment(request, options = nil) -> ::Google::Cloud::GSuiteAddOns::V1::Deployment
def get_deployment(name: nil) -> ::Google::Cloud::GSuiteAddOns::V1::Deployment

Gets the deployment with the specified name.

Overloads
def get_deployment(request, options = nil) -> ::Google::Cloud::GSuiteAddOns::V1::Deployment
Pass arguments to get_deployment via a request object, either of type Google::Cloud::GSuiteAddOns::V1::GetDeploymentRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::GSuiteAddOns::V1::GetDeploymentRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def get_deployment(name: nil) -> ::Google::Cloud::GSuiteAddOns::V1::Deployment
Pass arguments to get_deployment via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. The full resource name of the deployment to get.

    Example: projects/my_project/deployments/my_deployment.

Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require "google/cloud/gsuite_add_ons/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::GSuiteAddOns::V1::GSuiteAddOns::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::GSuiteAddOns::V1::GetDeploymentRequest.new

# Call the get_deployment method.
result = client.get_deployment request

# The returned object is of type Google::Cloud::GSuiteAddOns::V1::Deployment.
p result

#get_install_status

def get_install_status(request, options = nil) -> ::Google::Cloud::GSuiteAddOns::V1::InstallStatus
def get_install_status(name: nil) -> ::Google::Cloud::GSuiteAddOns::V1::InstallStatus

Fetches the install status of a developer mode deployment.

Overloads
def get_install_status(request, options = nil) -> ::Google::Cloud::GSuiteAddOns::V1::InstallStatus
Pass arguments to get_install_status via a request object, either of type Google::Cloud::GSuiteAddOns::V1::GetInstallStatusRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::GSuiteAddOns::V1::GetInstallStatusRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def get_install_status(name: nil) -> ::Google::Cloud::GSuiteAddOns::V1::InstallStatus
Pass arguments to get_install_status via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. The full resource name of the deployment.

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

Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require "google/cloud/gsuite_add_ons/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::GSuiteAddOns::V1::GSuiteAddOns::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::GSuiteAddOns::V1::GetInstallStatusRequest.new

# Call the get_install_status method.
result = client.get_install_status request

# The returned object is of type Google::Cloud::GSuiteAddOns::V1::InstallStatus.
p result

#initialize

def initialize() { |config| ... } -> Client

Create a new GSuiteAddOns REST client object.

Yields
  • (config) — Configure the GSuiteAddOns client.
Yield Parameter
Returns
  • (Client) — a new instance of Client
Example
# Create a client using the default configuration
client = ::Google::Cloud::GSuiteAddOns::V1::GSuiteAddOns::Rest::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::GSuiteAddOns::V1::GSuiteAddOns::Rest::Client.new do |config|
  config.timeout = 10.0
end

#install_deployment

def install_deployment(request, options = nil) -> ::Google::Protobuf::Empty
def install_deployment(name: nil) -> ::Google::Protobuf::Empty
Overloads
def install_deployment(request, options = nil) -> ::Google::Protobuf::Empty
Pass arguments to install_deployment via a request object, either of type InstallDeploymentRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::GSuiteAddOns::V1::InstallDeploymentRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def install_deployment(name: nil) -> ::Google::Protobuf::Empty
Pass arguments to install_deployment via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. The full resource name of the deployment to install.

    Example: projects/my_project/deployments/my_deployment.

Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require "google/cloud/gsuite_add_ons/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::GSuiteAddOns::V1::GSuiteAddOns::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::GSuiteAddOns::V1::InstallDeploymentRequest.new

# Call the install_deployment method.
result = client.install_deployment request

# The returned object is of type Google::Protobuf::Empty.
p result

#list_deployments

def list_deployments(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::GSuiteAddOns::V1::Deployment>
def list_deployments(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::GSuiteAddOns::V1::Deployment>

Lists all deployments in a particular project.

Overloads
def list_deployments(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::GSuiteAddOns::V1::Deployment>
Pass arguments to list_deployments via a request object, either of type ListDeploymentsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::GSuiteAddOns::V1::ListDeploymentsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def list_deployments(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::GSuiteAddOns::V1::Deployment>
Pass arguments to list_deployments via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. Name of the project in which to create the deployment.

    Example: projects/my_project.

  • page_size (::Integer) — The maximum number of deployments to return. The service may return fewer than this value. If unspecified, at most 1000 deployments will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.
  • page_token (::String) — A page token, received from a previous ListDeployments call. Provide this to retrieve the subsequent page.

    When paginating, all other parameters provided to ListDeployments must match the call that provided the page token.

Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require "google/cloud/gsuite_add_ons/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::GSuiteAddOns::V1::GSuiteAddOns::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::GSuiteAddOns::V1::ListDeploymentsRequest.new

# Call the list_deployments method.
result = client.list_deployments request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::GSuiteAddOns::V1::Deployment.
  p item
end

#replace_deployment

def replace_deployment(request, options = nil) -> ::Google::Cloud::GSuiteAddOns::V1::Deployment
def replace_deployment(deployment: nil) -> ::Google::Cloud::GSuiteAddOns::V1::Deployment

Creates or replaces a deployment with the specified name.

Overloads
def replace_deployment(request, options = nil) -> ::Google::Cloud::GSuiteAddOns::V1::Deployment
Pass arguments to replace_deployment via a request object, either of type ReplaceDeploymentRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::GSuiteAddOns::V1::ReplaceDeploymentRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def replace_deployment(deployment: nil) -> ::Google::Cloud::GSuiteAddOns::V1::Deployment
Pass arguments to replace_deployment via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require "google/cloud/gsuite_add_ons/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::GSuiteAddOns::V1::GSuiteAddOns::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::GSuiteAddOns::V1::ReplaceDeploymentRequest.new

# Call the replace_deployment method.
result = client.replace_deployment request

# The returned object is of type Google::Cloud::GSuiteAddOns::V1::Deployment.
p result

#uninstall_deployment

def uninstall_deployment(request, options = nil) -> ::Google::Protobuf::Empty
def uninstall_deployment(name: nil) -> ::Google::Protobuf::Empty
Overloads
def uninstall_deployment(request, options = nil) -> ::Google::Protobuf::Empty
Pass arguments to uninstall_deployment via a request object, either of type UninstallDeploymentRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::GSuiteAddOns::V1::UninstallDeploymentRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def uninstall_deployment(name: nil) -> ::Google::Protobuf::Empty
Pass arguments to uninstall_deployment via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. The full resource name of the deployment to install.

    Example: projects/my_project/deployments/my_deployment.

Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require "google/cloud/gsuite_add_ons/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::GSuiteAddOns::V1::GSuiteAddOns::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::GSuiteAddOns::V1::UninstallDeploymentRequest.new

# Call the uninstall_deployment method.
result = client.uninstall_deployment request

# The returned object is of type Google::Protobuf::Empty.
p result

#universe_domain

def universe_domain() -> String

The effective universe domain

Returns
  • (String)