plainrouter-sdk 0.1.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 (75) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +202 -0
  3. data/README.md +59 -0
  4. data/lib/plainrouter/client.rb +44 -0
  5. data/lib/plainrouter/openapi/api/event_api.rb +213 -0
  6. data/lib/plainrouter/openapi/api/operations_api.rb +542 -0
  7. data/lib/plainrouter/openapi/api/sandbox_api.rb +272 -0
  8. data/lib/plainrouter/openapi/api_client.rb +441 -0
  9. data/lib/plainrouter/openapi/api_error.rb +58 -0
  10. data/lib/plainrouter/openapi/api_model_base.rb +88 -0
  11. data/lib/plainrouter/openapi/configuration.rb +399 -0
  12. data/lib/plainrouter/openapi/models/create_event200_response.rb +190 -0
  13. data/lib/plainrouter/openapi/models/create_event_request.rb +103 -0
  14. data/lib/plainrouter/openapi/models/create_event_request_any_of.rb +344 -0
  15. data/lib/plainrouter/openapi/models/create_event_request_any_of1.rb +346 -0
  16. data/lib/plainrouter/openapi/models/create_event_request_any_of_event_time.rb +104 -0
  17. data/lib/plainrouter/openapi/models/create_event_request_any_of_value_data.rb +186 -0
  18. data/lib/plainrouter/openapi/models/create_sandbox_key201_response.rb +320 -0
  19. data/lib/plainrouter/openapi/models/create_sandbox_key201_response_use.rb +216 -0
  20. data/lib/plainrouter/openapi/models/delete_user_data200_response.rb +268 -0
  21. data/lib/plainrouter/openapi/models/delete_user_data_request.rb +225 -0
  22. data/lib/plainrouter/openapi/models/delivery_status.rb +49 -0
  23. data/lib/plainrouter/openapi/models/destination.rb +354 -0
  24. data/lib/plainrouter/openapi/models/destination_credential_source.rb +40 -0
  25. data/lib/plainrouter/openapi/models/destination_status.rb +40 -0
  26. data/lib/plainrouter/openapi/models/destination_type.rb +39 -0
  27. data/lib/plainrouter/openapi/models/emq_snapshot.rb +344 -0
  28. data/lib/plainrouter/openapi/models/error_message.rb +164 -0
  29. data/lib/plainrouter/openapi/models/event.rb +782 -0
  30. data/lib/plainrouter/openapi/models/get_emq_report200_response.rb +166 -0
  31. data/lib/plainrouter/openapi/models/get_emq_report200_response_snapshots_inner.rb +342 -0
  32. data/lib/plainrouter/openapi/models/get_event200_response.rb +218 -0
  33. data/lib/plainrouter/openapi/models/get_event200_response_deliveries_inner.rb +440 -0
  34. data/lib/plainrouter/openapi/models/get_event200_response_event.rb +624 -0
  35. data/lib/plainrouter/openapi/models/get_event200_response_event_consent.rb +103 -0
  36. data/lib/plainrouter/openapi/models/get_event200_response_event_deliveries_inner.rb +414 -0
  37. data/lib/plainrouter/openapi/models/get_event200_response_lineage.rb +178 -0
  38. data/lib/plainrouter/openapi/models/get_event200_response_lineage_children_inner.rb +596 -0
  39. data/lib/plainrouter/openapi/models/get_event200_response_lineage_parent.rb +596 -0
  40. data/lib/plainrouter/openapi/models/get_reconciliation_report200_response.rb +192 -0
  41. data/lib/plainrouter/openapi/models/get_reconciliation_report200_response_reports_inner.rb +476 -0
  42. data/lib/plainrouter/openapi/models/get_reconciliation_report200_response_reports_inner_buckets_value.rb +216 -0
  43. data/lib/plainrouter/openapi/models/get_reconciliation_report200_response_reports_inner_event_counts.rb +190 -0
  44. data/lib/plainrouter/openapi/models/get_reconciliation_report200_response_reports_inner_event_counts_accepted.rb +103 -0
  45. data/lib/plainrouter/openapi/models/get_sandbox200_response.rb +372 -0
  46. data/lib/plainrouter/openapi/models/get_sandbox200_response_self_serve_key.rb +242 -0
  47. data/lib/plainrouter/openapi/models/get_sandbox200_response_try.rb +242 -0
  48. data/lib/plainrouter/openapi/models/get_sandbox200_response_try_body.rb +242 -0
  49. data/lib/plainrouter/openapi/models/get_sandbox200_response_try_body_value_data.rb +216 -0
  50. data/lib/plainrouter/openapi/models/jurisdiction_policy_class.rb +40 -0
  51. data/lib/plainrouter/openapi/models/list_events200_response.rb +190 -0
  52. data/lib/plainrouter/openapi/models/list_events200_response_events.rb +382 -0
  53. data/lib/plainrouter/openapi/models/list_events200_response_events_links_inner.rb +202 -0
  54. data/lib/plainrouter/openapi/models/list_events200_response_metrics.rb +228 -0
  55. data/lib/plainrouter/openapi/models/list_events_by_cursor200_response.rb +190 -0
  56. data/lib/plainrouter/openapi/models/list_events_by_cursor200_response_events.rb +252 -0
  57. data/lib/plainrouter/openapi/models/reconciliation_report.rb +464 -0
  58. data/lib/plainrouter/openapi/models/replay_deliveries202_response.rb +242 -0
  59. data/lib/plainrouter/openapi/models/replay_deliveries_request.rb +199 -0
  60. data/lib/plainrouter/openapi/models/send_test_purchase200_response.rb +224 -0
  61. data/lib/plainrouter/openapi/models/send_test_purchase422_response.rb +103 -0
  62. data/lib/plainrouter/openapi/models/send_test_purchase_request.rb +224 -0
  63. data/lib/plainrouter/openapi/models/set_destination_test_mode200_response.rb +190 -0
  64. data/lib/plainrouter/openapi/models/set_destination_test_mode200_response_destination.rb +338 -0
  65. data/lib/plainrouter/openapi/models/set_destination_test_mode_request.rb +189 -0
  66. data/lib/plainrouter/openapi/models/traffic_class.rb +40 -0
  67. data/lib/plainrouter/openapi/models/validate_sandbox_event200_response.rb +320 -0
  68. data/lib/plainrouter/openapi/models/validate_sandbox_event_request.rb +194 -0
  69. data/lib/plainrouter/openapi/models/validate_sandbox_event_request_value_data.rb +166 -0
  70. data/lib/plainrouter/openapi/models/validation_error.rb +192 -0
  71. data/lib/plainrouter/openapi/version.rb +15 -0
  72. data/lib/plainrouter/openapi.rb +102 -0
  73. data/lib/plainrouter/version.rb +6 -0
  74. data/lib/plainrouter.rb +10 -0
  75. metadata +176 -0
