plainrouter-sdk 0.2.0 → 0.5.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 (125) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +9 -2
  3. data/lib/plainrouter/client.rb +2 -1
  4. data/lib/plainrouter/openapi/api/action_dry_run_api_api.rb +2 -2
  5. data/lib/plainrouter/openapi/api/action_proposal_api_api.rb +2 -2
  6. data/lib/plainrouter/openapi/api/ad_test_api_api.rb +259 -0
  7. data/lib/plainrouter/openapi/api/cookie_declaration_api.rb +90 -0
  8. data/lib/plainrouter/openapi/api/creative_api.rb +181 -0
  9. data/lib/plainrouter/openapi/api/deployment_plan_api.rb +306 -0
  10. data/lib/plainrouter/openapi/api/meta_inventory_exposure_api.rb +121 -0
  11. data/lib/plainrouter/openapi/configuration.rb +42 -0
  12. data/lib/plainrouter/openapi/models/action_current_disposition.rb +13 -1
  13. data/lib/plainrouter/openapi/models/action_current_disposition_outcome_payload.rb +238 -0
  14. data/lib/plainrouter/openapi/models/action_current_disposition_outcome_payload_baseline.rb +103 -0
  15. data/lib/plainrouter/openapi/models/action_current_disposition_outcome_payload_baseline_any_of.rb +245 -0
  16. data/lib/plainrouter/openapi/models/action_current_disposition_outcome_payload_inverse.rb +206 -0
  17. data/lib/plainrouter/openapi/models/action_current_disposition_outcome_payload_metrics.rb +103 -0
  18. data/lib/plainrouter/openapi/models/action_current_disposition_outcome_payload_metrics_any_of.rb +276 -0
  19. data/lib/plainrouter/openapi/models/action_policy_read_data.rb +3 -105
  20. data/lib/plainrouter/openapi/models/action_policy_result.rb +374 -0
  21. data/lib/plainrouter/openapi/models/action_proposal_input.rb +32 -4
  22. data/lib/plainrouter/openapi/models/action_read_item.rb +62 -4
  23. data/lib/plainrouter/openapi/models/action_read_item_evidence.rb +105 -0
  24. data/lib/plainrouter/openapi/models/action_read_item_evidence_any_of.rb +190 -0
  25. data/lib/plainrouter/openapi/models/action_read_item_evidence_any_of1.rb +242 -0
  26. data/lib/plainrouter/openapi/models/action_read_item_evidence_any_of2.rb +217 -0
  27. data/lib/plainrouter/openapi/models/action_read_item_evidence_any_of_outcome.rb +238 -0
  28. data/lib/plainrouter/openapi/models/action_read_item_proposer.rb +198 -0
  29. data/lib/plainrouter/openapi/models/actions_api_dry_run401_response.rb +103 -0
  30. data/lib/plainrouter/openapi/models/actions_tests_api_index404_response.rb +103 -0
  31. data/lib/plainrouter/openapi/models/actions_tests_api_store_request.rb +467 -0
  32. data/lib/plainrouter/openapi/models/actions_tests_api_store_request_maximum_spend_minor.rb +104 -0
  33. data/lib/plainrouter/openapi/models/ad_test.rb +552 -0
  34. data/lib/plainrouter/openapi/models/ad_test_create_read.rb +164 -0
  35. data/lib/plainrouter/openapi/models/ad_test_create_read_test.rb +675 -0
  36. data/lib/plainrouter/openapi/models/ad_test_create_read_test_members_inner.rb +232 -0
  37. data/lib/plainrouter/openapi/models/ad_test_create_read_test_pause_proposals_inner.rb +286 -0
  38. data/lib/plainrouter/openapi/models/ad_test_create_read_test_verdict.rb +336 -0
  39. data/lib/plainrouter/openapi/models/ad_test_create_read_test_verdict_daily_facts_inner.rb +374 -0
  40. data/lib/plainrouter/openapi/models/ad_test_create_read_test_verdict_halt_details.rb +285 -0
  41. data/lib/plainrouter/openapi/models/ad_test_create_read_test_verdict_halt_details_baseline.rb +190 -0
  42. data/lib/plainrouter/openapi/models/ad_test_create_read_test_verdict_halt_details_observed_destinations_inner.rb +216 -0
  43. data/lib/plainrouter/openapi/models/ad_test_create_read_test_verdict_members_inner.rb +349 -0
  44. data/lib/plainrouter/openapi/models/ad_test_daily_fact_read.rb +374 -0
  45. data/lib/plainrouter/openapi/models/ad_test_event_choice.rb +190 -0
  46. data/lib/plainrouter/openapi/models/ad_test_list_read.rb +218 -0
  47. data/lib/plainrouter/openapi/models/ad_test_list_read_observed_conversion_events_inner.rb +190 -0
  48. data/lib/plainrouter/openapi/models/ad_test_list_read_tests.rb +396 -0
  49. data/lib/plainrouter/openapi/models/ad_test_read.rb +675 -0
  50. data/lib/plainrouter/openapi/models/ad_test_show_read.rb +164 -0
  51. data/lib/plainrouter/openapi/models/ad_test_verdict_member_read.rb +349 -0
  52. data/lib/plainrouter/openapi/models/ad_test_verdict_read.rb +336 -0
  53. data/lib/plainrouter/openapi/models/agent_credential_error.rb +214 -0
  54. data/lib/plainrouter/openapi/models/api_route_not_found.rb +216 -0
  55. data/lib/plainrouter/openapi/models/api_route_not_found_error.rb +240 -0
  56. data/lib/plainrouter/openapi/models/api_route_not_found_request.rb +190 -0
  57. data/lib/plainrouter/openapi/models/api_route_not_found_resources.rb +190 -0
  58. data/lib/plainrouter/openapi/models/cookie_declaration.rb +177 -0
  59. data/lib/plainrouter/openapi/models/cookie_declaration_categories.rb +268 -0
  60. data/lib/plainrouter/openapi/models/cookie_declaration_categories_necessary.rb +194 -0
  61. data/lib/plainrouter/openapi/models/cookie_declaration_item.rb +280 -0
  62. data/lib/plainrouter/openapi/models/create_event202_response_warnings_inner.rb +2 -2
  63. data/lib/plainrouter/openapi/models/create_event_request_any_of.rb +1 -1
  64. data/lib/plainrouter/openapi/models/create_event_request_any_of1.rb +1 -1
  65. data/lib/plainrouter/openapi/models/creative_intake_read.rb +164 -0
  66. data/lib/plainrouter/openapi/models/creative_intake_read_creative.rb +451 -0
  67. data/lib/plainrouter/openapi/models/creative_intake_read_creative_tags.rb +104 -0
  68. data/lib/plainrouter/openapi/models/creative_intake_rejected.rb +164 -0
  69. data/lib/plainrouter/openapi/models/creative_intake_rejected_error.rb +190 -0
  70. data/lib/plainrouter/openapi/models/creative_intake_tags.rb +257 -0
  71. data/lib/plainrouter/openapi/models/deployment_plan.rb +593 -0
  72. data/lib/plainrouter/openapi/models/deployment_plan_read.rb +268 -0
  73. data/lib/plainrouter/openapi/models/deployment_plan_read_copy.rb +266 -0
  74. data/lib/plainrouter/openapi/models/deployment_plan_read_creatives_inner.rb +320 -0
  75. data/lib/plainrouter/openapi/models/deployment_plan_read_creatives_inner_copy.rb +267 -0
  76. data/lib/plainrouter/openapi/models/destination_type.rb +2 -1
  77. data/lib/plainrouter/openapi/models/execute_deployment_plan_request.rb +200 -0
  78. data/lib/plainrouter/openapi/models/get_cookie_declaration404_response.rb +103 -0
  79. data/lib/plainrouter/openapi/models/get_inventory_metrics200_response.rb +324 -0
  80. data/lib/plainrouter/openapi/models/get_inventory_metrics200_response_account.rb +264 -0
  81. data/lib/plainrouter/openapi/models/get_inventory_metrics200_response_changes_inner.rb +304 -0
  82. data/lib/plainrouter/openapi/models/get_inventory_metrics200_response_effective_range.rb +190 -0
  83. data/lib/plainrouter/openapi/models/get_inventory_metrics200_response_metrics_inner.rb +492 -0
  84. data/lib/plainrouter/openapi/models/get_inventory_metrics200_response_object_metrics_inner.rb +304 -0
  85. data/lib/plainrouter/openapi/models/get_inventory_metrics200_response_object_metrics_inner_meta.rb +268 -0
  86. data/lib/plainrouter/openapi/models/get_inventory_metrics200_response_staleness.rb +200 -0
  87. data/lib/plainrouter/openapi/models/get_inventory_metrics200_response_sync.rb +186 -0
  88. data/lib/plainrouter/openapi/models/ingestion_warning_code.rb +2 -1
  89. data/lib/plainrouter/openapi/models/launch_intent_read.rb +164 -0
  90. data/lib/plainrouter/openapi/models/launch_intent_read_intent.rb +330 -0
  91. data/lib/plainrouter/openapi/models/launch_intent_read_intent_actions_inner.rb +238 -0
  92. data/lib/plainrouter/openapi/models/launch_intent_status.rb +46 -0
  93. data/lib/plainrouter/openapi/models/launch_plans_copy403_response.rb +103 -0
  94. data/lib/plainrouter/openapi/models/launch_plans_copy404_response.rb +103 -0
  95. data/lib/plainrouter/openapi/models/launch_plans_execute422_response.rb +103 -0
  96. data/lib/plainrouter/openapi/models/launch_plans_index200_response.rb +164 -0
  97. data/lib/plainrouter/openapi/models/launch_plans_index200_response_plans.rb +244 -0
  98. data/lib/plainrouter/openapi/models/launch_plans_show200_response.rb +164 -0
  99. data/lib/plainrouter/openapi/models/plan_copy_forbidden.rb +164 -0
  100. data/lib/plainrouter/openapi/models/plan_copy_forbidden_error.rb +214 -0
  101. data/lib/plainrouter/openapi/models/plan_copy_not_found.rb +164 -0
  102. data/lib/plainrouter/openapi/models/plan_copy_not_found_error.rb +214 -0
  103. data/lib/plainrouter/openapi/models/plan_copy_read.rb +164 -0
  104. data/lib/plainrouter/openapi/models/plan_copy_read_plan.rb +347 -0
  105. data/lib/plainrouter/openapi/models/plan_copy_rejected.rb +164 -0
  106. data/lib/plainrouter/openapi/models/plan_copy_rejected_error.rb +214 -0
  107. data/lib/plainrouter/openapi/models/plan_execute_conflict.rb +164 -0
  108. data/lib/plainrouter/openapi/models/plan_execute_conflict_error.rb +214 -0
  109. data/lib/plainrouter/openapi/models/plan_execute_rejected.rb +164 -0
  110. data/lib/plainrouter/openapi/models/plan_execute_rejected_error.rb +214 -0
  111. data/lib/plainrouter/openapi/models/proposal_replay_conflict.rb +214 -0
  112. data/lib/plainrouter/openapi/models/proposal_replay_conflict_errors.rb +178 -0
  113. data/lib/plainrouter/openapi/models/store_creative403_response.rb +103 -0
  114. data/lib/plainrouter/openapi/models/store_creative413_response.rb +103 -0
  115. data/lib/plainrouter/openapi/models/store_creative422_response.rb +103 -0
  116. data/lib/plainrouter/openapi/models/store_creative_from_url_request.rb +208 -0
  117. data/lib/plainrouter/openapi/models/store_creative_from_url_request_tags.rb +257 -0
  118. data/lib/plainrouter/openapi/models/store_creative_request.rb +219 -0
  119. data/lib/plainrouter/openapi/models/store_creative_request_tags.rb +257 -0
  120. data/lib/plainrouter/openapi/models/workspace_lock_timeout.rb +164 -0
  121. data/lib/plainrouter/openapi/models/workspace_lock_timeout_error.rb +214 -0
  122. data/lib/plainrouter/openapi/version.rb +1 -1
  123. data/lib/plainrouter/openapi.rb +106 -0
  124. data/lib/plainrouter/version.rb +1 -1
  125. metadata +108 -2
