workspaceevents

package
v0.181.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 16, 2024 License: BSD-3-Clause Imports: 16 Imported by: 0

Documentation

Overview

Package workspaceevents provides access to the Google Workspace Events API.

For product documentation, see: https://developers.google.com/workspace/events

Library status

These client libraries are officially supported by Google. However, this library is considered complete and is in maintenance mode. This means that we will address critical bugs and security issues but will not add any new features.

When possible, we recommend using our newer [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go) that are still actively being worked and iterated on.

Creating a client

Usage example:

import "google.golang.org/api/workspaceevents/v1"
...
ctx := context.Background()
workspaceeventsService, err := workspaceevents.NewService(ctx)

In this example, Google Application Default Credentials are used for authentication. For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.

Other authentication options

By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use google.golang.org/api/option.WithScopes:

workspaceeventsService, err := workspaceevents.NewService(ctx, option.WithScopes(workspaceevents.MeetingsSpaceReadonlyScope))

To use an API key for authentication (note: some APIs do not support API keys), use google.golang.org/api/option.WithAPIKey:

workspaceeventsService, err := workspaceevents.NewService(ctx, option.WithAPIKey("AIza..."))

To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow, use google.golang.org/api/option.WithTokenSource:

config := &oauth2.Config{...}
// ...
token, err := config.Exchange(ctx, ...)
workspaceeventsService, err := workspaceevents.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))

See google.golang.org/api/option.ClientOption for details on options.

Index

Constants

View Source
const (
	// Private Service: https://www.googleapis.com/auth/chat.bot
	ChatBotScope = "https://www.googleapis.com/auth/chat.bot"

	// View, add, update, and remove members from conversations in Google Chat
	ChatMembershipsScope = "https://www.googleapis.com/auth/chat.memberships"

	// View members in Google Chat conversations.
	ChatMembershipsReadonlyScope = "https://www.googleapis.com/auth/chat.memberships.readonly"

	// View, compose, send, update, and delete messages, and add, view, and delete
	// reactions to messages.
	ChatMessagesScope = "https://www.googleapis.com/auth/chat.messages"

	// View, add, and delete reactions to messages in Google Chat
	ChatMessagesReactionsScope = "https://www.googleapis.com/auth/chat.messages.reactions"

	// View reactions to messages in Google Chat
	ChatMessagesReactionsReadonlyScope = "https://www.googleapis.com/auth/chat.messages.reactions.readonly"

	// View messages and reactions in Google Chat
	ChatMessagesReadonlyScope = "https://www.googleapis.com/auth/chat.messages.readonly"

	// Create conversations and spaces and see or edit metadata (including history
	// settings and access settings) in Google Chat
	ChatSpacesScope = "https://www.googleapis.com/auth/chat.spaces"

	// View chat and spaces in Google Chat
	ChatSpacesReadonlyScope = "https://www.googleapis.com/auth/chat.spaces.readonly"

	// Create, edit, and see information about your Google Meet conferences created
	// by the app.
	MeetingsSpaceCreatedScope = "https://www.googleapis.com/auth/meetings.space.created"

	// Read information about any of your Google Meet conferences
	MeetingsSpaceReadonlyScope = "https://www.googleapis.com/auth/meetings.space.readonly"
)

OAuth2 scopes used by this API.

Variables

This section is empty.

Functions

This section is empty.

Types

type ListSubscriptionsResponse added in v0.166.0

