...

Package workspaceevents

import "google.golang.org/api/workspaceevents/v1"
Overview
Index

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
type ListSubscriptionsResponse
    func (s *ListSubscriptionsResponse) MarshalJSON() ([]byte, error)
type NotificationEndpoint
    func (s *NotificationEndpoint) MarshalJSON() ([]byte, error)
type Operation
    func (s *Operation) MarshalJSON() ([]byte, error)
type OperationsGetCall
    func (c *OperationsGetCall) Context(ctx context.Context) *OperationsGetCall
    func (c *OperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error)
    func (c *OperationsGetCall) Fields(s ...googleapi.Field) *OperationsGetCall
    func (c *OperationsGetCall) Header() http.Header
    func (c *OperationsGetCall) IfNoneMatch(entityTag string) *OperationsGetCall
type OperationsService
    func NewOperationsService(s *Service) *OperationsService
    func (r *OperationsService) Get(name string) *OperationsGetCall
type PayloadOptions
    func (s *PayloadOptions) MarshalJSON() ([]byte, error)
type ReactivateSubscriptionRequest
type Service
    func New(client *http.Client) (*Service, error)
    func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error)
type Status
    func (s *Status) MarshalJSON() ([]byte, error)
type Subscription
    func (s *Subscription) MarshalJSON() ([]byte, error)
type SubscriptionsCreateCall
    func (c *SubscriptionsCreateCall) Context(ctx context.Context) *SubscriptionsCreateCall
    func (c *SubscriptionsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error)
    func (c *SubscriptionsCreateCall) Fields(s ...googleapi.Field) *SubscriptionsCreateCall
    func (c *SubscriptionsCreateCall) Header() http.Header
    func (c *SubscriptionsCreateCall) ValidateOnly(validateOnly bool) *SubscriptionsCreateCall
type SubscriptionsDeleteCall
    func (c *SubscriptionsDeleteCall) AllowMissing(allowMissing bool) *SubscriptionsDeleteCall
    func (c *SubscriptionsDeleteCall) Context(ctx context.Context) *SubscriptionsDeleteCall
    func (c *SubscriptionsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error)
    func (c *SubscriptionsDeleteCall) Etag(etag string) *SubscriptionsDeleteCall
    func (c *SubscriptionsDeleteCall) Fields(s ...googleapi.Field) *SubscriptionsDeleteCall
    func (c *SubscriptionsDeleteCall) Header() http.Header
    func (c *SubscriptionsDeleteCall) ValidateOnly(validateOnly bool) *SubscriptionsDeleteCall
type SubscriptionsGetCall
    func (c *SubscriptionsGetCall) Context(ctx context.Context) *SubscriptionsGetCall
    func (c *SubscriptionsGetCall) Do(opts ...googleapi.CallOption) (*Subscription, error)
    func (c *SubscriptionsGetCall) Fields(s ...googleapi.Field) *SubscriptionsGetCall
    func (c *SubscriptionsGetCall) Header() http.Header
    func (c *SubscriptionsGetCall) IfNoneMatch(entityTag string) *SubscriptionsGetCall
type SubscriptionsListCall
    func (c *SubscriptionsListCall) Context(ctx context.Context) *SubscriptionsListCall
    func (c *SubscriptionsListCall) Do(opts ...googleapi.CallOption) (*ListSubscriptionsResponse, error)
    func (c *SubscriptionsListCall) Fields(s ...googleapi.Field) *SubscriptionsListCall
    func (c *SubscriptionsListCall) Filter(filter string) *SubscriptionsListCall
    func (c *SubscriptionsListCall) Header() http.Header
    func (c *SubscriptionsListCall) IfNoneMatch(entityTag string) *SubscriptionsListCall
    func (c *SubscriptionsListCall) PageSize(pageSize int64) *SubscriptionsListCall
    func (c *SubscriptionsListCall) PageToken(pageToken string) *SubscriptionsListCall
    func (c *SubscriptionsListCall) Pages(ctx context.Context, f func(*ListSubscriptionsResponse) error) error
type SubscriptionsPatchCall
    func (c *SubscriptionsPatchCall) Context(ctx context.Context) *SubscriptionsPatchCall
    func (c *SubscriptionsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error)
    func (c *SubscriptionsPatchCall) Fields(s ...googleapi.Field) *SubscriptionsPatchCall
    func (c *SubscriptionsPatchCall) Header() http.Header
    func (c *SubscriptionsPatchCall) UpdateMask(updateMask string) *SubscriptionsPatchCall
    func (c *SubscriptionsPatchCall) ValidateOnly(validateOnly bool) *SubscriptionsPatchCall
type SubscriptionsReactivateCall
    func (c *SubscriptionsReactivateCall) Context(ctx context.Context) *SubscriptionsReactivateCall
    func (c *SubscriptionsReactivateCall) Do(opts ...googleapi.CallOption) (*Operation, error)
    func (c *SubscriptionsReactivateCall) Fields(s ...googleapi.Field) *SubscriptionsReactivateCall
    func (c *SubscriptionsReactivateCall) Header() http.Header
type SubscriptionsService
    func NewSubscriptionsService(s *Service) *SubscriptionsService
    func (r *SubscriptionsService) Create(subscription *Subscription) *SubscriptionsCreateCall
    func (r *SubscriptionsService) Delete(name string) *SubscriptionsDeleteCall
    func (r *SubscriptionsService) Get(name string) *SubscriptionsGetCall
    func (r *SubscriptionsService) List() *SubscriptionsListCall
    func (r *SubscriptionsService) Patch(name string, subscription *Subscription) *SubscriptionsPatchCall
    func (r *SubscriptionsService) Reactivate(name string, reactivatesubscriptionrequest *ReactivateSubscriptionRequest) *SubscriptionsReactivateCall

