late-sdk 0.0.97 → 0.0.99

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 (128) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +53 -0
  3. data/docs/Ad.md +58 -0
  4. data/docs/AdAudiencesApi.md +365 -0
  5. data/docs/AdBudget.md +20 -0
  6. data/docs/AdCampaign.md +40 -0
  7. data/docs/AdCampaignsApi.md +165 -0
  8. data/docs/AdMetrics.md +34 -0
  9. data/docs/AdSchedule.md +20 -0
  10. data/docs/AddUsersToAdAudience200Response.md +22 -0
  11. data/docs/AddUsersToAdAudienceRequest.md +18 -0
  12. data/docs/AddUsersToAdAudienceRequestUsersInner.md +20 -0
  13. data/docs/AdsApi.md +726 -0
  14. data/docs/BoostPostRequest.md +36 -0
  15. data/docs/BoostPostRequestBudget.md +20 -0
  16. data/docs/BoostPostRequestSchedule.md +20 -0
  17. data/docs/BoostPostRequestTargeting.md +24 -0
  18. data/docs/CreateAdAudience201Response.md +20 -0
  19. data/docs/CreateAdAudienceRequest.md +36 -0
  20. data/docs/CreateStandaloneAdRequest.md +56 -0
  21. data/docs/GetAd200Response.md +18 -0
  22. data/docs/GetAdAnalytics200Response.md +20 -0
  23. data/docs/GetAdAnalytics200ResponseAd.md +24 -0
  24. data/docs/GetAdAnalytics200ResponseAnalytics.md +22 -0
  25. data/docs/GetAdAnalytics200ResponseAnalyticsDailyInner.md +36 -0
  26. data/docs/GetAdAudience200Response.md +20 -0
  27. data/docs/ListAdAccounts200Response.md +18 -0
  28. data/docs/ListAdAccounts200ResponseAccountsInner.md +24 -0
  29. data/docs/ListAdAudiences200Response.md +18 -0
  30. data/docs/ListAdAudiences200ResponseAudiencesInner.md +32 -0
  31. data/docs/ListAdCampaigns200Response.md +20 -0
  32. data/docs/ListAds200Response.md +20 -0
  33. data/docs/SearchAdInterests200Response.md +18 -0
  34. data/docs/SearchAdInterests200ResponseInterestsInner.md +22 -0
  35. data/docs/SyncExternalAds200Response.md +24 -0
  36. data/docs/UpdateAd200Response.md +20 -0
  37. data/docs/UpdateAdCampaignStatus200Response.md +22 -0
  38. data/docs/UpdateAdCampaignStatusRequest.md +20 -0
  39. data/docs/UpdateAdRequest.md +24 -0
  40. data/docs/UpdateAdRequestBudget.md +20 -0
  41. data/docs/UpdateAdRequestTargeting.md +24 -0
  42. data/docs/UpdatePostMetadataRequest.md +7 -1
  43. data/lib/late-sdk/api/ad_audiences_api.rb +368 -0
  44. data/lib/late-sdk/api/ad_campaigns_api.rb +201 -0
  45. data/lib/late-sdk/api/ads_api.rb +719 -0
  46. data/lib/late-sdk/models/ad.rb +399 -0
  47. data/lib/late-sdk/models/ad_budget.rb +190 -0
  48. data/lib/late-sdk/models/ad_campaign.rb +293 -0
  49. data/lib/late-sdk/models/ad_metrics.rb +222 -0
  50. data/lib/late-sdk/models/ad_schedule.rb +156 -0
  51. data/lib/late-sdk/models/add_users_to_ad_audience200_response.rb +165 -0
  52. data/lib/late-sdk/models/add_users_to_ad_audience_request.rb +175 -0
  53. data/lib/late-sdk/models/add_users_to_ad_audience_request_users_inner.rb +157 -0
  54. data/lib/late-sdk/models/boost_post_request.rb +350 -0
  55. data/lib/late-sdk/models/boost_post_request_budget.rb +215 -0
  56. data/lib/late-sdk/models/boost_post_request_schedule.rb +157 -0
  57. data/lib/late-sdk/models/boost_post_request_targeting.rb +234 -0
  58. data/lib/late-sdk/models/create_ad_audience201_response.rb +156 -0
  59. data/lib/late-sdk/models/create_ad_audience_request.rb +391 -0
  60. data/lib/late-sdk/models/create_standalone_ad_request.rb +585 -0
  61. data/lib/late-sdk/models/get_ad200_response.rb +147 -0
  62. data/lib/late-sdk/models/get_ad_analytics200_response.rb +156 -0
  63. data/lib/late-sdk/models/get_ad_analytics200_response_ad.rb +174 -0
  64. data/lib/late-sdk/models/get_ad_analytics200_response_analytics.rb +169 -0
  65. data/lib/late-sdk/models/get_ad_analytics200_response_analytics_daily_inner.rb +238 -0
  66. data/lib/late-sdk/models/get_ad_audience200_response.rb +157 -0
  67. data/lib/late-sdk/models/list_ad_accounts200_response.rb +149 -0
  68. data/lib/late-sdk/models/list_ad_accounts200_response_accounts_inner.rb +175 -0
  69. data/lib/late-sdk/models/list_ad_audiences200_response.rb +149 -0
  70. data/lib/late-sdk/models/list_ad_audiences200_response_audiences_inner.rb +244 -0
  71. data/lib/late-sdk/models/list_ad_campaigns200_response.rb +158 -0
  72. data/lib/late-sdk/models/list_ads200_response.rb +158 -0
  73. data/lib/late-sdk/models/search_ad_interests200_response.rb +149 -0
  74. data/lib/late-sdk/models/search_ad_interests200_response_interests_inner.rb +165 -0
  75. data/lib/late-sdk/models/sync_external_ads200_response.rb +177 -0
  76. data/lib/late-sdk/models/update_ad200_response.rb +156 -0
  77. data/lib/late-sdk/models/update_ad_campaign_status200_response.rb +169 -0
  78. data/lib/late-sdk/models/update_ad_campaign_status_request.rb +216 -0
  79. data/lib/late-sdk/models/update_ad_request.rb +208 -0
  80. data/lib/late-sdk/models/update_ad_request_budget.rb +191 -0
  81. data/lib/late-sdk/models/update_ad_request_targeting.rb +235 -0
  82. data/lib/late-sdk/models/update_post_metadata_request.rb +34 -4
  83. data/lib/late-sdk/version.rb +1 -1
  84. data/lib/late-sdk.rb +39 -0
  85. data/openapi.yaml +693 -0
  86. data/spec/api/ad_audiences_api_spec.rb +98 -0
  87. data/spec/api/ad_campaigns_api_spec.rb +67 -0
  88. data/spec/api/ads_api_spec.rb +163 -0
  89. data/spec/models/ad_budget_spec.rb +46 -0
  90. data/spec/models/ad_campaign_spec.rb +110 -0
  91. data/spec/models/ad_metrics_spec.rb +84 -0
  92. data/spec/models/ad_schedule_spec.rb +42 -0
  93. data/spec/models/ad_spec.rb +172 -0
  94. data/spec/models/add_users_to_ad_audience200_response_spec.rb +48 -0
  95. data/spec/models/add_users_to_ad_audience_request_spec.rb +36 -0
  96. data/spec/models/add_users_to_ad_audience_request_users_inner_spec.rb +42 -0
  97. data/spec/models/boost_post_request_budget_spec.rb +46 -0
  98. data/spec/models/boost_post_request_schedule_spec.rb +42 -0
  99. data/spec/models/boost_post_request_spec.rb +94 -0
  100. data/spec/models/boost_post_request_targeting_spec.rb +54 -0
  101. data/spec/models/create_ad_audience201_response_spec.rb +42 -0
  102. data/spec/models/create_ad_audience_request_spec.rb +94 -0
  103. data/spec/models/create_standalone_ad_request_spec.rb +166 -0
  104. data/spec/models/get_ad200_response_spec.rb +36 -0
  105. data/spec/models/get_ad_analytics200_response_ad_spec.rb +54 -0
  106. data/spec/models/get_ad_analytics200_response_analytics_daily_inner_spec.rb +90 -0
  107. data/spec/models/get_ad_analytics200_response_analytics_spec.rb +48 -0
  108. data/spec/models/get_ad_analytics200_response_spec.rb +42 -0
  109. data/spec/models/get_ad_audience200_response_spec.rb +42 -0
  110. data/spec/models/list_ad_accounts200_response_accounts_inner_spec.rb +54 -0
  111. data/spec/models/list_ad_accounts200_response_spec.rb +36 -0
  112. data/spec/models/list_ad_audiences200_response_audiences_inner_spec.rb +82 -0
  113. data/spec/models/list_ad_audiences200_response_spec.rb +36 -0
  114. data/spec/models/list_ad_campaigns200_response_spec.rb +42 -0
  115. data/spec/models/list_ads200_response_spec.rb +42 -0
  116. data/spec/models/search_ad_interests200_response_interests_inner_spec.rb +48 -0
  117. data/spec/models/search_ad_interests200_response_spec.rb +36 -0
  118. data/spec/models/sync_external_ads200_response_spec.rb +54 -0
  119. data/spec/models/update_ad200_response_spec.rb +42 -0
  120. data/spec/models/update_ad_campaign_status200_response_spec.rb +48 -0
  121. data/spec/models/update_ad_campaign_status_request_spec.rb +50 -0
  122. data/spec/models/update_ad_request_budget_spec.rb +46 -0
  123. data/spec/models/update_ad_request_spec.rb +58 -0
  124. data/spec/models/update_ad_request_targeting_spec.rb +54 -0
  125. data/spec/models/update_post_metadata_request_spec.rb +18 -0
  126. data/zernio-sdk-0.0.99.gem +0 -0
  127. metadata +159 -3
  128. data/zernio-sdk-0.0.97.gem +0 -0
