class ClickSendClient::SMSApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/clicksend_client/api/sms_api.rb, line 19
def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Public Instance Methods

sms_cancel_all_put(opts = {}) click to toggle source

Update all scheduled message as cancelled Update all scheduled message as cancelled @param [Hash] opts the optional parameters @return [String]

# File lib/clicksend_client/api/sms_api.rb, line 26
def sms_cancel_all_put(opts = {})
  data, _status_code, _headers = sms_cancel_all_put_with_http_info(opts)
  data
end
sms_cancel_all_put_with_http_info(opts = {}) click to toggle source

Update all scheduled message as cancelled Update all scheduled message as cancelled @param [Hash] opts the optional parameters @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers

# File lib/clicksend_client/api/sms_api.rb, line 35
def sms_cancel_all_put_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SMSApi.sms_cancel_all_put ...'
  end
  # resource path
  local_var_path = '/sms/cancel-all'

  # query parameters
  query_params = {}

  # header parameters
  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 = {}

  # http body (model)
  post_body = nil
  auth_names = ['BasicAuth']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'String')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SMSApi#sms_cancel_all_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
sms_cancel_by_message_id_put(message_id, opts = {}) click to toggle source

Update scheduled message as cancelled Update scheduled message as cancelled @param message_id The message ID you want to cancel @param [Hash] opts the optional parameters @return [String]

# File lib/clicksend_client/api/sms_api.rb, line 75
def sms_cancel_by_message_id_put(message_id, opts = {})
  data, _status_code, _headers = sms_cancel_by_message_id_put_with_http_info(message_id, opts)
  data
end
sms_cancel_by_message_id_put_with_http_info(message_id, opts = {}) click to toggle source

Update scheduled message as cancelled Update scheduled message as cancelled @param message_id The message ID you want to cancel @param [Hash] opts the optional parameters @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers

# File lib/clicksend_client/api/sms_api.rb, line 85
def sms_cancel_by_message_id_put_with_http_info(message_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SMSApi.sms_cancel_by_message_id_put ...'
  end
  # verify the required parameter 'message_id' is set
  if @api_client.config.client_side_validation && message_id.nil?
    fail ArgumentError, "Missing the required parameter 'message_id' when calling SMSApi.sms_cancel_by_message_id_put"
  end
  # resource path
  local_var_path = '/sms/{message_id}/cancel'.sub('{' + 'message_id' + '}', message_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  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 = {}

  # http body (model)
  post_body = nil
  auth_names = ['BasicAuth']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'String')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SMSApi#sms_cancel_by_message_id_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
sms_history_export_get(filename, opts = {}) click to toggle source

Export all sms history Export all sms history @param filename Filename to download history as @param [Hash] opts the optional parameters @return [String]

# File lib/clicksend_client/api/sms_api.rb, line 129
def sms_history_export_get(filename, opts = {})
  data, _status_code, _headers = sms_history_export_get_with_http_info(filename, opts)
  data
end
sms_history_export_get_with_http_info(filename, opts = {}) click to toggle source

Export all sms history Export all sms history @param filename Filename to download history as @param [Hash] opts the optional parameters @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers

# File lib/clicksend_client/api/sms_api.rb, line 139
def sms_history_export_get_with_http_info(filename, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SMSApi.sms_history_export_get ...'
  end
  # verify the required parameter 'filename' is set
  if @api_client.config.client_side_validation && filename.nil?
    fail ArgumentError, "Missing the required parameter 'filename' when calling SMSApi.sms_history_export_get"
  end
  # resource path
  local_var_path = '/sms/history/export'

  # query parameters
  query_params = {}
  query_params[:'filename'] = filename

  # header parameters
  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 = {}

  # http body (model)
  post_body = nil
  auth_names = ['BasicAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'String')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SMSApi#sms_history_export_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
sms_history_get(opts = {}) click to toggle source

Get all sms history Get all sms history @param [Hash] opts the optional parameters @option opts [String] :q Custom query Example: from:{number},status_code:201. @option opts [Integer] :date_from Start date @option opts [Integer] :date_to End date @option opts [Integer] :page Page number (default to 1) @option opts [Integer] :limit Number of records per page (default to 10) @return [String]

# File lib/clicksend_client/api/sms_api.rb, line 188
def sms_history_get(opts = {})
  data, _status_code, _headers = sms_history_get_with_http_info(opts)
  data
end
sms_history_get_with_http_info(opts = {}) click to toggle source

Get all sms history Get all sms history @param [Hash] opts the optional parameters @option opts [String] :q Custom query Example: from:{number},status_code:201. @option opts [Integer] :date_from Start date @option opts [Integer] :date_to End date @option opts [Integer] :page Page number @option opts [Integer] :limit Number of records per page @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers

# File lib/clicksend_client/api/sms_api.rb, line 202
def sms_history_get_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SMSApi.sms_history_get ...'
  end
  if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
    fail ArgumentError, 'invalid value for "opts[:"page"]" when calling SMSApi.sms_history_get, must be greater than or equal to 1.'
  end

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling SMSApi.sms_history_get, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/sms/history'

  # query parameters
  query_params = {}
  query_params[:'q'] = opts[:'q'] if !opts[:'q'].nil?
  query_params[:'date_from'] = opts[:'date_from'] if !opts[:'date_from'].nil?
  query_params[:'date_to'] = opts[:'date_to'] if !opts[:'date_to'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?

  # header parameters
  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 = {}

  # http body (model)
  post_body = nil
  auth_names = ['BasicAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'String')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SMSApi#sms_history_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
sms_inbound_get(opts = {}) click to toggle source

Get all inbound sms Get all inbound sms @param [Hash] opts the optional parameters @option opts [String] :q Your keyword or query. @option opts [Integer] :page Page number (default to 1) @option opts [Integer] :limit Number of records per page (default to 10) @return [String]

# File lib/clicksend_client/api/sms_api.rb, line 257
def sms_inbound_get(opts = {})
  data, _status_code, _headers = sms_inbound_get_with_http_info(opts)
  data
end
sms_inbound_get_with_http_info(opts = {}) click to toggle source

Get all inbound sms Get all inbound sms @param [Hash] opts the optional parameters @option opts [String] :q Your keyword or query. @option opts [Integer] :page Page number @option opts [Integer] :limit Number of records per page @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers

# File lib/clicksend_client/api/sms_api.rb, line 269
def sms_inbound_get_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SMSApi.sms_inbound_get ...'
  end
  if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
    fail ArgumentError, 'invalid value for "opts[:"page"]" when calling SMSApi.sms_inbound_get, must be greater than or equal to 1.'
  end

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling SMSApi.sms_inbound_get, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/sms/inbound'

  # query parameters
  query_params = {}
  query_params[:'q'] = opts[:'q'] if !opts[:'q'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?

  # header parameters
  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 = {}

  # http body (model)
  post_body = nil
  auth_names = ['BasicAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'String')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SMSApi#sms_inbound_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
sms_inbound_post(url, opts = {}) click to toggle source

Create inbound sms Create inbound sms @param url Url model @param [Hash] opts the optional parameters @return [String]

# File lib/clicksend_client/api/sms_api.rb, line 320
def sms_inbound_post(url, opts = {})
  data, _status_code, _headers = sms_inbound_post_with_http_info(url, opts)
  data
end
sms_inbound_post_with_http_info(url, opts = {}) click to toggle source

Create inbound sms Create inbound sms @param url Url model @param [Hash] opts the optional parameters @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers

# File lib/clicksend_client/api/sms_api.rb, line 330
def sms_inbound_post_with_http_info(url, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SMSApi.sms_inbound_post ...'
  end
  # verify the required parameter 'url' is set
  if @api_client.config.client_side_validation && url.nil?
    fail ArgumentError, "Missing the required parameter 'url' when calling SMSApi.sms_inbound_post"
  end
  # resource path
  local_var_path = '/sms/inbound'

  # query parameters
  query_params = {}

  # header parameters
  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 = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(url)
  auth_names = ['BasicAuth']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'String')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SMSApi#sms_inbound_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
sms_inbound_read_by_message_id_put(message_id, opts = {}) click to toggle source

Mark inbound SMS as read Mark specific inbound SMS as read @param message_id Message ID @param [Hash] opts the optional parameters @return [String]

# File lib/clicksend_client/api/sms_api.rb, line 374
def sms_inbound_read_by_message_id_put(message_id, opts = {})
  data, _status_code, _headers = sms_inbound_read_by_message_id_put_with_http_info(message_id, opts)
  data
end
sms_inbound_read_by_message_id_put_with_http_info(message_id, opts = {}) click to toggle source

Mark inbound SMS as read Mark specific inbound SMS as read @param message_id Message ID @param [Hash] opts the optional parameters @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers

# File lib/clicksend_client/api/sms_api.rb, line 384
def sms_inbound_read_by_message_id_put_with_http_info(message_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SMSApi.sms_inbound_read_by_message_id_put ...'
  end
  # verify the required parameter 'message_id' is set
  if @api_client.config.client_side_validation && message_id.nil?
    fail ArgumentError, "Missing the required parameter 'message_id' when calling SMSApi.sms_inbound_read_by_message_id_put"
  end
  # resource path
  local_var_path = '/sms/inbound-read/{message_id}'.sub('{' + 'message_id' + '}', message_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  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 = {}

  # http body (model)
  post_body = nil
  auth_names = ['BasicAuth']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'String')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SMSApi#sms_inbound_read_by_message_id_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
sms_inbound_read_put(opts = {}) click to toggle source

Mark inbound SMS as read Mark all inbound SMS as read optionally before a certain date @param [Hash] opts the optional parameters @option opts [DateBefore] :date_before DateBefore model @return [String]

# File lib/clicksend_client/api/sms_api.rb, line 428
def sms_inbound_read_put(opts = {})
  data, _status_code, _headers = sms_inbound_read_put_with_http_info(opts)
  data
end
sms_inbound_read_put_with_http_info(opts = {}) click to toggle source

Mark inbound SMS as read Mark all inbound SMS as read optionally before a certain date @param [Hash] opts the optional parameters @option opts [DateBefore] :date_before DateBefore model @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers

# File lib/clicksend_client/api/sms_api.rb, line 438
def sms_inbound_read_put_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SMSApi.sms_inbound_read_put ...'
  end
  # resource path
  local_var_path = '/sms/inbound-read'

  # query parameters
  query_params = {}

  # header parameters
  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 = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(opts[:'date_before'])
  auth_names = ['BasicAuth']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'String')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SMSApi#sms_inbound_read_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
sms_price_post(sms_messages, opts = {}) click to toggle source

Calculate sms price Calculate sms price @param sms_messages SmsMessageCollection model @param [Hash] opts the optional parameters @return [String]

# File lib/clicksend_client/api/sms_api.rb, line 478
def sms_price_post(sms_messages, opts = {})
  data, _status_code, _headers = sms_price_post_with_http_info(sms_messages, opts)
  data
end
sms_price_post_with_http_info(sms_messages, opts = {}) click to toggle source

Calculate sms price Calculate sms price @param sms_messages SmsMessageCollection model @param [Hash] opts the optional parameters @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers

# File lib/clicksend_client/api/sms_api.rb, line 488
def sms_price_post_with_http_info(sms_messages, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SMSApi.sms_price_post ...'
  end
  # verify the required parameter 'sms_messages' is set
  if @api_client.config.client_side_validation && sms_messages.nil?
    fail ArgumentError, "Missing the required parameter 'sms_messages' when calling SMSApi.sms_price_post"
  end
  # resource path
  local_var_path = '/sms/price'

  # query parameters
  query_params = {}

  # header parameters
  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 = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(sms_messages)
  auth_names = ['BasicAuth']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'String')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SMSApi#sms_price_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
sms_receipts_by_message_id_get(message_id, opts = {}) click to toggle source

Get a Specific Delivery Receipt Get a Specific Delivery Receipt @param message_id Message ID @param [Hash] opts the optional parameters @return [String]

# File lib/clicksend_client/api/sms_api.rb, line 532
def sms_receipts_by_message_id_get(message_id, opts = {})
  data, _status_code, _headers = sms_receipts_by_message_id_get_with_http_info(message_id, opts)
  data
end
sms_receipts_by_message_id_get_with_http_info(message_id, opts = {}) click to toggle source

Get a Specific Delivery Receipt Get a Specific Delivery Receipt @param message_id Message ID @param [Hash] opts the optional parameters @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers

# File lib/clicksend_client/api/sms_api.rb, line 542
def sms_receipts_by_message_id_get_with_http_info(message_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SMSApi.sms_receipts_by_message_id_get ...'
  end
  # verify the required parameter 'message_id' is set
  if @api_client.config.client_side_validation && message_id.nil?
    fail ArgumentError, "Missing the required parameter 'message_id' when calling SMSApi.sms_receipts_by_message_id_get"
  end
  # resource path
  local_var_path = '/sms/receipts/{message_id}'.sub('{' + 'message_id' + '}', message_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  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 = {}

  # http body (model)
  post_body = nil
  auth_names = ['BasicAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'String')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SMSApi#sms_receipts_by_message_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
sms_receipts_get(opts = {}) click to toggle source

Get all delivery receipts Get all delivery receipts @param [Hash] opts the optional parameters @option opts [Integer] :page Page number (default to 1) @option opts [Integer] :limit Number of records per page (default to 10) @return [String]

# File lib/clicksend_client/api/sms_api.rb, line 587
def sms_receipts_get(opts = {})
  data, _status_code, _headers = sms_receipts_get_with_http_info(opts)
  data
end
sms_receipts_get_with_http_info(opts = {}) click to toggle source

Get all delivery receipts Get all delivery receipts @param [Hash] opts the optional parameters @option opts [Integer] :page Page number @option opts [Integer] :limit Number of records per page @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers

# File lib/clicksend_client/api/sms_api.rb, line 598
def sms_receipts_get_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SMSApi.sms_receipts_get ...'
  end
  if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
    fail ArgumentError, 'invalid value for "opts[:"page"]" when calling SMSApi.sms_receipts_get, must be greater than or equal to 1.'
  end

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling SMSApi.sms_receipts_get, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/sms/receipts'

  # query parameters
  query_params = {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?

  # header parameters
  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 = {}

  # http body (model)
  post_body = nil
  auth_names = ['BasicAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'String')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SMSApi#sms_receipts_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
sms_receipts_post(url, opts = {}) click to toggle source

Add a delivery receipt Add a delivery receipt @param url Url model @param [Hash] opts the optional parameters @return [String]

# File lib/clicksend_client/api/sms_api.rb, line 648
def sms_receipts_post(url, opts = {})
  data, _status_code, _headers = sms_receipts_post_with_http_info(url, opts)
  data
end
sms_receipts_post_with_http_info(url, opts = {}) click to toggle source

Add a delivery receipt Add a delivery receipt @param url Url model @param [Hash] opts the optional parameters @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers

# File lib/clicksend_client/api/sms_api.rb, line 658
def sms_receipts_post_with_http_info(url, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SMSApi.sms_receipts_post ...'
  end
  # verify the required parameter 'url' is set
  if @api_client.config.client_side_validation && url.nil?
    fail ArgumentError, "Missing the required parameter 'url' when calling SMSApi.sms_receipts_post"
  end
  # resource path
  local_var_path = '/sms/receipts'

  # query parameters
  query_params = {}

  # header parameters
  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 = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(url)
  auth_names = ['BasicAuth']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'String')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SMSApi#sms_receipts_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
sms_receipts_read_put(opts = {}) click to toggle source

Mark delivery receipts as read Mark delivery receipts as read @param [Hash] opts the optional parameters @option opts [DateBefore] :date_before DateBefore model @return [String]

# File lib/clicksend_client/api/sms_api.rb, line 702
def sms_receipts_read_put(opts = {})
  data, _status_code, _headers = sms_receipts_read_put_with_http_info(opts)
  data
end
sms_receipts_read_put_with_http_info(opts = {}) click to toggle source

Mark delivery receipts as read Mark delivery receipts as read @param [Hash] opts the optional parameters @option opts [DateBefore] :date_before DateBefore model @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers

# File lib/clicksend_client/api/sms_api.rb, line 712
def sms_receipts_read_put_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SMSApi.sms_receipts_read_put ...'
  end
  # resource path
  local_var_path = '/sms/receipts-read'

  # query parameters
  query_params = {}

  # header parameters
  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 = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(opts[:'date_before'])
  auth_names = ['BasicAuth']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'String')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SMSApi#sms_receipts_read_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
sms_send_post(sms_messages, opts = {}) click to toggle source

Send sms message(s)

# Send one or more SMS messages  You can post up to 1000 messages with each API call. You can send to a mix of contacts and contact lists, as long as the total number of recipients is up to 1000.  The response contains status and details for each recipient.  *Refer to [Application Status Codes](https://dashboard.clicksend.com/#/signup/step1/) for the possible response message status strings.*

@param sms_messages SmsMessageCollection model @param [Hash] opts the optional parameters @return [String]

# File lib/clicksend_client/api/sms_api.rb, line 752
def sms_send_post(sms_messages, opts = {})
  data, _status_code, _headers = sms_send_post_with_http_info(sms_messages, opts)
  data
end
sms_send_post_with_http_info(sms_messages, opts = {}) click to toggle source

Send sms message(s)

# Send one or more SMS messages  You can post up to 1000 messages with each API call. You can send to a mix of contacts and contact lists, as long as the total number of recipients is up to 1000.  The response contains status and details for each recipient.  *Refer to [Application Status Codes](https://dashboard.clicksend.com/#/signup/step1/) for the possible response message status strings.*

@param sms_messages SmsMessageCollection model @param [Hash] opts the optional parameters @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers

# File lib/clicksend_client/api/sms_api.rb, line 762
def sms_send_post_with_http_info(sms_messages, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SMSApi.sms_send_post ...'
  end
  # verify the required parameter 'sms_messages' is set
  if @api_client.config.client_side_validation && sms_messages.nil?
    fail ArgumentError, "Missing the required parameter 'sms_messages' when calling SMSApi.sms_send_post"
  end
  # resource path
  local_var_path = '/sms/send'

  # query parameters
  query_params = {}

  # header parameters
  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 = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(sms_messages)
  auth_names = ['BasicAuth']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'String')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SMSApi#sms_send_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
sms_templates_by_template_id_delete(template_id, opts = {}) click to toggle source

Delete sms template Delete sms template @param template_id Template id @param [Hash] opts the optional parameters @return [String]

# File lib/clicksend_client/api/sms_api.rb, line 806
def sms_templates_by_template_id_delete(template_id, opts = {})
  data, _status_code, _headers = sms_templates_by_template_id_delete_with_http_info(template_id, opts)
  data
end
sms_templates_by_template_id_delete_with_http_info(template_id, opts = {}) click to toggle source

Delete sms template Delete sms template @param template_id Template id @param [Hash] opts the optional parameters @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers

# File lib/clicksend_client/api/sms_api.rb, line 816
def sms_templates_by_template_id_delete_with_http_info(template_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SMSApi.sms_templates_by_template_id_delete ...'
  end
  # verify the required parameter 'template_id' is set
  if @api_client.config.client_side_validation && template_id.nil?
    fail ArgumentError, "Missing the required parameter 'template_id' when calling SMSApi.sms_templates_by_template_id_delete"
  end
  # resource path
  local_var_path = '/sms/templates/{template_id}'.sub('{' + 'template_id' + '}', template_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  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 = {}

  # http body (model)
  post_body = nil
  auth_names = ['BasicAuth']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'String')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SMSApi#sms_templates_by_template_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
sms_templates_by_template_id_put(template_id, sms_template, opts = {}) click to toggle source

Update sms template Update sms template @param template_id Template id @param sms_template Template item @param [Hash] opts the optional parameters @return [String]

# File lib/clicksend_client/api/sms_api.rb, line 861
def sms_templates_by_template_id_put(template_id, sms_template, opts = {})
  data, _status_code, _headers = sms_templates_by_template_id_put_with_http_info(template_id, sms_template, opts)
  data
end
sms_templates_by_template_id_put_with_http_info(template_id, sms_template, opts = {}) click to toggle source

Update sms template Update sms template @param template_id Template id @param sms_template Template item @param [Hash] opts the optional parameters @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers

# File lib/clicksend_client/api/sms_api.rb, line 872
def sms_templates_by_template_id_put_with_http_info(template_id, sms_template, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SMSApi.sms_templates_by_template_id_put ...'
  end
  # verify the required parameter 'template_id' is set
  if @api_client.config.client_side_validation && template_id.nil?
    fail ArgumentError, "Missing the required parameter 'template_id' when calling SMSApi.sms_templates_by_template_id_put"
  end
  # verify the required parameter 'sms_template' is set
  if @api_client.config.client_side_validation && sms_template.nil?
    fail ArgumentError, "Missing the required parameter 'sms_template' when calling SMSApi.sms_templates_by_template_id_put"
  end
  # resource path
  local_var_path = '/sms/templates/{template_id}'.sub('{' + 'template_id' + '}', template_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  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 = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(sms_template)
  auth_names = ['BasicAuth']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'String')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SMSApi#sms_templates_by_template_id_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
sms_templates_get(opts = {}) click to toggle source

Get lists of all sms templates Get lists of all sms templates @param [Hash] opts the optional parameters @option opts [Integer] :page Page number (default to 1) @option opts [Integer] :limit Number of records per page (default to 10) @return [String]

# File lib/clicksend_client/api/sms_api.rb, line 921
def sms_templates_get(opts = {})
  data, _status_code, _headers = sms_templates_get_with_http_info(opts)
  data
end
sms_templates_get_with_http_info(opts = {}) click to toggle source

Get lists of all sms templates Get lists of all sms templates @param [Hash] opts the optional parameters @option opts [Integer] :page Page number @option opts [Integer] :limit Number of records per page @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers

# File lib/clicksend_client/api/sms_api.rb, line 932
def sms_templates_get_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SMSApi.sms_templates_get ...'
  end
  if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
    fail ArgumentError, 'invalid value for "opts[:"page"]" when calling SMSApi.sms_templates_get, must be greater than or equal to 1.'
  end

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling SMSApi.sms_templates_get, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/sms/templates'

  # query parameters
  query_params = {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?

  # header parameters
  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 = {}

  # http body (model)
  post_body = nil
  auth_names = ['BasicAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'String')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SMSApi#sms_templates_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
sms_templates_post(sms_template, opts = {}) click to toggle source

Create sms template Create sms template @param sms_template SmsTemplate model @param [Hash] opts the optional parameters @return [String]

# File lib/clicksend_client/api/sms_api.rb, line 982
def sms_templates_post(sms_template, opts = {})
  data, _status_code, _headers = sms_templates_post_with_http_info(sms_template, opts)
  data
end
sms_templates_post_with_http_info(sms_template, opts = {}) click to toggle source

Create sms template Create sms template @param sms_template SmsTemplate model @param [Hash] opts the optional parameters @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers

# File lib/clicksend_client/api/sms_api.rb, line 992
def sms_templates_post_with_http_info(sms_template, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SMSApi.sms_templates_post ...'
  end
  # verify the required parameter 'sms_template' is set
  if @api_client.config.client_side_validation && sms_template.nil?
    fail ArgumentError, "Missing the required parameter 'sms_template' when calling SMSApi.sms_templates_post"
  end
  # resource path
  local_var_path = '/sms/templates'

  # query parameters
  query_params = {}

  # header parameters
  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 = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(sms_template)
  auth_names = ['BasicAuth']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'String')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SMSApi#sms_templates_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end