type ListSubscriptionsResponse struct {
	// NextPageToken: A token, which can be sent as `page_token` to retrieve the
	// next page. If this field is omitted, there are no subsequent pages.
	NextPageToken string `json:"nextPageToken,omitempty"`
	// Subscriptions: List of subscriptions.
	Subscriptions []*Subscription `json:"subscriptions,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the server.
	googleapi.ServerResponse `json:"-"`
	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

ListSubscriptionsResponse: The response message for SubscriptionsService.ListSubscriptions.

func (*ListSubscriptionsResponse) MarshalJSON added in v0.166.0

func (s *ListSubscriptionsResponse) MarshalJSON() ([]byte, error)

type NotificationEndpoint added in v0.166.0

type NotificationEndpoint struct {
	// PubsubTopic: Immutable. The Cloud Pub/Sub topic that receives events for the
	// subscription. Format: `projects/{project}/topics/{topic}` You must create
	// the topic in the same Google Cloud project where you create this
	// subscription. When the topic receives events, the events are encoded as
	// Cloud Pub/Sub messages. For details, see the Google Cloud Pub/Sub Protocol
	// Binding for CloudEvents
	// (https://github.com/googleapis/google-cloudevents/blob/main/docs/spec/pubsub.md).
	PubsubTopic string `json:"pubsubTopic,omitempty"`
	// ForceSendFields is a list of field names (e.g. "PubsubTopic") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "PubsubTopic") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

NotificationEndpoint: The endpoint where the subscription delivers events.

func (*NotificationEndpoint) MarshalJSON added in v0.166.0

func (s *NotificationEndpoint) MarshalJSON() ([]byte, error)

type Operation added in v0.166.0

type Operation struct {
	// Done: If the value is `false`, it means the operation is still in progress.
	// If `true`, the operation is completed, and either `error` or `response` is
	// available.
	Done bool `json:"done,omitempty"`
	// Error: The error result of the operation in case of failure or cancellation.
	Error *Status `json:"error,omitempty"`
	// Metadata: Service-specific metadata associated with the operation. It
	// typically contains progress information and common metadata such as create
	// time. Some services might not provide such metadata. Any method that returns
	// a long-running operation should document the metadata type, if any.
	Metadata googleapi.RawMessage `json:"metadata,omitempty"`
	// Name: The server-assigned name, which is only unique within the same service
	// that originally returns it. If you use the default HTTP mapping, the `name`
	// should be a resource name ending with `operations/{unique_id}`.
	Name string `json:"name,omitempty"`
	// Response: The normal, successful response of the operation. If the original
	// method returns no data on success, such as `Delete`, the response is
	// `google.protobuf.Empty`. If the original method is standard
	// `Get`/`Create`/`Update`, the response should be the resource. For other
	// methods, the response should have the type `XxxResponse`, where `Xxx` is the
	// original method name. For example, if the original method name is
	// `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
	Response googleapi.RawMessage `json:"response,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the server.
	googleapi.ServerResponse `json:"-"`
	// ForceSendFields is a list of field names (e.g. "Done") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Done") to include in API requests
	// with the JSON null value. By default, fields with empty values are omitted
	// from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

Operation: This resource represents a long-running operation that is the result of a network API call.

func (*Operation) MarshalJSON added in v0.166.0

func (s *Operation) MarshalJSON() ([]byte, error)

type OperationsGetCall added in v0.166.0

type OperationsGetCall struct {
	// contains filtered or unexported fields
}

func (*OperationsGetCall) Context added in v0.166.0

Context sets the context to be used in this call's Do method.

func (*OperationsGetCall) Do added in v0.166.0

Do executes the "workspaceevents.operations.get" call. Any non-2xx status code is an error. Response headers are in either *Operation.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*OperationsGetCall) Fields added in v0.166.0

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.

func (*OperationsGetCall) Header added in v0.166.0

func (c *OperationsGetCall) Header() http.Header

Header returns a http.Header that can be modified by the caller to add headers to the request.

func (*OperationsGetCall) IfNoneMatch added in v0.166.0

func (c *OperationsGetCall) IfNoneMatch(entityTag string) *OperationsGetCall

IfNoneMatch sets an optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request.

type OperationsService added in v0.166.0

type OperationsService struct {
	// contains filtered or unexported fields
}

func NewOperationsService added in v0.166.0

func NewOperationsService(s *Service) *OperationsService

func (*OperationsService) Get added in v0.166.0

Get: Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.

- name: The name of the operation resource.

type PayloadOptions added in v0.166.0

type PayloadOptions struct {
	// FieldMask: Optional. If `include_resource` is set to `true`, the list of
	// fields to include in the event payload. Separate fields with a comma. For
	// example, to include a Google Chat message's sender and create time, enter
	// `message.sender,message.createTime`. If omitted, the payload includes all
	// fields for the resource. If you specify a field that doesn't exist for the
	// resource, the system ignores the field.
	FieldMask string `json:"fieldMask,omitempty"`
	// IncludeResource: Optional. Whether the event payload includes data about the
	// resource that changed. For example, for an event where a Google Chat message
	// was created, whether the payload contains data about the `Message`
	// (https://developers.google.com/chat/api/reference/rest/v1/spaces.messages)
	// resource. If false, the event payload only includes the name of the changed
	// resource.
	IncludeResource bool `json:"includeResource,omitempty"`
	// ForceSendFields is a list of field names (e.g. "FieldMask") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "FieldMask") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

PayloadOptions: Options about what data to include in the event payload. Only supported for Google Chat events.

func (*PayloadOptions) MarshalJSON added in v0.166.0

func (s *PayloadOptions) MarshalJSON() ([]byte, error)

type ReactivateSubscriptionRequest added in v0.166.0

type ReactivateSubscriptionRequest struct {
}

ReactivateSubscriptionRequest: The request message for SubscriptionsService.ReactivateSubscription.

type Service

type Service struct {
	BasePath  string // API endpoint base URL
	UserAgent string // optional additional User-Agent fragment

	Operations *OperationsService

	Subscriptions *SubscriptionsService
	// contains filtered or unexported fields
}

func New deprecated

func New(client *http.Client) (*Service, error)

New creates a new Service. It uses the provided http.Client for requests.

Deprecated: please use NewService instead. To provide a custom HTTP client, use option.WithHTTPClient. If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.

func NewService

func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error)

NewService creates a new Service.

type Status added in v0.166.0

type Status struct {
	// Code: The status code, which should be an enum value of google.rpc.Code.
	Code int64 `json:"code,omitempty"`
	// Details: A list of messages that carry the error details. There is a common
	// set of message types for APIs to use.
	Details []googleapi.RawMessage `json:"details,omitempty"`
	// Message: A developer-facing error message, which should be in English. Any
	// user-facing error message should be localized and sent in the
	// google.rpc.Status.details field, or localized by the client.
	Message string `json:"message,omitempty"`
	// ForceSendFields is a list of field names (e.g. "Code") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Code") to include in API requests
	// with the JSON null value. By default, fields with empty values are omitted
	// from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

Status: The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by gRPC (https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the API Design Guide (https://cloud.google.com/apis/design/errors).

func (*Status) MarshalJSON added in v0.166.0

func (s *Status) MarshalJSON() ([]byte, error)

type Subscription added in v0.166.0

type Subscription struct {
	// Authority: Output only. The user who authorized the creation of the
	// subscription. Format: `users/{user}` For Google Workspace users, the
	// `{user}` value is the `user.id`
	// (https://developers.google.com/admin-sdk/directory/reference/rest/v1/users#User.FIELDS.ids)
	// field from the Directory API.
	Authority string `json:"authority,omitempty"`
	// CreateTime: Output only. The time when the subscription is created.
	CreateTime string `json:"createTime,omitempty"`
	// Etag: Optional. This checksum is computed by the server based on the value
	// of other fields, and might be sent on update requests to ensure the client
	// has an up-to-date value before proceeding.
	Etag string `json:"etag,omitempty"`
	// EventTypes: Required. Immutable. Unordered list. Input for creating a
	// subscription. Otherwise, output only. One or more types of events to receive
	// about the target resource. Formatted according to the CloudEvents
	// specification. The supported event types depend on the target resource of
	// your subscription. For details, see Supported Google Workspace events
	// (https://developers.google.com/workspace/events/guides#supported-events). By
	// default, you also receive events about the lifecycle of your subscription
	// (https://developers.google.com/workspace/events/guides/events-lifecycle).
	// You don't need to specify lifecycle events for this field. If you specify an
	// event type that doesn't exist for the target resource, the request returns
	// an HTTP `400 Bad Request` status code.
	EventTypes []string `json:"eventTypes,omitempty"`
	// ExpireTime: Non-empty default. The timestamp in UTC when the subscription
	// expires. Always displayed on output, regardless of what was used on input.
	ExpireTime string `json:"expireTime,omitempty"`
	// Name: Optional. Immutable. Identifier. Resource name of the subscription.
	// Format: `subscriptions/{subscription}`
	Name string `json:"name,omitempty"`
	// NotificationEndpoint: Required. Immutable. The endpoint where the
	// subscription delivers events, such as a Pub/Sub topic.
	NotificationEndpoint *NotificationEndpoint `json:"notificationEndpoint,omitempty"`
	// PayloadOptions: Optional. Options about what data to include in the event
	// payload. Only supported for Google Chat events.
	PayloadOptions *PayloadOptions `json:"payloadOptions,omitempty"`
	// Reconciling: Output only. If `true`, the subscription is in the process of
	// being updated.
	Reconciling bool `json:"reconciling,omitempty"`
	// State: Output only. The state of the subscription. Determines whether the
	// subscription can receive events and deliver them to the notification
	// endpoint.
	//
	// Possible values:
	//   "STATE_UNSPECIFIED" - Default value. This value is unused.
	//   "ACTIVE" - The subscription is active and can receive and deliver events
	// to its notification endpoint.
	//   "SUSPENDED" - The subscription is unable to receive events due to an
	// error. To identify the error, see the `suspension_reason` field.
	//   "DELETED" - The subscription is deleted.
	State string `json:"state,omitempty"`
	// SuspensionReason: Output only. The error that suspended the subscription. To
	// reactivate the subscription, resolve the error and call the
	// `ReactivateSubscription` method.
	//
	// Possible values:
	//   "ERROR_TYPE_UNSPECIFIED" - Default value. This value is unused.
	//   "USER_SCOPE_REVOKED" - The authorizing user has revoked the grant of one
	// or more OAuth scopes. To learn more about authorization for Google
	// Workspace, see [Configure the OAuth consent
	// screen](https://developers.google.com/workspace/guides/configure-oauth-consen
	// t#choose-scopes).
	//   "RESOURCE_DELETED" - The target resource for the subscription no longer
	// exists.
	//   "USER_AUTHORIZATION_FAILURE" - The user that authorized the creation of
	// the subscription no longer has access to the subscription's target resource.
	//   "ENDPOINT_PERMISSION_DENIED" - The Google Workspace application doesn't
	// have access to deliver events to your subscription's notification endpoint.
	//   "ENDPOINT_NOT_FOUND" - The subscription's notification endpoint doesn't
	// exist, or the endpoint can't be found in the Google Cloud project where you
	// created the subscription.
	//   "ENDPOINT_RESOURCE_EXHAUSTED" - The subscription's notification endpoint
	// failed to receive events due to insufficient quota or reaching rate
	// limiting.
	//   "OTHER" - An unidentified error has occurred.
	SuspensionReason string `json:"suspensionReason,omitempty"`
	// TargetResource: Required. Immutable. The Google Workspace resource that's
	// monitored for events, formatted as the full resource name
	// (https://google.aip.dev/122#full-resource-names). To learn about target
	// resources and the events that they support, see Supported Google Workspace
	// events (https://developers.google.com/workspace/events#supported-events). A
	// user can only authorize your app to create one subscription for a given
	// target resource. If your app tries to create another subscription with the
	// same user credentials, the request returns an `ALREADY_EXISTS` error.
	TargetResource string `json:"targetResource,omitempty"`
	// Ttl: Input only. The time-to-live (TTL) or duration for the subscription. If
	// unspecified or set to `0`, uses the maximum possible duration.
	Ttl string `json:"ttl,omitempty"`
	// Uid: Output only. System-assigned unique identifier for the subscription.
	Uid string `json:"uid,omitempty"`
	// UpdateTime: Output only. The last time that the subscription is updated.
	UpdateTime string `json:"updateTime,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the server.
	googleapi.ServerResponse `json:"-"`
	// ForceSendFields is a list of field names (e.g. "Authority") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Authority") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

Subscription: Developer Preview (https://developers.google.com/workspace/preview). A subscription to receive events about a Google Workspace resource. To learn more about subscriptions, see the Google Workspace Events API overview (https://developers.google.com/workspace/events).

func (*Subscription) MarshalJSON added in v0.166.0

func (s *Subscription) MarshalJSON() ([]byte, error)

type SubscriptionsCreateCall added in v0.166.0

type SubscriptionsCreateCall struct {
	// contains filtered or unexported fields
}

func (*SubscriptionsCreateCall) Context added in v0.166.0

Context sets the context to be used in this call's Do method.

func (*SubscriptionsCreateCall) Do added in v0.166.0

Do executes the "workspaceevents.subscriptions.create" call. Any non-2xx status code is an error. Response headers are in either *Operation.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*SubscriptionsCreateCall) Fields added in v0.166.0

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.

func (*SubscriptionsCreateCall) Header added in v0.166.0

func (c *SubscriptionsCreateCall) Header() http.Header

Header returns a http.Header that can be modified by the caller to add headers to the request.

func (*SubscriptionsCreateCall) ValidateOnly added in v0.166.0

func (c *SubscriptionsCreateCall) ValidateOnly(validateOnly bool) *SubscriptionsCreateCall

ValidateOnly sets the optional parameter "validateOnly": If set to `true`, validates and previews the request, but doesn't create the subscription.

type SubscriptionsDeleteCall added in v0.166.0

type SubscriptionsDeleteCall struct {
	// contains filtered or unexported fields
}

func (*SubscriptionsDeleteCall) AllowMissing added in v0.166.0

func (c *SubscriptionsDeleteCall) AllowMissing(allowMissing bool) *SubscriptionsDeleteCall

AllowMissing sets the optional parameter "allowMissing": If set to `true` and the subscription isn't found, the request succeeds but doesn't delete the subscription.

func (*SubscriptionsDeleteCall) Context added in v0.166.0

Context sets the context to be used in this call's Do method.

func (*SubscriptionsDeleteCall) Do added in v0.166.0

Do executes the "workspaceevents.subscriptions.delete" call. Any non-2xx status code is an error. Response headers are in either *Operation.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*SubscriptionsDeleteCall) Etag added in v0.166.0

