class TransferZero::LogsApi

Attributes

api_client[RW]

Public Class Methods

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

Public Instance Methods

get_webhook_log(webhook_log_id, opts = {}) click to toggle source

Fetch an individual webhook log Returns a single webhook log based on the webhook log ID. @param webhook_log_id ID of the webhook log to retrieve Example: `/v1/logs/9d1ad631-f34a-4cff-9a7e-2c83e3a556df` @param [Hash] opts the optional parameters @return [WebhookLogResponse]

# File lib/transferzero-sdk/api/logs_api.rb, line 29
def get_webhook_log(webhook_log_id, opts = {})
  data, _status_code, _headers = get_webhook_log_with_http_info(webhook_log_id, opts)
  data
end
get_webhook_log_with_http_info(webhook_log_id, opts = {}) click to toggle source

Fetch an individual webhook log Returns a single webhook log based on the webhook log ID. @param webhook_log_id ID of the webhook log to retrieve Example: &#x60;/v1/logs/9d1ad631-f34a-4cff-9a7e-2c83e3a556df&#x60; @param [Hash] opts the optional parameters @return [Array<(WebhookLogResponse, Fixnum, Hash)>] WebhookLogResponse data, response status code and response headers

# File lib/transferzero-sdk/api/logs_api.rb, line 39
def get_webhook_log_with_http_info(webhook_log_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LogsApi.get_webhook_log ...'
  end
  # verify the required parameter 'webhook_log_id' is set
  if @api_client.config.client_side_validation && webhook_log_id.nil?
    fail ArgumentError, "Missing the required parameter 'webhook_log_id' when calling LogsApi.get_webhook_log"
  end
  # resource path
  local_var_path = '/logs/{Webhook Log ID}'.sub('{' + 'Webhook Log ID' + '}', webhook_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 => 'WebhookLogResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LogsApi#get_webhook_log\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_webhook_logs(opts = {}) click to toggle source

Fetch a list of webhook logs Returns a list of webhook logs. Response includes pagination. @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 [WebhookLogListResponse]

# File lib/transferzero-sdk/api/logs_api.rb, line 86
def get_webhook_logs(opts = {})
  data, _status_code, _headers = get_webhook_logs_with_http_info(opts)
  data
end
get_webhook_logs_with_http_info(opts = {}) click to toggle source

Fetch a list of webhook logs Returns a list of webhook logs. Response includes pagination. @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<(WebhookLogListResponse, Fixnum, Hash)>] WebhookLogListResponse data, response status code and response headers

# File lib/transferzero-sdk/api/logs_api.rb, line 99
def get_webhook_logs_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LogsApi.get_webhook_logs ...'
  end
  # resource path
  local_var_path = '/logs/webhooks'

  # 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 => 'WebhookLogListResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LogsApi#get_webhook_logs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end