@@ -0,0 +1,585 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
5
+
6
+ The version of the OpenAPI document: 1.0.1
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 Late
17
+ class CreateStandaloneAdRequest < ApiModelBase
18
+ attr_accessor :account_id
19
+
20
+ attr_accessor :ad_account_id
21
+
22
+ attr_accessor :name
23
+
24
+ attr_accessor :goal
25
+
26
+ attr_accessor :budget_amount
27
+
28
+ attr_accessor :budget_type
29
+
30
+ attr_accessor :currency
31
+
32
+ # Required for most platforms. Max: Meta=255, Google=30, Pinterest=100
33
+ attr_accessor :headline
34
+
35
+ # Max: Google=90, Pinterest=500
36
+ attr_accessor :body
37
+
38
+ # Meta only
39
+ attr_accessor :call_to_action
40
+
41
+ attr_accessor :link_url
42
+
43
+ # Image URL (or video URL for TikTok)
44
+ attr_accessor :image_url
45
+
46
+ attr_accessor :countries
47
+
48
+ attr_accessor :age_min
49
+
50
+ attr_accessor :age_max
51
+
52
+ attr_accessor :interests
53
+
54
+ # Required for lifetime budgets
55
+ attr_accessor :end_date
56
+
57
+ # Custom audience ID for targeting
58
+ attr_accessor :audience_id
59
+
60
+ # Google only
61
+ attr_accessor :campaign_type
62
+
63
+ # Google Search only
64
+ attr_accessor :keywords
65
+
66
+ class EnumAttributeValidator
67
+ attr_reader :datatype
68
+ attr_reader :allowable_values
69
+
70
+ def initialize(datatype, allowable_values)
71
+ @allowable_values = allowable_values.map do |value|
72
+ case datatype.to_s
73
+ when /Integer/i
74
+ value.to_i
75
+ when /Float/i
76
+ value.to_f
77
+ else
78
+ value
79
+ end
80
+ end
81
+ end
82
+
83
+ def valid?(value)
84
+ !value || allowable_values.include?(value)
85
+ end
86
+ end
87
+
88
+ # Attribute mapping from ruby-style variable name to JSON key.
89
+ def self.attribute_map
90
+ {
91
+ :'account_id' => :'accountId',
92
+ :'ad_account_id' => :'adAccountId',
93
+ :'name' => :'name',
94
+ :'goal' => :'goal',
95
+ :'budget_amount' => :'budgetAmount',
96
+ :'budget_type' => :'budgetType',
97
+ :'currency' => :'currency',
98
+ :'headline' => :'headline',
99
+ :'body' => :'body',
100
+ :'call_to_action' => :'callToAction',
101
+ :'link_url' => :'linkUrl',
102
+ :'image_url' => :'imageUrl',
103
+ :'countries' => :'countries',
104
+ :'age_min' => :'ageMin',
105
+ :'age_max' => :'ageMax',
106
+ :'interests' => :'interests',
107
+ :'end_date' => :'endDate',
108
+ :'audience_id' => :'audienceId',
109
+ :'campaign_type' => :'campaignType',
110
+ :'keywords' => :'keywords'
111
+ }
112
+ end
113
+
114
+ # Returns attribute mapping this model knows about
115
+ def self.acceptable_attribute_map
116
+ attribute_map
117
+ end
118
+
119
+ # Returns all the JSON keys this model knows about
120
+ def self.acceptable_attributes
121
+ acceptable_attribute_map.values
122
+ end
123
+
124
+ # Attribute type mapping.
125
+ def self.openapi_types
126
+ {
127
+ :'account_id' => :'String',
128
+ :'ad_account_id' => :'String',
129
+ :'name' => :'String',
130
+ :'goal' => :'String',
131
+ :'budget_amount' => :'Float',
132
+ :'budget_type' => :'String',
133
+ :'currency' => :'String',
134
+ :'headline' => :'String',
135
+ :'body' => :'String',
136
+ :'call_to_action' => :'String',
137
+ :'link_url' => :'String',
138
+ :'image_url' => :'String',
139
+ :'countries' => :'Array<String>',
140
+ :'age_min' => :'Integer',
141
+ :'age_max' => :'Integer',
142
+ :'interests' => :'Array<String>',
143
+ :'end_date' => :'Time',
144
+ :'audience_id' => :'String',
145
+ :'campaign_type' => :'String',
146
+ :'keywords' => :'Array<String>'
147
+ }
148
+ end
149
+
150
+ # List of attributes with nullable: true
151
+ def self.openapi_nullable
152
+ Set.new([
153
+ ])
154
+ end
155
+
156
+ # Initializes the object
157
+ # @param [Hash] attributes Model attributes in the form of hash
158
+ def initialize(attributes = {})
159
+ if (!attributes.is_a?(Hash))
160
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Late::CreateStandaloneAdRequest` initialize method"
161
+ end
162
+
163
+ # check to see if the attribute exists and convert string to symbol for hash key
164
+ acceptable_attribute_map = self.class.acceptable_attribute_map
165
+ attributes = attributes.each_with_object({}) { |(k, v), h|
166
+ if (!acceptable_attribute_map.key?(k.to_sym))
167
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Late::CreateStandaloneAdRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
168
+ end
169
+ h[k.to_sym] = v
170
+ }
171
+
172
+ if attributes.key?(:'account_id')
173
+ self.account_id = attributes[:'account_id']
174
+ else
175
+ self.account_id = nil
176
+ end
177
+
178
+ if attributes.key?(:'ad_account_id')
179
+ self.ad_account_id = attributes[:'ad_account_id']
180
+ else
181
+ self.ad_account_id = nil
182
+ end
183
+
184
+ if attributes.key?(:'name')
185
+ self.name = attributes[:'name']
186
+ else
187
+ self.name = nil
188
+ end
189
+
190
+ if attributes.key?(:'goal')
191
+ self.goal = attributes[:'goal']
192
+ else
193
+ self.goal = nil
194
+ end
195
+
196
+ if attributes.key?(:'budget_amount')
197
+ self.budget_amount = attributes[:'budget_amount']
198
+ else
199
+ self.budget_amount = nil
200
+ end
201
+
202
+ if attributes.key?(:'budget_type')
203
+ self.budget_type = attributes[:'budget_type']
204
+ else
205
+ self.budget_type = nil
206
+ end
207
+
208
+ if attributes.key?(:'currency')
209
+ self.currency = attributes[:'currency']
210
+ end
211
+
212
+ if attributes.key?(:'headline')
213
+ self.headline = attributes[:'headline']
214
+ end
215
+
216
+ if attributes.key?(:'body')
217
+ self.body = attributes[:'body']
218
+ else
219
+ self.body = nil
220
+ end
221
+
222
+ if attributes.key?(:'call_to_action')
223
+ self.call_to_action = attributes[:'call_to_action']
224
+ end
225
+
226
+ if attributes.key?(:'link_url')
227
+ self.link_url = attributes[:'link_url']
228
+ end
229
+
230
+ if attributes.key?(:'image_url')
231
+ self.image_url = attributes[:'image_url']
232
+ else
233
+ self.image_url = nil
234
+ end
235
+
236
+ if attributes.key?(:'countries')
237
+ if (value = attributes[:'countries']).is_a?(Array)
238
+ self.countries = value
239
+ end
240
+ end
241
+
242
+ if attributes.key?(:'age_min')
243
+ self.age_min = attributes[:'age_min']
244
+ end
245
+
246
+ if attributes.key?(:'age_max')
247
+ self.age_max = attributes[:'age_max']
248
+ end
249
+
250
+ if attributes.key?(:'interests')
251
+ if (value = attributes[:'interests']).is_a?(Array)
252
+ self.interests = value
253
+ end
254
+ end
255
+
256
+ if attributes.key?(:'end_date')
257
+ self.end_date = attributes[:'end_date']
258
+ end
259
+
260
+ if attributes.key?(:'audience_id')
261
+ self.audience_id = attributes[:'audience_id']
262
+ end
263
+
264
+ if attributes.key?(:'campaign_type')
265
+ self.campaign_type = attributes[:'campaign_type']
266
+ else
267
+ self.campaign_type = 'display'
268
+ end
269
+
270
+ if attributes.key?(:'keywords')
271
+ if (value = attributes[:'keywords']).is_a?(Array)
272
+ self.keywords = value
273
+ end
274
+ end
275
+ end
276
+
277
+ # Show invalid properties with the reasons. Usually used together with valid?
278
+ # @return Array for valid properties with the reasons
279
+ def list_invalid_properties
280
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
281
+ invalid_properties = Array.new
282
+ if @account_id.nil?
283
+ invalid_properties.push('invalid value for "account_id", account_id cannot be nil.')
284
+ end
285
+
286
+ if @ad_account_id.nil?
287
+ invalid_properties.push('invalid value for "ad_account_id", ad_account_id cannot be nil.')
288
+ end
289
+
290
+ if @name.nil?
291
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
292
+ end
293
+
294
+ if @name.to_s.length > 255
295
+ invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 255.')
296
+ end
297
+
298
+ if @goal.nil?
299
+ invalid_properties.push('invalid value for "goal", goal cannot be nil.')
300
+ end
301
+
302
+ if @budget_amount.nil?
303
+ invalid_properties.push('invalid value for "budget_amount", budget_amount cannot be nil.')
304
+ end
305
+
306
+ if @budget_type.nil?
307
+ invalid_properties.push('invalid value for "budget_type", budget_type cannot be nil.')
308
+ end
309
+
310
+ if @body.nil?
311
+ invalid_properties.push('invalid value for "body", body cannot be nil.')
312
+ end
313
+
314
+ if @image_url.nil?
315
+ invalid_properties.push('invalid value for "image_url", image_url cannot be nil.')
316
+ end
317
+
318
+ if !@age_min.nil? && @age_min > 65
319
+ invalid_properties.push('invalid value for "age_min", must be smaller than or equal to 65.')
320
+ end
321
+
322
+ if !@age_min.nil? && @age_min < 13
323
+ invalid_properties.push('invalid value for "age_min", must be greater than or equal to 13.')
324
+ end
325
+
326
+ if !@age_max.nil? && @age_max > 65
327
+ invalid_properties.push('invalid value for "age_max", must be smaller than or equal to 65.')
328
+ end
329
+
330
+ if !@age_max.nil? && @age_max < 13
331
+ invalid_properties.push('invalid value for "age_max", must be greater than or equal to 13.')
332
+ end
333
+
334
+ invalid_properties
335
+ end
336
+
337
+ # Check to see if the all the properties in the model are valid
338
+ # @return true if the model is valid
339
+ def valid?
340
+ warn '[DEPRECATED] the `valid?` method is obsolete'
341
+ return false if @account_id.nil?
342
+ return false if @ad_account_id.nil?
343
+ return false if @name.nil?
344
+ return false if @name.to_s.length > 255
345
+ return false if @goal.nil?
346
+ goal_validator = EnumAttributeValidator.new('String', ["engagement", "traffic", "awareness", "video_views"])
347
+ return false unless goal_validator.valid?(@goal)
348
+ return false if @budget_amount.nil?
349
+ return false if @budget_type.nil?
350
+ budget_type_validator = EnumAttributeValidator.new('String', ["daily", "lifetime"])
351
+ return false unless budget_type_validator.valid?(@budget_type)
352
+ return false if @body.nil?
353
+ call_to_action_validator = EnumAttributeValidator.new('String', ["LEARN_MORE", "SHOP_NOW", "SIGN_UP", "BOOK_TRAVEL", "CONTACT_US", "DOWNLOAD", "GET_OFFER", "GET_QUOTE", "SUBSCRIBE", "WATCH_MORE"])
354
+ return false unless call_to_action_validator.valid?(@call_to_action)
355
+ return false if @image_url.nil?
356
+ return false if !@age_min.nil? && @age_min > 65
357
+ return false if !@age_min.nil? && @age_min < 13
358
+ return false if !@age_max.nil? && @age_max > 65
359
+ return false if !@age_max.nil? && @age_max < 13
360
+ campaign_type_validator = EnumAttributeValidator.new('String', ["display", "search"])
361
+ return false unless campaign_type_validator.valid?(@campaign_type)
362
+ true
363
+ end
364
+
365
+ # Custom attribute writer method with validation
366
+ # @param [Object] account_id Value to be assigned
367
+ def account_id=(account_id)
368
+ if account_id.nil?
369
+ fail ArgumentError, 'account_id cannot be nil'
370
+ end
371
+
372
+ @account_id = account_id
373
+ end
374
+
375
+ # Custom attribute writer method with validation
376
+ # @param [Object] ad_account_id Value to be assigned
377
+ def ad_account_id=(ad_account_id)
378
+ if ad_account_id.nil?
379
+ fail ArgumentError, 'ad_account_id cannot be nil'
380
+ end
381
+
382
+ @ad_account_id = ad_account_id
383
+ end
384
+
385
+ # Custom attribute writer method with validation
386
+ # @param [Object] name Value to be assigned
387
+ def name=(name)
388
+ if name.nil?
389
+ fail ArgumentError, 'name cannot be nil'
390
+ end
391
+
392
+ if name.to_s.length > 255
393
+ fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 255.'
394
+ end
395
+
396
+ @name = name
397
+ end
398
+
399
+ # Custom attribute writer method checking allowed values (enum).
400
+ # @param [Object] goal Object to be assigned
401
+ def goal=(goal)
402
+ validator = EnumAttributeValidator.new('String', ["engagement", "traffic", "awareness", "video_views"])
403
+ unless validator.valid?(goal)
404
+ fail ArgumentError, "invalid value for \"goal\", must be one of #{validator.allowable_values}."
405
+ end
406
+ @goal = goal
407
+ end
408
+
409
+ # Custom attribute writer method with validation
410
+ # @param [Object] budget_amount Value to be assigned
411
+ def budget_amount=(budget_amount)
412
+ if budget_amount.nil?
413
+ fail ArgumentError, 'budget_amount cannot be nil'
414
+ end
415
+
416
+ @budget_amount = budget_amount
417
+ end
418
+
419
+ # Custom attribute writer method checking allowed values (enum).
420
+ # @param [Object] budget_type Object to be assigned
421
+ def budget_type=(budget_type)
422
+ validator = EnumAttributeValidator.new('String', ["daily", "lifetime"])
423
+ unless validator.valid?(budget_type)
424
+ fail ArgumentError, "invalid value for \"budget_type\", must be one of #{validator.allowable_values}."
425
+ end
426
+ @budget_type = budget_type
427
+ end
428
+
429
+ # Custom attribute writer method with validation
430
+ # @param [Object] body Value to be assigned
431
+ def body=(body)
432
+ if body.nil?
433
+ fail ArgumentError, 'body cannot be nil'
434
+ end
435
+
436
+ @body = body
437
+ end
438
+
439
+ # Custom attribute writer method checking allowed values (enum).
440
+ # @param [Object] call_to_action Object to be assigned
441
+ def call_to_action=(call_to_action)
442
+ validator = EnumAttributeValidator.new('String', ["LEARN_MORE", "SHOP_NOW", "SIGN_UP", "BOOK_TRAVEL", "CONTACT_US", "DOWNLOAD", "GET_OFFER", "GET_QUOTE", "SUBSCRIBE", "WATCH_MORE"])
443
+ unless validator.valid?(call_to_action)
444
+ fail ArgumentError, "invalid value for \"call_to_action\", must be one of #{validator.allowable_values}."
445
+ end
446
+ @call_to_action = call_to_action
447
+ end
448
+
449
+ # Custom attribute writer method with validation
450
+ # @param [Object] image_url Value to be assigned
451
+ def image_url=(image_url)
452
+ if image_url.nil?
453
+ fail ArgumentError, 'image_url cannot be nil'
454
+ end
455
+
456
+ @image_url = image_url
457
+ end
458
+
459
+ # Custom attribute writer method with validation
460
+ # @param [Object] age_min Value to be assigned
461
+ def age_min=(age_min)
462
+ if age_min.nil?
463
+ fail ArgumentError, 'age_min cannot be nil'
464
+ end
465
+
466
+ if age_min > 65
467
+ fail ArgumentError, 'invalid value for "age_min", must be smaller than or equal to 65.'
468
+ end
469
+
470
+ if age_min < 13
471
+ fail ArgumentError, 'invalid value for "age_min", must be greater than or equal to 13.'
472
+ end
473
+
474
+ @age_min = age_min
475
+ end
476
+
477
+ # Custom attribute writer method with validation
478
+ # @param [Object] age_max Value to be assigned
479
+ def age_max=(age_max)
480
+ if age_max.nil?
481
+ fail ArgumentError, 'age_max cannot be nil'
482
+ end
483
+
484
+ if age_max > 65
485
+ fail ArgumentError, 'invalid value for "age_max", must be smaller than or equal to 65.'
486
+ end
487
+
488
+ if age_max < 13
489
+ fail ArgumentError, 'invalid value for "age_max", must be greater than or equal to 13.'
490
+ end
491
+
492
+ @age_max = age_max
493
+ end
494
+
495
+ # Custom attribute writer method checking allowed values (enum).
496
+ # @param [Object] campaign_type Object to be assigned
497
+ def campaign_type=(campaign_type)
498
+ validator = EnumAttributeValidator.new('String', ["display", "search"])
499
+ unless validator.valid?(campaign_type)
500
+ fail ArgumentError, "invalid value for \"campaign_type\", must be one of #{validator.allowable_values}."
501
+ end
502
+ @campaign_type = campaign_type
503
+ end
504
+
505
+ # Checks equality by comparing each attribute.
506
+ # @param [Object] Object to be compared
507
+ def ==(o)
508
+ return true if self.equal?(o)
509
+ self.class == o.class &&
510
+ account_id == o.account_id &&
511
+ ad_account_id == o.ad_account_id &&
512
+ name == o.name &&
513
+ goal == o.goal &&
514
+ budget_amount == o.budget_amount &&
515
+ budget_type == o.budget_type &&
516
+ currency == o.currency &&
517
+ headline == o.headline &&
518
+ body == o.body &&
519
+ call_to_action == o.call_to_action &&
520
+ link_url == o.link_url &&
521
+ image_url == o.image_url &&
522
+ countries == o.countries &&
523
+ age_min == o.age_min &&
524
+ age_max == o.age_max &&
525
+ interests == o.interests &&
526
+ end_date == o.end_date &&
527
+ audience_id == o.audience_id &&
528
+ campaign_type == o.campaign_type &&
529
+ keywords == o.keywords
530
+ end
531
+
532
+ # @see the `==` method
533
+ # @param [Object] Object to be compared
534
+ def eql?(o)
535
+ self == o
536
+ end
537
+
538
+ # Calculates hash code according to all attributes.
539
+ # @return [Integer] Hash code
540
+ def hash
541
+ [account_id, ad_account_id, name, goal, budget_amount, budget_type, currency, headline, body, call_to_action, link_url, image_url, countries, age_min, age_max, interests, end_date, audience_id, campaign_type, keywords].hash
542
+ end
543
+
544
+ # Builds the object from hash
545
+ # @param [Hash] attributes Model attributes in the form of hash
546
+ # @return [Object] Returns the model itself
547
+ def self.build_from_hash(attributes)
548
+ return nil unless attributes.is_a?(Hash)
549
+ attributes = attributes.transform_keys(&:to_sym)
550
+ transformed_hash = {}
551
+ openapi_types.each_pair do |key, type|
552
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
553
+ transformed_hash["#{key}"] = nil
554
+ elsif type =~ /\AArray<(.*)>/i
555
+ # check to ensure the input is an array given that the attribute
556
+ # is documented as an array but the input is not
557
+ if attributes[attribute_map[key]].is_a?(Array)
558
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
559
+ end
560
+ elsif !attributes[attribute_map[key]].nil?
561
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
562
+ end
563
+ end
564
+ new(transformed_hash)
565
+ end
566
+
567
+ # Returns the object in the form of hash
568
+ # @return [Hash] Returns the object in the form of hash
569
+ def to_hash
570
+ hash = {}
571
+ self.class.attribute_map.each_pair do |attr, param|
572
+ value = self.send(attr)
573
+ if value.nil?
574
+ is_nullable = self.class.openapi_nullable.include?(attr)
575
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
576
+ end
577
+
578
+ hash[param] = _to_hash(value)
579
+ end
580
+ hash
581
+ end
582
+
583
+ end
584
+
585
+ end