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

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.



870
871
872
# File 'lib/google/apis/workspaceevents_v1/classes.rb', line 870

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

Instance Attribute Details

#authorityString

Output only. The user who authorized the creation of the subscription. When a user authorizes the subscription, this field and the user_authority field have the same value and the format is: 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. When a Chat app authorizes the subscription, only service_account_authorityfield populates and this field is empty. Corresponds to the JSON propertyauthority`

Returns:

  • (String)


751
752
753
# File 'lib/google/apis/workspaceevents_v1/classes.rb', line 751

def authority
  @authority
end

#create_timeString

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

Returns:

  • (String)


756
757
758
# File 'lib/google/apis/workspaceevents_v1/classes.rb', line 756

def create_time
  @create_time
end

#drive_optionsGoogle::Apis::WorkspaceeventsV1::DriveOptions

Additional supported options for serving Drive events. Corresponds to the JSON property driveOptions



761
762
763
# File 'lib/google/apis/workspaceevents_v1/classes.rb', line 761

def drive_options
  @drive_options
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)


768
769
770
# File 'lib/google/apis/workspaceevents_v1/classes.rb', line 768

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>)


782
783
784
# File 'lib/google/apis/workspaceevents_v1/classes.rb', line 782

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)


788
789
790
# File 'lib/google/apis/workspaceevents_v1/classes.rb', line 788

def expire_time
  @expire_time
end

#nameString

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

Returns:

  • (String)


794
795
796
# File 'lib/google/apis/workspaceevents_v1/classes.rb', line 794

def name
  @name
end

#notification_endpointGoogle::Apis::WorkspaceeventsV1::NotificationEndpoint

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



799
800
801
# File 'lib/google/apis/workspaceevents_v1/classes.rb', line 799

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 and Google Drive events. Corresponds to the JSON property payloadOptions



805
806
807
# File 'lib/google/apis/workspaceevents_v1/classes.rb', line 805

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)


810
811
812
# File 'lib/google/apis/workspaceevents_v1/classes.rb', line 810

def reconciling
  @reconciling
end

#service_account_authorityString

Output only. The service account that was used to authorize the creation of the subscription. This service account must be owned by the same Google Cloud project where you created this subscription. Format: projects/project_id/ serviceAccounts/service_account_id` Corresponds to the JSON propertyserviceAccountAuthority`

Returns:

  • (String)


819
820
821
# File 'lib/google/apis/workspaceevents_v1/classes.rb', line 819

def 
  @service_account_authority
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)


825
826
827
# File 'lib/google/apis/workspaceevents_v1/classes.rb', line 825

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)


831
832
833
# File 'lib/google/apis/workspaceevents_v1/classes.rb', line 831

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)


843
844
845
# File 'lib/google/apis/workspaceevents_v1/classes.rb', line 843

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)


849
850
851
# File 'lib/google/apis/workspaceevents_v1/classes.rb', line 849

def ttl
  @ttl
end

#uidString

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

Returns:

  • (String)


854
855
856
# File 'lib/google/apis/workspaceevents_v1/classes.rb', line 854

def uid
  @uid
end

#update_timeString

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

Returns:

  • (String)


859
860
861
# File 'lib/google/apis/workspaceevents_v1/classes.rb', line 859

def update_time
  @update_time
end

#user_authorityString

Output only. The user who authorized the creation of the subscription. The user must be able to view the target_resource. For Google Workspace users, the user value is the user.id field from the Directory API. Format: users/user` Corresponds to the JSON propertyuserAuthority`

Returns:

  • (String)


868
869
870
# File 'lib/google/apis/workspaceevents_v1/classes.rb', line 868

def user_authority
  @user_authority
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
# File 'lib/google/apis/workspaceevents_v1/classes.rb', line 875

def update!(**args)
  @authority = args[:authority] if args.key?(:authority)
  @create_time = args[:create_time] if args.key?(:create_time)
  @drive_options = args[:drive_options] if args.key?(:drive_options)
  @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)
  @service_account_authority = args[:service_account_authority] if args.key?(:service_account_authority)
  @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)
  @user_authority = args[:user_authority] if args.key?(:user_authority)
end