late-sdk 0.0.905 → 0.0.906

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 (34) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +6 -0
  3. data/docs/AdCampaignsApi.md +71 -1
  4. data/docs/AdCreative.md +4 -0
  5. data/docs/CreateStandaloneAdRequest.md +8 -6
  6. data/docs/GooglePmaxAssetGroup.md +28 -0
  7. data/docs/GooglePmaxAssetGroupAssetsInner.md +28 -0
  8. data/docs/GooglePmaxAssetGroupInput.md +32 -0
  9. data/docs/GooglePmaxAssetGroupInputImages.md +22 -0
  10. data/docs/ListGoogleAssetGroups200Response.md +22 -0
  11. data/lib/zernio-sdk/api/ad_campaigns_api.rb +70 -2
  12. data/lib/zernio-sdk/models/ad_creative.rb +21 -1
  13. data/lib/zernio-sdk/models/create_standalone_ad200_response_results_inner.rb +2 -2
  14. data/lib/zernio-sdk/models/create_standalone_ad_request.rb +18 -9
  15. data/lib/zernio-sdk/models/google_pmax_asset_group.rb +299 -0
  16. data/lib/zernio-sdk/models/google_pmax_asset_group_assets_inner.rb +244 -0
  17. data/lib/zernio-sdk/models/google_pmax_asset_group_input.rb +453 -0
  18. data/lib/zernio-sdk/models/google_pmax_asset_group_input_images.rb +280 -0
  19. data/lib/zernio-sdk/models/list_google_asset_groups200_response.rb +204 -0
  20. data/lib/zernio-sdk/version.rb +1 -1
  21. data/lib/zernio-sdk.rb +5 -0
  22. data/openapi.yaml +184 -8
  23. data/spec/api/ad_campaigns_api_spec.rb +13 -1
  24. data/spec/models/ad_creative_spec.rb +12 -0
  25. data/spec/models/create_standalone_ad200_response_results_inner_spec.rb +1 -1
  26. data/spec/models/create_standalone_ad_request_spec.rb +7 -1
  27. data/spec/models/google_pmax_asset_group_assets_inner_spec.rb +66 -0
  28. data/spec/models/google_pmax_asset_group_input_images_spec.rb +48 -0
  29. data/spec/models/google_pmax_asset_group_input_spec.rb +78 -0
  30. data/spec/models/google_pmax_asset_group_spec.rb +66 -0
  31. data/spec/models/list_google_asset_groups200_response_spec.rb +48 -0
  32. data/zernio-sdk-0.0.906.gem +0 -0
  33. metadata +22 -2
  34. data/zernio-sdk-0.0.905.gem +0 -0