Etag sets the optional parameter "etag": Etag of the subscription. If present, it must match with the server's etag. Otherwise, request fails with the status `ABORTED`.

func (*SubscriptionsDeleteCall) Fields added in v0.166.0

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.

func (*SubscriptionsDeleteCall) Header added in v0.166.0

func (c *SubscriptionsDeleteCall) Header() http.Header

Header returns a http.Header that can be modified by the caller to add headers to the request.

func (*SubscriptionsDeleteCall) ValidateOnly added in v0.166.0

func (c *SubscriptionsDeleteCall) ValidateOnly(validateOnly bool) *SubscriptionsDeleteCall

ValidateOnly sets the optional parameter "validateOnly": If set to `true`, validates and previews the request, but doesn't delete the subscription.

type SubscriptionsGetCall added in v0.166.0

type SubscriptionsGetCall struct {
	// contains filtered or unexported fields
}

func (*SubscriptionsGetCall) Context added in v0.166.0

Context sets the context to be used in this call's Do method.

func (*SubscriptionsGetCall) Do added in v0.166.0

Do executes the "workspaceevents.subscriptions.get" call. Any non-2xx status code is an error. Response headers are in either *Subscription.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*SubscriptionsGetCall) Fields added in v0.166.0

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.

func (*SubscriptionsGetCall) Header added in v0.166.0

