Class: Norbelys::AnalyticsApi
- Inherits:
-
Object
- Object
- Norbelys::AnalyticsApi
- Defined in:
- lib/norbelys/api/analytics_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#analytics_query(analytics_query, opts = {}) ⇒ AnalyticsQueryResult
Run an analytics query The ONE read door for all event-derived analytics — choose a named
queryfrom the catalog and pass itsparams; the tenant is auto-scoped (you can never read another org). -
#analytics_query_with_http_info(analytics_query, opts = {}) ⇒ Array<(AnalyticsQueryResult, Integer, Hash)>
Run an analytics query The ONE read door for all event-derived analytics — choose a named `query` from the catalog and pass its `params`; the tenant is auto-scoped (you can never read another org).
-
#initialize(api_client = ApiClient.default) ⇒ AnalyticsApi
constructor
A new instance of AnalyticsApi.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ AnalyticsApi
Returns a new instance of AnalyticsApi.
19 20 21 |
# File 'lib/norbelys/api/analytics_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/norbelys/api/analytics_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#analytics_query(analytics_query, opts = {}) ⇒ AnalyticsQueryResult
Run an analytics query
The ONE read door for all event-derived analytics — choose a named query from the catalog and pass its params; the tenant is auto-scoped (you can never read another org). Returns flat rows + a count. Covers activity feeds, message/person event traces, time-series, campaign funnels, sender & inbox-provider health, A/B performance, warmup placement, and DMARC rollups. The query field documents the full catalog and which params each one takes.
28 29 30 31 |
# File 'lib/norbelys/api/analytics_api.rb', line 28 def analytics_query(analytics_query, opts = {}) data, _status_code, _headers = analytics_query_with_http_info(analytics_query, opts) data end |
#analytics_query_with_http_info(analytics_query, opts = {}) ⇒ Array<(AnalyticsQueryResult, Integer, Hash)>
Run an analytics query The ONE read door for all event-derived analytics — choose a named `query` from the catalog and pass its `params`; the tenant is auto-scoped (you can never read another org). Returns flat rows + a count. Covers activity feeds, message/person event traces, time-series, campaign funnels, sender & inbox-provider health, A/B performance, warmup placement, and DMARC rollups. The `query` field documents the full catalog and which params each one takes.
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 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
# File 'lib/norbelys/api/analytics_api.rb', line 39 def analytics_query_with_http_info(analytics_query, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AnalyticsApi.analytics_query ...' end # verify the required parameter 'analytics_query' is set if @api_client.config.client_side_validation && analytics_query.nil? fail ArgumentError, "Missing the required parameter 'analytics_query' when calling AnalyticsApi.analytics_query" end if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length > 255 fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling AnalyticsApi.analytics_query, the character length must be smaller than or equal to 255.' end # resource path local_var_path = '/analytics/query' # 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'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(analytics_query) # return_type return_type = opts[:debug_return_type] || 'AnalyticsQueryResult' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AnalyticsApi.analytics_query", :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(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AnalyticsApi#analytics_query\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |