late-sdk 0.0.950 → 0.0.952

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 (47) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +12 -0
  3. data/docs/AdCampaignsApi.md +155 -1
  4. data/docs/AdKeyword.md +3 -1
  5. data/docs/AdKeywordQuality.md +24 -0
  6. data/docs/AdScheduleWindow.md +32 -0
  7. data/docs/BoostPostRequest.md +2 -0
  8. data/docs/BoostPostRequestPromotedObject.md +20 -0
  9. data/docs/GetCampaignAdSchedule200Response.md +28 -0
  10. data/docs/GetCampaignAdSchedule200ResponsePerformance.md +22 -0
  11. data/docs/GetCampaignAdSchedule200ResponsePerformanceByDayOfWeekInner.md +26 -0
  12. data/docs/GetCampaignAdSchedule200ResponsePerformanceByHourInner.md +26 -0
  13. data/docs/UpdateCampaignAdSchedule200Response.md +22 -0
  14. data/docs/UpdateCampaignAdScheduleRequest.md +18 -0
  15. data/docs/UpdateCampaignAdScheduleRequestScheduleInner.md +28 -0
  16. data/lib/zernio-sdk/api/ad_campaigns_api.rb +166 -2
  17. data/lib/zernio-sdk/models/ad_keyword.rb +11 -2
  18. data/lib/zernio-sdk/models/ad_keyword_quality.rb +241 -0
  19. data/lib/zernio-sdk/models/ad_schedule_window.rb +329 -0
  20. data/lib/zernio-sdk/models/boost_post_request.rb +10 -1
  21. data/lib/zernio-sdk/models/boost_post_request_promoted_object.rb +159 -0
  22. data/lib/zernio-sdk/models/get_campaign_ad_schedule200_response.rb +197 -0
  23. data/lib/zernio-sdk/models/get_campaign_ad_schedule200_response_performance.rb +174 -0
  24. data/lib/zernio-sdk/models/get_campaign_ad_schedule200_response_performance_by_day_of_week_inner.rb +218 -0
  25. data/lib/zernio-sdk/models/get_campaign_ad_schedule200_response_performance_by_hour_inner.rb +212 -0
  26. data/lib/zernio-sdk/models/update_campaign_ad_schedule200_response.rb +167 -0
  27. data/lib/zernio-sdk/models/update_campaign_ad_schedule_request.rb +176 -0
  28. data/lib/zernio-sdk/models/update_campaign_ad_schedule_request_schedule_inner.rb +362 -0
  29. data/lib/zernio-sdk/version.rb +1 -1
  30. data/lib/zernio-sdk.rb +10 -0
  31. data/openapi.yaml +230 -7
  32. data/spec/api/ad_campaigns_api_spec.rb +31 -1
  33. data/spec/models/ad_keyword_quality_spec.rb +66 -0
  34. data/spec/models/ad_keyword_spec.rb +6 -0
  35. data/spec/models/ad_schedule_window_spec.rb +90 -0
  36. data/spec/models/boost_post_request_promoted_object_spec.rb +42 -0
  37. data/spec/models/boost_post_request_spec.rb +6 -0
  38. data/spec/models/get_campaign_ad_schedule200_response_performance_by_day_of_week_inner_spec.rb +64 -0
  39. data/spec/models/get_campaign_ad_schedule200_response_performance_by_hour_inner_spec.rb +60 -0
  40. data/spec/models/get_campaign_ad_schedule200_response_performance_spec.rb +48 -0
  41. data/spec/models/get_campaign_ad_schedule200_response_spec.rb +66 -0
  42. data/spec/models/update_campaign_ad_schedule200_response_spec.rb +48 -0
  43. data/spec/models/update_campaign_ad_schedule_request_schedule_inner_spec.rb +78 -0
  44. data/spec/models/update_campaign_ad_schedule_request_spec.rb +36 -0
  45. data/zernio-sdk-0.0.952.gem +0 -0
  46. metadata +43 -3
  47. data/zernio-sdk-0.0.950.gem +0 -0
