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,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 GetInventoryMetrics200ResponseEffectiveRange < ApiModelBase
18
+ attr_accessor :from
19
+
20
+ attr_accessor :to
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'from' => :'from',
26
+ :'to' => :'to'
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
+ :'from' => :'String',
44
+ :'to' => :'String'
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::GetInventoryMetrics200ResponseEffectiveRange` 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::GetInventoryMetrics200ResponseEffectiveRange`. 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?(:'from')
71
+ self.from = attributes[:'from']
72
+ else
73
+ self.from = nil
74
+ end
75
+
76
+ if attributes.key?(:'to')
77
+ self.to = attributes[:'to']
78
+ else
79
+ self.to = 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 @from.nil?
89
+ invalid_properties.push('invalid value for "from", from cannot be nil.')
90
+ end
91
+
92
+ if @to.nil?
93
+ invalid_properties.push('invalid value for "to", to 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 @from.nil?
104
+ return false if @to.nil?
105
+ true
106
+ end
107
+
108
+ # Custom attribute writer method with validation
109
+ # @param [Object] from Value to be assigned
110
+ def from=(from)
111
+ if from.nil?
112
+ fail ArgumentError, 'from cannot be nil'
113
+ end
114
+
115
+ @from = from
116
+ end
117
+
118
+ # Custom attribute writer method with validation
119
+ # @param [Object] to Value to be assigned
120
+ def to=(to)
121
+ if to.nil?
122
+ fail ArgumentError, 'to cannot be nil'
123
+ end
124
+
125
+ @to = to
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
+ from == o.from &&
134
+ to == o.to
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
+ [from, to].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
@@ -0,0 +1,492 @@
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 GetInventoryMetrics200ResponseMetricsInner < ApiModelBase
18
+ attr_accessor :id
19
+
20
+ attr_accessor :platform_ad_account_id
21
+
22
+ attr_accessor :ad_external_id
23
+
24
+ attr_accessor :campaign_external_id
25
+
26
+ attr_accessor :adset_external_id
27
+
28
+ attr_accessor :date
29
+
30
+ attr_accessor :account_currency
31
+
32
+ attr_accessor :spend
33
+
34
+ attr_accessor :impressions
35
+
36
+ attr_accessor :clicks
37
+
38
+ attr_accessor :inline_link_clicks
39
+
40
+ attr_accessor :actions
41
+
42
+ attr_accessor :action_values
43
+
44
+ attr_accessor :fetched_at
45
+
46
+ attr_accessor :arrivals
47
+
48
+ attr_accessor :creative_id
49
+
50
+ attr_accessor :generator
51
+
52
+ attr_accessor :generator_job
53
+
54
+ attr_accessor :parent_creative
55
+
56
+ # Attribute mapping from ruby-style variable name to JSON key.
57
+ def self.attribute_map
58
+ {
59
+ :'id' => :'id',
60
+ :'platform_ad_account_id' => :'platform_ad_account_id',
61
+ :'ad_external_id' => :'ad_external_id',
62
+ :'campaign_external_id' => :'campaign_external_id',
63
+ :'adset_external_id' => :'adset_external_id',
64
+ :'date' => :'date',
65
+ :'account_currency' => :'account_currency',
66
+ :'spend' => :'spend',
67
+ :'impressions' => :'impressions',
68
+ :'clicks' => :'clicks',
69
+ :'inline_link_clicks' => :'inline_link_clicks',
70
+ :'actions' => :'actions',
71
+ :'action_values' => :'action_values',
72
+ :'fetched_at' => :'fetched_at',
73
+ :'arrivals' => :'arrivals',
74
+ :'creative_id' => :'creative_id',
75
+ :'generator' => :'generator',
76
+ :'generator_job' => :'generator_job',
77
+ :'parent_creative' => :'parent_creative'
78
+ }
79
+ end
80
+
81
+ # Returns attribute mapping this model knows about
82
+ def self.acceptable_attribute_map
83
+ attribute_map
84
+ end
85
+
86
+ # Returns all the JSON keys this model knows about
87
+ def self.acceptable_attributes
88
+ acceptable_attribute_map.values
89
+ end
90
+
91
+ # Attribute type mapping.
92
+ def self.openapi_types
93
+ {
94
+ :'id' => :'Integer',
95
+ :'platform_ad_account_id' => :'Integer',
96
+ :'ad_external_id' => :'String',
97
+ :'campaign_external_id' => :'String',
98
+ :'adset_external_id' => :'String',
99
+ :'date' => :'String',
100
+ :'account_currency' => :'String',
101
+ :'spend' => :'String',
102
+ :'impressions' => :'Integer',
103
+ :'clicks' => :'Integer',
104
+ :'inline_link_clicks' => :'Integer',
105
+ :'actions' => :'GetEvent200ResponseEventConsent',
106
+ :'action_values' => :'GetEvent200ResponseEventConsent',
107
+ :'fetched_at' => :'String',
108
+ :'arrivals' => :'Integer',
109
+ :'creative_id' => :'String',
110
+ :'generator' => :'String',
111
+ :'generator_job' => :'String',
112
+ :'parent_creative' => :'String'
113
+ }
114
+ end
115
+
116
+ # List of attributes with nullable: true
117
+ def self.openapi_nullable
118
+ Set.new([
119
+ :'campaign_external_id',
120
+ :'adset_external_id',
121
+ :'actions',
122
+ :'action_values',
123
+ :'fetched_at',
124
+ :'arrivals',
125
+ :'creative_id',
126
+ :'generator',
127
+ :'generator_job',
128
+ :'parent_creative'
129
+ ])
130
+ end
131
+
132
+ # Initializes the object
133
+ # @param [Hash] attributes Model attributes in the form of hash
134
+ def initialize(attributes = {})
135
+ if (!attributes.is_a?(Hash))
136
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PlainRouter::OpenAPI::GetInventoryMetrics200ResponseMetricsInner` initialize method"
137
+ end
138
+
139
+ # check to see if the attribute exists and convert string to symbol for hash key
140
+ acceptable_attribute_map = self.class.acceptable_attribute_map
141
+ attributes = attributes.each_with_object({}) { |(k, v), h|
142
+ if (!acceptable_attribute_map.key?(k.to_sym))
143
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PlainRouter::OpenAPI::GetInventoryMetrics200ResponseMetricsInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
144
+ end
145
+ h[k.to_sym] = v
146
+ }
147
+
148
+ if attributes.key?(:'id')
149
+ self.id = attributes[:'id']
150
+ else
151
+ self.id = nil
152
+ end
153
+
154
+ if attributes.key?(:'platform_ad_account_id')
155
+ self.platform_ad_account_id = attributes[:'platform_ad_account_id']
156
+ else
157
+ self.platform_ad_account_id = nil
158
+ end
159
+
160
+ if attributes.key?(:'ad_external_id')
161
+ self.ad_external_id = attributes[:'ad_external_id']
162
+ else
163
+ self.ad_external_id = nil
164
+ end
165
+
166
+ if attributes.key?(:'campaign_external_id')
167
+ self.campaign_external_id = attributes[:'campaign_external_id']
168
+ else
169
+ self.campaign_external_id = nil
170
+ end
171
+
172
+ if attributes.key?(:'adset_external_id')
173
+ self.adset_external_id = attributes[:'adset_external_id']
174
+ else
175
+ self.adset_external_id = nil
176
+ end
177
+
178
+ if attributes.key?(:'date')
179
+ self.date = attributes[:'date']
180
+ else
181
+ self.date = nil
182
+ end
183
+
184
+ if attributes.key?(:'account_currency')
185
+ self.account_currency = attributes[:'account_currency']
186
+ else
187
+ self.account_currency = nil
188
+ end
189
+
190
+ if attributes.key?(:'spend')
191
+ self.spend = attributes[:'spend']
192
+ else
193
+ self.spend = nil
194
+ end
195
+
196
+ if attributes.key?(:'impressions')
197
+ self.impressions = attributes[:'impressions']
198
+ else
199
+ self.impressions = nil
200
+ end
201
+
202
+ if attributes.key?(:'clicks')
203
+ self.clicks = attributes[:'clicks']
204
+ else
205
+ self.clicks = nil
206
+ end
207
+
208
+ if attributes.key?(:'inline_link_clicks')
209
+ self.inline_link_clicks = attributes[:'inline_link_clicks']
210
+ else
211
+ self.inline_link_clicks = nil
212
+ end
213
+
214
+ if attributes.key?(:'actions')
215
+ self.actions = attributes[:'actions']
216
+ else
217
+ self.actions = nil
218
+ end
219
+
220
+ if attributes.key?(:'action_values')
221
+ self.action_values = attributes[:'action_values']
222
+ else
223
+ self.action_values = nil
224
+ end
225
+
226
+ if attributes.key?(:'fetched_at')
227
+ self.fetched_at = attributes[:'fetched_at']
228
+ else
229
+ self.fetched_at = nil
230
+ end
231
+
232
+ if attributes.key?(:'arrivals')
233
+ self.arrivals = attributes[:'arrivals']
234
+ else
235
+ self.arrivals = nil
236
+ end
237
+
238
+ if attributes.key?(:'creative_id')
239
+ self.creative_id = attributes[:'creative_id']
240
+ else
241
+ self.creative_id = nil
242
+ end
243
+
244
+ if attributes.key?(:'generator')
245
+ self.generator = attributes[:'generator']
246
+ else
247
+ self.generator = nil
248
+ end
249
+
250
+ if attributes.key?(:'generator_job')
251
+ self.generator_job = attributes[:'generator_job']
252
+ else
253
+ self.generator_job = nil
254
+ end
255
+
256
+ if attributes.key?(:'parent_creative')
257
+ self.parent_creative = attributes[:'parent_creative']
258
+ else
259
+ self.parent_creative = nil
260
+ end
261
+ end
262
+
263
+ # Show invalid properties with the reasons. Usually used together with valid?
264
+ # @return Array for valid properties with the reasons
265
+ def list_invalid_properties
266
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
267
+ invalid_properties = Array.new
268
+ if @id.nil?
269
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
270
+ end
271
+
272
+ if @platform_ad_account_id.nil?
273
+ invalid_properties.push('invalid value for "platform_ad_account_id", platform_ad_account_id cannot be nil.')
274
+ end
275
+
276
+ if @ad_external_id.nil?
277
+ invalid_properties.push('invalid value for "ad_external_id", ad_external_id cannot be nil.')
278
+ end
279
+
280
+ if @date.nil?
281
+ invalid_properties.push('invalid value for "date", date cannot be nil.')
282
+ end
283
+
284
+ if @account_currency.nil?
285
+ invalid_properties.push('invalid value for "account_currency", account_currency cannot be nil.')
286
+ end
287
+
288
+ if @spend.nil?
289
+ invalid_properties.push('invalid value for "spend", spend cannot be nil.')
290
+ end
291
+
292
+ if @impressions.nil?
293
+ invalid_properties.push('invalid value for "impressions", impressions cannot be nil.')
294
+ end
295
+
296
+ if @clicks.nil?
297
+ invalid_properties.push('invalid value for "clicks", clicks cannot be nil.')
298
+ end
299
+
300
+ if @inline_link_clicks.nil?
301
+ invalid_properties.push('invalid value for "inline_link_clicks", inline_link_clicks cannot be nil.')
302
+ end
303
+
304
+ invalid_properties
305
+ end
306
+
307
+ # Check to see if the all the properties in the model are valid
308
+ # @return true if the model is valid
309
+ def valid?
310
+ warn '[DEPRECATED] the `valid?` method is obsolete'
311
+ return false if @id.nil?
312
+ return false if @platform_ad_account_id.nil?
313
+ return false if @ad_external_id.nil?
314
+ return false if @date.nil?
315
+ return false if @account_currency.nil?
316
+ return false if @spend.nil?
317
+ return false if @impressions.nil?
318
+ return false if @clicks.nil?
319
+ return false if @inline_link_clicks.nil?
320
+ true
321
+ end
322
+
323
+ # Custom attribute writer method with validation
324
+ # @param [Object] id Value to be assigned
325
+ def id=(id)
326
+ if id.nil?
327
+ fail ArgumentError, 'id cannot be nil'
328
+ end
329
+
330
+ @id = id
331
+ end
332
+
333
+ # Custom attribute writer method with validation
334
+ # @param [Object] platform_ad_account_id Value to be assigned
335
+ def platform_ad_account_id=(platform_ad_account_id)
336
+ if platform_ad_account_id.nil?
337
+ fail ArgumentError, 'platform_ad_account_id cannot be nil'
338
+ end
339
+
340
+ @platform_ad_account_id = platform_ad_account_id
341
+ end
342
+
343
+ # Custom attribute writer method with validation
344
+ # @param [Object] ad_external_id Value to be assigned
345
+ def ad_external_id=(ad_external_id)
346
+ if ad_external_id.nil?
347
+ fail ArgumentError, 'ad_external_id cannot be nil'
348
+ end
349
+
350
+ @ad_external_id = ad_external_id
351
+ end
352
+
353
+ # Custom attribute writer method with validation
354
+ # @param [Object] date Value to be assigned
355
+ def date=(date)
356
+ if date.nil?
357
+ fail ArgumentError, 'date cannot be nil'
358
+ end
359
+
360
+ @date = date
361
+ end
362
+
363
+ # Custom attribute writer method with validation
364
+ # @param [Object] account_currency Value to be assigned
365
+ def account_currency=(account_currency)
366
+ if account_currency.nil?
367
+ fail ArgumentError, 'account_currency cannot be nil'
368
+ end
369
+
370
+ @account_currency = account_currency
371
+ end
372
+
373
+ # Custom attribute writer method with validation
374
+ # @param [Object] spend Value to be assigned
375
+ def spend=(spend)
376
+ if spend.nil?
377
+ fail ArgumentError, 'spend cannot be nil'
378
+ end
379
+
380
+ @spend = spend
381
+ end
382
+
383
+ # Custom attribute writer method with validation
384
+ # @param [Object] impressions Value to be assigned
385
+ def impressions=(impressions)
386
+ if impressions.nil?
387
+ fail ArgumentError, 'impressions cannot be nil'
388
+ end
389
+
390
+ @impressions = impressions
391
+ end
392
+
393
+ # Custom attribute writer method with validation
394
+ # @param [Object] clicks Value to be assigned
395
+ def clicks=(clicks)
396
+ if clicks.nil?
397
+ fail ArgumentError, 'clicks cannot be nil'
398
+ end
399
+
400
+ @clicks = clicks
401
+ end
402
+
403
+ # Custom attribute writer method with validation
404
+ # @param [Object] inline_link_clicks Value to be assigned
405
+ def inline_link_clicks=(inline_link_clicks)
406
+ if inline_link_clicks.nil?
407
+ fail ArgumentError, 'inline_link_clicks cannot be nil'
408
+ end
409
+
410
+ @inline_link_clicks = inline_link_clicks
411
+ end
412
+
413
+ # Checks equality by comparing each attribute.
414
+ # @param [Object] Object to be compared
415
+ def ==(o)
416
+ return true if self.equal?(o)
417
+ self.class == o.class &&
418
+ id == o.id &&
419
+ platform_ad_account_id == o.platform_ad_account_id &&
420
+ ad_external_id == o.ad_external_id &&
421
+ campaign_external_id == o.campaign_external_id &&
422
+ adset_external_id == o.adset_external_id &&
423
+ date == o.date &&
424
+ account_currency == o.account_currency &&
425
+ spend == o.spend &&
426
+ impressions == o.impressions &&
427
+ clicks == o.clicks &&
428
+ inline_link_clicks == o.inline_link_clicks &&
429
+ actions == o.actions &&
430
+ action_values == o.action_values &&
431
+ fetched_at == o.fetched_at &&
432
+ arrivals == o.arrivals &&
433
+ creative_id == o.creative_id &&
434
+ generator == o.generator &&
435
+ generator_job == o.generator_job &&
436
+ parent_creative == o.parent_creative
437
+ end
438
+
439
+ # @see the `==` method
440
+ # @param [Object] Object to be compared
441
+ def eql?(o)
442
+ self == o
443
+ end
444
+
445
+ # Calculates hash code according to all attributes.
446
+ # @return [Integer] Hash code
447
+ def hash
448
+ [id, platform_ad_account_id, ad_external_id, campaign_external_id, adset_external_id, date, account_currency, spend, impressions, clicks, inline_link_clicks, actions, action_values, fetched_at, arrivals, creative_id, generator, generator_job, parent_creative].hash
449
+ end
450
+
451
+ # Builds the object from hash
452
+ # @param [Hash] attributes Model attributes in the form of hash
453
+ # @return [Object] Returns the model itself
454
+ def self.build_from_hash(attributes)
455
+ return nil unless attributes.is_a?(Hash)
456
+ attributes = attributes.transform_keys(&:to_sym)
457
+ transformed_hash = {}
458
+ openapi_types.each_pair do |key, type|
459
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
460
+ transformed_hash["#{key}"] = nil
461
+ elsif type =~ /\AArray<(.*)>/i
462
+ # check to ensure the input is an array given that the attribute
463
+ # is documented as an array but the input is not
464
+ if attributes[attribute_map[key]].is_a?(Array)
465
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
466
+ end
467
+ elsif !attributes[attribute_map[key]].nil?
468
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
469
+ end
470
+ end
471
+ new(transformed_hash)
472
+ end
473
+
474
+ # Returns the object in the form of hash
475
+ # @return [Hash] Returns the object in the form of hash
476
+ def to_hash
477
+ hash = {}
478
+ self.class.attribute_map.each_pair do |attr, param|
479
+ value = self.send(attr)
480
+ if value.nil?
481
+ is_nullable = self.class.openapi_nullable.include?(attr)
482
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
483
+ end
484
+
485
+ hash[param] = _to_hash(value)
486
+ end
487
+ hash
488
+ end
489
+
490
+ end
491
+
492
+ end