func (c *SubscriptionsGetCall) Header() http.Header

Header returns a http.Header that can be modified by the caller to add headers to the request.

func (*SubscriptionsGetCall) IfNoneMatch added in v0.166.0

func (c *SubscriptionsGetCall) IfNoneMatch(entityTag string) *SubscriptionsGetCall

IfNoneMatch sets an optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request.

type SubscriptionsListCall added in v0.166.0

type SubscriptionsListCall struct {
	// contains filtered or unexported fields
}

func (*SubscriptionsListCall) Context added in v0.166.0

Context sets the context to be used in this call's Do method.

func (*SubscriptionsListCall) Do added in v0.166.0

Do executes the "workspaceevents.subscriptions.list" call. Any non-2xx status code is an error. Response headers are in either *ListSubscriptionsResponse.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*SubscriptionsListCall) Fields added in v0.166.0

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.

func (*SubscriptionsListCall) Filter added in v0.166.0

Filter sets the optional parameter "filter": Required. A query filter. You can filter subscriptions by event type (`event_types`) and target resource (`target_resource`). You must specify at least one event type in your query. To filter for multiple event types, use the `OR` operator. To filter by both event type and target resource, use the `AND` operator and specify the full resource name, such as `//chat.googleapis.com/spaces/{space}`. For example, the following queries are valid: ``` event_types:"google.workspace.chat.membership.v1.updated" OR event_types:"google.workspace.chat.message.v1.created" event_types:"google.workspace.chat.message.v1.created" AND target_resource="//chat.googleapis.com/spaces/{space}" ( event_types:"google.workspace.chat.membership.v1.updated" OR event_types:"google.workspace.chat.message.v1.created" ) AND target_resource="//chat.googleapis.com/spaces/{space}" ``` The server rejects invalid queries with an `INVALID_ARGUMENT` error.

