Class: PhoneComClient::CallLogsApi
- Inherits:
-
Object
- Object
- PhoneComClient::CallLogsApi
- Defined in:
- lib/phone_com_client/api/call_logs_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#get_account_call_logs(account_id, call_id, opts = {}) ⇒ CallLogFull
Show details of an individual Call Log entry Show details of an individual Call Log entry.
-
#get_account_call_logs_with_http_info(account_id, call_id, opts = {}) ⇒ Array<(CallLogFull, Fixnum, Hash)>
Show details of an individual Call Log entry Show details of an individual Call Log entry.
-
#initialize(api_client = ApiClient.default) ⇒ CallLogsApi
constructor
A new instance of CallLogsApi.
-
#list_account_call_logs(account_id, opts = {}) ⇒ ListCallLogs
Get a list of call details associated with your account Get a list of call details associated with your account.
-
#list_account_call_logs_with_http_info(account_id, opts = {}) ⇒ Array<(ListCallLogs, Fixnum, Hash)>
Get a list of call details associated with your account Get a list of call details associated with your account.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ CallLogsApi
Returns a new instance of CallLogsApi.
19 20 21 |
# File 'lib/phone_com_client/api/call_logs_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/phone_com_client/api/call_logs_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#get_account_call_logs(account_id, call_id, opts = {}) ⇒ CallLogFull
Show details of an individual Call Log entry Show details of an individual Call Log entry. See Call Logs for more detail.
28 29 30 31 |
# File 'lib/phone_com_client/api/call_logs_api.rb', line 28 def get_account_call_logs(account_id, call_id, opts = {}) data, _status_code, _headers = get_account_call_logs_with_http_info(account_id, call_id, opts) data end |
#get_account_call_logs_with_http_info(account_id, call_id, opts = {}) ⇒ Array<(CallLogFull, Fixnum, Hash)>
Show details of an individual Call Log entry Show details of an individual Call Log entry. See Call Logs for more detail.
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 |
# File 'lib/phone_com_client/api/call_logs_api.rb', line 39 def get_account_call_logs_with_http_info(account_id, call_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CallLogsApi.get_account_call_logs ...' end # verify the required parameter 'account_id' is set if @api_client.config.client_side_validation && account_id.nil? fail ArgumentError, "Missing the required parameter 'account_id' when calling CallLogsApi.get_account_call_logs" end # verify the required parameter 'call_id' is set if @api_client.config.client_side_validation && call_id.nil? fail ArgumentError, "Missing the required parameter 'call_id' when calling CallLogsApi.get_account_call_logs" end # resource path local_var_path = '/accounts/{account_id}/call-logs/{call_id}'.sub('{' + 'account_id' + '}', account_id.to_s).sub('{' + 'call_id' + '}', call_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 = ['apiKey'] 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 => 'CallLogFull') if @api_client.config.debugging @api_client.config.logger.debug "API called: CallLogsApi#get_account_call_logs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_account_call_logs(account_id, opts = {}) ⇒ ListCallLogs
Get a list of call details associated with your account Get a list of call details associated with your account. See Call Logs for more detail.
100 101 102 103 |
# File 'lib/phone_com_client/api/call_logs_api.rb', line 100 def list_account_call_logs(account_id, opts = {}) data, _status_code, _headers = list_account_call_logs_with_http_info(account_id, opts) data end |
#list_account_call_logs_with_http_info(account_id, opts = {}) ⇒ Array<(ListCallLogs, Fixnum, Hash)>
Get a list of call details associated with your account Get a list of call details associated with your account. See Call Logs for more detail.
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 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 |
# File 'lib/phone_com_client/api/call_logs_api.rb', line 123 def list_account_call_logs_with_http_info(account_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CallLogsApi.list_account_call_logs ...' end # verify the required parameter 'account_id' is set if @api_client.config.client_side_validation && account_id.nil? fail ArgumentError, "Missing the required parameter 'account_id' when calling CallLogsApi.list_account_call_logs" end if @api_client.config.client_side_validation && !opts[:'filters_created_at'].nil? && opts[:'filters_created_at'] !~ Regexp.new(/^eq:.*|^ne:.*|^lt:.*|^gt:.*|^lte:.*|^gte:.*|^starts-with:.*|^ends-with:.*|^contains:.*|^not-starts-with:.*|^not-ends-with:.*|^not-contains:.*|^between:.*,.*|^not-between:.*,.*/) fail ArgumentError, "invalid value for 'opts[:\"filters_created_at\"]' when calling CallLogsApi.list_account_call_logs, must conform to the pattern /^eq:.*|^ne:.*|^lt:.*|^gt:.*|^lte:.*|^gte:.*|^starts-with:.*|^ends-with:.*|^contains:.*|^not-starts-with:.*|^not-ends-with:.*|^not-contains:.*|^between:.*,.*|^not-between:.*,.*/." end if @api_client.config.client_side_validation && !opts[:'filters_direction'].nil? && opts[:'filters_direction'] !~ Regexp.new(/^eq:.*|^ne:.*|^lt:.*|^gt:.*|^lte:.*|^gte:.*|^starts-with:.*|^ends-with:.*|^contains:.*|^not-starts-with:.*|^not-ends-with:.*|^not-contains:.*|^between:.*,.*|^not-between:.*,.*/) fail ArgumentError, "invalid value for 'opts[:\"filters_direction\"]' when calling CallLogsApi.list_account_call_logs, must conform to the pattern /^eq:.*|^ne:.*|^lt:.*|^gt:.*|^lte:.*|^gte:.*|^starts-with:.*|^ends-with:.*|^contains:.*|^not-starts-with:.*|^not-ends-with:.*|^not-contains:.*|^between:.*,.*|^not-between:.*,.*/." end if @api_client.config.client_side_validation && !opts[:'filters_called_number'].nil? && opts[:'filters_called_number'] !~ Regexp.new(/^eq:.*|^ne:.*|^lt:.*|^gt:.*|^lte:.*|^gte:.*|^starts-with:.*|^ends-with:.*|^contains:.*|^not-starts-with:.*|^not-ends-with:.*|^not-contains:.*|^between:.*,.*|^not-between:.*,.*/) fail ArgumentError, "invalid value for 'opts[:\"filters_called_number\"]' when calling CallLogsApi.list_account_call_logs, must conform to the pattern /^eq:.*|^ne:.*|^lt:.*|^gt:.*|^lte:.*|^gte:.*|^starts-with:.*|^ends-with:.*|^contains:.*|^not-starts-with:.*|^not-ends-with:.*|^not-contains:.*|^between:.*,.*|^not-between:.*,.*/." end if @api_client.config.client_side_validation && !opts[:'filters_type'].nil? && opts[:'filters_type'] !~ Regexp.new(/^eq:.*|^ne:.*|^lt:.*|^gt:.*|^lte:.*|^gte:.*|^starts-with:.*|^ends-with:.*|^contains:.*|^not-starts-with:.*|^not-ends-with:.*|^not-contains:.*|^between:.*,.*|^not-between:.*,.*/) fail ArgumentError, "invalid value for 'opts[:\"filters_type\"]' when calling CallLogsApi.list_account_call_logs, must conform to the pattern /^eq:.*|^ne:.*|^lt:.*|^gt:.*|^lte:.*|^gte:.*|^starts-with:.*|^ends-with:.*|^contains:.*|^not-starts-with:.*|^not-ends-with:.*|^not-contains:.*|^between:.*,.*|^not-between:.*,.*/." end if @api_client.config.client_side_validation && !opts[:'sort_id'].nil? && opts[:'sort_id'] !~ Regexp.new(/asc|desc/) fail ArgumentError, "invalid value for 'opts[:\"sort_id\"]' when calling CallLogsApi.list_account_call_logs, must conform to the pattern /asc|desc/." end if @api_client.config.client_side_validation && !opts[:'sort_start_time'].nil? && opts[:'sort_start_time'] !~ Regexp.new(/asc|desc/) fail ArgumentError, "invalid value for 'opts[:\"sort_start_time\"]' when calling CallLogsApi.list_account_call_logs, must conform to the pattern /asc|desc/." end if @api_client.config.client_side_validation && !opts[:'sort_created_at'].nil? && opts[:'sort_created_at'] !~ Regexp.new(/asc|desc/) fail ArgumentError, "invalid value for 'opts[:\"sort_created_at\"]' when calling CallLogsApi.list_account_call_logs, must conform to the pattern /asc|desc/." end # resource path local_var_path = '/accounts/{account_id}/call-logs'.sub('{' + 'account_id' + '}', account_id.to_s) # query parameters query_params = {} query_params[:'filters[id]'] = @api_client.build_collection_param(opts[:'filters_id'], :multi) if !opts[:'filters_id'].nil? query_params[:'filters[start_time]'] = @api_client.build_collection_param(opts[:'filters_start_time'], :multi) if !opts[:'filters_start_time'].nil? query_params[:'filters[created_at]'] = opts[:'filters_created_at'] if !opts[:'filters_created_at'].nil? query_params[:'filters[direction]'] = opts[:'filters_direction'] if !opts[:'filters_direction'].nil? query_params[:'filters[called_number]'] = opts[:'filters_called_number'] if !opts[:'filters_called_number'].nil? query_params[:'filters[type]'] = opts[:'filters_type'] if !opts[:'filters_type'].nil? query_params[:'filters[extension]'] = @api_client.build_collection_param(opts[:'filters_extension'], :multi) if !opts[:'filters_extension'].nil? query_params[:'sort[id]'] = opts[:'sort_id'] if !opts[:'sort_id'].nil? query_params[:'sort[start_time]'] = opts[:'sort_start_time'] if !opts[:'sort_start_time'].nil? query_params[:'sort[created_at]'] = opts[:'sort_created_at'] if !opts[:'sort_created_at'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? query_params[:'fields'] = opts[:'fields'] if !opts[:'fields'].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 = ['apiKey'] 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 => 'ListCallLogs') if @api_client.config.debugging @api_client.config.logger.debug "API called: CallLogsApi#list_account_call_logs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |