Reference documentation and code samples for the Google Apps Events Subscriptions V1 Client class Subscription.
A subscription to receive events about a Google Workspace resource. To learn more about subscriptions, see the Google Workspace Events API overview .
Generated from protobuf message google.apps.events.subscriptions.v1.Subscription
Namespace
Google \ Apps \ Events \ Subscriptions \ V1Methods
__construct
Constructor.
data
array
Optional. Data for populating the Message object.
↳ expire_time
Google\Protobuf\Timestamp
Non-empty default. The timestamp in UTC when the subscription expires. Always displayed on output, regardless of what was used on input.
↳ ttl
Google\Protobuf\Duration
Input only. The time-to-live (TTL) or duration for the subscription. If unspecified or set to 0
, uses the maximum possible duration.
↳ name
string
Optional. Immutable. Identifier. Resource name of the subscription. Format: subscriptions/{subscription}
↳ uid
string
Output only. System-assigned unique identifier for the subscription.
↳ target_resource
string
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.
↳ event_types
array
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.
↳ payload_options
PayloadOptions
Optional. Options about what data to include in the event payload. Only supported for Google Chat events.
↳ notification_endpoint
NotificationEndpoint
Required. Immutable. The endpoint where the subscription delivers events, such as a Pub/Sub topic.
↳ state
int
Output only. The state of the subscription. Determines whether the subscription can receive events and deliver them to the notification endpoint.
↳ suspension_reason
int
Output only. The error that suspended the subscription. To reactivate the subscription, resolve the error and call the ReactivateSubscription
method.
↳ authority
string
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.
↳ create_time
↳ update_time
↳ reconciling
bool
Output only. If true
, the subscription is in the process of being updated.
↳ etag
string
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.
getExpireTime
Non-empty default. The timestamp in UTC when the subscription expires.
Always displayed on output, regardless of what was used on input.
hasExpireTime
setExpireTime
Non-empty default. The timestamp in UTC when the subscription expires.
Always displayed on output, regardless of what was used on input.
$this
getTtl
Input only. The time-to-live (TTL) or duration for the subscription. If
unspecified or set to 0
, uses the maximum possible duration.
hasTtl
setTtl
Input only. The time-to-live (TTL) or duration for the subscription. If
unspecified or set to 0
, uses the maximum possible duration.
$this
getName
Optional. Immutable. Identifier. Resource name of the subscription.
Format: subscriptions/{subscription}
string
setName
Optional. Immutable. Identifier. Resource name of the subscription.
Format: subscriptions/{subscription}
var
string
$this
getUid
Output only. System-assigned unique identifier for the subscription.
string
setUid
Output only. System-assigned unique identifier for the subscription.
var
string
$this
getTargetResource
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.
string
setTargetResource
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.
var
string
$this
getEventTypes
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.
setEventTypes
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.
var
string[]
$this
getPayloadOptions
Optional. Options about what data to include in the event payload. Only supported for Google Chat events.
hasPayloadOptions
clearPayloadOptions
setPayloadOptions
Optional. Options about what data to include in the event payload. Only supported for Google Chat events.
$this
getNotificationEndpoint
Required. Immutable. The endpoint where the subscription delivers events, such as a Pub/Sub topic.
hasNotificationEndpoint
clearNotificationEndpoint
setNotificationEndpoint
Required. Immutable. The endpoint where the subscription delivers events, such as a Pub/Sub topic.
$this
getState
Output only. The state of the subscription. Determines whether the subscription can receive events and deliver them to the notification endpoint.
int
setState
Output only. The state of the subscription. Determines whether the subscription can receive events and deliver them to the notification endpoint.
var
int
$this
getSuspensionReason
Output only. The error that suspended the subscription.
To reactivate the subscription, resolve the error and call the ReactivateSubscription
method.
int
setSuspensionReason
Output only. The error that suspended the subscription.
To reactivate the subscription, resolve the error and call the ReactivateSubscription
method.
var
int
$this
getAuthority
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.
string
setAuthority
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.
var
string
$this
getCreateTime
Output only. The time when the subscription is created.
hasCreateTime
clearCreateTime
setCreateTime
Output only. The time when the subscription is created.
$this
getUpdateTime
Output only. The last time that the subscription is updated.
hasUpdateTime
clearUpdateTime
setUpdateTime
Output only. The last time that the subscription is updated.
$this
getReconciling
Output only. If true
, the subscription is in the process of being
updated.
bool
setReconciling
Output only. If true
, the subscription is in the process of being
updated.
var
bool
$this
getEtag
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.
string
setEtag
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.
var
string
$this
getExpiration
string