func (*SubscriptionsListCall) Header added in v0.166.0

func (c *SubscriptionsListCall) Header() http.Header

Header returns a http.Header that can be modified by the caller to add headers to the request.

func (*SubscriptionsListCall) IfNoneMatch added in v0.166.0

func (c *SubscriptionsListCall) IfNoneMatch(entityTag string) *SubscriptionsListCall

IfNoneMatch sets an optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request.

func (*SubscriptionsListCall) PageSize added in v0.166.0

func (c *SubscriptionsListCall) PageSize(pageSize int64) *SubscriptionsListCall

PageSize sets the optional parameter "pageSize": The maximum number of subscriptions to return. The service might return fewer than this value. If unspecified or set to `0`, up to 50 subscriptions are returned. The maximum value is 100. If you specify a value more than 100, the system only returns 100 subscriptions.

func (*SubscriptionsListCall) PageToken added in v0.166.0

func (c *SubscriptionsListCall) PageToken(pageToken string) *SubscriptionsListCall

PageToken sets the optional parameter "pageToken": A page token, received from a previous list subscriptions call. Provide this parameter to retrieve the subsequent page. When paginating, the filter value should match the call that provided the page token. Passing a different value might lead to unexpected results.

func (*SubscriptionsListCall) Pages added in v0.166.0

