Class: Invoicetronic_Sdk::LogApi

Inherits:
Object
  • Object
show all
Defined in:
lib/invoicetronic_sdk/api/log_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ LogApi

Returns a new instance of LogApi.



19
20
21
# File 'lib/invoicetronic_sdk/api/log_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/invoicetronic_sdk/api/log_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#log_get(opts = {}) ⇒ Array<Event>

List events Retrieve a paginated list of log events. Results can be filtered by various criteria such as endpoint, method, status code, and date ranges. Logs record every API request. They are preserved for 15 days. You can also view logs in the Events section of the [Dashboard](dashboard.invoicetronic.com).

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :company_id (Integer)

    Company id

  • :endpoint (String)
  • :method (String)
  • :api_verion (Integer)

    Api version

  • :status_code (Integer)

    Response status code

  • :date_created_from (Time)

    UTC ISO 8601 (2024-11-29T12:34:56Z)

  • :date_created_to (Time)

    UTC ISO 8601 (2024-11-29T12:34:56Z)

  • :page (Integer)

    Page number. (default to 1)

  • :page_size (Integer)

    Items per page. Cannot be greater than 200. (default to 100)

  • :sort (String)

    Sort by field. Prefix with &#39;-&#39; for descending order.

  • :query (String)
  • :success (Boolean)
  • :date_time_from (Time)

    Date and time of the event

  • :date_time_to (Time)

    Date and time of the event

  • :user_agent (String)

Returns:



41
42
43
44
# File 'lib/invoicetronic_sdk/api/log_api.rb', line 41

def log_get(opts = {})
  data, _status_code, _headers = log_get_with_http_info(opts)
  data
end

#log_get_with_http_info(opts = {}) ⇒ Array<(Array<Event>, Integer, Hash)>

List events Retrieve a paginated list of log events. Results can be filtered by various criteria such as endpoint, method, status code, and date ranges. Logs record every API request. They are preserved for 15 days. You can also view logs in the Events section of the [Dashboard](dashboard.invoicetronic.com).

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :company_id (Integer)

    Company id

  • :endpoint (String)
  • :method (String)
  • :api_verion (Integer)

    Api version

  • :status_code (Integer)

    Response status code

  • :date_created_from (Time)

    UTC ISO 8601 (2024-11-29T12:34:56Z)

  • :date_created_to (Time)

    UTC ISO 8601 (2024-11-29T12:34:56Z)

  • :page (Integer)

    Page number. (default to 1)

  • :page_size (Integer)

    Items per page. Cannot be greater than 200. (default to 100)

  • :sort (String)

    Sort by field. Prefix with &#39;-&#39; for descending order.

  • :query (String)
  • :success (Boolean)
  • :date_time_from (Time)

    Date and time of the event

  • :date_time_to (Time)

    Date and time of the event

  • :user_agent (String)

Returns:

  • (Array<(Array<Event>, Integer, Hash)>)

    Array<Event> data, response status code and response headers



65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# File 'lib/invoicetronic_sdk/api/log_api.rb', line 65

def log_get_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LogApi.log_get ...'
  end
  # resource path
  local_var_path = '/log'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'company_id'] = opts[:'company_id'] if !opts[:'company_id'].nil?
  query_params[:'endpoint'] = opts[:'endpoint'] if !opts[:'endpoint'].nil?
  query_params[:'method'] = opts[:'method'] if !opts[:'method'].nil?
  query_params[:'api_verion'] = opts[:'api_verion'] if !opts[:'api_verion'].nil?
  query_params[:'status_code'] = opts[:'status_code'] if !opts[:'status_code'].nil?
  query_params[:'date_created_from'] = opts[:'date_created_from'] if !opts[:'date_created_from'].nil?
  query_params[:'date_created_to'] = opts[:'date_created_to'] if !opts[:'date_created_to'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
  query_params[:'query'] = opts[:'query'] if !opts[:'query'].nil?
  query_params[:'success'] = opts[:'success'] if !opts[:'success'].nil?
  query_params[:'date_time_from'] = opts[:'date_time_from'] if !opts[:'date_time_from'].nil?
  query_params[:'date_time_to'] = opts[:'date_time_to'] if !opts[:'date_time_to'].nil?
  query_params[:'user_agent'] = opts[:'user_agent'] if !opts[:'user_agent'].nil?

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Array<Event>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Basic']

  new_options = opts.merge(
    :operation => :"LogApi.log_get",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LogApi#log_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#log_id_get(id, opts = {}) ⇒ Event

Get an event by id Retrieve a log event by its internal id. Logs record every API request. They are preserved for 15 days. You can also view logs in the Events section of the [Dashboard](dashboard.invoicetronic.com).

Parameters:

  • id (Integer)

    Item id

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

    the optional parameters

Returns:



129
130
131
132
# File 'lib/invoicetronic_sdk/api/log_api.rb', line 129

def log_id_get(id, opts = {})
  data, _status_code, _headers = log_id_get_with_http_info(id, opts)
  data
end

#log_id_get_with_http_info(id, opts = {}) ⇒ Array<(Event, Integer, Hash)>

Get an event by id Retrieve a log event by its internal id. Logs record every API request. They are preserved for 15 days. You can also view logs in the Events section of the [Dashboard](dashboard.invoicetronic.com).

Parameters:

  • id (Integer)

    Item id

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

    the optional parameters

Returns:

  • (Array<(Event, Integer, Hash)>)

    Event data, response status code and response headers



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
# File 'lib/invoicetronic_sdk/api/log_api.rb', line 139

def log_id_get_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LogApi.log_id_get ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling LogApi.log_id_get"
  end
  # resource path
  local_var_path = '/log/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Event'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Basic']

  new_options = opts.merge(
    :operation => :"LogApi.log_id_get",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LogApi#log_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end