Class: SunshineConversationsClient::SwitchboardActionsApi
- Inherits:
-
Object
- Object
- SunshineConversationsClient::SwitchboardActionsApi
- Defined in:
- lib/sunshine-conversations-client/api/switchboard_actions_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#accept_control(app_id, conversation_id, accept_control_body, opts = {}) ⇒ Object
Accept Control The acceptControl action transfers the control of the conversation to the pending switchboard integration.
-
#accept_control_with_http_info(app_id, conversation_id, accept_control_body, opts = {}) ⇒ Array<(Object, Integer, Hash)>
Accept Control The acceptControl action transfers the control of the conversation to the pending switchboard integration.
-
#initialize(api_client = ApiClient.default) ⇒ SwitchboardActionsApi
constructor
A new instance of SwitchboardActionsApi.
-
#offer_control(app_id, conversation_id, offer_control_body, opts = {}) ⇒ Object
Offer Control The offerControl action will invite a switchboard integration to accept control of the conversation (changing its status to pending), and trigger a webhook signal to that integration indicating that they have been offered control of the conversation.
-
#offer_control_with_http_info(app_id, conversation_id, offer_control_body, opts = {}) ⇒ Array<(Object, Integer, Hash)>
Offer Control The offerControl action will invite a switchboard integration to accept control of the conversation (changing its status to pending), and trigger a webhook signal to that integration indicating that they have been offered control of the conversation.
-
#pass_control(app_id, conversation_id, pass_control_body, opts = {}) ⇒ Object
Pass Control The passControl action marks the named switchboard integration as active and transitions all the other switchboard integrations to standby status.
-
#pass_control_with_http_info(app_id, conversation_id, pass_control_body, opts = {}) ⇒ Array<(Object, Integer, Hash)>
Pass Control The passControl action marks the named switchboard integration as active and transitions all the other switchboard integrations to standby status.
-
#release_control(app_id, conversation_id, opts = {}) ⇒ Object
Release Control The releaseControl action releases the control of the conversation by nullifying its switchboard state.
-
#release_control_with_http_info(app_id, conversation_id, opts = {}) ⇒ Array<(Object, Integer, Hash)>
Release Control The releaseControl action releases the control of the conversation by nullifying its switchboard state.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ SwitchboardActionsApi
Returns a new instance of SwitchboardActionsApi.
16 17 18 |
# File 'lib/sunshine-conversations-client/api/switchboard_actions_api.rb', line 16 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
14 15 16 |
# File 'lib/sunshine-conversations-client/api/switchboard_actions_api.rb', line 14 def api_client @api_client end |
Instance Method Details
#accept_control(app_id, conversation_id, accept_control_body, opts = {}) ⇒ Object
Accept Control The acceptControl action transfers the control of the conversation to the pending switchboard integration. When using integration auth scope, a 403 is returned if the pending switchboard integration is not the authenticated integration.
26 27 28 29 |
# File 'lib/sunshine-conversations-client/api/switchboard_actions_api.rb', line 26 def accept_control(app_id, conversation_id, accept_control_body, opts = {}) data, _status_code, _headers = accept_control_with_http_info(app_id, conversation_id, accept_control_body, opts) data end |
#accept_control_with_http_info(app_id, conversation_id, accept_control_body, opts = {}) ⇒ Array<(Object, Integer, Hash)>
Accept Control The acceptControl action transfers the control of the conversation to the pending switchboard integration. When using integration auth scope, a 403 is returned if the pending switchboard integration is not the authenticated integration.
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 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 |
# File 'lib/sunshine-conversations-client/api/switchboard_actions_api.rb', line 38 def accept_control_with_http_info(app_id, conversation_id, accept_control_body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SwitchboardActionsApi.accept_control ...' end # verify the required parameter 'app_id' is set if @api_client.config.client_side_validation && app_id.nil? fail ArgumentError, "Missing the required parameter 'app_id' when calling SwitchboardActionsApi.accept_control" end # verify the required parameter 'conversation_id' is set if @api_client.config.client_side_validation && conversation_id.nil? fail ArgumentError, "Missing the required parameter 'conversation_id' when calling SwitchboardActionsApi.accept_control" end # verify the required parameter 'accept_control_body' is set if @api_client.config.client_side_validation && accept_control_body.nil? fail ArgumentError, "Missing the required parameter 'accept_control_body' when calling SwitchboardActionsApi.accept_control" end # resource path local_var_path = '/v2/apps/{appId}/conversations/{conversationId}/acceptControl'.sub('{' + 'appId' + '}', CGI.escape(app_id.to_s)).sub('{' + 'conversationId' + '}', CGI.escape(conversation_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(accept_control_body) # return_type return_type = opts[:debug_return_type] || 'Object' # auth_names auth_names = opts[:debug_auth_names] || ['basicAuth', 'bearerAuth'] = opts.merge( :operation => :"SwitchboardActionsApi.accept_control", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: SwitchboardActionsApi#accept_control\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#offer_control(app_id, conversation_id, offer_control_body, opts = {}) ⇒ Object
Offer Control The offerControl action will invite a switchboard integration to accept control of the conversation (changing its status to pending), and trigger a webhook signal to that integration indicating that they have been offered control of the conversation. Invalidates previous offerControl actions.
106 107 108 109 |
# File 'lib/sunshine-conversations-client/api/switchboard_actions_api.rb', line 106 def offer_control(app_id, conversation_id, offer_control_body, opts = {}) data, _status_code, _headers = offer_control_with_http_info(app_id, conversation_id, offer_control_body, opts) data end |
#offer_control_with_http_info(app_id, conversation_id, offer_control_body, opts = {}) ⇒ Array<(Object, Integer, Hash)>
Offer Control The offerControl action will invite a switchboard integration to accept control of the conversation (changing its status to pending), and trigger a webhook signal to that integration indicating that they have been offered control of the conversation. Invalidates previous offerControl actions.
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 |
# File 'lib/sunshine-conversations-client/api/switchboard_actions_api.rb', line 118 def offer_control_with_http_info(app_id, conversation_id, offer_control_body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SwitchboardActionsApi.offer_control ...' end # verify the required parameter 'app_id' is set if @api_client.config.client_side_validation && app_id.nil? fail ArgumentError, "Missing the required parameter 'app_id' when calling SwitchboardActionsApi.offer_control" end # verify the required parameter 'conversation_id' is set if @api_client.config.client_side_validation && conversation_id.nil? fail ArgumentError, "Missing the required parameter 'conversation_id' when calling SwitchboardActionsApi.offer_control" end # verify the required parameter 'offer_control_body' is set if @api_client.config.client_side_validation && offer_control_body.nil? fail ArgumentError, "Missing the required parameter 'offer_control_body' when calling SwitchboardActionsApi.offer_control" end # resource path local_var_path = '/v2/apps/{appId}/conversations/{conversationId}/offerControl'.sub('{' + 'appId' + '}', CGI.escape(app_id.to_s)).sub('{' + 'conversationId' + '}', CGI.escape(conversation_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(offer_control_body) # return_type return_type = opts[:debug_return_type] || 'Object' # auth_names auth_names = opts[:debug_auth_names] || ['basicAuth', 'bearerAuth'] = opts.merge( :operation => :"SwitchboardActionsApi.offer_control", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: SwitchboardActionsApi#offer_control\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#pass_control(app_id, conversation_id, pass_control_body, opts = {}) ⇒ Object
Pass Control The passControl action marks the named switchboard integration as active and transitions all the other switchboard integrations to standby status. The ‘passControl` action is idempotent if either the target `switchboardIntegration` is specified explicitly by its `id` or `name`, or the `next` keyword is used for the `switchboardIntegration` field, and the invoking integration can be identified by its [OAuth token](developer.zendesk.com/documentation/conversations/how-to-guides/building-a-marketplace-bot/) or [Custom Integration API Key](developer.zendesk.com/api-reference/conversations/#tag/CustomIntegrationApiKeys) credentials. Duplicate passControl actions using the `next` keyword and their metadata are disregarded. For more information, see [Switchboard passControl](developer.zendesk.com/documentation/conversations/messaging-platform/programmable-conversations/switchboard/#pass-control).
186 187 188 189 |
# File 'lib/sunshine-conversations-client/api/switchboard_actions_api.rb', line 186 def pass_control(app_id, conversation_id, pass_control_body, opts = {}) data, _status_code, _headers = pass_control_with_http_info(app_id, conversation_id, pass_control_body, opts) data end |
#pass_control_with_http_info(app_id, conversation_id, pass_control_body, opts = {}) ⇒ Array<(Object, Integer, Hash)>
Pass Control The passControl action marks the named switchboard integration as active and transitions all the other switchboard integrations to standby status. The `passControl` action is idempotent if either the target `switchboardIntegration` is specified explicitly by its `id` or `name`, or the `next` keyword is used for the `switchboardIntegration` field, and the invoking integration can be identified by its [OAuth token](developer.zendesk.com/documentation/conversations/how-to-guides/building-a-marketplace-bot/) or [Custom Integration API Key](developer.zendesk.com/api-reference/conversations/#tag/CustomIntegrationApiKeys) credentials. Duplicate passControl actions using the `next` keyword and their metadata are disregarded. For more information, see [Switchboard passControl](developer.zendesk.com/documentation/conversations/messaging-platform/programmable-conversations/switchboard/#pass-control).
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 |
# File 'lib/sunshine-conversations-client/api/switchboard_actions_api.rb', line 198 def pass_control_with_http_info(app_id, conversation_id, pass_control_body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SwitchboardActionsApi.pass_control ...' end # verify the required parameter 'app_id' is set if @api_client.config.client_side_validation && app_id.nil? fail ArgumentError, "Missing the required parameter 'app_id' when calling SwitchboardActionsApi.pass_control" end # verify the required parameter 'conversation_id' is set if @api_client.config.client_side_validation && conversation_id.nil? fail ArgumentError, "Missing the required parameter 'conversation_id' when calling SwitchboardActionsApi.pass_control" end # verify the required parameter 'pass_control_body' is set if @api_client.config.client_side_validation && pass_control_body.nil? fail ArgumentError, "Missing the required parameter 'pass_control_body' when calling SwitchboardActionsApi.pass_control" end # resource path local_var_path = '/v2/apps/{appId}/conversations/{conversationId}/passControl'.sub('{' + 'appId' + '}', CGI.escape(app_id.to_s)).sub('{' + 'conversationId' + '}', CGI.escape(conversation_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(pass_control_body) # return_type return_type = opts[:debug_return_type] || 'Object' # auth_names auth_names = opts[:debug_auth_names] || ['basicAuth', 'bearerAuth'] = opts.merge( :operation => :"SwitchboardActionsApi.pass_control", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: SwitchboardActionsApi#pass_control\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#release_control(app_id, conversation_id, opts = {}) ⇒ Object
Release Control The releaseControl action releases the control of the conversation by nullifying its switchboard state. When using integration auth scope, a 403 is returned if the active switchboard integration is not the authenticated integration.
266 267 268 269 |
# File 'lib/sunshine-conversations-client/api/switchboard_actions_api.rb', line 266 def release_control(app_id, conversation_id, opts = {}) data, _status_code, _headers = release_control_with_http_info(app_id, conversation_id, opts) data end |
#release_control_with_http_info(app_id, conversation_id, opts = {}) ⇒ Array<(Object, Integer, Hash)>
Release Control The releaseControl action releases the control of the conversation by nullifying its switchboard state. When using integration auth scope, a 403 is returned if the active switchboard integration is not the authenticated integration.
278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 |
# File 'lib/sunshine-conversations-client/api/switchboard_actions_api.rb', line 278 def release_control_with_http_info(app_id, conversation_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SwitchboardActionsApi.release_control ...' end # verify the required parameter 'app_id' is set if @api_client.config.client_side_validation && app_id.nil? fail ArgumentError, "Missing the required parameter 'app_id' when calling SwitchboardActionsApi.release_control" end # verify the required parameter 'conversation_id' is set if @api_client.config.client_side_validation && conversation_id.nil? fail ArgumentError, "Missing the required parameter 'conversation_id' when calling SwitchboardActionsApi.release_control" end # resource path local_var_path = '/v2/apps/{appId}/conversations/{conversationId}/releaseControl'.sub('{' + 'appId' + '}', CGI.escape(app_id.to_s)).sub('{' + 'conversationId' + '}', CGI.escape(conversation_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'release_control_body']) # return_type return_type = opts[:debug_return_type] || 'Object' # auth_names auth_names = opts[:debug_auth_names] || ['basicAuth', 'bearerAuth'] = opts.merge( :operation => :"SwitchboardActionsApi.release_control", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: SwitchboardActionsApi#release_control\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |