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_section(request, options = nil) {|response, operation| ... } ⇒ ::Google::Apps::Chat::V1::Section
Creates a section in Google Chat.
-
#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_section(request, options = nil) {|response, operation| ... } ⇒ ::Google::Protobuf::Empty
Deletes a section of type
CUSTOM_SECTION. -
#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.
-
#find_group_chats(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::PagedEnumerable<::Google::Apps::Chat::V1::Space>
Returns all spaces with
spaceType == GROUP_CHAT, whose human memberships contain exactly the calling user, and the users specified inFindGroupChatsRequest.users. -
#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_section_items(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::PagedEnumerable<::Google::Apps::Chat::V1::SectionItem>
Lists items in a section.
-
#list_sections(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::PagedEnumerable<::Google::Apps::Chat::V1::Section>
Lists sections available to the Chat user.
-
#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.
-
#move_section_item(request, options = nil) {|response, operation| ... } ⇒ ::Google::Apps::Chat::V1::MoveSectionItemResponse
Moves an item from one section to another.
-
#position_section(request, options = nil) {|response, operation| ... } ⇒ ::Google::Apps::Chat::V1::PositionSectionResponse
Changes the sort order of a section.
-
#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_section(request, options = nil) {|response, operation| ... } ⇒ ::Google::Apps::Chat::V1::Section
Updates a section.
-
#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, #section_item_path, #section_path, #space_event_path, #space_notification_setting_path, #space_path, #space_read_state_path, #thread_path, #thread_read_state_path, #user_path
Constructor Details
#initialize {|config| ... } ⇒ Client
Create a new ChatService client object.
340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 340 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 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 |
# 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.find_group_chats.timeout = 30.0 default_config.rpcs.find_group_chats.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.rpcs.create_section.timeout = 30.0 default_config.rpcs.create_section.retry_policy = { initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs.delete_section.timeout = 30.0 default_config.rpcs.delete_section.retry_policy = { initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs.update_section.timeout = 30.0 default_config.rpcs.update_section.retry_policy = { initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs.list_sections.timeout = 30.0 default_config.rpcs.list_sections.retry_policy = { initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs.position_section.timeout = 30.0 default_config.rpcs.position_section.retry_policy = { initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs.list_section_items.timeout = 30.0 default_config.rpcs.list_section_items.retry_policy = { initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs.move_section_item.timeout = 30.0 default_config.rpcs.move_section_item.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.
2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 2866 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.
310 311 312 313 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 310 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
4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 4037 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:
3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 3304 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, create_message_notification_options: 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.
534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 534 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)
3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 3679 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_section(request, options = nil) ⇒ ::Google::Apps::Chat::V1::Section #create_section(parent: nil, section: nil) ⇒ ::Google::Apps::Chat::V1::Section
Creates a section in Google Chat. Sections help users group conversations
and customize the list of spaces displayed in Chat navigation panel. Only
sections of type CUSTOM_SECTION can be created. For details, see Create
and organize sections in Google
Chat.
Requires user authentication with the authorization scope:
https://www.googleapis.com/auth/chat.users.sections
5345 5346 5347 5348 5349 5350 5351 5352 5353 5354 5355 5356 5357 5358 5359 5360 5361 5362 5363 5364 5365 5366 5367 5368 5369 5370 5371 5372 5373 5374 5375 5376 5377 5378 5379 5380 5381 5382 5383 5384 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 5345 def create_section request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::CreateSectionRequest # 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_section..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_section.timeout, metadata: , retry_policy: @config.rpcs.create_section.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @chat_service_stub.call_rpc :create_section, 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.
2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 2263 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
4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 4368 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.
3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 3578 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.
1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 1437 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)
3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 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 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 3938 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_section(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_section(name: nil) ⇒ ::Google::Protobuf::Empty
Deletes a section of type CUSTOM_SECTION.
If the section contains items, such as spaces, the items are moved to Google Chat's default sections and are not deleted.
For details, see Create and organize sections in Google Chat.
Requires user authentication with the authorization scope:
https://www.googleapis.com/auth/chat.users.sections
5445 5446 5447 5448 5449 5450 5451 5452 5453 5454 5455 5456 5457 5458 5459 5460 5461 5462 5463 5464 5465 5466 5467 5468 5469 5470 5471 5472 5473 5474 5475 5476 5477 5478 5479 5480 5481 5482 5483 5484 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 5445 def delete_section request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::DeleteSectionRequest # 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_section..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_section.timeout, metadata: , retry_policy: @config.rpcs.delete_section.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @chat_service_stub.call_rpc :delete_section, 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
2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 2766 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
2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 2990 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 |
#find_group_chats(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Apps::Chat::V1::Space> #find_group_chats(users: nil, page_size: nil, page_token: nil, space_view: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Apps::Chat::V1::Space>
Returns all spaces with spaceType == GROUP_CHAT, whose
human memberships contain exactly the calling user, and the users specified
in FindGroupChatsRequest.users. Only members that have joined the
conversation are supported. For an example, see Find group
chats.
If the calling user blocks, or is blocked by, some users, and no spaces with the entire specified set of users are found, this method returns spaces that don't include the blocked or blocking users.
The specified set of users must contain only human (non-app) memberships. A request that contains non-human users doesn't return any spaces.
Requires user authentication with one of the following authorization scopes:
https://www.googleapis.com/auth/chat.memberships.readonlyhttps://www.googleapis.com/auth/chat.memberships
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 3161 3162 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 3129 def find_group_chats request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::FindGroupChatsRequest # 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.find_group_chats..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.find_group_chats.timeout, metadata: , retry_policy: @config.rpcs.find_group_chats.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @chat_service_stub.call_rpc :find_group_chats, request, options: do |response, operation| response = ::Gapic::PagedEnumerable.new @chat_service_stub, :find_group_chats, 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 |
#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
1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 1535 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
4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 4135 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
1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 1065 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. 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.
1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 1184 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.
2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 2120 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 with one of the following authorization scopes:
https://www.googleapis.com/auth/chat.app.spaceshttps://www.googleapis.com/auth/chat.app.spaces.readonlyhttps://www.googleapis.com/auth/chat.app.messages.readonlyhttps://www.googleapis.com/auth/chat.app.membershipshttps://www.googleapis.com/auth/chat.app.memberships.readonly
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.
4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 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 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 4842 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
5142 5143 5144 5145 5146 5147 5148 5149 5150 5151 5152 5153 5154 5155 5156 5157 5158 5159 5160 5161 5162 5163 5164 5165 5166 5167 5168 5169 5170 5171 5172 5173 5174 5175 5176 5177 5178 5179 5180 5181 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 5142 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
4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 4478 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
4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 4711 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
4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 4265 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
932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 932 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 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)
720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 720 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
3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 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 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 3838 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_section_items(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Apps::Chat::V1::SectionItem> #list_section_items(parent: nil, page_size: nil, page_token: nil, filter: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Apps::Chat::V1::SectionItem>
Lists items in a section.
Only spaces can be section items. For details, see Create and organize sections in Google Chat.
Requires user authentication with the authorization scope:
https://www.googleapis.com/auth/chat.users.sectionshttps://www.googleapis.com/auth/chat.users.sections.readonly
5914 5915 5916 5917 5918 5919 5920 5921 5922 5923 5924 5925 5926 5927 5928 5929 5930 5931 5932 5933 5934 5935 5936 5937 5938 5939 5940 5941 5942 5943 5944 5945 5946 5947 5948 5949 5950 5951 5952 5953 5954 5955 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 5914 def list_section_items request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::ListSectionItemsRequest # 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_section_items..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_section_items.timeout, metadata: , retry_policy: @config.rpcs.list_section_items.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @chat_service_stub.call_rpc :list_section_items, request, options: do |response, operation| response = ::Gapic::PagedEnumerable.new @chat_service_stub, :list_section_items, 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_sections(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Apps::Chat::V1::Section> #list_sections(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Apps::Chat::V1::Section>
Lists sections available to the Chat user. Sections help users group their conversations and customize the list of spaces displayed in Chat navigation panel. For details, see Create and organize sections in Google Chat.
Requires user authentication with the authorization scope:
https://www.googleapis.com/auth/chat.users.sectionshttps://www.googleapis.com/auth/chat.users.sections.readonly
5672 5673 5674 5675 5676 5677 5678 5679 5680 5681 5682 5683 5684 5685 5686 5687 5688 5689 5690 5691 5692 5693 5694 5695 5696 5697 5698 5699 5700 5701 5702 5703 5704 5705 5706 5707 5708 5709 5710 5711 5712 5713 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 5672 def list_sections request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::ListSectionsRequest # 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_sections..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_sections.timeout, metadata: , retry_policy: @config.rpcs.list_sections.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @chat_service_stub.call_rpc :list_sections, request, options: do |response, operation| response = ::Gapic::PagedEnumerable.new @chat_service_stub, :list_sections, 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 with one of the following authorization scopes:
https://www.googleapis.com/auth/chat.app.spaceshttps://www.googleapis.com/auth/chat.app.spaces.readonlyhttps://www.googleapis.com/auth/chat.app.messages.readonlyhttps://www.googleapis.com/auth/chat.app.membershipshttps://www.googleapis.com/auth/chat.app.memberships.readonly
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.
5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 5052 5053 5054 5055 5056 5057 5058 5059 5060 5061 5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 5073 5074 5075 5076 5077 5078 5079 5080 5081 5082 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 5041 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.
1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 1782 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.
396 397 398 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 396 def logger @chat_service_stub.logger end |
#move_section_item(request, options = nil) ⇒ ::Google::Apps::Chat::V1::MoveSectionItemResponse #move_section_item(name: nil, target_section: nil) ⇒ ::Google::Apps::Chat::V1::MoveSectionItemResponse
Moves an item from one section to another. For example, if a section contains spaces, this method can be used to move a space to a different section. For details, see Create and organize sections in Google Chat.
Requires user authentication with the authorization scope:
https://www.googleapis.com/auth/chat.users.sections
6017 6018 6019 6020 6021 6022 6023 6024 6025 6026 6027 6028 6029 6030 6031 6032 6033 6034 6035 6036 6037 6038 6039 6040 6041 6042 6043 6044 6045 6046 6047 6048 6049 6050 6051 6052 6053 6054 6055 6056 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 6017 def move_section_item request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::MoveSectionItemRequest # 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.move_section_item..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.move_section_item.timeout, metadata: , retry_policy: @config.rpcs.move_section_item.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @chat_service_stub.call_rpc :move_section_item, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#position_section(request, options = nil) ⇒ ::Google::Apps::Chat::V1::PositionSectionResponse #position_section(name: nil, sort_order: nil, relative_position: nil) ⇒ ::Google::Apps::Chat::V1::PositionSectionResponse
Changes the sort order of a section. For details, see Create and organize sections in Google Chat.
Requires user authentication with the authorization scope:
https://www.googleapis.com/auth/chat.users.sections
5782 5783 5784 5785 5786 5787 5788 5789 5790 5791 5792 5793 5794 5795 5796 5797 5798 5799 5800 5801 5802 5803 5804 5805 5806 5807 5808 5809 5810 5811 5812 5813 5814 5815 5816 5817 5818 5819 5820 5821 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 5782 def position_section request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::PositionSectionRequest # 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.position_section..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.position_section.timeout, metadata: , retry_policy: @config.rpcs.position_section.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @chat_service_stub.call_rpc :position_section, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) 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
1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 1998 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 user@example.com is 123456789,
you can add the user to the space by setting the membership.member.name
to users/user@example.com 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 group@example.com, 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
2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 2455 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
320 321 322 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 320 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
3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 3430 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.
1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 1317 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_section(request, options = nil) ⇒ ::Google::Apps::Chat::V1::Section #update_section(section: nil, update_mask: nil) ⇒ ::Google::Apps::Chat::V1::Section
Updates a section. Only sections of type CUSTOM_SECTION can be updated.
For details, see Create and organize sections in Google
Chat.
Requires user authentication with the authorization scope:
https://www.googleapis.com/auth/chat.users.sections
5545 5546 5547 5548 5549 5550 5551 5552 5553 5554 5555 5556 5557 5558 5559 5560 5561 5562 5563 5564 5565 5566 5567 5568 5569 5570 5571 5572 5573 5574 5575 5576 5577 5578 5579 5580 5581 5582 5583 5584 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 5545 def update_section request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::UpdateSectionRequest # 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_section..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.section&.name header_params["section.name"] = request.section.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_section.timeout, metadata: , retry_policy: @config.rpcs.update_section.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @chat_service_stub.call_rpc :update_section, 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.
2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 2643 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
5245 5246 5247 5248 5249 5250 5251 5252 5253 5254 5255 5256 5257 5258 5259 5260 5261 5262 5263 5264 5265 5266 5267 5268 5269 5270 5271 5272 5273 5274 5275 5276 5277 5278 5279 5280 5281 5282 5283 5284 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 5245 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
4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 4600 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.
1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 |
# File 'lib/google/apps/chat/v1/chat_service/client.rb', line 1638 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 |