Class: Google::Apis::WorkspaceeventsV1::Subscription

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/workspaceevents_v1/classes.rb,
lib/google/apis/workspaceevents_v1/representations.rb,
lib/google/apis/workspaceevents_v1/representations.rb

Overview

Developer Preview. A subscription to receive events about a Google Workspace resource. To learn more about subscriptions, see the Google Workspace Events API overview.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Subscription

Returns a new instance of Subscription.



335
336
337
# File 'lib/google/apis/workspaceevents_v1/classes.rb', line 335

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#authorityString

Output only. The user who authorized the creation of the subscription. Format: users/userFor Google Workspace users, theuser`value is the [user.id ](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users# User.FIELDS.ids) field from the Directory API. Corresponds to the JSON propertyauthority`

Returns:

  • (String)


238
239
240
# File 'lib/google/apis/workspaceevents_v1/classes.rb', line 238

def authority
  @authority
end

#create_timeString

Output only. The time when the subscription is created. Corresponds to the JSON property createTime

Returns:

  • (String)


243
244
245
# File 'lib/google/apis/workspaceevents_v1/classes.rb', line 243

def create_time
  @create_time
end

#etagString

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. Corresponds to the JSON property etag

Returns:

  • (String)


250
251
252
# File 'lib/google/apis/workspaceevents_v1/classes.rb', line 250

def etag
  @etag
end

#event_typesArray<String>

Required. 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. Corresponds to the JSON property eventTypes

Returns:

  • (Array<String>)


264
265
266
# File 'lib/google/apis/workspaceevents_v1/classes.rb', line 264

def event_types
  @event_types
end

#expire_timeString

Non-empty default. The timestamp in UTC when the subscription expires. Always displayed on output, regardless of what was used on input. Corresponds to the JSON property expireTime

Returns:

  • (String)


270
271
272
# File 'lib/google/apis/workspaceevents_v1/classes.rb', line 270

def expire_time
  @expire_time
end

#nameString

Identifier. Resource name of the subscription. Format: subscriptions/ subscription` Corresponds to the JSON propertyname`

Returns:

  • (String)


276
277
278
# File 'lib/google/apis/workspaceevents_v1/classes.rb', line 276

def name
  @name
end

#notification_endpointGoogle::Apis::WorkspaceeventsV1::NotificationEndpoint

The endpoint where the subscription delivers events. Corresponds to the JSON property notificationEndpoint



281
282
283
# File 'lib/google/apis/workspaceevents_v1/classes.rb', line 281

def notification_endpoint
  @notification_endpoint
end

#payload_optionsGoogle::Apis::WorkspaceeventsV1::PayloadOptions

Options about what data to include in the event payload. Only supported for Google Chat events. Corresponds to the JSON property payloadOptions



287
288
289
# File 'lib/google/apis/workspaceevents_v1/classes.rb', line 287

def payload_options
  @payload_options
end

#reconcilingBoolean Also known as: reconciling?

Output only. If true, the subscription is in the process of being updated. Corresponds to the JSON property reconciling

Returns:

  • (Boolean)


292
293
294
# File 'lib/google/apis/workspaceevents_v1/classes.rb', line 292

def reconciling
  @reconciling
end

#stateString

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

Returns:

  • (String)


299
300
301
# File 'lib/google/apis/workspaceevents_v1/classes.rb', line 299

def state
  @state
end

#suspension_reasonString

Output only. The error that suspended the subscription. To reactivate the subscription, resolve the error and call the ReactivateSubscription method. Corresponds to the JSON property suspensionReason

Returns:

  • (String)


305
306
307
# File 'lib/google/apis/workspaceevents_v1/classes.rb', line 305

def suspension_reason
  @suspension_reason
end

#target_resourceString

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. Corresponds to the JSON property targetResource

Returns:

  • (String)


317
318
319
# File 'lib/google/apis/workspaceevents_v1/classes.rb', line 317

def target_resource
  @target_resource
end

#ttlString

Input only. The time-to-live (TTL) or duration for the subscription. If unspecified or set to 0, uses the maximum possible duration. Corresponds to the JSON property ttl

Returns:

  • (String)


323
324
325
# File 'lib/google/apis/workspaceevents_v1/classes.rb', line 323

def ttl
  @ttl
end

#uidString

Output only. System-assigned unique identifier for the subscription. Corresponds to the JSON property uid

Returns:

  • (String)


328
329
330
# File 'lib/google/apis/workspaceevents_v1/classes.rb', line 328

def uid
  @uid
end

#update_timeString

Output only. The last time that the subscription is updated. Corresponds to the JSON property updateTime

Returns:

  • (String)


333
334
335
# File 'lib/google/apis/workspaceevents_v1/classes.rb', line 333

def update_time
  @update_time
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
# File 'lib/google/apis/workspaceevents_v1/classes.rb', line 340

def update!(**args)
  @authority = args[:authority] if args.key?(:authority)
  @create_time = args[:create_time] if args.key?(:create_time)
  @etag = args[:etag] if args.key?(:etag)
  @event_types = args[:event_types] if args.key?(:event_types)
  @expire_time = args[:expire_time] if args.key?(:expire_time)
  @name = args[:name] if args.key?(:name)
  @notification_endpoint = args[:notification_endpoint] if args.key?(:notification_endpoint)
  @payload_options = args[:payload_options] if args.key?(:payload_options)
  @reconciling = args[:reconciling] if args.key?(:reconciling)
  @state = args[:state] if args.key?(:state)
  @suspension_reason = args[:suspension_reason] if args.key?(:suspension_reason)
  @target_resource = args[:target_resource] if args.key?(:target_resource)
  @ttl = args[:ttl] if args.key?(:ttl)
  @uid = args[:uid] if args.key?(:uid)
  @update_time = args[:update_time] if args.key?(:update_time)
end