Class: Zernio::LogsApi
- Inherits:
-
Object
- Object
- Zernio::LogsApi
- Defined in:
- lib/zernio-sdk/api/logs_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#initialize(api_client = ApiClient.default) ⇒ LogsApi
constructor
A new instance of LogsApi.
-
#list_logs(opts = {}) ⇒ ListLogs200Response
List activity logs Unified logs endpoint.
-
#list_logs_with_http_info(opts = {}) ⇒ Array<(ListLogs200Response, Integer, Hash)>
List activity logs Unified logs endpoint.
Constructor Details
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/zernio-sdk/api/logs_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#list_logs(opts = {}) ⇒ ListLogs200Response
List activity logs Unified logs endpoint. Returns logs for publishing, connections, webhooks, and messaging. Filter by type, platform, status, and time range. Logs are retained for 90 days.
42 43 44 45 |
# File 'lib/zernio-sdk/api/logs_api.rb', line 42 def list_logs(opts = {}) data, _status_code, _headers = list_logs_with_http_info(opts) data end |
#list_logs_with_http_info(opts = {}) ⇒ Array<(ListLogs200Response, Integer, Hash)>
List activity logs Unified logs endpoint. Returns logs for publishing, connections, webhooks, and messaging. Filter by type, platform, status, and time range. Logs are retained for 90 days.
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 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 |
# File 'lib/zernio-sdk/api/logs_api.rb', line 67 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 = ["all", "publishing", "connections", "webhooks", "messaging", "workflow_event", "api_request"] if @api_client.config.client_side_validation && opts[:'type'] && !allowable_values.include?(opts[:'type']) fail ArgumentError, "invalid value for \"type\", must be one of #{allowable_values}" end allowable_values = ["success", "failed", "pending", "skipped", "all"] if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status']) fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}" end allowable_values = ["tiktok", "instagram", "whatsapp", "facebook", "youtube", "linkedin", "twitter", "threads", "pinterest", "reddit", "bluesky", "googlebusiness", "telegram", "snapchat", "all"] if @api_client.config.client_side_validation && opts[:'platform'] && !allowable_values.include?(opts[:'platform']) fail ArgumentError, "invalid value for \"platform\", must be one of #{allowable_values}" end if @api_client.config.client_side_validation && !opts[:'days'].nil? && opts[:'days'] > 90 fail ArgumentError, 'invalid value for "opts[:"days"]" when calling LogsApi.list_logs, must be smaller than or equal to 90.' end if @api_client.config.client_side_validation && !opts[:'days'].nil? && opts[:'days'] < 1 fail ArgumentError, 'invalid value for "opts[:"days"]" when calling LogsApi.list_logs, must be greater than or equal to 1.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling LogsApi.list_logs, must be smaller than or equal to 100.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling LogsApi.list_logs, must be greater than or equal to 1.' end if @api_client.config.client_side_validation && !opts[:'skip'].nil? && opts[:'skip'] < 0 fail ArgumentError, 'invalid value for "opts[:"skip"]" when calling LogsApi.list_logs, must be greater than or equal to 0.' end # resource path local_var_path = '/v1/logs' # query parameters query_params = opts[:query_params] || {} query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil? query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil? query_params[:'platform'] = opts[:'platform'] if !opts[:'platform'].nil? query_params[:'action'] = opts[:'action'] if !opts[:'action'].nil? query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil? query_params[:'days'] = opts[:'days'] if !opts[:'days'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'skip'] = opts[:'skip'] if !opts[:'skip'].nil? query_params[:'account_id'] = opts[:'account_id'] if !opts[:'account_id'].nil? query_params[:'event'] = opts[:'event'] if !opts[:'event'].nil? query_params[:'request_id'] = opts[:'request_id'] if !opts[:'request_id'].nil? query_params[:'from'] = opts[:'from'] if !opts[:'from'].nil? query_params[:'to'] = opts[:'to'] if !opts[:'to'].nil? query_params[:'status_code'] = opts[:'status_code'] if !opts[:'status_code'].nil? query_params[:'api_key_id'] = opts[:'api_key_id'] if !opts[:'api_key_id'].nil? query_params[:'include_read_receipts'] = opts[:'include_read_receipts'] if !opts[:'include_read_receipts'].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] || 'ListLogs200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = 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, ) 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 |