pingram 1.0.31 → 1.0.32

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 (56) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +2 -2
  3. data/lib/pingram/api/broadcasts_api.rb +912 -0
  4. data/lib/pingram/api/library_api.rb +161 -0
  5. data/lib/pingram/api_client.rb +1 -1
  6. data/lib/pingram/client_wrapper.rb +20 -0
  7. data/lib/pingram/models/broadcast_metrics_response.rb +480 -0
  8. data/lib/pingram/models/broadcast_response.rb +525 -0
  9. data/lib/pingram/models/broadcast_response_audience.rb +161 -0
  10. data/lib/pingram/models/create_broadcast_request.rb +366 -0
  11. data/lib/pingram/models/create_library_request.rb +192 -0
  12. data/lib/pingram/models/create_library_response.rb +346 -0
  13. data/lib/pingram/models/get_users_response_users_inner.rb +13 -1
  14. data/lib/pingram/models/get_users_response_users_inner_properties_value.rb +104 -0
  15. data/lib/pingram/models/list_broadcast_recipients_response.rb +175 -0
  16. data/lib/pingram/models/list_broadcast_recipients_response_recipients_inner.rb +324 -0
  17. data/lib/pingram/models/list_broadcasts_response.rb +175 -0
  18. data/lib/pingram/models/list_broadcasts_response_broadcasts_inner.rb +487 -0
  19. data/lib/pingram/models/list_library_response.rb +175 -0
  20. data/lib/pingram/models/list_library_response_items_inner.rb +344 -0
  21. data/lib/pingram/models/logs_get_response_logs_inner.rb +4 -4
  22. data/lib/pingram/models/mfa_status_response.rb +1 -1
  23. data/lib/pingram/models/post_user_request.rb +16 -4
  24. data/lib/pingram/models/schedule_broadcast_request.rb +165 -0
  25. data/lib/pingram/models/sender_post_body_to.rb +13 -1
  26. data/lib/pingram/models/sender_post_body_user.rb +13 -1
  27. data/lib/pingram/models/update_broadcast_request.rb +264 -0
  28. data/lib/pingram/models/user.rb +13 -1
  29. data/lib/pingram/version.rb +1 -1
  30. data/lib/pingram.rb +17 -0
  31. data/vendor/bundle/ruby/3.2.0/cache/io-console-0.9.3.gem +0 -0
  32. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/byebug-13.0.0/gem_make.out +5 -5
  33. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/date-3.5.1/gem_make.out +5 -5
  34. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/{io-console-0.9.2 → io-console-0.9.3}/gem_make.out +11 -10
  35. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/io-console-0.9.3/io/console.so +0 -0
  36. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/{io-console-0.9.2 → io-console-0.9.3}/mkmf.log +10 -6
  37. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/jaro_winkler-1.5.6/gem_make.out +5 -5
  38. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/psych-5.5.0/gem_make.out +5 -5
  39. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/racc-1.8.1/gem_make.out +5 -5
  40. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/stringio-3.2.0/gem_make.out +5 -5
  41. data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.2 → io-console-0.9.3}/ext/io/console/Makefile +2 -2
  42. data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.2 → io-console-0.9.3}/ext/io/console/console.c +98 -13
  43. data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.2 → io-console-0.9.3}/ext/io/console/extconf.rb +15 -1
  44. data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.2 → io-console-0.9.3}/lib/io/console/size.rb +4 -2
  45. data/vendor/bundle/ruby/3.2.0/gems/io-console-0.9.3/lib/io/console.so +0 -0
  46. data/vendor/bundle/ruby/3.2.0/specifications/{io-console-0.9.2.gemspec → io-console-0.9.3.gemspec} +3 -3
  47. metadata +35 -18
  48. data/vendor/bundle/ruby/3.2.0/cache/io-console-0.9.2.gem +0 -0
  49. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/io-console-0.9.2/io/console.so +0 -0
  50. data/vendor/bundle/ruby/3.2.0/gems/io-console-0.9.2/lib/io/console.so +0 -0
  51. /data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/{io-console-0.9.2 → io-console-0.9.3}/gem.build_complete +0 -0
  52. /data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.2 → io-console-0.9.3}/.document +0 -0
  53. /data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.2 → io-console-0.9.3}/BSDL +0 -0
  54. /data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.2 → io-console-0.9.3}/COPYING +0 -0
  55. /data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.2 → io-console-0.9.3}/README.md +0 -0
  56. /data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.2 → io-console-0.9.3}/ext/io/console/win32_vk.inc +0 -0