Pages invokes f for each page of results. A non-nil error returned from f will halt the iteration. The provided context supersedes any context provided to the Context method.

type SubscriptionsPatchCall added in v0.166.0

type SubscriptionsPatchCall struct {
	// contains filtered or unexported fields
}

func (*SubscriptionsPatchCall) Context added in v0.166.0

Context sets the context to be used in this call's Do method.

func (*SubscriptionsPatchCall) Do added in v0.166.0

Do executes the "workspaceevents.subscriptions.patch" call. Any non-2xx status code is an error. Response headers are in either *Operation.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*SubscriptionsPatchCall) Fields added in v0.166.0

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.

func (*SubscriptionsPatchCall) Header added in v0.166.0

func (c *SubscriptionsPatchCall) Header() http.Header

Header returns a http.Header that can be modified by the caller to add headers to the request.

func (*SubscriptionsPatchCall) UpdateMask added in v0.166.0

func (c *SubscriptionsPatchCall) UpdateMask(updateMask string) *SubscriptionsPatchCall

UpdateMask sets the optional parameter "updateMask": The field to update. If omitted, updates any fields included in the request. You can update one of the following fields in a subscription: * `expire_time`: The timestamp when the subscription expires. * `ttl`: The time-to-live (TTL) or duration of the subscription. To fully replace the subscription (the equivalent of `PUT`), use `*`. Any omitted fields are updated with empty values.

