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,104 @@
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
+ # Optional stop limit in positive whole Meta minor units, using the same unit scale as Launch plan budget_amount_minor.
18
+ module ActionsTestsApiStoreRequestMaximumSpendMinor
19
+ class << self
20
+ # List of class defined in anyOf (OpenAPI v3)
21
+ def openapi_any_of
22
+ [
23
+ :'Integer',
24
+ :'String'
25
+ ]
26
+ end
27
+
28
+ # Builds the object
29
+ # @param [Mixed] Data to be matched against the list of anyOf items
30
+ # @return [Object] Returns the model or the data itself
31
+ def build(data)
32
+ # Go through the list of anyOf items and attempt to identify the appropriate one.
33
+ # Note:
34
+ # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
35
+ # due to the way the deserialization is made in the base_object template (it just casts without verifying).
36
+ # - TODO: scalar values are de facto behaving as if they were nullable.
37
+ # - TODO: logging when debugging is set.
38
+ openapi_any_of.each do |klass|
39
+ begin
40
+ next if klass == :AnyType # "nullable: true"
41
+ return find_and_cast_into_type(klass, data)
42
+ rescue # rescue all errors so we keep iterating even if the current item lookup raises
43
+ end
44
+ end
45
+
46
+ openapi_any_of.include?(:AnyType) ? data : nil
47
+ end
48
+
49
+ private
50
+
51
+ SchemaMismatchError = Class.new(StandardError)
52
+
53
+ # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse.
54
+ def find_and_cast_into_type(klass, data)
55
+ return if data.nil?
56
+
57
+ case klass.to_s
58
+ when 'Boolean'
59
+ return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)
60
+ when 'Float'
61
+ return data if data.instance_of?(Float)
62
+ when 'Integer'
63
+ return data if data.instance_of?(Integer)
64
+ when 'Time'
65
+ return Time.parse(data)
66
+ when 'Date'
67
+ return Date.iso8601(data)
68
+ when 'String'
69
+ return data if data.instance_of?(String)
70
+ when 'Object' # "type: object"
71
+ return data if data.instance_of?(Hash)
72
+ when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
73
+ if data.instance_of?(Array)
74
+ sub_type = Regexp.last_match[:sub_type]
75
+ return data.map { |item| find_and_cast_into_type(sub_type, item) }
76
+ end
77
+ when /\AHash<String, (?<sub_type>.+)>\z/ # "type: object" with "additionalProperties: { ... }"
78
+ if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }
79
+ sub_type = Regexp.last_match[:sub_type]
80
+ return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
81
+ end
82
+ else # model
83
+ const = PlainRouter::OpenAPI.const_get(klass)
84
+ if const
85
+ if const.respond_to?(:openapi_any_of) # nested anyOf model
86
+ model = const.build(data)
87
+ return model if model
88
+ else
89
+ # raise if data contains keys that are not known to the model
90
+ raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty?
91
+ model = const.build_from_hash(data)
92
+ return model if model
93
+ end
94
+ end
95
+ end
96
+
97
+ raise # if no match by now, raise
98
+ rescue
99
+ raise SchemaMismatchError, "#{data} doesn't match the #{klass} type"
100
+ end
101
+ end
102
+ end
103
+
104
+ end
@@ -0,0 +1,552 @@
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 AdTest < ApiModelBase
18
+ attr_accessor :id
19
+
20
+ attr_accessor :workspace_id
21
+
22
+ attr_accessor :platform_ad_account_id
23
+
24
+ attr_accessor :ad_set_id
25
+
26
+ attr_accessor :axis
27
+
28
+ attr_accessor :event_name
29
+
30
+ attr_accessor :arrivals_floor
31
+
32
+ attr_accessor :minimum_conversions
33
+
34
+ attr_accessor :maximum_days
35
+
36
+ attr_accessor :maximum_spend_minor
37
+
38
+ attr_accessor :anomaly_threshold_percent
39
+
40
+ attr_accessor :currency
41
+
42
+ attr_accessor :timezone
43
+
44
+ attr_accessor :first_day
45
+
46
+ attr_accessor :created_at
47
+
48
+ attr_accessor :updated_at
49
+
50
+ attr_accessor :count_health_click_threshold
51
+
52
+ # Attribute mapping from ruby-style variable name to JSON key.
53
+ def self.attribute_map
54
+ {
55
+ :'id' => :'id',
56
+ :'workspace_id' => :'workspace_id',
57
+ :'platform_ad_account_id' => :'platform_ad_account_id',
58
+ :'ad_set_id' => :'ad_set_id',
59
+ :'axis' => :'axis',
60
+ :'event_name' => :'event_name',
61
+ :'arrivals_floor' => :'arrivals_floor',
62
+ :'minimum_conversions' => :'minimum_conversions',
63
+ :'maximum_days' => :'maximum_days',
64
+ :'maximum_spend_minor' => :'maximum_spend_minor',
65
+ :'anomaly_threshold_percent' => :'anomaly_threshold_percent',
66
+ :'currency' => :'currency',
67
+ :'timezone' => :'timezone',
68
+ :'first_day' => :'first_day',
69
+ :'created_at' => :'created_at',
70
+ :'updated_at' => :'updated_at',
71
+ :'count_health_click_threshold' => :'count_health_click_threshold'
72
+ }
73
+ end
74
+
75
+ # Returns attribute mapping this model knows about
76
+ def self.acceptable_attribute_map
77
+ attribute_map
78
+ end
79
+
80
+ # Returns all the JSON keys this model knows about
81
+ def self.acceptable_attributes
82
+ acceptable_attribute_map.values
83
+ end
84
+
85
+ # Attribute type mapping.
86
+ def self.openapi_types
87
+ {
88
+ :'id' => :'String',
89
+ :'workspace_id' => :'Integer',
90
+ :'platform_ad_account_id' => :'Integer',
91
+ :'ad_set_id' => :'String',
92
+ :'axis' => :'String',
93
+ :'event_name' => :'String',
94
+ :'arrivals_floor' => :'Integer',
95
+ :'minimum_conversions' => :'Integer',
96
+ :'maximum_days' => :'Integer',
97
+ :'maximum_spend_minor' => :'String',
98
+ :'anomaly_threshold_percent' => :'String',
99
+ :'currency' => :'String',
100
+ :'timezone' => :'String',
101
+ :'first_day' => :'Time',
102
+ :'created_at' => :'Time',
103
+ :'updated_at' => :'Time',
104
+ :'count_health_click_threshold' => :'Integer'
105
+ }
106
+ end
107
+
108
+ # List of attributes with nullable: true
109
+ def self.openapi_nullable
110
+ Set.new([
111
+ :'maximum_spend_minor',
112
+ :'count_health_click_threshold'
113
+ ])
114
+ end
115
+
116
+ # Initializes the object
117
+ # @param [Hash] attributes Model attributes in the form of hash
118
+ def initialize(attributes = {})
119
+ if (!attributes.is_a?(Hash))
120
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PlainRouter::OpenAPI::AdTest` initialize method"
121
+ end
122
+
123
+ # check to see if the attribute exists and convert string to symbol for hash key
124
+ acceptable_attribute_map = self.class.acceptable_attribute_map
125
+ attributes = attributes.each_with_object({}) { |(k, v), h|
126
+ if (!acceptable_attribute_map.key?(k.to_sym))
127
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PlainRouter::OpenAPI::AdTest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
128
+ end
129
+ h[k.to_sym] = v
130
+ }
131
+
132
+ if attributes.key?(:'id')
133
+ self.id = attributes[:'id']
134
+ else
135
+ self.id = nil
136
+ end
137
+
138
+ if attributes.key?(:'workspace_id')
139
+ self.workspace_id = attributes[:'workspace_id']
140
+ else
141
+ self.workspace_id = nil
142
+ end
143
+
144
+ if attributes.key?(:'platform_ad_account_id')
145
+ self.platform_ad_account_id = attributes[:'platform_ad_account_id']
146
+ else
147
+ self.platform_ad_account_id = nil
148
+ end
149
+
150
+ if attributes.key?(:'ad_set_id')
151
+ self.ad_set_id = attributes[:'ad_set_id']
152
+ else
153
+ self.ad_set_id = nil
154
+ end
155
+
156
+ if attributes.key?(:'axis')
157
+ self.axis = attributes[:'axis']
158
+ else
159
+ self.axis = nil
160
+ end
161
+
162
+ if attributes.key?(:'event_name')
163
+ self.event_name = attributes[:'event_name']
164
+ else
165
+ self.event_name = nil
166
+ end
167
+
168
+ if attributes.key?(:'arrivals_floor')
169
+ self.arrivals_floor = attributes[:'arrivals_floor']
170
+ else
171
+ self.arrivals_floor = nil
172
+ end
173
+
174
+ if attributes.key?(:'minimum_conversions')
175
+ self.minimum_conversions = attributes[:'minimum_conversions']
176
+ else
177
+ self.minimum_conversions = nil
178
+ end
179
+
180
+ if attributes.key?(:'maximum_days')
181
+ self.maximum_days = attributes[:'maximum_days']
182
+ else
183
+ self.maximum_days = nil
184
+ end
185
+
186
+ if attributes.key?(:'maximum_spend_minor')
187
+ self.maximum_spend_minor = attributes[:'maximum_spend_minor']
188
+ else
189
+ self.maximum_spend_minor = nil
190
+ end
191
+
192
+ if attributes.key?(:'anomaly_threshold_percent')
193
+ self.anomaly_threshold_percent = attributes[:'anomaly_threshold_percent']
194
+ else
195
+ self.anomaly_threshold_percent = nil
196
+ end
197
+
198
+ if attributes.key?(:'currency')
199
+ self.currency = attributes[:'currency']
200
+ else
201
+ self.currency = nil
202
+ end
203
+
204
+ if attributes.key?(:'timezone')
205
+ self.timezone = attributes[:'timezone']
206
+ else
207
+ self.timezone = nil
208
+ end
209
+
210
+ if attributes.key?(:'first_day')
211
+ self.first_day = attributes[:'first_day']
212
+ else
213
+ self.first_day = nil
214
+ end
215
+
216
+ if attributes.key?(:'created_at')
217
+ self.created_at = attributes[:'created_at']
218
+ else
219
+ self.created_at = nil
220
+ end
221
+
222
+ if attributes.key?(:'updated_at')
223
+ self.updated_at = attributes[:'updated_at']
224
+ else
225
+ self.updated_at = nil
226
+ end
227
+
228
+ if attributes.key?(:'count_health_click_threshold')
229
+ self.count_health_click_threshold = attributes[:'count_health_click_threshold']
230
+ else
231
+ self.count_health_click_threshold = nil
232
+ end
233
+ end
234
+
235
+ # Show invalid properties with the reasons. Usually used together with valid?
236
+ # @return Array for valid properties with the reasons
237
+ def list_invalid_properties
238
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
239
+ invalid_properties = Array.new
240
+ if @id.nil?
241
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
242
+ end
243
+
244
+ if @workspace_id.nil?
245
+ invalid_properties.push('invalid value for "workspace_id", workspace_id cannot be nil.')
246
+ end
247
+
248
+ if @platform_ad_account_id.nil?
249
+ invalid_properties.push('invalid value for "platform_ad_account_id", platform_ad_account_id cannot be nil.')
250
+ end
251
+
252
+ if @ad_set_id.nil?
253
+ invalid_properties.push('invalid value for "ad_set_id", ad_set_id cannot be nil.')
254
+ end
255
+
256
+ if @axis.nil?
257
+ invalid_properties.push('invalid value for "axis", axis cannot be nil.')
258
+ end
259
+
260
+ if @event_name.nil?
261
+ invalid_properties.push('invalid value for "event_name", event_name cannot be nil.')
262
+ end
263
+
264
+ if @arrivals_floor.nil?
265
+ invalid_properties.push('invalid value for "arrivals_floor", arrivals_floor cannot be nil.')
266
+ end
267
+
268
+ if @minimum_conversions.nil?
269
+ invalid_properties.push('invalid value for "minimum_conversions", minimum_conversions cannot be nil.')
270
+ end
271
+
272
+ if @maximum_days.nil?
273
+ invalid_properties.push('invalid value for "maximum_days", maximum_days cannot be nil.')
274
+ end
275
+
276
+ if @anomaly_threshold_percent.nil?
277
+ invalid_properties.push('invalid value for "anomaly_threshold_percent", anomaly_threshold_percent cannot be nil.')
278
+ end
279
+
280
+ if @currency.nil?
281
+ invalid_properties.push('invalid value for "currency", currency cannot be nil.')
282
+ end
283
+
284
+ if @timezone.nil?
285
+ invalid_properties.push('invalid value for "timezone", timezone cannot be nil.')
286
+ end
287
+
288
+ if @first_day.nil?
289
+ invalid_properties.push('invalid value for "first_day", first_day cannot be nil.')
290
+ end
291
+
292
+ if @created_at.nil?
293
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
294
+ end
295
+
296
+ if @updated_at.nil?
297
+ invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
298
+ end
299
+
300
+ invalid_properties
301
+ end
302
+
303
+ # Check to see if the all the properties in the model are valid
304
+ # @return true if the model is valid
305
+ def valid?
306
+ warn '[DEPRECATED] the `valid?` method is obsolete'
307
+ return false if @id.nil?
308
+ return false if @workspace_id.nil?
309
+ return false if @platform_ad_account_id.nil?
310
+ return false if @ad_set_id.nil?
311
+ return false if @axis.nil?
312
+ return false if @event_name.nil?
313
+ return false if @arrivals_floor.nil?
314
+ return false if @minimum_conversions.nil?
315
+ return false if @maximum_days.nil?
316
+ return false if @anomaly_threshold_percent.nil?
317
+ return false if @currency.nil?
318
+ return false if @timezone.nil?
319
+ return false if @first_day.nil?
320
+ return false if @created_at.nil?
321
+ return false if @updated_at.nil?
322
+ true
323
+ end
324
+
325
+ # Custom attribute writer method with validation
326
+ # @param [Object] id Value to be assigned
327
+ def id=(id)
328
+ if id.nil?
329
+ fail ArgumentError, 'id cannot be nil'
330
+ end
331
+
332
+ @id = id
333
+ end
334
+
335
+ # Custom attribute writer method with validation
336
+ # @param [Object] workspace_id Value to be assigned
337
+ def workspace_id=(workspace_id)
338
+ if workspace_id.nil?
339
+ fail ArgumentError, 'workspace_id cannot be nil'
340
+ end
341
+
342
+ @workspace_id = workspace_id
343
+ end
344
+
345
+ # Custom attribute writer method with validation
346
+ # @param [Object] platform_ad_account_id Value to be assigned
347
+ def platform_ad_account_id=(platform_ad_account_id)
348
+ if platform_ad_account_id.nil?
349
+ fail ArgumentError, 'platform_ad_account_id cannot be nil'
350
+ end
351
+
352
+ @platform_ad_account_id = platform_ad_account_id
353
+ end
354
+
355
+ # Custom attribute writer method with validation
356
+ # @param [Object] ad_set_id Value to be assigned
357
+ def ad_set_id=(ad_set_id)
358
+ if ad_set_id.nil?
359
+ fail ArgumentError, 'ad_set_id cannot be nil'
360
+ end
361
+
362
+ @ad_set_id = ad_set_id
363
+ end
364
+
365
+ # Custom attribute writer method with validation
366
+ # @param [Object] axis Value to be assigned
367
+ def axis=(axis)
368
+ if axis.nil?
369
+ fail ArgumentError, 'axis cannot be nil'
370
+ end
371
+
372
+ @axis = axis
373
+ end
374
+
375
+ # Custom attribute writer method with validation
376
+ # @param [Object] event_name Value to be assigned
377
+ def event_name=(event_name)
378
+ if event_name.nil?
379
+ fail ArgumentError, 'event_name cannot be nil'
380
+ end
381
+
382
+ @event_name = event_name
383
+ end
384
+
385
+ # Custom attribute writer method with validation
386
+ # @param [Object] arrivals_floor Value to be assigned
387
+ def arrivals_floor=(arrivals_floor)
388
+ if arrivals_floor.nil?
389
+ fail ArgumentError, 'arrivals_floor cannot be nil'
390
+ end
391
+
392
+ @arrivals_floor = arrivals_floor
393
+ end
394
+
395
+ # Custom attribute writer method with validation
396
+ # @param [Object] minimum_conversions Value to be assigned
397
+ def minimum_conversions=(minimum_conversions)
398
+ if minimum_conversions.nil?
399
+ fail ArgumentError, 'minimum_conversions cannot be nil'
400
+ end
401
+
402
+ @minimum_conversions = minimum_conversions
403
+ end
404
+
405
+ # Custom attribute writer method with validation
406
+ # @param [Object] maximum_days Value to be assigned
407
+ def maximum_days=(maximum_days)
408
+ if maximum_days.nil?
409
+ fail ArgumentError, 'maximum_days cannot be nil'
410
+ end
411
+
412
+ @maximum_days = maximum_days
413
+ end
414
+
415
+ # Custom attribute writer method with validation
416
+ # @param [Object] anomaly_threshold_percent Value to be assigned
417
+ def anomaly_threshold_percent=(anomaly_threshold_percent)
418
+ if anomaly_threshold_percent.nil?
419
+ fail ArgumentError, 'anomaly_threshold_percent cannot be nil'
420
+ end
421
+
422
+ @anomaly_threshold_percent = anomaly_threshold_percent
423
+ end
424
+
425
+ # Custom attribute writer method with validation
426
+ # @param [Object] currency Value to be assigned
427
+ def currency=(currency)
428
+ if currency.nil?
429
+ fail ArgumentError, 'currency cannot be nil'
430
+ end
431
+
432
+ @currency = currency
433
+ end
434
+
435
+ # Custom attribute writer method with validation
436
+ # @param [Object] timezone Value to be assigned
437
+ def timezone=(timezone)
438
+ if timezone.nil?
439
+ fail ArgumentError, 'timezone cannot be nil'
440
+ end
441
+
442
+ @timezone = timezone
443
+ end
444
+
445
+ # Custom attribute writer method with validation
446
+ # @param [Object] first_day Value to be assigned
447
+ def first_day=(first_day)
448
+ if first_day.nil?
449
+ fail ArgumentError, 'first_day cannot be nil'
450
+ end
451
+
452
+ @first_day = first_day
453
+ end
454
+
455
+ # Custom attribute writer method with validation
456
+ # @param [Object] created_at Value to be assigned
457
+ def created_at=(created_at)
458
+ if created_at.nil?
459
+ fail ArgumentError, 'created_at cannot be nil'
460
+ end
461
+
462
+ @created_at = created_at
463
+ end
464
+
465
+ # Custom attribute writer method with validation
466
+ # @param [Object] updated_at Value to be assigned
467
+ def updated_at=(updated_at)
468
+ if updated_at.nil?
469
+ fail ArgumentError, 'updated_at cannot be nil'
470
+ end
471
+
472
+ @updated_at = updated_at
473
+ end
474
+
475
+ # Checks equality by comparing each attribute.
476
+ # @param [Object] Object to be compared
477
+ def ==(o)
478
+ return true if self.equal?(o)
479
+ self.class == o.class &&
480
+ id == o.id &&
481
+ workspace_id == o.workspace_id &&
482
+ platform_ad_account_id == o.platform_ad_account_id &&
483
+ ad_set_id == o.ad_set_id &&
484
+ axis == o.axis &&
485
+ event_name == o.event_name &&
486
+ arrivals_floor == o.arrivals_floor &&
487
+ minimum_conversions == o.minimum_conversions &&
488
+ maximum_days == o.maximum_days &&
489
+ maximum_spend_minor == o.maximum_spend_minor &&
490
+ anomaly_threshold_percent == o.anomaly_threshold_percent &&
491
+ currency == o.currency &&
492
+ timezone == o.timezone &&
493
+ first_day == o.first_day &&
494
+ created_at == o.created_at &&
495
+ updated_at == o.updated_at &&
496
+ count_health_click_threshold == o.count_health_click_threshold
497
+ end
498
+
499
+ # @see the `==` method
500
+ # @param [Object] Object to be compared
501
+ def eql?(o)
502
+ self == o
503
+ end
504
+
505
+ # Calculates hash code according to all attributes.
506
+ # @return [Integer] Hash code
507
+ def hash
508
+ [id, workspace_id, platform_ad_account_id, ad_set_id, axis, event_name, arrivals_floor, minimum_conversions, maximum_days, maximum_spend_minor, anomaly_threshold_percent, currency, timezone, first_day, created_at, updated_at, count_health_click_threshold].hash
509
+ end
510
+
511
+ # Builds the object from hash
512
+ # @param [Hash] attributes Model attributes in the form of hash
513
+ # @return [Object] Returns the model itself
514
+ def self.build_from_hash(attributes)
515
+ return nil unless attributes.is_a?(Hash)
516
+ attributes = attributes.transform_keys(&:to_sym)
517
+ transformed_hash = {}
518
+ openapi_types.each_pair do |key, type|
519
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
520
+ transformed_hash["#{key}"] = nil
521
+ elsif type =~ /\AArray<(.*)>/i
522
+ # check to ensure the input is an array given that the attribute
523
+ # is documented as an array but the input is not
524
+ if attributes[attribute_map[key]].is_a?(Array)
525
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
526
+ end
527
+ elsif !attributes[attribute_map[key]].nil?
528
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
529
+ end
530
+ end
531
+ new(transformed_hash)
532
+ end
533
+
534
+ # Returns the object in the form of hash
535
+ # @return [Hash] Returns the object in the form of hash
536
+ def to_hash
537
+ hash = {}
538
+ self.class.attribute_map.each_pair do |attr, param|
539
+ value = self.send(attr)
540
+ if value.nil?
541
+ is_nullable = self.class.openapi_nullable.include?(attr)
542
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
543
+ end
544
+
545
+ hash[param] = _to_hash(value)
546
+ end
547
+ hash
548
+ end
549
+
550
+ end
551
+
552
+ end