late-sdk 0.0.544 → 0.0.545

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 (127) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +52 -3
  3. data/docs/AdAudiencesApi.md +5 -5
  4. data/docs/AdCampaignsApi.md +142 -0
  5. data/docs/AdsApi.md +795 -37
  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 +40 -0
  10. data/docs/CreateAdCreativeRequestCarouselCardsInner.md +26 -0
  11. data/docs/CreateSmsSenderId200Response.md +22 -0
  12. data/docs/CreateSmsSenderIdRequest.md +18 -0
  13. data/docs/CreateStandaloneAd200Response.md +22 -0
  14. data/docs/CreateStandaloneAd200ResponseResultsInner.md +22 -0
  15. data/docs/CreateStandaloneAdRequest.md +4 -0
  16. data/docs/DeleteAdCreative200Response.md +20 -0
  17. data/docs/DeleteSmsSenderId200Response.md +18 -0
  18. data/docs/DiscordApi.md +153 -1
  19. data/docs/{ListDiscordGuildMembers200ResponseDataInner.md → DiscordGuildMember.md} +3 -3
  20. data/docs/{ListDiscordGuildMembers200ResponseDataInnerUser.md → DiscordGuildMemberUser.md} +2 -2
  21. data/docs/DuplicateAd200Response.md +22 -0
  22. data/docs/DuplicateAdRequest.md +28 -0
  23. data/docs/DuplicateAdSet200Response.md +22 -0
  24. data/docs/DuplicateAdSetRequest.md +36 -0
  25. data/docs/GetAdCreative200Response.md +18 -0
  26. data/docs/GetDiscordGuildMember200Response.md +18 -0
  27. data/docs/ListAdCreatives200Response.md +22 -0
  28. data/docs/ListAdImages200Response.md +22 -0
  29. data/docs/ListAdLabels200Response.md +22 -0
  30. data/docs/ListDiscordGuildMembers200Response.md +1 -1
  31. data/docs/ListHighDemandPeriods200Response.md +22 -0
  32. data/docs/ListMetaBusinesses200Response.md +20 -0
  33. data/docs/ListSmsSenderIds200Response.md +20 -0
  34. data/docs/ListSmsSenderIds200ResponseBudget.md +24 -0
  35. data/docs/ListSmsSenderIds200ResponseBudgetPendingRequest.md +22 -0
  36. data/docs/ListSmsSenderIds200ResponseSenderIdsInner.md +24 -0
  37. data/docs/RequestSmsSenderIdLimitIncrease200Response.md +20 -0
  38. data/docs/RequestSmsSenderIdLimitIncreaseRequest.md +20 -0
  39. data/docs/SMSApi.md +275 -0
  40. data/docs/SearchDiscordGuildMembers200Response.md +18 -0
  41. data/docs/UpdateAdCreative200Response.md +22 -0
  42. data/docs/UpdateAdCreativeRequest.md +20 -0
  43. data/lib/zernio-sdk/api/ad_audiences_api.rb +4 -4
  44. data/lib/zernio-sdk/api/ad_campaigns_api.rb +142 -0
  45. data/lib/zernio-sdk/api/ads_api.rb +829 -51
  46. data/lib/zernio-sdk/api/discord_api.rb +174 -2
  47. data/lib/zernio-sdk/api/sms_api.rb +254 -0
  48. data/lib/zernio-sdk/models/create_ad_campaign201_response.rb +210 -0
  49. data/lib/zernio-sdk/models/create_ad_campaign_request.rb +343 -0
  50. data/lib/zernio-sdk/models/create_ad_creative201_response.rb +157 -0
  51. data/lib/zernio-sdk/models/create_ad_creative_request.rb +424 -0
  52. data/lib/zernio-sdk/models/create_ad_creative_request_carousel_cards_inner.rb +255 -0
  53. data/lib/zernio-sdk/models/create_sms_sender_id200_response.rb +166 -0
  54. data/lib/zernio-sdk/models/create_sms_sender_id_request.rb +183 -0
  55. data/lib/zernio-sdk/models/create_standalone_ad200_response.rb +201 -0
  56. data/lib/zernio-sdk/models/create_standalone_ad200_response_results_inner.rb +212 -0
  57. data/lib/zernio-sdk/models/create_standalone_ad_request.rb +23 -1
  58. data/lib/zernio-sdk/models/delete_ad_creative200_response.rb +156 -0
  59. data/lib/zernio-sdk/models/delete_sms_sender_id200_response.rb +147 -0
  60. data/lib/zernio-sdk/models/{list_discord_guild_members200_response_data_inner.rb → discord_guild_member.rb} +5 -4
  61. data/lib/zernio-sdk/models/{list_discord_guild_members200_response_data_inner_user.rb → discord_guild_member_user.rb} +3 -3
  62. data/lib/zernio-sdk/models/duplicate_ad200_response.rb +200 -0
  63. data/lib/zernio-sdk/models/duplicate_ad_request.rb +243 -0
  64. data/lib/zernio-sdk/models/duplicate_ad_set200_response.rb +201 -0
  65. data/lib/zernio-sdk/models/duplicate_ad_set_request.rb +302 -0
  66. data/lib/zernio-sdk/models/get_ad_creative200_response.rb +148 -0
  67. data/lib/zernio-sdk/models/get_discord_guild_member200_response.rb +147 -0
  68. data/lib/zernio-sdk/models/list_ad_creatives200_response.rb +167 -0
  69. data/lib/zernio-sdk/models/list_ad_images200_response.rb +167 -0
  70. data/lib/zernio-sdk/models/list_ad_labels200_response.rb +167 -0
  71. data/lib/zernio-sdk/models/list_discord_guild_members200_response.rb +1 -1
  72. data/lib/zernio-sdk/models/list_high_demand_periods200_response.rb +168 -0
  73. data/lib/zernio-sdk/models/list_meta_businesses200_response.rb +158 -0
  74. data/lib/zernio-sdk/models/list_sms_sender_ids200_response.rb +158 -0
  75. data/lib/zernio-sdk/models/list_sms_sender_ids200_response_budget.rb +178 -0
  76. data/lib/zernio-sdk/models/list_sms_sender_ids200_response_budget_pending_request.rb +167 -0
  77. data/lib/zernio-sdk/models/list_sms_sender_ids200_response_sender_ids_inner.rb +175 -0
  78. data/lib/zernio-sdk/models/request_sms_sender_id_limit_increase200_response.rb +156 -0
  79. data/lib/zernio-sdk/models/request_sms_sender_id_limit_increase_request.rb +210 -0
  80. data/lib/zernio-sdk/models/search_discord_guild_members200_response.rb +149 -0
  81. data/lib/zernio-sdk/models/update_ad_creative200_response.rb +165 -0
  82. data/lib/zernio-sdk/models/update_ad_creative_request.rb +200 -0
  83. data/lib/zernio-sdk/version.rb +1 -1
  84. data/lib/zernio-sdk.rb +33 -2
  85. data/openapi.yaml +740 -27
  86. data/spec/api/ad_audiences_api_spec.rb +2 -2
  87. data/spec/api/ad_campaigns_api_spec.rb +25 -0
  88. data/spec/api/ads_api_spec.rb +143 -1
  89. data/spec/api/discord_api_spec.rb +30 -1
  90. data/spec/api/sms_api_spec.rb +46 -0
  91. data/spec/models/create_ad_campaign201_response_spec.rb +58 -0
  92. data/spec/models/create_ad_campaign_request_spec.rb +94 -0
  93. data/spec/models/create_ad_creative201_response_spec.rb +42 -0
  94. data/spec/models/create_ad_creative_request_carousel_cards_inner_spec.rb +60 -0
  95. data/spec/models/create_ad_creative_request_spec.rb +106 -0
  96. data/spec/models/create_sms_sender_id200_response_spec.rb +48 -0
  97. data/spec/models/create_sms_sender_id_request_spec.rb +36 -0
  98. data/spec/models/create_standalone_ad200_response_results_inner_spec.rb +56 -0
  99. data/spec/models/create_standalone_ad200_response_spec.rb +52 -0
  100. data/spec/models/create_standalone_ad_request_spec.rb +16 -0
  101. data/spec/models/delete_ad_creative200_response_spec.rb +42 -0
  102. data/spec/models/delete_sms_sender_id200_response_spec.rb +36 -0
  103. data/spec/models/{list_discord_guild_members200_response_data_inner_spec.rb → discord_guild_member_spec.rb} +6 -6
  104. data/spec/models/{list_discord_guild_members200_response_data_inner_user_spec.rb → discord_guild_member_user_spec.rb} +6 -6
  105. data/spec/models/duplicate_ad200_response_spec.rb +52 -0
  106. data/spec/models/duplicate_ad_request_spec.rb +74 -0
  107. data/spec/models/duplicate_ad_set200_response_spec.rb +52 -0
  108. data/spec/models/duplicate_ad_set_request_spec.rb +102 -0
  109. data/spec/models/get_ad_creative200_response_spec.rb +36 -0
  110. data/spec/models/get_discord_guild_member200_response_spec.rb +36 -0
  111. data/spec/models/list_ad_creatives200_response_spec.rb +48 -0
  112. data/spec/models/list_ad_images200_response_spec.rb +48 -0
  113. data/spec/models/list_ad_labels200_response_spec.rb +48 -0
  114. data/spec/models/list_high_demand_periods200_response_spec.rb +48 -0
  115. data/spec/models/list_meta_businesses200_response_spec.rb +42 -0
  116. data/spec/models/list_sms_sender_ids200_response_budget_pending_request_spec.rb +48 -0
  117. data/spec/models/list_sms_sender_ids200_response_budget_spec.rb +54 -0
  118. data/spec/models/list_sms_sender_ids200_response_sender_ids_inner_spec.rb +54 -0
  119. data/spec/models/list_sms_sender_ids200_response_spec.rb +42 -0
  120. data/spec/models/request_sms_sender_id_limit_increase200_response_spec.rb +42 -0
  121. data/spec/models/request_sms_sender_id_limit_increase_request_spec.rb +42 -0
  122. data/spec/models/search_discord_guild_members200_response_spec.rb +36 -0
  123. data/spec/models/update_ad_creative200_response_spec.rb +48 -0
  124. data/spec/models/update_ad_creative_request_spec.rb +42 -0
  125. data/zernio-sdk-0.0.545.gem +0 -0
  126. metadata +134 -10
  127. data/zernio-sdk-0.0.544.gem +0 -0