@@ -0,0 +1,542 @@
1
+ =begin
2
+ #PlainRouter Conversion API
3
+
4
+ #PlainRouter public Signals Conversion API.
5
+
6
+ The version of the OpenAPI document: 0.5.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.25.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module PlainRouter::OpenAPI
16
+ class OperationsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Delete user data by hashed identifier
23
+ # Idempotently removes retained user data matching one caller-supplied SHA-256 identifier digest.
24
+ # @param delete_user_data_request [DeleteUserDataRequest]
25
+ # @param [Hash] opts the optional parameters
26
+ # @return [DeleteUserData200Response]
27
+ def delete_user_data(delete_user_data_request, opts = {})
28
+ data, _status_code, _headers = delete_user_data_with_http_info(delete_user_data_request, opts)
29
+ data
30
+ end
31
+
32
+ # Delete user data by hashed identifier
33
+ # Idempotently removes retained user data matching one caller-supplied SHA-256 identifier digest.
34
+ # @param delete_user_data_request [DeleteUserDataRequest]
35
+ # @param [Hash] opts the optional parameters
36
+ # @return [Array<(DeleteUserData200Response, Integer, Hash)>] DeleteUserData200Response data, response status code and response headers
37
+ def delete_user_data_with_http_info(delete_user_data_request, opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: OperationsApi.delete_user_data ...'
40
+ end
41
+ # verify the required parameter 'delete_user_data_request' is set
42
+ if @api_client.config.client_side_validation && delete_user_data_request.nil?
43
+ fail ArgumentError, "Missing the required parameter 'delete_user_data_request' when calling OperationsApi.delete_user_data"
44
+ end
45
+ # resource path
46
+ local_var_path = '/user-data'
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
+ # HTTP header 'Content-Type'
56
+ content_type = @api_client.select_header_content_type(['application/json'])
57
+ if !content_type.nil?
58
+ header_params['Content-Type'] = content_type
59
+ end
60
+
61
+ # form parameters
62
+ form_params = opts[:form_params] || {}
63
+
64
+ # http body (model)
65
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(delete_user_data_request)
66
+
67
+ # return_type
68
+ return_type = opts[:debug_return_type] || 'DeleteUserData200Response'
69
+
70
+ # auth_names
71
+ auth_names = opts[:debug_auth_names] || ['signalTrackerSecret']
72
+
73
+ new_options = opts.merge(
74
+ :operation => :"OperationsApi.delete_user_data",
75
+ :header_params => header_params,
76
+ :query_params => query_params,
77
+ :form_params => form_params,
78
+ :body => post_body,
79
+ :auth_names => auth_names,
80
+ :return_type => return_type
81
+ )
82
+
83
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
84
+ if @api_client.config.debugging
85
+ @api_client.config.logger.debug "API called: OperationsApi#delete_user_data\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
86
+ end
87
+ return data, status_code, headers
88
+ end
89
+
90
+ # Get Event Match Quality history
91
+ # Returns recent Meta Event Match Quality snapshots for the authenticated Signal tracker.
92
+ # @param [Hash] opts the optional parameters
93
+ # @return [GetEmqReport200Response]
94
+ def get_emq_report(opts = {})
95
+ data, _status_code, _headers = get_emq_report_with_http_info(opts)
96
+ data
97
+ end
98
+
99
+ # Get Event Match Quality history
100
+ # Returns recent Meta Event Match Quality snapshots for the authenticated Signal tracker.
101
+ # @param [Hash] opts the optional parameters
102
+ # @return [Array<(GetEmqReport200Response, Integer, Hash)>] GetEmqReport200Response data, response status code and response headers
103
+ def get_emq_report_with_http_info(opts = {})
104
+ if @api_client.config.debugging
105
+ @api_client.config.logger.debug 'Calling API: OperationsApi.get_emq_report ...'
106
+ end
107
+ # resource path
108
+ local_var_path = '/reports/emq'
109
+
110
+ # query parameters
111
+ query_params = opts[:query_params] || {}
112
+
113
+ # header parameters
114
+ header_params = opts[:header_params] || {}
115
+ # HTTP header 'Accept' (if needed)
116
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
117
+
118
+ # form parameters
119
+ form_params = opts[:form_params] || {}
120
+
121
+ # http body (model)
122
+ post_body = opts[:debug_body]
123
+
124
+ # return_type
125
+ return_type = opts[:debug_return_type] || 'GetEmqReport200Response'
126
+
127
+ # auth_names
128
+ auth_names = opts[:debug_auth_names] || ['signalTrackerSecret']
129
+
130
+ new_options = opts.merge(
131
+ :operation => :"OperationsApi.get_emq_report",
132
+ :header_params => header_params,
133
+ :query_params => query_params,
134
+ :form_params => form_params,
135
+ :body => post_body,
136
+ :auth_names => auth_names,
137
+ :return_type => return_type
138
+ )
139
+
140
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
141
+ if @api_client.config.debugging
142
+ @api_client.config.logger.debug "API called: OperationsApi#get_emq_report\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
143
+ end
144
+ return data, status_code, headers
145
+ end
146
+
147
+ # Get a reconciliation report
148
+ # Returns stored delivery-versus-platform reconciliation results for one calendar date.
149
+ # @param date [Date]
150
+ # @param [Hash] opts the optional parameters
151
+ # @return [GetReconciliationReport200Response]
152
+ def get_reconciliation_report(date, opts = {})
153
+ data, _status_code, _headers = get_reconciliation_report_with_http_info(date, opts)
154
+ data
155
+ end
156
+
157
+ # Get a reconciliation report
158
+ # Returns stored delivery-versus-platform reconciliation results for one calendar date.
159
+ # @param date [Date]
160
+ # @param [Hash] opts the optional parameters
161
+ # @return [Array<(GetReconciliationReport200Response, Integer, Hash)>] GetReconciliationReport200Response data, response status code and response headers
162
+ def get_reconciliation_report_with_http_info(date, opts = {})
163
+ if @api_client.config.debugging
164
+ @api_client.config.logger.debug 'Calling API: OperationsApi.get_reconciliation_report ...'
165
+ end
166
+ # verify the required parameter 'date' is set
167
+ if @api_client.config.client_side_validation && date.nil?
168
+ fail ArgumentError, "Missing the required parameter 'date' when calling OperationsApi.get_reconciliation_report"
169
+ end
170
+ # resource path
171
+ local_var_path = '/reports/reconciliation'
172
+
173
+ # query parameters
174
+ query_params = opts[:query_params] || {}
175
+ query_params[:'date'] = date
176
+
177
+ # header parameters
178
+ header_params = opts[:header_params] || {}
179
+ # HTTP header 'Accept' (if needed)
180
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
181
+
182
+ # form parameters
183
+ form_params = opts[:form_params] || {}
184
+
185
+ # http body (model)
186
+ post_body = opts[:debug_body]
187
+
188
+ # return_type
189
+ return_type = opts[:debug_return_type] || 'GetReconciliationReport200Response'
190
+
191
+ # auth_names
192
+ auth_names = opts[:debug_auth_names] || ['signalTrackerSecret']
193
+
194
+ new_options = opts.merge(
195
+ :operation => :"OperationsApi.get_reconciliation_report",
196
+ :header_params => header_params,
197
+ :query_params => query_params,
198
+ :form_params => form_params,
199
+ :body => post_body,
200
+ :auth_names => auth_names,
201
+ :return_type => return_type
202
+ )
203
+
204
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
205
+ if @api_client.config.debugging
206
+ @api_client.config.logger.debug "API called: OperationsApi#get_reconciliation_report\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
207
+ end
208
+ return data, status_code, headers
209
+ end
210
+
211
+ # List recent events
212
+ # Returns retained customer-readable events and aggregate destination-delivery acceptance metrics.
213
+ # @param [Hash] opts the optional parameters
214
+ # @option opts [Integer] :per_page Events per page, capped at 100. (default to 25)
215
+ # @return [ListEvents200Response]
216
+ def list_events(opts = {})
217
+ data, _status_code, _headers = list_events_with_http_info(opts)
218
+ data
219
+ end
220
+
221
+ # List recent events
222
+ # Returns retained customer-readable events and aggregate destination-delivery acceptance metrics.
223
+ # @param [Hash] opts the optional parameters
224
+ # @option opts [Integer] :per_page Events per page, capped at 100. (default to 25)
225
+ # @return [Array<(ListEvents200Response, Integer, Hash)>] ListEvents200Response data, response status code and response headers
226
+ def list_events_with_http_info(opts = {})
227
+ if @api_client.config.debugging
228
+ @api_client.config.logger.debug 'Calling API: OperationsApi.list_events ...'
229
+ end
230
+ # resource path
231
+ local_var_path = '/dashboard/events'
232
+
233
+ # query parameters
234
+ query_params = opts[:query_params] || {}
235
+ query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
236
+
237
+ # header parameters
238
+ header_params = opts[:header_params] || {}
239
+ # HTTP header 'Accept' (if needed)
240
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
241
+
242
+ # form parameters
243
+ form_params = opts[:form_params] || {}
244
+
245
+ # http body (model)
246
+ post_body = opts[:debug_body]
247
+
248
+ # return_type
249
+ return_type = opts[:debug_return_type] || 'ListEvents200Response'
250
+
251
+ # auth_names
252
+ auth_names = opts[:debug_auth_names] || ['signalTrackerSecret']
253
+
254
+ new_options = opts.merge(
255
+ :operation => :"OperationsApi.list_events",
256
+ :header_params => header_params,
257
+ :query_params => query_params,
258
+ :form_params => form_params,
259
+ :body => post_body,
260
+ :auth_names => auth_names,
261
+ :return_type => return_type
262
+ )
263
+
264
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
265
+ if @api_client.config.debugging
266
+ @api_client.config.logger.debug "API called: OperationsApi#list_events\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
267
+ end
268
+ return data, status_code, headers
269
+ end
270
+
271
+ # List recent events by cursor
272
+ # Returns retained customer-readable events using stable cursor pagination and aggregate destination-delivery acceptance metrics.
273
+ # @param [Hash] opts the optional parameters
274
+ # @option opts [Integer] :per_page Events per cursor page, capped at 100. (default to 25)
275
+ # @option opts [String] :cursor Opaque cursor returned by a previous response. Omit it on the first request.
276
+ # @return [ListEventsByCursor200Response]
277
+ def list_events_by_cursor(opts = {})
278
+ data, _status_code, _headers = list_events_by_cursor_with_http_info(opts)
279
+ data
280
+ end
281
+
282
+ # List recent events by cursor
283
+ # Returns retained customer-readable events using stable cursor pagination and aggregate destination-delivery acceptance metrics.
284
+ # @param [Hash] opts the optional parameters
285
+ # @option opts [Integer] :per_page Events per cursor page, capped at 100. (default to 25)
286
+ # @option opts [String] :cursor Opaque cursor returned by a previous response. Omit it on the first request.
287
+ # @return [Array<(ListEventsByCursor200Response, Integer, Hash)>] ListEventsByCursor200Response data, response status code and response headers
288
+ def list_events_by_cursor_with_http_info(opts = {})
289
+ if @api_client.config.debugging
290
+ @api_client.config.logger.debug 'Calling API: OperationsApi.list_events_by_cursor ...'
291
+ end
292
+ # resource path
293
+ local_var_path = '/dashboard/events/cursor'
294
+
295
+ # query parameters
296
+ query_params = opts[:query_params] || {}
297
+ query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
298
+ query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
299
+
300
+ # header parameters
301
+ header_params = opts[:header_params] || {}
302
+ # HTTP header 'Accept' (if needed)
303
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
304
+
305
+ # form parameters
306
+ form_params = opts[:form_params] || {}
307
+
308
+ # http body (model)
309
+ post_body = opts[:debug_body]
310
+
311
+ # return_type
312
+ return_type = opts[:debug_return_type] || 'ListEventsByCursor200Response'
313
+
314
+ # auth_names
315
+ auth_names = opts[:debug_auth_names] || ['signalTrackerSecret']
316
+
317
+ new_options = opts.merge(
318
+ :operation => :"OperationsApi.list_events_by_cursor",
319
+ :header_params => header_params,
320
+ :query_params => query_params,
321
+ :form_params => form_params,
322
+ :body => post_body,
323
+ :auth_names => auth_names,
324
+ :return_type => return_type
325
+ )
326
+
327
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
328
+ if @api_client.config.debugging
329
+ @api_client.config.logger.debug "API called: OperationsApi#list_events_by_cursor\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
330
+ end
331
+ return data, status_code, headers
332
+ end
333
+
334
+ # Replay eligible deliveries
335
+ # Evaluates retained failed deliveries and queues the eligible subset for another delivery attempt.
336
+ # @param [Hash] opts the optional parameters
337
+ # @option opts [ReplayDeliveriesRequest] :replay_deliveries_request
338
+ # @return [ReplayDeliveries202Response]
339
+ def replay_deliveries(opts = {})
340
+ data, _status_code, _headers = replay_deliveries_with_http_info(opts)
341
+ data
342
+ end
343
+
344
+ # Replay eligible deliveries
345
+ # Evaluates retained failed deliveries and queues the eligible subset for another delivery attempt.
346
+ # @param [Hash] opts the optional parameters
347
+ # @option opts [ReplayDeliveriesRequest] :replay_deliveries_request
348
+ # @return [Array<(ReplayDeliveries202Response, Integer, Hash)>] ReplayDeliveries202Response data, response status code and response headers
349
+ def replay_deliveries_with_http_info(opts = {})
350
+ if @api_client.config.debugging
351
+ @api_client.config.logger.debug 'Calling API: OperationsApi.replay_deliveries ...'
352
+ end
353
+ # resource path
354
+ local_var_path = '/deliveries/replay'
355
+
356
+ # query parameters
357
+ query_params = opts[:query_params] || {}
358
+
359
+ # header parameters
360
+ header_params = opts[:header_params] || {}
361
+ # HTTP header 'Accept' (if needed)
362
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
363
+ # HTTP header 'Content-Type'
364
+ content_type = @api_client.select_header_content_type(['application/json'])
365
+ if !content_type.nil?
366
+ header_params['Content-Type'] = content_type
367
+ end
368
+
369
+ # form parameters
370
+ form_params = opts[:form_params] || {}
371
+
372
+ # http body (model)
373
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'replay_deliveries_request'])
374
+
375
+ # return_type
376
+ return_type = opts[:debug_return_type] || 'ReplayDeliveries202Response'
377
+
378
+ # auth_names
379
+ auth_names = opts[:debug_auth_names] || ['signalTrackerSecret']
380
+
381
+ new_options = opts.merge(
382
+ :operation => :"OperationsApi.replay_deliveries",
383
+ :header_params => header_params,
384
+ :query_params => query_params,
385
+ :form_params => form_params,
386
+ :body => post_body,
387
+ :auth_names => auth_names,
388
+ :return_type => return_type
389
+ )
390
+
391
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
392
+ if @api_client.config.debugging
393
+ @api_client.config.logger.debug "API called: OperationsApi#replay_deliveries\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
394
+ end
395
+ return data, status_code, headers
396
+ end
397
+
398
+ # Send a controlled test purchase
399
+ # Creates an identity-free synthetic purchase and sends it only to the selected destination while test mode is enabled.
400
+ # @param destination [String] The destination ID
401
+ # @param [Hash] opts the optional parameters
402
+ # @option opts [SendTestPurchaseRequest] :send_test_purchase_request
403
+ # @return [SendTestPurchase200Response]
404
+ def send_test_purchase(destination, opts = {})
405
+ data, _status_code, _headers = send_test_purchase_with_http_info(destination, opts)
406
+ data
407
+ end
408
+
409
+ # Send a controlled test purchase
410
+ # Creates an identity-free synthetic purchase and sends it only to the selected destination while test mode is enabled.
411
+ # @param destination [String] The destination ID
412
+ # @param [Hash] opts the optional parameters
413
+ # @option opts [SendTestPurchaseRequest] :send_test_purchase_request
414
+ # @return [Array<(SendTestPurchase200Response, Integer, Hash)>] SendTestPurchase200Response data, response status code and response headers
415
+ def send_test_purchase_with_http_info(destination, opts = {})
416
+ if @api_client.config.debugging
417
+ @api_client.config.logger.debug 'Calling API: OperationsApi.send_test_purchase ...'
418
+ end
419
+ # verify the required parameter 'destination' is set
420
+ if @api_client.config.client_side_validation && destination.nil?
421
+ fail ArgumentError, "Missing the required parameter 'destination' when calling OperationsApi.send_test_purchase"
422
+ end
423
+ # resource path
424
+ local_var_path = '/destinations/{destination}/test-purchase'.sub('{destination}', CGI.escape(destination.to_s))
425
+
426
+ # query parameters
427
+ query_params = opts[:query_params] || {}
428
+
429
+ # header parameters
430
+ header_params = opts[:header_params] || {}
431
+ # HTTP header 'Accept' (if needed)
432
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
433
+ # HTTP header 'Content-Type'
434
+ content_type = @api_client.select_header_content_type(['application/json'])
435
+ if !content_type.nil?
436
+ header_params['Content-Type'] = content_type
437
+ end
438
+
439
+ # form parameters
440
+ form_params = opts[:form_params] || {}
441
+
442
+ # http body (model)
443
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'send_test_purchase_request'])
444
+
445
+ # return_type
446
+ return_type = opts[:debug_return_type] || 'SendTestPurchase200Response'
447
+
448
+ # auth_names
449
+ auth_names = opts[:debug_auth_names] || ['signalTrackerSecret']
450
+
451
+ new_options = opts.merge(
452
+ :operation => :"OperationsApi.send_test_purchase",
453
+ :header_params => header_params,
454
+ :query_params => query_params,
455
+ :form_params => form_params,
456
+ :body => post_body,
457
+ :auth_names => auth_names,
458
+ :return_type => return_type
459
+ )
460
+
461
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
462
+ if @api_client.config.debugging
463
+ @api_client.config.logger.debug "API called: OperationsApi#send_test_purchase\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
464
+ end
465
+ return data, status_code, headers
466
+ end
467
+
468
+ # Configure destination test mode
469
+ # Enables or disables Meta Test Events mode for a destination owned by the authenticated Signal tracker.
470
+ # @param destination [String] The destination ID
471
+ # @param set_destination_test_mode_request [SetDestinationTestModeRequest]
472
+ # @param [Hash] opts the optional parameters
473
+ # @return [SetDestinationTestMode200Response]
474
+ def set_destination_test_mode(destination, set_destination_test_mode_request, opts = {})
475
+ data, _status_code, _headers = set_destination_test_mode_with_http_info(destination, set_destination_test_mode_request, opts)
476
+ data
477
+ end
478
+
479
+ # Configure destination test mode
480
+ # Enables or disables Meta Test Events mode for a destination owned by the authenticated Signal tracker.
481
+ # @param destination [String] The destination ID
482
+ # @param set_destination_test_mode_request [SetDestinationTestModeRequest]
483
+ # @param [Hash] opts the optional parameters
484
+ # @return [Array<(SetDestinationTestMode200Response, Integer, Hash)>] SetDestinationTestMode200Response data, response status code and response headers
485
+ def set_destination_test_mode_with_http_info(destination, set_destination_test_mode_request, opts = {})
486
+ if @api_client.config.debugging
487
+ @api_client.config.logger.debug 'Calling API: OperationsApi.set_destination_test_mode ...'
488
+ end
489
+ # verify the required parameter 'destination' is set
490
+ if @api_client.config.client_side_validation && destination.nil?
491
+ fail ArgumentError, "Missing the required parameter 'destination' when calling OperationsApi.set_destination_test_mode"
492
+ end
493
+ # verify the required parameter 'set_destination_test_mode_request' is set
494
+ if @api_client.config.client_side_validation && set_destination_test_mode_request.nil?
495
+ fail ArgumentError, "Missing the required parameter 'set_destination_test_mode_request' when calling OperationsApi.set_destination_test_mode"
496
+ end
497
+ # resource path
498
+ local_var_path = '/destinations/{destination}/test-mode'.sub('{destination}', CGI.escape(destination.to_s))
499
+
500
+ # query parameters
501
+ query_params = opts[:query_params] || {}
502
+
503
+ # header parameters
504
+ header_params = opts[:header_params] || {}
505
+ # HTTP header 'Accept' (if needed)
506
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
507
+ # HTTP header 'Content-Type'
508
+ content_type = @api_client.select_header_content_type(['application/json'])
509
+ if !content_type.nil?
510
+ header_params['Content-Type'] = content_type
511
+ end
512
+
513
+ # form parameters
514
+ form_params = opts[:form_params] || {}
515
+
516
+ # http body (model)
517
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(set_destination_test_mode_request)
518
+
519
+ # return_type
520
+ return_type = opts[:debug_return_type] || 'SetDestinationTestMode200Response'
521
+
522
+ # auth_names
523
+ auth_names = opts[:debug_auth_names] || ['signalTrackerSecret']
524
+
525
+ new_options = opts.merge(
526
+ :operation => :"OperationsApi.set_destination_test_mode",
527
+ :header_params => header_params,
528
+ :query_params => query_params,
529
+ :form_params => form_params,
530
+ :body => post_body,
531
+ :auth_names => auth_names,
532
+ :return_type => return_type
533
+ )
534
+
535
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
536
+ if @api_client.config.debugging
537
+ @api_client.config.logger.debug "API called: OperationsApi#set_destination_test_mode\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
538
+ end
539
+ return data, status_code, headers
540
+ end
541
+ end
542
+ end