func (*SubscriptionsPatchCall) ValidateOnly added in v0.166.0

func (c *SubscriptionsPatchCall) ValidateOnly(validateOnly bool) *SubscriptionsPatchCall

ValidateOnly sets the optional parameter "validateOnly": If set to `true`, validates and previews the request, but doesn't update the subscription.

type SubscriptionsReactivateCall added in v0.166.0

type SubscriptionsReactivateCall struct {
	// contains filtered or unexported fields
}

func (*SubscriptionsReactivateCall) Context added in v0.166.0

Context sets the context to be used in this call's Do method.

func (*SubscriptionsReactivateCall) Do added in v0.166.0

Do executes the "workspaceevents.subscriptions.reactivate" call. Any non-2xx status code is an error. Response headers are in either *Operation.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*SubscriptionsReactivateCall) Fields added in v0.166.0

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.

func (*SubscriptionsReactivateCall) Header added in v0.166.0

Header returns a http.Header that can be modified by the caller to add headers to the request.

type SubscriptionsService added in v0.166.0

type SubscriptionsService struct {
	// contains filtered or unexported fields
}

func NewSubscriptionsService added in v0.166.0

func NewSubscriptionsService(s *Service) *SubscriptionsService

func (*SubscriptionsService) Create added in v0.166.0

func (r *SubscriptionsService) Create(subscription *Subscription) *SubscriptionsCreateCall

Create: Developer Preview (https://developers.google.com/workspace/preview): Creates a Google Workspace subscription. To learn how to use this method, see Create a Google Workspace subscription (https://developers.google.com/workspace/events/guides/create-subscription).

func (*SubscriptionsService) Delete added in v0.166.0

Delete: Developer Preview (https://developers.google.com/workspace/preview): Deletes a Google Workspace subscription. To learn how to use this method, see Delete a Google Workspace subscription (https://developers.google.com/workspace/events/guides/delete-subscription).

  • name: Resource name of the subscription to delete. Format: `subscriptions/{subscription}`.

func (*SubscriptionsService) Get added in v0.166.0

Get: Developer Preview (https://developers.google.com/workspace/preview): Gets details about a Google Workspace subscription. To learn how to use this method, see Get details about a Google Workspace subscription (https://developers.google.com/workspace/events/guides/get-subscription).

  • name: Resource name of the subscription. Format: `subscriptions/{subscription}`.

func (*SubscriptionsService) List added in v0.166.0

List: Developer Preview (https://developers.google.com/workspace/preview): Lists Google Workspace subscriptions. To learn how to use this method, see List Google Workspace subscriptions (https://developers.google.com/workspace/events/guides/list-subscriptions).

func (*SubscriptionsService) Patch added in v0.166.0

func (r *SubscriptionsService) Patch(name string, subscription *Subscription) *SubscriptionsPatchCall

Patch: Developer Preview (https://developers.google.com/workspace/preview): Updates or renews a Google Workspace subscription. To learn how to use this method, see Update or renew a Google Workspace subscription (https://developers.google.com/workspace/events/guides/update-subscription).

  • name: Optional. Immutable. Identifier. Resource name of the subscription. Format: `subscriptions/{subscription}`.

func (*SubscriptionsService) Reactivate added in v0.166.0

func (r *SubscriptionsService) Reactivate(name string, reactivatesubscriptionrequest *ReactivateSubscriptionRequest) *SubscriptionsReactivateCall

Reactivate: Developer Preview (https://developers.google.com/workspace/preview): Reactivates a suspended Google Workspace subscription. This method resets your subscription's `State` field to `ACTIVE`. Before you use this method, you must fix the error that suspended the subscription. To learn how to use this method, see Reactivate a Google Workspace subscription (https://developers.google.com/workspace/events/guides/reactivate-subscription).

  • name: Resource name of the subscription. Format: `subscriptions/{subscription}`.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL