google-apps-chat-v1 0.24.0 → 0.25.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 +596 -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 +561 -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/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/proto_docs/google/chat/v1/availability.rb +214 -0
- metadata +3 -1
|
@@ -233,6 +233,31 @@ module Google
|
|
|
233
233
|
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
|
234
234
|
}
|
|
235
235
|
|
|
236
|
+
default_config.rpcs.get_availability.timeout = 30.0
|
|
237
|
+
default_config.rpcs.get_availability.retry_policy = {
|
|
238
|
+
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
default_config.rpcs.mark_as_active.timeout = 30.0
|
|
242
|
+
default_config.rpcs.mark_as_active.retry_policy = {
|
|
243
|
+
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
default_config.rpcs.mark_as_away.timeout = 30.0
|
|
247
|
+
default_config.rpcs.mark_as_away.retry_policy = {
|
|
248
|
+
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
default_config.rpcs.mark_as_do_not_disturb.timeout = 30.0
|
|
252
|
+
default_config.rpcs.mark_as_do_not_disturb.retry_policy = {
|
|
253
|
+
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
default_config.rpcs.update_availability.timeout = 30.0
|
|
257
|
+
default_config.rpcs.update_availability.retry_policy = {
|
|
258
|
+
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
|
259
|
+
}
|
|
260
|
+
|
|
236
261
|
default_config.rpcs.get_space_event.timeout = 30.0
|
|
237
262
|
default_config.rpcs.get_space_event.retry_policy = {
|
|
238
263
|
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
|
@@ -4582,6 +4607,507 @@ module Google
|
|
|
4582
4607
|
raise ::Google::Cloud::Error.from_error(e)
|
|
4583
4608
|
end
|
|
4584
4609
|
|
|
4610
|
+
##
|
|
4611
|
+
# Returns availability information for a human user in Google Chat. For
|
|
4612
|
+
# example, this can be used to check if a user is online or away, or to
|
|
4613
|
+
# retrieve their custom status message.
|
|
4614
|
+
#
|
|
4615
|
+
# This method only retrieves the authenticated user's availability.
|
|
4616
|
+
#
|
|
4617
|
+
# Requires [user
|
|
4618
|
+
# authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
|
|
4619
|
+
# with one of the following [authorization
|
|
4620
|
+
# scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes):
|
|
4621
|
+
#
|
|
4622
|
+
# - `https://www.googleapis.com/auth/chat.users.availability.readonly`
|
|
4623
|
+
# - `https://www.googleapis.com/auth/chat.users.availability`
|
|
4624
|
+
#
|
|
4625
|
+
# @overload get_availability(request, options = nil)
|
|
4626
|
+
# Pass arguments to `get_availability` via a request object, either of type
|
|
4627
|
+
# {::Google::Apps::Chat::V1::GetAvailabilityRequest} or an equivalent Hash.
|
|
4628
|
+
#
|
|
4629
|
+
# @param request [::Google::Apps::Chat::V1::GetAvailabilityRequest, ::Hash]
|
|
4630
|
+
# A request object representing the call parameters. Required. To specify no
|
|
4631
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
4632
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
4633
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
|
4634
|
+
#
|
|
4635
|
+
# @overload get_availability(name: nil)
|
|
4636
|
+
# Pass arguments to `get_availability` via keyword arguments. Note that at
|
|
4637
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
4638
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
4639
|
+
#
|
|
4640
|
+
# @param name [::String]
|
|
4641
|
+
# Required. The resource name of the availability to retrieve.
|
|
4642
|
+
#
|
|
4643
|
+
# Format: users/\\{user}/availability
|
|
4644
|
+
#
|
|
4645
|
+
# `{user}` is the id for the Person in the People API or Admin SDK directory
|
|
4646
|
+
# API. For example, `users/123456789`.
|
|
4647
|
+
#
|
|
4648
|
+
# The user's email address or `me` can also be used as an alias to refer to
|
|
4649
|
+
# the caller. For example, `users/user@example.com` or `users/me`.
|
|
4650
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
|
4651
|
+
# @yieldparam result [::Google::Apps::Chat::V1::Availability]
|
|
4652
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
|
4653
|
+
#
|
|
4654
|
+
# @return [::Google::Apps::Chat::V1::Availability]
|
|
4655
|
+
#
|
|
4656
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
|
4657
|
+
#
|
|
4658
|
+
# @example Basic example
|
|
4659
|
+
# require "google/apps/chat/v1"
|
|
4660
|
+
#
|
|
4661
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
4662
|
+
# client = Google::Apps::Chat::V1::ChatService::Rest::Client.new
|
|
4663
|
+
#
|
|
4664
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
4665
|
+
# request = Google::Apps::Chat::V1::GetAvailabilityRequest.new
|
|
4666
|
+
#
|
|
4667
|
+
# # Call the get_availability method.
|
|
4668
|
+
# result = client.get_availability request
|
|
4669
|
+
#
|
|
4670
|
+
# # The returned object is of type Google::Apps::Chat::V1::Availability.
|
|
4671
|
+
# p result
|
|
4672
|
+
#
|
|
4673
|
+
def get_availability request, options = nil
|
|
4674
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
4675
|
+
|
|
4676
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::GetAvailabilityRequest
|
|
4677
|
+
|
|
4678
|
+
# Converts hash and nil to an options object
|
|
4679
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
4680
|
+
|
|
4681
|
+
# Customize the options with defaults
|
|
4682
|
+
call_metadata = @config.rpcs.get_availability.metadata.to_h
|
|
4683
|
+
|
|
4684
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
4685
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
4686
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
4687
|
+
gapic_version: ::Google::Apps::Chat::V1::VERSION,
|
|
4688
|
+
transports_version_send: [:rest]
|
|
4689
|
+
|
|
4690
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
4691
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
4692
|
+
|
|
4693
|
+
options.apply_defaults timeout: @config.rpcs.get_availability.timeout,
|
|
4694
|
+
metadata: call_metadata,
|
|
4695
|
+
retry_policy: @config.rpcs.get_availability.retry_policy
|
|
4696
|
+
|
|
4697
|
+
options.apply_defaults timeout: @config.timeout,
|
|
4698
|
+
metadata: @config.metadata,
|
|
4699
|
+
retry_policy: @config.retry_policy
|
|
4700
|
+
|
|
4701
|
+
@chat_service_stub.get_availability request, options do |result, operation|
|
|
4702
|
+
yield result, operation if block_given?
|
|
4703
|
+
end
|
|
4704
|
+
rescue ::Gapic::Rest::Error => e
|
|
4705
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
4706
|
+
end
|
|
4707
|
+
|
|
4708
|
+
##
|
|
4709
|
+
# Marks user as `ACTIVE` in Google Chat.
|
|
4710
|
+
#
|
|
4711
|
+
# Sets the user's availability state to `ACTIVE`. The `ACTIVE` state
|
|
4712
|
+
# lasts until the specified expiration, at which point the user's state
|
|
4713
|
+
# becomes `AWAY`. Note that if the user is actively using Chat, the `ACTIVE`
|
|
4714
|
+
# state duration may extend beyond the provided expiration.
|
|
4715
|
+
#
|
|
4716
|
+
# This method only updates the authenticated user's availability.
|
|
4717
|
+
#
|
|
4718
|
+
# Requires [user
|
|
4719
|
+
# authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
|
|
4720
|
+
# with [authorization
|
|
4721
|
+
# scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes):
|
|
4722
|
+
#
|
|
4723
|
+
# - `https://www.googleapis.com/auth/chat.users.availability`
|
|
4724
|
+
#
|
|
4725
|
+
# @overload mark_as_active(request, options = nil)
|
|
4726
|
+
# Pass arguments to `mark_as_active` via a request object, either of type
|
|
4727
|
+
# {::Google::Apps::Chat::V1::MarkAsActiveRequest} or an equivalent Hash.
|
|
4728
|
+
#
|
|
4729
|
+
# @param request [::Google::Apps::Chat::V1::MarkAsActiveRequest, ::Hash]
|
|
4730
|
+
# A request object representing the call parameters. Required. To specify no
|
|
4731
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
4732
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
4733
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
|
4734
|
+
#
|
|
4735
|
+
# @overload mark_as_active(name: nil, expire_time: nil, ttl: nil)
|
|
4736
|
+
# Pass arguments to `mark_as_active` via keyword arguments. Note that at
|
|
4737
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
4738
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
4739
|
+
#
|
|
4740
|
+
# @param name [::String]
|
|
4741
|
+
# Required. The resource name of the availability to mark as active.
|
|
4742
|
+
# Format: users/\\{user}/availability
|
|
4743
|
+
#
|
|
4744
|
+
# `{user}` is the id for the Person in the People API or Admin SDK directory
|
|
4745
|
+
# API. For example, `users/123456789`.
|
|
4746
|
+
#
|
|
4747
|
+
# The user's email address or `me` can also be used as an alias to refer to
|
|
4748
|
+
# the caller. For example, `users/user@example.com` or `users/me`.
|
|
4749
|
+
# @param expire_time [::Google::Protobuf::Timestamp, ::Hash]
|
|
4750
|
+
# The absolute timestamp when the ACTIVE state expires.
|
|
4751
|
+
#
|
|
4752
|
+
# 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.
|
|
4753
|
+
# @param ttl [::Google::Protobuf::Duration, ::Hash]
|
|
4754
|
+
# The duration from the current time until the ACTIVE state expires.
|
|
4755
|
+
# Using a short TTL can effectively reset the user's state to be based
|
|
4756
|
+
# on activity after this brief duration.
|
|
4757
|
+
#
|
|
4758
|
+
# 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.
|
|
4759
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
|
4760
|
+
# @yieldparam result [::Google::Apps::Chat::V1::Availability]
|
|
4761
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
|
4762
|
+
#
|
|
4763
|
+
# @return [::Google::Apps::Chat::V1::Availability]
|
|
4764
|
+
#
|
|
4765
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
|
4766
|
+
#
|
|
4767
|
+
# @example Basic example
|
|
4768
|
+
# require "google/apps/chat/v1"
|
|
4769
|
+
#
|
|
4770
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
4771
|
+
# client = Google::Apps::Chat::V1::ChatService::Rest::Client.new
|
|
4772
|
+
#
|
|
4773
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
4774
|
+
# request = Google::Apps::Chat::V1::MarkAsActiveRequest.new
|
|
4775
|
+
#
|
|
4776
|
+
# # Call the mark_as_active method.
|
|
4777
|
+
# result = client.mark_as_active request
|
|
4778
|
+
#
|
|
4779
|
+
# # The returned object is of type Google::Apps::Chat::V1::Availability.
|
|
4780
|
+
# p result
|
|
4781
|
+
#
|
|
4782
|
+
def mark_as_active request, options = nil
|
|
4783
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
4784
|
+
|
|
4785
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::MarkAsActiveRequest
|
|
4786
|
+
|
|
4787
|
+
# Converts hash and nil to an options object
|
|
4788
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
4789
|
+
|
|
4790
|
+
# Customize the options with defaults
|
|
4791
|
+
call_metadata = @config.rpcs.mark_as_active.metadata.to_h
|
|
4792
|
+
|
|
4793
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
4794
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
4795
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
4796
|
+
gapic_version: ::Google::Apps::Chat::V1::VERSION,
|
|
4797
|
+
transports_version_send: [:rest]
|
|
4798
|
+
|
|
4799
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
4800
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
4801
|
+
|
|
4802
|
+
options.apply_defaults timeout: @config.rpcs.mark_as_active.timeout,
|
|
4803
|
+
metadata: call_metadata,
|
|
4804
|
+
retry_policy: @config.rpcs.mark_as_active.retry_policy
|
|
4805
|
+
|
|
4806
|
+
options.apply_defaults timeout: @config.timeout,
|
|
4807
|
+
metadata: @config.metadata,
|
|
4808
|
+
retry_policy: @config.retry_policy
|
|
4809
|
+
|
|
4810
|
+
@chat_service_stub.mark_as_active request, options do |result, operation|
|
|
4811
|
+
yield result, operation if block_given?
|
|
4812
|
+
end
|
|
4813
|
+
rescue ::Gapic::Rest::Error => e
|
|
4814
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
4815
|
+
end
|
|
4816
|
+
|
|
4817
|
+
##
|
|
4818
|
+
# Marks user as `AWAY` in Google Chat.
|
|
4819
|
+
#
|
|
4820
|
+
# Sets the user's state to away and is not affected by the user's
|
|
4821
|
+
# activity.
|
|
4822
|
+
#
|
|
4823
|
+
# This method only updates the authenticated user's availability.
|
|
4824
|
+
#
|
|
4825
|
+
# Requires [user
|
|
4826
|
+
# authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
|
|
4827
|
+
# with [authorization
|
|
4828
|
+
# scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes):
|
|
4829
|
+
#
|
|
4830
|
+
# - `https://www.googleapis.com/auth/chat.users.availability`
|
|
4831
|
+
#
|
|
4832
|
+
# @overload mark_as_away(request, options = nil)
|
|
4833
|
+
# Pass arguments to `mark_as_away` via a request object, either of type
|
|
4834
|
+
# {::Google::Apps::Chat::V1::MarkAsAwayRequest} or an equivalent Hash.
|
|
4835
|
+
#
|
|
4836
|
+
# @param request [::Google::Apps::Chat::V1::MarkAsAwayRequest, ::Hash]
|
|
4837
|
+
# A request object representing the call parameters. Required. To specify no
|
|
4838
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
4839
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
4840
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
|
4841
|
+
#
|
|
4842
|
+
# @overload mark_as_away(name: nil)
|
|
4843
|
+
# Pass arguments to `mark_as_away` via keyword arguments. Note that at
|
|
4844
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
4845
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
4846
|
+
#
|
|
4847
|
+
# @param name [::String]
|
|
4848
|
+
# Required. The resource name of the availability to mark as away.
|
|
4849
|
+
# Format: users/\\{user}/availability
|
|
4850
|
+
#
|
|
4851
|
+
# `{user}` is the id for the Person in the People API or Admin SDK directory
|
|
4852
|
+
# API. For example, `users/123456789`.
|
|
4853
|
+
#
|
|
4854
|
+
# The user's email address or `me` can also be used as an alias to refer to
|
|
4855
|
+
# the caller. For example, `users/user@example.com` or `users/me`.
|
|
4856
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
|
4857
|
+
# @yieldparam result [::Google::Apps::Chat::V1::Availability]
|
|
4858
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
|
4859
|
+
#
|
|
4860
|
+
# @return [::Google::Apps::Chat::V1::Availability]
|
|
4861
|
+
#
|
|
4862
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
|
4863
|
+
#
|
|
4864
|
+
# @example Basic example
|
|
4865
|
+
# require "google/apps/chat/v1"
|
|
4866
|
+
#
|
|
4867
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
4868
|
+
# client = Google::Apps::Chat::V1::ChatService::Rest::Client.new
|
|
4869
|
+
#
|
|
4870
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
4871
|
+
# request = Google::Apps::Chat::V1::MarkAsAwayRequest.new
|
|
4872
|
+
#
|
|
4873
|
+
# # Call the mark_as_away method.
|
|
4874
|
+
# result = client.mark_as_away request
|
|
4875
|
+
#
|
|
4876
|
+
# # The returned object is of type Google::Apps::Chat::V1::Availability.
|
|
4877
|
+
# p result
|
|
4878
|
+
#
|
|
4879
|
+
def mark_as_away request, options = nil
|
|
4880
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
4881
|
+
|
|
4882
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::MarkAsAwayRequest
|
|
4883
|
+
|
|
4884
|
+
# Converts hash and nil to an options object
|
|
4885
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
4886
|
+
|
|
4887
|
+
# Customize the options with defaults
|
|
4888
|
+
call_metadata = @config.rpcs.mark_as_away.metadata.to_h
|
|
4889
|
+
|
|
4890
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
4891
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
4892
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
4893
|
+
gapic_version: ::Google::Apps::Chat::V1::VERSION,
|
|
4894
|
+
transports_version_send: [:rest]
|
|
4895
|
+
|
|
4896
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
4897
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
4898
|
+
|
|
4899
|
+
options.apply_defaults timeout: @config.rpcs.mark_as_away.timeout,
|
|
4900
|
+
metadata: call_metadata,
|
|
4901
|
+
retry_policy: @config.rpcs.mark_as_away.retry_policy
|
|
4902
|
+
|
|
4903
|
+
options.apply_defaults timeout: @config.timeout,
|
|
4904
|
+
metadata: @config.metadata,
|
|
4905
|
+
retry_policy: @config.retry_policy
|
|
4906
|
+
|
|
4907
|
+
@chat_service_stub.mark_as_away request, options do |result, operation|
|
|
4908
|
+
yield result, operation if block_given?
|
|
4909
|
+
end
|
|
4910
|
+
rescue ::Gapic::Rest::Error => e
|
|
4911
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
4912
|
+
end
|
|
4913
|
+
|
|
4914
|
+
##
|
|
4915
|
+
# Marks user as `DO_NOT_DISTURB` in Google Chat.
|
|
4916
|
+
#
|
|
4917
|
+
# Sets a user's availability state to `DO_NOT_DISTURB` until a specified
|
|
4918
|
+
# expiration time.
|
|
4919
|
+
# When in `DO_NOT_DISTURB`, users typically won't receive notifications.
|
|
4920
|
+
#
|
|
4921
|
+
# This method only updates the authenticated user's availability.
|
|
4922
|
+
#
|
|
4923
|
+
# Requires [user
|
|
4924
|
+
# authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
|
|
4925
|
+
# with [authorization
|
|
4926
|
+
# scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes):
|
|
4927
|
+
#
|
|
4928
|
+
# - `https://www.googleapis.com/auth/chat.users.availability`
|
|
4929
|
+
#
|
|
4930
|
+
# @overload mark_as_do_not_disturb(request, options = nil)
|
|
4931
|
+
# Pass arguments to `mark_as_do_not_disturb` via a request object, either of type
|
|
4932
|
+
# {::Google::Apps::Chat::V1::MarkAsDoNotDisturbRequest} or an equivalent Hash.
|
|
4933
|
+
#
|
|
4934
|
+
# @param request [::Google::Apps::Chat::V1::MarkAsDoNotDisturbRequest, ::Hash]
|
|
4935
|
+
# A request object representing the call parameters. Required. To specify no
|
|
4936
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
4937
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
4938
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
|
4939
|
+
#
|
|
4940
|
+
# @overload mark_as_do_not_disturb(name: nil, expire_time: nil, ttl: nil)
|
|
4941
|
+
# Pass arguments to `mark_as_do_not_disturb` via keyword arguments. Note that at
|
|
4942
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
4943
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
4944
|
+
#
|
|
4945
|
+
# @param name [::String]
|
|
4946
|
+
# Required. The resource name of the availability to mark as Do Not Disturb.
|
|
4947
|
+
# Format: users/\\{user}/availability
|
|
4948
|
+
#
|
|
4949
|
+
# `{user}` is the id for the Person in the People API or Admin SDK directory
|
|
4950
|
+
# API. For example, `users/123456789`.
|
|
4951
|
+
#
|
|
4952
|
+
# The user's email address or `me` can also be used as an alias to refer to
|
|
4953
|
+
# the caller. For example, `users/user@example.com` or `users/me`.
|
|
4954
|
+
# @param expire_time [::Google::Protobuf::Timestamp, ::Hash]
|
|
4955
|
+
# The absolute timestamp when the DND state expires.
|
|
4956
|
+
#
|
|
4957
|
+
# 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.
|
|
4958
|
+
# @param ttl [::Google::Protobuf::Duration, ::Hash]
|
|
4959
|
+
# The duration from the current time until the DND state expires.
|
|
4960
|
+
#
|
|
4961
|
+
# 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.
|
|
4962
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
|
4963
|
+
# @yieldparam result [::Google::Apps::Chat::V1::Availability]
|
|
4964
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
|
4965
|
+
#
|
|
4966
|
+
# @return [::Google::Apps::Chat::V1::Availability]
|
|
4967
|
+
#
|
|
4968
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
|
4969
|
+
#
|
|
4970
|
+
# @example Basic example
|
|
4971
|
+
# require "google/apps/chat/v1"
|
|
4972
|
+
#
|
|
4973
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
4974
|
+
# client = Google::Apps::Chat::V1::ChatService::Rest::Client.new
|
|
4975
|
+
#
|
|
4976
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
4977
|
+
# request = Google::Apps::Chat::V1::MarkAsDoNotDisturbRequest.new
|
|
4978
|
+
#
|
|
4979
|
+
# # Call the mark_as_do_not_disturb method.
|
|
4980
|
+
# result = client.mark_as_do_not_disturb request
|
|
4981
|
+
#
|
|
4982
|
+
# # The returned object is of type Google::Apps::Chat::V1::Availability.
|
|
4983
|
+
# p result
|
|
4984
|
+
#
|
|
4985
|
+
def mark_as_do_not_disturb request, options = nil
|
|
4986
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
4987
|
+
|
|
4988
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::MarkAsDoNotDisturbRequest
|
|
4989
|
+
|
|
4990
|
+
# Converts hash and nil to an options object
|
|
4991
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
4992
|
+
|
|
4993
|
+
# Customize the options with defaults
|
|
4994
|
+
call_metadata = @config.rpcs.mark_as_do_not_disturb.metadata.to_h
|
|
4995
|
+
|
|
4996
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
4997
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
4998
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
4999
|
+
gapic_version: ::Google::Apps::Chat::V1::VERSION,
|
|
5000
|
+
transports_version_send: [:rest]
|
|
5001
|
+
|
|
5002
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
5003
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
5004
|
+
|
|
5005
|
+
options.apply_defaults timeout: @config.rpcs.mark_as_do_not_disturb.timeout,
|
|
5006
|
+
metadata: call_metadata,
|
|
5007
|
+
retry_policy: @config.rpcs.mark_as_do_not_disturb.retry_policy
|
|
5008
|
+
|
|
5009
|
+
options.apply_defaults timeout: @config.timeout,
|
|
5010
|
+
metadata: @config.metadata,
|
|
5011
|
+
retry_policy: @config.retry_policy
|
|
5012
|
+
|
|
5013
|
+
@chat_service_stub.mark_as_do_not_disturb request, options do |result, operation|
|
|
5014
|
+
yield result, operation if block_given?
|
|
5015
|
+
end
|
|
5016
|
+
rescue ::Gapic::Rest::Error => e
|
|
5017
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
5018
|
+
end
|
|
5019
|
+
|
|
5020
|
+
##
|
|
5021
|
+
# Updates availability information for a human user. Only the `custom_status`
|
|
5022
|
+
# field can be updated through this method.
|
|
5023
|
+
#
|
|
5024
|
+
# This method only updates the authenticated user's availability.
|
|
5025
|
+
#
|
|
5026
|
+
# Requires [user
|
|
5027
|
+
# authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
|
|
5028
|
+
# with one of the following [authorization
|
|
5029
|
+
# scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes):
|
|
5030
|
+
#
|
|
5031
|
+
# - `https://www.googleapis.com/auth/chat.users.availability`
|
|
5032
|
+
#
|
|
5033
|
+
# @overload update_availability(request, options = nil)
|
|
5034
|
+
# Pass arguments to `update_availability` via a request object, either of type
|
|
5035
|
+
# {::Google::Apps::Chat::V1::UpdateAvailabilityRequest} or an equivalent Hash.
|
|
5036
|
+
#
|
|
5037
|
+
# @param request [::Google::Apps::Chat::V1::UpdateAvailabilityRequest, ::Hash]
|
|
5038
|
+
# A request object representing the call parameters. Required. To specify no
|
|
5039
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
5040
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
5041
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
|
5042
|
+
#
|
|
5043
|
+
# @overload update_availability(availability: nil, update_mask: nil)
|
|
5044
|
+
# Pass arguments to `update_availability` via keyword arguments. Note that at
|
|
5045
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
5046
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
5047
|
+
#
|
|
5048
|
+
# @param availability [::Google::Apps::Chat::V1::Availability, ::Hash]
|
|
5049
|
+
# Required. The availability to update.
|
|
5050
|
+
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
|
5051
|
+
# Required. The list of fields to update.
|
|
5052
|
+
# The only field that can be updated is `custom_status`.
|
|
5053
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
|
5054
|
+
# @yieldparam result [::Google::Apps::Chat::V1::Availability]
|
|
5055
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
|
5056
|
+
#
|
|
5057
|
+
# @return [::Google::Apps::Chat::V1::Availability]
|
|
5058
|
+
#
|
|
5059
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
|
5060
|
+
#
|
|
5061
|
+
# @example Basic example
|
|
5062
|
+
# require "google/apps/chat/v1"
|
|
5063
|
+
#
|
|
5064
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
5065
|
+
# client = Google::Apps::Chat::V1::ChatService::Rest::Client.new
|
|
5066
|
+
#
|
|
5067
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
5068
|
+
# request = Google::Apps::Chat::V1::UpdateAvailabilityRequest.new
|
|
5069
|
+
#
|
|
5070
|
+
# # Call the update_availability method.
|
|
5071
|
+
# result = client.update_availability request
|
|
5072
|
+
#
|
|
5073
|
+
# # The returned object is of type Google::Apps::Chat::V1::Availability.
|
|
5074
|
+
# p result
|
|
5075
|
+
#
|
|
5076
|
+
def update_availability request, options = nil
|
|
5077
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
5078
|
+
|
|
5079
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::UpdateAvailabilityRequest
|
|
5080
|
+
|
|
5081
|
+
# Converts hash and nil to an options object
|
|
5082
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
5083
|
+
|
|
5084
|
+
# Customize the options with defaults
|
|
5085
|
+
call_metadata = @config.rpcs.update_availability.metadata.to_h
|
|
5086
|
+
|
|
5087
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
5088
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
5089
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
5090
|
+
gapic_version: ::Google::Apps::Chat::V1::VERSION,
|
|
5091
|
+
transports_version_send: [:rest]
|
|
5092
|
+
|
|
5093
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
5094
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
5095
|
+
|
|
5096
|
+
options.apply_defaults timeout: @config.rpcs.update_availability.timeout,
|
|
5097
|
+
metadata: call_metadata,
|
|
5098
|
+
retry_policy: @config.rpcs.update_availability.retry_policy
|
|
5099
|
+
|
|
5100
|
+
options.apply_defaults timeout: @config.timeout,
|
|
5101
|
+
metadata: @config.metadata,
|
|
5102
|
+
retry_policy: @config.retry_policy
|
|
5103
|
+
|
|
5104
|
+
@chat_service_stub.update_availability request, options do |result, operation|
|
|
5105
|
+
yield result, operation if block_given?
|
|
5106
|
+
end
|
|
5107
|
+
rescue ::Gapic::Rest::Error => e
|
|
5108
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
5109
|
+
end
|
|
5110
|
+
|
|
4585
5111
|
##
|
|
4586
5112
|
# Returns an event from a Google Chat space. The [event
|
|
4587
5113
|
# payload](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.spaceEvents#SpaceEvent.FIELDS.oneof_payload)
|
|
@@ -6120,6 +6646,31 @@ module Google
|
|
|
6120
6646
|
#
|
|
6121
6647
|
attr_reader :get_thread_read_state
|
|
6122
6648
|
##
|
|
6649
|
+
# RPC-specific configuration for `get_availability`
|
|
6650
|
+
# @return [::Gapic::Config::Method]
|
|
6651
|
+
#
|
|
6652
|
+
attr_reader :get_availability
|
|
6653
|
+
##
|
|
6654
|
+
# RPC-specific configuration for `mark_as_active`
|
|
6655
|
+
# @return [::Gapic::Config::Method]
|
|
6656
|
+
#
|
|
6657
|
+
attr_reader :mark_as_active
|
|
6658
|
+
##
|
|
6659
|
+
# RPC-specific configuration for `mark_as_away`
|
|
6660
|
+
# @return [::Gapic::Config::Method]
|
|
6661
|
+
#
|
|
6662
|
+
attr_reader :mark_as_away
|
|
6663
|
+
##
|
|
6664
|
+
# RPC-specific configuration for `mark_as_do_not_disturb`
|
|
6665
|
+
# @return [::Gapic::Config::Method]
|
|
6666
|
+
#
|
|
6667
|
+
attr_reader :mark_as_do_not_disturb
|
|
6668
|
+
##
|
|
6669
|
+
# RPC-specific configuration for `update_availability`
|
|
6670
|
+
# @return [::Gapic::Config::Method]
|
|
6671
|
+
#
|
|
6672
|
+
attr_reader :update_availability
|
|
6673
|
+
##
|
|
6123
6674
|
# RPC-specific configuration for `get_space_event`
|
|
6124
6675
|
# @return [::Gapic::Config::Method]
|
|
6125
6676
|
#
|
|
@@ -6241,6 +6792,16 @@ module Google
|
|
|
6241
6792
|
@update_space_read_state = ::Gapic::Config::Method.new update_space_read_state_config
|
|
6242
6793
|
get_thread_read_state_config = parent_rpcs.get_thread_read_state if parent_rpcs.respond_to? :get_thread_read_state
|
|
6243
6794
|
@get_thread_read_state = ::Gapic::Config::Method.new get_thread_read_state_config
|
|
6795
|
+
get_availability_config = parent_rpcs.get_availability if parent_rpcs.respond_to? :get_availability
|
|
6796
|
+
@get_availability = ::Gapic::Config::Method.new get_availability_config
|
|
6797
|
+
mark_as_active_config = parent_rpcs.mark_as_active if parent_rpcs.respond_to? :mark_as_active
|
|
6798
|
+
@mark_as_active = ::Gapic::Config::Method.new mark_as_active_config
|
|
6799
|
+
mark_as_away_config = parent_rpcs.mark_as_away if parent_rpcs.respond_to? :mark_as_away
|
|
6800
|
+
@mark_as_away = ::Gapic::Config::Method.new mark_as_away_config
|
|
6801
|
+
mark_as_do_not_disturb_config = parent_rpcs.mark_as_do_not_disturb if parent_rpcs.respond_to? :mark_as_do_not_disturb
|
|
6802
|
+
@mark_as_do_not_disturb = ::Gapic::Config::Method.new mark_as_do_not_disturb_config
|
|
6803
|
+
update_availability_config = parent_rpcs.update_availability if parent_rpcs.respond_to? :update_availability
|
|
6804
|
+
@update_availability = ::Gapic::Config::Method.new update_availability_config
|
|
6244
6805
|
get_space_event_config = parent_rpcs.get_space_event if parent_rpcs.respond_to? :get_space_event
|
|
6245
6806
|
@get_space_event = ::Gapic::Config::Method.new get_space_event_config
|
|
6246
6807
|
list_space_events_config = parent_rpcs.list_space_events if parent_rpcs.respond_to? :list_space_events
|