Package files

workspaceevents-gen.go

Constants

OAuth2 scopes used by this API.

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"
)

type ListSubscriptionsResponse

ListSubscriptionsResponse: The response message for SubscriptionsService.ListSubscriptions.

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:"-"`
}

func (*ListSubscriptionsResponse) MarshalJSON

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

type NotificationEndpoint

NotificationEndpoint: The endpoint where the subscription delivers events.

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:"-"`
}

func (*NotificationEndpoint) MarshalJSON

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

type Operation

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

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:"-"`
}

func (*Operation) MarshalJSON

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

type OperationsGetCall

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

func (*OperationsGetCall) Context

func (c *OperationsGetCall) Context(ctx context.Context) *OperationsGetCall

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

func (*OperationsGetCall) Do

func (c *OperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error)

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

func (c *OperationsGetCall) Fields(s ...googleapi.Field) *OperationsGetCall

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

func (*OperationsGetCall) Header

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

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

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

func NewOperationsService

func NewOperationsService(s *Service) *OperationsService

func (*OperationsService) Get

func (r *OperationsService) Get(name string) *OperationsGetCall

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

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

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:"-"`
}

func (*PayloadOptions) MarshalJSON

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

type ReactivateSubscriptionRequest

ReactivateSubscriptionRequest: The request message for SubscriptionsService.ReactivateSubscription.

type ReactivateSubscriptionRequest struct {
}

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

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

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).

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:"-"`
}

func (*Status) MarshalJSON

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

type Subscription

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).

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:"-"`
}

func (*Subscription) MarshalJSON

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

type SubscriptionsCreateCall

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

func (*SubscriptionsCreateCall) Context

func (c *SubscriptionsCreateCall) Context(ctx context.Context) *SubscriptionsCreateCall

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

func (*SubscriptionsCreateCall) Do

func (c *SubscriptionsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error)

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

func (c *SubscriptionsCreateCall) Fields(s ...googleapi.Field) *SubscriptionsCreateCall

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

func (*SubscriptionsCreateCall) Header

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

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

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

func (*SubscriptionsDeleteCall) AllowMissing

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

func (c *SubscriptionsDeleteCall) Context(ctx context.Context) *SubscriptionsDeleteCall

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

func (*SubscriptionsDeleteCall) Do

func (c *SubscriptionsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error)

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

func (c *SubscriptionsDeleteCall) Etag(etag string) *SubscriptionsDeleteCall

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

func (c *SubscriptionsDeleteCall) Fields(s ...googleapi.Field) *SubscriptionsDeleteCall

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

func (*SubscriptionsDeleteCall) Header

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

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

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

func (*SubscriptionsGetCall) Context

func (c *SubscriptionsGetCall) Context(ctx context.Context) *SubscriptionsGetCall

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

func (*SubscriptionsGetCall) Do

func (c *SubscriptionsGetCall) Do(opts ...googleapi.CallOption) (*Subscription, error)

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

func (c *SubscriptionsGetCall) Fields(s ...googleapi.Field) *SubscriptionsGetCall

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

func (*SubscriptionsGetCall) Header

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

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

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

func (*SubscriptionsListCall) Context

func (c *SubscriptionsListCall) Context(ctx context.Context) *SubscriptionsListCall

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

func (*SubscriptionsListCall) Do

func (c *SubscriptionsListCall) Do(opts ...googleapi.CallOption) (*ListSubscriptionsResponse, error)

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

func (c *SubscriptionsListCall) Fields(s ...googleapi.Field) *SubscriptionsListCall

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

func (*SubscriptionsListCall) Filter

func (c *SubscriptionsListCall) Filter(filter string) *SubscriptionsListCall

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

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

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

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

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

func (c *SubscriptionsListCall) Pages(ctx context.Context, f func(*ListSubscriptionsResponse) error) error

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

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

func (*SubscriptionsPatchCall) Context

func (c *SubscriptionsPatchCall) Context(ctx context.Context) *SubscriptionsPatchCall

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

func (*SubscriptionsPatchCall) Do

func (c *SubscriptionsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error)

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

func (c *SubscriptionsPatchCall) Fields(s ...googleapi.Field) *SubscriptionsPatchCall

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

func (*SubscriptionsPatchCall) Header

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

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

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

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

func (*SubscriptionsReactivateCall) Context

func (c *SubscriptionsReactivateCall) Context(ctx context.Context) *SubscriptionsReactivateCall

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

func (*SubscriptionsReactivateCall) Do

func (c *SubscriptionsReactivateCall) Do(opts ...googleapi.CallOption) (*Operation, error)

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

func (c *SubscriptionsReactivateCall) Fields(s ...googleapi.Field) *SubscriptionsReactivateCall

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

func (*SubscriptionsReactivateCall) Header

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

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

type SubscriptionsService

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

func NewSubscriptionsService

func NewSubscriptionsService(s *Service) *SubscriptionsService

func (*SubscriptionsService) Create

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

func (r *SubscriptionsService) Delete(name string) *SubscriptionsDeleteCall

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).

func (*SubscriptionsService) Get

func (r *SubscriptionsService) Get(name string) *SubscriptionsGetCall

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).

func (*SubscriptionsService) List

func (r *SubscriptionsService) List() *SubscriptionsListCall

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

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).

func (*SubscriptionsService) Reactivate

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).