Class: SlackWebApi::RtmController
- Inherits:
-
BaseController
- Object
- BaseController
- SlackWebApi::RtmController
- Defined in:
- lib/slack_web_api/controllers/rtm_controller.rb
Overview
RtmController
Constant Summary
Constants inherited from BaseController
Instance Attribute Summary
Attributes inherited from BaseController
Instance Method Summary collapse
-
#rtm_connect(token, batch_presence_aware: nil, presence_sub: nil) ⇒ ApiResponse
Starts a Real Time Messaging session.
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
#rtm_connect(token, batch_presence_aware: nil, presence_sub: nil) ⇒ ApiResponse
Starts a Real Time Messaging session. scope: rtm:stream Batch presence deliveries via subscription. Enabling changes the shape of presence_change events. See [batch presence](/docs/presence-and-status#batching). deliver presence events when requested by subscription. See [presence subscriptions](/docs/presence-and-status#subscriptions).
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/slack_web_api/controllers/rtm_controller.rb', line 20 def rtm_connect(token, batch_presence_aware: nil, presence_sub: nil) @api_call .request(new_request_builder(HttpMethodEnum::GET, '/rtm.connect', Server::DEFAULT) .query_param(new_parameter(token, key: 'token') .is_required(true)) .header_param(new_parameter('application/x-www-form-urlencoded', key: 'Content-Type')) .query_param(new_parameter(batch_presence_aware, key: 'batch_presence_aware')) .query_param(new_parameter(presence_sub, key: 'presence_sub')) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('slackAuth'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(RtmConnectSchema.method(:from_hash)) .is_api_response(true) .local_error('default', 'Typical error response', RtmConnectErrorSchemaException)) .execute end |