Class: SlackWebApi::ConversationsController
- Inherits:
-
BaseController
- Object
- BaseController
- SlackWebApi::ConversationsController
- Defined in:
- lib/slack_web_api/controllers/conversations_controller.rb
Overview
ConversationsController
Constant Summary
Constants inherited from BaseController
Instance Attribute Summary
Attributes inherited from BaseController
Instance Method Summary collapse
-
#conversations_archive(token: nil, channel: nil) ⇒ ApiResponse
Archives a conversation.
-
#conversations_close(token: nil, channel: nil) ⇒ ApiResponse
Closes a direct message or multi-person direct message.
-
#conversations_create(token: nil, name: nil, is_private: nil) ⇒ ApiResponse
Initiates a public or private channel-based conversation scope:
conversations:writechannel to create private channel instead of a public one. -
#conversations_history(token: nil, channel: nil, latest: nil, oldest: nil, inclusive: nil, limit: nil, cursor: nil) ⇒ ApiResponse
Fetches a conversation’s history of messages and events.
-
#conversations_info(token: nil, channel: nil, include_locale: nil, include_num_members: nil) ⇒ ApiResponse
Retrieve information about a conversation.
-
#conversations_invite(token: nil, channel: nil, users: nil) ⇒ ApiResponse
Invites users to a channel.
-
#conversations_join(token: nil, channel: nil) ⇒ ApiResponse
Joins an existing conversation.
-
#conversations_kick(token: nil, channel: nil, user: nil) ⇒ ApiResponse
Removes a user from a conversation.
-
#conversations_leave(token: nil, channel: nil) ⇒ ApiResponse
Leaves a conversation.
-
#conversations_list(token: nil, exclude_archived: nil, types: nil, limit: nil, cursor: nil) ⇒ ApiResponse
Lists all channels in a Slack team.
-
#conversations_mark(token: nil, channel: nil, ts: nil) ⇒ ApiResponse
Sets the read cursor in a channel.
-
#conversations_members(token: nil, channel: nil, limit: nil, cursor: nil) ⇒ ApiResponse
Retrieve members of a conversation.
-
#conversations_open(token: nil, channel: nil, users: nil, return_im: nil) ⇒ ApiResponse
Opens or resumes a direct message or multi-person direct message.
-
#conversations_rename(token: nil, channel: nil, name: nil) ⇒ ApiResponse
Renames a conversation.
-
#conversations_replies(token: nil, channel: nil, ts: nil, latest: nil, oldest: nil, inclusive: nil, limit: nil, cursor: nil) ⇒ ApiResponse
Retrieve a thread of messages posted to a conversation scope:
conversations:historythread from. -
#conversations_set_purpose(token: nil, channel: nil, purpose: nil) ⇒ ApiResponse
Sets the purpose for a conversation.
-
#conversations_set_topic(token: nil, channel: nil, topic: nil) ⇒ ApiResponse
Sets the topic for a conversation.
-
#conversations_unarchive(token: nil, channel: nil) ⇒ ApiResponse
Reverses conversation archival.
Methods inherited from BaseController
#initialize, #new_parameter, #new_request_builder, #new_response_handler, user_agent, user_agent_parameters
Constructor Details
This class inherits a constructor from SlackWebApi::BaseController
Instance Method Details
#conversations_archive(token: nil, channel: nil) ⇒ ApiResponse
Archives a conversation. scope: conversations:write archive
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/slack_web_api/controllers/conversations_controller.rb', line 15 def conversations_archive(token: nil, channel: nil) @api_call .request(new_request_builder(HttpMethodEnum::POST, '/conversations.archive', Server::DEFAULT) .header_param(new_parameter(token, key: 'token')) .form_param(new_parameter(channel, key: 'channel')) .header_param(new_parameter('application/x-www-form-urlencoded', key: 'content-type')) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('slackAuth'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(ConversationsArchiveSuccessSchema.method(:from_hash)) .is_api_response(true) .local_error('default', 'Typical error response', ConversationsArchiveErrorSchemaException)) .execute end |
#conversations_close(token: nil, channel: nil) ⇒ ApiResponse
Closes a direct message or multi-person direct message. scope: conversations:write
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/slack_web_api/controllers/conversations_controller.rb', line 41 def conversations_close(token: nil, channel: nil) @api_call .request(new_request_builder(HttpMethodEnum::POST, '/conversations.close', Server::DEFAULT) .header_param(new_parameter(token, key: 'token')) .form_param(new_parameter(channel, key: 'channel')) .header_param(new_parameter('application/x-www-form-urlencoded', key: 'content-type')) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('slackAuth'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(ConversationsCloseSuccessSchema.method(:from_hash)) .is_api_response(true) .local_error('default', 'Typical error response', ConversationsCloseErrorSchemaException)) .execute end |
#conversations_create(token: nil, name: nil, is_private: nil) ⇒ ApiResponse
Initiates a public or private channel-based conversation scope: conversations:write channel to create private channel instead of a public one
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
# File 'lib/slack_web_api/controllers/conversations_controller.rb', line 70 def conversations_create(token: nil, name: nil, is_private: nil) @api_call .request(new_request_builder(HttpMethodEnum::POST, '/conversations.create', Server::DEFAULT) .header_param(new_parameter(token, key: 'token')) .form_param(new_parameter(name, key: 'name')) .form_param(new_parameter(is_private, key: 'is_private')) .header_param(new_parameter('application/x-www-form-urlencoded', key: 'content-type')) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('slackAuth'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(ConversationsCreateSuccessSchema.method(:from_hash)) .is_api_response(true) .local_error('default', 'Typical error response when name already in use', ConversationsCreateErrorSchemaException)) .execute end |
#conversations_history(token: nil, channel: nil, latest: nil, oldest: nil, inclusive: nil, limit: nil, cursor: nil) ⇒ ApiResponse
Fetches a conversation’s history of messages and events. scope: conversations:history history for. include in results. to include in results. messages with latest or oldest timestamp in results only when either timestamp is specified. return. Fewer than the requested number of items may be returned, even if the end of the users list hasn’t been reached. data by setting the cursor parameter to a next_cursor attribute returned by a previous request’s response_metadata. Default value fetches the first “page” of the collection. See [pagination](/docs/pagination) for more detail.
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 |
# File 'lib/slack_web_api/controllers/conversations_controller.rb', line 114 def conversations_history(token: nil, channel: nil, latest: nil, oldest: nil, inclusive: nil, limit: nil, cursor: nil) @api_call .request(new_request_builder(HttpMethodEnum::GET, '/conversations.history', Server::DEFAULT) .header_param(new_parameter('application/x-www-form-urlencoded', key: 'Content-Type')) .query_param(new_parameter(token, key: 'token')) .query_param(new_parameter(channel, key: 'channel')) .query_param(new_parameter(latest, key: 'latest')) .query_param(new_parameter(oldest, key: 'oldest')) .query_param(new_parameter(inclusive, key: 'inclusive')) .query_param(new_parameter(limit, key: 'limit')) .query_param(new_parameter(cursor, key: 'cursor')) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('slackAuth'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(ConversationsHistorySuccessSchema.method(:from_hash)) .is_api_response(true) .local_error('default', 'Typical error response', ConversationsHistoryErrorSchemaException)) .execute end |
#conversations_info(token: nil, channel: nil, include_locale: nil, include_num_members: nil) ⇒ ApiResponse
Retrieve information about a conversation. scope: conversations:read about this to true to receive the locale for this conversation. Defaults to false Set to true to include the member count for the specified conversation. Defaults to false
157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 |
# File 'lib/slack_web_api/controllers/conversations_controller.rb', line 157 def conversations_info(token: nil, channel: nil, include_locale: nil, include_num_members: nil) @api_call .request(new_request_builder(HttpMethodEnum::GET, '/conversations.info', Server::DEFAULT) .header_param(new_parameter('application/x-www-form-urlencoded', key: 'Content-Type')) .query_param(new_parameter(token, key: 'token')) .query_param(new_parameter(channel, key: 'channel')) .query_param(new_parameter(include_locale, key: 'include_locale')) .query_param(new_parameter(include_num_members, key: 'include_num_members')) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('slackAuth'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(ConversationsInfoSuccessSchema.method(:from_hash)) .is_api_response(true) .local_error('default', 'Typical error response when a channel cannot be found', ConversationsInfoErrorSchemaException)) .execute end |
#conversations_invite(token: nil, channel: nil, users: nil) ⇒ ApiResponse
Invites users to a channel. scope: conversations:write private channel to invite user(s) to. IDs. Up to 1000 users may be listed.
190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 |
# File 'lib/slack_web_api/controllers/conversations_controller.rb', line 190 def conversations_invite(token: nil, channel: nil, users: nil) @api_call .request(new_request_builder(HttpMethodEnum::POST, '/conversations.invite', Server::DEFAULT) .header_param(new_parameter(token, key: 'token')) .form_param(new_parameter(channel, key: 'channel')) .form_param(new_parameter(users, key: 'users')) .header_param(new_parameter('application/x-www-form-urlencoded', key: 'content-type')) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('slackAuth'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(ConversationsInviteErrorSchema.method(:from_hash)) .is_api_response(true) .local_error('default', 'Typical error response when an invite is attempted on a'\ ' conversation type that does not support it', ConversationsInviteErrorSchema1Exception)) .execute end |
#conversations_join(token: nil, channel: nil) ⇒ ApiResponse
Joins an existing conversation. scope: channels:write
219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 |
# File 'lib/slack_web_api/controllers/conversations_controller.rb', line 219 def conversations_join(token: nil, channel: nil) @api_call .request(new_request_builder(HttpMethodEnum::POST, '/conversations.join', Server::DEFAULT) .header_param(new_parameter(token, key: 'token')) .form_param(new_parameter(channel, key: 'channel')) .header_param(new_parameter('application/x-www-form-urlencoded', key: 'content-type')) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('slackAuth'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(ConversationsJoinSuccessSchema.method(:from_hash)) .is_api_response(true) .local_error('default', 'Typical error response if the conversation is archived and'\ ' cannot be joined', ConversationsJoinErrorSchemaException)) .execute end |
#conversations_kick(token: nil, channel: nil, user: nil) ⇒ ApiResponse
Removes a user from a conversation. scope: conversations:write user from.
248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 |
# File 'lib/slack_web_api/controllers/conversations_controller.rb', line 248 def conversations_kick(token: nil, channel: nil, user: nil) @api_call .request(new_request_builder(HttpMethodEnum::POST, '/conversations.kick', Server::DEFAULT) .header_param(new_parameter(token, key: 'token')) .form_param(new_parameter(channel, key: 'channel')) .form_param(new_parameter(user, key: 'user')) .header_param(new_parameter('application/x-www-form-urlencoded', key: 'content-type')) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('slackAuth'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(ConversationsKickSuccessSchema.method(:from_hash)) .is_api_response(true) .local_error('default', 'Typical error response when you attempt to kick yourself from'\ ' a channel', ConversationsKickErrorSchemaException)) .execute end |
#conversations_leave(token: nil, channel: nil) ⇒ ApiResponse
Leaves a conversation. scope: conversations:write
277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 |
# File 'lib/slack_web_api/controllers/conversations_controller.rb', line 277 def conversations_leave(token: nil, channel: nil) @api_call .request(new_request_builder(HttpMethodEnum::POST, '/conversations.leave', Server::DEFAULT) .header_param(new_parameter(token, key: 'token')) .form_param(new_parameter(channel, key: 'channel')) .header_param(new_parameter('application/x-www-form-urlencoded', key: 'content-type')) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('slackAuth'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(ConversationsLeaveSuccessSchema.method(:from_hash)) .is_api_response(true) .local_error('default', 'Typical error response when attempting to leave a workspace\'s'\ ' "general" channel', ConversationsLeaveErrorSchemaException)) .execute end |
#conversations_list(token: nil, exclude_archived: nil, types: nil, limit: nil, cursor: nil) ⇒ ApiResponse
Lists all channels in a Slack team. scope: conversations:read to true to exclude archived channels from the list providing a comma-separated list of any combination of public_channel, private_channel, mpim, im return. Fewer than the requested number of items may be returned, even if the end of the list hasn’t been reached. Must be an integer no larger than 1000. data by setting the cursor parameter to a next_cursor attribute returned by a previous request’s response_metadata. Default value fetches the first “page” of the collection. See [pagination](/docs/pagination) for more detail.
317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 |
# File 'lib/slack_web_api/controllers/conversations_controller.rb', line 317 def conversations_list(token: nil, exclude_archived: nil, types: nil, limit: nil, cursor: nil) @api_call .request(new_request_builder(HttpMethodEnum::GET, '/conversations.list', Server::DEFAULT) .header_param(new_parameter('application/x-www-form-urlencoded', key: 'Content-Type')) .query_param(new_parameter(token, key: 'token')) .query_param(new_parameter(exclude_archived, key: 'exclude_archived')) .query_param(new_parameter(types, key: 'types')) .query_param(new_parameter(limit, key: 'limit')) .query_param(new_parameter(cursor, key: 'cursor')) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('slackAuth'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(ConversationsListSuccessSchema.method(:from_hash)) .is_api_response(true) .local_error('default', 'Typical error response', ConversationsListErrorSchemaException)) .execute end |
#conversations_mark(token: nil, channel: nil, ts: nil) ⇒ ApiResponse
Sets the read cursor in a channel. scope: conversations:write the read cursor for. want marked as most recently seen in this conversation.
352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 |
# File 'lib/slack_web_api/controllers/conversations_controller.rb', line 352 def conversations_mark(token: nil, channel: nil, ts: nil) @api_call .request(new_request_builder(HttpMethodEnum::POST, '/conversations.mark', Server::DEFAULT) .header_param(new_parameter(token, key: 'token')) .form_param(new_parameter(channel, key: 'channel')) .form_param(new_parameter(ts, key: 'ts')) .header_param(new_parameter('application/x-www-form-urlencoded', key: 'content-type')) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('slackAuth'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(ConversationsMarkSuccessSchema.method(:from_hash)) .is_api_response(true) .local_error('default', 'Typical error response', ConversationsMarkErrorSchemaException)) .execute end |
#conversations_members(token: nil, channel: nil, limit: nil, cursor: nil) ⇒ ApiResponse
Retrieve members of a conversation. scope: conversations:read retrieve members for return. Fewer than the requested number of items may be returned, even if the end of the users list hasn’t been reached. data by setting the cursor parameter to a next_cursor attribute returned by a previous request’s response_metadata. Default value fetches the first “page” of the collection. See [pagination](/docs/pagination) for more detail.
389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 |
# File 'lib/slack_web_api/controllers/conversations_controller.rb', line 389 def conversations_members(token: nil, channel: nil, limit: nil, cursor: nil) @api_call .request(new_request_builder(HttpMethodEnum::GET, '/conversations.members', Server::DEFAULT) .header_param(new_parameter('application/x-www-form-urlencoded', key: 'Content-Type')) .query_param(new_parameter(token, key: 'token')) .query_param(new_parameter(channel, key: 'channel')) .query_param(new_parameter(limit, key: 'limit')) .query_param(new_parameter(cursor, key: 'cursor')) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('slackAuth'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(ConversationsMembersSuccessSchema.method(:from_hash)) .is_api_response(true) .local_error('default', 'Typical error response when an invalid cursor is provided', ConversationsMembersErrorSchemaException)) .execute end |
#conversations_open(token: nil, channel: nil, users: nil, return_im: nil) ⇒ ApiResponse
Opens or resumes a direct message or multi-person direct message. scope: conversations:write supplying an im or mpim‘s ID. Or provide the users field instead. If only one user is included, this creates a 1:1 DM. The ordering of the users is preserved whenever a multi-person direct message is returned. Supply a channel when not supplying users. indicates you want the full IM channel definition in the response.
426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 |
# File 'lib/slack_web_api/controllers/conversations_controller.rb', line 426 def conversations_open(token: nil, channel: nil, users: nil, return_im: nil) @api_call .request(new_request_builder(HttpMethodEnum::POST, '/conversations.open', Server::DEFAULT) .header_param(new_parameter(token, key: 'token')) .form_param(new_parameter(channel, key: 'channel')) .form_param(new_parameter(users, key: 'users')) .form_param(new_parameter(return_im, key: 'return_im')) .header_param(new_parameter('application/x-www-form-urlencoded', key: 'content-type')) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('slackAuth'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(ConversationsOpenSuccessSchema.method(:from_hash)) .is_api_response(true) .local_error('default', 'Typical error response', ConversationsOpenErrorSchemaException)) .execute end |
#conversations_rename(token: nil, channel: nil, name: nil) ⇒ ApiResponse
Renames a conversation. scope: conversations:write
457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 |
# File 'lib/slack_web_api/controllers/conversations_controller.rb', line 457 def conversations_rename(token: nil, channel: nil, name: nil) @api_call .request(new_request_builder(HttpMethodEnum::POST, '/conversations.rename', Server::DEFAULT) .header_param(new_parameter(token, key: 'token')) .form_param(new_parameter(channel, key: 'channel')) .form_param(new_parameter(name, key: 'name')) .header_param(new_parameter('application/x-www-form-urlencoded', key: 'content-type')) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('slackAuth'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(ConversationsRenameSuccessSchema.method(:from_hash)) .is_api_response(true) .local_error('default', 'Typical error response when the calling user is not a member'\ ' of the conversation', ConversationsRenameErrorSchemaException)) .execute end |
#conversations_replies(token: nil, channel: nil, ts: nil, latest: nil, oldest: nil, inclusive: nil, limit: nil, cursor: nil) ⇒ ApiResponse
Retrieve a thread of messages posted to a conversation scope: conversations:history thread from. parent message. ts must be the timestamp of an existing message with 0 or more replies. If there are no replies then just the single message referenced by ts will return - it is just an ordinary, unthreaded message. include in results. to include in results. messages with latest or oldest timestamp in results only when either timestamp is specified. return. Fewer than the requested number of items may be returned, even if the end of the users list hasn’t been reached. data by setting the cursor parameter to a next_cursor attribute returned by a previous request’s response_metadata. Default value fetches the first “page” of the collection. See [pagination](/docs/pagination) for more detail.
507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 |
# File 'lib/slack_web_api/controllers/conversations_controller.rb', line 507 def conversations_replies(token: nil, channel: nil, ts: nil, latest: nil, oldest: nil, inclusive: nil, limit: nil, cursor: nil) @api_call .request(new_request_builder(HttpMethodEnum::GET, '/conversations.replies', Server::DEFAULT) .header_param(new_parameter('application/x-www-form-urlencoded', key: 'Content-Type')) .query_param(new_parameter(token, key: 'token')) .query_param(new_parameter(channel, key: 'channel')) .query_param(new_parameter(ts, key: 'ts')) .query_param(new_parameter(latest, key: 'latest')) .query_param(new_parameter(oldest, key: 'oldest')) .query_param(new_parameter(inclusive, key: 'inclusive')) .query_param(new_parameter(limit, key: 'limit')) .query_param(new_parameter(cursor, key: 'cursor')) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('slackAuth'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(ConversationsRepliesSuccessSchema.method(:from_hash)) .is_api_response(true) .local_error('default', 'Typical error response', ConversationsRepliesErrorSchemaException)) .execute end |
#conversations_set_purpose(token: nil, channel: nil, purpose: nil) ⇒ ApiResponse
Sets the purpose for a conversation. scope: conversations:write purpose of
547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 |
# File 'lib/slack_web_api/controllers/conversations_controller.rb', line 547 def conversations_set_purpose(token: nil, channel: nil, purpose: nil) @api_call .request(new_request_builder(HttpMethodEnum::POST, '/conversations.setPurpose', Server::DEFAULT) .header_param(new_parameter(token, key: 'token')) .form_param(new_parameter(channel, key: 'channel')) .form_param(new_parameter(purpose, key: 'purpose')) .header_param(new_parameter('application/x-www-form-urlencoded', key: 'content-type')) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('slackAuth'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(ConversationsSetPurposeSuccessSchema.method(:from_hash)) .is_api_response(true) .local_error('default', 'Typical error response', ConversationsSetPurposeErrorSchemaException)) .execute end |
#conversations_set_topic(token: nil, channel: nil, topic: nil) ⇒ ApiResponse
Sets the topic for a conversation. scope: conversations:write of support formatting or linkification.
578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 |
# File 'lib/slack_web_api/controllers/conversations_controller.rb', line 578 def conversations_set_topic(token: nil, channel: nil, topic: nil) @api_call .request(new_request_builder(HttpMethodEnum::POST, '/conversations.setTopic', Server::DEFAULT) .header_param(new_parameter(token, key: 'token')) .form_param(new_parameter(channel, key: 'channel')) .form_param(new_parameter(topic, key: 'topic')) .header_param(new_parameter('application/x-www-form-urlencoded', key: 'content-type')) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('slackAuth'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(ConversationsSetTopicSuccessSchema.method(:from_hash)) .is_api_response(true) .local_error('default', 'Typical error response', ConversationsSetTopicErrorSchemaException)) .execute end |
#conversations_unarchive(token: nil, channel: nil) ⇒ ApiResponse
Reverses conversation archival. scope: conversations:write unarchive
607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 |
# File 'lib/slack_web_api/controllers/conversations_controller.rb', line 607 def conversations_unarchive(token: nil, channel: nil) @api_call .request(new_request_builder(HttpMethodEnum::POST, '/conversations.unarchive', Server::DEFAULT) .header_param(new_parameter(token, key: 'token')) .form_param(new_parameter(channel, key: 'channel')) .header_param(new_parameter('application/x-www-form-urlencoded', key: 'content-type')) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('slackAuth'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(ConversationsUnarchiveSuccessSchema.method(:from_hash)) .is_api_response(true) .local_error('default', 'Typical error response', ConversationsUnarchiveErrorSchemaException)) .execute end |