trustcomponent 0.0.1.beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.md +21 -0
  3. data/README.md +78 -0
  4. data/lib/trustcomponent/captcha.rb +24 -0
  5. data/lib/trustcomponent/client.rb +44 -0
  6. data/lib/trustcomponent/errors.rb +58 -0
  7. data/lib/trustcomponent/http_middleware.rb +83 -0
  8. data/lib/trustcomponent.rb +15 -0
  9. data/lib/trustcomponent_generated/api/analytics_server_events_api.rb +90 -0
  10. data/lib/trustcomponent_generated/api/analytics_websites_api.rb +527 -0
  11. data/lib/trustcomponent_generated/api/captcha_verifications_api.rb +88 -0
  12. data/lib/trustcomponent_generated/api/monitoring_heartbeats_api.rb +89 -0
  13. data/lib/trustcomponent_generated/api/platform_events_api.rb +106 -0
  14. data/lib/trustcomponent_generated/api/tax_validation_schedules_api.rb +147 -0
  15. data/lib/trustcomponent_generated/api/tax_validation_validation_results_api.rb +83 -0
  16. data/lib/trustcomponent_generated/api/tax_validation_validations_api.rb +156 -0
  17. data/lib/trustcomponent_generated/api_client.rb +441 -0
  18. data/lib/trustcomponent_generated/api_error.rb +58 -0
  19. data/lib/trustcomponent_generated/api_model_base.rb +88 -0
  20. data/lib/trustcomponent_generated/configuration.rb +400 -0
  21. data/lib/trustcomponent_generated/models/analytics_event_category_enum.rb +52 -0
  22. data/lib/trustcomponent_generated/models/analytics_realtime.rb +251 -0
  23. data/lib/trustcomponent_generated/models/analytics_realtime_page.rb +193 -0
  24. data/lib/trustcomponent_generated/models/analytics_realtime_point.rb +193 -0
  25. data/lib/trustcomponent_generated/models/analytics_server_event_batch_create_params.rb +295 -0
  26. data/lib/trustcomponent_generated/models/analytics_server_event_batch_event_commerce_create_params.rb +366 -0
  27. data/lib/trustcomponent_generated/models/analytics_server_event_batch_event_commerce_product_create_params.rb +298 -0
  28. data/lib/trustcomponent_generated/models/analytics_server_event_batch_event_create_params.rb +508 -0
  29. data/lib/trustcomponent_generated/models/analytics_server_event_batch_event_error_create_params.rb +269 -0
  30. data/lib/trustcomponent_generated/models/analytics_server_event_batch_event_refund_create_params.rb +211 -0
  31. data/lib/trustcomponent_generated/models/analytics_server_event_batch_result.rb +194 -0
  32. data/lib/trustcomponent_generated/models/analytics_server_event_batch_result_drop_reason_enum.rb +52 -0
  33. data/lib/trustcomponent_generated/models/analytics_server_event_batch_result_dropped.rb +213 -0
  34. data/lib/trustcomponent_generated/models/analytics_stats_breakdown.rb +351 -0
  35. data/lib/trustcomponent_generated/models/analytics_stats_breakdown_row.rb +201 -0
  36. data/lib/trustcomponent_generated/models/analytics_stats_breakdown_row_page.rb +226 -0
  37. data/lib/trustcomponent_generated/models/analytics_stats_conversions.rb +249 -0
  38. data/lib/trustcomponent_generated/models/analytics_stats_conversions_goal.rb +260 -0
  39. data/lib/trustcomponent_generated/models/analytics_stats_conversions_goal_revenue.rb +193 -0
  40. data/lib/trustcomponent_generated/models/analytics_stats_dimension_enum.rb +69 -0
  41. data/lib/trustcomponent_generated/models/analytics_stats_filter_match_mode_enum.rb +40 -0
  42. data/lib/trustcomponent_generated/models/analytics_stats_filter_operator_enum.rb +45 -0
  43. data/lib/trustcomponent_generated/models/analytics_stats_granularity_enum.rb +40 -0
  44. data/lib/trustcomponent_generated/models/analytics_stats_overview.rb +282 -0
  45. data/lib/trustcomponent_generated/models/analytics_stats_timeseries.rb +270 -0
  46. data/lib/trustcomponent_generated/models/analytics_stats_timeseries_point.rb +192 -0
  47. data/lib/trustcomponent_generated/models/analytics_stats_totals.rb +307 -0
  48. data/lib/trustcomponent_generated/models/analytics_website.rb +249 -0
  49. data/lib/trustcomponent_generated/models/analytics_websites_page.rb +249 -0
  50. data/lib/trustcomponent_generated/models/captcha_verification_result.rb +350 -0
  51. data/lib/trustcomponent_generated/models/platform_event.rb +439 -0
  52. data/lib/trustcomponent_generated/models/platform_event_actor.rb +218 -0
  53. data/lib/trustcomponent_generated/models/platform_event_actor_automation.rb +214 -0
  54. data/lib/trustcomponent_generated/models/platform_event_actor_automation_kind_enum.rb +41 -0
  55. data/lib/trustcomponent_generated/models/platform_event_actor_type_enum.rb +43 -0
  56. data/lib/trustcomponent_generated/models/platform_event_change.rb +263 -0
  57. data/lib/trustcomponent_generated/models/platform_event_change_operation_enum.rb +43 -0
  58. data/lib/trustcomponent_generated/models/platform_event_origin.rb +263 -0
  59. data/lib/trustcomponent_generated/models/platform_event_ref.rb +204 -0
  60. data/lib/trustcomponent_generated/models/platform_event_source_enum.rb +44 -0
  61. data/lib/trustcomponent_generated/models/platform_events_page.rb +314 -0
  62. data/lib/trustcomponent_generated/models/tax_validation_match_status_enum.rb +44 -0
  63. data/lib/trustcomponent_generated/models/tax_validation_provider_enum.rb +46 -0
  64. data/lib/trustcomponent_generated/models/tax_validation_provider_status_enum.rb +51 -0
  65. data/lib/trustcomponent_generated/models/tax_validation_schedule.rb +423 -0
  66. data/lib/trustcomponent_generated/models/tax_validation_schedule_create_params.rb +321 -0
  67. data/lib/trustcomponent_generated/models/tax_validation_tax_address.rb +188 -0
  68. data/lib/trustcomponent_generated/models/tax_validation_tax_identifier_scheme_enum.rb +49 -0
  69. data/lib/trustcomponent_generated/models/tax_validation_validation.rb +372 -0
  70. data/lib/trustcomponent_generated/models/tax_validation_validation_address_match.rb +290 -0
  71. data/lib/trustcomponent_generated/models/tax_validation_validation_batch_create_params.rb +176 -0
  72. data/lib/trustcomponent_generated/models/tax_validation_validation_create_params.rb +292 -0
  73. data/lib/trustcomponent_generated/models/tax_validation_validation_frequency_enum.rb +41 -0
  74. data/lib/trustcomponent_generated/models/tax_validation_validation_input.rb +322 -0
  75. data/lib/trustcomponent_generated/models/tax_validation_validation_match.rb +238 -0
  76. data/lib/trustcomponent_generated/models/tax_validation_validation_mode_enum.rb +40 -0
  77. data/lib/trustcomponent_generated/models/tax_validation_validation_outcome_enum.rb +44 -0
  78. data/lib/trustcomponent_generated/models/tax_validation_validation_request_status_enum.rb +44 -0
  79. data/lib/trustcomponent_generated/models/tax_validation_validation_response_data.rb +177 -0
  80. data/lib/trustcomponent_generated/models/tax_validation_validation_result.rb +459 -0
  81. data/lib/trustcomponent_generated/models/tax_validation_validation_schedule_attach_params.rb +225 -0
  82. data/lib/trustcomponent_generated/models/tax_validation_verification_method_enum.rb +40 -0
  83. data/lib/trustcomponent_generated/modules.rb +51 -0
  84. data/lib/trustcomponent_generated/version.rb +15 -0
  85. data/lib/trustcomponent_generated.rb +110 -0
  86. metadata +190 -0
