Documentation ¶
Overview ¶
Package gsuiteaddons is an auto-generated package for the Google Workspace Add-ons API.
General documentation ¶
For information that is relevant for all client libraries please reference https://pkg.go.dev/cloud.google.com/go#pkg-overview. Some information on this page includes:
- Authentication and Authorization
- Timeouts and Cancellation
- Testing against Client Libraries
- Debugging Client Libraries
- Inspecting errors
Example usage ¶
To get started with this package, create a client.
ctx := context.Background() // 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := gsuiteaddons.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close()
The client will use your default application credentials. Clients should be reused instead of created as needed. The methods of Client are safe for concurrent use by multiple goroutines. The returned client must be Closed when it is done being used.
Using the Client ¶
The following is an example of making an API call with the newly created client.
ctx := context.Background() // 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := gsuiteaddons.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &gsuiteaddonspb.CreateDeploymentRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/gsuiteaddons/apiv1/gsuiteaddonspb#CreateDeploymentRequest. } resp, err := c.CreateDeployment(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp
Use of Context ¶
The ctx passed to NewClient is used for authentication requests and for creating the underlying connection, but is not used for subsequent calls. Individual methods on the client use the ctx given to them.
To close the open connection, use the Close() method.
Index ¶
- func DefaultAuthScopes() []string
- type CallOptions
- type Client
- func (c *Client) Close() error
- func (c *Client) Connection() *grpc.ClientConndeprecated
- func (c *Client) CreateDeployment(ctx context.Context, req *gsuiteaddonspb.CreateDeploymentRequest, ...) (*gsuiteaddonspb.Deployment, error)
- func (c *Client) DeleteDeployment(ctx context.Context, req *gsuiteaddonspb.DeleteDeploymentRequest, ...) error
- func (c *Client) GetAuthorization(ctx context.Context, req *gsuiteaddonspb.GetAuthorizationRequest, ...) (*gsuiteaddonspb.Authorization, error)
- func (c *Client) GetDeployment(ctx context.Context, req *gsuiteaddonspb.GetDeploymentRequest, ...) (*gsuiteaddonspb.Deployment, error)
- func (c *Client) GetInstallStatus(ctx context.Context, req *gsuiteaddonspb.GetInstallStatusRequest, ...) (*gsuiteaddonspb.InstallStatus, error)
- func (c *Client) InstallDeployment(ctx context.Context, req *gsuiteaddonspb.InstallDeploymentRequest, ...) error
- func (c *Client) ListDeployments(ctx context.Context, req *gsuiteaddonspb.ListDeploymentsRequest, ...) *DeploymentIterator
- func (c *Client) ReplaceDeployment(ctx context.Context, req *gsuiteaddonspb.ReplaceDeploymentRequest, ...) (*gsuiteaddonspb.Deployment, error)
- func (c *Client) UninstallDeployment(ctx context.Context, req *gsuiteaddonspb.UninstallDeploymentRequest, ...) error
- type DeploymentIterator
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultAuthScopes ¶
func DefaultAuthScopes() []string
DefaultAuthScopes reports the default set of authentication scopes to use with this package.
Types ¶
type CallOptions ¶
type CallOptions struct { GetAuthorization []gax.CallOption CreateDeployment []gax.CallOption ReplaceDeployment []gax.CallOption GetDeployment []gax.CallOption ListDeployments []gax.CallOption DeleteDeployment []gax.CallOption InstallDeployment []gax.CallOption UninstallDeployment []gax.CallOption GetInstallStatus []gax.CallOption }
CallOptions contains the retry settings for each method of Client.
type Client ¶
type Client struct { // The call options for this service. CallOptions *CallOptions // contains filtered or unexported fields }
Client is a client for interacting with Google Workspace Add-ons API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
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 (at 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 (at 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 (at 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 (at https://developers.google.com/gsuite/add-ons/how-tos/publish-add-on-overview) for details.
func NewClient ¶
NewClient creates a new g suite add ons client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
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 (at 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 (at 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 (at 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 (at https://developers.google.com/gsuite/add-ons/how-tos/publish-add-on-overview) for details.
Example ¶
package main import ( "context" gsuiteaddons "cloud.google.com/go/gsuiteaddons/apiv1" ) func main() { ctx := context.Background() // 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := gsuiteaddons.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func NewRESTClient ¶ added in v1.5.0
NewRESTClient creates a new g suite add ons rest client.
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 (at 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 (at 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 (at 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 (at https://developers.google.com/gsuite/add-ons/how-tos/publish-add-on-overview) for details.
Example ¶
package main import ( "context" gsuiteaddons "cloud.google.com/go/gsuiteaddons/apiv1" ) func main() { ctx := context.Background() // 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := gsuiteaddons.NewRESTClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func (*Client) Close ¶
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*Client) Connection
deprecated
func (c *Client) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*Client) CreateDeployment ¶
func (c *Client) CreateDeployment(ctx context.Context, req *gsuiteaddonspb.CreateDeploymentRequest, opts ...gax.CallOption) (*gsuiteaddonspb.Deployment, error)
CreateDeployment creates a deployment with the specified name and configuration.
Example ¶
package main import ( "context" gsuiteaddons "cloud.google.com/go/gsuiteaddons/apiv1" gsuiteaddonspb "cloud.google.com/go/gsuiteaddons/apiv1/gsuiteaddonspb" ) func main() { ctx := context.Background() // 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := gsuiteaddons.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &gsuiteaddonspb.CreateDeploymentRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/gsuiteaddons/apiv1/gsuiteaddonspb#CreateDeploymentRequest. } resp, err := c.CreateDeployment(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) DeleteDeployment ¶
func (c *Client) DeleteDeployment(ctx context.Context, req *gsuiteaddonspb.DeleteDeploymentRequest, opts ...gax.CallOption) error
DeleteDeployment deletes the deployment with the given name.
Example ¶
package main import ( "context" gsuiteaddons "cloud.google.com/go/gsuiteaddons/apiv1" gsuiteaddonspb "cloud.google.com/go/gsuiteaddons/apiv1/gsuiteaddonspb" ) func main() { ctx := context.Background() // 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := gsuiteaddons.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &gsuiteaddonspb.DeleteDeploymentRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/gsuiteaddons/apiv1/gsuiteaddonspb#DeleteDeploymentRequest. } err = c.DeleteDeployment(ctx, req) if err != nil { // TODO: Handle error. } }
Output:
func (*Client) GetAuthorization ¶
func (c *Client) GetAuthorization(ctx context.Context, req *gsuiteaddonspb.GetAuthorizationRequest, opts ...gax.CallOption) (*gsuiteaddonspb.Authorization, error)
GetAuthorization gets the authorization information for deployments in a given project.
Example ¶
package main import ( "context" gsuiteaddons "cloud.google.com/go/gsuiteaddons/apiv1" gsuiteaddonspb "cloud.google.com/go/gsuiteaddons/apiv1/gsuiteaddonspb" ) func main() { ctx := context.Background() // 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := gsuiteaddons.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &gsuiteaddonspb.GetAuthorizationRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/gsuiteaddons/apiv1/gsuiteaddonspb#GetAuthorizationRequest. } resp, err := c.GetAuthorization(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) GetDeployment ¶
func (c *Client) GetDeployment(ctx context.Context, req *gsuiteaddonspb.GetDeploymentRequest, opts ...gax.CallOption) (*gsuiteaddonspb.Deployment, error)
GetDeployment gets the deployment with the specified name.
Example ¶
package main import ( "context" gsuiteaddons "cloud.google.com/go/gsuiteaddons/apiv1" gsuiteaddonspb "cloud.google.com/go/gsuiteaddons/apiv1/gsuiteaddonspb" ) func main() { ctx := context.Background() // 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := gsuiteaddons.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &gsuiteaddonspb.GetDeploymentRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/gsuiteaddons/apiv1/gsuiteaddonspb#GetDeploymentRequest. } resp, err := c.GetDeployment(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) GetInstallStatus ¶
func (c *Client) GetInstallStatus(ctx context.Context, req *gsuiteaddonspb.GetInstallStatusRequest, opts ...gax.CallOption) (*gsuiteaddonspb.InstallStatus, error)
GetInstallStatus fetches the install status of a developer mode deployment.
Example ¶
package main import ( "context" gsuiteaddons "cloud.google.com/go/gsuiteaddons/apiv1" gsuiteaddonspb "cloud.google.com/go/gsuiteaddons/apiv1/gsuiteaddonspb" ) func main() { ctx := context.Background() // 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := gsuiteaddons.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &gsuiteaddonspb.GetInstallStatusRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/gsuiteaddons/apiv1/gsuiteaddonspb#GetInstallStatusRequest. } resp, err := c.GetInstallStatus(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) InstallDeployment ¶
func (c *Client) InstallDeployment(ctx context.Context, req *gsuiteaddonspb.InstallDeploymentRequest, opts ...gax.CallOption) error
InstallDeployment installs a deployment in developer mode. See: https://developers.google.com/gsuite/add-ons/how-tos/testing-gsuite-addons (at https://developers.google.com/gsuite/add-ons/how-tos/testing-gsuite-addons).
Example ¶
package main import ( "context" gsuiteaddons "cloud.google.com/go/gsuiteaddons/apiv1" gsuiteaddonspb "cloud.google.com/go/gsuiteaddons/apiv1/gsuiteaddonspb" ) func main() { ctx := context.Background() // 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := gsuiteaddons.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &gsuiteaddonspb.InstallDeploymentRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/gsuiteaddons/apiv1/gsuiteaddonspb#InstallDeploymentRequest. } err = c.InstallDeployment(ctx, req) if err != nil { // TODO: Handle error. } }
Output:
func (*Client) ListDeployments ¶
func (c *Client) ListDeployments(ctx context.Context, req *gsuiteaddonspb.ListDeploymentsRequest, opts ...gax.CallOption) *DeploymentIterator
ListDeployments lists all deployments in a particular project.
Example ¶
package main import ( "context" gsuiteaddons "cloud.google.com/go/gsuiteaddons/apiv1" gsuiteaddonspb "cloud.google.com/go/gsuiteaddons/apiv1/gsuiteaddonspb" "google.golang.org/api/iterator" ) func main() { ctx := context.Background() // 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := gsuiteaddons.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &gsuiteaddonspb.ListDeploymentsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/gsuiteaddons/apiv1/gsuiteaddonspb#ListDeploymentsRequest. } it := c.ListDeployments(ctx, req) for { resp, err := it.Next() if err == iterator.Done { break } if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp // If you need to access the underlying RPC response, // you can do so by casting the `Response` as below. // Otherwise, remove this line. Only populated after // first call to Next(). Not safe for concurrent access. _ = it.Response.(*gsuiteaddonspb.ListDeploymentsResponse) } }
Output:
func (*Client) ReplaceDeployment ¶
func (c *Client) ReplaceDeployment(ctx context.Context, req *gsuiteaddonspb.ReplaceDeploymentRequest, opts ...gax.CallOption) (*gsuiteaddonspb.Deployment, error)
ReplaceDeployment creates or replaces a deployment with the specified name.
Example ¶
package main import ( "context" gsuiteaddons "cloud.google.com/go/gsuiteaddons/apiv1" gsuiteaddonspb "cloud.google.com/go/gsuiteaddons/apiv1/gsuiteaddonspb" ) func main() { ctx := context.Background() // 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := gsuiteaddons.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &gsuiteaddonspb.ReplaceDeploymentRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/gsuiteaddons/apiv1/gsuiteaddonspb#ReplaceDeploymentRequest. } resp, err := c.ReplaceDeployment(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) UninstallDeployment ¶
func (c *Client) UninstallDeployment(ctx context.Context, req *gsuiteaddonspb.UninstallDeploymentRequest, opts ...gax.CallOption) error
UninstallDeployment uninstalls a developer mode deployment. See: https://developers.google.com/gsuite/add-ons/how-tos/testing-gsuite-addons (at https://developers.google.com/gsuite/add-ons/how-tos/testing-gsuite-addons).
Example ¶
package main import ( "context" gsuiteaddons "cloud.google.com/go/gsuiteaddons/apiv1" gsuiteaddonspb "cloud.google.com/go/gsuiteaddons/apiv1/gsuiteaddonspb" ) func main() { ctx := context.Background() // 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := gsuiteaddons.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &gsuiteaddonspb.UninstallDeploymentRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/gsuiteaddons/apiv1/gsuiteaddonspb#UninstallDeploymentRequest. } err = c.UninstallDeployment(ctx, req) if err != nil { // TODO: Handle error. } }
Output:
type DeploymentIterator ¶
type DeploymentIterator struct { // Response is the raw response for the current page. // It must be cast to the RPC response type. // Calling Next() or InternalFetch() updates this value. Response interface{} // InternalFetch is for use by the Google Cloud Libraries only. // It is not part of the stable interface of this package. // // InternalFetch returns results from a single call to the underlying RPC. // The number of results is no greater than pageSize. // If there are no more results, nextPageToken is empty and err is nil. InternalFetch func(pageSize int, pageToken string) (results []*gsuiteaddonspb.Deployment, nextPageToken string, err error) // contains filtered or unexported fields }
DeploymentIterator manages a stream of *gsuiteaddonspb.Deployment.
func (*DeploymentIterator) Next ¶
func (it *DeploymentIterator) Next() (*gsuiteaddonspb.Deployment, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*DeploymentIterator) PageInfo ¶
func (it *DeploymentIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.