@@ -0,0 +1,329 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).
5
+
6
+ The version of the OpenAPI document: 1.0.4
7
+ Contact: support@zernio.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Zernio
17
+ # One ad schedule window as Google stores it. Half-open: it is exclusive of the end minute, so 09:00-12:00 and 12:00-17:00 are adjacent, not overlapping.
18
+ class AdScheduleWindow < ApiModelBase
19
+ # Google campaign criterion id. Changes whenever the window is rewritten, because Google cannot edit a schedule in place.
20
+ attr_accessor :criterion_id
21
+
22
+ attr_accessor :resource_name
23
+
24
+ attr_accessor :day_of_week
25
+
26
+ attr_accessor :start_hour
27
+
28
+ attr_accessor :start_minute
29
+
30
+ # 24 means midnight at the end of the day.
31
+ attr_accessor :end_hour
32
+
33
+ attr_accessor :end_minute
34
+
35
+ # Bid adjustment for this window, 0.1-10.0. Null when the window runs at the campaign bid.
36
+ attr_accessor :bid_modifier
37
+
38
+ class EnumAttributeValidator
39
+ attr_reader :datatype
40
+ attr_reader :allowable_values
41
+
42
+ def initialize(datatype, allowable_values)
43
+ @allowable_values = allowable_values.map do |value|
44
+ case datatype.to_s
45
+ when /Integer/i
46
+ value.to_i
47
+ when /Float/i
48
+ value.to_f
49
+ else
50
+ value
51
+ end
52
+ end
53
+ end
54
+
55
+ def valid?(value)
56
+ !value || allowable_values.include?(value)
57
+ end
58
+ end
59
+
60
+ # Attribute mapping from ruby-style variable name to JSON key.
61
+ def self.attribute_map
62
+ {
63
+ :'criterion_id' => :'criterionId',
64
+ :'resource_name' => :'resourceName',
65
+ :'day_of_week' => :'dayOfWeek',
66
+ :'start_hour' => :'startHour',
67
+ :'start_minute' => :'startMinute',
68
+ :'end_hour' => :'endHour',
69
+ :'end_minute' => :'endMinute',
70
+ :'bid_modifier' => :'bidModifier'
71
+ }
72
+ end
73
+
74
+ # Returns attribute mapping this model knows about
75
+ def self.acceptable_attribute_map
76
+ attribute_map
77
+ end
78
+
79
+ # Returns all the JSON keys this model knows about
80
+ def self.acceptable_attributes
81
+ acceptable_attribute_map.values
82
+ end
83
+
84
+ # Attribute type mapping.
85
+ def self.openapi_types
86
+ {
87
+ :'criterion_id' => :'String',
88
+ :'resource_name' => :'String',
89
+ :'day_of_week' => :'String',
90
+ :'start_hour' => :'Integer',
91
+ :'start_minute' => :'Integer',
92
+ :'end_hour' => :'Integer',
93
+ :'end_minute' => :'Integer',
94
+ :'bid_modifier' => :'Float'
95
+ }
96
+ end
97
+
98
+ # List of attributes with nullable: true
99
+ def self.openapi_nullable
100
+ Set.new([
101
+ :'bid_modifier'
102
+ ])
103
+ end
104
+
105
+ # Initializes the object
106
+ # @param [Hash] attributes Model attributes in the form of hash
107
+ def initialize(attributes = {})
108
+ if (!attributes.is_a?(Hash))
109
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::AdScheduleWindow` initialize method"
110
+ end
111
+
112
+ # check to see if the attribute exists and convert string to symbol for hash key
113
+ acceptable_attribute_map = self.class.acceptable_attribute_map
114
+ attributes = attributes.each_with_object({}) { |(k, v), h|
115
+ if (!acceptable_attribute_map.key?(k.to_sym))
116
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::AdScheduleWindow`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
117
+ end
118
+ h[k.to_sym] = v
119
+ }
120
+
121
+ if attributes.key?(:'criterion_id')
122
+ self.criterion_id = attributes[:'criterion_id']
123
+ end
124
+
125
+ if attributes.key?(:'resource_name')
126
+ self.resource_name = attributes[:'resource_name']
127
+ end
128
+
129
+ if attributes.key?(:'day_of_week')
130
+ self.day_of_week = attributes[:'day_of_week']
131
+ end
132
+
133
+ if attributes.key?(:'start_hour')
134
+ self.start_hour = attributes[:'start_hour']
135
+ end
136
+
137
+ if attributes.key?(:'start_minute')
138
+ self.start_minute = attributes[:'start_minute']
139
+ end
140
+
141
+ if attributes.key?(:'end_hour')
142
+ self.end_hour = attributes[:'end_hour']
143
+ end
144
+
145
+ if attributes.key?(:'end_minute')
146
+ self.end_minute = attributes[:'end_minute']
147
+ end
148
+
149
+ if attributes.key?(:'bid_modifier')
150
+ self.bid_modifier = attributes[:'bid_modifier']
151
+ end
152
+ end
153
+
154
+ # Show invalid properties with the reasons. Usually used together with valid?
155
+ # @return Array for valid properties with the reasons
156
+ def list_invalid_properties
157
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
158
+ invalid_properties = Array.new
159
+ if !@start_hour.nil? && @start_hour > 23
160
+ invalid_properties.push('invalid value for "start_hour", must be smaller than or equal to 23.')
161
+ end
162
+
163
+ if !@start_hour.nil? && @start_hour < 0
164
+ invalid_properties.push('invalid value for "start_hour", must be greater than or equal to 0.')
165
+ end
166
+
167
+ if !@end_hour.nil? && @end_hour > 24
168
+ invalid_properties.push('invalid value for "end_hour", must be smaller than or equal to 24.')
169
+ end
170
+
171
+ if !@end_hour.nil? && @end_hour < 0
172
+ invalid_properties.push('invalid value for "end_hour", must be greater than or equal to 0.')
173
+ end
174
+
175
+ invalid_properties
176
+ end
177
+
178
+ # Check to see if the all the properties in the model are valid
179
+ # @return true if the model is valid
180
+ def valid?
181
+ warn '[DEPRECATED] the `valid?` method is obsolete'
182
+ day_of_week_validator = EnumAttributeValidator.new('String', ["MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY", "SATURDAY", "SUNDAY"])
183
+ return false unless day_of_week_validator.valid?(@day_of_week)
184
+ return false if !@start_hour.nil? && @start_hour > 23
185
+ return false if !@start_hour.nil? && @start_hour < 0
186
+ start_minute_validator = EnumAttributeValidator.new('Integer', [0, 15, 30, 45])
187
+ return false unless start_minute_validator.valid?(@start_minute)
188
+ return false if !@end_hour.nil? && @end_hour > 24
189
+ return false if !@end_hour.nil? && @end_hour < 0
190
+ end_minute_validator = EnumAttributeValidator.new('Integer', [0, 15, 30, 45])
191
+ return false unless end_minute_validator.valid?(@end_minute)
192
+ true
193
+ end
194
+
195
+ # Custom attribute writer method checking allowed values (enum).
196
+ # @param [Object] day_of_week Object to be assigned
197
+ def day_of_week=(day_of_week)
198
+ validator = EnumAttributeValidator.new('String', ["MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY", "SATURDAY", "SUNDAY"])
199
+ unless validator.valid?(day_of_week)
200
+ fail ArgumentError, "invalid value for \"day_of_week\", must be one of #{validator.allowable_values}."
201
+ end
202
+ @day_of_week = day_of_week
203
+ end
204
+
205
+ # Custom attribute writer method with validation
206
+ # @param [Object] start_hour Value to be assigned
207
+ def start_hour=(start_hour)
208
+ if start_hour.nil?
209
+ fail ArgumentError, 'start_hour cannot be nil'
210
+ end
211
+
212
+ if start_hour > 23
213
+ fail ArgumentError, 'invalid value for "start_hour", must be smaller than or equal to 23.'
214
+ end
215
+
216
+ if start_hour < 0
217
+ fail ArgumentError, 'invalid value for "start_hour", must be greater than or equal to 0.'
218
+ end
219
+
220
+ @start_hour = start_hour
221
+ end
222
+
223
+ # Custom attribute writer method checking allowed values (enum).
224
+ # @param [Object] start_minute Object to be assigned
225
+ def start_minute=(start_minute)
226
+ validator = EnumAttributeValidator.new('Integer', [0, 15, 30, 45])
227
+ unless validator.valid?(start_minute)
228
+ fail ArgumentError, "invalid value for \"start_minute\", must be one of #{validator.allowable_values}."
229
+ end
230
+ @start_minute = start_minute
231
+ end
232
+
233
+ # Custom attribute writer method with validation
234
+ # @param [Object] end_hour Value to be assigned
235
+ def end_hour=(end_hour)
236
+ if end_hour.nil?
237
+ fail ArgumentError, 'end_hour cannot be nil'
238
+ end
239
+
240
+ if end_hour > 24
241
+ fail ArgumentError, 'invalid value for "end_hour", must be smaller than or equal to 24.'
242
+ end
243
+
244
+ if end_hour < 0
245
+ fail ArgumentError, 'invalid value for "end_hour", must be greater than or equal to 0.'
246
+ end
247
+
248
+ @end_hour = end_hour
249
+ end
250
+
251
+ # Custom attribute writer method checking allowed values (enum).
252
+ # @param [Object] end_minute Object to be assigned
253
+ def end_minute=(end_minute)
254
+ validator = EnumAttributeValidator.new('Integer', [0, 15, 30, 45])
255
+ unless validator.valid?(end_minute)
256
+ fail ArgumentError, "invalid value for \"end_minute\", must be one of #{validator.allowable_values}."
257
+ end
258
+ @end_minute = end_minute
259
+ end
260
+
261
+ # Checks equality by comparing each attribute.
262
+ # @param [Object] Object to be compared
263
+ def ==(o)
264
+ return true if self.equal?(o)
265
+ self.class == o.class &&
266
+ criterion_id == o.criterion_id &&
267
+ resource_name == o.resource_name &&
268
+ day_of_week == o.day_of_week &&
269
+ start_hour == o.start_hour &&
270
+ start_minute == o.start_minute &&
271
+ end_hour == o.end_hour &&
272
+ end_minute == o.end_minute &&
273
+ bid_modifier == o.bid_modifier
274
+ end
275
+
276
+ # @see the `==` method
277
+ # @param [Object] Object to be compared
278
+ def eql?(o)
279
+ self == o
280
+ end
281
+
282
+ # Calculates hash code according to all attributes.
283
+ # @return [Integer] Hash code
284
+ def hash
285
+ [criterion_id, resource_name, day_of_week, start_hour, start_minute, end_hour, end_minute, bid_modifier].hash
286
+ end
287
+
288
+ # Builds the object from hash
289
+ # @param [Hash] attributes Model attributes in the form of hash
290
+ # @return [Object] Returns the model itself
291
+ def self.build_from_hash(attributes)
292
+ return nil unless attributes.is_a?(Hash)
293
+ attributes = attributes.transform_keys(&:to_sym)
294
+ transformed_hash = {}
295
+ openapi_types.each_pair do |key, type|
296
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
297
+ transformed_hash["#{key}"] = nil
298
+ elsif type =~ /\AArray<(.*)>/i
299
+ # check to ensure the input is an array given that the attribute
300
+ # is documented as an array but the input is not
301
+ if attributes[attribute_map[key]].is_a?(Array)
302
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
303
+ end
304
+ elsif !attributes[attribute_map[key]].nil?
305
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
306
+ end
307
+ end
308
+ new(transformed_hash)
309
+ end
310
+
311
+ # Returns the object in the form of hash
312
+ # @return [Hash] Returns the object in the form of hash
313
+ def to_hash
314
+ hash = {}
315
+ self.class.attribute_map.each_pair do |attr, param|
316
+ value = self.send(attr)
317
+ if value.nil?
318
+ is_nullable = self.class.openapi_nullable.include?(attr)
319
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
320
+ end
321
+
322
+ hash[param] = _to_hash(value)
323
+ end
324
+ hash
325
+ end
326
+
327
+ end
328
+
329
+ end
@@ -93,6 +93,8 @@ module Zernio
93
93
  # TikTok-only. Spark Code (creator's `auth_code`) authorizing cross-creator Spark Ads: the advertiser can boost a video owned by a DIFFERENT TikTok account. Without this, boosts are limited to videos owned by the same account running the ads (same-BC creators only). The creator generates the code in their TikTok app's Promote settings and shares it with the advertiser. Maps to `auth_code` on the creative entry of /v2/ad/create/.