@@ -0,0 +1,487 @@
1
+ =begin
2
+ #Pingram
3
+
4
+ #Internal API for notification delivery and management
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
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 Pingram
17
+ class ListBroadcastsResponseBroadcastsInner < ApiModelBase
18
+ # UUIDv7 (time-ordered).
19
+ attr_accessor :broadcast_id
20
+
21
+ attr_accessor :name
22
+
23
+ # Lifecycle status of an email broadcast.
24
+ attr_accessor :status
25
+
26
+ attr_accessor :paused_reason
27
+
28
+ # Notification type id. Required before send or schedule.
29
+ attr_accessor :type
30
+
31
+ # Email-only in v1; forward-compatible field.
32
+ attr_accessor :channel
33
+
34
+ attr_accessor :audience
35
+
36
+ attr_accessor :from_name
37
+
38
+ attr_accessor :from_address
39
+
40
+ attr_accessor :reply_to_address
41
+
42
+ attr_accessor :subject
43
+
44
+ # ISO datetime for scheduled broadcasts.
45
+ attr_accessor :schedule_at
46
+
47
+ # Set when the user archives the broadcast; hidden from the default list.
48
+ attr_accessor :archived_at
49
+
50
+ attr_accessor :created_at
51
+
52
+ attr_accessor :updated_at
53
+
54
+ class EnumAttributeValidator
55
+ attr_reader :datatype
56
+ attr_reader :allowable_values
57
+
58
+ def initialize(datatype, allowable_values)
59
+ @allowable_values = allowable_values.map do |value|
60
+ case datatype.to_s
61
+ when /Integer/i
62
+ value.to_i
63
+ when /Float/i
64
+ value.to_f
65
+ else
66
+ value
67
+ end
68
+ end
69
+ end
70
+
71
+ def valid?(value)
72
+ !value || allowable_values.include?(value)
73
+ end
74
+ end
75
+
76
+ # Attribute mapping from ruby-style variable name to JSON key.
77
+ def self.attribute_map
78
+ {
79
+ :'broadcast_id' => :'broadcastId',
80
+ :'name' => :'name',
81
+ :'status' => :'status',
82
+ :'paused_reason' => :'pausedReason',
83
+ :'type' => :'type',
84
+ :'channel' => :'channel',
85
+ :'audience' => :'audience',
86
+ :'from_name' => :'fromName',
87
+ :'from_address' => :'fromAddress',
88
+ :'reply_to_address' => :'replyToAddress',
89
+ :'subject' => :'subject',
90
+ :'schedule_at' => :'scheduleAt',
91
+ :'archived_at' => :'archivedAt',
92
+ :'created_at' => :'createdAt',
93
+ :'updated_at' => :'updatedAt'
94
+ }
95
+ end
96
+
97
+ # Returns attribute mapping this model knows about
98
+ def self.acceptable_attribute_map
99
+ attribute_map
100
+ end
101
+
102
+ # Returns all the JSON keys this model knows about
103
+ def self.acceptable_attributes
104
+ acceptable_attribute_map.values
105
+ end
106
+
107
+ # Attribute type mapping.
108
+ def self.openapi_types
109
+ {
110
+ :'broadcast_id' => :'String',
111
+ :'name' => :'String',
112
+ :'status' => :'String',
113
+ :'paused_reason' => :'String',
114
+ :'type' => :'String',
115
+ :'channel' => :'String',
116
+ :'audience' => :'BroadcastResponseAudience',
117
+ :'from_name' => :'String',
118
+ :'from_address' => :'String',
119
+ :'reply_to_address' => :'String',
120
+ :'subject' => :'String',
121
+ :'schedule_at' => :'String',
122
+ :'archived_at' => :'String',
123
+ :'created_at' => :'String',
124
+ :'updated_at' => :'String'
125
+ }
126
+ end
127
+
128
+ # List of attributes with nullable: true
129
+ def self.openapi_nullable
130
+ Set.new([
131
+ ])
132
+ end
133
+
134
+ # Initializes the object
135
+ # @param [Hash] attributes Model attributes in the form of hash
136
+ def initialize(attributes = {})
137
+ if (!attributes.is_a?(Hash))
138
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Pingram::ListBroadcastsResponseBroadcastsInner` initialize method"
139
+ end
140
+
141
+ # check to see if the attribute exists and convert string to symbol for hash key
142
+ acceptable_attribute_map = self.class.acceptable_attribute_map
143
+ attributes = attributes.each_with_object({}) { |(k, v), h|
144
+ if (!acceptable_attribute_map.key?(k.to_sym))
145
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Pingram::ListBroadcastsResponseBroadcastsInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
146
+ end
147
+ h[k.to_sym] = v
148
+ }
149
+
150
+ if attributes.key?(:'broadcast_id')
151
+ self.broadcast_id = attributes[:'broadcast_id']
152
+ else
153
+ self.broadcast_id = nil
154
+ end
155
+
156
+ if attributes.key?(:'name')
157
+ self.name = attributes[:'name']
158
+ else
159
+ self.name = nil
160
+ end
161
+
162
+ if attributes.key?(:'status')
163
+ self.status = attributes[:'status']
164
+ else
165
+ self.status = nil
166
+ end
167
+
168
+ if attributes.key?(:'paused_reason')
169
+ self.paused_reason = attributes[:'paused_reason']
170
+ end
171
+
172
+ if attributes.key?(:'type')
173
+ self.type = attributes[:'type']
174
+ end
175
+
176
+ if attributes.key?(:'channel')
177
+ self.channel = attributes[:'channel']
178
+ else
179
+ self.channel = nil
180
+ end
181
+
182
+ if attributes.key?(:'audience')
183
+ self.audience = attributes[:'audience']
184
+ else
185
+ self.audience = nil
186
+ end
187
+
188
+ if attributes.key?(:'from_name')
189
+ self.from_name = attributes[:'from_name']
190
+ else
191
+ self.from_name = nil
192
+ end
193
+
194
+ if attributes.key?(:'from_address')
195
+ self.from_address = attributes[:'from_address']
196
+ else
197
+ self.from_address = nil
198
+ end
199
+
200
+ if attributes.key?(:'reply_to_address')
201
+ self.reply_to_address = attributes[:'reply_to_address']
202
+ end
203
+
204
+ if attributes.key?(:'subject')
205
+ self.subject = attributes[:'subject']
206
+ else
207
+ self.subject = nil
208
+ end
209
+
210
+ if attributes.key?(:'schedule_at')
211
+ self.schedule_at = attributes[:'schedule_at']
212
+ end
213
+
214
+ if attributes.key?(:'archived_at')
215
+ self.archived_at = attributes[:'archived_at']
216
+ end
217
+
218
+ if attributes.key?(:'created_at')
219
+ self.created_at = attributes[:'created_at']
220
+ else
221
+ self.created_at = nil
222
+ end
223
+
224
+ if attributes.key?(:'updated_at')
225
+ self.updated_at = attributes[:'updated_at']
226
+ else
227
+ self.updated_at = nil
228
+ end
229
+ end
230
+
231
+ # Show invalid properties with the reasons. Usually used together with valid?
232
+ # @return Array for valid properties with the reasons
233
+ def list_invalid_properties
234
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
235
+ invalid_properties = Array.new
236
+ if @broadcast_id.nil?
237
+ invalid_properties.push('invalid value for "broadcast_id", broadcast_id cannot be nil.')
238
+ end
239
+
240
+ if @name.nil?
241
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
242
+ end
243
+
244
+ if @status.nil?
245
+ invalid_properties.push('invalid value for "status", status cannot be nil.')
246
+ end
247
+
248
+ if @channel.nil?
249
+ invalid_properties.push('invalid value for "channel", channel cannot be nil.')
250
+ end
251
+
252
+ if @audience.nil?
253
+ invalid_properties.push('invalid value for "audience", audience cannot be nil.')
254
+ end
255
+
256
+ if @from_name.nil?
257
+ invalid_properties.push('invalid value for "from_name", from_name cannot be nil.')
258
+ end
259
+
260
+ if @from_address.nil?
261
+ invalid_properties.push('invalid value for "from_address", from_address cannot be nil.')
262
+ end
263
+
264
+ if @subject.nil?
265
+ invalid_properties.push('invalid value for "subject", subject cannot be nil.')
266
+ end
267
+
268
+ if @created_at.nil?
269
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
270
+ end
271
+
272
+ if @updated_at.nil?
273
+ invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
274
+ end
275
+
276
+ invalid_properties
277
+ end
278
+
279
+ # Check to see if the all the properties in the model are valid
280
+ # @return true if the model is valid
281
+ def valid?
282
+ warn '[DEPRECATED] the `valid?` method is obsolete'
283
+ return false if @broadcast_id.nil?
284
+ return false if @name.nil?
285
+ return false if @status.nil?
286
+ status_validator = EnumAttributeValidator.new('String', ["draft", "scheduled", "sending", "sent", "paused", "canceled"])
287
+ return false unless status_validator.valid?(@status)
288
+ paused_reason_validator = EnumAttributeValidator.new('String', ["PAUSED_BY_USER", "REPUTATION_GUARD", "PLAN_EXCEEDED", "PENDING_VERIFICATION", "AUDIENCE_LIMITS_EXCEEDED", "UNVERIFIED_DOMAIN", "SPAM_CONTENT"])
289
+ return false unless paused_reason_validator.valid?(@paused_reason)
290
+ return false if @channel.nil?
291
+ channel_validator = EnumAttributeValidator.new('String', ["email"])
292
+ return false unless channel_validator.valid?(@channel)
293
+ return false if @audience.nil?
294
+ return false if @from_name.nil?
295
+ return false if @from_address.nil?
296
+ return false if @subject.nil?
297
+ return false if @created_at.nil?
298
+ return false if @updated_at.nil?
299
+ true
300
+ end
301
+
302
+ # Custom attribute writer method with validation
303
+ # @param [Object] broadcast_id Value to be assigned
304
+ def broadcast_id=(broadcast_id)
305
+ if broadcast_id.nil?
306
+ fail ArgumentError, 'broadcast_id cannot be nil'
307
+ end
308
+
309
+ @broadcast_id = broadcast_id
310
+ end
311
+
312
+ # Custom attribute writer method with validation
313
+ # @param [Object] name Value to be assigned
314
+ def name=(name)
315
+ if name.nil?
316
+ fail ArgumentError, 'name cannot be nil'
317
+ end
318
+
319
+ @name = name
320
+ end
321
+
322
+ # Custom attribute writer method checking allowed values (enum).
323
+ # @param [Object] status Object to be assigned
324
+ def status=(status)
325
+ validator = EnumAttributeValidator.new('String', ["draft", "scheduled", "sending", "sent", "paused", "canceled"])
326
+ unless validator.valid?(status)
327
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
328
+ end
329
+ @status = status
330
+ end
331
+
332
+ # Custom attribute writer method checking allowed values (enum).
333
+ # @param [Object] paused_reason Object to be assigned
334
+ def paused_reason=(paused_reason)
335
+ validator = EnumAttributeValidator.new('String', ["PAUSED_BY_USER", "REPUTATION_GUARD", "PLAN_EXCEEDED", "PENDING_VERIFICATION", "AUDIENCE_LIMITS_EXCEEDED", "UNVERIFIED_DOMAIN", "SPAM_CONTENT"])
336
+ unless validator.valid?(paused_reason)
337
+ fail ArgumentError, "invalid value for \"paused_reason\", must be one of #{validator.allowable_values}."
338
+ end
339
+ @paused_reason = paused_reason
340
+ end
341
+
342
+ # Custom attribute writer method checking allowed values (enum).
343
+ # @param [Object] channel Object to be assigned
344
+ def channel=(channel)
345
+ validator = EnumAttributeValidator.new('String', ["email"])
346
+ unless validator.valid?(channel)
347
+ fail ArgumentError, "invalid value for \"channel\", must be one of #{validator.allowable_values}."
348
+ end
349
+ @channel = channel
350
+ end
351
+
352
+ # Custom attribute writer method with validation
353
+ # @param [Object] audience Value to be assigned
354
+ def audience=(audience)
355
+ if audience.nil?
356
+ fail ArgumentError, 'audience cannot be nil'
357
+ end
358
+
359
+ @audience = audience
360
+ end
361
+
362
+ # Custom attribute writer method with validation
363
+ # @param [Object] from_name Value to be assigned
364
+ def from_name=(from_name)
365
+ if from_name.nil?
366
+ fail ArgumentError, 'from_name cannot be nil'
367
+ end
368
+
369
+ @from_name = from_name
370
+ end
371
+
372
+ # Custom attribute writer method with validation
373
+ # @param [Object] from_address Value to be assigned
374
+ def from_address=(from_address)
375
+ if from_address.nil?
376
+ fail ArgumentError, 'from_address cannot be nil'
377
+ end
378
+
379
+ @from_address = from_address
380
+ end
381
+
382
+ # Custom attribute writer method with validation
383
+ # @param [Object] subject Value to be assigned
384
+ def subject=(subject)
385
+ if subject.nil?
386
+ fail ArgumentError, 'subject cannot be nil'
387
+ end
388
+
389
+ @subject = subject
390
+ end
391
+
392
+ # Custom attribute writer method with validation
393
+ # @param [Object] created_at Value to be assigned
394
+ def created_at=(created_at)
395
+ if created_at.nil?
396
+ fail ArgumentError, 'created_at cannot be nil'
397
+ end
398
+
399
+ @created_at = created_at
400
+ end
401
+
402
+ # Custom attribute writer method with validation
403
+ # @param [Object] updated_at Value to be assigned
404
+ def updated_at=(updated_at)
405
+ if updated_at.nil?
406
+ fail ArgumentError, 'updated_at cannot be nil'
407
+ end
408
+
409
+ @updated_at = updated_at
410
+ end
411
+
412
+ # Checks equality by comparing each attribute.
413
+ # @param [Object] Object to be compared
414
+ def ==(o)
415
+ return true if self.equal?(o)
416
+ self.class == o.class &&
417
+ broadcast_id == o.broadcast_id &&
418
+ name == o.name &&
419
+ status == o.status &&
420
+ paused_reason == o.paused_reason &&
421
+ type == o.type &&
422
+ channel == o.channel &&
423
+ audience == o.audience &&
424
+ from_name == o.from_name &&
425
+ from_address == o.from_address &&
426
+ reply_to_address == o.reply_to_address &&
427
+ subject == o.subject &&
428
+ schedule_at == o.schedule_at &&
429
+ archived_at == o.archived_at &&
430
+ created_at == o.created_at &&
431
+ updated_at == o.updated_at
432
+ end
433
+
434
+ # @see the `==` method
435
+ # @param [Object] Object to be compared
436
+ def eql?(o)
437
+ self == o
438
+ end
439
+
440
+ # Calculates hash code according to all attributes.
441
+ # @return [Integer] Hash code
442
+ def hash
443
+ [broadcast_id, name, status, paused_reason, type, channel, audience, from_name, from_address, reply_to_address, subject, schedule_at, archived_at, created_at, updated_at].hash
444
+ end
445
+
446
+ # Builds the object from hash
447
+ # @param [Hash] attributes Model attributes in the form of hash
448
+ # @return [Object] Returns the model itself
449
+ def self.build_from_hash(attributes)
450
+ return nil unless attributes.is_a?(Hash)
451
+ attributes = attributes.transform_keys(&:to_sym)
452
+ transformed_hash = {}
453
+ openapi_types.each_pair do |key, type|
454
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
455
+ transformed_hash["#{key}"] = nil
456
+ elsif type =~ /\AArray<(.*)>/i
457
+ # check to ensure the input is an array given that the attribute
458
+ # is documented as an array but the input is not
459
+ if attributes[attribute_map[key]].is_a?(Array)
460
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
461
+ end
462
+ elsif !attributes[attribute_map[key]].nil?
463
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
464
+ end
465
+ end
466
+ new(transformed_hash)
467
+ end
468
+
469
+ # Returns the object in the form of hash
470
+ # @return [Hash] Returns the object in the form of hash
471
+ def to_hash
472
+ hash = {}
473
+ self.class.attribute_map.each_pair do |attr, param|
474
+ value = self.send(attr)
475
+ if value.nil?
476
+ is_nullable = self.class.openapi_nullable.include?(attr)
477
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
478
+ end
479
+
480
+ hash[param] = _to_hash(value)
481
+ end
482
+ hash
483
+ end
484
+
485
+ end
486
+
487
+ end
@@ -0,0 +1,175 @@
1
+ =begin
2
+ #Pingram
3
+
4
+ #Internal API for notification delivery and management
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
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 Pingram
17
+ class ListLibraryResponse < ApiModelBase
18
+ attr_accessor :items
19
+
20
+ attr_accessor :next_token
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'items' => :'items',
26
+ :'next_token' => :'nextToken'
27
+ }
28
+ end
29
+
30
+ # Returns attribute mapping this model knows about
31
+ def self.acceptable_attribute_map
32
+ attribute_map
33
+ end
34
+
35
+ # Returns all the JSON keys this model knows about
36
+ def self.acceptable_attributes
37
+ acceptable_attribute_map.values
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.openapi_types
42
+ {
43
+ :'items' => :'Array<ListLibraryResponseItemsInner>',
44
+ :'next_token' => :'String'
45
+ }
46
+ end
47
+
48
+ # List of attributes with nullable: true
49
+ def self.openapi_nullable
50
+ Set.new([
51
+ ])
52
+ end
53
+
54
+ # Initializes the object
55
+ # @param [Hash] attributes Model attributes in the form of hash
56
+ def initialize(attributes = {})
57
+ if (!attributes.is_a?(Hash))
58
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Pingram::ListLibraryResponse` initialize method"
59
+ end
60
+
61
+ # check to see if the attribute exists and convert string to symbol for hash key
62
+ acceptable_attribute_map = self.class.acceptable_attribute_map
63
+ attributes = attributes.each_with_object({}) { |(k, v), h|
64
+ if (!acceptable_attribute_map.key?(k.to_sym))
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Pingram::ListLibraryResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
66
+ end
67
+ h[k.to_sym] = v
68
+ }
69
+
70
+ if attributes.key?(:'items')
71
+ if (value = attributes[:'items']).is_a?(Array)
72
+ self.items = value
73
+ end
74
+ else
75
+ self.items = nil
76
+ end
77
+
78
+ if attributes.key?(:'next_token')
79
+ self.next_token = attributes[:'next_token']
80
+ end
81
+ end
82
+
83
+ # Show invalid properties with the reasons. Usually used together with valid?
84
+ # @return Array for valid properties with the reasons
85
+ def list_invalid_properties
86
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
87
+ invalid_properties = Array.new
88
+ if @items.nil?
89
+ invalid_properties.push('invalid value for "items", items cannot be nil.')
90
+ end
91
+
92
+ invalid_properties
93
+ end
94
+
95
+ # Check to see if the all the properties in the model are valid
96
+ # @return true if the model is valid
97
+ def valid?
98
+ warn '[DEPRECATED] the `valid?` method is obsolete'
99
+ return false if @items.nil?
100
+ true
101
+ end
102
+
103
+ # Custom attribute writer method with validation
104
+ # @param [Object] items Value to be assigned
105
+ def items=(items)
106
+ if items.nil?
107
+ fail ArgumentError, 'items cannot be nil'
108
+ end
109
+
110
+ @items = items
111
+ end
112
+
113
+ # Checks equality by comparing each attribute.
114
+ # @param [Object] Object to be compared
115
+ def ==(o)
116
+ return true if self.equal?(o)
117
+ self.class == o.class &&
118
+ items == o.items &&
119
+ next_token == o.next_token
120
+ end
121
+
122
+ # @see the `==` method
123
+ # @param [Object] Object to be compared
124
+ def eql?(o)
125
+ self == o
126
+ end
127
+
128
+ # Calculates hash code according to all attributes.
129
+ # @return [Integer] Hash code
130
+ def hash
131
+ [items, next_token].hash
132
+ end
133
+
134
+ # Builds the object from hash
135
+ # @param [Hash] attributes Model attributes in the form of hash
136
+ # @return [Object] Returns the model itself
137
+ def self.build_from_hash(attributes)
138
+ return nil unless attributes.is_a?(Hash)
139
+ attributes = attributes.transform_keys(&:to_sym)
140
+ transformed_hash = {}
141
+ openapi_types.each_pair do |key, type|
142
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
143
+ transformed_hash["#{key}"] = nil
144
+ elsif type =~ /\AArray<(.*)>/i
145
+ # check to ensure the input is an array given that the attribute
146
+ # is documented as an array but the input is not
147
+ if attributes[attribute_map[key]].is_a?(Array)
148
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
149
+ end
150
+ elsif !attributes[attribute_map[key]].nil?
151
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
152
+ end
153
+ end
154
+ new(transformed_hash)
155
+ end
156
+
157
+ # Returns the object in the form of hash
158
+ # @return [Hash] Returns the object in the form of hash
159
+ def to_hash
160
+ hash = {}
161
+ self.class.attribute_map.each_pair do |attr, param|
162
+ value = self.send(attr)
163
+ if value.nil?
164
+ is_nullable = self.class.openapi_nullable.include?(attr)
165
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
166
+ end
167
+
168
+ hash[param] = _to_hash(value)
169
+ end
170
+ hash
171
+ end
172
+
173
+ end
174
+
175
+ end