class Bitpesa::APILogsApi

Attributes

api_client[RW]

Public Class Methods

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

Public Instance Methods

get_api_log(api_log_id, opts = {}) click to toggle source

Fetch an individual API log Returns a single API log based on the API log ID. @param api_log_id ID of the API log to retrieve Example: `/v1/api_logs/00485ce9-532b-45e7-8518-7e5582242407` @param [Hash] opts the optional parameters @return [ApiLogResponse]

# File lib/bitpesa-sdk/api/api_logs_api.rb, line 29
def get_api_log(api_log_id, opts = {})
  data, _status_code, _headers = get_api_log_with_http_info(api_log_id, opts)
  data
end
get_api_log_with_http_info(api_log_id, opts = {}) click to toggle source

Fetch an individual API log Returns a single API log based on the API log ID. @param api_log_id ID of the API log to retrieve Example: &#x60;/v1/api_logs/00485ce9-532b-45e7-8518-7e5582242407&#x60; @param [Hash] opts the optional parameters @return [Array<(ApiLogResponse, Fixnum, Hash)>] ApiLogResponse data, response status code and response headers

# File lib/bitpesa-sdk/api/api_logs_api.rb, line 39
def get_api_log_with_http_info(api_log_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: APILogsApi.get_api_log ...'
  end
  # verify the required parameter 'api_log_id' is set
  if @api_client.config.client_side_validation && api_log_id.nil?
    fail ArgumentError, "Missing the required parameter 'api_log_id' when calling APILogsApi.get_api_log"
  end
  # resource path
  local_var_path = '/api_logs/{API Log ID}'.sub('{' + 'API Log ID' + '}', api_log_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'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['AuthorizationKey', 'AuthorizationNonce', 'AuthorizationSecret', 'AuthorizationSignature']
  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 => 'ApiLogResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: APILogsApi#get_api_log\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_api_logs(opts = {}) click to toggle source

Fetch a list of API logs Returns a list of API logs. Also includes information relating to the original request. @param [Hash] opts the optional parameters @option opts [Integer] :page The page number to request (defaults to 1) @option opts [Integer] :per The number of results to load per page (defaults to 10) @option opts [String] :created_at_from Start date to filter recipients by created_at range Allows filtering results by the specified &#x60;created_at&#x60; timeframe. Example: &#x60;/v1/recipients?created_at_from&#x3D;2018-06-06&amp;created_at_to&#x3D;2018-06-08&#x60; @option opts [String] :created_at_to End date to filter recipients by created_at range Allows filtering results by the specified &#x60;created_at&#x60; timeframe. Example: &#x60;/v1/recipients?created_at_from&#x3D;2018-06-06&amp;created_at_to&#x3D;2018-06-08&#x60; @return [ApiLogListResponse]

# File lib/bitpesa-sdk/api/api_logs_api.rb, line 86
def get_api_logs(opts = {})
  data, _status_code, _headers = get_api_logs_with_http_info(opts)
  data
end
get_api_logs_with_http_info(opts = {}) click to toggle source

Fetch a list of API logs Returns a list of API logs. Also includes information relating to the original request. @param [Hash] opts the optional parameters @option opts [Integer] :page The page number to request (defaults to 1) @option opts [Integer] :per The number of results to load per page (defaults to 10) @option opts [String] :created_at_from Start date to filter recipients by created_at range Allows filtering results by the specified &#x60;created_at&#x60; timeframe. Example: &#x60;/v1/recipients?created_at_from&#x3D;2018-06-06&amp;created_at_to&#x3D;2018-06-08&#x60; @option opts [String] :created_at_to End date to filter recipients by created_at range Allows filtering results by the specified &#x60;created_at&#x60; timeframe. Example: &#x60;/v1/recipients?created_at_from&#x3D;2018-06-06&amp;created_at_to&#x3D;2018-06-08&#x60; @return [Array<(ApiLogListResponse, Fixnum, Hash)>] ApiLogListResponse data, response status code and response headers

# File lib/bitpesa-sdk/api/api_logs_api.rb, line 99
def get_api_logs_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: APILogsApi.get_api_logs ...'
  end
  # resource path
  local_var_path = '/api_logs'

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

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['AuthorizationKey', 'AuthorizationNonce', 'AuthorizationSecret', 'AuthorizationSignature']
  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 => 'ApiLogListResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: APILogsApi#get_api_logs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end