94
94
  attr_accessor :spark_auth_code
95
95
 
96
+ attr_accessor :promoted_object
97
+
96
98
  # Legal entity that benefits from the ad. Required when targeting EU users (EU DSA, Article 26). Optional if the ad account has a default beneficiary: set it once via `PATCH /v1/ads/accounts` or in Meta Ads Manager, and Meta fills it in whenever the field is omitted.
97
99
  attr_accessor :dsa_beneficiary
98
100
 
@@ -161,6 +163,7 @@ module Zernio
161
163
  :'link_url' => :'linkUrl',
162
164
  :'call_to_action' => :'callToAction',
163
165
  :'spark_auth_code' => :'sparkAuthCode',
166
+ :'promoted_object' => :'promotedObject',
164
167
  :'dsa_beneficiary' => :'dsaBeneficiary',
165
168
  :'dsa_payor' => :'dsaPayor',
166
169
  :'lead_gen_form_id' => :'leadGenFormId',
@@ -210,6 +213,7 @@ module Zernio
210
213
  :'link_url' => :'String',
211
214
  :'call_to_action' => :'String',
212
215
  :'spark_auth_code' => :'String',
216
+ :'promoted_object' => :'BoostPostRequestPromotedObject',
213
217
  :'dsa_beneficiary' => :'String',