@@ -0,0 +1,527 @@
1
+ =begin
2
+ #TrustComponent API
3
+
4
+ #The public API of every TrustComponent module, authenticated with an API key (`ak_…`). Each operation carries its own version in its path.
5
+
6
+ The version of the OpenAPI document: 0.0.1-beta.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.24.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module TrustComponent::Generated
16
+ class AnalyticsWebsitesApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Returns the visitors active right now
23
+ # Sessions active in the last five minutes, the pages they are on, and the pageviews of each of the last thirty minutes.
24
+ # @param website_id [String] Id of the website, as listed by GET /websites
25
+ # @param [Hash] opts the optional parameters
26
+ # @return [AnalyticsRealtime]
27
+ def get_website_realtime(website_id, opts = {})
28
+ data, _status_code, _headers = get_website_realtime_with_http_info(website_id, opts)
29
+ data
30
+ end
31
+
32
+ # Returns the visitors active right now
33
+ # Sessions active in the last five minutes, the pages they are on, and the pageviews of each of the last thirty minutes.
34
+ # @param website_id [String] Id of the website, as listed by GET /websites
35
+ # @param [Hash] opts the optional parameters
36
+ # @return [Array<(AnalyticsRealtime, Integer, Hash)>] AnalyticsRealtime data, response status code and response headers
37
+ def get_website_realtime_with_http_info(website_id, opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: AnalyticsWebsitesApi.get_website_realtime ...'
40
+ end
41
+ # verify the required parameter 'website_id' is set
42
+ if @api_client.config.client_side_validation && website_id.nil?
43
+ fail ArgumentError, "Missing the required parameter 'website_id' when calling AnalyticsWebsitesApi.get_website_realtime"
44
+ end
45
+ # resource path
46
+ local_var_path = '/analytics/v1/websites/{websiteId}/realtime'.sub('{websiteId}', CGI.escape(website_id.to_s))
47
+
48
+ # query parameters
49
+ query_params = opts[:query_params] || {}
50
+
51
+ # header parameters
52
+ header_params = opts[:header_params] || {}
53
+ # HTTP header 'Accept' (if needed)
54
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
55
+
56
+ # form parameters
57
+ form_params = opts[:form_params] || {}
58
+
59
+ # http body (model)
60
+ post_body = opts[:debug_body]
61
+
62
+ # return_type
63
+ return_type = opts[:debug_return_type] || 'AnalyticsRealtime'
64
+
65
+ # auth_names
66
+ auth_names = opts[:debug_auth_names] || ['bearerApiKey']
67
+
68
+ new_options = opts.merge(
69
+ :operation => :"AnalyticsWebsitesApi.get_website_realtime",
70
+ :header_params => header_params,
71
+ :query_params => query_params,
72
+ :form_params => form_params,
73
+ :body => post_body,
74
+ :auth_names => auth_names,
75
+ :return_type => return_type
76
+ )
77
+
78
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
79
+ if @api_client.config.debugging
80
+ @api_client.config.logger.debug "API called: AnalyticsWebsitesApi#get_website_realtime\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
81
+ end
82
+ return data, status_code, headers
83
+ end
84
+
85
+ # Returns the key figures of a website split by one dimension
86
+ # The values of one dimension — pages, sources, campaigns, countries, browsers, … — largest first, each with its key figures. Rows of the PATH dimension also carry entrances, exits and time on the page.
87
+ # @param website_id [String] Id of the website, as listed by GET /websites
88
+ # @param dimension [AnalyticsStatsDimensionEnum] Dimension the figures are split by
89
+ # @param from [String] Start of the range, inclusive, as an ISO 8601 timestamp in UTC. A start inside an hour, or for ranges longer than 72 hours inside a day of the website&#39;s time zone, moves forward to the next full hour or midnight; the response names the range that was used
90
+ # @param to [String] End of the range, exclusive, as an ISO 8601 timestamp in UTC
91
+ # @param [Hash] opts the optional parameters
92
+ # @option opts [Array<String>] :filter Filter written as &#x60;dimension:operator:value&#x60;, for example &#x60;PATH:STARTS_WITH:/blog&#x60; or &#x60;COUNTRY:IS:DE&#x60;; the parameter may be repeated. Filters on different dimensions must all match, filters on the same dimension are alternatives. Dimensions are those of StatsDimensionEnumV1, operators those of StatsFilterOperatorEnumV1.
93
+ # @option opts [Integer] :page Zero-based page index (default to 0)
94
+ # @option opts [Integer] :page_size Number of entries per page (default to 100)
95
+ # @return [AnalyticsStatsBreakdown]
96
+ def get_website_stats_breakdowns(website_id, dimension, from, to, opts = {})
97
+ data, _status_code, _headers = get_website_stats_breakdowns_with_http_info(website_id, dimension, from, to, opts)
98
+ data
99
+ end
100
+
101
+ # Returns the key figures of a website split by one dimension
102
+ # The values of one dimension — pages, sources, campaigns, countries, browsers, … — largest first, each with its key figures. Rows of the PATH dimension also carry entrances, exits and time on the page.
103
+ # @param website_id [String] Id of the website, as listed by GET /websites
104
+ # @param dimension [AnalyticsStatsDimensionEnum] Dimension the figures are split by
105
+ # @param from [String] Start of the range, inclusive, as an ISO 8601 timestamp in UTC. A start inside an hour, or for ranges longer than 72 hours inside a day of the website&#39;s time zone, moves forward to the next full hour or midnight; the response names the range that was used
106
+ # @param to [String] End of the range, exclusive, as an ISO 8601 timestamp in UTC
107
+ # @param [Hash] opts the optional parameters
108
+ # @option opts [Array<String>] :filter Filter written as &#x60;dimension:operator:value&#x60;, for example &#x60;PATH:STARTS_WITH:/blog&#x60; or &#x60;COUNTRY:IS:DE&#x60;; the parameter may be repeated. Filters on different dimensions must all match, filters on the same dimension are alternatives. Dimensions are those of StatsDimensionEnumV1, operators those of StatsFilterOperatorEnumV1.
109
+ # @option opts [Integer] :page Zero-based page index (default to 0)
110
+ # @option opts [Integer] :page_size Number of entries per page (default to 100)
111
+ # @return [Array<(AnalyticsStatsBreakdown, Integer, Hash)>] AnalyticsStatsBreakdown data, response status code and response headers
112
+ def get_website_stats_breakdowns_with_http_info(website_id, dimension, from, to, opts = {})
113
+ if @api_client.config.debugging
114
+ @api_client.config.logger.debug 'Calling API: AnalyticsWebsitesApi.get_website_stats_breakdowns ...'
115
+ end
116
+ # verify the required parameter 'website_id' is set
117
+ if @api_client.config.client_side_validation && website_id.nil?
118
+ fail ArgumentError, "Missing the required parameter 'website_id' when calling AnalyticsWebsitesApi.get_website_stats_breakdowns"
119
+ end
120
+ # verify the required parameter 'dimension' is set
121
+ if @api_client.config.client_side_validation && dimension.nil?
122
+ fail ArgumentError, "Missing the required parameter 'dimension' when calling AnalyticsWebsitesApi.get_website_stats_breakdowns"
123
+ end
124
+ # verify the required parameter 'from' is set
125
+ if @api_client.config.client_side_validation && from.nil?
126
+ fail ArgumentError, "Missing the required parameter 'from' when calling AnalyticsWebsitesApi.get_website_stats_breakdowns"
127
+ end
128
+ # verify the required parameter 'to' is set
129
+ if @api_client.config.client_side_validation && to.nil?
130
+ fail ArgumentError, "Missing the required parameter 'to' when calling AnalyticsWebsitesApi.get_website_stats_breakdowns"
131
+ end
132
+ if @api_client.config.client_side_validation && !opts[:'filter'].nil? && opts[:'filter'].length > 20
133
+ fail ArgumentError, 'invalid value for "opts[:"filter"]" when calling AnalyticsWebsitesApi.get_website_stats_breakdowns, number of items must be less than or equal to 20.'
134
+ end
135
+
136
+ if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 0
137
+ fail ArgumentError, 'invalid value for "opts[:"page"]" when calling AnalyticsWebsitesApi.get_website_stats_breakdowns, must be greater than or equal to 0.'
138
+ end
139
+
140
+ if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000
141
+ fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling AnalyticsWebsitesApi.get_website_stats_breakdowns, must be smaller than or equal to 1000.'
142
+ end
143
+
144
+ if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
145
+ fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling AnalyticsWebsitesApi.get_website_stats_breakdowns, must be greater than or equal to 1.'
146
+ end
147
+
148
+ # resource path
149
+ local_var_path = '/analytics/v1/websites/{websiteId}/stats/breakdowns'.sub('{websiteId}', CGI.escape(website_id.to_s))
150
+
151
+ # query parameters
152
+ query_params = opts[:query_params] || {}
153
+ query_params[:'dimension'] = dimension
154
+ query_params[:'from'] = from
155
+ query_params[:'to'] = to
156
+ query_params[:'filter'] = @api_client.build_collection_param(opts[:'filter'], :multi) if !opts[:'filter'].nil?
157
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
158
+ query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?
159
+
160
+ # header parameters
161
+ header_params = opts[:header_params] || {}
162
+ # HTTP header 'Accept' (if needed)
163
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
164
+
165
+ # form parameters
166
+ form_params = opts[:form_params] || {}
167
+
168
+ # http body (model)
169
+ post_body = opts[:debug_body]
170
+
171
+ # return_type
172
+ return_type = opts[:debug_return_type] || 'AnalyticsStatsBreakdown'
173
+
174
+ # auth_names
175
+ auth_names = opts[:debug_auth_names] || ['bearerApiKey']
176
+
177
+ new_options = opts.merge(
178
+ :operation => :"AnalyticsWebsitesApi.get_website_stats_breakdowns",
179
+ :header_params => header_params,
180
+ :query_params => query_params,
181
+ :form_params => form_params,
182
+ :body => post_body,
183
+ :auth_names => auth_names,
184
+ :return_type => return_type
185
+ )
186
+
187
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
188
+ if @api_client.config.debugging
189
+ @api_client.config.logger.debug "API called: AnalyticsWebsitesApi#get_website_stats_breakdowns\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
190
+ end
191
+ return data, status_code, headers
192
+ end
193
+
194
+ # Returns the conversions of every goal of a website
195
+ # For each goal of the website the sessions that reached it, the conversion rate and the revenue of those sessions per currency. Revenue is left out when a filter is set.
196
+ # @param website_id [String] Id of the website, as listed by GET /websites
197
+ # @param from [String] Start of the range, inclusive, as an ISO 8601 timestamp in UTC. A start inside an hour, or for ranges longer than 72 hours inside a day of the website&#39;s time zone, moves forward to the next full hour or midnight; the response names the range that was used
198
+ # @param to [String] End of the range, exclusive, as an ISO 8601 timestamp in UTC
199
+ # @param [Hash] opts the optional parameters
200
+ # @option opts [Array<String>] :filter Filter written as &#x60;dimension:operator:value&#x60;, for example &#x60;PATH:STARTS_WITH:/blog&#x60; or &#x60;COUNTRY:IS:DE&#x60;; the parameter may be repeated. Filters on different dimensions must all match, filters on the same dimension are alternatives. Dimensions are those of StatsDimensionEnumV1, operators those of StatsFilterOperatorEnumV1.
201
+ # @option opts [AnalyticsStatsFilterMatchModeEnum] :filter_match_mode Whether a session has to match all filters or any of them
202
+ # @return [AnalyticsStatsConversions]
203
+ def get_website_stats_conversions(website_id, from, to, opts = {})
204
+ data, _status_code, _headers = get_website_stats_conversions_with_http_info(website_id, from, to, opts)
205
+ data
206
+ end
207
+
208
+ # Returns the conversions of every goal of a website
209
+ # For each goal of the website the sessions that reached it, the conversion rate and the revenue of those sessions per currency. Revenue is left out when a filter is set.
210
+ # @param website_id [String] Id of the website, as listed by GET /websites
211
+ # @param from [String] Start of the range, inclusive, as an ISO 8601 timestamp in UTC. A start inside an hour, or for ranges longer than 72 hours inside a day of the website&#39;s time zone, moves forward to the next full hour or midnight; the response names the range that was used
212
+ # @param to [String] End of the range, exclusive, as an ISO 8601 timestamp in UTC
213
+ # @param [Hash] opts the optional parameters
214
+ # @option opts [Array<String>] :filter Filter written as &#x60;dimension:operator:value&#x60;, for example &#x60;PATH:STARTS_WITH:/blog&#x60; or &#x60;COUNTRY:IS:DE&#x60;; the parameter may be repeated. Filters on different dimensions must all match, filters on the same dimension are alternatives. Dimensions are those of StatsDimensionEnumV1, operators those of StatsFilterOperatorEnumV1.
215
+ # @option opts [AnalyticsStatsFilterMatchModeEnum] :filter_match_mode Whether a session has to match all filters or any of them
216
+ # @return [Array<(AnalyticsStatsConversions, Integer, Hash)>] AnalyticsStatsConversions data, response status code and response headers
217
+ def get_website_stats_conversions_with_http_info(website_id, from, to, opts = {})
218
+ if @api_client.config.debugging
219
+ @api_client.config.logger.debug 'Calling API: AnalyticsWebsitesApi.get_website_stats_conversions ...'
220
+ end
221
+ # verify the required parameter 'website_id' is set
222
+ if @api_client.config.client_side_validation && website_id.nil?
223
+ fail ArgumentError, "Missing the required parameter 'website_id' when calling AnalyticsWebsitesApi.get_website_stats_conversions"
224
+ end
225
+ # verify the required parameter 'from' is set
226
+ if @api_client.config.client_side_validation && from.nil?
227
+ fail ArgumentError, "Missing the required parameter 'from' when calling AnalyticsWebsitesApi.get_website_stats_conversions"
228
+ end
229
+ # verify the required parameter 'to' is set
230
+ if @api_client.config.client_side_validation && to.nil?
231
+ fail ArgumentError, "Missing the required parameter 'to' when calling AnalyticsWebsitesApi.get_website_stats_conversions"
232
+ end
233
+ if @api_client.config.client_side_validation && !opts[:'filter'].nil? && opts[:'filter'].length > 20
234
+ fail ArgumentError, 'invalid value for "opts[:"filter"]" when calling AnalyticsWebsitesApi.get_website_stats_conversions, number of items must be less than or equal to 20.'
235
+ end
236
+
237
+ # resource path
238
+ local_var_path = '/analytics/v1/websites/{websiteId}/stats/conversions'.sub('{websiteId}', CGI.escape(website_id.to_s))
239
+
240
+ # query parameters
241
+ query_params = opts[:query_params] || {}
242
+ query_params[:'from'] = from
243
+ query_params[:'to'] = to
244
+ query_params[:'filter'] = @api_client.build_collection_param(opts[:'filter'], :multi) if !opts[:'filter'].nil?
245
+ query_params[:'filterMatchMode'] = opts[:'filter_match_mode'] if !opts[:'filter_match_mode'].nil?
246
+
247
+ # header parameters
248
+ header_params = opts[:header_params] || {}
249
+ # HTTP header 'Accept' (if needed)
250
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
251
+
252
+ # form parameters
253
+ form_params = opts[:form_params] || {}
254
+
255
+ # http body (model)
256
+ post_body = opts[:debug_body]
257
+
258
+ # return_type
259
+ return_type = opts[:debug_return_type] || 'AnalyticsStatsConversions'
260
+
261
+ # auth_names
262
+ auth_names = opts[:debug_auth_names] || ['bearerApiKey']
263
+
264
+ new_options = opts.merge(
265
+ :operation => :"AnalyticsWebsitesApi.get_website_stats_conversions",
266
+ :header_params => header_params,
267
+ :query_params => query_params,
268
+ :form_params => form_params,
269
+ :body => post_body,
270
+ :auth_names => auth_names,
271
+ :return_type => return_type
272
+ )
273
+
274
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
275
+ if @api_client.config.debugging
276
+ @api_client.config.logger.debug "API called: AnalyticsWebsitesApi#get_website_stats_conversions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
277
+ end
278
+ return data, status_code, headers
279
+ end
280
+
281
+ # Returns the key figures of a website for a time range and the period before it
282
+ # Pageviews, sessions, visitors, events, bounces and engaged time of the range, and the same figures for the comparison period: a range that starts at midnight in the website's time zone moves back by as many calendar days as it covers and keeps its local times (today until now is compared with yesterday until the same time), any other range moves back by its own length. Without a filter the figures come from the aggregates and reach back as far as aggregates are kept; with a filter they are counted from the stored sessions and events and reach back as far as those are kept.
283
+ # @param website_id [String] Id of the website, as listed by GET /websites
284
+ # @param from [String] Start of the range, inclusive, as an ISO 8601 timestamp in UTC. A start inside an hour, or for ranges longer than 72 hours inside a day of the website&#39;s time zone, moves forward to the next full hour or midnight; the response names the range that was used
285
+ # @param to [String] End of the range, exclusive, as an ISO 8601 timestamp in UTC
286
+ # @param [Hash] opts the optional parameters
287
+ # @option opts [Array<String>] :filter Filter written as &#x60;dimension:operator:value&#x60;, for example &#x60;PATH:STARTS_WITH:/blog&#x60; or &#x60;COUNTRY:IS:DE&#x60;; the parameter may be repeated. Filters on different dimensions must all match, filters on the same dimension are alternatives. Dimensions are those of StatsDimensionEnumV1, operators those of StatsFilterOperatorEnumV1.
288
+ # @return [AnalyticsStatsOverview]
289
+ def get_website_stats_overview(website_id, from, to, opts = {})
290
+ data, _status_code, _headers = get_website_stats_overview_with_http_info(website_id, from, to, opts)
291
+ data
292
+ end
293
+
294
+ # Returns the key figures of a website for a time range and the period before it
295
+ # Pageviews, sessions, visitors, events, bounces and engaged time of the range, and the same figures for the comparison period: a range that starts at midnight in the website&#39;s time zone moves back by as many calendar days as it covers and keeps its local times (today until now is compared with yesterday until the same time), any other range moves back by its own length. Without a filter the figures come from the aggregates and reach back as far as aggregates are kept; with a filter they are counted from the stored sessions and events and reach back as far as those are kept.
296
+ # @param website_id [String] Id of the website, as listed by GET /websites
297
+ # @param from [String] Start of the range, inclusive, as an ISO 8601 timestamp in UTC. A start inside an hour, or for ranges longer than 72 hours inside a day of the website&#39;s time zone, moves forward to the next full hour or midnight; the response names the range that was used
298
+ # @param to [String] End of the range, exclusive, as an ISO 8601 timestamp in UTC
299
+ # @param [Hash] opts the optional parameters
300
+ # @option opts [Array<String>] :filter Filter written as &#x60;dimension:operator:value&#x60;, for example &#x60;PATH:STARTS_WITH:/blog&#x60; or &#x60;COUNTRY:IS:DE&#x60;; the parameter may be repeated. Filters on different dimensions must all match, filters on the same dimension are alternatives. Dimensions are those of StatsDimensionEnumV1, operators those of StatsFilterOperatorEnumV1.
301
+ # @return [Array<(AnalyticsStatsOverview, Integer, Hash)>] AnalyticsStatsOverview data, response status code and response headers
302
+ def get_website_stats_overview_with_http_info(website_id, from, to, opts = {})
303
+ if @api_client.config.debugging
304
+ @api_client.config.logger.debug 'Calling API: AnalyticsWebsitesApi.get_website_stats_overview ...'
305
+ end
306
+ # verify the required parameter 'website_id' is set
307
+ if @api_client.config.client_side_validation && website_id.nil?
308
+ fail ArgumentError, "Missing the required parameter 'website_id' when calling AnalyticsWebsitesApi.get_website_stats_overview"
309
+ end
310
+ # verify the required parameter 'from' is set
311
+ if @api_client.config.client_side_validation && from.nil?
312
+ fail ArgumentError, "Missing the required parameter 'from' when calling AnalyticsWebsitesApi.get_website_stats_overview"
313
+ end
314
+ # verify the required parameter 'to' is set
315
+ if @api_client.config.client_side_validation && to.nil?
316
+ fail ArgumentError, "Missing the required parameter 'to' when calling AnalyticsWebsitesApi.get_website_stats_overview"
317
+ end
318
+ if @api_client.config.client_side_validation && !opts[:'filter'].nil? && opts[:'filter'].length > 20
319
+ fail ArgumentError, 'invalid value for "opts[:"filter"]" when calling AnalyticsWebsitesApi.get_website_stats_overview, number of items must be less than or equal to 20.'
320
+ end
321
+
322
+ # resource path
323
+ local_var_path = '/analytics/v1/websites/{websiteId}/stats/overview'.sub('{websiteId}', CGI.escape(website_id.to_s))
324
+
325
+ # query parameters
326
+ query_params = opts[:query_params] || {}
327
+ query_params[:'from'] = from
328
+ query_params[:'to'] = to
329
+ query_params[:'filter'] = @api_client.build_collection_param(opts[:'filter'], :multi) if !opts[:'filter'].nil?
330
+
331
+ # header parameters
332
+ header_params = opts[:header_params] || {}
333
+ # HTTP header 'Accept' (if needed)
334
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
335
+
336
+ # form parameters
337
+ form_params = opts[:form_params] || {}
338
+
339
+ # http body (model)
340
+ post_body = opts[:debug_body]
341
+
342
+ # return_type
343
+ return_type = opts[:debug_return_type] || 'AnalyticsStatsOverview'
344
+
345
+ # auth_names
346
+ auth_names = opts[:debug_auth_names] || ['bearerApiKey']
347
+
348
+ new_options = opts.merge(
349
+ :operation => :"AnalyticsWebsitesApi.get_website_stats_overview",
350
+ :header_params => header_params,
351
+ :query_params => query_params,
352
+ :form_params => form_params,
353
+ :body => post_body,
354
+ :auth_names => auth_names,
355
+ :return_type => return_type
356
+ )
357
+
358
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
359
+ if @api_client.config.debugging
360
+ @api_client.config.logger.debug "API called: AnalyticsWebsitesApi#get_website_stats_overview\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
361
+ end
362
+ return data, status_code, headers
363
+ end
364
+
365
+ # Returns the key figures of a website per hour or per day
366
+ # One point per hour or per day of the range, empty buckets included as zero. Days start at midnight in the time zone of the website. Without a granularity, ranges up to three days come per hour and longer ones per day; a series has at most 1,000 points.
367
+ # @param website_id [String] Id of the website, as listed by GET /websites
368
+ # @param from [String] Start of the range, inclusive, as an ISO 8601 timestamp in UTC. A start inside an hour, or for ranges longer than 72 hours inside a day of the website&#39;s time zone, moves forward to the next full hour or midnight; the response names the range that was used
369
+ # @param to [String] End of the range, exclusive, as an ISO 8601 timestamp in UTC
370
+ # @param [Hash] opts the optional parameters
371
+ # @option opts [AnalyticsStatsGranularityEnum] :granularity Size of one point of the series; without it, ranges up to three days come per hour and longer ones per day
372
+ # @option opts [Array<String>] :filter Filter written as &#x60;dimension:operator:value&#x60;, for example &#x60;PATH:STARTS_WITH:/blog&#x60; or &#x60;COUNTRY:IS:DE&#x60;; the parameter may be repeated. Filters on different dimensions must all match, filters on the same dimension are alternatives. Dimensions are those of StatsDimensionEnumV1, operators those of StatsFilterOperatorEnumV1.
373
+ # @return [AnalyticsStatsTimeseries]
374
+ def get_website_stats_timeseries(website_id, from, to, opts = {})
375
+ data, _status_code, _headers = get_website_stats_timeseries_with_http_info(website_id, from, to, opts)
376
+ data
377
+ end
378
+
379
+ # Returns the key figures of a website per hour or per day
380
+ # One point per hour or per day of the range, empty buckets included as zero. Days start at midnight in the time zone of the website. Without a granularity, ranges up to three days come per hour and longer ones per day; a series has at most 1,000 points.
381
+ # @param website_id [String] Id of the website, as listed by GET /websites
382
+ # @param from [String] Start of the range, inclusive, as an ISO 8601 timestamp in UTC. A start inside an hour, or for ranges longer than 72 hours inside a day of the website&#39;s time zone, moves forward to the next full hour or midnight; the response names the range that was used
383
+ # @param to [String] End of the range, exclusive, as an ISO 8601 timestamp in UTC
384
+ # @param [Hash] opts the optional parameters
385
+ # @option opts [AnalyticsStatsGranularityEnum] :granularity Size of one point of the series; without it, ranges up to three days come per hour and longer ones per day
386
+ # @option opts [Array<String>] :filter Filter written as &#x60;dimension:operator:value&#x60;, for example &#x60;PATH:STARTS_WITH:/blog&#x60; or &#x60;COUNTRY:IS:DE&#x60;; the parameter may be repeated. Filters on different dimensions must all match, filters on the same dimension are alternatives. Dimensions are those of StatsDimensionEnumV1, operators those of StatsFilterOperatorEnumV1.
387
+ # @return [Array<(AnalyticsStatsTimeseries, Integer, Hash)>] AnalyticsStatsTimeseries data, response status code and response headers
388
+ def get_website_stats_timeseries_with_http_info(website_id, from, to, opts = {})
389
+ if @api_client.config.debugging
390
+ @api_client.config.logger.debug 'Calling API: AnalyticsWebsitesApi.get_website_stats_timeseries ...'
391
+ end
392
+ # verify the required parameter 'website_id' is set
393
+ if @api_client.config.client_side_validation && website_id.nil?
394
+ fail ArgumentError, "Missing the required parameter 'website_id' when calling AnalyticsWebsitesApi.get_website_stats_timeseries"
395
+ end
396
+ # verify the required parameter 'from' is set
397
+ if @api_client.config.client_side_validation && from.nil?
398
+ fail ArgumentError, "Missing the required parameter 'from' when calling AnalyticsWebsitesApi.get_website_stats_timeseries"
399
+ end
400
+ # verify the required parameter 'to' is set
401
+ if @api_client.config.client_side_validation && to.nil?
402
+ fail ArgumentError, "Missing the required parameter 'to' when calling AnalyticsWebsitesApi.get_website_stats_timeseries"
403
+ end
404
+ if @api_client.config.client_side_validation && !opts[:'filter'].nil? && opts[:'filter'].length > 20
405
+ fail ArgumentError, 'invalid value for "opts[:"filter"]" when calling AnalyticsWebsitesApi.get_website_stats_timeseries, number of items must be less than or equal to 20.'
406
+ end
407
+
408
+ # resource path
409
+ local_var_path = '/analytics/v1/websites/{websiteId}/stats/timeseries'.sub('{websiteId}', CGI.escape(website_id.to_s))
410
+
411
+ # query parameters
412
+ query_params = opts[:query_params] || {}
413
+ query_params[:'from'] = from
414
+ query_params[:'to'] = to
415
+ query_params[:'granularity'] = opts[:'granularity'] if !opts[:'granularity'].nil?
416
+ query_params[:'filter'] = @api_client.build_collection_param(opts[:'filter'], :multi) if !opts[:'filter'].nil?
417
+
418
+ # header parameters
419
+ header_params = opts[:header_params] || {}
420
+ # HTTP header 'Accept' (if needed)
421
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
422
+
423
+ # form parameters
424
+ form_params = opts[:form_params] || {}
425
+
426
+ # http body (model)
427
+ post_body = opts[:debug_body]
428
+
429
+ # return_type
430
+ return_type = opts[:debug_return_type] || 'AnalyticsStatsTimeseries'
431
+
432
+ # auth_names
433
+ auth_names = opts[:debug_auth_names] || ['bearerApiKey']
434
+
435
+ new_options = opts.merge(
436
+ :operation => :"AnalyticsWebsitesApi.get_website_stats_timeseries",
437
+ :header_params => header_params,
438
+ :query_params => query_params,
439
+ :form_params => form_params,
440
+ :body => post_body,
441
+ :auth_names => auth_names,
442
+ :return_type => return_type
443
+ )
444
+
445
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
446
+ if @api_client.config.debugging
447
+ @api_client.config.logger.debug "API called: AnalyticsWebsitesApi#get_website_stats_timeseries\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
448
+ end
449
+ return data, status_code, headers
450
+ end
451
+
452
+ # Lists the websites of the subscription of the API key
453
+ # Every website of the project the API key belongs to, oldest first, with the id the statistics endpoints take.
454
+ # @param [Hash] opts the optional parameters
455
+ # @option opts [Integer] :page Zero-based page index (default to 0)
456
+ # @option opts [Integer] :page_size Number of entries per page (default to 100)
457
+ # @return [AnalyticsWebsitesPage]
458
+ def get_websites(opts = {})
459
+ data, _status_code, _headers = get_websites_with_http_info(opts)
460
+ data
461
+ end
462
+
463
+ # Lists the websites of the subscription of the API key
464
+ # Every website of the project the API key belongs to, oldest first, with the id the statistics endpoints take.
465
+ # @param [Hash] opts the optional parameters
466
+ # @option opts [Integer] :page Zero-based page index (default to 0)
467
+ # @option opts [Integer] :page_size Number of entries per page (default to 100)
468
+ # @return [Array<(AnalyticsWebsitesPage, Integer, Hash)>] AnalyticsWebsitesPage data, response status code and response headers
469
+ def get_websites_with_http_info(opts = {})
470
+ if @api_client.config.debugging
471
+ @api_client.config.logger.debug 'Calling API: AnalyticsWebsitesApi.get_websites ...'
472
+ end
473
+ if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 0
474
+ fail ArgumentError, 'invalid value for "opts[:"page"]" when calling AnalyticsWebsitesApi.get_websites, must be greater than or equal to 0.'
475
+ end
476
+
477
+ if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000
478
+ fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling AnalyticsWebsitesApi.get_websites, must be smaller than or equal to 1000.'
479
+ end
480
+
481
+ if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
482
+ fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling AnalyticsWebsitesApi.get_websites, must be greater than or equal to 1.'
483
+ end
484
+
485
+ # resource path
486
+ local_var_path = '/analytics/v1/websites'
487
+
488
+ # query parameters
489
+ query_params = opts[:query_params] || {}
490
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
491
+ query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?
492
+
493
+ # header parameters
494
+ header_params = opts[:header_params] || {}
495
+ # HTTP header 'Accept' (if needed)
496
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
497
+
498
+ # form parameters
499
+ form_params = opts[:form_params] || {}
500
+
501
+ # http body (model)
502
+ post_body = opts[:debug_body]
503
+
504
+ # return_type
505
+ return_type = opts[:debug_return_type] || 'AnalyticsWebsitesPage'
506
+
507
+ # auth_names
508
+ auth_names = opts[:debug_auth_names] || ['bearerApiKey']
509
+
510
+ new_options = opts.merge(
511
+ :operation => :"AnalyticsWebsitesApi.get_websites",
512
+ :header_params => header_params,
513
+ :query_params => query_params,
514
+ :form_params => form_params,
515
+ :body => post_body,
516
+ :auth_names => auth_names,
517
+ :return_type => return_type
518
+ )
519
+
520
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
521
+ if @api_client.config.debugging
522
+ @api_client.config.logger.debug "API called: AnalyticsWebsitesApi#get_websites\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
523
+ end
524
+ return data, status_code, headers
525
+ end
526
+ end
527
+ end
@@ -0,0 +1,88 @@
1
+ =begin
2
+ #TrustComponent API
3
+
4
+ #The public API of every TrustComponent module, authenticated with an API key (`ak_…`). Each operation carries its own version in its path.
5
+
6
+ The version of the OpenAPI document: 0.0.1-beta.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.24.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module TrustComponent::Generated
16
+ class CaptchaVerificationsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Returns the result of a verification
23
+ # Call it from your server with the verification id from the token the widget put into your form. A 429 here means the result reached its maximum retrieval count and comes without `Retry-After`; it is final and is not retried.
24
+ # @param verification_id [String] ID of a verification
25
+ # @param [Hash] opts the optional parameters
26
+ # @option opts [Boolean] :client_failover Set when the widget could not reach TrustCaptcha (&#x60;clientFailover&#x60; in its token). The public gateway then answers on its own and lets the visitor pass only while it has seen an outage itself.
27
+ # @return [CaptchaVerificationResult]
28
+ def get_result(verification_id, opts = {})
29
+ data, _status_code, _headers = get_result_with_http_info(verification_id, opts)
30
+ data
31
+ end
32
+
33
+ # Returns the result of a verification
34
+ # Call it from your server with the verification id from the token the widget put into your form. A 429 here means the result reached its maximum retrieval count and comes without &#x60;Retry-After&#x60;; it is final and is not retried.
35
+ # @param verification_id [String] ID of a verification
36
+ # @param [Hash] opts the optional parameters
37
+ # @option opts [Boolean] :client_failover Set when the widget could not reach TrustCaptcha (&#x60;clientFailover&#x60; in its token). The public gateway then answers on its own and lets the visitor pass only while it has seen an outage itself.
38
+ # @return [Array<(CaptchaVerificationResult, Integer, Hash)>] CaptchaVerificationResult data, response status code and response headers
39
+ def get_result_with_http_info(verification_id, opts = {})
40
+ if @api_client.config.debugging
41
+ @api_client.config.logger.debug 'Calling API: CaptchaVerificationsApi.get_result ...'
42
+ end
43
+ # verify the required parameter 'verification_id' is set
44
+ if @api_client.config.client_side_validation && verification_id.nil?
45
+ fail ArgumentError, "Missing the required parameter 'verification_id' when calling CaptchaVerificationsApi.get_result"
46
+ end
47
+ # resource path
48
+ local_var_path = '/captcha/v2/verifications/{verificationId}/results'.sub('{verificationId}', CGI.escape(verification_id.to_s))
49
+
50
+ # query parameters
51
+ query_params = opts[:query_params] || {}
52
+ query_params[:'clientFailover'] = opts[:'client_failover'] if !opts[:'client_failover'].nil?
53
+
54
+ # header parameters
55
+ header_params = opts[:header_params] || {}
56
+ # HTTP header 'Accept' (if needed)
57
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
58
+
59
+ # form parameters
60
+ form_params = opts[:form_params] || {}
61
+
62
+ # http body (model)
63
+ post_body = opts[:debug_body]
64
+
65
+ # return_type
66
+ return_type = opts[:debug_return_type] || 'CaptchaVerificationResult'
67
+
68
+ # auth_names
69
+ auth_names = opts[:debug_auth_names] || ['bearerApiKey']
70
+
71
+ new_options = opts.merge(
72
+ :operation => :"CaptchaVerificationsApi.get_result",
73
+ :header_params => header_params,
74
+ :query_params => query_params,
75
+ :form_params => form_params,
76
+ :body => post_body,
77
+ :auth_names => auth_names,
78
+ :return_type => return_type
79
+ )
80
+
81
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
82
+ if @api_client.config.debugging
83
+ @api_client.config.logger.debug "API called: CaptchaVerificationsApi#get_result\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
84
+ end
85
+ return data, status_code, headers
86
+ end
87
+ end
88
+ end