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.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/lib/pingram/api/broadcasts_api.rb +912 -0
- data/lib/pingram/api/library_api.rb +161 -0
- data/lib/pingram/api_client.rb +1 -1
- data/lib/pingram/client_wrapper.rb +20 -0
- data/lib/pingram/models/broadcast_metrics_response.rb +480 -0
- data/lib/pingram/models/broadcast_response.rb +525 -0
- data/lib/pingram/models/broadcast_response_audience.rb +161 -0
- data/lib/pingram/models/create_broadcast_request.rb +366 -0
- data/lib/pingram/models/create_library_request.rb +192 -0
- data/lib/pingram/models/create_library_response.rb +346 -0
- data/lib/pingram/models/get_users_response_users_inner.rb +13 -1
- data/lib/pingram/models/get_users_response_users_inner_properties_value.rb +104 -0
- data/lib/pingram/models/list_broadcast_recipients_response.rb +175 -0
- data/lib/pingram/models/list_broadcast_recipients_response_recipients_inner.rb +324 -0
- data/lib/pingram/models/list_broadcasts_response.rb +175 -0
- data/lib/pingram/models/list_broadcasts_response_broadcasts_inner.rb +487 -0
- data/lib/pingram/models/list_library_response.rb +175 -0
- data/lib/pingram/models/list_library_response_items_inner.rb +344 -0
- data/lib/pingram/models/logs_get_response_logs_inner.rb +4 -4
- data/lib/pingram/models/mfa_status_response.rb +1 -1
- data/lib/pingram/models/post_user_request.rb +16 -4
- data/lib/pingram/models/schedule_broadcast_request.rb +165 -0
- data/lib/pingram/models/sender_post_body_to.rb +13 -1
- data/lib/pingram/models/sender_post_body_user.rb +13 -1
- data/lib/pingram/models/update_broadcast_request.rb +264 -0
- data/lib/pingram/models/user.rb +13 -1
- data/lib/pingram/version.rb +1 -1
- data/lib/pingram.rb +17 -0
- data/vendor/bundle/ruby/3.2.0/cache/io-console-0.9.3.gem +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/byebug-13.0.0/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/date-3.5.1/gem_make.out +5 -5
- 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
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/io-console-0.9.3/io/console.so +0 -0
- 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
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/jaro_winkler-1.5.6/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/psych-5.5.0/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/racc-1.8.1/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/stringio-3.2.0/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.2 → io-console-0.9.3}/ext/io/console/Makefile +2 -2
- 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
- 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
- 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
- data/vendor/bundle/ruby/3.2.0/gems/io-console-0.9.3/lib/io/console.so +0 -0
- data/vendor/bundle/ruby/3.2.0/specifications/{io-console-0.9.2.gemspec → io-console-0.9.3.gemspec} +3 -3
- metadata +35 -18
- data/vendor/bundle/ruby/3.2.0/cache/io-console-0.9.2.gem +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/io-console-0.9.2/io/console.so +0 -0
- data/vendor/bundle/ruby/3.2.0/gems/io-console-0.9.2/lib/io/console.so +0 -0
- /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
- /data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.2 → io-console-0.9.3}/.document +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.2 → io-console-0.9.3}/BSDL +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.2 → io-console-0.9.3}/COPYING +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.2 → io-console-0.9.3}/README.md +0 -0
- /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,366 @@
|
|
|
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 CreateBroadcastRequest < ApiModelBase
|
|
18
|
+
attr_accessor :name
|
|
19
|
+
|
|
20
|
+
# Notification type id. Optional on create; required before send/schedule. Created on the fly when missing.
|
|
21
|
+
attr_accessor :type
|
|
22
|
+
|
|
23
|
+
attr_accessor :channel
|
|
24
|
+
|
|
25
|
+
attr_accessor :audience
|
|
26
|
+
|
|
27
|
+
attr_accessor :from_name
|
|
28
|
+
|
|
29
|
+
attr_accessor :from_address
|
|
30
|
+
|
|
31
|
+
attr_accessor :reply_to_address
|
|
32
|
+
|
|
33
|
+
attr_accessor :subject
|
|
34
|
+
|
|
35
|
+
attr_accessor :html
|
|
36
|
+
|
|
37
|
+
# Optional visual-editor source. Can only be set at create time and must stay paired with html.
|
|
38
|
+
attr_accessor :internal_template
|
|
39
|
+
|
|
40
|
+
class EnumAttributeValidator
|
|
41
|
+
attr_reader :datatype
|
|
42
|
+
attr_reader :allowable_values
|
|
43
|
+
|
|
44
|
+
def initialize(datatype, allowable_values)
|
|
45
|
+
@allowable_values = allowable_values.map do |value|
|
|
46
|
+
case datatype.to_s
|
|
47
|
+
when /Integer/i
|
|
48
|
+
value.to_i
|
|
49
|
+
when /Float/i
|
|
50
|
+
value.to_f
|
|
51
|
+
else
|
|
52
|
+
value
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
def valid?(value)
|
|
58
|
+
!value || allowable_values.include?(value)
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
63
|
+
def self.attribute_map
|
|
64
|
+
{
|
|
65
|
+
:'name' => :'name',
|
|
66
|
+
:'type' => :'type',
|
|
67
|
+
:'channel' => :'channel',
|
|
68
|
+
:'audience' => :'audience',
|
|
69
|
+
:'from_name' => :'fromName',
|
|
70
|
+
:'from_address' => :'fromAddress',
|
|
71
|
+
:'reply_to_address' => :'replyToAddress',
|
|
72
|
+
:'subject' => :'subject',
|
|
73
|
+
:'html' => :'html',
|
|
74
|
+
:'internal_template' => :'internalTemplate'
|
|
75
|
+
}
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
# Returns attribute mapping this model knows about
|
|
79
|
+
def self.acceptable_attribute_map
|
|
80
|
+
attribute_map
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# Returns all the JSON keys this model knows about
|
|
84
|
+
def self.acceptable_attributes
|
|
85
|
+
acceptable_attribute_map.values
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# Attribute type mapping.
|
|
89
|
+
def self.openapi_types
|
|
90
|
+
{
|
|
91
|
+
:'name' => :'String',
|
|
92
|
+
:'type' => :'String',
|
|
93
|
+
:'channel' => :'String',
|
|
94
|
+
:'audience' => :'BroadcastResponseAudience',
|
|
95
|
+
:'from_name' => :'String',
|
|
96
|
+
:'from_address' => :'String',
|
|
97
|
+
:'reply_to_address' => :'String',
|
|
98
|
+
:'subject' => :'String',
|
|
99
|
+
:'html' => :'String',
|
|
100
|
+
:'internal_template' => :'String'
|
|
101
|
+
}
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
# List of attributes with nullable: true
|
|
105
|
+
def self.openapi_nullable
|
|
106
|
+
Set.new([
|
|
107
|
+
])
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
# Initializes the object
|
|
111
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
112
|
+
def initialize(attributes = {})
|
|
113
|
+
if (!attributes.is_a?(Hash))
|
|
114
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Pingram::CreateBroadcastRequest` initialize method"
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
118
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
119
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
120
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
121
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Pingram::CreateBroadcastRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
122
|
+
end
|
|
123
|
+
h[k.to_sym] = v
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
if attributes.key?(:'name')
|
|
127
|
+
self.name = attributes[:'name']
|
|
128
|
+
else
|
|
129
|
+
self.name = nil
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
if attributes.key?(:'type')
|
|
133
|
+
self.type = attributes[:'type']
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
if attributes.key?(:'channel')
|
|
137
|
+
self.channel = attributes[:'channel']
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
if attributes.key?(:'audience')
|
|
141
|
+
self.audience = attributes[:'audience']
|
|
142
|
+
else
|
|
143
|
+
self.audience = nil
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
if attributes.key?(:'from_name')
|
|
147
|
+
self.from_name = attributes[:'from_name']
|
|
148
|
+
else
|
|
149
|
+
self.from_name = nil
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
if attributes.key?(:'from_address')
|
|
153
|
+
self.from_address = attributes[:'from_address']
|
|
154
|
+
else
|
|
155
|
+
self.from_address = nil
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
if attributes.key?(:'reply_to_address')
|
|
159
|
+
self.reply_to_address = attributes[:'reply_to_address']
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
if attributes.key?(:'subject')
|
|
163
|
+
self.subject = attributes[:'subject']
|
|
164
|
+
else
|
|
165
|
+
self.subject = nil
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
if attributes.key?(:'html')
|
|
169
|
+
self.html = attributes[:'html']
|
|
170
|
+
else
|
|
171
|
+
self.html = nil
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
if attributes.key?(:'internal_template')
|
|
175
|
+
self.internal_template = attributes[:'internal_template']
|
|
176
|
+
end
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
180
|
+
# @return Array for valid properties with the reasons
|
|
181
|
+
def list_invalid_properties
|
|
182
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
183
|
+
invalid_properties = Array.new
|
|
184
|
+
if @name.nil?
|
|
185
|
+
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
if @audience.nil?
|
|
189
|
+
invalid_properties.push('invalid value for "audience", audience cannot be nil.')
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
if @from_name.nil?
|
|
193
|
+
invalid_properties.push('invalid value for "from_name", from_name cannot be nil.')
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
if @from_address.nil?
|
|
197
|
+
invalid_properties.push('invalid value for "from_address", from_address cannot be nil.')
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
if @subject.nil?
|
|
201
|
+
invalid_properties.push('invalid value for "subject", subject cannot be nil.')
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
if @html.nil?
|
|
205
|
+
invalid_properties.push('invalid value for "html", html cannot be nil.')
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
invalid_properties
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
# Check to see if the all the properties in the model are valid
|
|
212
|
+
# @return true if the model is valid
|
|
213
|
+
def valid?
|
|
214
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
215
|
+
return false if @name.nil?
|
|
216
|
+
channel_validator = EnumAttributeValidator.new('String', ["email"])
|
|
217
|
+
return false unless channel_validator.valid?(@channel)
|
|
218
|
+
return false if @audience.nil?
|
|
219
|
+
return false if @from_name.nil?
|
|
220
|
+
return false if @from_address.nil?
|
|
221
|
+
return false if @subject.nil?
|
|
222
|
+
return false if @html.nil?
|
|
223
|
+
true
|
|
224
|
+
end
|
|
225
|
+
|
|
226
|
+
# Custom attribute writer method with validation
|
|
227
|
+
# @param [Object] name Value to be assigned
|
|
228
|
+
def name=(name)
|
|
229
|
+
if name.nil?
|
|
230
|
+
fail ArgumentError, 'name cannot be nil'
|
|
231
|
+
end
|
|
232
|
+
|
|
233
|
+
@name = name
|
|
234
|
+
end
|
|
235
|
+
|
|
236
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
237
|
+
# @param [Object] channel Object to be assigned
|
|
238
|
+
def channel=(channel)
|
|
239
|
+
validator = EnumAttributeValidator.new('String', ["email"])
|
|
240
|
+
unless validator.valid?(channel)
|
|
241
|
+
fail ArgumentError, "invalid value for \"channel\", must be one of #{validator.allowable_values}."
|
|
242
|
+
end
|
|
243
|
+
@channel = channel
|
|
244
|
+
end
|
|
245
|
+
|
|
246
|
+
# Custom attribute writer method with validation
|
|
247
|
+
# @param [Object] audience Value to be assigned
|
|
248
|
+
def audience=(audience)
|
|
249
|
+
if audience.nil?
|
|
250
|
+
fail ArgumentError, 'audience cannot be nil'
|
|
251
|
+
end
|
|
252
|
+
|
|
253
|
+
@audience = audience
|
|
254
|
+
end
|
|
255
|
+
|
|
256
|
+
# Custom attribute writer method with validation
|
|
257
|
+
# @param [Object] from_name Value to be assigned
|
|
258
|
+
def from_name=(from_name)
|
|
259
|
+
if from_name.nil?
|
|
260
|
+
fail ArgumentError, 'from_name cannot be nil'
|
|
261
|
+
end
|
|
262
|
+
|
|
263
|
+
@from_name = from_name
|
|
264
|
+
end
|
|
265
|
+
|
|
266
|
+
# Custom attribute writer method with validation
|
|
267
|
+
# @param [Object] from_address Value to be assigned
|
|
268
|
+
def from_address=(from_address)
|
|
269
|
+
if from_address.nil?
|
|
270
|
+
fail ArgumentError, 'from_address cannot be nil'
|
|
271
|
+
end
|
|
272
|
+
|
|
273
|
+
@from_address = from_address
|
|
274
|
+
end
|
|
275
|
+
|
|
276
|
+
# Custom attribute writer method with validation
|
|
277
|
+
# @param [Object] subject Value to be assigned
|
|
278
|
+
def subject=(subject)
|
|
279
|
+
if subject.nil?
|
|
280
|
+
fail ArgumentError, 'subject cannot be nil'
|
|
281
|
+
end
|
|
282
|
+
|
|
283
|
+
@subject = subject
|
|
284
|
+
end
|
|
285
|
+
|
|
286
|
+
# Custom attribute writer method with validation
|
|
287
|
+
# @param [Object] html Value to be assigned
|
|
288
|
+
def html=(html)
|
|
289
|
+
if html.nil?
|
|
290
|
+
fail ArgumentError, 'html cannot be nil'
|
|
291
|
+
end
|
|
292
|
+
|
|
293
|
+
@html = html
|
|
294
|
+
end
|
|
295
|
+
|
|
296
|
+
# Checks equality by comparing each attribute.
|
|
297
|
+
# @param [Object] Object to be compared
|
|
298
|
+
def ==(o)
|
|
299
|
+
return true if self.equal?(o)
|
|
300
|
+
self.class == o.class &&
|
|
301
|
+
name == o.name &&
|
|
302
|
+
type == o.type &&
|
|
303
|
+
channel == o.channel &&
|
|
304
|
+
audience == o.audience &&
|
|
305
|
+
from_name == o.from_name &&
|
|
306
|
+
from_address == o.from_address &&
|
|
307
|
+
reply_to_address == o.reply_to_address &&
|
|
308
|
+
subject == o.subject &&
|
|
309
|
+
html == o.html &&
|
|
310
|
+
internal_template == o.internal_template
|
|
311
|
+
end
|
|
312
|
+
|
|
313
|
+
# @see the `==` method
|
|
314
|
+
# @param [Object] Object to be compared
|
|
315
|
+
def eql?(o)
|
|
316
|
+
self == o
|
|
317
|
+
end
|
|
318
|
+
|
|
319
|
+
# Calculates hash code according to all attributes.
|
|
320
|
+
# @return [Integer] Hash code
|
|
321
|
+
def hash
|
|
322
|
+
[name, type, channel, audience, from_name, from_address, reply_to_address, subject, html, internal_template].hash
|
|
323
|
+
end
|
|
324
|
+
|
|
325
|
+
# Builds the object from hash
|
|
326
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
327
|
+
# @return [Object] Returns the model itself
|
|
328
|
+
def self.build_from_hash(attributes)
|
|
329
|
+
return nil unless attributes.is_a?(Hash)
|
|
330
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
331
|
+
transformed_hash = {}
|
|
332
|
+
openapi_types.each_pair do |key, type|
|
|
333
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
334
|
+
transformed_hash["#{key}"] = nil
|
|
335
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
336
|
+
# check to ensure the input is an array given that the attribute
|
|
337
|
+
# is documented as an array but the input is not
|
|
338
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
339
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
340
|
+
end
|
|
341
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
342
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
343
|
+
end
|
|
344
|
+
end
|
|
345
|
+
new(transformed_hash)
|
|
346
|
+
end
|
|
347
|
+
|
|
348
|
+
# Returns the object in the form of hash
|
|
349
|
+
# @return [Hash] Returns the object in the form of hash
|
|
350
|
+
def to_hash
|
|
351
|
+
hash = {}
|
|
352
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
353
|
+
value = self.send(attr)
|
|
354
|
+
if value.nil?
|
|
355
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
356
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
357
|
+
end
|
|
358
|
+
|
|
359
|
+
hash[param] = _to_hash(value)
|
|
360
|
+
end
|
|
361
|
+
hash
|
|
362
|
+
end
|
|
363
|
+
|
|
364
|
+
end
|
|
365
|
+
|
|
366
|
+
end
|
|
@@ -0,0 +1,192 @@
|
|
|
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 CreateLibraryRequest < ApiModelBase
|
|
18
|
+
# Original filename, including extension (e.g. hero.png).
|
|
19
|
+
attr_accessor :filename
|
|
20
|
+
|
|
21
|
+
# MIME type of the file that will be uploaded to the returned URL.
|
|
22
|
+
attr_accessor :content_type
|
|
23
|
+
|
|
24
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
25
|
+
def self.attribute_map
|
|
26
|
+
{
|
|
27
|
+
:'filename' => :'filename',
|
|
28
|
+
:'content_type' => :'contentType'
|
|
29
|
+
}
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Returns attribute mapping this model knows about
|
|
33
|
+
def self.acceptable_attribute_map
|
|
34
|
+
attribute_map
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Returns all the JSON keys this model knows about
|
|
38
|
+
def self.acceptable_attributes
|
|
39
|
+
acceptable_attribute_map.values
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Attribute type mapping.
|
|
43
|
+
def self.openapi_types
|
|
44
|
+
{
|
|
45
|
+
:'filename' => :'String',
|
|
46
|
+
:'content_type' => :'String'
|
|
47
|
+
}
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# List of attributes with nullable: true
|
|
51
|
+
def self.openapi_nullable
|
|
52
|
+
Set.new([
|
|
53
|
+
])
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Initializes the object
|
|
57
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
58
|
+
def initialize(attributes = {})
|
|
59
|
+
if (!attributes.is_a?(Hash))
|
|
60
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Pingram::CreateLibraryRequest` initialize method"
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
64
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
65
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
66
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
67
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Pingram::CreateLibraryRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
68
|
+
end
|
|
69
|
+
h[k.to_sym] = v
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if attributes.key?(:'filename')
|
|
73
|
+
self.filename = attributes[:'filename']
|
|
74
|
+
else
|
|
75
|
+
self.filename = nil
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
if attributes.key?(:'content_type')
|
|
79
|
+
self.content_type = attributes[:'content_type']
|
|
80
|
+
else
|
|
81
|
+
self.content_type = nil
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
86
|
+
# @return Array for valid properties with the reasons
|
|
87
|
+
def list_invalid_properties
|
|
88
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
89
|
+
invalid_properties = Array.new
|
|
90
|
+
if @filename.nil?
|
|
91
|
+
invalid_properties.push('invalid value for "filename", filename cannot be nil.')
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
if @content_type.nil?
|
|
95
|
+
invalid_properties.push('invalid value for "content_type", content_type cannot be nil.')
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
invalid_properties
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
# Check to see if the all the properties in the model are valid
|
|
102
|
+
# @return true if the model is valid
|
|
103
|
+
def valid?
|
|
104
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
105
|
+
return false if @filename.nil?
|
|
106
|
+
return false if @content_type.nil?
|
|
107
|
+
true
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
# Custom attribute writer method with validation
|
|
111
|
+
# @param [Object] filename Value to be assigned
|
|
112
|
+
def filename=(filename)
|
|
113
|
+
if filename.nil?
|
|
114
|
+
fail ArgumentError, 'filename cannot be nil'
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
@filename = filename
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
# Custom attribute writer method with validation
|
|
121
|
+
# @param [Object] content_type Value to be assigned
|
|
122
|
+
def content_type=(content_type)
|
|
123
|
+
if content_type.nil?
|
|
124
|
+
fail ArgumentError, 'content_type cannot be nil'
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
@content_type = content_type
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
# Checks equality by comparing each attribute.
|
|
131
|
+
# @param [Object] Object to be compared
|
|
132
|
+
def ==(o)
|
|
133
|
+
return true if self.equal?(o)
|
|
134
|
+
self.class == o.class &&
|
|
135
|
+
filename == o.filename &&
|
|
136
|
+
content_type == o.content_type
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
# @see the `==` method
|
|
140
|
+
# @param [Object] Object to be compared
|
|
141
|
+
def eql?(o)
|
|
142
|
+
self == o
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
# Calculates hash code according to all attributes.
|
|
146
|
+
# @return [Integer] Hash code
|
|
147
|
+
def hash
|
|
148
|
+
[filename, content_type].hash
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
# Builds the object from hash
|
|
152
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
153
|
+
# @return [Object] Returns the model itself
|
|
154
|
+
def self.build_from_hash(attributes)
|
|
155
|
+
return nil unless attributes.is_a?(Hash)
|
|
156
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
157
|
+
transformed_hash = {}
|
|
158
|
+
openapi_types.each_pair do |key, type|
|
|
159
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
160
|
+
transformed_hash["#{key}"] = nil
|
|
161
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
162
|
+
# check to ensure the input is an array given that the attribute
|
|
163
|
+
# is documented as an array but the input is not
|
|
164
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
165
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
166
|
+
end
|
|
167
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
168
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
169
|
+
end
|
|
170
|
+
end
|
|
171
|
+
new(transformed_hash)
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
# Returns the object in the form of hash
|
|
175
|
+
# @return [Hash] Returns the object in the form of hash
|
|
176
|
+
def to_hash
|
|
177
|
+
hash = {}
|
|
178
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
179
|
+
value = self.send(attr)
|
|
180
|
+
if value.nil?
|
|
181
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
182
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
hash[param] = _to_hash(value)
|
|
186
|
+
end
|
|
187
|
+
hash
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
end
|