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,49 @@
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 'date'
14
+ require 'time'
15
+
16
+ module PlainRouter::OpenAPI
17
+ class DeliveryStatus
18
+ QUEUED = "queued".freeze
19
+ SENT = "sent".freeze
20
+ ACCEPTED = "accepted".freeze
21
+ RETRYING = "retrying".freeze
22
+ FAILED_AUTH = "failed:auth".freeze
23
+ FAILED_PERMANENT = "failed:permanent".freeze
24
+ FAILED_UNKNOWN = "failed:unknown".freeze
25
+ EXPIRED = "expired".freeze
26
+ SKIPPED_CONSENT = "skipped:consent".freeze
27
+ SKIPPED_NO_DESTINATION = "skipped:no_destination".freeze
28
+ SKIPPED_DUPLICATE = "skipped:duplicate".freeze
29
+
30
+ def self.all_vars
31
+ @all_vars ||= [QUEUED, SENT, ACCEPTED, RETRYING, FAILED_AUTH, FAILED_PERMANENT, FAILED_UNKNOWN, EXPIRED, SKIPPED_CONSENT, SKIPPED_NO_DESTINATION, SKIPPED_DUPLICATE].freeze
32
+ end
33
+
34
+ # Builds the enum from string
35
+ # @param [String] The enum value in the form of the string
36
+ # @return [String] The enum value
37
+ def self.build_from_hash(value)
38
+ new.build_from_hash(value)
39
+ end
40
+
41
+ # Builds the enum from string
42
+ # @param [String] The enum value in the form of the string
43
+ # @return [String] The enum value
44
+ def build_from_hash(value)
45
+ return value if DeliveryStatus.all_vars.include?(value)
46
+ raise "Invalid ENUM value #{value} for class #DeliveryStatus"
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,354 @@
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 'date'
14
+ require 'time'
15
+
16
+ module PlainRouter::OpenAPI
17
+ class Destination < ApiModelBase
18
+ attr_accessor :id
19
+
20
+ attr_accessor :signal_tracker_id
21
+
22
+ attr_accessor :platform_ad_account_id
23
+
24
+ attr_accessor :type
25
+
26
+ attr_accessor :credential_source
27
+
28
+ attr_accessor :config
29
+
30
+ attr_accessor :status
31
+
32
+ attr_accessor :created_at
33
+
34
+ attr_accessor :updated_at
35
+
36
+ class EnumAttributeValidator
37
+ attr_reader :datatype
38
+ attr_reader :allowable_values
39
+
40
+ def initialize(datatype, allowable_values)
41
+ @allowable_values = allowable_values.map do |value|
42
+ case datatype.to_s
43
+ when /Integer/i
44
+ value.to_i
45
+ when /Float/i
46
+ value.to_f
47
+ else
48
+ value
49
+ end
50
+ end
51
+ end
52
+
53
+ def valid?(value)
54
+ !value || allowable_values.include?(value)
55
+ end
56
+ end
57
+
58
+ # Attribute mapping from ruby-style variable name to JSON key.
59
+ def self.attribute_map
60
+ {
61
+ :'id' => :'id',
62
+ :'signal_tracker_id' => :'signal_tracker_id',
63
+ :'platform_ad_account_id' => :'platform_ad_account_id',
64
+ :'type' => :'type',
65
+ :'credential_source' => :'credential_source',
66
+ :'config' => :'config',
67
+ :'status' => :'status',
68
+ :'created_at' => :'created_at',
69
+ :'updated_at' => :'updated_at'
70
+ }
71
+ end
72
+
73
+ # Returns attribute mapping this model knows about
74
+ def self.acceptable_attribute_map
75
+ attribute_map
76
+ end
77
+
78
+ # Returns all the JSON keys this model knows about
79
+ def self.acceptable_attributes
80
+ acceptable_attribute_map.values
81
+ end
82
+
83
+ # Attribute type mapping.
84
+ def self.openapi_types
85
+ {
86
+ :'id' => :'String',
87
+ :'signal_tracker_id' => :'String',
88
+ :'platform_ad_account_id' => :'Integer',
89
+ :'type' => :'DestinationType',
90
+ :'credential_source' => :'DestinationCredentialSource',
91
+ :'config' => :'Array<Object>',
92
+ :'status' => :'DestinationStatus',
93
+ :'created_at' => :'Time',
94
+ :'updated_at' => :'Time'
95
+ }
96
+ end
97
+
98
+ # List of attributes with nullable: true
99
+ def self.openapi_nullable
100
+ Set.new([
101
+ :'platform_ad_account_id',
102
+ :'created_at',
103
+ :'updated_at'
104
+ ])
105
+ end
106
+
107
+ # Initializes the object
108
+ # @param [Hash] attributes Model attributes in the form of hash
109
+ def initialize(attributes = {})
110
+ if (!attributes.is_a?(Hash))
111
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PlainRouter::OpenAPI::Destination` initialize method"
112
+ end
113
+
114
+ # check to see if the attribute exists and convert string to symbol for hash key
115
+ acceptable_attribute_map = self.class.acceptable_attribute_map
116
+ attributes = attributes.each_with_object({}) { |(k, v), h|
117
+ if (!acceptable_attribute_map.key?(k.to_sym))
118
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PlainRouter::OpenAPI::Destination`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
119
+ end
120
+ h[k.to_sym] = v
121
+ }
122
+
123
+ if attributes.key?(:'id')
124
+ self.id = attributes[:'id']
125
+ else
126
+ self.id = nil
127
+ end
128
+
129
+ if attributes.key?(:'signal_tracker_id')
130
+ self.signal_tracker_id = attributes[:'signal_tracker_id']
131
+ else
132
+ self.signal_tracker_id = nil
133
+ end
134
+
135
+ if attributes.key?(:'platform_ad_account_id')
136
+ self.platform_ad_account_id = attributes[:'platform_ad_account_id']
137
+ else
138
+ self.platform_ad_account_id = nil
139
+ end
140
+
141
+ if attributes.key?(:'type')
142
+ self.type = attributes[:'type']
143
+ else
144
+ self.type = nil
145
+ end
146
+
147
+ if attributes.key?(:'credential_source')
148
+ self.credential_source = attributes[:'credential_source']
149
+ else
150
+ self.credential_source = nil
151
+ end
152
+
153
+ if attributes.key?(:'config')
154
+ if (value = attributes[:'config']).is_a?(Array)
155
+ self.config = value
156
+ end
157
+ else
158
+ self.config = nil
159
+ end
160
+
161
+ if attributes.key?(:'status')
162
+ self.status = attributes[:'status']
163
+ else
164
+ self.status = nil
165
+ end
166
+
167
+ if attributes.key?(:'created_at')
168
+ self.created_at = attributes[:'created_at']
169
+ else
170
+ self.created_at = nil
171
+ end
172
+
173
+ if attributes.key?(:'updated_at')
174
+ self.updated_at = attributes[:'updated_at']
175
+ else
176
+ self.updated_at = nil
177
+ end
178
+ end
179
+
180
+ # Show invalid properties with the reasons. Usually used together with valid?
181
+ # @return Array for valid properties with the reasons
182
+ def list_invalid_properties
183
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
184
+ invalid_properties = Array.new
185
+ if @id.nil?
186
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
187
+ end
188
+
189
+ if @signal_tracker_id.nil?
190
+ invalid_properties.push('invalid value for "signal_tracker_id", signal_tracker_id cannot be nil.')
191
+ end
192
+
193
+ if @type.nil?
194
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
195
+ end
196
+
197
+ if @credential_source.nil?
198
+ invalid_properties.push('invalid value for "credential_source", credential_source cannot be nil.')
199
+ end
200
+
201
+ if @config.nil?
202
+ invalid_properties.push('invalid value for "config", config cannot be nil.')
203
+ end
204
+
205
+ if @status.nil?
206
+ invalid_properties.push('invalid value for "status", status cannot be nil.')
207
+ end
208
+
209
+ invalid_properties
210
+ end
211
+
212
+ # Check to see if the all the properties in the model are valid
213
+ # @return true if the model is valid
214
+ def valid?
215
+ warn '[DEPRECATED] the `valid?` method is obsolete'
216
+ return false if @id.nil?
217
+ return false if @signal_tracker_id.nil?
218
+ return false if @type.nil?
219
+ return false if @credential_source.nil?
220
+ return false if @config.nil?
221
+ return false if @status.nil?
222
+ true
223
+ end
224
+
225
+ # Custom attribute writer method with validation
226
+ # @param [Object] id Value to be assigned
227
+ def id=(id)
228
+ if id.nil?
229
+ fail ArgumentError, 'id cannot be nil'
230
+ end
231
+
232
+ @id = id
233
+ end
234
+
235
+ # Custom attribute writer method with validation
236
+ # @param [Object] signal_tracker_id Value to be assigned
237
+ def signal_tracker_id=(signal_tracker_id)
238
+ if signal_tracker_id.nil?
239
+ fail ArgumentError, 'signal_tracker_id cannot be nil'
240
+ end
241
+
242
+ @signal_tracker_id = signal_tracker_id
243
+ end
244
+
245
+ # Custom attribute writer method with validation
246
+ # @param [Object] type Value to be assigned
247
+ def type=(type)
248
+ if type.nil?
249
+ fail ArgumentError, 'type cannot be nil'
250
+ end
251
+
252
+ @type = type
253
+ end
254
+
255
+ # Custom attribute writer method with validation
256
+ # @param [Object] credential_source Value to be assigned
257
+ def credential_source=(credential_source)
258
+ if credential_source.nil?
259
+ fail ArgumentError, 'credential_source cannot be nil'
260
+ end
261
+
262
+ @credential_source = credential_source
263
+ end
264
+
265
+ # Custom attribute writer method with validation
266
+ # @param [Object] config Value to be assigned
267
+ def config=(config)
268
+ if config.nil?
269
+ fail ArgumentError, 'config cannot be nil'
270
+ end
271
+
272
+ @config = config
273
+ end
274
+
275
+ # Custom attribute writer method with validation
276
+ # @param [Object] status Value to be assigned
277
+ def status=(status)
278
+ if status.nil?
279
+ fail ArgumentError, 'status cannot be nil'
280
+ end
281
+
282
+ @status = status
283
+ end
284
+
285
+ # Checks equality by comparing each attribute.
286
+ # @param [Object] Object to be compared
287
+ def ==(o)
288
+ return true if self.equal?(o)
289
+ self.class == o.class &&
290
+ id == o.id &&
291
+ signal_tracker_id == o.signal_tracker_id &&
292
+ platform_ad_account_id == o.platform_ad_account_id &&
293
+ type == o.type &&
294
+ credential_source == o.credential_source &&
295
+ config == o.config &&
296
+ status == o.status &&
297
+ created_at == o.created_at &&
298
+ updated_at == o.updated_at
299
+ end
300
+
301
+ # @see the `==` method
302
+ # @param [Object] Object to be compared
303
+ def eql?(o)
304
+ self == o
305
+ end
306
+
307
+ # Calculates hash code according to all attributes.
308
+ # @return [Integer] Hash code
309
+ def hash
310
+ [id, signal_tracker_id, platform_ad_account_id, type, credential_source, config, status, created_at, updated_at].hash
311
+ end
312
+
313
+ # Builds the object from hash
314
+ # @param [Hash] attributes Model attributes in the form of hash
315
+ # @return [Object] Returns the model itself
316
+ def self.build_from_hash(attributes)
317
+ return nil unless attributes.is_a?(Hash)
318
+ attributes = attributes.transform_keys(&:to_sym)
319
+ transformed_hash = {}
320
+ openapi_types.each_pair do |key, type|
321
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
322
+ transformed_hash["#{key}"] = nil
323
+ elsif type =~ /\AArray<(.*)>/i
324
+ # check to ensure the input is an array given that the attribute
325
+ # is documented as an array but the input is not
326
+ if attributes[attribute_map[key]].is_a?(Array)
327
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
328
+ end
329
+ elsif !attributes[attribute_map[key]].nil?
330
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
331
+ end
332
+ end
333
+ new(transformed_hash)
334
+ end
335
+
336
+ # Returns the object in the form of hash
337
+ # @return [Hash] Returns the object in the form of hash
338
+ def to_hash
339
+ hash = {}
340
+ self.class.attribute_map.each_pair do |attr, param|
341
+ value = self.send(attr)
342
+ if value.nil?
343
+ is_nullable = self.class.openapi_nullable.include?(attr)
344
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
345
+ end
346
+
347
+ hash[param] = _to_hash(value)
348
+ end
349
+ hash
350
+ end
351
+
352
+ end
353
+
354
+ end
@@ -0,0 +1,40 @@
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 'date'
14
+ require 'time'
15
+
16
+ module PlainRouter::OpenAPI
17
+ class DestinationCredentialSource
18
+ OAUTH_CONNECTION = "oauth_connection".freeze
19
+ MANAGED_TOKEN = "managed_token".freeze
20
+
21
+ def self.all_vars
22
+ @all_vars ||= [OAUTH_CONNECTION, MANAGED_TOKEN].freeze
23
+ end
24
+
25
+ # Builds the enum from string
26
+ # @param [String] The enum value in the form of the string
27
+ # @return [String] The enum value
28
+ def self.build_from_hash(value)
29
+ new.build_from_hash(value)
30
+ end
31
+
32
+ # Builds the enum from string
33
+ # @param [String] The enum value in the form of the string
34
+ # @return [String] The enum value
35
+ def build_from_hash(value)
36
+ return value if DestinationCredentialSource.all_vars.include?(value)
37
+ raise "Invalid ENUM value #{value} for class #DestinationCredentialSource"
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,40 @@
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 'date'
14
+ require 'time'
15
+
16
+ module PlainRouter::OpenAPI
17
+ class DestinationStatus
18
+ ACTIVE = "active".freeze
19
+ INACTIVE = "inactive".freeze
20
+
21
+ def self.all_vars
22
+ @all_vars ||= [ACTIVE, INACTIVE].freeze
23
+ end
24
+
25
+ # Builds the enum from string
26
+ # @param [String] The enum value in the form of the string
27
+ # @return [String] The enum value
28
+ def self.build_from_hash(value)
29
+ new.build_from_hash(value)
30
+ end
31
+
32
+ # Builds the enum from string
33
+ # @param [String] The enum value in the form of the string
34
+ # @return [String] The enum value
35
+ def build_from_hash(value)
36
+ return value if DestinationStatus.all_vars.include?(value)
37
+ raise "Invalid ENUM value #{value} for class #DestinationStatus"
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,39 @@
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 'date'
14
+ require 'time'
15
+
16
+ module PlainRouter::OpenAPI
17
+ class DestinationType
18
+ META = "meta".freeze
19
+
20
+ def self.all_vars
21
+ @all_vars ||= [META].freeze
22
+ end
23
+
24
+ # Builds the enum from string
25
+ # @param [String] The enum value in the form of the string
26
+ # @return [String] The enum value
27
+ def self.build_from_hash(value)
28
+ new.build_from_hash(value)
29
+ end
30
+
31
+ # Builds the enum from string
32
+ # @param [String] The enum value in the form of the string
33
+ # @return [String] The enum value
34
+ def build_from_hash(value)
35
+ return value if DestinationType.all_vars.include?(value)
36
+ raise "Invalid ENUM value #{value} for class #DestinationType"
37
+ end
38
+ end
39
+ end