zernio-sdk 0.0.536 → 0.0.538

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 (66) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +29 -1
  3. data/docs/AdAudiencesApi.md +5 -5
  4. data/docs/AdCampaignsApi.md +142 -0
  5. data/docs/AdsApi.md +715 -33
  6. data/docs/CreateAdCampaign201Response.md +24 -0
  7. data/docs/CreateAdCampaignRequest.md +32 -0
  8. data/docs/CreateAdCreative201Response.md +20 -0
  9. data/docs/CreateAdCreativeRequest.md +38 -0
  10. data/docs/CreateAdCreativeRequestCarouselCardsInner.md +26 -0
  11. data/docs/DeleteAdCreative200Response.md +20 -0
  12. data/docs/DuplicateAd200Response.md +22 -0
  13. data/docs/DuplicateAdRequest.md +28 -0
  14. data/docs/DuplicateAdSet200Response.md +22 -0
  15. data/docs/DuplicateAdSetRequest.md +36 -0
  16. data/docs/GetAdCreative200Response.md +18 -0
  17. data/docs/ListAdCreatives200Response.md +22 -0
  18. data/docs/ListAdImages200Response.md +22 -0
  19. data/docs/ListAdLabels200Response.md +22 -0
  20. data/docs/ListHighDemandPeriods200Response.md +22 -0
  21. data/docs/UpdateAdCreative200Response.md +22 -0
  22. data/docs/UpdateAdCreativeRequest.md +20 -0
  23. data/lib/zernio-sdk/api/ad_audiences_api.rb +4 -4
  24. data/lib/zernio-sdk/api/ad_campaigns_api.rb +142 -0
  25. data/lib/zernio-sdk/api/ads_api.rb +748 -48
  26. data/lib/zernio-sdk/models/create_ad_campaign201_response.rb +210 -0
  27. data/lib/zernio-sdk/models/create_ad_campaign_request.rb +343 -0
  28. data/lib/zernio-sdk/models/create_ad_creative201_response.rb +157 -0
  29. data/lib/zernio-sdk/models/create_ad_creative_request.rb +390 -0
  30. data/lib/zernio-sdk/models/create_ad_creative_request_carousel_cards_inner.rb +255 -0
  31. data/lib/zernio-sdk/models/delete_ad_creative200_response.rb +156 -0
  32. data/lib/zernio-sdk/models/duplicate_ad200_response.rb +200 -0
  33. data/lib/zernio-sdk/models/duplicate_ad_request.rb +243 -0
  34. data/lib/zernio-sdk/models/duplicate_ad_set200_response.rb +201 -0
  35. data/lib/zernio-sdk/models/duplicate_ad_set_request.rb +302 -0
  36. data/lib/zernio-sdk/models/get_ad_creative200_response.rb +148 -0
  37. data/lib/zernio-sdk/models/list_ad_creatives200_response.rb +167 -0
  38. data/lib/zernio-sdk/models/list_ad_images200_response.rb +167 -0
  39. data/lib/zernio-sdk/models/list_ad_labels200_response.rb +167 -0
  40. data/lib/zernio-sdk/models/list_high_demand_periods200_response.rb +168 -0
  41. data/lib/zernio-sdk/models/update_ad_creative200_response.rb +165 -0
  42. data/lib/zernio-sdk/models/update_ad_creative_request.rb +200 -0
  43. data/lib/zernio-sdk/version.rb +1 -1
  44. data/lib/zernio-sdk.rb +17 -0
  45. data/openapi.yaml +445 -7
  46. data/spec/api/ad_audiences_api_spec.rb +2 -2
  47. data/spec/api/ad_campaigns_api_spec.rb +25 -0
  48. data/spec/api/ads_api_spec.rb +128 -0
  49. data/spec/models/create_ad_campaign201_response_spec.rb +58 -0
  50. data/spec/models/create_ad_campaign_request_spec.rb +94 -0
  51. data/spec/models/create_ad_creative201_response_spec.rb +42 -0
  52. data/spec/models/create_ad_creative_request_carousel_cards_inner_spec.rb +60 -0
  53. data/spec/models/create_ad_creative_request_spec.rb +96 -0
  54. data/spec/models/delete_ad_creative200_response_spec.rb +42 -0
  55. data/spec/models/duplicate_ad200_response_spec.rb +52 -0
  56. data/spec/models/duplicate_ad_request_spec.rb +74 -0
  57. data/spec/models/duplicate_ad_set200_response_spec.rb +52 -0
  58. data/spec/models/duplicate_ad_set_request_spec.rb +102 -0
  59. data/spec/models/get_ad_creative200_response_spec.rb +36 -0
  60. data/spec/models/list_ad_creatives200_response_spec.rb +48 -0
  61. data/spec/models/list_ad_images200_response_spec.rb +48 -0
  62. data/spec/models/list_ad_labels200_response_spec.rb +48 -0
  63. data/spec/models/list_high_demand_periods200_response_spec.rb +48 -0
  64. data/spec/models/update_ad_creative200_response_spec.rb +48 -0
  65. data/spec/models/update_ad_creative_request_spec.rb +42 -0
  66. metadata +70 -2