@@ -0,0 +1,424 @@
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
+ # Advantage+ creative enhancements: partial map of Meta creative feature keys (snake_case) to enroll status, forwarded as degrees_of_freedom_spec.creative_features_spec. Unspecified features default to OPT_OUT.
49
+ attr_accessor :creative_features
50
+
51
+ class EnumAttributeValidator
52
+ attr_reader :datatype
53
+ attr_reader :allowable_values
54
+
55
+ def initialize(datatype, allowable_values)
56
+ @allowable_values = allowable_values.map do |value|
57
+ case datatype.to_s
58
+ when /Integer/i
59
+ value.to_i
60
+ when /Float/i
61
+ value.to_f
62
+ else
63
+ value
64
+ end
65
+ end
66
+ end
67
+
68
+ def valid?(value)
69
+ !value || allowable_values.include?(value)
70
+ end
71
+ end
72
+
73
+ # Attribute mapping from ruby-style variable name to JSON key.
74
+ def self.attribute_map
75
+ {
76
+ :'account_id' => :'accountId',
77
+ :'ad_account_id' => :'adAccountId',
78
+ :'headline' => :'headline',
79
+ :'body' => :'body',
80
+ :'description' => :'description',
81
+ :'call_to_action' => :'callToAction',
82
+ :'link_url' => :'linkUrl',
83
+ :'image_url' => :'imageUrl',
84
+ :'image_hash' => :'imageHash',
85
+ :'carousel_cards' => :'carouselCards',
86
+ :'url_tags' => :'urlTags',
87
+ :'creative_features' => :'creativeFeatures'
88
+ }
89
+ end
90
+
91
+ # Returns attribute mapping this model knows about
92
+ def self.acceptable_attribute_map
93
+ attribute_map
94
+ end
95
+
96
+ # Returns all the JSON keys this model knows about
97
+ def self.acceptable_attributes
98
+ acceptable_attribute_map.values
99
+ end
100
+
101
+ # Attribute type mapping.
102
+ def self.openapi_types
103
+ {
104
+ :'account_id' => :'String',
105
+ :'ad_account_id' => :'String',
106
+ :'headline' => :'String',
107
+ :'body' => :'String',
108
+ :'description' => :'String',
109
+ :'call_to_action' => :'String',
110
+ :'link_url' => :'String',
111
+ :'image_url' => :'String',
112
+ :'image_hash' => :'String',
113
+ :'carousel_cards' => :'Array<CreateAdCreativeRequestCarouselCardsInner>',
114
+ :'url_tags' => :'String',
115
+ :'creative_features' => :'Hash<String, String>'
116
+ }
117
+ end
118
+
119
+ # List of attributes with nullable: true
120
+ def self.openapi_nullable
121
+ Set.new([
122
+ ])
123
+ end
124
+
125
+ # Initializes the object
126
+ # @param [Hash] attributes Model attributes in the form of hash
127
+ def initialize(attributes = {})
128
+ if (!attributes.is_a?(Hash))
129
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::CreateAdCreativeRequest` initialize method"
130
+ end
131
+
132
+ # check to see if the attribute exists and convert string to symbol for hash key
133
+ acceptable_attribute_map = self.class.acceptable_attribute_map
134
+ attributes = attributes.each_with_object({}) { |(k, v), h|
135
+ if (!acceptable_attribute_map.key?(k.to_sym))
136
+ 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
137
+ end
138
+ h[k.to_sym] = v
139
+ }
140
+
141
+ if attributes.key?(:'account_id')
142
+ self.account_id = attributes[:'account_id']
143
+ else
144
+ self.account_id = nil
145
+ end
146
+
147
+ if attributes.key?(:'ad_account_id')
148
+ self.ad_account_id = attributes[:'ad_account_id']
149
+ else
150
+ self.ad_account_id = nil
151
+ end
152
+
153
+ if attributes.key?(:'headline')
154
+ self.headline = attributes[:'headline']
155
+ else
156
+ self.headline = nil
157
+ end
158
+
159
+ if attributes.key?(:'body')
160
+ self.body = attributes[:'body']
161
+ else
162
+ self.body = nil
163
+ end
164
+
165
+ if attributes.key?(:'description')
166
+ self.description = attributes[:'description']
167
+ end
168
+
169
+ if attributes.key?(:'call_to_action')
170
+ self.call_to_action = attributes[:'call_to_action']
171
+ else
172
+ self.call_to_action = 'LEARN_MORE'
173
+ end
174
+
175
+ if attributes.key?(:'link_url')
176
+ self.link_url = attributes[:'link_url']
177
+ else
178
+ self.link_url = nil
179
+ end
180
+
181
+ if attributes.key?(:'image_url')
182
+ self.image_url = attributes[:'image_url']
183
+ end
184
+
185
+ if attributes.key?(:'image_hash')
186
+ self.image_hash = attributes[:'image_hash']
187
+ end
188
+
189
+ if attributes.key?(:'carousel_cards')
190
+ if (value = attributes[:'carousel_cards']).is_a?(Array)
191
+ self.carousel_cards = value
192
+ end
193
+ end
194
+
195
+ if attributes.key?(:'url_tags')
196
+ self.url_tags = attributes[:'url_tags']
197
+ end
198
+
199
+ if attributes.key?(:'creative_features')
200
+ if (value = attributes[:'creative_features']).is_a?(Hash)
201
+ self.creative_features = value
202
+ end
203
+ end
204
+ end
205
+
206
+ # Show invalid properties with the reasons. Usually used together with valid?
207
+ # @return Array for valid properties with the reasons
208
+ def list_invalid_properties
209
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
210
+ invalid_properties = Array.new
211
+ if @account_id.nil?
212
+ invalid_properties.push('invalid value for "account_id", account_id cannot be nil.')
213
+ end
214
+
215
+ if @ad_account_id.nil?
216
+ invalid_properties.push('invalid value for "ad_account_id", ad_account_id cannot be nil.')
217
+ end
218
+
219
+ if @headline.nil?
220
+ invalid_properties.push('invalid value for "headline", headline cannot be nil.')
221
+ end
222
+
223
+ if @headline.to_s.length > 255
224
+ invalid_properties.push('invalid value for "headline", the character length must be smaller than or equal to 255.')
225
+ end
226
+
227
+ if @body.nil?
228
+ invalid_properties.push('invalid value for "body", body cannot be nil.')
229
+ end
230
+
231
+ if !@description.nil? && @description.to_s.length > 255
232
+ invalid_properties.push('invalid value for "description", the character length must be smaller than or equal to 255.')
233
+ end
234
+
235
+ if @link_url.nil?
236
+ invalid_properties.push('invalid value for "link_url", link_url cannot be nil.')
237
+ end
238
+
239
+ if !@carousel_cards.nil? && @carousel_cards.length > 10
240
+ invalid_properties.push('invalid value for "carousel_cards", number of items must be less than or equal to 10.')
241
+ end
242
+
243
+ if !@carousel_cards.nil? && @carousel_cards.length < 2
244
+ invalid_properties.push('invalid value for "carousel_cards", number of items must be greater than or equal to 2.')
245
+ end
246
+
247
+ invalid_properties
248
+ end
249
+
250
+ # Check to see if the all the properties in the model are valid
251
+ # @return true if the model is valid
252
+ def valid?
253
+ warn '[DEPRECATED] the `valid?` method is obsolete'
254
+ return false if @account_id.nil?
255
+ return false if @ad_account_id.nil?
256
+ return false if @headline.nil?
257
+ return false if @headline.to_s.length > 255
258
+ return false if @body.nil?
259
+ return false if !@description.nil? && @description.to_s.length > 255
260
+ return false if @link_url.nil?
261
+ return false if !@carousel_cards.nil? && @carousel_cards.length > 10
262
+ return false if !@carousel_cards.nil? && @carousel_cards.length < 2
263
+ true
264
+ end
265
+
266
+ # Custom attribute writer method with validation
267
+ # @param [Object] account_id Value to be assigned
268
+ def account_id=(account_id)
269
+ if account_id.nil?
270
+ fail ArgumentError, 'account_id cannot be nil'
271
+ end
272
+
273
+ @account_id = account_id
274
+ end
275
+
276
+ # Custom attribute writer method with validation
277
+ # @param [Object] ad_account_id Value to be assigned
278
+ def ad_account_id=(ad_account_id)
279
+ if ad_account_id.nil?
280
+ fail ArgumentError, 'ad_account_id cannot be nil'
281
+ end
282
+
283
+ @ad_account_id = ad_account_id
284
+ end
285
+
286
+ # Custom attribute writer method with validation
287
+ # @param [Object] headline Value to be assigned
288
+ def headline=(headline)
289
+ if headline.nil?
290
+ fail ArgumentError, 'headline cannot be nil'
291
+ end
292
+
293
+ if headline.to_s.length > 255
294
+ fail ArgumentError, 'invalid value for "headline", the character length must be smaller than or equal to 255.'
295
+ end
296
+
297
+ @headline = headline
298
+ end
299
+
300
+ # Custom attribute writer method with validation
301
+ # @param [Object] body Value to be assigned
302
+ def body=(body)
303
+ if body.nil?
304
+ fail ArgumentError, 'body cannot be nil'
305
+ end
306
+
307
+ @body = body
308
+ end
309
+
310
+ # Custom attribute writer method with validation
311
+ # @param [Object] description Value to be assigned
312
+ def description=(description)
313
+ if description.nil?
314
+ fail ArgumentError, 'description cannot be nil'
315
+ end
316
+
317
+ if description.to_s.length > 255
318
+ fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 255.'
319
+ end
320
+
321
+ @description = description
322
+ end
323
+
324
+ # Custom attribute writer method with validation
325
+ # @param [Object] link_url Value to be assigned
326
+ def link_url=(link_url)
327
+ if link_url.nil?
328
+ fail ArgumentError, 'link_url cannot be nil'
329
+ end
330
+
331
+ @link_url = link_url
332
+ end
333
+
334
+ # Custom attribute writer method with validation
335
+ # @param [Object] carousel_cards Value to be assigned
336
+ def carousel_cards=(carousel_cards)
337
+ if carousel_cards.nil?
338
+ fail ArgumentError, 'carousel_cards cannot be nil'
339
+ end
340
+
341
+ if carousel_cards.length > 10
342
+ fail ArgumentError, 'invalid value for "carousel_cards", number of items must be less than or equal to 10.'
343
+ end
344
+
345
+ if carousel_cards.length < 2
346
+ fail ArgumentError, 'invalid value for "carousel_cards", number of items must be greater than or equal to 2.'
347
+ end
348
+
349
+ @carousel_cards = carousel_cards
350
+ end
351
+
352
+ # Checks equality by comparing each attribute.
353
+ # @param [Object] Object to be compared
354
+ def ==(o)
355
+ return true if self.equal?(o)
356
+ self.class == o.class &&
357
+ account_id == o.account_id &&
358
+ ad_account_id == o.ad_account_id &&
359
+ headline == o.headline &&
360
+ body == o.body &&
361
+ description == o.description &&
362
+ call_to_action == o.call_to_action &&
363
+ link_url == o.link_url &&
364
+ image_url == o.image_url &&
365
+ image_hash == o.image_hash &&
366
+ carousel_cards == o.carousel_cards &&
367
+ url_tags == o.url_tags &&
368
+ creative_features == o.creative_features
369
+ end
370
+
371
+ # @see the `==` method
372
+ # @param [Object] Object to be compared
373
+ def eql?(o)
374
+ self == o
375
+ end
376
+
377
+ # Calculates hash code according to all attributes.
378
+ # @return [Integer] Hash code
379
+ def hash
380
+ [account_id, ad_account_id, headline, body, description, call_to_action, link_url, image_url, image_hash, carousel_cards, url_tags, creative_features].hash
381
+ end
382
+
383
+ # Builds the object from hash
384
+ # @param [Hash] attributes Model attributes in the form of hash
385
+ # @return [Object] Returns the model itself
386
+ def self.build_from_hash(attributes)
387
+ return nil unless attributes.is_a?(Hash)
388
+ attributes = attributes.transform_keys(&:to_sym)
389
+ transformed_hash = {}
390
+ openapi_types.each_pair do |key, type|
391
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
392
+ transformed_hash["#{key}"] = nil
393
+ elsif type =~ /\AArray<(.*)>/i
394
+ # check to ensure the input is an array given that the attribute
395
+ # is documented as an array but the input is not
396
+ if attributes[attribute_map[key]].is_a?(Array)
397
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
398
+ end
399
+ elsif !attributes[attribute_map[key]].nil?
400
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
401
+ end
402
+ end
403
+ new(transformed_hash)
404
+ end
405
+
406
+ # Returns the object in the form of hash
407
+ # @return [Hash] Returns the object in the form of hash
408
+ def to_hash
409
+ hash = {}
410
+ self.class.attribute_map.each_pair do |attr, param|
411
+ value = self.send(attr)
412
+ if value.nil?
413
+ is_nullable = self.class.openapi_nullable.include?(attr)
414
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
415
+ end
416
+
417
+ hash[param] = _to_hash(value)
418
+ end
419
+ hash
420
+ end
421
+
422
+ end
423
+
424
+ 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