class TransferZero::LogsApi
Attributes
Public Class Methods
# File lib/transferzero-sdk/api/logs_api.rb, line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
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
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 [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
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 `created_at` timeframe. Example: `/v1/recipients?created_at_from=2018-06-06&created_at_to=2018-06-08` @option opts [String] :created_at_to End date to filter recipients by created_at range Allows filtering results by the specified `created_at` timeframe. Example: `/v1/recipients?created_at_from=2018-06-06&created_at_to=2018-06-08` @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
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 `created_at` timeframe. Example: `/v1/recipients?created_at_from=2018-06-06&created_at_to=2018-06-08` @option opts [String] :created_at_to End date to filter recipients by created_at range Allows filtering results by the specified `created_at` timeframe. Example: `/v1/recipients?created_at_from=2018-06-06&created_at_to=2018-06-08` @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