Class: Daily::LogsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/daily-ruby/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/daily-ruby/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/daily-ruby/api/logs_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#list_api_logs(opts = {}) ⇒ ListAPILogs200Response

/logs/api

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :starting_after (String)

    Given the log ID, will return all records after that ID. See [pagination docs](../../rest-api#pagination)

  • :ending_before (String)

    Given the log ID, will return all records before that ID. See [pagination docs](../../rest-api#pagination)

  • :limit (Integer)

    Limit the number of logs and/or metrics returned (default to 20)

  • :source (String)

    The source of the given logs, either `"api"` or `"webhook"` (default to ‘"api"’)

  • :url (String)

    Either the webhook server URL, or the API endpoint that was logged

Returns:



30
31
32
33
# File 'lib/daily-ruby/api/logs_api.rb', line 30

def list_api_logs(opts = {})
  data, _status_code, _headers = list_api_logs_with_http_info(opts)
  data
end

#list_api_logs_with_http_info(opts = {}) ⇒ Array<(ListAPILogs200Response, Integer, Hash)>

/logs/api

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :starting_after (String)

    Given the log ID, will return all records after that ID. See [pagination docs](../../rest-api#pagination)

  • :ending_before (String)

    Given the log ID, will return all records before that ID. See [pagination docs](../../rest-api#pagination)

  • :limit (Integer)

    Limit the number of logs and/or metrics returned (default to 20)

  • :source (String)

    The source of the given logs, either &#x60;&quot;api&quot;&#x60; or &#x60;&quot;webhook&quot;&#x60; (default to ‘"api"’)

  • :url (String)

    Either the webhook server URL, or the API endpoint that was logged

Returns:

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

    ListAPILogs200Response data, response status code and response headers



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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# File 'lib/daily-ruby/api/logs_api.rb', line 43

def list_api_logs_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LogsApi.list_api_logs ...'
  end
  # resource path
  local_var_path = '/logs/api'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'starting_after'] = opts[:'starting_after'] if !opts[:'starting_after'].nil?
  query_params[:'ending_before'] = opts[:'ending_before'] if !opts[:'ending_before'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?
  query_params[:'url'] = opts[:'url'] if !opts[:'url'].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] || 'ListAPILogs200Response'

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

  new_options = opts.merge(
    :operation => :"LogsApi.list_api_logs",
    :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: LogsApi#list_api_logs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_logs(opts = {}) ⇒ Object

/logs

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :include_logs (Boolean)

    If true, you get a &quot;logs&quot; array in the results (default to true)

  • :include_metrics (Boolean)

    If true, results have &quot;metrics&quot; array (default to false)

  • :user_session_id (String)

    Filters by this user ID (aka &quot;participant ID&quot;). Required if &#x60;mtgSessionId&#x60; is not present in the request

  • :mtg_session_id (String)

    Filters by this Session ID. Required if &#x60;userSessionId&#x60; is not present in the request

  • :log_level (String)

    Filters by the given log level name

  • :order (String)

    ASC or DESC, case insensitive (default to ‘DESC’)

  • :start_time (Integer)

    A JS timestamp (ms since epoch in UTC)

  • :end_time (Integer)

    A JS timestamp (ms since epoch), defaults to the current time

  • :limit (Integer)

    Limit the number of logs and/or metrics returned (default to 20)

  • :offset (Integer)

    Number of records to skip before returning results (default to 0)

Returns:

  • (Object)


105
106
107
108
# File 'lib/daily-ruby/api/logs_api.rb', line 105

def list_logs(opts = {})
  data, _status_code, _headers = list_logs_with_http_info(opts)
  data
end

#list_logs_with_http_info(opts = {}) ⇒ Array<(Object, Integer, Hash)>

/logs

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :include_logs (Boolean)

    If true, you get a &quot;logs&quot; array in the results (default to true)

  • :include_metrics (Boolean)

    If true, results have &quot;metrics&quot; array (default to false)

  • :user_session_id (String)

    Filters by this user ID (aka &quot;participant ID&quot;). Required if &#x60;mtgSessionId&#x60; is not present in the request

  • :mtg_session_id (String)

    Filters by this Session ID. Required if &#x60;userSessionId&#x60; is not present in the request

  • :log_level (String)

    Filters by the given log level name

  • :order (String)

    ASC or DESC, case insensitive (default to ‘DESC’)

  • :start_time (Integer)

    A JS timestamp (ms since epoch in UTC)

  • :end_time (Integer)

    A JS timestamp (ms since epoch), defaults to the current time

  • :limit (Integer)

    Limit the number of logs and/or metrics returned (default to 20)

  • :offset (Integer)

    Number of records to skip before returning results (default to 0)

Returns:

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

    Object data, response status code and response headers



123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
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
# File 'lib/daily-ruby/api/logs_api.rb', line 123

def list_logs_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LogsApi.list_logs ...'
  end
  allowable_values = ["ERROR", "INFO", "DEBUG", "unknown_default_open_api"]
  if @api_client.config.client_side_validation && opts[:'log_level'] && !allowable_values.include?(opts[:'log_level'])
    fail ArgumentError, "invalid value for \"log_level\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/logs'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'includeLogs'] = opts[:'include_logs'] if !opts[:'include_logs'].nil?
  query_params[:'includeMetrics'] = opts[:'include_metrics'] if !opts[:'include_metrics'].nil?
  query_params[:'userSessionId'] = opts[:'user_session_id'] if !opts[:'user_session_id'].nil?
  query_params[:'mtgSessionId'] = opts[:'mtg_session_id'] if !opts[:'mtg_session_id'].nil?
  query_params[:'logLevel'] = opts[:'log_level'] if !opts[:'log_level'].nil?
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
  query_params[:'startTime'] = opts[:'start_time'] if !opts[:'start_time'].nil?
  query_params[:'endTime'] = opts[:'end_time'] if !opts[:'end_time'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].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] || 'Object'

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

  new_options = opts.merge(
    :operation => :"LogsApi.list_logs",
    :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: LogsApi#list_logs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end