@@ -0,0 +1,374 @@
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 AdTestDailyFactRead < ApiModelBase
18
+ attr_accessor :date
19
+
20
+ attr_accessor :ad_test_member_id
21
+
22
+ attr_accessor :ad_id
23
+
24
+ # Exact spend in Meta minor units for the account currency, including any stored fractional component.
25
+ attr_accessor :spend_minor
26
+
27
+ # Account-currency spend in major units.
28
+ attr_accessor :spend
29
+
30
+ attr_accessor :impressions
31
+
32
+ attr_accessor :inline_link_clicks
33
+
34
+ attr_accessor :counted_arrivals
35
+
36
+ attr_accessor :recorded_conversions
37
+
38
+ attr_accessor :admitted_conversions
39
+
40
+ # Attribute mapping from ruby-style variable name to JSON key.
41
+ def self.attribute_map
42
+ {
43
+ :'date' => :'date',
44
+ :'ad_test_member_id' => :'ad_test_member_id',
45
+ :'ad_id' => :'ad_id',
46
+ :'spend_minor' => :'spend_minor',
47
+ :'spend' => :'spend',
48
+ :'impressions' => :'impressions',
49
+ :'inline_link_clicks' => :'inline_link_clicks',
50
+ :'counted_arrivals' => :'counted_arrivals',
51
+ :'recorded_conversions' => :'recorded_conversions',
52
+ :'admitted_conversions' => :'admitted_conversions'
53
+ }
54
+ end
55
+
56
+ # Returns attribute mapping this model knows about
57
+ def self.acceptable_attribute_map
58
+ attribute_map
59
+ end
60
+
61
+ # Returns all the JSON keys this model knows about
62
+ def self.acceptable_attributes
63
+ acceptable_attribute_map.values
64
+ end
65
+
66
+ # Attribute type mapping.
67
+ def self.openapi_types
68
+ {
69
+ :'date' => :'Date',
70
+ :'ad_test_member_id' => :'String',
71
+ :'ad_id' => :'String',
72
+ :'spend_minor' => :'String',
73
+ :'spend' => :'String',
74
+ :'impressions' => :'Integer',
75
+ :'inline_link_clicks' => :'Integer',
76
+ :'counted_arrivals' => :'Integer',
77
+ :'recorded_conversions' => :'Integer',
78
+ :'admitted_conversions' => :'Integer'
79
+ }
80
+ end
81
+
82
+ # List of attributes with nullable: true
83
+ def self.openapi_nullable
84
+ Set.new([
85
+ :'spend',
86
+ :'impressions',
87
+ :'inline_link_clicks',
88
+ :'counted_arrivals',
89
+ :'recorded_conversions',
90
+ :'admitted_conversions'
91
+ ])
92
+ end
93
+
94
+ # Initializes the object
95
+ # @param [Hash] attributes Model attributes in the form of hash
96
+ def initialize(attributes = {})
97
+ if (!attributes.is_a?(Hash))
98
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PlainRouter::OpenAPI::AdTestDailyFactRead` initialize method"
99
+ end
100
+
101
+ # check to see if the attribute exists and convert string to symbol for hash key
102
+ acceptable_attribute_map = self.class.acceptable_attribute_map
103
+ attributes = attributes.each_with_object({}) { |(k, v), h|
104
+ if (!acceptable_attribute_map.key?(k.to_sym))
105
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PlainRouter::OpenAPI::AdTestDailyFactRead`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
106
+ end
107
+ h[k.to_sym] = v
108
+ }
109
+
110
+ if attributes.key?(:'date')
111
+ self.date = attributes[:'date']
112
+ else
113
+ self.date = nil
114
+ end
115
+
116
+ if attributes.key?(:'ad_test_member_id')
117
+ self.ad_test_member_id = attributes[:'ad_test_member_id']
118
+ else
119
+ self.ad_test_member_id = nil
120
+ end
121
+
122
+ if attributes.key?(:'ad_id')
123
+ self.ad_id = attributes[:'ad_id']
124
+ else
125
+ self.ad_id = nil
126
+ end
127
+
128
+ if attributes.key?(:'spend_minor')
129
+ self.spend_minor = attributes[:'spend_minor']
130
+ else
131
+ self.spend_minor = nil
132
+ end
133
+
134
+ if attributes.key?(:'spend')
135
+ self.spend = attributes[:'spend']
136
+ else
137
+ self.spend = nil
138
+ end
139
+
140
+ if attributes.key?(:'impressions')
141
+ self.impressions = attributes[:'impressions']
142
+ else
143
+ self.impressions = nil
144
+ end
145
+
146
+ if attributes.key?(:'inline_link_clicks')
147
+ self.inline_link_clicks = attributes[:'inline_link_clicks']
148
+ end
149
+
150
+ if attributes.key?(:'counted_arrivals')
151
+ self.counted_arrivals = attributes[:'counted_arrivals']
152
+ else
153
+ self.counted_arrivals = nil
154
+ end
155
+
156
+ if attributes.key?(:'recorded_conversions')
157
+ self.recorded_conversions = attributes[:'recorded_conversions']
158
+ else
159
+ self.recorded_conversions = nil
160
+ end
161
+
162
+ if attributes.key?(:'admitted_conversions')
163
+ self.admitted_conversions = attributes[:'admitted_conversions']
164
+ else
165
+ self.admitted_conversions = nil
166
+ end
167
+ end
168
+
169
+ # Show invalid properties with the reasons. Usually used together with valid?
170
+ # @return Array for valid properties with the reasons
171
+ def list_invalid_properties
172
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
173
+ invalid_properties = Array.new
174
+ if @date.nil?
175
+ invalid_properties.push('invalid value for "date", date cannot be nil.')
176
+ end
177
+
178
+ if @ad_test_member_id.nil?
179
+ invalid_properties.push('invalid value for "ad_test_member_id", ad_test_member_id cannot be nil.')
180
+ end
181
+
182
+ if @ad_test_member_id.to_s.length > 26
183
+ invalid_properties.push('invalid value for "ad_test_member_id", the character length must be smaller than or equal to 26.')
184
+ end
185
+
186
+ if @ad_test_member_id.to_s.length < 26
187
+ invalid_properties.push('invalid value for "ad_test_member_id", the character length must be greater than or equal to 26.')
188
+ end
189
+
190
+ pattern = Regexp.new(/^[0-7][0-9a-hjkmnp-tv-z]{25}$/)
191
+ if @ad_test_member_id !~ pattern
192
+ invalid_properties.push("invalid value for \"ad_test_member_id\", must conform to the pattern #{pattern}.")
193
+ end
194
+
195
+ if @ad_id.nil?
196
+ invalid_properties.push('invalid value for "ad_id", ad_id cannot be nil.')
197
+ end
198
+
199
+ if @ad_id.to_s.length > 128
200
+ invalid_properties.push('invalid value for "ad_id", the character length must be smaller than or equal to 128.')
201
+ end
202
+
203
+ pattern = Regexp.new(/^[0-9]+$/)
204
+ if @ad_id !~ pattern
205
+ invalid_properties.push("invalid value for \"ad_id\", must conform to the pattern #{pattern}.")
206
+ end
207
+
208
+ if @spend_minor.nil?
209
+ invalid_properties.push('invalid value for "spend_minor", spend_minor cannot be nil.')
210
+ end
211
+
212
+ pattern = Regexp.new(/^[0-9]+(?:\.[0-9]+)?$/)
213
+ if @spend_minor !~ pattern
214
+ invalid_properties.push("invalid value for \"spend_minor\", must conform to the pattern #{pattern}.")
215
+ end
216
+
217
+ invalid_properties
218
+ end
219
+
220
+ # Check to see if the all the properties in the model are valid
221
+ # @return true if the model is valid
222
+ def valid?
223
+ warn '[DEPRECATED] the `valid?` method is obsolete'
224
+ return false if @date.nil?
225
+ return false if @ad_test_member_id.nil?
226
+ return false if @ad_test_member_id.to_s.length > 26
227
+ return false if @ad_test_member_id.to_s.length < 26
228
+ return false if @ad_test_member_id !~ Regexp.new(/^[0-7][0-9a-hjkmnp-tv-z]{25}$/)
229
+ return false if @ad_id.nil?
230
+ return false if @ad_id.to_s.length > 128
231
+ return false if @ad_id !~ Regexp.new(/^[0-9]+$/)
232
+ return false if @spend_minor.nil?
233
+ return false if @spend_minor !~ Regexp.new(/^[0-9]+(?:\.[0-9]+)?$/)
234
+ true
235
+ end
236
+
237
+ # Custom attribute writer method with validation
238
+ # @param [Object] date Value to be assigned
239
+ def date=(date)
240
+ if date.nil?
241
+ fail ArgumentError, 'date cannot be nil'
242
+ end
243
+
244
+ @date = date
245
+ end
246
+
247
+ # Custom attribute writer method with validation
248
+ # @param [Object] ad_test_member_id Value to be assigned
249
+ def ad_test_member_id=(ad_test_member_id)
250
+ if ad_test_member_id.nil?
251
+ fail ArgumentError, 'ad_test_member_id cannot be nil'
252
+ end
253
+
254
+ if ad_test_member_id.to_s.length > 26
255
+ fail ArgumentError, 'invalid value for "ad_test_member_id", the character length must be smaller than or equal to 26.'
256
+ end
257
+
258
+ if ad_test_member_id.to_s.length < 26
259
+ fail ArgumentError, 'invalid value for "ad_test_member_id", the character length must be greater than or equal to 26.'
260
+ end
261
+
262
+ pattern = Regexp.new(/^[0-7][0-9a-hjkmnp-tv-z]{25}$/)
263
+ if ad_test_member_id !~ pattern
264
+ fail ArgumentError, "invalid value for \"ad_test_member_id\", must conform to the pattern #{pattern}."
265
+ end
266
+
267
+ @ad_test_member_id = ad_test_member_id
268
+ end
269
+
270
+ # Custom attribute writer method with validation
271
+ # @param [Object] ad_id Value to be assigned
272
+ def ad_id=(ad_id)
273
+ if ad_id.nil?
274
+ fail ArgumentError, 'ad_id cannot be nil'
275
+ end
276
+
277
+ if ad_id.to_s.length > 128
278
+ fail ArgumentError, 'invalid value for "ad_id", the character length must be smaller than or equal to 128.'
279
+ end
280
+
281
+ pattern = Regexp.new(/^[0-9]+$/)
282
+ if ad_id !~ pattern
283
+ fail ArgumentError, "invalid value for \"ad_id\", must conform to the pattern #{pattern}."
284
+ end
285
+
286
+ @ad_id = ad_id
287
+ end
288
+
289
+ # Custom attribute writer method with validation
290
+ # @param [Object] spend_minor Value to be assigned
291
+ def spend_minor=(spend_minor)
292
+ if spend_minor.nil?
293
+ fail ArgumentError, 'spend_minor cannot be nil'
294
+ end
295
+
296
+ pattern = Regexp.new(/^[0-9]+(?:\.[0-9]+)?$/)
297
+ if spend_minor !~ pattern
298
+ fail ArgumentError, "invalid value for \"spend_minor\", must conform to the pattern #{pattern}."
299
+ end
300
+
301
+ @spend_minor = spend_minor
302
+ end
303
+
304
+ # Checks equality by comparing each attribute.
305
+ # @param [Object] Object to be compared
306
+ def ==(o)
307
+ return true if self.equal?(o)
308
+ self.class == o.class &&
309
+ date == o.date &&
310
+ ad_test_member_id == o.ad_test_member_id &&
311
+ ad_id == o.ad_id &&
312
+ spend_minor == o.spend_minor &&
313
+ spend == o.spend &&
314
+ impressions == o.impressions &&
315
+ inline_link_clicks == o.inline_link_clicks &&
316
+ counted_arrivals == o.counted_arrivals &&
317
+ recorded_conversions == o.recorded_conversions &&
318
+ admitted_conversions == o.admitted_conversions
319
+ end
320
+
321
+ # @see the `==` method
322
+ # @param [Object] Object to be compared
323
+ def eql?(o)
324
+ self == o
325
+ end
326
+
327
+ # Calculates hash code according to all attributes.
328
+ # @return [Integer] Hash code
329
+ def hash
330
+ [date, ad_test_member_id, ad_id, spend_minor, spend, impressions, inline_link_clicks, counted_arrivals, recorded_conversions, admitted_conversions].hash
331
+ end
332
+
333
+ # Builds the object from hash
334
+ # @param [Hash] attributes Model attributes in the form of hash
335
+ # @return [Object] Returns the model itself
336
+ def self.build_from_hash(attributes)
337
+ return nil unless attributes.is_a?(Hash)
338
+ attributes = attributes.transform_keys(&:to_sym)
339
+ transformed_hash = {}
340
+ openapi_types.each_pair do |key, type|
341
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
342
+ transformed_hash["#{key}"] = nil
343
+ elsif type =~ /\AArray<(.*)>/i
344
+ # check to ensure the input is an array given that the attribute
345
+ # is documented as an array but the input is not
346
+ if attributes[attribute_map[key]].is_a?(Array)
347
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
348
+ end
349
+ elsif !attributes[attribute_map[key]].nil?
350
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
351
+ end
352
+ end
353
+ new(transformed_hash)
354
+ end
355
+
356
+ # Returns the object in the form of hash
357
+ # @return [Hash] Returns the object in the form of hash
358
+ def to_hash
359
+ hash = {}
360
+ self.class.attribute_map.each_pair do |attr, param|
361
+ value = self.send(attr)
362
+ if value.nil?
363
+ is_nullable = self.class.openapi_nullable.include?(attr)
364
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
365
+ end
366
+
367
+ hash[param] = _to_hash(value)
368
+ end
369
+ hash
370
+ end
371
+
372
+ end
373
+
374
+ end
@@ -0,0 +1,190 @@
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 AdTestEventChoice < ApiModelBase
18
+ attr_accessor :event_name
19
+
20
+ attr_accessor :recorded_count
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'event_name' => :'event_name',
26
+ :'recorded_count' => :'recorded_count'
27
+ }
28
+ end
29
+
30
+ # Returns attribute mapping this model knows about
31
+ def self.acceptable_attribute_map
32
+ attribute_map
33
+ end
34
+
35
+ # Returns all the JSON keys this model knows about
36
+ def self.acceptable_attributes
37
+ acceptable_attribute_map.values
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.openapi_types
42
+ {
43
+ :'event_name' => :'String',
44
+ :'recorded_count' => :'Integer'
45
+ }
46
+ end
47
+
48
+ # List of attributes with nullable: true
49
+ def self.openapi_nullable
50
+ Set.new([
51
+ ])
52
+ end
53
+
54
+ # Initializes the object
55
+ # @param [Hash] attributes Model attributes in the form of hash
56
+ def initialize(attributes = {})
57
+ if (!attributes.is_a?(Hash))
58
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PlainRouter::OpenAPI::AdTestEventChoice` initialize method"
59
+ end
60
+
61
+ # check to see if the attribute exists and convert string to symbol for hash key
62
+ acceptable_attribute_map = self.class.acceptable_attribute_map
63
+ attributes = attributes.each_with_object({}) { |(k, v), h|
64
+ if (!acceptable_attribute_map.key?(k.to_sym))
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PlainRouter::OpenAPI::AdTestEventChoice`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
66
+ end
67
+ h[k.to_sym] = v
68
+ }
69
+
70
+ if attributes.key?(:'event_name')
71
+ self.event_name = attributes[:'event_name']
72
+ else
73
+ self.event_name = nil
74
+ end
75
+
76
+ if attributes.key?(:'recorded_count')
77
+ self.recorded_count = attributes[:'recorded_count']
78
+ else
79
+ self.recorded_count = nil
80
+ end
81
+ end
82
+
83
+ # Show invalid properties with the reasons. Usually used together with valid?
84
+ # @return Array for valid properties with the reasons
85
+ def list_invalid_properties
86
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
87
+ invalid_properties = Array.new
88
+ if @event_name.nil?
89
+ invalid_properties.push('invalid value for "event_name", event_name cannot be nil.')
90
+ end
91
+
92
+ if @recorded_count.nil?
93
+ invalid_properties.push('invalid value for "recorded_count", recorded_count cannot be nil.')
94
+ end
95
+
96
+ invalid_properties
97
+ end
98
+
99
+ # Check to see if the all the properties in the model are valid
100
+ # @return true if the model is valid
101
+ def valid?
102
+ warn '[DEPRECATED] the `valid?` method is obsolete'
103
+ return false if @event_name.nil?
104
+ return false if @recorded_count.nil?
105
+ true
106
+ end
107
+
108
+ # Custom attribute writer method with validation
109
+ # @param [Object] event_name Value to be assigned
110
+ def event_name=(event_name)
111
+ if event_name.nil?
112
+ fail ArgumentError, 'event_name cannot be nil'
113
+ end
114
+
115
+ @event_name = event_name
116
+ end
117
+
118
+ # Custom attribute writer method with validation
119
+ # @param [Object] recorded_count Value to be assigned
120
+ def recorded_count=(recorded_count)
121
+ if recorded_count.nil?
122
+ fail ArgumentError, 'recorded_count cannot be nil'
123
+ end
124
+
125
+ @recorded_count = recorded_count
126
+ end
127
+
128
+ # Checks equality by comparing each attribute.
129
+ # @param [Object] Object to be compared
130
+ def ==(o)
131
+ return true if self.equal?(o)
132
+ self.class == o.class &&
133
+ event_name == o.event_name &&
134
+ recorded_count == o.recorded_count
135
+ end
136
+
137
+ # @see the `==` method
138
+ # @param [Object] Object to be compared
139
+ def eql?(o)
140
+ self == o
141
+ end
142
+
143
+ # Calculates hash code according to all attributes.
144
+ # @return [Integer] Hash code
145
+ def hash
146
+ [event_name, recorded_count].hash
147
+ end
148
+
149
+ # Builds the object from hash
150
+ # @param [Hash] attributes Model attributes in the form of hash
151
+ # @return [Object] Returns the model itself
152
+ def self.build_from_hash(attributes)
153
+ return nil unless attributes.is_a?(Hash)
154
+ attributes = attributes.transform_keys(&:to_sym)
155
+ transformed_hash = {}
156
+ openapi_types.each_pair do |key, type|
157
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
158
+ transformed_hash["#{key}"] = nil
159
+ elsif type =~ /\AArray<(.*)>/i
160
+ # check to ensure the input is an array given that the attribute
161
+ # is documented as an array but the input is not
162
+ if attributes[attribute_map[key]].is_a?(Array)
163
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
164
+ end
165
+ elsif !attributes[attribute_map[key]].nil?
166
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
167
+ end
168
+ end
169
+ new(transformed_hash)
170
+ end
171
+
172
+ # Returns the object in the form of hash
173
+ # @return [Hash] Returns the object in the form of hash
174
+ def to_hash
175
+ hash = {}
176
+ self.class.attribute_map.each_pair do |attr, param|
177
+ value = self.send(attr)
178
+ if value.nil?
179
+ is_nullable = self.class.openapi_nullable.include?(attr)
180
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
181
+ end
182
+
183
+ hash[param] = _to_hash(value)
184
+ end
185
+ hash
186
+ end
187
+
188
+ end
189
+
190
+ end