Class: TransferZero::LogsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/transferzero-sdk/api/logs_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ LogsApi

Returns a new instance of LogsApi.



19
20
21
# File 'lib/transferzero-sdk/api/logs_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/transferzero-sdk/api/logs_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#get_webhook_log(webhook_log_id, opts = {}) ⇒ WebhookLogResponse

Fetch an individual webhook log Returns a single webhook log based on the webhook log ID.

Parameters:

  • webhook_log_id

    ID of the webhook log to retrieve Example: `/v1/logs/9d1ad631-f34a-4cff-9a7e-2c83e3a556df`

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



29
30
31
32
# 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 = {}) ⇒ Array<(WebhookLogResponse, Fixnum, Hash)>

Fetch an individual webhook log Returns a single webhook log based on the webhook log ID.

Parameters:

  • webhook_log_id

    ID of the webhook log to retrieve Example: &#x60;/v1/logs/9d1ad631-f34a-4cff-9a7e-2c83e3a556df&#x60;

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(WebhookLogResponse, Fixnum, Hash)>)

    WebhookLogResponse data, response status code and response headers



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
# 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 = {}) ⇒ WebhookLogListResponse

Fetch a list of webhook logs Returns a list of webhook logs. Response includes pagination.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    The page number to request (defaults to 1)

  • :per (Integer)

    The number of results to load per page (defaults to 10)

  • :created_at_from (String)

    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;

  • :created_at_to (String)

    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;

Returns:



86
87
88
89
# 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 = {}) ⇒ Array<(WebhookLogListResponse, Fixnum, Hash)>

Fetch a list of webhook logs Returns a list of webhook logs. Response includes pagination.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    The page number to request (defaults to 1)

  • :per (Integer)

    The number of results to load per page (defaults to 10)

  • :created_at_from (String)

    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;

  • :created_at_to (String)

    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;

Returns:

  • (Array<(WebhookLogListResponse, Fixnum, Hash)>)

    WebhookLogListResponse data, response status code and response headers



99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# 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