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.



838
839
840
# File 'lib/google/apis/workspaceevents_v1/classes.rb', line 838

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)


724
725
726
# File 'lib/google/apis/workspaceevents_v1/classes.rb', line 724

def authority
  @authority
end

#create_timeString

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

Returns:

  • (String)


729
730
731
# File 'lib/google/apis/workspaceevents_v1/classes.rb', line 729

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)


736
737
738
# File 'lib/google/apis/workspaceevents_v1/classes.rb', line 736

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


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

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)


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

def expire_time
  @expire_time
end

#nameString

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

Returns:

  • (String)


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

def name
  @name
end

#notification_endpointGoogle::Apis::WorkspaceeventsV1::NotificationEndpoint

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



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

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



773
774
775
# File 'lib/google/apis/workspaceevents_v1/classes.rb', line 773

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)


778
779
780
# File 'lib/google/apis/workspaceevents_v1/classes.rb', line 778

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)


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

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)


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

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)


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

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)


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

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)


817
818
819
# File 'lib/google/apis/workspaceevents_v1/classes.rb', line 817

def ttl
  @ttl
end

#uidString

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

Returns:

  • (String)


822
823
824
# File 'lib/google/apis/workspaceevents_v1/classes.rb', line 822

def uid
  @uid
end

#update_timeString

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

Returns:

  • (String)


827
828
829
# File 'lib/google/apis/workspaceevents_v1/classes.rb', line 827

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)


836
837
838
# File 'lib/google/apis/workspaceevents_v1/classes.rb', line 836

def user_authority
  @user_authority
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
# File 'lib/google/apis/workspaceevents_v1/classes.rb', line 843

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