Class: Google::Apps::Chat::V1::ChatService::Client
- Inherits:
-
Object
- Object
- Google::Apps::Chat::V1::ChatService::Client
- Includes:
- Paths
- Defined in:
- lib/google/apps/chat/v1/chat_service/client.rb
Overview
Client for the ChatService service.
Enables developers to build Chat apps and integrations on Google Chat Platform.
Defined Under Namespace
Classes: Configuration
Class Method Summary collapse
-
.configure {|config| ... } ⇒ Client::Configuration
Configure the ChatService Client class.
Instance Method Summary collapse
-
#complete_import_space(request, options = nil) {|response, operation| ... } ⇒ ::Google::Apps::Chat::V1::CompleteImportSpaceResponse
Completes the import process for the specified space and makes it visible to users.
-
#configure {|config| ... } ⇒ Client::Configuration
Configure the ChatService Client instance.
-
#create_custom_emoji(request, options = nil) {|response, operation| ... } ⇒ ::Google::Apps::Chat::V1::CustomEmoji
Creates a custom emoji.
-
#create_membership(request, options = nil) {|response, operation| ... } ⇒ ::Google::Apps::Chat::V1::Membership
Creates a membership for the calling Chat app, a user, or a Google Group.
-
#create_message(request, options = nil) {|response, operation| ... } ⇒ ::Google::Apps::Chat::V1::Message
Creates a message in a Google Chat space.
-
#create_reaction(request, options = nil) {|response, operation| ... } ⇒ ::Google::Apps::Chat::V1::Reaction
Creates a reaction and adds it to a message.
-
#create_space(request, options = nil) {|response, operation| ... } ⇒ ::Google::Apps::Chat::V1::Space
Creates a space.
-
#delete_custom_emoji(request, options = nil) {|response, operation| ... } ⇒ ::Google::Protobuf::Empty
Deletes a custom emoji.
-
#delete_membership(request, options = nil) {|response, operation| ... } ⇒ ::Google::Apps::Chat::V1::Membership
Deletes a membership.
-
#delete_message(request, options = nil) {|response, operation| ... } ⇒ ::Google::Protobuf::Empty
Deletes a message.
-
#delete_reaction(request, options = nil) {|response, operation| ... } ⇒ ::Google::Protobuf::Empty
Deletes a reaction to a message.
-
#delete_space(request, options = nil) {|response, operation| ... } ⇒ ::Google::Protobuf::Empty
Deletes a named space.
-
#find_direct_message(request, options = nil) {|response, operation| ... } ⇒ ::Google::Apps::Chat::V1::Space
Returns the existing direct message with the specified user.
-
#get_attachment(request, options = nil) {|response, operation| ... } ⇒ ::Google::Apps::Chat::V1::Attachment
Gets the metadata of a message attachment.
-
#get_custom_emoji(request, options = nil) {|response, operation| ... } ⇒ ::Google::Apps::Chat::V1::CustomEmoji
Returns details about a custom emoji.
-
#get_membership(request, options = nil) {|response, operation| ... } ⇒ ::Google::Apps::Chat::V1::Membership
Returns details about a membership.
-
#get_message(request, options = nil) {|response, operation| ... } ⇒ ::Google::Apps::Chat::V1::Message
Returns details about a message.
-
#get_space(request, options = nil) {|response, operation| ... } ⇒ ::Google::Apps::Chat::V1::Space
Returns details about a space.
-
#get_space_event(request, options = nil) {|response, operation| ... } ⇒ ::Google::Apps::Chat::V1::SpaceEvent
Returns an event from a Google Chat space.
-
#get_space_notification_setting(request, options = nil) {|response, operation| ... } ⇒ ::Google::Apps::Chat::V1::SpaceNotificationSetting
Gets the space notification setting.
-
#get_space_read_state(request, options = nil) {|response, operation| ... } ⇒ ::Google::Apps::Chat::V1::SpaceReadState
Returns details about a user's read state within a space, used to identify read and unread messages.
-
#get_thread_read_state(request, options = nil) {|response, operation| ... } ⇒ ::Google::Apps::Chat::V1::ThreadReadState
Returns details about a user's read state within a thread, used to identify read and unread messages.
-
#initialize {|config| ... } ⇒ Client
constructor
Create a new ChatService client object.
-
#list_custom_emojis(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::PagedEnumerable<::Google::Apps::Chat::V1::CustomEmoji>
Lists custom emojis visible to the authenticated user.
-
#list_memberships(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::PagedEnumerable<::Google::Apps::Chat::V1::Membership>
Lists memberships in a space.
-
#list_messages(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::PagedEnumerable<::Google::Apps::Chat::V1::Message>
Lists messages in a space that the caller is a member of, including messages from blocked members and spaces.
-
#list_reactions(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::PagedEnumerable<::Google::Apps::Chat::V1::Reaction>
Lists reactions to a message.
-
#list_space_events(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::PagedEnumerable<::Google::Apps::Chat::V1::SpaceEvent>
Lists events from a Google Chat space.
-
#list_spaces(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::PagedEnumerable<::Google::Apps::Chat::V1::Space>
Lists spaces the caller is a member of.
-
#logger ⇒ Logger
The logger used for request/response debug logging.
-
#search_spaces(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::PagedEnumerable<::Google::Apps::Chat::V1::Space>
Returns a list of spaces in a Google Workspace organization based on an administrator's search.
-
#set_up_space(request, options = nil) {|response, operation| ... } ⇒ ::Google::Apps::Chat::V1::Space
Creates a space and adds specified users to it.
-
#universe_domain ⇒ String
The effective universe domain.
-
#update_membership(request, options = nil) {|response, operation| ... } ⇒ ::Google::Apps::Chat::V1::Membership
Updates a membership.
-
#update_message(request, options = nil) {|response, operation| ... } ⇒ ::Google::Apps::Chat::V1::Message
Updates a message.
-
#update_space(request, options = nil) {|response, operation| ... } ⇒ ::Google::Apps::Chat::V1::Space
Updates a space.
-
#update_space_notification_setting(request, options = nil) {|response, operation| ... } ⇒ ::Google::Apps::Chat::V1::SpaceNotificationSetting
Updates the space notification setting.
-
#update_space_read_state(request, options = nil) {|response, operation| ... } ⇒ ::Google::Apps::Chat::V1::SpaceReadState
Updates a user's read state within a space, used to identify read and unread messages.
-
#upload_attachment(request, options = nil) {|response, operation| ... } ⇒ ::Google::Apps::Chat::V1::UploadAttachmentResponse
Uploads an attachment.
Methods included from Paths
#attachment_path, #custom_emoji_path, #membership_path, #message_path, #quoted_message_metadata_path, #reaction_path, #space_event_path, #space_notification_setting_path, #space_path, #space_read_state_path, #thread_path, #thread_read_state_path
Constructor Details
#initialize {|config| ... } ⇒ Client
Create a new ChatService client object.
300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 300 def initialize # These require statements are intentionally placed here to initialize # the gRPC module only when it's required. # See https://github.com/googleapis/toolkit/issues/446 require "gapic/grpc" require "google/chat/v1/chat_service_services_pb" # Create the configuration object @config = Configuration.new Client.configure # Yield the configuration if needed yield @config if block_given? # Create credentials credentials = @config.credentials # Use self-signed JWT if the endpoint is unchanged from default, # but only if the default endpoint does not have a region prefix. enable_self_signed_jwt = @config.endpoint.nil? || (@config.endpoint == Configuration::DEFAULT_ENDPOINT && !@config.endpoint.split(".").first.include?("-")) credentials ||= Credentials.default scope: @config.scope, enable_self_signed_jwt: enable_self_signed_jwt if credentials.is_a?(::String) || credentials.is_a?(::Hash) credentials = Credentials.new credentials, scope: @config.scope end @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id @chat_service_stub = ::Gapic::ServiceStub.new( ::Google::Apps::Chat::V1::ChatService::Stub, credentials: credentials, endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, channel_args: @config.channel_args, interceptors: @config.interceptors, channel_pool_config: @config.channel_pool, logger: @config.logger ) @chat_service_stub.stub_logger&.info do |entry| entry.set_system_name entry.set_service entry. = "Created client for #{entry.service}" entry.set_credentials_fields credentials entry.set "customEndpoint", @config.endpoint if @config.endpoint entry.set "defaultTimeout", @config.timeout if @config.timeout entry.set "quotaProject", @quota_project_id if @quota_project_id end end |
Class Method Details
.configure {|config| ... } ⇒ Client::Configuration
Configure the ChatService Client class.
See Configuration for a description of the configuration fields.
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 63 def self.configure @configure ||= begin namespace = ["Google", "Apps", "Chat", "V1"] parent_config = while namespace.any? parent_name = namespace.join "::" parent_const = const_get parent_name break parent_const.configure if parent_const.respond_to? :configure namespace.pop end default_config = Client::Configuration.new parent_config default_config.rpcs..timeout = 30.0 default_config.rpcs..retry_policy = { initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs..timeout = 30.0 default_config.rpcs..retry_policy = { initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs.list_memberships.timeout = 30.0 default_config.rpcs.list_memberships.retry_policy = { initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs.get_membership.timeout = 30.0 default_config.rpcs.get_membership.retry_policy = { initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs..timeout = 30.0 default_config.rpcs..retry_policy = { initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs..timeout = 30.0 default_config.rpcs..retry_policy = { initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs..timeout = 30.0 default_config.rpcs..retry_policy = { initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs..timeout = 30.0 default_config.rpcs..retry_policy = { initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs..timeout = 30.0 default_config.rpcs..retry_policy = { initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs.list_spaces.timeout = 30.0 default_config.rpcs.list_spaces.retry_policy = { initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs.search_spaces.timeout = 30.0 default_config.rpcs.search_spaces.retry_policy = { initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs.get_space.timeout = 30.0 default_config.rpcs.get_space.retry_policy = { initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs.create_space.timeout = 30.0 default_config.rpcs.create_space.retry_policy = { initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs.set_up_space.timeout = 30.0 default_config.rpcs.set_up_space.retry_policy = { initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs.update_space.timeout = 30.0 default_config.rpcs.update_space.retry_policy = { initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs.delete_space.timeout = 30.0 default_config.rpcs.delete_space.retry_policy = { initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs.complete_import_space.timeout = 30.0 default_config.rpcs.complete_import_space.retry_policy = { initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs..timeout = 30.0 default_config.rpcs..retry_policy = { initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs.create_membership.timeout = 30.0 default_config.rpcs.create_membership.retry_policy = { initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs.update_membership.timeout = 30.0 default_config.rpcs.update_membership.retry_policy = { initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs.delete_membership.timeout = 30.0 default_config.rpcs.delete_membership.retry_policy = { initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs.create_reaction.timeout = 30.0 default_config.rpcs.create_reaction.retry_policy = { initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs.list_reactions.timeout = 30.0 default_config.rpcs.list_reactions.retry_policy = { initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs.delete_reaction.timeout = 30.0 default_config.rpcs.delete_reaction.retry_policy = { initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs.create_custom_emoji.timeout = 30.0 default_config.rpcs.create_custom_emoji.retry_policy = { initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs.get_custom_emoji.timeout = 30.0 default_config.rpcs.get_custom_emoji.retry_policy = { initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs.list_custom_emojis.timeout = 30.0 default_config.rpcs.list_custom_emojis.retry_policy = { initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs.delete_custom_emoji.timeout = 30.0 default_config.rpcs.delete_custom_emoji.retry_policy = { initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs.get_space_read_state.timeout = 30.0 default_config.rpcs.get_space_read_state.retry_policy = { initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs.update_space_read_state.timeout = 30.0 default_config.rpcs.update_space_read_state.retry_policy = { initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs.get_thread_read_state.timeout = 30.0 default_config.rpcs.get_thread_read_state.retry_policy = { initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs.get_space_event.timeout = 30.0 default_config.rpcs.get_space_event.retry_policy = { initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs.list_space_events.timeout = 30.0 default_config.rpcs.list_space_events.retry_policy = { initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs.get_space_notification_setting.timeout = 30.0 default_config.rpcs.get_space_notification_setting.retry_policy = { initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs.update_space_notification_setting.timeout = 30.0 default_config.rpcs.update_space_notification_setting.retry_policy = { initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] } default_config end yield @configure if block_given? @configure end |
Instance Method Details
#complete_import_space(request, options = nil) ⇒ ::Google::Apps::Chat::V1::CompleteImportSpaceResponse #complete_import_space(name: nil) ⇒ ::Google::Apps::Chat::V1::CompleteImportSpaceResponse
Completes the import process for the specified space and makes it visible to users.
Requires user authentication and domain-wide delegation with the authorization scope:
https://www.googleapis.com/auth/chat.import
For more information, see Authorize Google Chat apps to import data.
2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 2824 def complete_import_space request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::CompleteImportSpaceRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.complete_import_space..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Apps::Chat::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.complete_import_space.timeout, metadata: , retry_policy: @config.rpcs.complete_import_space.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @chat_service_stub.call_rpc :complete_import_space, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#configure {|config| ... } ⇒ Client::Configuration
Configure the ChatService Client instance.
The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on configure.
See Configuration for a description of the configuration fields.
270 271 272 273 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 270 def configure yield @config if block_given? @config end |
#create_custom_emoji(request, options = nil) ⇒ ::Google::Apps::Chat::V1::CustomEmoji #create_custom_emoji(custom_emoji: nil) ⇒ ::Google::Apps::Chat::V1::CustomEmoji
Creates a custom emoji.
Custom emojis are only available for Google Workspace accounts, and the administrator must turn custom emojis on for the organization. For more information, see Learn about custom emojis in Google Chat and Manage custom emoji permissions.
Requires user authentication with the authorization scope:
https://www.googleapis.com/auth/chat.customemojis
3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 3854 def create_custom_emoji request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::CreateCustomEmojiRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.create_custom_emoji..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Apps::Chat::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.create_custom_emoji.timeout, metadata: , retry_policy: @config.rpcs.create_custom_emoji.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @chat_service_stub.call_rpc :create_custom_emoji, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#create_membership(request, options = nil) ⇒ ::Google::Apps::Chat::V1::Membership #create_membership(parent: nil, membership: nil, use_admin_access: nil) ⇒ ::Google::Apps::Chat::V1::Membership
Creates a membership for the calling Chat app, a user, or a Google Group. Creating memberships for other Chat apps isn't supported. When creating a membership, if the specified member has their auto-accept policy turned off, then they're invited, and must accept the space invitation before joining. Otherwise, creating a membership adds the member directly to the specified space.
Supports the following types of authentication:
App authentication with administrator approval and the authorization scope:
https://www.googleapis.com/auth/chat.app.memberships
User authentication with one of the following authorization scopes:
https://www.googleapis.com/auth/chat.membershipshttps://www.googleapis.com/auth/chat.memberships.app(to add the calling app to the space)https://www.googleapis.com/auth/chat.import(import mode spaces only)- User authentication grants administrator privileges when an
administrator account authenticates,
use_admin_accessistrue, and the following authorization scope is used:https://www.googleapis.com/auth/chat.admin.memberships
App authentication is not supported for the following use cases:
- Inviting users external to the Workspace organization that owns the space.
- Adding a Google Group to a space.
- Adding a Chat app to a space.
For example usage, see:
3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 3121 def create_membership request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::CreateMembershipRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.create_membership..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Apps::Chat::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.create_membership.timeout, metadata: , retry_policy: @config.rpcs.create_membership.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @chat_service_stub.call_rpc :create_membership, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#create_message(request, options = nil) ⇒ ::Google::Apps::Chat::V1::Message #create_message(parent: nil, message: nil, thread_key: nil, request_id: nil, message_reply_option: nil, message_id: nil) ⇒ ::Google::Apps::Chat::V1::Message
Creates a message in a Google Chat space. For an example, see Send a message.
Supports the following types of authentication:
- App
authentication
with the authorization scope:
https://www.googleapis.com/auth/chat.bot
- User
authentication
with one of the following authorization scopes:
https://www.googleapis.com/auth/chat.messages.createhttps://www.googleapis.com/auth/chat.messageshttps://www.googleapis.com/auth/chat.import(import mode spaces only)
Chat attributes the message sender differently depending on the type of authentication that you use in your request.
The following image shows how Chat attributes a message when you use app
authentication. Chat displays the Chat app as the message
sender. The content of the message can contain text (text), cards
(cardsV2), and accessory widgets (accessoryWidgets).
The following image shows how Chat attributes a message when you use user
authentication. Chat displays the user as the message sender and attributes
the Chat app to the message by displaying its name. The content of message
can only contain text (text).
The maximum message size, including the message contents, is 32,000 bytes.
For
webhook
requests, the response doesn't contain the full message. The response only
populates the name and thread.name fields in addition to the
information that was in the request.
490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 490 def request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::CreateMessageRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs...to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Apps::Chat::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs..timeout, metadata: , retry_policy: @config.rpcs..retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @chat_service_stub.call_rpc :create_message, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#create_reaction(request, options = nil) ⇒ ::Google::Apps::Chat::V1::Reaction #create_reaction(parent: nil, reaction: nil) ⇒ ::Google::Apps::Chat::V1::Reaction
Creates a reaction and adds it to a message. For an example, see Add a reaction to a message.
Requires user authentication with one of the following authorization scopes:
https://www.googleapis.com/auth/chat.messages.reactions.createhttps://www.googleapis.com/auth/chat.messages.reactionshttps://www.googleapis.com/auth/chat.messageshttps://www.googleapis.com/auth/chat.import(import mode spaces only)
3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 3496 def create_reaction request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::CreateReactionRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.create_reaction..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Apps::Chat::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.create_reaction.timeout, metadata: , retry_policy: @config.rpcs.create_reaction.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @chat_service_stub.call_rpc :create_reaction, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#create_space(request, options = nil) ⇒ ::Google::Apps::Chat::V1::Space #create_space(space: nil, request_id: nil) ⇒ ::Google::Apps::Chat::V1::Space
Creates a space. Can be used to create a named space, or a
group chat in Import mode. For an example, see Create a
space.
Supports the following types of authentication:
App authentication with administrator approval and one of the following authorization scopes:
https://www.googleapis.com/auth/chat.app.spaces.createhttps://www.googleapis.com/auth/chat.app.spaces
User authentication with one of the following authorization scopes:
https://www.googleapis.com/auth/chat.spaces.createhttps://www.googleapis.com/auth/chat.spaceshttps://www.googleapis.com/auth/chat.import(import mode spaces only)
When authenticating as an app, the space.customer field must be set in
the request.
When authenticating as an app, the Chat app is added as a member of the
space. However, unlike human authentication, the Chat app is not added as a
space manager. By default, the Chat app can be removed from the space by
all space members. To allow only space managers to remove the app from a
space, set space.permission_settings.manage_apps to managers_allowed.
Space membership upon creation depends on whether the space is created in
Import mode:
- Import mode: No members are created.
- All other modes: The calling user is added as a member. This is:
- The app itself when using app authentication.
- The human user when using user authentication.
If you receive the error message ALREADY_EXISTS when creating
a space, try a different displayName. An existing space within
the Google Workspace organization might already use this display name.
2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 2221 def create_space request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::CreateSpaceRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.create_space..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Apps::Chat::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.create_space.timeout, metadata: , retry_policy: @config.rpcs.create_space.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @chat_service_stub.call_rpc :create_space, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#delete_custom_emoji(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_custom_emoji(name: nil) ⇒ ::Google::Protobuf::Empty
Deletes a custom emoji. By default, users can only delete custom emoji they created. Emoji managers assigned by the administrator can delete any custom emoji in the organization. See Learn about custom emojis in Google Chat.
Custom emojis are only available for Google Workspace accounts, and the administrator must turn custom emojis on for the organization. For more information, see Learn about custom emojis in Google Chat and Manage custom emoji permissions.
Requires user authentication with the authorization scope:
https://www.googleapis.com/auth/chat.customemojis
4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 4185 def delete_custom_emoji request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::DeleteCustomEmojiRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.delete_custom_emoji..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Apps::Chat::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.delete_custom_emoji.timeout, metadata: , retry_policy: @config.rpcs.delete_custom_emoji.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @chat_service_stub.call_rpc :delete_custom_emoji, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#delete_membership(request, options = nil) ⇒ ::Google::Apps::Chat::V1::Membership #delete_membership(name: nil, use_admin_access: nil) ⇒ ::Google::Apps::Chat::V1::Membership
Deletes a membership. For an example, see Remove a user or a Google Chat app from a space.
Supports the following types of authentication:
App authentication with administrator approval and the authorization scope:
https://www.googleapis.com/auth/chat.app.memberships
User authentication with one of the following authorization scopes:
https://www.googleapis.com/auth/chat.membershipshttps://www.googleapis.com/auth/chat.memberships.app(to remove the calling app from the space)https://www.googleapis.com/auth/chat.import(import mode spaces only)- User authentication grants administrator privileges when an
administrator account authenticates,
use_admin_accessistrue, and the following authorization scope is used:https://www.googleapis.com/auth/chat.admin.memberships
App authentication is not supported for the following use cases:
- Removing a Google Group from a space.
- Removing a Chat app from a space.
To delete memberships for space managers, the requester must be a space manager. If you're using app authentication the Chat app must be the space creator.
3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 3395 def delete_membership request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::DeleteMembershipRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.delete_membership..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Apps::Chat::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.delete_membership.timeout, metadata: , retry_policy: @config.rpcs.delete_membership.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @chat_service_stub.call_rpc :delete_membership, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#delete_message(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_message(name: nil, force: nil) ⇒ ::Google::Protobuf::Empty
Deletes a message. For an example, see Delete a message.
Supports the following types of authentication:
App authentication with the authorization scope:
https://www.googleapis.com/auth/chat.bot
User authentication with one of the following authorization scopes:
https://www.googleapis.com/auth/chat.messageshttps://www.googleapis.com/auth/chat.import(import mode spaces only)
When using app authentication, requests can only delete messages created by the calling Chat app.
1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 1395 def request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::DeleteMessageRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs...to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Apps::Chat::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs..timeout, metadata: , retry_policy: @config.rpcs..retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @chat_service_stub.call_rpc :delete_message, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#delete_reaction(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_reaction(name: nil) ⇒ ::Google::Protobuf::Empty
Deletes a reaction to a message. For an example, see Delete a reaction.
Requires user authentication with one of the following authorization scopes:
https://www.googleapis.com/auth/chat.messages.reactionshttps://www.googleapis.com/auth/chat.messageshttps://www.googleapis.com/auth/chat.import(import mode spaces only)
3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 3755 def delete_reaction request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::DeleteReactionRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.delete_reaction..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Apps::Chat::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.delete_reaction.timeout, metadata: , retry_policy: @config.rpcs.delete_reaction.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @chat_service_stub.call_rpc :delete_reaction, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#delete_space(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_space(name: nil, use_admin_access: nil) ⇒ ::Google::Protobuf::Empty
Deletes a named space. Always performs a cascading delete, which means that the space's child resources—like messages posted in the space and memberships in the space—are also deleted. For an example, see Delete a space.
Supports the following types of authentication:
App authentication with administrator approval and the authorization scope:
https://www.googleapis.com/auth/chat.app.delete(only in spaces the app created)
User authentication with one of the following authorization scopes:
https://www.googleapis.com/auth/chat.deletehttps://www.googleapis.com/auth/chat.import(import mode spaces only)- User authentication grants administrator privileges when an
administrator account authenticates,
use_admin_accessistrue, and the following authorization scope is used:https://www.googleapis.com/auth/chat.admin.delete
2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 2724 def delete_space request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::DeleteSpaceRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.delete_space..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Apps::Chat::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.delete_space.timeout, metadata: , retry_policy: @config.rpcs.delete_space.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @chat_service_stub.call_rpc :delete_space, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#find_direct_message(request, options = nil) ⇒ ::Google::Apps::Chat::V1::Space #find_direct_message(name: nil) ⇒ ::Google::Apps::Chat::V1::Space
Returns the existing direct message with the specified user. If no direct
message space is found, returns a 404 NOT_FOUND error. For an example,
see
Find a direct message.
With app authentication, returns the direct message space between the specified user and the calling Chat app.
With user authentication, returns the direct message space between the specified user and the authenticated user.
Supports the following types of authentication:
App authentication with the authorization scope:
https://www.googleapis.com/auth/chat.bot
User authentication with one of the following authorization scopes:
https://www.googleapis.com/auth/chat.spaces.readonlyhttps://www.googleapis.com/auth/chat.spaces
2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 2948 def request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::FindDirectMessageRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs...to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Apps::Chat::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs..timeout, metadata: , retry_policy: @config.rpcs..retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @chat_service_stub.call_rpc :find_direct_message, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#get_attachment(request, options = nil) ⇒ ::Google::Apps::Chat::V1::Attachment #get_attachment(name: nil) ⇒ ::Google::Apps::Chat::V1::Attachment
Gets the metadata of a message attachment. The attachment data is fetched using the media API. For an example, see Get metadata about a message attachment.
Requires app authentication with the authorization scope:
https://www.googleapis.com/auth/chat.bot
1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 1493 def request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::GetAttachmentRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs...to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Apps::Chat::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs..timeout, metadata: , retry_policy: @config.rpcs..retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @chat_service_stub.call_rpc :get_attachment, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#get_custom_emoji(request, options = nil) ⇒ ::Google::Apps::Chat::V1::CustomEmoji #get_custom_emoji(name: nil) ⇒ ::Google::Apps::Chat::V1::CustomEmoji
Returns details about a custom emoji.
Custom emojis are only available for Google Workspace accounts, and the administrator must turn custom emojis on for the organization. For more information, see Learn about custom emojis in Google Chat and Manage custom emoji permissions.
Requires user authentication with one of the following authorization scopes:
https://www.googleapis.com/auth/chat.customemojis.readonlyhttps://www.googleapis.com/auth/chat.customemojis
3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 3952 def get_custom_emoji request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::GetCustomEmojiRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.get_custom_emoji..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Apps::Chat::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.get_custom_emoji.timeout, metadata: , retry_policy: @config.rpcs.get_custom_emoji.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @chat_service_stub.call_rpc :get_custom_emoji, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#get_membership(request, options = nil) ⇒ ::Google::Apps::Chat::V1::Membership #get_membership(name: nil, use_admin_access: nil) ⇒ ::Google::Apps::Chat::V1::Membership
Returns details about a membership. For an example, see Get details about a user's or Google Chat app's membership.
Supports the following types of authentication:
App authentication with one of the following authorization scopes:
https://www.googleapis.com/auth/chat.bothttps://www.googleapis.com/auth/chat.app.memberships(requires administrator approval)
User authentication with one of the following authorization scopes:
https://www.googleapis.com/auth/chat.memberships.readonlyhttps://www.googleapis.com/auth/chat.memberships- User authentication grants administrator privileges when an
administrator account authenticates,
use_admin_accessistrue, and one of the following authorization scopes is used:https://www.googleapis.com/auth/chat.admin.memberships.readonlyhttps://www.googleapis.com/auth/chat.admin.memberships
1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 1022 def get_membership request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::GetMembershipRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.get_membership..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Apps::Chat::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.get_membership.timeout, metadata: , retry_policy: @config.rpcs.get_membership.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @chat_service_stub.call_rpc :get_membership, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#get_message(request, options = nil) ⇒ ::Google::Apps::Chat::V1::Message #get_message(name: nil) ⇒ ::Google::Apps::Chat::V1::Message
Returns details about a message. For an example, see Get details about a message.
Supports the following types of authentication:
App authentication with one of the following authorization scopes:
https://www.googleapis.com/auth/chat.bot: When using this authorization scope, this method returns details about a message the Chat app has access to, like direct messages and slash commands that invoke the Chat app.https://www.googleapis.com/auth/chat.app.messages.readonlywith administrator approval (available in Developer Preview). When using this authentication scope, this method returns details about a public message in a space.
User authentication with one of the following authorization scopes:
https://www.googleapis.com/auth/chat.messages.readonlyhttps://www.googleapis.com/auth/chat.messages
Note: Might return a message from a blocked member or space.
1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 1142 def request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::GetMessageRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs...to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Apps::Chat::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs..timeout, metadata: , retry_policy: @config.rpcs..retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @chat_service_stub.call_rpc :get_message, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#get_space(request, options = nil) ⇒ ::Google::Apps::Chat::V1::Space #get_space(name: nil, use_admin_access: nil) ⇒ ::Google::Apps::Chat::V1::Space
Returns details about a space. For an example, see Get details about a space.
Supports the following types of authentication:
App authentication with one of the following authorization scopes:
https://www.googleapis.com/auth/chat.bothttps://www.googleapis.com/auth/chat.app.spaceswith administrator approval
User authentication with one of the following authorization scopes:
https://www.googleapis.com/auth/chat.spaces.readonlyhttps://www.googleapis.com/auth/chat.spaces- User authentication grants administrator privileges when an
administrator account authenticates,
use_admin_accessistrue, and one of the following authorization scopes is used:https://www.googleapis.com/auth/chat.admin.spaces.readonlyhttps://www.googleapis.com/auth/chat.admin.spaces
App authentication has the following limitations:
space.access_settingsis only populated when using thechat.app.spacesscope.space.predefind_permission_settingsandspace.permission_settingsare only populated when using thechat.app.spacesscope, and only for spaces the app created.
2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 2078 def get_space request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::GetSpaceRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.get_space..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Apps::Chat::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.get_space.timeout, metadata: , retry_policy: @config.rpcs.get_space.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @chat_service_stub.call_rpc :get_space, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#get_space_event(request, options = nil) ⇒ ::Google::Apps::Chat::V1::SpaceEvent #get_space_event(name: nil) ⇒ ::Google::Apps::Chat::V1::SpaceEvent
Returns an event from a Google Chat space. The event
payload
contains the most recent version of the resource that changed. For example,
if you request an event about a new message but the message was later
updated, the server returns the updated Message resource in the event
payload.
Note: The permissionSettings field is not returned in the Space
object of the Space event data for this request.
Supports the following types of authentication with an authorization scope appropriate for reading the requested data:
App authentication with administrator approval in Developer Preview with one of the following authorization scopes:
https://www.googleapis.com/auth/chat.app.spaceshttps://www.googleapis.com/auth/chat.app.messages.readonlyhttps://www.googleapis.com/auth/chat.app.memberships
User authentication with one of the following authorization scopes:
https://www.googleapis.com/auth/chat.spaces.readonlyhttps://www.googleapis.com/auth/chat.spaceshttps://www.googleapis.com/auth/chat.messages.readonlyhttps://www.googleapis.com/auth/chat.messageshttps://www.googleapis.com/auth/chat.messages.reactions.readonlyhttps://www.googleapis.com/auth/chat.messages.reactionshttps://www.googleapis.com/auth/chat.memberships.readonlyhttps://www.googleapis.com/auth/chat.memberships
To get an event, the authenticated caller must be a member of the space.
For an example, see Get details about an event from a Google Chat space.
4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 4658 def get_space_event request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::GetSpaceEventRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.get_space_event..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Apps::Chat::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.get_space_event.timeout, metadata: , retry_policy: @config.rpcs.get_space_event.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @chat_service_stub.call_rpc :get_space_event, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#get_space_notification_setting(request, options = nil) ⇒ ::Google::Apps::Chat::V1::SpaceNotificationSetting #get_space_notification_setting(name: nil) ⇒ ::Google::Apps::Chat::V1::SpaceNotificationSetting
Gets the space notification setting. For an example, see Get the caller's space notification setting.
Requires user authentication with the authorization scope:
https://www.googleapis.com/auth/chat.users.spacesettings
4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 4957 def get_space_notification_setting request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::GetSpaceNotificationSettingRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.get_space_notification_setting..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Apps::Chat::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.get_space_notification_setting.timeout, metadata: , retry_policy: @config.rpcs.get_space_notification_setting.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @chat_service_stub.call_rpc :get_space_notification_setting, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#get_space_read_state(request, options = nil) ⇒ ::Google::Apps::Chat::V1::SpaceReadState #get_space_read_state(name: nil) ⇒ ::Google::Apps::Chat::V1::SpaceReadState
Returns details about a user's read state within a space, used to identify read and unread messages. For an example, see Get details about a user's space read state.
Requires user authentication with one of the following authorization scopes:
https://www.googleapis.com/auth/chat.users.readstate.readonlyhttps://www.googleapis.com/auth/chat.users.readstate
4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 4295 def get_space_read_state request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::GetSpaceReadStateRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.get_space_read_state..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Apps::Chat::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.get_space_read_state.timeout, metadata: , retry_policy: @config.rpcs.get_space_read_state.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @chat_service_stub.call_rpc :get_space_read_state, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#get_thread_read_state(request, options = nil) ⇒ ::Google::Apps::Chat::V1::ThreadReadState #get_thread_read_state(name: nil) ⇒ ::Google::Apps::Chat::V1::ThreadReadState
Returns details about a user's read state within a thread, used to identify read and unread messages. For an example, see Get details about a user's thread read state.
Requires user authentication with one of the following authorization scopes:
https://www.googleapis.com/auth/chat.users.readstate.readonlyhttps://www.googleapis.com/auth/chat.users.readstate
4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 4528 def get_thread_read_state request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::GetThreadReadStateRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.get_thread_read_state..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Apps::Chat::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.get_thread_read_state.timeout, metadata: , retry_policy: @config.rpcs.get_thread_read_state.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @chat_service_stub.call_rpc :get_thread_read_state, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#list_custom_emojis(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Apps::Chat::V1::CustomEmoji> #list_custom_emojis(page_size: nil, page_token: nil, filter: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Apps::Chat::V1::CustomEmoji>
Lists custom emojis visible to the authenticated user.
Custom emojis are only available for Google Workspace accounts, and the administrator must turn custom emojis on for the organization. For more information, see Learn about custom emojis in Google Chat and Manage custom emoji permissions.
Requires user authentication with one of the following authorization scopes:
https://www.googleapis.com/auth/chat.customemojis.readonlyhttps://www.googleapis.com/auth/chat.customemojis
4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 4082 def list_custom_emojis request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::ListCustomEmojisRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.list_custom_emojis..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Apps::Chat::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.list_custom_emojis.timeout, metadata: , retry_policy: @config.rpcs.list_custom_emojis.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @chat_service_stub.call_rpc :list_custom_emojis, request, options: do |response, operation| response = ::Gapic::PagedEnumerable.new @chat_service_stub, :list_custom_emojis, request, response, operation, yield response, operation if block_given? throw :response, response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#list_memberships(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Apps::Chat::V1::Membership> #list_memberships(parent: nil, page_size: nil, page_token: nil, filter: nil, show_groups: nil, show_invited: nil, use_admin_access: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Apps::Chat::V1::Membership>
Lists memberships in a space. For an example, see List users and Google Chat apps in a space. Listing memberships with app authentication lists memberships in spaces that the Chat app has access to, but excludes Chat app memberships, including its own. Listing memberships with User authentication lists memberships in spaces that the authenticated user has access to.
Supports the following types of authentication:
App authentication with one of the following authorization scopes:
https://www.googleapis.com/auth/chat.bothttps://www.googleapis.com/auth/chat.app.memberships(requires administrator approval)
User authentication with one of the following authorization scopes:
https://www.googleapis.com/auth/chat.memberships.readonlyhttps://www.googleapis.com/auth/chat.membershipshttps://www.googleapis.com/auth/chat.import(import mode spaces only)- User authentication grants administrator privileges when an
administrator account authenticates,
use_admin_accessistrue, and one of the following authorization scopes is used:https://www.googleapis.com/auth/chat.admin.memberships.readonlyhttps://www.googleapis.com/auth/chat.admin.memberships
889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 889 def list_memberships request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::ListMembershipsRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.list_memberships..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Apps::Chat::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.list_memberships.timeout, metadata: , retry_policy: @config.rpcs.list_memberships.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @chat_service_stub.call_rpc :list_memberships, request, options: do |response, operation| response = ::Gapic::PagedEnumerable.new @chat_service_stub, :list_memberships, request, response, operation, yield response, operation if block_given? throw :response, response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#list_messages(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Apps::Chat::V1::Message> #list_messages(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil, show_deleted: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Apps::Chat::V1::Message>
Lists messages in a space that the caller is a member of, including
messages from blocked members and spaces. System messages, like those
announcing new space members, aren't included. If you list messages from a
space with no messages, the response is an empty object. When using a
REST/HTTP interface, the response contains an empty JSON object, {}.
For an example, see
List
messages.
Supports the following types of authentication:
App authentication with administrator approval in Developer Preview with the authorization scope:
https://www.googleapis.com/auth/chat.app.messages.readonly. When using this authentication scope, this method only returns public messages in a space. It doesn't include private messages.
User authentication with one of the following authorization scopes:
https://www.googleapis.com/auth/chat.messages.readonlyhttps://www.googleapis.com/auth/chat.messageshttps://www.googleapis.com/auth/chat.import(import mode spaces only)
677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 677 def request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::ListMessagesRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs...to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Apps::Chat::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs..timeout, metadata: , retry_policy: @config.rpcs..retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @chat_service_stub.call_rpc :list_messages, request, options: do |response, operation| response = ::Gapic::PagedEnumerable.new @chat_service_stub, :list_messages, request, response, operation, yield response, operation if block_given? throw :response, response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#list_reactions(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Apps::Chat::V1::Reaction> #list_reactions(parent: nil, page_size: nil, page_token: nil, filter: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Apps::Chat::V1::Reaction>
Lists reactions to a message. For an example, see List reactions for a message.
Requires user authentication with one of the following authorization scopes:
https://www.googleapis.com/auth/chat.messages.reactions.readonlyhttps://www.googleapis.com/auth/chat.messages.reactionshttps://www.googleapis.com/auth/chat.messages.readonlyhttps://www.googleapis.com/auth/chat.messages
3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 3655 def list_reactions request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::ListReactionsRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.list_reactions..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Apps::Chat::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.list_reactions.timeout, metadata: , retry_policy: @config.rpcs.list_reactions.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @chat_service_stub.call_rpc :list_reactions, request, options: do |response, operation| response = ::Gapic::PagedEnumerable.new @chat_service_stub, :list_reactions, request, response, operation, yield response, operation if block_given? throw :response, response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#list_space_events(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Apps::Chat::V1::SpaceEvent> #list_space_events(parent: nil, page_size: nil, page_token: nil, filter: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Apps::Chat::V1::SpaceEvent>
Lists events from a Google Chat space. For each event, the
payload
contains the most recent version of the Chat resource. For example, if you
list events about new space members, the server returns Membership
resources that contain the latest membership details. If new members were
removed during the requested period, the event payload contains an empty
Membership resource.
Supports the following types of authentication with an authorization scope appropriate for reading the requested data:
App authentication with administrator approval in Developer Preview with one of the following authorization scopes:
https://www.googleapis.com/auth/chat.app.spaceshttps://www.googleapis.com/auth/chat.app.messages.readonlyhttps://www.googleapis.com/auth/chat.app.memberships
User authentication with one of the following authorization scopes:
https://www.googleapis.com/auth/chat.spaces.readonlyhttps://www.googleapis.com/auth/chat.spaceshttps://www.googleapis.com/auth/chat.messages.readonlyhttps://www.googleapis.com/auth/chat.messageshttps://www.googleapis.com/auth/chat.messages.reactions.readonlyhttps://www.googleapis.com/auth/chat.messages.reactionshttps://www.googleapis.com/auth/chat.memberships.readonlyhttps://www.googleapis.com/auth/chat.memberships
To list events, the authenticated caller must be a member of the space.
For an example, see List events from a Google Chat space.
4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 4856 def list_space_events request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::ListSpaceEventsRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.list_space_events..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Apps::Chat::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.list_space_events.timeout, metadata: , retry_policy: @config.rpcs.list_space_events.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @chat_service_stub.call_rpc :list_space_events, request, options: do |response, operation| response = ::Gapic::PagedEnumerable.new @chat_service_stub, :list_space_events, request, response, operation, yield response, operation if block_given? throw :response, response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#list_spaces(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Apps::Chat::V1::Space> #list_spaces(page_size: nil, page_token: nil, filter: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Apps::Chat::V1::Space>
Lists spaces the caller is a member of. Group chats and DMs aren't listed until the first message is sent. For an example, see List spaces.
Supports the following types of authentication:
App authentication with the authorization scope:
https://www.googleapis.com/auth/chat.bot
User authentication with one of the following authorization scopes:
https://www.googleapis.com/auth/chat.spaces.readonlyhttps://www.googleapis.com/auth/chat.spaces
To list all named spaces by Google Workspace organization, use the
spaces.search()
method using Workspace administrator privileges instead.
1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 1740 def list_spaces request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::ListSpacesRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.list_spaces..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Apps::Chat::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.list_spaces.timeout, metadata: , retry_policy: @config.rpcs.list_spaces.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @chat_service_stub.call_rpc :list_spaces, request, options: do |response, operation| response = ::Gapic::PagedEnumerable.new @chat_service_stub, :list_spaces, request, response, operation, yield response, operation if block_given? throw :response, response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#logger ⇒ Logger
The logger used for request/response debug logging.
356 357 358 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 356 def logger @chat_service_stub.logger end |
#search_spaces(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Apps::Chat::V1::Space> #search_spaces(use_admin_access: nil, page_size: nil, page_token: nil, query: nil, order_by: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Apps::Chat::V1::Space>
Returns a list of spaces in a Google Workspace organization based on an
administrator's search. In the request, set use_admin_access to true.
For an example, see Search for and manage
spaces.
Requires user authentication with administrator privileges and one of the following authorization scopes:
https://www.googleapis.com/auth/chat.admin.spaces.readonlyhttps://www.googleapis.com/auth/chat.admin.spaces
1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 1956 def search_spaces request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::SearchSpacesRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.search_spaces..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Apps::Chat::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.search_spaces.timeout, metadata: , retry_policy: @config.rpcs.search_spaces.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @chat_service_stub.call_rpc :search_spaces, request, options: do |response, operation| response = ::Gapic::PagedEnumerable.new @chat_service_stub, :search_spaces, request, response, operation, yield response, operation if block_given? throw :response, response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#set_up_space(request, options = nil) ⇒ ::Google::Apps::Chat::V1::Space #set_up_space(space: nil, request_id: nil, memberships: nil) ⇒ ::Google::Apps::Chat::V1::Space
Creates a space and adds specified users to it. The calling user is automatically added to the space, and shouldn't be specified as a membership in the request. For an example, see Set up a space with initial members.
To specify the human members to add, add memberships with the appropriate
membership.member.name. To add a human user, use users/{user}, where
{user} can be the email address for the user. For users in the same
Workspace organization {user} can also be the id for the person from
the People API, or the id for the user in the Directory API. For example,
if the People API Person profile ID for [email protected] is 123456789,
you can add the user to the space by setting the membership.member.name
to users/[email protected] or users/123456789.
To specify the Google groups to add, add memberships with the
appropriate membership.group_member.name. To add or invite a Google
group, use groups/{group}, where {group} is the id for the group from
the Cloud Identity Groups API. For example, you can use Cloud Identity
Groups lookup
API
to retrieve the ID 123456789 for group email [email protected], then
you can add the group to the space by setting the
membership.group_member.name to groups/123456789. Group email is not
supported, and Google groups can only be added as members in named spaces.
For a named space or group chat, if the caller blocks, or is blocked by some members, or doesn't have permission to add some members, then those members aren't added to the created space.
To create a direct message (DM) between the calling user and another human user, specify exactly one membership to represent the human user. If one user blocks the other, the request fails and the DM isn't created.
To create a DM between the calling user and the calling app, set
Space.singleUserBotDm to true and don't specify any memberships. You
can only use this method to set up a DM with the calling app. To add the
calling app as a member of a space or an existing DM between two human
users, see
Invite or add a user or app to a
space.
If a DM already exists between two users, even when one user blocks the other at the time a request is made, then the existing DM is returned.
Spaces with threaded replies aren't supported. If you receive the error
message ALREADY_EXISTS when setting up a space, try a different
displayName. An existing space within the Google Workspace organization
might already use this display name.
Requires user authentication with one of the following authorization scopes:
https://www.googleapis.com/auth/chat.spaces.createhttps://www.googleapis.com/auth/chat.spaces
2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 2413 def set_up_space request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::SetUpSpaceRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.set_up_space..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Apps::Chat::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.set_up_space.timeout, metadata: , retry_policy: @config.rpcs.set_up_space.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @chat_service_stub.call_rpc :set_up_space, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#universe_domain ⇒ String
The effective universe domain
280 281 282 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 280 def universe_domain @chat_service_stub.universe_domain end |
#update_membership(request, options = nil) ⇒ ::Google::Apps::Chat::V1::Membership #update_membership(membership: nil, update_mask: nil, use_admin_access: nil) ⇒ ::Google::Apps::Chat::V1::Membership
Updates a membership. For an example, see Update a user's membership in a space.
Supports the following types of authentication:
App authentication with administrator approval and the authorization scope:
https://www.googleapis.com/auth/chat.app.memberships(only in spaces the app created)
User authentication with one of the following authorization scopes:
https://www.googleapis.com/auth/chat.membershipshttps://www.googleapis.com/auth/chat.import(import mode spaces only)- User authentication grants administrator privileges when an
administrator account authenticates,
use_admin_accessistrue, and the following authorization scope is used:https://www.googleapis.com/auth/chat.admin.memberships
3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 3247 def update_membership request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::UpdateMembershipRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.update_membership..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Apps::Chat::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.membership&.name header_params["membership.name"] = request.membership.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.update_membership.timeout, metadata: , retry_policy: @config.rpcs.update_membership.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @chat_service_stub.call_rpc :update_membership, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#update_message(request, options = nil) ⇒ ::Google::Apps::Chat::V1::Message #update_message(message: nil, update_mask: nil, allow_missing: nil) ⇒ ::Google::Apps::Chat::V1::Message
Updates a message. There's a difference between the patch and update
methods. The patch
method uses a patch request while the update method uses a put
request. We recommend using the patch method. For an example, see
Update a
message.
Supports the following types of authentication:
App authentication with the authorization scope:
https://www.googleapis.com/auth/chat.bot
User authentication with one of the following authorization scopes:
https://www.googleapis.com/auth/chat.messageshttps://www.googleapis.com/auth/chat.import(import mode spaces only)
When using app authentication, requests can only update messages created by the calling Chat app.
1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 1275 def request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::UpdateMessageRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs...to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Apps::Chat::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.&.name header_params["message.name"] = request..name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs..timeout, metadata: , retry_policy: @config.rpcs..retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @chat_service_stub.call_rpc :update_message, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#update_space(request, options = nil) ⇒ ::Google::Apps::Chat::V1::Space #update_space(space: nil, update_mask: nil, use_admin_access: nil) ⇒ ::Google::Apps::Chat::V1::Space
Updates a space. For an example, see Update a space.
If you're updating the displayName field and receive the error message
ALREADY_EXISTS, try a different display name.. An existing space within
the Google Workspace organization might already use this display name.
Supports the following types of authentication:
App authentication with administrator approval and one of the following authorization scopes:
https://www.googleapis.com/auth/chat.app.spaces
User authentication with one of the following authorization scopes:
https://www.googleapis.com/auth/chat.spaceshttps://www.googleapis.com/auth/chat.import(import mode spaces only)- User authentication grants administrator privileges when an
administrator account authenticates,
use_admin_accessistrue, and the following authorization scopes is used:https://www.googleapis.com/auth/chat.admin.spaces
App authentication has the following limitations:
- To update either
space.predefined_permission_settingsorspace.permission_settings, the app must be the space creator. - Updating the
space.access_settings.audienceis not supported for app authentication.
2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 2601 def update_space request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::UpdateSpaceRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.update_space..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Apps::Chat::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.space&.name header_params["space.name"] = request.space.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.update_space.timeout, metadata: , retry_policy: @config.rpcs.update_space.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @chat_service_stub.call_rpc :update_space, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#update_space_notification_setting(request, options = nil) ⇒ ::Google::Apps::Chat::V1::SpaceNotificationSetting #update_space_notification_setting(space_notification_setting: nil, update_mask: nil) ⇒ ::Google::Apps::Chat::V1::SpaceNotificationSetting
Updates the space notification setting. For an example, see Update the caller's space notification setting.
Requires user authentication with the authorization scope:
https://www.googleapis.com/auth/chat.users.spacesettings
5060 5061 5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 5073 5074 5075 5076 5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 5098 5099 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 5060 def update_space_notification_setting request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::UpdateSpaceNotificationSettingRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.update_space_notification_setting..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Apps::Chat::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.space_notification_setting&.name header_params["space_notification_setting.name"] = request.space_notification_setting.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.update_space_notification_setting.timeout, metadata: , retry_policy: @config.rpcs.update_space_notification_setting.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @chat_service_stub.call_rpc :update_space_notification_setting, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#update_space_read_state(request, options = nil) ⇒ ::Google::Apps::Chat::V1::SpaceReadState #update_space_read_state(space_read_state: nil, update_mask: nil) ⇒ ::Google::Apps::Chat::V1::SpaceReadState
Updates a user's read state within a space, used to identify read and unread messages. For an example, see Update a user's space read state.
Requires user authentication with the authorization scope:
https://www.googleapis.com/auth/chat.users.readstate
4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 4417 def update_space_read_state request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::UpdateSpaceReadStateRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.update_space_read_state..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Apps::Chat::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.space_read_state&.name header_params["space_read_state.name"] = request.space_read_state.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.update_space_read_state.timeout, metadata: , retry_policy: @config.rpcs.update_space_read_state.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @chat_service_stub.call_rpc :update_space_read_state, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#upload_attachment(request, options = nil) ⇒ ::Google::Apps::Chat::V1::UploadAttachmentResponse #upload_attachment(parent: nil, filename: nil) ⇒ ::Google::Apps::Chat::V1::UploadAttachmentResponse
Uploads an attachment. For an example, see Upload media as a file attachment.
Requires user authentication with one of the following authorization scopes:
https://www.googleapis.com/auth/chat.messages.createhttps://www.googleapis.com/auth/chat.messageshttps://www.googleapis.com/auth/chat.import(import mode spaces only)
You can upload attachments up to 200 MB. Certain file types aren't supported. For details, see File types blocked by Google Chat.
1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 1596 def request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::UploadAttachmentRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs...to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Apps::Chat::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs..timeout, metadata: , retry_policy: @config.rpcs..retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @chat_service_stub.call_rpc :upload_attachment, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |