google-apps-chat-v1 0.24.0 → 0.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/google/apps/chat/v1/chat_service/client.rb +614 -0
- data/lib/google/apps/chat/v1/chat_service/credentials.rb +2 -0
- data/lib/google/apps/chat/v1/chat_service/paths.rb +14 -0
- data/lib/google/apps/chat/v1/chat_service/rest/client.rb +579 -0
- data/lib/google/apps/chat/v1/chat_service/rest/service_stub.rb +309 -0
- data/lib/google/apps/chat/v1/version.rb +1 -1
- data/lib/google/chat/v1/audience_pb.rb +21 -0
- data/lib/google/chat/v1/availability_pb.rb +36 -0
- data/lib/google/chat/v1/chat_service_pb.rb +2 -1
- data/lib/google/chat/v1/chat_service_services_pb.rb +71 -0
- data/lib/google/chat/v1/space_pb.rb +5 -1
- data/proto_docs/google/chat/v1/audience.rb +51 -0
- data/proto_docs/google/chat/v1/availability.rb +214 -0
- data/proto_docs/google/chat/v1/space.rb +54 -0
- metadata +5 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 23084a0c6d282c4e30dee50c303214fd1433a36b71147224f483bd873b6be3e9
|
|
4
|
+
data.tar.gz: c2bf76cef3b5466ffef720602d7d351b361ad9b495f63c182b1e166a859c0d88
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: '0825ffe7320e2a370dba900d23d6965cef3e7c348f187076616b428075a1343cd50299d763068044461a3b6139842ad0638378d06ca5dcff230954b0b6aa15c5'
|
|
7
|
+
data.tar.gz: f4177a0ff4271497567ad2187a4e2c9c8a48c1fd9e07e0ce22431b78f091c3bf7b6041850b8d1036e7a765da594c3d17207ff14938ef41a1aa4eb4e4ef4c8c4d
|
|
@@ -231,6 +231,31 @@ module Google
|
|
|
231
231
|
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
|
232
232
|
}
|
|
233
233
|
|
|
234
|
+
default_config.rpcs.get_availability.timeout = 30.0
|
|
235
|
+
default_config.rpcs.get_availability.retry_policy = {
|
|
236
|
+
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
default_config.rpcs.mark_as_active.timeout = 30.0
|
|
240
|
+
default_config.rpcs.mark_as_active.retry_policy = {
|
|
241
|
+
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
default_config.rpcs.mark_as_away.timeout = 30.0
|
|
245
|
+
default_config.rpcs.mark_as_away.retry_policy = {
|
|
246
|
+
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
default_config.rpcs.mark_as_do_not_disturb.timeout = 30.0
|
|
250
|
+
default_config.rpcs.mark_as_do_not_disturb.retry_policy = {
|
|
251
|
+
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
default_config.rpcs.update_availability.timeout = 30.0
|
|
255
|
+
default_config.rpcs.update_availability.retry_policy = {
|
|
256
|
+
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
|
257
|
+
}
|
|
258
|
+
|
|
234
259
|
default_config.rpcs.get_space_event.timeout = 30.0
|
|
235
260
|
default_config.rpcs.get_space_event.retry_policy = {
|
|
236
261
|
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
|
@@ -2588,6 +2613,24 @@ module Google
|
|
|
2588
2613
|
# users](https://developers.google.com/workspace/chat/space-target-audience).
|
|
2589
2614
|
# `access_settings.audience` is not supported with `useAdminAccess`.
|
|
2590
2615
|
#
|
|
2616
|
+
# `access_settings.access_permission_settings`: Updates the [access
|
|
2617
|
+
# permission
|
|
2618
|
+
# settings](https://support.google.com/chat/answer/11971020) of who can
|
|
2619
|
+
# discover and join the space where `spaceType` field is `SPACE`. Principals
|
|
2620
|
+
# allowed to join the space must also be allowed to discover it. To update
|
|
2621
|
+
# access permission settings for a space, the authenticating user must be a
|
|
2622
|
+
# space manager or assistant manager and omit all other field masks in the
|
|
2623
|
+
# request. You can't update this field if the space is in [import
|
|
2624
|
+
# mode](https://developers.google.com/workspace/chat/import-data-overview).
|
|
2625
|
+
# To learn more, see [Make a space discoverable to specific
|
|
2626
|
+
# users](https://developers.google.com/workspace/chat/space-target-audience).
|
|
2627
|
+
# `access_settings.access_permission_settings` is not supported with
|
|
2628
|
+
# `useAdminAccess`.
|
|
2629
|
+
# The supported field masks include:
|
|
2630
|
+
#
|
|
2631
|
+
# - `access_settings.access_permission_settings.discoverSpaceSetting`
|
|
2632
|
+
# - `access_settings.access_permission_settings.joinSpaceSetting`
|
|
2633
|
+
#
|
|
2591
2634
|
# `permission_settings`: Supports changing the
|
|
2592
2635
|
# [permission settings](https://support.google.com/chat/answer/13340792)
|
|
2593
2636
|
# of a space.
|
|
@@ -4749,6 +4792,542 @@ module Google
|
|
|
4749
4792
|
raise ::Google::Cloud::Error.from_error(e)
|
|
4750
4793
|
end
|
|
4751
4794
|
|
|
4795
|
+
##
|
|
4796
|
+
# Returns availability information for a human user in Google Chat. For
|
|
4797
|
+
# example, this can be used to check if a user is online or away, or to
|
|
4798
|
+
# retrieve their custom status message.
|
|
4799
|
+
#
|
|
4800
|
+
# This method only retrieves the authenticated user's availability.
|
|
4801
|
+
#
|
|
4802
|
+
# Requires [user
|
|
4803
|
+
# authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
|
|
4804
|
+
# with one of the following [authorization
|
|
4805
|
+
# scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes):
|
|
4806
|
+
#
|
|
4807
|
+
# - `https://www.googleapis.com/auth/chat.users.availability.readonly`
|
|
4808
|
+
# - `https://www.googleapis.com/auth/chat.users.availability`
|
|
4809
|
+
#
|
|
4810
|
+
# @overload get_availability(request, options = nil)
|
|
4811
|
+
# Pass arguments to `get_availability` via a request object, either of type
|
|
4812
|
+
# {::Google::Apps::Chat::V1::GetAvailabilityRequest} or an equivalent Hash.
|
|
4813
|
+
#
|
|
4814
|
+
# @param request [::Google::Apps::Chat::V1::GetAvailabilityRequest, ::Hash]
|
|
4815
|
+
# A request object representing the call parameters. Required. To specify no
|
|
4816
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
4817
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
4818
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
|
4819
|
+
#
|
|
4820
|
+
# @overload get_availability(name: nil)
|
|
4821
|
+
# Pass arguments to `get_availability` via keyword arguments. Note that at
|
|
4822
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
4823
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
4824
|
+
#
|
|
4825
|
+
# @param name [::String]
|
|
4826
|
+
# Required. The resource name of the availability to retrieve.
|
|
4827
|
+
#
|
|
4828
|
+
# Format: users/\\{user}/availability
|
|
4829
|
+
#
|
|
4830
|
+
# `{user}` is the id for the Person in the People API or Admin SDK directory
|
|
4831
|
+
# API. For example, `users/123456789`.
|
|
4832
|
+
#
|
|
4833
|
+
# The user's email address or `me` can also be used as an alias to refer to
|
|
4834
|
+
# the caller. For example, `users/user@example.com` or `users/me`.
|
|
4835
|
+
#
|
|
4836
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
|
4837
|
+
# @yieldparam response [::Google::Apps::Chat::V1::Availability]
|
|
4838
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
|
4839
|
+
#
|
|
4840
|
+
# @return [::Google::Apps::Chat::V1::Availability]
|
|
4841
|
+
#
|
|
4842
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
|
4843
|
+
#
|
|
4844
|
+
# @example Basic example
|
|
4845
|
+
# require "google/apps/chat/v1"
|
|
4846
|
+
#
|
|
4847
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
4848
|
+
# client = Google::Apps::Chat::V1::ChatService::Client.new
|
|
4849
|
+
#
|
|
4850
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
4851
|
+
# request = Google::Apps::Chat::V1::GetAvailabilityRequest.new
|
|
4852
|
+
#
|
|
4853
|
+
# # Call the get_availability method.
|
|
4854
|
+
# result = client.get_availability request
|
|
4855
|
+
#
|
|
4856
|
+
# # The returned object is of type Google::Apps::Chat::V1::Availability.
|
|
4857
|
+
# p result
|
|
4858
|
+
#
|
|
4859
|
+
def get_availability request, options = nil
|
|
4860
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
4861
|
+
|
|
4862
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::GetAvailabilityRequest
|
|
4863
|
+
|
|
4864
|
+
# Converts hash and nil to an options object
|
|
4865
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
4866
|
+
|
|
4867
|
+
# Customize the options with defaults
|
|
4868
|
+
metadata = @config.rpcs.get_availability.metadata.to_h
|
|
4869
|
+
|
|
4870
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
4871
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
4872
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
4873
|
+
gapic_version: ::Google::Apps::Chat::V1::VERSION
|
|
4874
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
4875
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
4876
|
+
|
|
4877
|
+
header_params = {}
|
|
4878
|
+
if request.name
|
|
4879
|
+
header_params["name"] = request.name
|
|
4880
|
+
end
|
|
4881
|
+
|
|
4882
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
|
4883
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
|
4884
|
+
|
|
4885
|
+
options.apply_defaults timeout: @config.rpcs.get_availability.timeout,
|
|
4886
|
+
metadata: metadata,
|
|
4887
|
+
retry_policy: @config.rpcs.get_availability.retry_policy
|
|
4888
|
+
|
|
4889
|
+
options.apply_defaults timeout: @config.timeout,
|
|
4890
|
+
metadata: @config.metadata,
|
|
4891
|
+
retry_policy: @config.retry_policy
|
|
4892
|
+
|
|
4893
|
+
@chat_service_stub.call_rpc :get_availability, request, options: options do |response, operation|
|
|
4894
|
+
yield response, operation if block_given?
|
|
4895
|
+
end
|
|
4896
|
+
rescue ::GRPC::BadStatus => e
|
|
4897
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
4898
|
+
end
|
|
4899
|
+
|
|
4900
|
+
##
|
|
4901
|
+
# Marks user as `ACTIVE` in Google Chat.
|
|
4902
|
+
#
|
|
4903
|
+
# Sets the user's availability state to `ACTIVE`. The `ACTIVE` state
|
|
4904
|
+
# lasts until the specified expiration, at which point the user's state
|
|
4905
|
+
# becomes `AWAY`. Note that if the user is actively using Chat, the `ACTIVE`
|
|
4906
|
+
# state duration may extend beyond the provided expiration.
|
|
4907
|
+
#
|
|
4908
|
+
# This method only updates the authenticated user's availability.
|
|
4909
|
+
#
|
|
4910
|
+
# Requires [user
|
|
4911
|
+
# authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
|
|
4912
|
+
# with [authorization
|
|
4913
|
+
# scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes):
|
|
4914
|
+
#
|
|
4915
|
+
# - `https://www.googleapis.com/auth/chat.users.availability`
|
|
4916
|
+
#
|
|
4917
|
+
# @overload mark_as_active(request, options = nil)
|
|
4918
|
+
# Pass arguments to `mark_as_active` via a request object, either of type
|
|
4919
|
+
# {::Google::Apps::Chat::V1::MarkAsActiveRequest} or an equivalent Hash.
|
|
4920
|
+
#
|
|
4921
|
+
# @param request [::Google::Apps::Chat::V1::MarkAsActiveRequest, ::Hash]
|
|
4922
|
+
# A request object representing the call parameters. Required. To specify no
|
|
4923
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
4924
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
4925
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
|
4926
|
+
#
|
|
4927
|
+
# @overload mark_as_active(name: nil, expire_time: nil, ttl: nil)
|
|
4928
|
+
# Pass arguments to `mark_as_active` via keyword arguments. Note that at
|
|
4929
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
4930
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
4931
|
+
#
|
|
4932
|
+
# @param name [::String]
|
|
4933
|
+
# Required. The resource name of the availability to mark as active.
|
|
4934
|
+
# Format: users/\\{user}/availability
|
|
4935
|
+
#
|
|
4936
|
+
# `{user}` is the id for the Person in the People API or Admin SDK directory
|
|
4937
|
+
# API. For example, `users/123456789`.
|
|
4938
|
+
#
|
|
4939
|
+
# The user's email address or `me` can also be used as an alias to refer to
|
|
4940
|
+
# the caller. For example, `users/user@example.com` or `users/me`.
|
|
4941
|
+
# @param expire_time [::Google::Protobuf::Timestamp, ::Hash]
|
|
4942
|
+
# The absolute timestamp when the ACTIVE state expires.
|
|
4943
|
+
#
|
|
4944
|
+
# Note: The following parameters are mutually exclusive: `expire_time`, `ttl`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
|
|
4945
|
+
# @param ttl [::Google::Protobuf::Duration, ::Hash]
|
|
4946
|
+
# The duration from the current time until the ACTIVE state expires.
|
|
4947
|
+
# Using a short TTL can effectively reset the user's state to be based
|
|
4948
|
+
# on activity after this brief duration.
|
|
4949
|
+
#
|
|
4950
|
+
# Note: The following parameters are mutually exclusive: `ttl`, `expire_time`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
|
|
4951
|
+
#
|
|
4952
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
|
4953
|
+
# @yieldparam response [::Google::Apps::Chat::V1::Availability]
|
|
4954
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
|
4955
|
+
#
|
|
4956
|
+
# @return [::Google::Apps::Chat::V1::Availability]
|
|
4957
|
+
#
|
|
4958
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
|
4959
|
+
#
|
|
4960
|
+
# @example Basic example
|
|
4961
|
+
# require "google/apps/chat/v1"
|
|
4962
|
+
#
|
|
4963
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
4964
|
+
# client = Google::Apps::Chat::V1::ChatService::Client.new
|
|
4965
|
+
#
|
|
4966
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
4967
|
+
# request = Google::Apps::Chat::V1::MarkAsActiveRequest.new
|
|
4968
|
+
#
|
|
4969
|
+
# # Call the mark_as_active method.
|
|
4970
|
+
# result = client.mark_as_active request
|
|
4971
|
+
#
|
|
4972
|
+
# # The returned object is of type Google::Apps::Chat::V1::Availability.
|
|
4973
|
+
# p result
|
|
4974
|
+
#
|
|
4975
|
+
def mark_as_active request, options = nil
|
|
4976
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
4977
|
+
|
|
4978
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::MarkAsActiveRequest
|
|
4979
|
+
|
|
4980
|
+
# Converts hash and nil to an options object
|
|
4981
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
4982
|
+
|
|
4983
|
+
# Customize the options with defaults
|
|
4984
|
+
metadata = @config.rpcs.mark_as_active.metadata.to_h
|
|
4985
|
+
|
|
4986
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
4987
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
4988
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
4989
|
+
gapic_version: ::Google::Apps::Chat::V1::VERSION
|
|
4990
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
4991
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
4992
|
+
|
|
4993
|
+
header_params = {}
|
|
4994
|
+
if request.name
|
|
4995
|
+
header_params["name"] = request.name
|
|
4996
|
+
end
|
|
4997
|
+
|
|
4998
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
|
4999
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
|
5000
|
+
|
|
5001
|
+
options.apply_defaults timeout: @config.rpcs.mark_as_active.timeout,
|
|
5002
|
+
metadata: metadata,
|
|
5003
|
+
retry_policy: @config.rpcs.mark_as_active.retry_policy
|
|
5004
|
+
|
|
5005
|
+
options.apply_defaults timeout: @config.timeout,
|
|
5006
|
+
metadata: @config.metadata,
|
|
5007
|
+
retry_policy: @config.retry_policy
|
|
5008
|
+
|
|
5009
|
+
@chat_service_stub.call_rpc :mark_as_active, request, options: options do |response, operation|
|
|
5010
|
+
yield response, operation if block_given?
|
|
5011
|
+
end
|
|
5012
|
+
rescue ::GRPC::BadStatus => e
|
|
5013
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
5014
|
+
end
|
|
5015
|
+
|
|
5016
|
+
##
|
|
5017
|
+
# Marks user as `AWAY` in Google Chat.
|
|
5018
|
+
#
|
|
5019
|
+
# Sets the user's state to away and is not affected by the user's
|
|
5020
|
+
# activity.
|
|
5021
|
+
#
|
|
5022
|
+
# This method only updates the authenticated user's availability.
|
|
5023
|
+
#
|
|
5024
|
+
# Requires [user
|
|
5025
|
+
# authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
|
|
5026
|
+
# with [authorization
|
|
5027
|
+
# scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes):
|
|
5028
|
+
#
|
|
5029
|
+
# - `https://www.googleapis.com/auth/chat.users.availability`
|
|
5030
|
+
#
|
|
5031
|
+
# @overload mark_as_away(request, options = nil)
|
|
5032
|
+
# Pass arguments to `mark_as_away` via a request object, either of type
|
|
5033
|
+
# {::Google::Apps::Chat::V1::MarkAsAwayRequest} or an equivalent Hash.
|
|
5034
|
+
#
|
|
5035
|
+
# @param request [::Google::Apps::Chat::V1::MarkAsAwayRequest, ::Hash]
|
|
5036
|
+
# A request object representing the call parameters. Required. To specify no
|
|
5037
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
5038
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
5039
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
|
5040
|
+
#
|
|
5041
|
+
# @overload mark_as_away(name: nil)
|
|
5042
|
+
# Pass arguments to `mark_as_away` via keyword arguments. Note that at
|
|
5043
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
5044
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
5045
|
+
#
|
|
5046
|
+
# @param name [::String]
|
|
5047
|
+
# Required. The resource name of the availability to mark as away.
|
|
5048
|
+
# Format: users/\\{user}/availability
|
|
5049
|
+
#
|
|
5050
|
+
# `{user}` is the id for the Person in the People API or Admin SDK directory
|
|
5051
|
+
# API. For example, `users/123456789`.
|
|
5052
|
+
#
|
|
5053
|
+
# The user's email address or `me` can also be used as an alias to refer to
|
|
5054
|
+
# the caller. For example, `users/user@example.com` or `users/me`.
|
|
5055
|
+
#
|
|
5056
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
|
5057
|
+
# @yieldparam response [::Google::Apps::Chat::V1::Availability]
|
|
5058
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
|
5059
|
+
#
|
|
5060
|
+
# @return [::Google::Apps::Chat::V1::Availability]
|
|
5061
|
+
#
|
|
5062
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
|
5063
|
+
#
|
|
5064
|
+
# @example Basic example
|
|
5065
|
+
# require "google/apps/chat/v1"
|
|
5066
|
+
#
|
|
5067
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
5068
|
+
# client = Google::Apps::Chat::V1::ChatService::Client.new
|
|
5069
|
+
#
|
|
5070
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
5071
|
+
# request = Google::Apps::Chat::V1::MarkAsAwayRequest.new
|
|
5072
|
+
#
|
|
5073
|
+
# # Call the mark_as_away method.
|
|
5074
|
+
# result = client.mark_as_away request
|
|
5075
|
+
#
|
|
5076
|
+
# # The returned object is of type Google::Apps::Chat::V1::Availability.
|
|
5077
|
+
# p result
|
|
5078
|
+
#
|
|
5079
|
+
def mark_as_away request, options = nil
|
|
5080
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
5081
|
+
|
|
5082
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::MarkAsAwayRequest
|
|
5083
|
+
|
|
5084
|
+
# Converts hash and nil to an options object
|
|
5085
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
5086
|
+
|
|
5087
|
+
# Customize the options with defaults
|
|
5088
|
+
metadata = @config.rpcs.mark_as_away.metadata.to_h
|
|
5089
|
+
|
|
5090
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
5091
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
5092
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
5093
|
+
gapic_version: ::Google::Apps::Chat::V1::VERSION
|
|
5094
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
5095
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
5096
|
+
|
|
5097
|
+
header_params = {}
|
|
5098
|
+
if request.name
|
|
5099
|
+
header_params["name"] = request.name
|
|
5100
|
+
end
|
|
5101
|
+
|
|
5102
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
|
5103
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
|
5104
|
+
|
|
5105
|
+
options.apply_defaults timeout: @config.rpcs.mark_as_away.timeout,
|
|
5106
|
+
metadata: metadata,
|
|
5107
|
+
retry_policy: @config.rpcs.mark_as_away.retry_policy
|
|
5108
|
+
|
|
5109
|
+
options.apply_defaults timeout: @config.timeout,
|
|
5110
|
+
metadata: @config.metadata,
|
|
5111
|
+
retry_policy: @config.retry_policy
|
|
5112
|
+
|
|
5113
|
+
@chat_service_stub.call_rpc :mark_as_away, request, options: options do |response, operation|
|
|
5114
|
+
yield response, operation if block_given?
|
|
5115
|
+
end
|
|
5116
|
+
rescue ::GRPC::BadStatus => e
|
|
5117
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
5118
|
+
end
|
|
5119
|
+
|
|
5120
|
+
##
|
|
5121
|
+
# Marks user as `DO_NOT_DISTURB` in Google Chat.
|
|
5122
|
+
#
|
|
5123
|
+
# Sets a user's availability state to `DO_NOT_DISTURB` until a specified
|
|
5124
|
+
# expiration time.
|
|
5125
|
+
# When in `DO_NOT_DISTURB`, users typically won't receive notifications.
|
|
5126
|
+
#
|
|
5127
|
+
# This method only updates the authenticated user's availability.
|
|
5128
|
+
#
|
|
5129
|
+
# Requires [user
|
|
5130
|
+
# authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
|
|
5131
|
+
# with [authorization
|
|
5132
|
+
# scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes):
|
|
5133
|
+
#
|
|
5134
|
+
# - `https://www.googleapis.com/auth/chat.users.availability`
|
|
5135
|
+
#
|
|
5136
|
+
# @overload mark_as_do_not_disturb(request, options = nil)
|
|
5137
|
+
# Pass arguments to `mark_as_do_not_disturb` via a request object, either of type
|
|
5138
|
+
# {::Google::Apps::Chat::V1::MarkAsDoNotDisturbRequest} or an equivalent Hash.
|
|
5139
|
+
#
|
|
5140
|
+
# @param request [::Google::Apps::Chat::V1::MarkAsDoNotDisturbRequest, ::Hash]
|
|
5141
|
+
# A request object representing the call parameters. Required. To specify no
|
|
5142
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
5143
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
5144
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
|
5145
|
+
#
|
|
5146
|
+
# @overload mark_as_do_not_disturb(name: nil, expire_time: nil, ttl: nil)
|
|
5147
|
+
# Pass arguments to `mark_as_do_not_disturb` via keyword arguments. Note that at
|
|
5148
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
5149
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
5150
|
+
#
|
|
5151
|
+
# @param name [::String]
|
|
5152
|
+
# Required. The resource name of the availability to mark as Do Not Disturb.
|
|
5153
|
+
# Format: users/\\{user}/availability
|
|
5154
|
+
#
|
|
5155
|
+
# `{user}` is the id for the Person in the People API or Admin SDK directory
|
|
5156
|
+
# API. For example, `users/123456789`.
|
|
5157
|
+
#
|
|
5158
|
+
# The user's email address or `me` can also be used as an alias to refer to
|
|
5159
|
+
# the caller. For example, `users/user@example.com` or `users/me`.
|
|
5160
|
+
# @param expire_time [::Google::Protobuf::Timestamp, ::Hash]
|
|
5161
|
+
# The absolute timestamp when the DND state expires.
|
|
5162
|
+
#
|
|
5163
|
+
# Note: The following parameters are mutually exclusive: `expire_time`, `ttl`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
|
|
5164
|
+
# @param ttl [::Google::Protobuf::Duration, ::Hash]
|
|
5165
|
+
# The duration from the current time until the DND state expires.
|
|
5166
|
+
#
|
|
5167
|
+
# Note: The following parameters are mutually exclusive: `ttl`, `expire_time`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
|
|
5168
|
+
#
|
|
5169
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
|
5170
|
+
# @yieldparam response [::Google::Apps::Chat::V1::Availability]
|
|
5171
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
|
5172
|
+
#
|
|
5173
|
+
# @return [::Google::Apps::Chat::V1::Availability]
|
|
5174
|
+
#
|
|
5175
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
|
5176
|
+
#
|
|
5177
|
+
# @example Basic example
|
|
5178
|
+
# require "google/apps/chat/v1"
|
|
5179
|
+
#
|
|
5180
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
5181
|
+
# client = Google::Apps::Chat::V1::ChatService::Client.new
|
|
5182
|
+
#
|
|
5183
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
5184
|
+
# request = Google::Apps::Chat::V1::MarkAsDoNotDisturbRequest.new
|
|
5185
|
+
#
|
|
5186
|
+
# # Call the mark_as_do_not_disturb method.
|
|
5187
|
+
# result = client.mark_as_do_not_disturb request
|
|
5188
|
+
#
|
|
5189
|
+
# # The returned object is of type Google::Apps::Chat::V1::Availability.
|
|
5190
|
+
# p result
|
|
5191
|
+
#
|
|
5192
|
+
def mark_as_do_not_disturb request, options = nil
|
|
5193
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
5194
|
+
|
|
5195
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::MarkAsDoNotDisturbRequest
|
|
5196
|
+
|
|
5197
|
+
# Converts hash and nil to an options object
|
|
5198
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
5199
|
+
|
|
5200
|
+
# Customize the options with defaults
|
|
5201
|
+
metadata = @config.rpcs.mark_as_do_not_disturb.metadata.to_h
|
|
5202
|
+
|
|
5203
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
5204
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
5205
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
5206
|
+
gapic_version: ::Google::Apps::Chat::V1::VERSION
|
|
5207
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
5208
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
5209
|
+
|
|
5210
|
+
header_params = {}
|
|
5211
|
+
if request.name
|
|
5212
|
+
header_params["name"] = request.name
|
|
5213
|
+
end
|
|
5214
|
+
|
|
5215
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
|
5216
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
|
5217
|
+
|
|
5218
|
+
options.apply_defaults timeout: @config.rpcs.mark_as_do_not_disturb.timeout,
|
|
5219
|
+
metadata: metadata,
|
|
5220
|
+
retry_policy: @config.rpcs.mark_as_do_not_disturb.retry_policy
|
|
5221
|
+
|
|
5222
|
+
options.apply_defaults timeout: @config.timeout,
|
|
5223
|
+
metadata: @config.metadata,
|
|
5224
|
+
retry_policy: @config.retry_policy
|
|
5225
|
+
|
|
5226
|
+
@chat_service_stub.call_rpc :mark_as_do_not_disturb, request, options: options do |response, operation|
|
|
5227
|
+
yield response, operation if block_given?
|
|
5228
|
+
end
|
|
5229
|
+
rescue ::GRPC::BadStatus => e
|
|
5230
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
5231
|
+
end
|
|
5232
|
+
|
|
5233
|
+
##
|
|
5234
|
+
# Updates availability information for a human user. Only the `custom_status`
|
|
5235
|
+
# field can be updated through this method.
|
|
5236
|
+
#
|
|
5237
|
+
# This method only updates the authenticated user's availability.
|
|
5238
|
+
#
|
|
5239
|
+
# Requires [user
|
|
5240
|
+
# authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
|
|
5241
|
+
# with one of the following [authorization
|
|
5242
|
+
# scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes):
|
|
5243
|
+
#
|
|
5244
|
+
# - `https://www.googleapis.com/auth/chat.users.availability`
|
|
5245
|
+
#
|
|
5246
|
+
# @overload update_availability(request, options = nil)
|
|
5247
|
+
# Pass arguments to `update_availability` via a request object, either of type
|
|
5248
|
+
# {::Google::Apps::Chat::V1::UpdateAvailabilityRequest} or an equivalent Hash.
|
|
5249
|
+
#
|
|
5250
|
+
# @param request [::Google::Apps::Chat::V1::UpdateAvailabilityRequest, ::Hash]
|
|
5251
|
+
# A request object representing the call parameters. Required. To specify no
|
|
5252
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
5253
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
5254
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
|
5255
|
+
#
|
|
5256
|
+
# @overload update_availability(availability: nil, update_mask: nil)
|
|
5257
|
+
# Pass arguments to `update_availability` via keyword arguments. Note that at
|
|
5258
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
5259
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
5260
|
+
#
|
|
5261
|
+
# @param availability [::Google::Apps::Chat::V1::Availability, ::Hash]
|
|
5262
|
+
# Required. The availability to update.
|
|
5263
|
+
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
|
5264
|
+
# Required. The list of fields to update.
|
|
5265
|
+
# The only field that can be updated is `custom_status`.
|
|
5266
|
+
#
|
|
5267
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
|
5268
|
+
# @yieldparam response [::Google::Apps::Chat::V1::Availability]
|
|
5269
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
|
5270
|
+
#
|
|
5271
|
+
# @return [::Google::Apps::Chat::V1::Availability]
|
|
5272
|
+
#
|
|
5273
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
|
5274
|
+
#
|
|
5275
|
+
# @example Basic example
|
|
5276
|
+
# require "google/apps/chat/v1"
|
|
5277
|
+
#
|
|
5278
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
5279
|
+
# client = Google::Apps::Chat::V1::ChatService::Client.new
|
|
5280
|
+
#
|
|
5281
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
5282
|
+
# request = Google::Apps::Chat::V1::UpdateAvailabilityRequest.new
|
|
5283
|
+
#
|
|
5284
|
+
# # Call the update_availability method.
|
|
5285
|
+
# result = client.update_availability request
|
|
5286
|
+
#
|
|
5287
|
+
# # The returned object is of type Google::Apps::Chat::V1::Availability.
|
|
5288
|
+
# p result
|
|
5289
|
+
#
|
|
5290
|
+
def update_availability request, options = nil
|
|
5291
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
5292
|
+
|
|
5293
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::UpdateAvailabilityRequest
|
|
5294
|
+
|
|
5295
|
+
# Converts hash and nil to an options object
|
|
5296
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
5297
|
+
|
|
5298
|
+
# Customize the options with defaults
|
|
5299
|
+
metadata = @config.rpcs.update_availability.metadata.to_h
|
|
5300
|
+
|
|
5301
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
5302
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
5303
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
5304
|
+
gapic_version: ::Google::Apps::Chat::V1::VERSION
|
|
5305
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
5306
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
5307
|
+
|
|
5308
|
+
header_params = {}
|
|
5309
|
+
if request.availability&.name
|
|
5310
|
+
header_params["availability.name"] = request.availability.name
|
|
5311
|
+
end
|
|
5312
|
+
|
|
5313
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
|
5314
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
|
5315
|
+
|
|
5316
|
+
options.apply_defaults timeout: @config.rpcs.update_availability.timeout,
|
|
5317
|
+
metadata: metadata,
|
|
5318
|
+
retry_policy: @config.rpcs.update_availability.retry_policy
|
|
5319
|
+
|
|
5320
|
+
options.apply_defaults timeout: @config.timeout,
|
|
5321
|
+
metadata: @config.metadata,
|
|
5322
|
+
retry_policy: @config.retry_policy
|
|
5323
|
+
|
|
5324
|
+
@chat_service_stub.call_rpc :update_availability, request, options: options do |response, operation|
|
|
5325
|
+
yield response, operation if block_given?
|
|
5326
|
+
end
|
|
5327
|
+
rescue ::GRPC::BadStatus => e
|
|
5328
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
5329
|
+
end
|
|
5330
|
+
|
|
4752
5331
|
##
|
|
4753
5332
|
# Returns an event from a Google Chat space. The [event
|
|
4754
5333
|
# payload](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.spaceEvents#SpaceEvent.FIELDS.oneof_payload)
|
|
@@ -6401,6 +6980,31 @@ module Google
|
|
|
6401
6980
|
#
|
|
6402
6981
|
attr_reader :get_thread_read_state
|
|
6403
6982
|
##
|
|
6983
|
+
# RPC-specific configuration for `get_availability`
|
|
6984
|
+
# @return [::Gapic::Config::Method]
|
|
6985
|
+
#
|
|
6986
|
+
attr_reader :get_availability
|
|
6987
|
+
##
|
|
6988
|
+
# RPC-specific configuration for `mark_as_active`
|
|
6989
|
+
# @return [::Gapic::Config::Method]
|
|
6990
|
+
#
|
|
6991
|
+
attr_reader :mark_as_active
|
|
6992
|
+
##
|
|
6993
|
+
# RPC-specific configuration for `mark_as_away`
|
|
6994
|
+
# @return [::Gapic::Config::Method]
|
|
6995
|
+
#
|
|
6996
|
+
attr_reader :mark_as_away
|
|
6997
|
+
##
|
|
6998
|
+
# RPC-specific configuration for `mark_as_do_not_disturb`
|
|
6999
|
+
# @return [::Gapic::Config::Method]
|
|
7000
|
+
#
|
|
7001
|
+
attr_reader :mark_as_do_not_disturb
|
|
7002
|
+
##
|
|
7003
|
+
# RPC-specific configuration for `update_availability`
|
|
7004
|
+
# @return [::Gapic::Config::Method]
|
|
7005
|
+
#
|
|
7006
|
+
attr_reader :update_availability
|
|
7007
|
+
##
|
|
6404
7008
|
# RPC-specific configuration for `get_space_event`
|
|
6405
7009
|
# @return [::Gapic::Config::Method]
|
|
6406
7010
|
#
|
|
@@ -6522,6 +7126,16 @@ module Google
|
|
|
6522
7126
|
@update_space_read_state = ::Gapic::Config::Method.new update_space_read_state_config
|
|
6523
7127
|
get_thread_read_state_config = parent_rpcs.get_thread_read_state if parent_rpcs.respond_to? :get_thread_read_state
|
|
6524
7128
|
@get_thread_read_state = ::Gapic::Config::Method.new get_thread_read_state_config
|
|
7129
|
+
get_availability_config = parent_rpcs.get_availability if parent_rpcs.respond_to? :get_availability
|
|
7130
|
+
@get_availability = ::Gapic::Config::Method.new get_availability_config
|
|
7131
|
+
mark_as_active_config = parent_rpcs.mark_as_active if parent_rpcs.respond_to? :mark_as_active
|
|
7132
|
+
@mark_as_active = ::Gapic::Config::Method.new mark_as_active_config
|
|
7133
|
+
mark_as_away_config = parent_rpcs.mark_as_away if parent_rpcs.respond_to? :mark_as_away
|
|
7134
|
+
@mark_as_away = ::Gapic::Config::Method.new mark_as_away_config
|
|
7135
|
+
mark_as_do_not_disturb_config = parent_rpcs.mark_as_do_not_disturb if parent_rpcs.respond_to? :mark_as_do_not_disturb
|
|
7136
|
+
@mark_as_do_not_disturb = ::Gapic::Config::Method.new mark_as_do_not_disturb_config
|
|
7137
|
+
update_availability_config = parent_rpcs.update_availability if parent_rpcs.respond_to? :update_availability
|
|
7138
|
+
@update_availability = ::Gapic::Config::Method.new update_availability_config
|
|
6525
7139
|
get_space_event_config = parent_rpcs.get_space_event if parent_rpcs.respond_to? :get_space_event
|
|
6526
7140
|
@get_space_event = ::Gapic::Config::Method.new get_space_event_config
|
|
6527
7141
|
list_space_events_config = parent_rpcs.list_space_events if parent_rpcs.respond_to? :list_space_events
|
|
@@ -55,6 +55,8 @@ module Google
|
|
|
55
55
|
"https://www.googleapis.com/auth/chat.spaces",
|
|
56
56
|
"https://www.googleapis.com/auth/chat.spaces.create",
|
|
57
57
|
"https://www.googleapis.com/auth/chat.spaces.readonly",
|
|
58
|
+
"https://www.googleapis.com/auth/chat.users.availability",
|
|
59
|
+
"https://www.googleapis.com/auth/chat.users.availability.readonly",
|
|
58
60
|
"https://www.googleapis.com/auth/chat.users.readstate",
|
|
59
61
|
"https://www.googleapis.com/auth/chat.users.readstate.readonly",
|
|
60
62
|
"https://www.googleapis.com/auth/chat.users.sections",
|