214
218
  :'dsa_payor' => :'String',
215
219
  :'lead_gen_form_id' => :'String',
@@ -372,6 +376,10 @@ module Zernio
372
376
  self.spark_auth_code = attributes[:'spark_auth_code']
373
377
  end
374
378
 
379
+ if attributes.key?(:'promoted_object')
380
+ self.promoted_object = attributes[:'promoted_object']
381
+ end
382
+
375
383
  if attributes.key?(:'dsa_beneficiary')
376
384
  self.dsa_beneficiary = attributes[:'dsa_beneficiary']
377
385
  end
@@ -623,6 +631,7 @@ module Zernio
623
631
  link_url == o.link_url &&
624
632
  call_to_action == o.call_to_action &&
625
633
  spark_auth_code == o.spark_auth_code &&
634
+ promoted_object == o.promoted_object &&
626
635
  dsa_beneficiary == o.dsa_beneficiary &&
627
636
  dsa_payor == o.dsa_payor &&
628
637
  lead_gen_form_id == o.lead_gen_form_id &&
@@ -639,7 +648,7 @@ module Zernio
639
648
  # Calculates hash code according to all attributes.
640
649
  # @return [Integer] Hash code
641
650
  def hash
642
- [creative_features, post_id, platform_post_id, account_id, ad_account_id, name, goal, ad_set_id, budget, instagram_account_id, destination_type, whatsapp_phone_number, currency, schedule, targeting, raw_targeting, bid_strategy, bid_amount, roas_average_floor, platform_specific_data, tracking, special_ad_categories, special_ad_category_country, regional_regulated_categories, regional_regulation_identities, link_url, call_to_action, spark_auth_code, dsa_beneficiary, dsa_payor, lead_gen_form_id, status, optimization_goal].hash
651
+ [creative_features, post_id, platform_post_id, account_id, ad_account_id, name, goal, ad_set_id, budget, instagram_account_id, destination_type, whatsapp_phone_number, currency, schedule, targeting, raw_targeting, bid_strategy, bid_amount, roas_average_floor, platform_specific_data, tracking, special_ad_categories, special_ad_category_country, regional_regulated_categories, regional_regulation_identities, link_url, call_to_action, spark_auth_code, promoted_object, dsa_beneficiary, dsa_payor, lead_gen_form_id, status, optimization_goal].hash
643
652
  end