@@ -0,0 +1,453 @@
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
+ # Google Performance Max creative assets. At least one description must be 60 characters or fewer. Texts within each list must be distinct.
18
+ class GooglePmaxAssetGroupInput < ApiModelBase
19
+ # Defaults to the request name.
20
+ attr_accessor :name
21
+
22
+ # Required destination URL.
23
+ attr_accessor :final_url
24
+
25
+ attr_accessor :headlines
26
+
27
+ attr_accessor :long_headline
28
+
29
+ # At least one description must be 60 characters or fewer.
30
+ attr_accessor :descriptions
31
+
32
+ attr_accessor :business_name
33
+
34
+ attr_accessor :images
35
+
36
+ # Optional existing YouTube video id. Google can generate video when omitted. Video uploads and arbitrary video URLs are not supported.
37
+ attr_accessor :youtube_video_id
38
+
39
+ # Attribute mapping from ruby-style variable name to JSON key.
40
+ def self.attribute_map
41
+ {
42
+ :'name' => :'name',
43
+ :'final_url' => :'finalUrl',
44
+ :'headlines' => :'headlines',
45
+ :'long_headline' => :'longHeadline',
46
+ :'descriptions' => :'descriptions',
47
+ :'business_name' => :'businessName',
48
+ :'images' => :'images',
49
+ :'youtube_video_id' => :'youtubeVideoId'
50
+ }
51
+ end
52
+
53
+ # Returns attribute mapping this model knows about
54
+ def self.acceptable_attribute_map
55
+ attribute_map
56
+ end
57
+
58
+ # Returns all the JSON keys this model knows about
59
+ def self.acceptable_attributes
60
+ acceptable_attribute_map.values
61
+ end
62
+
63
+ # Attribute type mapping.
64
+ def self.openapi_types
65
+ {
66
+ :'name' => :'String',
67
+ :'final_url' => :'String',
68
+ :'headlines' => :'Array<String>',
69
+ :'long_headline' => :'String',
70
+ :'descriptions' => :'Array<String>',
71
+ :'business_name' => :'String',
72
+ :'images' => :'GooglePmaxAssetGroupInputImages',
73
+ :'youtube_video_id' => :'String'
74
+ }
75
+ end
76
+
77
+ # List of attributes with nullable: true
78
+ def self.openapi_nullable
79
+ Set.new([
80
+ ])
81
+ end
82
+
83
+ # Initializes the object
84
+ # @param [Hash] attributes Model attributes in the form of hash
85
+ def initialize(attributes = {})
86
+ if (!attributes.is_a?(Hash))
87
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::GooglePmaxAssetGroupInput` initialize method"
88
+ end
89
+
90
+ # check to see if the attribute exists and convert string to symbol for hash key
91
+ acceptable_attribute_map = self.class.acceptable_attribute_map
92
+ attributes = attributes.each_with_object({}) { |(k, v), h|
93
+ if (!acceptable_attribute_map.key?(k.to_sym))
94
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::GooglePmaxAssetGroupInput`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
95
+ end
96
+ h[k.to_sym] = v
97
+ }
98
+
99
+ if attributes.key?(:'name')
100
+ self.name = attributes[:'name']
101
+ end
102
+
103
+ if attributes.key?(:'final_url')
104
+ self.final_url = attributes[:'final_url']
105
+ else
106
+ self.final_url = nil
107
+ end
108
+
109
+ if attributes.key?(:'headlines')
110
+ if (value = attributes[:'headlines']).is_a?(Array)
111
+ self.headlines = value
112
+ end
113
+ else
114
+ self.headlines = nil
115
+ end
116
+
117
+ if attributes.key?(:'long_headline')
118
+ self.long_headline = attributes[:'long_headline']
119
+ else
120
+ self.long_headline = nil
121
+ end
122
+
123
+ if attributes.key?(:'descriptions')
124
+ if (value = attributes[:'descriptions']).is_a?(Array)
125
+ self.descriptions = value
126
+ end
127
+ else
128
+ self.descriptions = nil
129
+ end
130
+
131
+ if attributes.key?(:'business_name')
132
+ self.business_name = attributes[:'business_name']
133
+ else
134
+ self.business_name = nil
135
+ end
136
+
137
+ if attributes.key?(:'images')
138
+ self.images = attributes[:'images']
139
+ else
140
+ self.images = nil
141
+ end
142
+
143
+ if attributes.key?(:'youtube_video_id')
144
+ self.youtube_video_id = attributes[:'youtube_video_id']
145
+ end
146
+ end
147
+
148
+ # Show invalid properties with the reasons. Usually used together with valid?
149
+ # @return Array for valid properties with the reasons
150
+ def list_invalid_properties
151
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
152
+ invalid_properties = Array.new
153
+ if !@name.nil? && @name.to_s.length > 128
154
+ invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 128.')
155
+ end
156
+
157
+ if !@name.nil? && @name.to_s.length < 1
158
+ invalid_properties.push('invalid value for "name", the character length must be greater than or equal to 1.')
159
+ end
160
+
161
+ if @final_url.nil?
162
+ invalid_properties.push('invalid value for "final_url", final_url cannot be nil.')
163
+ end
164
+
165
+ pattern = Regexp.new(/^https?:\/\//)
166
+ if @final_url !~ pattern
167
+ invalid_properties.push("invalid value for \"final_url\", must conform to the pattern #{pattern}.")
168
+ end
169
+
170
+ if @headlines.nil?
171
+ invalid_properties.push('invalid value for "headlines", headlines cannot be nil.')
172
+ end
173
+
174
+ if @headlines.length > 15
175
+ invalid_properties.push('invalid value for "headlines", number of items must be less than or equal to 15.')
176
+ end
177
+
178
+ if @headlines.length < 3
179
+ invalid_properties.push('invalid value for "headlines", number of items must be greater than or equal to 3.')
180
+ end
181
+
182
+ if @long_headline.nil?
183
+ invalid_properties.push('invalid value for "long_headline", long_headline cannot be nil.')
184
+ end
185
+
186
+ if @long_headline.to_s.length > 90
187
+ invalid_properties.push('invalid value for "long_headline", the character length must be smaller than or equal to 90.')
188
+ end
189
+
190
+ if @long_headline.to_s.length < 1
191
+ invalid_properties.push('invalid value for "long_headline", the character length must be greater than or equal to 1.')
192
+ end
193
+
194
+ if @descriptions.nil?
195
+ invalid_properties.push('invalid value for "descriptions", descriptions cannot be nil.')
196
+ end
197
+
198
+ if @descriptions.length > 5
199
+ invalid_properties.push('invalid value for "descriptions", number of items must be less than or equal to 5.')
200
+ end
201
+
202
+ if @descriptions.length < 2
203
+ invalid_properties.push('invalid value for "descriptions", number of items must be greater than or equal to 2.')
204
+ end
205
+
206
+ if @business_name.nil?
207
+ invalid_properties.push('invalid value for "business_name", business_name cannot be nil.')
208
+ end
209
+
210
+ if @business_name.to_s.length > 25
211
+ invalid_properties.push('invalid value for "business_name", the character length must be smaller than or equal to 25.')
212
+ end
213
+
214
+ if @business_name.to_s.length < 1
215
+ invalid_properties.push('invalid value for "business_name", the character length must be greater than or equal to 1.')
216
+ end
217
+
218
+ if @images.nil?
219
+ invalid_properties.push('invalid value for "images", images cannot be nil.')
220
+ end
221
+
222
+ pattern = Regexp.new(/^[A-Za-z0-9_-]{11}$/)
223
+ if !@youtube_video_id.nil? && @youtube_video_id !~ pattern
224
+ invalid_properties.push("invalid value for \"youtube_video_id\", must conform to the pattern #{pattern}.")
225
+ end
226
+
227
+ invalid_properties
228
+ end
229
+
230
+ # Check to see if the all the properties in the model are valid
231
+ # @return true if the model is valid
232
+ def valid?
233
+ warn '[DEPRECATED] the `valid?` method is obsolete'
234
+ return false if !@name.nil? && @name.to_s.length > 128
235
+ return false if !@name.nil? && @name.to_s.length < 1
236
+ return false if @final_url.nil?
237
+ return false if @final_url !~ Regexp.new(/^https?:\/\//)
238
+ return false if @headlines.nil?
239
+ return false if @headlines.length > 15
240
+ return false if @headlines.length < 3
241
+ return false if @long_headline.nil?
242
+ return false if @long_headline.to_s.length > 90
243
+ return false if @long_headline.to_s.length < 1
244
+ return false if @descriptions.nil?
245
+ return false if @descriptions.length > 5
246
+ return false if @descriptions.length < 2
247
+ return false if @business_name.nil?
248
+ return false if @business_name.to_s.length > 25
249
+ return false if @business_name.to_s.length < 1
250
+ return false if @images.nil?
251
+ return false if !@youtube_video_id.nil? && @youtube_video_id !~ Regexp.new(/^[A-Za-z0-9_-]{11}$/)
252
+ true
253
+ end
254
+
255
+ # Custom attribute writer method with validation
256
+ # @param [Object] name Value to be assigned
257
+ def name=(name)
258
+ if name.nil?
259
+ fail ArgumentError, 'name cannot be nil'
260
+ end
261
+
262
+ if name.to_s.length > 128
263
+ fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 128.'
264
+ end
265
+
266
+ if name.to_s.length < 1
267
+ fail ArgumentError, 'invalid value for "name", the character length must be greater than or equal to 1.'
268
+ end
269
+
270
+ @name = name
271
+ end
272
+
273
+ # Custom attribute writer method with validation
274
+ # @param [Object] final_url Value to be assigned
275
+ def final_url=(final_url)
276
+ if final_url.nil?
277
+ fail ArgumentError, 'final_url cannot be nil'
278
+ end
279
+
280
+ pattern = Regexp.new(/^https?:\/\//)
281
+ if final_url !~ pattern
282
+ fail ArgumentError, "invalid value for \"final_url\", must conform to the pattern #{pattern}."
283
+ end
284
+
285
+ @final_url = final_url
286
+ end
287
+
288
+ # Custom attribute writer method with validation
289
+ # @param [Object] headlines Value to be assigned
290
+ def headlines=(headlines)
291
+ if headlines.nil?
292
+ fail ArgumentError, 'headlines cannot be nil'
293
+ end
294
+
295
+ if headlines.length > 15
296
+ fail ArgumentError, 'invalid value for "headlines", number of items must be less than or equal to 15.'
297
+ end
298
+
299
+ if headlines.length < 3
300
+ fail ArgumentError, 'invalid value for "headlines", number of items must be greater than or equal to 3.'
301
+ end
302
+
303
+ @headlines = headlines
304
+ end
305
+
306
+ # Custom attribute writer method with validation
307
+ # @param [Object] long_headline Value to be assigned
308
+ def long_headline=(long_headline)
309
+ if long_headline.nil?
310
+ fail ArgumentError, 'long_headline cannot be nil'
311
+ end
312
+
313
+ if long_headline.to_s.length > 90
314
+ fail ArgumentError, 'invalid value for "long_headline", the character length must be smaller than or equal to 90.'
315
+ end
316
+
317
+ if long_headline.to_s.length < 1
318
+ fail ArgumentError, 'invalid value for "long_headline", the character length must be greater than or equal to 1.'
319
+ end
320
+
321
+ @long_headline = long_headline
322
+ end
323
+
324
+ # Custom attribute writer method with validation
325
+ # @param [Object] descriptions Value to be assigned
326
+ def descriptions=(descriptions)
327
+ if descriptions.nil?
328
+ fail ArgumentError, 'descriptions cannot be nil'
329
+ end
330
+
331
+ if descriptions.length > 5
332
+ fail ArgumentError, 'invalid value for "descriptions", number of items must be less than or equal to 5.'
333
+ end
334
+
335
+ if descriptions.length < 2
336
+ fail ArgumentError, 'invalid value for "descriptions", number of items must be greater than or equal to 2.'
337
+ end
338
+
339
+ @descriptions = descriptions
340
+ end
341
+
342
+ # Custom attribute writer method with validation
343
+ # @param [Object] business_name Value to be assigned
344
+ def business_name=(business_name)
345
+ if business_name.nil?
346
+ fail ArgumentError, 'business_name cannot be nil'
347
+ end
348
+
349
+ if business_name.to_s.length > 25
350
+ fail ArgumentError, 'invalid value for "business_name", the character length must be smaller than or equal to 25.'
351
+ end
352
+
353
+ if business_name.to_s.length < 1
354
+ fail ArgumentError, 'invalid value for "business_name", the character length must be greater than or equal to 1.'
355
+ end
356
+
357
+ @business_name = business_name
358
+ end
359
+
360
+ # Custom attribute writer method with validation
361
+ # @param [Object] images Value to be assigned
362
+ def images=(images)
363
+ if images.nil?
364
+ fail ArgumentError, 'images cannot be nil'
365
+ end
366
+
367
+ @images = images
368
+ end
369
+
370
+ # Custom attribute writer method with validation
371
+ # @param [Object] youtube_video_id Value to be assigned
372
+ def youtube_video_id=(youtube_video_id)
373
+ if youtube_video_id.nil?
374
+ fail ArgumentError, 'youtube_video_id cannot be nil'
375
+ end
376
+
377
+ pattern = Regexp.new(/^[A-Za-z0-9_-]{11}$/)
378
+ if youtube_video_id !~ pattern
379
+ fail ArgumentError, "invalid value for \"youtube_video_id\", must conform to the pattern #{pattern}."
380
+ end
381
+
382
+ @youtube_video_id = youtube_video_id
383
+ end
384
+
385
+ # Checks equality by comparing each attribute.
386
+ # @param [Object] Object to be compared
387
+ def ==(o)
388
+ return true if self.equal?(o)
389
+ self.class == o.class &&
390
+ name == o.name &&
391
+ final_url == o.final_url &&
392
+ headlines == o.headlines &&
393
+ long_headline == o.long_headline &&
394
+ descriptions == o.descriptions &&
395
+ business_name == o.business_name &&
396
+ images == o.images &&
397
+ youtube_video_id == o.youtube_video_id
398
+ end
399
+
400
+ # @see the `==` method
401
+ # @param [Object] Object to be compared
402
+ def eql?(o)
403
+ self == o
404
+ end
405
+
406
+ # Calculates hash code according to all attributes.
407
+ # @return [Integer] Hash code
408
+ def hash
409
+ [name, final_url, headlines, long_headline, descriptions, business_name, images, youtube_video_id].hash
410
+ end
411
+
412
+ # Builds the object from hash
413
+ # @param [Hash] attributes Model attributes in the form of hash
414
+ # @return [Object] Returns the model itself
415
+ def self.build_from_hash(attributes)
416
+ return nil unless attributes.is_a?(Hash)
417
+ attributes = attributes.transform_keys(&:to_sym)
418
+ transformed_hash = {}
419
+ openapi_types.each_pair do |key, type|
420
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
421
+ transformed_hash["#{key}"] = nil
422
+ elsif type =~ /\AArray<(.*)>/i
423
+ # check to ensure the input is an array given that the attribute
424
+ # is documented as an array but the input is not
425
+ if attributes[attribute_map[key]].is_a?(Array)
426
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
427
+ end
428
+ elsif !attributes[attribute_map[key]].nil?
429
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
430
+ end
431
+ end
432
+ new(transformed_hash)
433
+ end
434
+
435
+ # Returns the object in the form of hash
436
+ # @return [Hash] Returns the object in the form of hash
437
+ def to_hash
438
+ hash = {}
439
+ self.class.attribute_map.each_pair do |attr, param|
440
+ value = self.send(attr)
441
+ if value.nil?
442
+ is_nullable = self.class.openapi_nullable.include?(attr)
443
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
444
+ end
445
+
446
+ hash[param] = _to_hash(value)
447
+ end
448
+ hash
449
+ end
450
+
451
+ end
452
+
453
+ end