Class: Google::Apis::WorkspaceeventsV1::WorkspaceEventsService
- Inherits:
-
Core::BaseService
- Object
- Core::BaseService
- Google::Apis::WorkspaceeventsV1::WorkspaceEventsService
- Defined in:
- lib/google/apis/workspaceevents_v1/service.rb
Overview
Google Workspace Events API
The Google Workspace Events API lets you subscribe to events and manage change notifications across Google Workspace applications.
Constant Summary collapse
- DEFAULT_ENDPOINT_TEMPLATE =
"https://workspaceevents.$UNIVERSE_DOMAIN$/"
Instance Attribute Summary collapse
-
#key ⇒ String
API key.
-
#quota_user ⇒ String
Available to use for quota purposes for server-side applications.
Instance Method Summary collapse
-
#cancel_task(name, cancel_task_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WorkspaceeventsV1::Task
Cancel a task from the agent.
-
#create_subscription(subscription_object = nil, validate_only: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WorkspaceeventsV1::Operation
Creates a Google Workspace subscription.
-
#create_task_push_notification_config(parent, task_push_notification_config_object = nil, config_id: nil, tenant: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WorkspaceeventsV1::TaskPushNotificationConfig
Set a push notification config for a task.
-
#delete_subscription(name, allow_missing: nil, etag: nil, validate_only: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WorkspaceeventsV1::Operation
Deletes a Google Workspace subscription.
-
#delete_task_push_notification_config(name, tenant: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WorkspaceeventsV1::Empty
Delete a push notification config for a task.
-
#get_operation(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WorkspaceeventsV1::Operation
Gets the latest state of a long-running operation.
-
#get_subscription(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WorkspaceeventsV1::Subscription
Gets details about a Google Workspace subscription.
-
#get_task(name, history_length: nil, tenant: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WorkspaceeventsV1::Task
Get the current state of a task from the agent.
-
#get_task_push_notification_config(name, tenant: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WorkspaceeventsV1::TaskPushNotificationConfig
Get a push notification config for a task.
-
#initialize ⇒ WorkspaceEventsService
constructor
A new instance of WorkspaceEventsService.
-
#list_subscriptions(filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WorkspaceeventsV1::ListSubscriptionsResponse
Lists Google Workspace subscriptions.
-
#list_task_push_notification_configs(parent, page_size: nil, page_token: nil, tenant: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WorkspaceeventsV1::ListTaskPushNotificationConfigResponse
Get a list of push notifications configured for a task.
-
#patch_subscription(name, subscription_object = nil, update_mask: nil, validate_only: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WorkspaceeventsV1::Operation
Updates or renews a Google Workspace subscription.
-
#reactivate_subscription(name, reactivate_subscription_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WorkspaceeventsV1::Operation
Reactivates a suspended Google Workspace subscription.
-
#stream_message(send_message_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WorkspaceeventsV1::StreamResponse
SendStreamingMessage is a streaming call that will return a stream of task update events until the Task is in an interrupted or terminal state.
-
#subscribe_task(name, tenant: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WorkspaceeventsV1::StreamResponse
TaskSubscription is a streaming call that will return a stream of task update events.
Constructor Details
#initialize ⇒ WorkspaceEventsService
Returns a new instance of WorkspaceEventsService.
48 49 50 51 52 53 |
# File 'lib/google/apis/workspaceevents_v1/service.rb', line 48 def initialize super(DEFAULT_ENDPOINT_TEMPLATE, '', client_name: 'google-apis-workspaceevents_v1', client_version: Google::Apis::WorkspaceeventsV1::GEM_VERSION) @batch_path = 'batch' end |
Instance Attribute Details
#key ⇒ String
Returns API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
41 42 43 |
# File 'lib/google/apis/workspaceevents_v1/service.rb', line 41 def key @key end |
#quota_user ⇒ String
Returns Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
46 47 48 |
# File 'lib/google/apis/workspaceevents_v1/service.rb', line 46 def quota_user @quota_user end |
Instance Method Details
#cancel_task(name, cancel_task_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WorkspaceeventsV1::Task
Cancel a task from the agent. If supported one should expect no more task updates for the task.
445 446 447 448 449 450 451 452 453 454 455 |
# File 'lib/google/apis/workspaceevents_v1/service.rb', line 445 def cancel_task(name, cancel_task_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/{+name}:cancel', ) command.request_representation = Google::Apis::WorkspaceeventsV1::CancelTaskRequest::Representation command.request_object = cancel_task_request_object command.response_representation = Google::Apis::WorkspaceeventsV1::Task::Representation command.response_class = Google::Apis::WorkspaceeventsV1::Task command.params['name'] = name unless name.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#create_subscription(subscription_object = nil, validate_only: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WorkspaceeventsV1::Operation
Creates a Google Workspace subscription. To learn how to use this method, see
Create a Google Workspace subscription. For a subscription on a Chat
target resource, you can create a subscription as: - A Chat app subscribing to space
events where the app is a member by specifying an authorization scope that
begins with chat.app and getting one-time administrator approval. To learn
more, see Authorize as a Chat app with administrator approval. -
Developer Preview: A Chat
app subscribing to all events in a Google Workspace organization by specifying
an authorization scope that begins with chat.app.all and obtaining one-time
administrator approval. To learn more, see Subscribe to all Google Chat
events in a Workspace organization . - A user by
specifying an authorization scope that doesn't include app in its name. To
learn more, see Authorize as a Chat user.
156 157 158 159 160 161 162 163 164 165 166 |
# File 'lib/google/apis/workspaceevents_v1/service.rb', line 156 def create_subscription(subscription_object = nil, validate_only: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/subscriptions', ) command.request_representation = Google::Apis::WorkspaceeventsV1::Subscription::Representation command.request_object = subscription_object command.response_representation = Google::Apis::WorkspaceeventsV1::Operation::Representation command.response_class = Google::Apis::WorkspaceeventsV1::Operation command.query['validateOnly'] = validate_only unless validate_only.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#create_task_push_notification_config(parent, task_push_notification_config_object = nil, config_id: nil, tenant: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WorkspaceeventsV1::TaskPushNotificationConfig
Set a push notification config for a task.
557 558 559 560 561 562 563 564 565 566 567 568 569 |
# File 'lib/google/apis/workspaceevents_v1/service.rb', line 557 def create_task_push_notification_config(parent, task_push_notification_config_object = nil, config_id: nil, tenant: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/{+parent}', ) command.request_representation = Google::Apis::WorkspaceeventsV1::TaskPushNotificationConfig::Representation command.request_object = task_push_notification_config_object command.response_representation = Google::Apis::WorkspaceeventsV1::TaskPushNotificationConfig::Representation command.response_class = Google::Apis::WorkspaceeventsV1::TaskPushNotificationConfig command.params['parent'] = parent unless parent.nil? command.query['configId'] = config_id unless config_id.nil? command.query['tenant'] = tenant unless tenant.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#delete_subscription(name, allow_missing: nil, etag: nil, validate_only: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WorkspaceeventsV1::Operation
Deletes a Google Workspace subscription. To learn how to use this method, see Delete a Google Workspace subscription.
200 201 202 203 204 205 206 207 208 209 210 211 |
# File 'lib/google/apis/workspaceevents_v1/service.rb', line 200 def delete_subscription(name, allow_missing: nil, etag: nil, validate_only: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:delete, 'v1/{+name}', ) command.response_representation = Google::Apis::WorkspaceeventsV1::Operation::Representation command.response_class = Google::Apis::WorkspaceeventsV1::Operation command.params['name'] = name unless name.nil? command.query['allowMissing'] = allow_missing unless allow_missing.nil? command.query['etag'] = etag unless etag.nil? command.query['validateOnly'] = validate_only unless validate_only.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#delete_task_push_notification_config(name, tenant: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WorkspaceeventsV1::Empty
Delete a push notification config for a task.
595 596 597 598 599 600 601 602 603 604 |
# File 'lib/google/apis/workspaceevents_v1/service.rb', line 595 def delete_task_push_notification_config(name, tenant: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:delete, 'v1/{+name}', ) command.response_representation = Google::Apis::WorkspaceeventsV1::Empty::Representation command.response_class = Google::Apis::WorkspaceeventsV1::Empty command.params['name'] = name unless name.nil? command.query['tenant'] = tenant unless tenant.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#get_operation(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WorkspaceeventsV1::Operation
Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.
107 108 109 110 111 112 113 114 115 |
# File 'lib/google/apis/workspaceevents_v1/service.rb', line 107 def get_operation(name, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/{+name}', ) command.response_representation = Google::Apis::WorkspaceeventsV1::Operation::Representation command.response_class = Google::Apis::WorkspaceeventsV1::Operation command.params['name'] = name unless name.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#get_subscription(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WorkspaceeventsV1::Subscription
Gets details about a Google Workspace subscription. To learn how to use this method, see Get details about a Google Workspace subscription.
236 237 238 239 240 241 242 243 244 |
# File 'lib/google/apis/workspaceevents_v1/service.rb', line 236 def get_subscription(name, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/{+name}', ) command.response_representation = Google::Apis::WorkspaceeventsV1::Subscription::Representation command.response_class = Google::Apis::WorkspaceeventsV1::Subscription command.params['name'] = name unless name.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#get_task(name, history_length: nil, tenant: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WorkspaceeventsV1::Task
Get the current state of a task from the agent.
482 483 484 485 486 487 488 489 490 491 492 |
# File 'lib/google/apis/workspaceevents_v1/service.rb', line 482 def get_task(name, history_length: nil, tenant: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/{+name}', ) command.response_representation = Google::Apis::WorkspaceeventsV1::Task::Representation command.response_class = Google::Apis::WorkspaceeventsV1::Task command.params['name'] = name unless name.nil? command.query['historyLength'] = history_length unless history_length.nil? command.query['tenant'] = tenant unless tenant.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#get_task_push_notification_config(name, tenant: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WorkspaceeventsV1::TaskPushNotificationConfig
Get a push notification config for a task.
630 631 632 633 634 635 636 637 638 639 |
# File 'lib/google/apis/workspaceevents_v1/service.rb', line 630 def get_task_push_notification_config(name, tenant: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/{+name}', ) command.response_representation = Google::Apis::WorkspaceeventsV1::TaskPushNotificationConfig::Representation command.response_class = Google::Apis::WorkspaceeventsV1::TaskPushNotificationConfig command.params['name'] = name unless name.nil? command.query['tenant'] = tenant unless tenant.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#list_subscriptions(filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WorkspaceeventsV1::ListSubscriptionsResponse
Lists Google Workspace subscriptions. To learn how to use this method, see List Google Workspace subscriptions.
293 294 295 296 297 298 299 300 301 302 303 |
# File 'lib/google/apis/workspaceevents_v1/service.rb', line 293 def list_subscriptions(filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/subscriptions', ) command.response_representation = Google::Apis::WorkspaceeventsV1::ListSubscriptionsResponse::Representation command.response_class = Google::Apis::WorkspaceeventsV1::ListSubscriptionsResponse command.query['filter'] = filter unless filter.nil? command.query['pageSize'] = page_size unless page_size.nil? command.query['pageToken'] = page_token unless page_token.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#list_task_push_notification_configs(parent, page_size: nil, page_token: nil, tenant: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WorkspaceeventsV1::ListTaskPushNotificationConfigResponse
Get a list of push notifications configured for a task.
673 674 675 676 677 678 679 680 681 682 683 684 |
# File 'lib/google/apis/workspaceevents_v1/service.rb', line 673 def list_task_push_notification_configs(parent, page_size: nil, page_token: nil, tenant: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/{+parent}/pushNotificationConfigs', ) command.response_representation = Google::Apis::WorkspaceeventsV1::ListTaskPushNotificationConfigResponse::Representation command.response_class = Google::Apis::WorkspaceeventsV1::ListTaskPushNotificationConfigResponse command.params['parent'] = parent unless parent.nil? command.query['pageSize'] = page_size unless page_size.nil? command.query['pageToken'] = page_token unless page_token.nil? command.query['tenant'] = tenant unless tenant.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#patch_subscription(name, subscription_object = nil, update_mask: nil, validate_only: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WorkspaceeventsV1::Operation
Updates or renews a Google Workspace subscription. To learn how to use this
method, see Update or renew a Google Workspace subscription. For a
subscription on a Chat target resource, you can update a subscription as: - A
Chat app subscribing to space events where the app is a member by specifying
an authorization scope that begins with chat.app and getting one-time
administrator approval. To learn more, see Authorize as a Chat app with
administrator approval. - Developer Preview: A Chat app subscribing to all events in a
Google Workspace organization by specifying an authorization scope that begins
with chat.app.all and getting one-time administrator approval. To learn more,
see Subscribe to all Google Chat events in a Workspace organization . - A user by specifying an authorization scope that doesn't
include app in its name. To learn more, see Authorize as a Chat user.
355 356 357 358 359 360 361 362 363 364 365 366 367 |
# File 'lib/google/apis/workspaceevents_v1/service.rb', line 355 def patch_subscription(name, subscription_object = nil, update_mask: nil, validate_only: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:patch, 'v1/{+name}', ) command.request_representation = Google::Apis::WorkspaceeventsV1::Subscription::Representation command.request_object = subscription_object command.response_representation = Google::Apis::WorkspaceeventsV1::Operation::Representation command.response_class = Google::Apis::WorkspaceeventsV1::Operation command.params['name'] = name unless name.nil? command.query['updateMask'] = update_mask unless update_mask.nil? command.query['validateOnly'] = validate_only unless validate_only.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#reactivate_subscription(name, reactivate_subscription_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WorkspaceeventsV1::Operation
Reactivates a suspended Google Workspace subscription. This method resets your
subscription's State field to ACTIVE. Before you use this method, you must
fix the error that suspended the subscription. This method will ignore or
reject any subscription that isn't currently in a suspended state. To learn
how to use this method, see Reactivate a Google Workspace subscription. For
a subscription on a Chat target resource, you can reactivate a subscription as: -
A Chat app subscribing to space events where the app is a member by specifying
an authorization scope that begins with chat.app and getting one-time
administrator approval. To learn more, see Authorize as a Chat app with
administrator approval. - Developer Preview: A Chat app subscribing to all events in a
Google Workspace organization by specifying an authorization scope that begins
with chat.app.all and getting one-time administrator approval. To learn more,
see Subscribe to all Google Chat events in a Workspace organization . - A user by specifying an authorization scope that doesn't
include app in its name. To learn more, see Authorize as a Chat user.
411 412 413 414 415 416 417 418 419 420 421 |
# File 'lib/google/apis/workspaceevents_v1/service.rb', line 411 def reactivate_subscription(name, reactivate_subscription_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/{+name}:reactivate', ) command.request_representation = Google::Apis::WorkspaceeventsV1::ReactivateSubscriptionRequest::Representation command.request_object = reactivate_subscription_request_object command.response_representation = Google::Apis::WorkspaceeventsV1::Operation::Representation command.response_class = Google::Apis::WorkspaceeventsV1::Operation command.params['name'] = name unless name.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#stream_message(send_message_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WorkspaceeventsV1::StreamResponse
SendStreamingMessage is a streaming call that will return a stream of task update events until the Task is in an interrupted or terminal state.
75 76 77 78 79 80 81 82 83 84 |
# File 'lib/google/apis/workspaceevents_v1/service.rb', line 75 def ( = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/message:stream', ) command.request_representation = Google::Apis::WorkspaceeventsV1::SendMessageRequest::Representation command.request_object = command.response_representation = Google::Apis::WorkspaceeventsV1::StreamResponse::Representation command.response_class = Google::Apis::WorkspaceeventsV1::StreamResponse command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#subscribe_task(name, tenant: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WorkspaceeventsV1::StreamResponse
TaskSubscription is a streaming call that will return a stream of task update events. This attaches the stream to an existing in process task. If the task is complete the stream will return the completed task (like GetTask) and close the stream.
520 521 522 523 524 525 526 527 528 529 |
# File 'lib/google/apis/workspaceevents_v1/service.rb', line 520 def subscribe_task(name, tenant: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/{+name}:subscribe', ) command.response_representation = Google::Apis::WorkspaceeventsV1::StreamResponse::Representation command.response_class = Google::Apis::WorkspaceeventsV1::StreamResponse command.params['name'] = name unless name.nil? command.query['tenant'] = tenant unless tenant.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |