Google Apps Events Subscriptions V1 Client - Class Subscription (0.1.2)

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 \ V1

Methods

__construct

Constructor.

Parameters
Name Description
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 Google\Apps\Events\Subscriptions\V1\PayloadOptions

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

↳ notification_endpoint Google\Apps\Events\Subscriptions\V1\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 Google\Protobuf\Timestamp

Output only. The time when the subscription is created.

↳ update_time Google\Protobuf\Timestamp

Output only. The last time that the subscription is updated.

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

Returns
Type Description
Google\Protobuf\Timestamp|null

hasExpireTime

setExpireTime

Non-empty default. The timestamp in UTC when the subscription expires.

Always displayed on output, regardless of what was used on input.

Parameter
Name Description
var Google\Protobuf\Timestamp
Returns
Type Description
$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.

Returns
Type Description
Google\Protobuf\Duration|null

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.

Parameter
Name Description
var Google\Protobuf\Duration
Returns
Type Description
$this

getName

Optional. Immutable. Identifier. Resource name of the subscription.

Format: subscriptions/{subscription}

Returns
Type Description
string

setName

Optional. Immutable. Identifier. Resource name of the subscription.

Format: subscriptions/{subscription}

Parameter
Name Description
var string
Returns
Type Description
$this

getUid

Output only. System-assigned unique identifier for the subscription.

Returns
Type Description
string

setUid

Output only. System-assigned unique identifier for the subscription.

Parameter
Name Description
var string
Returns
Type Description
$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.

Returns
Type Description
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.

Parameter
Name Description
var string
Returns
Type Description
$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.

Returns
Type Description
Google\Protobuf\Internal\RepeatedField

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.

Parameter
Name Description
var string[]
Returns
Type Description
$this

getPayloadOptions

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

Returns
Type Description
Google\Apps\Events\Subscriptions\V1\PayloadOptions|null

hasPayloadOptions

clearPayloadOptions

setPayloadOptions

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

Parameter
Name Description
var Google\Apps\Events\Subscriptions\V1\PayloadOptions
Returns
Type Description
$this

getNotificationEndpoint

Required. Immutable. The endpoint where the subscription delivers events, such as a Pub/Sub topic.

Returns
Type Description
Google\Apps\Events\Subscriptions\V1\NotificationEndpoint|null

hasNotificationEndpoint

clearNotificationEndpoint

setNotificationEndpoint

Required. Immutable. The endpoint where the subscription delivers events, such as a Pub/Sub topic.

Parameter
Name Description
var Google\Apps\Events\Subscriptions\V1\NotificationEndpoint
Returns
Type Description
$this

getState

Output only. The state of the subscription. Determines whether the subscription can receive events and deliver them to the notification endpoint.

Returns
Type Description
int

setState

Output only. The state of the subscription. Determines whether the subscription can receive events and deliver them to the notification endpoint.

Parameter
Name Description
var int
Returns
Type Description
$this

getSuspensionReason

Output only. The error that suspended the subscription.

To reactivate the subscription, resolve the error and call the ReactivateSubscription method.

Returns
Type Description
int

setSuspensionReason

Output only. The error that suspended the subscription.

To reactivate the subscription, resolve the error and call the ReactivateSubscription method.

Parameter
Name Description
var int
Returns
Type Description
$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.

Returns
Type Description
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.

Parameter
Name Description
var string
Returns
Type Description
$this

getCreateTime

Output only. The time when the subscription is created.

Returns
Type Description
Google\Protobuf\Timestamp|null

hasCreateTime

clearCreateTime

setCreateTime

Output only. The time when the subscription is created.

Parameter
Name Description
var Google\Protobuf\Timestamp
Returns
Type Description
$this

getUpdateTime

Output only. The last time that the subscription is updated.

Returns
Type Description
Google\Protobuf\Timestamp|null

hasUpdateTime

clearUpdateTime

setUpdateTime

Output only. The last time that the subscription is updated.

Parameter
Name Description
var Google\Protobuf\Timestamp
Returns
Type Description
$this

getReconciling

Output only. If true, the subscription is in the process of being updated.

Returns
Type Description
bool

setReconciling

Output only. If true, the subscription is in the process of being updated.

Parameter
Name Description
var bool
Returns
Type Description
$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.

Returns
Type Description
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.

Parameter
Name Description
var string
Returns
Type Description
$this

getExpiration

Returns
Type Description
string