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,525 @@
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
+ # Broadcast as returned by the API (html + optional internalTemplate on single-get only).
18
+ class BroadcastResponse < ApiModelBase
19
+ # UUIDv7 (time-ordered).
20
+ attr_accessor :broadcast_id
21
+
22
+ attr_accessor :name
23
+
24
+ # Lifecycle status of an email broadcast.
25
+ attr_accessor :status
26
+
27
+ attr_accessor :paused_reason
28
+
29
+ # Notification type id. Required before send or schedule.
30
+ attr_accessor :type
31
+
32
+ # Email-only in v1; forward-compatible field.
33
+ attr_accessor :channel
34
+
35
+ attr_accessor :audience
36
+
37
+ attr_accessor :from_name
38
+
39
+ attr_accessor :from_address
40
+
41
+ attr_accessor :reply_to_address
42
+
43
+ attr_accessor :subject
44
+
45
+ # Send-ready HTML body.
46
+ attr_accessor :html
47
+
48
+ # Optional visual-editor source. Can only be set at create time and must stay paired with html.
49
+ attr_accessor :internal_template
50
+
51
+ # ISO datetime for scheduled broadcasts.
52
+ attr_accessor :schedule_at
53
+
54
+ # Set when the user archives the broadcast; hidden from the default list.
55
+ attr_accessor :archived_at
56
+
57
+ attr_accessor :created_at
58
+
59
+ attr_accessor :updated_at
60
+
61
+ class EnumAttributeValidator
62
+ attr_reader :datatype
63
+ attr_reader :allowable_values
64
+
65
+ def initialize(datatype, allowable_values)
66
+ @allowable_values = allowable_values.map do |value|
67
+ case datatype.to_s
68
+ when /Integer/i
69
+ value.to_i
70
+ when /Float/i
71
+ value.to_f
72
+ else
73
+ value
74
+ end
75
+ end
76
+ end
77
+
78
+ def valid?(value)
79
+ !value || allowable_values.include?(value)
80
+ end
81
+ end
82
+
83
+ # Attribute mapping from ruby-style variable name to JSON key.
84
+ def self.attribute_map
85
+ {
86
+ :'broadcast_id' => :'broadcastId',
87
+ :'name' => :'name',
88
+ :'status' => :'status',
89
+ :'paused_reason' => :'pausedReason',
90
+ :'type' => :'type',
91
+ :'channel' => :'channel',
92
+ :'audience' => :'audience',
93
+ :'from_name' => :'fromName',
94
+ :'from_address' => :'fromAddress',
95
+ :'reply_to_address' => :'replyToAddress',
96
+ :'subject' => :'subject',
97
+ :'html' => :'html',
98
+ :'internal_template' => :'internalTemplate',
99
+ :'schedule_at' => :'scheduleAt',
100
+ :'archived_at' => :'archivedAt',
101
+ :'created_at' => :'createdAt',
102
+ :'updated_at' => :'updatedAt'
103
+ }
104
+ end
105
+
106
+ # Returns attribute mapping this model knows about
107
+ def self.acceptable_attribute_map
108
+ attribute_map
109
+ end
110
+
111
+ # Returns all the JSON keys this model knows about
112
+ def self.acceptable_attributes
113
+ acceptable_attribute_map.values
114
+ end
115
+
116
+ # Attribute type mapping.
117
+ def self.openapi_types
118
+ {
119
+ :'broadcast_id' => :'String',
120
+ :'name' => :'String',
121
+ :'status' => :'String',
122
+ :'paused_reason' => :'String',
123
+ :'type' => :'String',
124
+ :'channel' => :'String',
125
+ :'audience' => :'BroadcastResponseAudience',
126
+ :'from_name' => :'String',
127
+ :'from_address' => :'String',
128
+ :'reply_to_address' => :'String',
129
+ :'subject' => :'String',
130
+ :'html' => :'String',
131
+ :'internal_template' => :'String',
132
+ :'schedule_at' => :'String',
133
+ :'archived_at' => :'String',
134
+ :'created_at' => :'String',
135
+ :'updated_at' => :'String'
136
+ }
137
+ end
138
+
139
+ # List of attributes with nullable: true
140
+ def self.openapi_nullable
141
+ Set.new([
142
+ ])
143
+ end
144
+
145
+ # Initializes the object
146
+ # @param [Hash] attributes Model attributes in the form of hash
147
+ def initialize(attributes = {})
148
+ if (!attributes.is_a?(Hash))
149
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Pingram::BroadcastResponse` initialize method"
150
+ end
151
+
152
+ # check to see if the attribute exists and convert string to symbol for hash key
153
+ acceptable_attribute_map = self.class.acceptable_attribute_map
154
+ attributes = attributes.each_with_object({}) { |(k, v), h|
155
+ if (!acceptable_attribute_map.key?(k.to_sym))
156
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Pingram::BroadcastResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
157
+ end
158
+ h[k.to_sym] = v
159
+ }
160
+
161
+ if attributes.key?(:'broadcast_id')
162
+ self.broadcast_id = attributes[:'broadcast_id']
163
+ else
164
+ self.broadcast_id = nil
165
+ end
166
+
167
+ if attributes.key?(:'name')
168
+ self.name = attributes[:'name']
169
+ else
170
+ self.name = nil
171
+ end
172
+
173
+ if attributes.key?(:'status')
174
+ self.status = attributes[:'status']
175
+ else
176
+ self.status = nil
177
+ end
178
+
179
+ if attributes.key?(:'paused_reason')
180
+ self.paused_reason = attributes[:'paused_reason']
181
+ end
182
+
183
+ if attributes.key?(:'type')
184
+ self.type = attributes[:'type']
185
+ end
186
+
187
+ if attributes.key?(:'channel')
188
+ self.channel = attributes[:'channel']
189
+ else
190
+ self.channel = nil
191
+ end
192
+
193
+ if attributes.key?(:'audience')
194
+ self.audience = attributes[:'audience']
195
+ else
196
+ self.audience = nil
197
+ end
198
+
199
+ if attributes.key?(:'from_name')
200
+ self.from_name = attributes[:'from_name']
201
+ else
202
+ self.from_name = nil
203
+ end
204
+
205
+ if attributes.key?(:'from_address')
206
+ self.from_address = attributes[:'from_address']
207
+ else
208
+ self.from_address = nil
209
+ end
210
+
211
+ if attributes.key?(:'reply_to_address')
212
+ self.reply_to_address = attributes[:'reply_to_address']
213
+ end
214
+
215
+ if attributes.key?(:'subject')
216
+ self.subject = attributes[:'subject']
217
+ else
218
+ self.subject = nil
219
+ end
220
+
221
+ if attributes.key?(:'html')
222
+ self.html = attributes[:'html']
223
+ else
224
+ self.html = nil
225
+ end
226
+
227
+ if attributes.key?(:'internal_template')
228
+ self.internal_template = attributes[:'internal_template']
229
+ end
230
+
231
+ if attributes.key?(:'schedule_at')
232
+ self.schedule_at = attributes[:'schedule_at']
233
+ end
234
+
235
+ if attributes.key?(:'archived_at')
236
+ self.archived_at = attributes[:'archived_at']
237
+ end
238
+
239
+ if attributes.key?(:'created_at')
240
+ self.created_at = attributes[:'created_at']
241
+ else
242
+ self.created_at = nil
243
+ end
244
+
245
+ if attributes.key?(:'updated_at')
246
+ self.updated_at = attributes[:'updated_at']
247
+ else
248
+ self.updated_at = nil
249
+ end
250
+ end
251
+
252
+ # Show invalid properties with the reasons. Usually used together with valid?
253
+ # @return Array for valid properties with the reasons
254
+ def list_invalid_properties
255
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
256
+ invalid_properties = Array.new
257
+ if @broadcast_id.nil?
258
+ invalid_properties.push('invalid value for "broadcast_id", broadcast_id cannot be nil.')
259
+ end
260
+
261
+ if @name.nil?
262
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
263
+ end
264
+
265
+ if @status.nil?
266
+ invalid_properties.push('invalid value for "status", status cannot be nil.')
267
+ end
268
+
269
+ if @channel.nil?
270
+ invalid_properties.push('invalid value for "channel", channel cannot be nil.')
271
+ end
272
+
273
+ if @audience.nil?
274
+ invalid_properties.push('invalid value for "audience", audience cannot be nil.')
275
+ end
276
+
277
+ if @from_name.nil?
278
+ invalid_properties.push('invalid value for "from_name", from_name cannot be nil.')
279
+ end
280
+
281
+ if @from_address.nil?
282
+ invalid_properties.push('invalid value for "from_address", from_address cannot be nil.')
283
+ end
284
+
285
+ if @subject.nil?
286
+ invalid_properties.push('invalid value for "subject", subject cannot be nil.')
287
+ end
288
+
289
+ if @html.nil?
290
+ invalid_properties.push('invalid value for "html", html cannot be nil.')
291
+ end
292
+
293
+ if @created_at.nil?
294
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
295
+ end
296
+
297
+ if @updated_at.nil?
298
+ invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
299
+ end
300
+
301
+ invalid_properties
302
+ end
303
+
304
+ # Check to see if the all the properties in the model are valid
305
+ # @return true if the model is valid
306
+ def valid?
307
+ warn '[DEPRECATED] the `valid?` method is obsolete'
308
+ return false if @broadcast_id.nil?
309
+ return false if @name.nil?
310
+ return false if @status.nil?
311
+ status_validator = EnumAttributeValidator.new('String', ["draft", "scheduled", "sending", "sent", "paused", "canceled"])
312
+ return false unless status_validator.valid?(@status)
313
+ paused_reason_validator = EnumAttributeValidator.new('String', ["PAUSED_BY_USER", "REPUTATION_GUARD", "PLAN_EXCEEDED", "PENDING_VERIFICATION", "AUDIENCE_LIMITS_EXCEEDED", "UNVERIFIED_DOMAIN", "SPAM_CONTENT"])
314
+ return false unless paused_reason_validator.valid?(@paused_reason)
315
+ return false if @channel.nil?
316
+ channel_validator = EnumAttributeValidator.new('String', ["email"])
317
+ return false unless channel_validator.valid?(@channel)
318
+ return false if @audience.nil?
319
+ return false if @from_name.nil?
320
+ return false if @from_address.nil?
321
+ return false if @subject.nil?
322
+ return false if @html.nil?
323
+ return false if @created_at.nil?
324
+ return false if @updated_at.nil?
325
+ true
326
+ end
327
+
328
+ # Custom attribute writer method with validation
329
+ # @param [Object] broadcast_id Value to be assigned
330
+ def broadcast_id=(broadcast_id)
331
+ if broadcast_id.nil?
332
+ fail ArgumentError, 'broadcast_id cannot be nil'
333
+ end
334
+
335
+ @broadcast_id = broadcast_id
336
+ end
337
+
338
+ # Custom attribute writer method with validation
339
+ # @param [Object] name Value to be assigned
340
+ def name=(name)
341
+ if name.nil?
342
+ fail ArgumentError, 'name cannot be nil'
343
+ end
344
+
345
+ @name = name
346
+ end
347
+
348
+ # Custom attribute writer method checking allowed values (enum).
349
+ # @param [Object] status Object to be assigned
350
+ def status=(status)
351
+ validator = EnumAttributeValidator.new('String', ["draft", "scheduled", "sending", "sent", "paused", "canceled"])
352
+ unless validator.valid?(status)
353
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
354
+ end
355
+ @status = status
356
+ end
357
+
358
+ # Custom attribute writer method checking allowed values (enum).
359
+ # @param [Object] paused_reason Object to be assigned
360
+ def paused_reason=(paused_reason)
361
+ validator = EnumAttributeValidator.new('String', ["PAUSED_BY_USER", "REPUTATION_GUARD", "PLAN_EXCEEDED", "PENDING_VERIFICATION", "AUDIENCE_LIMITS_EXCEEDED", "UNVERIFIED_DOMAIN", "SPAM_CONTENT"])
362
+ unless validator.valid?(paused_reason)
363
+ fail ArgumentError, "invalid value for \"paused_reason\", must be one of #{validator.allowable_values}."
364
+ end
365
+ @paused_reason = paused_reason
366
+ end
367
+
368
+ # Custom attribute writer method checking allowed values (enum).
369
+ # @param [Object] channel Object to be assigned
370
+ def channel=(channel)
371
+ validator = EnumAttributeValidator.new('String', ["email"])
372
+ unless validator.valid?(channel)
373
+ fail ArgumentError, "invalid value for \"channel\", must be one of #{validator.allowable_values}."
374
+ end
375
+ @channel = channel
376
+ end
377
+
378
+ # Custom attribute writer method with validation
379
+ # @param [Object] audience Value to be assigned
380
+ def audience=(audience)
381
+ if audience.nil?
382
+ fail ArgumentError, 'audience cannot be nil'
383
+ end
384
+
385
+ @audience = audience
386
+ end
387
+
388
+ # Custom attribute writer method with validation
389
+ # @param [Object] from_name Value to be assigned
390
+ def from_name=(from_name)
391
+ if from_name.nil?
392
+ fail ArgumentError, 'from_name cannot be nil'
393
+ end
394
+
395
+ @from_name = from_name
396
+ end
397
+
398
+ # Custom attribute writer method with validation
399
+ # @param [Object] from_address Value to be assigned
400
+ def from_address=(from_address)
401
+ if from_address.nil?
402
+ fail ArgumentError, 'from_address cannot be nil'
403
+ end
404
+
405
+ @from_address = from_address
406
+ end
407
+
408
+ # Custom attribute writer method with validation
409
+ # @param [Object] subject Value to be assigned
410
+ def subject=(subject)
411
+ if subject.nil?
412
+ fail ArgumentError, 'subject cannot be nil'
413
+ end
414
+
415
+ @subject = subject
416
+ end
417
+
418
+ # Custom attribute writer method with validation
419
+ # @param [Object] html Value to be assigned
420
+ def html=(html)
421
+ if html.nil?
422
+ fail ArgumentError, 'html cannot be nil'
423
+ end
424
+
425
+ @html = html
426
+ end
427
+
428
+ # Custom attribute writer method with validation
429
+ # @param [Object] created_at Value to be assigned
430
+ def created_at=(created_at)
431
+ if created_at.nil?
432
+ fail ArgumentError, 'created_at cannot be nil'
433
+ end
434
+
435
+ @created_at = created_at
436
+ end
437
+
438
+ # Custom attribute writer method with validation
439
+ # @param [Object] updated_at Value to be assigned
440
+ def updated_at=(updated_at)
441
+ if updated_at.nil?
442
+ fail ArgumentError, 'updated_at cannot be nil'
443
+ end
444
+
445
+ @updated_at = updated_at
446
+ end
447
+
448
+ # Checks equality by comparing each attribute.
449
+ # @param [Object] Object to be compared
450
+ def ==(o)
451
+ return true if self.equal?(o)
452
+ self.class == o.class &&
453
+ broadcast_id == o.broadcast_id &&
454
+ name == o.name &&
455
+ status == o.status &&
456
+ paused_reason == o.paused_reason &&
457
+ type == o.type &&
458
+ channel == o.channel &&
459
+ audience == o.audience &&
460
+ from_name == o.from_name &&
461
+ from_address == o.from_address &&
462
+ reply_to_address == o.reply_to_address &&
463
+ subject == o.subject &&
464
+ html == o.html &&
465
+ internal_template == o.internal_template &&
466
+ schedule_at == o.schedule_at &&
467
+ archived_at == o.archived_at &&
468
+ created_at == o.created_at &&
469
+ updated_at == o.updated_at
470
+ end
471
+
472
+ # @see the `==` method
473
+ # @param [Object] Object to be compared
474
+ def eql?(o)
475
+ self == o
476
+ end
477
+
478
+ # Calculates hash code according to all attributes.
479
+ # @return [Integer] Hash code
480
+ def hash
481
+ [broadcast_id, name, status, paused_reason, type, channel, audience, from_name, from_address, reply_to_address, subject, html, internal_template, schedule_at, archived_at, created_at, updated_at].hash
482
+ end
483
+
484
+ # Builds the object from hash
485
+ # @param [Hash] attributes Model attributes in the form of hash
486
+ # @return [Object] Returns the model itself
487
+ def self.build_from_hash(attributes)
488
+ return nil unless attributes.is_a?(Hash)
489
+ attributes = attributes.transform_keys(&:to_sym)
490
+ transformed_hash = {}
491
+ openapi_types.each_pair do |key, type|
492
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
493
+ transformed_hash["#{key}"] = nil
494
+ elsif type =~ /\AArray<(.*)>/i
495
+ # check to ensure the input is an array given that the attribute
496
+ # is documented as an array but the input is not
497
+ if attributes[attribute_map[key]].is_a?(Array)
498
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
499
+ end
500
+ elsif !attributes[attribute_map[key]].nil?
501
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
502
+ end
503
+ end
504
+ new(transformed_hash)
505
+ end
506
+
507
+ # Returns the object in the form of hash
508
+ # @return [Hash] Returns the object in the form of hash
509
+ def to_hash
510
+ hash = {}
511
+ self.class.attribute_map.each_pair do |attr, param|
512
+ value = self.send(attr)
513
+ if value.nil?
514
+ is_nullable = self.class.openapi_nullable.include?(attr)
515
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
516
+ end
517
+
518
+ hash[param] = _to_hash(value)
519
+ end
520
+ hash
521
+ end
522
+
523
+ end
524
+
525
+ end
@@ -0,0 +1,161 @@
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
+ # Broadcast audience: exactly one of `filter` (Mongo-style query evaluated against synced user objects) or `emails` (raw list, max 10,000 addresses; for larger audiences use filter after syncing users via the Users API).
18
+ class BroadcastResponseAudience < ApiModelBase
19
+ attr_accessor :filter
20
+
21
+ attr_accessor :emails
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'filter' => :'filter',
27
+ :'emails' => :'emails'
28
+ }
29
+ end
30
+
31
+ # Returns attribute mapping this model knows about
32
+ def self.acceptable_attribute_map
33
+ attribute_map
34
+ end
35
+
36
+ # Returns all the JSON keys this model knows about
37
+ def self.acceptable_attributes
38
+ acceptable_attribute_map.values
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.openapi_types
43
+ {
44
+ :'filter' => :'Hash<String, Object>',
45
+ :'emails' => :'Array<String>'
46
+ }
47
+ end
48
+
49
+ # List of attributes with nullable: true
50
+ def self.openapi_nullable
51
+ Set.new([
52
+ ])
53
+ end
54
+
55
+ # Initializes the object
56
+ # @param [Hash] attributes Model attributes in the form of hash
57
+ def initialize(attributes = {})
58
+ if (!attributes.is_a?(Hash))
59
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Pingram::BroadcastResponseAudience` initialize method"
60
+ end
61
+
62
+ # check to see if the attribute exists and convert string to symbol for hash key
63
+ acceptable_attribute_map = self.class.acceptable_attribute_map
64
+ attributes = attributes.each_with_object({}) { |(k, v), h|
65
+ if (!acceptable_attribute_map.key?(k.to_sym))
66
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Pingram::BroadcastResponseAudience`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
67
+ end
68
+ h[k.to_sym] = v
69
+ }
70
+
71
+ if attributes.key?(:'filter')
72
+ if (value = attributes[:'filter']).is_a?(Hash)
73
+ self.filter = value
74
+ end
75
+ end
76
+
77
+ if attributes.key?(:'emails')
78
+ if (value = attributes[:'emails']).is_a?(Array)
79
+ self.emails = value
80
+ end
81
+ end
82
+ end
83
+
84
+ # Show invalid properties with the reasons. Usually used together with valid?
85
+ # @return Array for valid properties with the reasons
86
+ def list_invalid_properties
87
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
88
+ invalid_properties = Array.new
89
+ invalid_properties
90
+ end
91
+
92
+ # Check to see if the all the properties in the model are valid
93
+ # @return true if the model is valid
94
+ def valid?
95
+ warn '[DEPRECATED] the `valid?` method is obsolete'
96
+ true
97
+ end
98
+
99
+ # Checks equality by comparing each attribute.
100
+ # @param [Object] Object to be compared
101
+ def ==(o)
102
+ return true if self.equal?(o)
103
+ self.class == o.class &&
104
+ filter == o.filter &&
105
+ emails == o.emails
106
+ end
107
+
108
+ # @see the `==` method
109
+ # @param [Object] Object to be compared
110
+ def eql?(o)
111
+ self == o
112
+ end
113
+
114
+ # Calculates hash code according to all attributes.
115
+ # @return [Integer] Hash code
116
+ def hash
117
+ [filter, emails].hash
118
+ end
119
+
120
+ # Builds the object from hash
121
+ # @param [Hash] attributes Model attributes in the form of hash
122
+ # @return [Object] Returns the model itself
123
+ def self.build_from_hash(attributes)
124
+ return nil unless attributes.is_a?(Hash)
125
+ attributes = attributes.transform_keys(&:to_sym)
126
+ transformed_hash = {}
127
+ openapi_types.each_pair do |key, type|
128
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
129
+ transformed_hash["#{key}"] = nil
130
+ elsif type =~ /\AArray<(.*)>/i
131
+ # check to ensure the input is an array given that the attribute
132
+ # is documented as an array but the input is not
133
+ if attributes[attribute_map[key]].is_a?(Array)
134
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
135
+ end
136
+ elsif !attributes[attribute_map[key]].nil?
137
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
138
+ end
139
+ end
140
+ new(transformed_hash)
141
+ end
142
+
143
+ # Returns the object in the form of hash
144
+ # @return [Hash] Returns the object in the form of hash
145
+ def to_hash
146
+ hash = {}
147
+ self.class.attribute_map.each_pair do |attr, param|
148
+ value = self.send(attr)
149
+ if value.nil?
150
+ is_nullable = self.class.openapi_nullable.include?(attr)
151
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
152
+ end
153
+
154
+ hash[param] = _to_hash(value)
155
+ end
156
+ hash
157
+ end
158
+
159
+ end
160
+
161
+ end