Class: SlackWebApi::ChatScheduledMessagesController

Inherits:
BaseController show all
Defined in:
lib/slack_web_api/controllers/chat_scheduled_messages_controller.rb

Overview

ChatScheduledMessagesController

Constant Summary

Constants inherited from BaseController

BaseController::GLOBAL_ERRORS

Instance Attribute Summary

Attributes inherited from BaseController

#config, #http_call_back

Instance Method Summary collapse

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

#chat_scheduled_messages_list(token: nil, channel: nil, latest: nil, oldest: nil, limit: nil, cursor: nil) ⇒ ApiResponse

Returns a list of scheduled messages. scope: none messages value in the time range value in the time range entries to return. is the cursor value returned from a previous call to chat.scheduledmessages.list indicating where you want to start this call from.

Parameters:

  • token (String) (defaults to: nil)

    Optional parameter: Authentication token. Requires

  • channel (String) (defaults to: nil)

    Optional parameter: The channel of the scheduled

  • latest (Float) (defaults to: nil)

    Optional parameter: A UNIX timestamp of the latest

  • oldest (Float) (defaults to: nil)

    Optional parameter: A UNIX timestamp of the oldest

  • limit (Integer) (defaults to: nil)

    Optional parameter: Maximum number of original

  • cursor (String) (defaults to: nil)

    Optional parameter: For pagination purposes, this

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/slack_web_api/controllers/chat_scheduled_messages_controller.rb', line 25

def chat_scheduled_messages_list(token: nil,
                                 channel: nil,
                                 latest: nil,
                                 oldest: nil,
                                 limit: nil,
                                 cursor: nil)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/chat.scheduledMessages.list',
                                 Server::DEFAULT)
               .header_param(new_parameter('application/x-www-form-urlencoded', key: 'Content-Type'))
               .header_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(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(ChatScheduledMessagesListSchema.method(:from_hash))
                .is_api_response(true)
                .local_error('default',
                             'Typical error response if the channel passed is invalid',
                             ChatScheduledMessagesListErrorSchemaException))
    .execute
end