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.
424 425 426 427 428 429 430 431 432 433 434 |
# File 'lib/google/apis/workspaceevents_v1/service.rb', line 424 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 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. - A user by specifying an authorization
scope that doesn't include app in its name. To learn more, see Authorize as
a Chat user.
150 151 152 153 154 155 156 157 158 159 160 |
# File 'lib/google/apis/workspaceevents_v1/service.rb', line 150 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.
536 537 538 539 540 541 542 543 544 545 546 547 548 |
# File 'lib/google/apis/workspaceevents_v1/service.rb', line 536 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.
194 195 196 197 198 199 200 201 202 203 204 205 |
# File 'lib/google/apis/workspaceevents_v1/service.rb', line 194 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.
574 575 576 577 578 579 580 581 582 583 |
# File 'lib/google/apis/workspaceevents_v1/service.rb', line 574 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.
230 231 232 233 234 235 236 237 238 |
# File 'lib/google/apis/workspaceevents_v1/service.rb', line 230 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.
461 462 463 464 465 466 467 468 469 470 471 |
# File 'lib/google/apis/workspaceevents_v1/service.rb', line 461 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.
609 610 611 612 613 614 615 616 617 618 |
# File 'lib/google/apis/workspaceevents_v1/service.rb', line 609 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.
284 285 286 287 288 289 290 291 292 293 294 |
# File 'lib/google/apis/workspaceevents_v1/service.rb', line 284 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.
652 653 654 655 656 657 658 659 660 661 662 663 |
# File 'lib/google/apis/workspaceevents_v1/service.rb', line 652 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 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. - A user by specifying an authorization
scope that doesn't include app in its name. To learn more, see Authorize as
a Chat user.
340 341 342 343 344 345 346 347 348 349 350 351 352 |
# File 'lib/google/apis/workspaceevents_v1/service.rb', line 340 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 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. - A user by specifying an
authorization scope that doesn't include app in its name. To learn more, see
Authorize as a Chat user.
390 391 392 393 394 395 396 397 398 399 400 |
# File 'lib/google/apis/workspaceevents_v1/service.rb', line 390 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.
499 500 501 502 503 504 505 506 507 508 |
# File 'lib/google/apis/workspaceevents_v1/service.rb', line 499 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 |