644
653
 
645
654
  # Builds the object from hash
@@ -0,0 +1,159 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).
5
+
6
+ The version of the OpenAPI document: 1.0.4
7
+ Contact: support@zernio.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Zernio
17
+ # TikTok-only on this endpoint. The pixel a Website Conversion ad group optimizes toward, so a Spark Ad built from an existing organic post can optimize for a conversion instead of only engagement or traffic. Required when `goal` is `conversions`; ignored on every other goal, because only a WEB_CONVERSIONS ad group accepts these fields. Combine freely with `platformPostId` + `sparkAuthCode`: the pixel lives on the ad group and the Spark item on the creative, so they never conflict.
18
+ class BoostPostRequestPromotedObject < ApiModelBase
19
+ # TikTok Pixel. Either the numeric pixel id or the alphanumeric pixel code from Events Manager, which is resolved for you.
20
+ attr_accessor :pixel_id
21
+
22
+ # Optimization event, as a TikTok optimization_event code (e.g. ON_WEB_ORDER, SHOPPING, FORM) or the exact event name shown in Events Manager, which is resolved to its code. Omit to let TikTok optimize for the ad group default.
23
+ attr_accessor :custom_event_type
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'pixel_id' => :'pixelId',
29
+ :'custom_event_type' => :'customEventType'
30
+ }
31
+ end
32
+
33
+ # Returns attribute mapping this model knows about
34
+ def self.acceptable_attribute_map
35
+ attribute_map
36
+ end
37
+
38
+ # Returns all the JSON keys this model knows about
39
+ def self.acceptable_attributes
40
+ acceptable_attribute_map.values
41
+ end
42
+
43
+ # Attribute type mapping.
44
+ def self.openapi_types
45
+ {
46
+ :'pixel_id' => :'String',
47
+ :'custom_event_type' => :'String'
48
+ }
49
+ end
50
+
51
+ # List of attributes with nullable: true
52
+ def self.openapi_nullable
53
+ Set.new([
54
+ ])
55
+ end
56
+
57
+ # Initializes the object
58
+ # @param [Hash] attributes Model attributes in the form of hash
59
+ def initialize(attributes = {})
60
+ if (!attributes.is_a?(Hash))
61
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::BoostPostRequestPromotedObject` initialize method"
62
+ end
63
+
64
+ # check to see if the attribute exists and convert string to symbol for hash key
65
+ acceptable_attribute_map = self.class.acceptable_attribute_map
66
+ attributes = attributes.each_with_object({}) { |(k, v), h|
67
+ if (!acceptable_attribute_map.key?(k.to_sym))
68
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::BoostPostRequestPromotedObject`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
69
+ end
70
+ h[k.to_sym] = v
71
+ }
72
+
73
+ if attributes.key?(:'pixel_id')
74
+ self.pixel_id = attributes[:'pixel_id']
75
+ end
76
+
77
+ if attributes.key?(:'custom_event_type')
78
+ self.custom_event_type = attributes[:'custom_event_type']
79
+ end
80
+ end
81
+
82
+ # Show invalid properties with the reasons. Usually used together with valid?
83
+ # @return Array for valid properties with the reasons
84
+ def list_invalid_properties
85
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
86
+ invalid_properties = Array.new
87
+ invalid_properties
88
+ end
89
+
90
+ # Check to see if the all the properties in the model are valid
91
+ # @return true if the model is valid
92
+ def valid?
93
+ warn '[DEPRECATED] the `valid?` method is obsolete'
94
+ true
95
+ end
96
+
97
+ # Checks equality by comparing each attribute.
98
+ # @param [Object] Object to be compared
99
+ def ==(o)
100
+ return true if self.equal?(o)
101
+ self.class == o.class &&
102
+ pixel_id == o.pixel_id &&
103
+ custom_event_type == o.custom_event_type
104
+ end
105
+
106
+ # @see the `==` method
107
+ # @param [Object] Object to be compared
108
+ def eql?(o)
109
+ self == o
110
+ end
111
+
112
+ # Calculates hash code according to all attributes.
113
+ # @return [Integer] Hash code
114
+ def hash
115
+ [pixel_id, custom_event_type].hash
116
+ end
117
+
118
+ # Builds the object from hash
119
+ # @param [Hash] attributes Model attributes in the form of hash
120
+ # @return [Object] Returns the model itself
121
+ def self.build_from_hash(attributes)
122
+ return nil unless attributes.is_a?(Hash)
123
+ attributes = attributes.transform_keys(&:to_sym)
124
+ transformed_hash = {}
125
+ openapi_types.each_pair do |key, type|
126
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
127
+ transformed_hash["#{key}"] = nil
128
+ elsif type =~ /\AArray<(.*)>/i
129
+ # check to ensure the input is an array given that the attribute
130
+ # is documented as an array but the input is not
131
+ if attributes[attribute_map[key]].is_a?(Array)
132
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
133
+ end
134
+ elsif !attributes[attribute_map[key]].nil?
135
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
136
+ end
137
+ end
138
+ new(transformed_hash)
139
+ end
140
+
141
+ # Returns the object in the form of hash
142
+ # @return [Hash] Returns the object in the form of hash
143
+ def to_hash
144
+ hash = {}
145
+ self.class.attribute_map.each_pair do |attr, param|
146
+ value = self.send(attr)
147
+ if value.nil?
148
+ is_nullable = self.class.openapi_nullable.include?(attr)
149
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
150
+ end
151
+
152
+ hash[param] = _to_hash(value)
153
+ end
154
+ hash
155
+ end
156
+
157
+ end
158
+
159
+ end