@@ -0,0 +1,390 @@
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.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
+ class CreateAdCreativeRequest < ApiModelBase
18
+ # Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token and Page.
19
+ attr_accessor :account_id
20
+
21
+ # Meta ad account id (act_<n>).
22
+ attr_accessor :ad_account_id
23
+
24
+ attr_accessor :headline
25
+
26
+ # Primary text
27
+ attr_accessor :body
28
+
29
+ # Link description below the headline; omitted = Meta scrapes the destination's OG description.
30
+ attr_accessor :description
31
+
32
+ # CTA type (same whitelist as POST /v1/ads/create).
33
+ attr_accessor :call_to_action
34
+
35
+ attr_accessor :link_url
36
+
37
+ # Publicly reachable image; uploaded to the account's library server-side.
38
+ attr_accessor :image_url
39
+
40
+ # Existing library image hash (POST /v1/ads/images or GET /v1/ads/images).
41
+ attr_accessor :image_hash
42
+
43
+ attr_accessor :carousel_cards
44
+
45
+ # Appended to every outbound URL (e.g. utm_source=fb).
46
+ attr_accessor :url_tags
47
+
48
+ # Attribute mapping from ruby-style variable name to JSON key.
49
+ def self.attribute_map
50
+ {
51
+ :'account_id' => :'accountId',
52
+ :'ad_account_id' => :'adAccountId',
53
+ :'headline' => :'headline',
54
+ :'body' => :'body',
55
+ :'description' => :'description',
56
+ :'call_to_action' => :'callToAction',
57
+ :'link_url' => :'linkUrl',
58
+ :'image_url' => :'imageUrl',
59
+ :'image_hash' => :'imageHash',
60
+ :'carousel_cards' => :'carouselCards',
61
+ :'url_tags' => :'urlTags'
62
+ }
63
+ end
64
+
65
+ # Returns attribute mapping this model knows about
66
+ def self.acceptable_attribute_map
67
+ attribute_map
68
+ end
69
+
70
+ # Returns all the JSON keys this model knows about
71
+ def self.acceptable_attributes
72
+ acceptable_attribute_map.values
73
+ end
74
+
75
+ # Attribute type mapping.
76
+ def self.openapi_types
77
+ {
78
+ :'account_id' => :'String',
79
+ :'ad_account_id' => :'String',
80
+ :'headline' => :'String',
81
+ :'body' => :'String',
82
+ :'description' => :'String',
83
+ :'call_to_action' => :'String',
84
+ :'link_url' => :'String',
85
+ :'image_url' => :'String',
86
+ :'image_hash' => :'String',
87
+ :'carousel_cards' => :'Array<CreateAdCreativeRequestCarouselCardsInner>',
88
+ :'url_tags' => :'String'
89
+ }
90
+ end
91
+
92
+ # List of attributes with nullable: true
93
+ def self.openapi_nullable
94
+ Set.new([
95
+ ])
96
+ end
97
+
98
+ # Initializes the object
99
+ # @param [Hash] attributes Model attributes in the form of hash
100
+ def initialize(attributes = {})
101
+ if (!attributes.is_a?(Hash))
102
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::CreateAdCreativeRequest` initialize method"
103
+ end
104
+
105
+ # check to see if the attribute exists and convert string to symbol for hash key
106
+ acceptable_attribute_map = self.class.acceptable_attribute_map
107
+ attributes = attributes.each_with_object({}) { |(k, v), h|
108
+ if (!acceptable_attribute_map.key?(k.to_sym))
109
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::CreateAdCreativeRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
110
+ end
111
+ h[k.to_sym] = v
112
+ }
113
+
114
+ if attributes.key?(:'account_id')
115
+ self.account_id = attributes[:'account_id']
116
+ else
117
+ self.account_id = nil
118
+ end
119
+
120
+ if attributes.key?(:'ad_account_id')
121
+ self.ad_account_id = attributes[:'ad_account_id']
122
+ else
123
+ self.ad_account_id = nil
124
+ end
125
+
126
+ if attributes.key?(:'headline')
127
+ self.headline = attributes[:'headline']
128
+ else
129
+ self.headline = nil
130
+ end
131
+
132
+ if attributes.key?(:'body')
133
+ self.body = attributes[:'body']
134
+ else
135
+ self.body = nil
136
+ end
137
+
138
+ if attributes.key?(:'description')
139
+ self.description = attributes[:'description']
140
+ end
141
+
142
+ if attributes.key?(:'call_to_action')
143
+ self.call_to_action = attributes[:'call_to_action']
144
+ else
145
+ self.call_to_action = 'LEARN_MORE'
146
+ end
147
+
148
+ if attributes.key?(:'link_url')
149
+ self.link_url = attributes[:'link_url']
150
+ else
151
+ self.link_url = nil
152
+ end
153
+
154
+ if attributes.key?(:'image_url')
155
+ self.image_url = attributes[:'image_url']
156
+ end
157
+
158
+ if attributes.key?(:'image_hash')
159
+ self.image_hash = attributes[:'image_hash']
160
+ end
161
+
162
+ if attributes.key?(:'carousel_cards')
163
+ if (value = attributes[:'carousel_cards']).is_a?(Array)
164
+ self.carousel_cards = value
165
+ end
166
+ end
167
+
168
+ if attributes.key?(:'url_tags')
169
+ self.url_tags = attributes[:'url_tags']
170
+ end
171
+ end
172
+
173
+ # Show invalid properties with the reasons. Usually used together with valid?
174
+ # @return Array for valid properties with the reasons
175
+ def list_invalid_properties
176
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
177
+ invalid_properties = Array.new
178
+ if @account_id.nil?
179
+ invalid_properties.push('invalid value for "account_id", account_id cannot be nil.')
180
+ end
181
+
182
+ if @ad_account_id.nil?
183
+ invalid_properties.push('invalid value for "ad_account_id", ad_account_id cannot be nil.')
184
+ end
185
+
186
+ if @headline.nil?
187
+ invalid_properties.push('invalid value for "headline", headline cannot be nil.')
188
+ end
189
+
190
+ if @headline.to_s.length > 255
191
+ invalid_properties.push('invalid value for "headline", the character length must be smaller than or equal to 255.')
192
+ end
193
+
194
+ if @body.nil?
195
+ invalid_properties.push('invalid value for "body", body cannot be nil.')
196
+ end
197
+
198
+ if !@description.nil? && @description.to_s.length > 255
199
+ invalid_properties.push('invalid value for "description", the character length must be smaller than or equal to 255.')
200
+ end
201
+
202
+ if @link_url.nil?
203
+ invalid_properties.push('invalid value for "link_url", link_url cannot be nil.')
204
+ end
205
+
206
+ if !@carousel_cards.nil? && @carousel_cards.length > 10
207
+ invalid_properties.push('invalid value for "carousel_cards", number of items must be less than or equal to 10.')
208
+ end
209
+
210
+ if !@carousel_cards.nil? && @carousel_cards.length < 2
211
+ invalid_properties.push('invalid value for "carousel_cards", number of items must be greater than or equal to 2.')
212
+ end
213
+
214
+ invalid_properties
215
+ end
216
+
217
+ # Check to see if the all the properties in the model are valid
218
+ # @return true if the model is valid
219
+ def valid?
220
+ warn '[DEPRECATED] the `valid?` method is obsolete'
221
+ return false if @account_id.nil?
222
+ return false if @ad_account_id.nil?
223
+ return false if @headline.nil?
224
+ return false if @headline.to_s.length > 255
225
+ return false if @body.nil?
226
+ return false if !@description.nil? && @description.to_s.length > 255
227
+ return false if @link_url.nil?
228
+ return false if !@carousel_cards.nil? && @carousel_cards.length > 10
229
+ return false if !@carousel_cards.nil? && @carousel_cards.length < 2
230
+ true
231
+ end
232
+
233
+ # Custom attribute writer method with validation
234
+ # @param [Object] account_id Value to be assigned
235
+ def account_id=(account_id)
236
+ if account_id.nil?
237
+ fail ArgumentError, 'account_id cannot be nil'
238
+ end
239
+
240
+ @account_id = account_id
241
+ end
242
+
243
+ # Custom attribute writer method with validation
244
+ # @param [Object] ad_account_id Value to be assigned
245
+ def ad_account_id=(ad_account_id)
246
+ if ad_account_id.nil?
247
+ fail ArgumentError, 'ad_account_id cannot be nil'
248
+ end
249
+
250
+ @ad_account_id = ad_account_id
251
+ end
252
+
253
+ # Custom attribute writer method with validation
254
+ # @param [Object] headline Value to be assigned
255
+ def headline=(headline)
256
+ if headline.nil?
257
+ fail ArgumentError, 'headline cannot be nil'
258
+ end
259
+
260
+ if headline.to_s.length > 255
261
+ fail ArgumentError, 'invalid value for "headline", the character length must be smaller than or equal to 255.'
262
+ end
263
+
264
+ @headline = headline
265
+ end
266
+
267
+ # Custom attribute writer method with validation
268
+ # @param [Object] body Value to be assigned
269
+ def body=(body)
270
+ if body.nil?
271
+ fail ArgumentError, 'body cannot be nil'
272
+ end
273
+
274
+ @body = body
275
+ end
276
+
277
+ # Custom attribute writer method with validation
278
+ # @param [Object] description Value to be assigned
279
+ def description=(description)
280
+ if description.nil?
281
+ fail ArgumentError, 'description cannot be nil'
282
+ end
283
+
284
+ if description.to_s.length > 255
285
+ fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 255.'
286
+ end
287
+
288
+ @description = description
289
+ end
290
+
291
+ # Custom attribute writer method with validation
292
+ # @param [Object] link_url Value to be assigned
293
+ def link_url=(link_url)
294
+ if link_url.nil?
295
+ fail ArgumentError, 'link_url cannot be nil'
296
+ end
297
+
298
+ @link_url = link_url
299
+ end
300
+
301
+ # Custom attribute writer method with validation
302
+ # @param [Object] carousel_cards Value to be assigned
303
+ def carousel_cards=(carousel_cards)
304
+ if carousel_cards.nil?
305
+ fail ArgumentError, 'carousel_cards cannot be nil'
306
+ end
307
+
308
+ if carousel_cards.length > 10
309
+ fail ArgumentError, 'invalid value for "carousel_cards", number of items must be less than or equal to 10.'
310
+ end
311
+
312
+ if carousel_cards.length < 2
313
+ fail ArgumentError, 'invalid value for "carousel_cards", number of items must be greater than or equal to 2.'
314
+ end
315
+
316
+ @carousel_cards = carousel_cards
317
+ end
318
+
319
+ # Checks equality by comparing each attribute.
320
+ # @param [Object] Object to be compared
321
+ def ==(o)
322
+ return true if self.equal?(o)
323
+ self.class == o.class &&
324
+ account_id == o.account_id &&
325
+ ad_account_id == o.ad_account_id &&
326
+ headline == o.headline &&
327
+ body == o.body &&
328
+ description == o.description &&
329
+ call_to_action == o.call_to_action &&
330
+ link_url == o.link_url &&
331
+ image_url == o.image_url &&
332
+ image_hash == o.image_hash &&
333
+ carousel_cards == o.carousel_cards &&
334
+ url_tags == o.url_tags
335
+ end
336
+
337
+ # @see the `==` method
338
+ # @param [Object] Object to be compared
339
+ def eql?(o)
340
+ self == o
341
+ end
342
+
343
+ # Calculates hash code according to all attributes.
344
+ # @return [Integer] Hash code
345
+ def hash
346
+ [account_id, ad_account_id, headline, body, description, call_to_action, link_url, image_url, image_hash, carousel_cards, url_tags].hash
347
+ end
348
+
349
+ # Builds the object from hash
350
+ # @param [Hash] attributes Model attributes in the form of hash
351
+ # @return [Object] Returns the model itself
352
+ def self.build_from_hash(attributes)
353
+ return nil unless attributes.is_a?(Hash)
354
+ attributes = attributes.transform_keys(&:to_sym)
355
+ transformed_hash = {}
356
+ openapi_types.each_pair do |key, type|
357
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
358
+ transformed_hash["#{key}"] = nil
359
+ elsif type =~ /\AArray<(.*)>/i
360
+ # check to ensure the input is an array given that the attribute
361
+ # is documented as an array but the input is not
362
+ if attributes[attribute_map[key]].is_a?(Array)
363
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
364
+ end
365
+ elsif !attributes[attribute_map[key]].nil?
366
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
367
+ end
368
+ end
369
+ new(transformed_hash)
370
+ end
371
+
372
+ # Returns the object in the form of hash
373
+ # @return [Hash] Returns the object in the form of hash
374
+ def to_hash
375
+ hash = {}
376
+ self.class.attribute_map.each_pair do |attr, param|
377
+ value = self.send(attr)
378
+ if value.nil?
379
+ is_nullable = self.class.openapi_nullable.include?(attr)
380
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
381
+ end
382
+
383
+ hash[param] = _to_hash(value)
384
+ end
385
+ hash
386
+ end
387
+
388
+ end
389
+
390
+ end
@@ -0,0 +1,255 @@
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.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
+ class CreateAdCreativeRequestCarouselCardsInner < ApiModelBase
18
+ attr_accessor :image_url
19
+
20
+ attr_accessor :link_url
21
+
22
+ attr_accessor :headline
23
+
24
+ attr_accessor :description
25
+
26
+ attr_accessor :call_to_action
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'image_url' => :'imageUrl',
32
+ :'link_url' => :'linkUrl',
33
+ :'headline' => :'headline',
34
+ :'description' => :'description',
35
+ :'call_to_action' => :'callToAction'
36
+ }
37
+ end
38
+
39
+ # Returns attribute mapping this model knows about
40
+ def self.acceptable_attribute_map
41
+ attribute_map
42
+ end
43
+
44
+ # Returns all the JSON keys this model knows about
45
+ def self.acceptable_attributes
46
+ acceptable_attribute_map.values
47
+ end
48
+
49
+ # Attribute type mapping.
50
+ def self.openapi_types
51
+ {
52
+ :'image_url' => :'String',
53
+ :'link_url' => :'String',
54
+ :'headline' => :'String',
55
+ :'description' => :'String',
56
+ :'call_to_action' => :'String'
57
+ }
58
+ end
59
+
60
+ # List of attributes with nullable: true
61
+ def self.openapi_nullable
62
+ Set.new([
63
+ ])
64
+ end
65
+
66
+ # Initializes the object
67
+ # @param [Hash] attributes Model attributes in the form of hash
68
+ def initialize(attributes = {})
69
+ if (!attributes.is_a?(Hash))
70
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::CreateAdCreativeRequestCarouselCardsInner` initialize method"
71
+ end
72
+
73
+ # check to see if the attribute exists and convert string to symbol for hash key
74
+ acceptable_attribute_map = self.class.acceptable_attribute_map
75
+ attributes = attributes.each_with_object({}) { |(k, v), h|
76
+ if (!acceptable_attribute_map.key?(k.to_sym))
77
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::CreateAdCreativeRequestCarouselCardsInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
78
+ end
79
+ h[k.to_sym] = v
80
+ }
81
+
82
+ if attributes.key?(:'image_url')
83
+ self.image_url = attributes[:'image_url']
84
+ else
85
+ self.image_url = nil
86
+ end
87
+
88
+ if attributes.key?(:'link_url')
89
+ self.link_url = attributes[:'link_url']
90
+ else
91
+ self.link_url = nil
92
+ end
93
+
94
+ if attributes.key?(:'headline')
95
+ self.headline = attributes[:'headline']
96
+ end
97
+
98
+ if attributes.key?(:'description')
99
+ self.description = attributes[:'description']
100
+ end
101
+
102
+ if attributes.key?(:'call_to_action')
103
+ self.call_to_action = attributes[:'call_to_action']
104
+ end
105
+ end
106
+
107
+ # Show invalid properties with the reasons. Usually used together with valid?
108
+ # @return Array for valid properties with the reasons
109
+ def list_invalid_properties
110
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
111
+ invalid_properties = Array.new
112
+ if @image_url.nil?
113
+ invalid_properties.push('invalid value for "image_url", image_url cannot be nil.')
114
+ end
115
+
116
+ if @link_url.nil?
117
+ invalid_properties.push('invalid value for "link_url", link_url cannot be nil.')
118
+ end
119
+
120
+ if !@headline.nil? && @headline.to_s.length > 255
121
+ invalid_properties.push('invalid value for "headline", the character length must be smaller than or equal to 255.')
122
+ end
123
+
124
+ if !@description.nil? && @description.to_s.length > 255
125
+ invalid_properties.push('invalid value for "description", the character length must be smaller than or equal to 255.')
126
+ end
127
+
128
+ invalid_properties
129
+ end
130
+
131
+ # Check to see if the all the properties in the model are valid
132
+ # @return true if the model is valid
133
+ def valid?
134
+ warn '[DEPRECATED] the `valid?` method is obsolete'
135
+ return false if @image_url.nil?
136
+ return false if @link_url.nil?
137
+ return false if !@headline.nil? && @headline.to_s.length > 255
138
+ return false if !@description.nil? && @description.to_s.length > 255
139
+ true
140
+ end
141
+
142
+ # Custom attribute writer method with validation
143
+ # @param [Object] image_url Value to be assigned
144
+ def image_url=(image_url)
145
+ if image_url.nil?
146
+ fail ArgumentError, 'image_url cannot be nil'
147
+ end
148
+
149
+ @image_url = image_url
150
+ end
151
+
152
+ # Custom attribute writer method with validation
153
+ # @param [Object] link_url Value to be assigned
154
+ def link_url=(link_url)
155
+ if link_url.nil?
156
+ fail ArgumentError, 'link_url cannot be nil'
157
+ end
158
+
159
+ @link_url = link_url
160
+ end
161
+
162
+ # Custom attribute writer method with validation
163
+ # @param [Object] headline Value to be assigned
164
+ def headline=(headline)
165
+ if headline.nil?
166
+ fail ArgumentError, 'headline cannot be nil'
167
+ end
168
+
169
+ if headline.to_s.length > 255
170
+ fail ArgumentError, 'invalid value for "headline", the character length must be smaller than or equal to 255.'
171
+ end
172
+
173
+ @headline = headline
174
+ end
175
+
176
+ # Custom attribute writer method with validation
177
+ # @param [Object] description Value to be assigned
178
+ def description=(description)
179
+ if description.nil?
180
+ fail ArgumentError, 'description cannot be nil'
181
+ end
182
+
183
+ if description.to_s.length > 255
184
+ fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 255.'
185
+ end
186
+
187
+ @description = description
188
+ end
189
+
190
+ # Checks equality by comparing each attribute.
191
+ # @param [Object] Object to be compared
192
+ def ==(o)
193
+ return true if self.equal?(o)
194
+ self.class == o.class &&
195
+ image_url == o.image_url &&
196
+ link_url == o.link_url &&
197
+ headline == o.headline &&
198
+ description == o.description &&
199
+ call_to_action == o.call_to_action
200
+ end
201
+
202
+ # @see the `==` method
203
+ # @param [Object] Object to be compared
204
+ def eql?(o)
205
+ self == o
206
+ end
207
+
208
+ # Calculates hash code according to all attributes.
209
+ # @return [Integer] Hash code
210
+ def hash
211
+ [image_url, link_url, headline, description, call_to_action].hash
212
+ end
213
+
214
+ # Builds the object from hash
215
+ # @param [Hash] attributes Model attributes in the form of hash
216
+ # @return [Object] Returns the model itself
217
+ def self.build_from_hash(attributes)
218
+ return nil unless attributes.is_a?(Hash)
219
+ attributes = attributes.transform_keys(&:to_sym)
220
+ transformed_hash = {}
221
+ openapi_types.each_pair do |key, type|
222
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
223
+ transformed_hash["#{key}"] = nil
224
+ elsif type =~ /\AArray<(.*)>/i
225
+ # check to ensure the input is an array given that the attribute
226
+ # is documented as an array but the input is not
227
+ if attributes[attribute_map[key]].is_a?(Array)
228
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
229
+ end
230
+ elsif !attributes[attribute_map[key]].nil?
231
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
232
+ end
233
+ end
234
+ new(transformed_hash)
235
+ end
236
+
237
+ # Returns the object in the form of hash
238
+ # @return [Hash] Returns the object in the form of hash
239
+ def to_hash
240
+ hash = {}
241
+ self.class.attribute_map.each_pair do |attr, param|
242
+ value = self.send(attr)
243
+ if value.nil?
244
+ is_nullable = self.class.openapi_nullable.include?(attr)
245
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
246
+ end
247
+
248
+ hash[param] = _to_hash(value)
249
+ end
250
+ hash
251
+ end
252
+
253
+ end
254
+
255
+ end