Class Subscription
A subscription to receive events about a Google Workspace resource. To learn more about subscriptions, see the Google Workspace Events API overview.
Implements
Namespace: Google.Apps.Events.Subscriptions.V1
Assembly: Google.Apps.Events.Subscriptions.V1.dll
Syntax
public sealed class Subscription : IMessage<Subscription>, IEquatable<Subscription>, IDeepCloneable<Subscription>, IBufferMessage, IMessage
Constructors
Subscription()
Declaration
public Subscription()
Subscription(Subscription)
Declaration
public Subscription(Subscription other)
Parameters
Type | Name | Description |
---|---|---|
Subscription | other |
Properties
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
field from the Directory API.
Declaration
public string Authority { get; set; }
Property Value
Type | Description |
---|---|
string |
AuthorityAsUserName
Declaration
public UserName AuthorityAsUserName { get; set; }
Property Value
Type | Description |
---|---|
UserName |
CreateTime
Output only. The time when the subscription is created.
Declaration
public Timestamp CreateTime { get; set; }
Property Value
Type | Description |
---|---|
Timestamp |
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.
Declaration
public string Etag { get; set; }
Property Value
Type | Description |
---|---|
string |
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.
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 Request
status code.
Declaration
public RepeatedField<string> EventTypes { get; }
Property Value
Type | Description |
---|---|
RepeatedField<string> |
ExpirationCase
Declaration
public Subscription.ExpirationOneofCase ExpirationCase { get; }
Property Value
Type | Description |
---|---|
Subscription.ExpirationOneofCase |
ExpireTime
Non-empty default. The timestamp in UTC when the subscription expires. Always displayed on output, regardless of what was used on input.
Declaration
public Timestamp ExpireTime { get; set; }
Property Value
Type | Description |
---|---|
Timestamp |
Name
Optional. Immutable. Identifier. Resource name of the subscription.
Format: subscriptions/{subscription}
Declaration
public string Name { get; set; }
Property Value
Type | Description |
---|---|
string |
NotificationEndpoint
Required. Immutable. The endpoint where the subscription delivers events, such as a Pub/Sub topic.
Declaration
public NotificationEndpoint NotificationEndpoint { get; set; }
Property Value
Type | Description |
---|---|
NotificationEndpoint |
PayloadOptions
Optional. Options about what data to include in the event payload. Only supported for Google Chat events.
Declaration
public PayloadOptions PayloadOptions { get; set; }
Property Value
Type | Description |
---|---|
PayloadOptions |
Reconciling
Output only. If true
, the subscription is in the process of being
updated.
Declaration
public bool Reconciling { get; set; }
Property Value
Type | Description |
---|---|
bool |
State
Output only. The state of the subscription. Determines whether the subscription can receive events and deliver them to the notification endpoint.
Declaration
public Subscription.Types.State State { get; set; }
Property Value
Type | Description |
---|---|
Subscription.Types.State |
SubscriptionName
SubscriptionName-typed view over the Name resource name property.
Declaration
public SubscriptionName SubscriptionName { get; set; }
Property Value
Type | Description |
---|---|
SubscriptionName |
SuspensionReason
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.
Declaration
public Subscription.Types.ErrorType SuspensionReason { get; set; }
Property Value
Type | Description |
---|---|
Subscription.Types.ErrorType |
TargetResource
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_EXISTS
error.
Declaration
public string TargetResource { get; set; }
Property Value
Type | Description |
---|---|
string |
TargetResourceAsResourceName
IResourceName-typed view over the TargetResource resource name property.
Declaration
public IResourceName TargetResourceAsResourceName { get; set; }
Property Value
Type | Description |
---|---|
IResourceName |
Ttl
Input only. The time-to-live (TTL) or duration for the subscription. If
unspecified or set to 0
, uses the maximum possible duration.
Declaration
public Duration Ttl { get; set; }
Property Value
Type | Description |
---|---|
Duration |
Uid
Output only. System-assigned unique identifier for the subscription.
Declaration
public string Uid { get; set; }
Property Value
Type | Description |
---|---|
string |
UpdateTime
Output only. The last time that the subscription is updated.
Declaration
public Timestamp UpdateTime { get; set; }
Property Value
Type | Description |
---|---|
Timestamp |