Types for Google Apps Events Subscriptions v1 API¶
- class google.apps.events_subscriptions_v1.types.CreateSubscriptionMetadata(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.MessageMetadata for CreateSubscription LRO.
- class google.apps.events_subscriptions_v1.types.CreateSubscriptionRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.MessageThe request message for [SubscriptionsService.CreateSubscription][google.apps.events.subscriptions.v1.SubscriptionsService.CreateSubscription].
- subscription¶
Required. The subscription resource to create.
- class google.apps.events_subscriptions_v1.types.DeleteSubscriptionMetadata(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.MessageMetadata for DeleteSubscription LRO.
- class google.apps.events_subscriptions_v1.types.DeleteSubscriptionRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.MessageThe request message for [SubscriptionsService.DeleteSubscription][google.apps.events.subscriptions.v1.SubscriptionsService.DeleteSubscription].
- name¶
Required. Resource name of the subscription to delete.
Format:
subscriptions/{subscription}- Type
- validate_only¶
Optional. If set to
true, validates and previews the request, but doesn’t delete the subscription.- Type
- allow_missing¶
Optional. If set to
trueand the subscription isn’t found, the request succeeds but doesn’t delete the subscription.- Type
- class google.apps.events_subscriptions_v1.types.GetSubscriptionRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.MessageThe request message for [SubscriptionsService.GetSubscription][google.apps.events.subscriptions.v1.SubscriptionsService.GetSubscription].
- class google.apps.events_subscriptions_v1.types.ListSubscriptionsRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.MessageThe request message for [SubscriptionsService.ListSubscriptions][google.apps.events.subscriptions.v1.SubscriptionsService.ListSubscriptions].
- page_size¶
Optional. 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.
- Type
- page_token¶
Optional. 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.
- Type
- 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
ORoperator.To filter by both event type and target resource, use the
ANDoperator 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_ARGUMENTerror.- Type
- class google.apps.events_subscriptions_v1.types.ListSubscriptionsResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.MessageThe response message for [SubscriptionsService.ListSubscriptions][google.apps.events.subscriptions.v1.SubscriptionsService.ListSubscriptions].
- subscriptions¶
List of subscriptions.
- Type
MutableSequence[google.apps.events_subscriptions_v1.types.Subscription]
- class google.apps.events_subscriptions_v1.types.NotificationEndpoint(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.MessageThe endpoint where the subscription delivers events.
- pubsub_topic¶
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.
This field is a member of oneof
endpoint.- Type
- class google.apps.events_subscriptions_v1.types.PayloadOptions(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.MessageOptions about what data to include in the event payload. Only supported for Google Chat events.
- include_resource¶
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.- Type
- field_mask¶
Optional. If
include_resourceis set totrue, 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, entermessage.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.
- class google.apps.events_subscriptions_v1.types.ReactivateSubscriptionMetadata(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.MessageMetadata for ReactivateSubscription LRO.
- class google.apps.events_subscriptions_v1.types.ReactivateSubscriptionRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.MessageThe request message for [SubscriptionsService.ReactivateSubscription][google.apps.events.subscriptions.v1.SubscriptionsService.ReactivateSubscription].
- class google.apps.events_subscriptions_v1.types.Subscription(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.MessageA subscription to receive events about a Google Workspace resource. To learn more about subscriptions, see the Google Workspace Events API overview.
This message has oneof fields (mutually exclusive fields). For each oneof, at most one member field can be set at the same time. Setting any member of the oneof automatically clears all other members.
- expire_time¶
Non-empty default. The timestamp in UTC when the subscription expires. Always displayed on output, regardless of what was used on input.
This field is a member of oneof
expiration.
- ttl¶
Input only. The time-to-live (TTL) or duration for the subscription. If unspecified or set to
0, uses the maximum possible duration.This field is a member of oneof
expiration.
- name¶
Optional. Immutable. Identifier. Resource name of the subscription.
Format:
subscriptions/{subscription}- Type
- target_resource¶
Required. Immutable. The Google Workspace resource that’s monitored for events, formatted as the full resource name. To learn about target resources and the events that they support, see Supported Google Workspace 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_EXISTSerror.- Type
- event_types¶
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.
By default, you also receive events about the lifecycle of your subscription. 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 Requeststatus code.- Type
MutableSequence[str]
- payload_options¶
Optional. Options about what data to include in the event payload. Only supported for Google Chat events.
- notification_endpoint¶
Required. Immutable. The endpoint where the subscription delivers events, such as a Pub/Sub topic.
- state¶
Output only. The state of the subscription. Determines whether the subscription can receive events and deliver them to the notification endpoint.
- suspension_reason¶
Output only. The error that suspended the subscription.
To reactivate the subscription, resolve the error and call the [
ReactivateSubscription][google.apps.events.subscriptions.v1.SubscriptionsService.ReactivateSubscription] method.
- 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.- Type
- create_time¶
Output only. The time when the subscription is created.
- update_time¶
Output only. The last time that the subscription is updated.
- 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.
- Type
- class ErrorType(value)[source]¶
Bases:
proto.enums.EnumPossible errors for a subscription.
- Values:
- ERROR_TYPE_UNSPECIFIED (0):
Default value. This value is unused.
- USER_SCOPE_REVOKED (1):
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.
- RESOURCE_DELETED (2):
The target resource for the subscription no longer exists.
- USER_AUTHORIZATION_FAILURE (3):
The user that authorized the creation of the subscription no longer has access to the subscription’s target resource.
- ENDPOINT_PERMISSION_DENIED (4):
The Google Workspace application doesn’t have access to deliver events to your subscription’s notification endpoint.
- ENDPOINT_NOT_FOUND (6):
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 (7):
The subscription’s notification endpoint failed to receive events due to insufficient quota or reaching rate limiting.
- OTHER (5):
An unidentified error has occurred.
- class State(value)[source]¶
Bases:
proto.enums.EnumPossible states for the subscription.
- Values:
- STATE_UNSPECIFIED (0):
Default value. This value is unused.
- ACTIVE (1):
The subscription is active and can receive and deliver events to its notification endpoint.
- SUSPENDED (2):
The subscription is unable to receive events due to an error. To identify the error, see the [
suspension_reason][google.apps.events.subscriptions.v1.Subscription.suspension_reason] field.- DELETED (3):
The subscription is deleted.
- class google.apps.events_subscriptions_v1.types.UpdateSubscriptionMetadata(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.MessageMetadata for UpdateSubscription LRO.
- class google.apps.events_subscriptions_v1.types.UpdateSubscriptionRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.MessageThe request message for [SubscriptionsService.UpdateSubscription][google.apps.events.subscriptions.v1.SubscriptionsService.UpdateSubscription].
- subscription¶
Required. The subscription to update.
The subscription’s
namefield is used to identify the subscription to update.
- update_mask¶
Optional. Required. The field to update.
You can update one of the following fields in a subscription:
[
expire_time][google.apps.events.subscriptions.v1.Subscription.expire_time]: The timestamp when the subscription expires.[
ttl][google.apps.events.subscriptions.v1.Subscription.ttl]: The time-to-live (TTL) or duration of the subscription.