class SunshineConversationsClient::SwitchboardsApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/sunshine-conversations-client/api/switchboards_api.rb, line 16
def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Public Instance Methods

create_switchboard(app_id, opts = {}) click to toggle source

Create Switchboard Create a switchboard. @param app_id [String] Identifies the app. @param [Hash] opts the optional parameters @return [SwitchboardResponse]

# File lib/sunshine-conversations-client/api/switchboards_api.rb, line 24
def create_switchboard(app_id, opts = {})
  data, _status_code, _headers = create_switchboard_with_http_info(app_id, opts)
  data
end
create_switchboard_with_http_info(app_id, opts = {}) click to toggle source

Create Switchboard Create a switchboard. @param app_id [String] Identifies the app. @param [Hash] opts the optional parameters @return [Array<(SwitchboardResponse, Integer, Hash)>] SwitchboardResponse data, response status code and response headers

# File lib/sunshine-conversations-client/api/switchboards_api.rb, line 34
def create_switchboard_with_http_info(app_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SwitchboardsApi.create_switchboard ...'
  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 SwitchboardsApi.create_switchboard"
  end
  # resource path
  local_var_path = '/v2/apps/{appId}/switchboards'.sub('{' + 'appId' + '}', CGI.escape(app_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'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'SwitchboardResponse' 

  # auth_names
  auth_names = opts[:auth_names] || ['basicAuth', 'bearerAuth']

  new_options = opts.merge(
    :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, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SwitchboardsApi#create_switchboard\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
delete_switchboard(app_id, switchboard_id, opts = {}) click to toggle source

Delete Switchboard Deletes the switchboard and all its switchboard integrations. The integrations linked to these switchboard integrations are not deleted and will start receiving all conversation events. @param app_id [String] Identifies the app. @param switchboard_id [String] Identifies the switchboard. @param [Hash] opts the optional parameters @return [Object]

# File lib/sunshine-conversations-client/api/switchboards_api.rb, line 87
def delete_switchboard(app_id, switchboard_id, opts = {})
  data, _status_code, _headers = delete_switchboard_with_http_info(app_id, switchboard_id, opts)
  data
end
delete_switchboard_with_http_info(app_id, switchboard_id, opts = {}) click to toggle source

Delete Switchboard Deletes the switchboard and all its switchboard integrations. The integrations linked to these switchboard integrations are not deleted and will start receiving all conversation events. @param app_id [String] Identifies the app. @param switchboard_id [String] Identifies the switchboard. @param [Hash] opts the optional parameters @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers

# File lib/sunshine-conversations-client/api/switchboards_api.rb, line 98
def delete_switchboard_with_http_info(app_id, switchboard_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SwitchboardsApi.delete_switchboard ...'
  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 SwitchboardsApi.delete_switchboard"
  end
  # verify the required parameter 'switchboard_id' is set
  if @api_client.config.client_side_validation && switchboard_id.nil?
    fail ArgumentError, "Missing the required parameter 'switchboard_id' when calling SwitchboardsApi.delete_switchboard"
  end
  # resource path
  local_var_path = '/v2/apps/{appId}/switchboards/{switchboardId}'.sub('{' + 'appId' + '}', CGI.escape(app_id.to_s)).sub('{' + 'switchboardId' + '}', CGI.escape(switchboard_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'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'Object' 

  # auth_names
  auth_names = opts[:auth_names] || ['basicAuth', 'bearerAuth']

  new_options = opts.merge(
    :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(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SwitchboardsApi#delete_switchboard\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
list_switchboards(app_id, opts = {}) click to toggle source

List Switchboards Lists all switchboards belonging to the app. @param app_id [String] Identifies the app. @param [Hash] opts the optional parameters @return [SwitchboardListResponse]

# File lib/sunshine-conversations-client/api/switchboards_api.rb, line 154
def list_switchboards(app_id, opts = {})
  data, _status_code, _headers = list_switchboards_with_http_info(app_id, opts)
  data
end
list_switchboards_with_http_info(app_id, opts = {}) click to toggle source

List Switchboards Lists all switchboards belonging to the app. @param app_id [String] Identifies the app. @param [Hash] opts the optional parameters @return [Array<(SwitchboardListResponse, Integer, Hash)>] SwitchboardListResponse data, response status code and response headers

# File lib/sunshine-conversations-client/api/switchboards_api.rb, line 164
def list_switchboards_with_http_info(app_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SwitchboardsApi.list_switchboards ...'
  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 SwitchboardsApi.list_switchboards"
  end
  # resource path
  local_var_path = '/v2/apps/{appId}/switchboards'.sub('{' + 'appId' + '}', CGI.escape(app_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'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'SwitchboardListResponse' 

  # auth_names
  auth_names = opts[:auth_names] || ['basicAuth', 'bearerAuth']

  new_options = opts.merge(
    :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(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SwitchboardsApi#list_switchboards\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
update_switchboard(app_id, switchboard_id, switchboard_update_body, opts = {}) click to toggle source

Update Switchboard Updates a switchboard record. @param app_id [String] Identifies the app. @param switchboard_id [String] Identifies the switchboard. @param switchboard_update_body [SwitchboardUpdateBody] @param [Hash] opts the optional parameters @return [SwitchboardResponse]

# File lib/sunshine-conversations-client/api/switchboards_api.rb, line 218
def update_switchboard(app_id, switchboard_id, switchboard_update_body, opts = {})
  data, _status_code, _headers = update_switchboard_with_http_info(app_id, switchboard_id, switchboard_update_body, opts)
  data
end
update_switchboard_with_http_info(app_id, switchboard_id, switchboard_update_body, opts = {}) click to toggle source

Update Switchboard Updates a switchboard record. @param app_id [String] Identifies the app. @param switchboard_id [String] Identifies the switchboard. @param switchboard_update_body [SwitchboardUpdateBody] @param [Hash] opts the optional parameters @return [Array<(SwitchboardResponse, Integer, Hash)>] SwitchboardResponse data, response status code and response headers

# File lib/sunshine-conversations-client/api/switchboards_api.rb, line 230
def update_switchboard_with_http_info(app_id, switchboard_id, switchboard_update_body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SwitchboardsApi.update_switchboard ...'
  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 SwitchboardsApi.update_switchboard"
  end
  # verify the required parameter 'switchboard_id' is set
  if @api_client.config.client_side_validation && switchboard_id.nil?
    fail ArgumentError, "Missing the required parameter 'switchboard_id' when calling SwitchboardsApi.update_switchboard"
  end
  # verify the required parameter 'switchboard_update_body' is set
  if @api_client.config.client_side_validation && switchboard_update_body.nil?
    fail ArgumentError, "Missing the required parameter 'switchboard_update_body' when calling SwitchboardsApi.update_switchboard"
  end
  # resource path
  local_var_path = '/v2/apps/{appId}/switchboards/{switchboardId}'.sub('{' + 'appId' + '}', CGI.escape(app_id.to_s)).sub('{' + 'switchboardId' + '}', CGI.escape(switchboard_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'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] || @api_client.object_to_http_body(switchboard_update_body) 

  # return_type
  return_type = opts[:return_type] || 'SwitchboardResponse' 

  # auth_names
  auth_names = opts[:auth_names] || ['basicAuth', 'bearerAuth']

  new_options = opts.merge(
    :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(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SwitchboardsApi#update_switchboard\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end