telestream_cloud_flip 2.0.0

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 (118) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +7 -0
  3. data/README.md +130 -0
  4. data/Rakefile +8 -0
  5. data/docs/CanceledResponse.md +8 -0
  6. data/docs/CloudNotificationSettings.md +11 -0
  7. data/docs/CloudNotificationSettingsEvents.md +11 -0
  8. data/docs/CopyProfileBody.md +9 -0
  9. data/docs/CountResponse.md +8 -0
  10. data/docs/CreateEncodingBody.md +10 -0
  11. data/docs/CreateVideoBody.md +12 -0
  12. data/docs/DeletedResponse.md +8 -0
  13. data/docs/Encoding.md +38 -0
  14. data/docs/EncodingSignedUrl.md +8 -0
  15. data/docs/EncodingSignedUrls.md +8 -0
  16. data/docs/Error.md +9 -0
  17. data/docs/ExtraFile.md +10 -0
  18. data/docs/Factory.md +25 -0
  19. data/docs/FactoryBody.md +23 -0
  20. data/docs/FactoryBodyStorageCredentialAttributes.md +11 -0
  21. data/docs/FactorySync.md +8 -0
  22. data/docs/FactorySyncBody.md +8 -0
  23. data/docs/FlipApi.md +2179 -0
  24. data/docs/PaginatedEncodingsCollection.md +11 -0
  25. data/docs/PaginatedFactoryCollection.md +11 -0
  26. data/docs/PaginatedProfilesCollection.md +11 -0
  27. data/docs/PaginatedVideoCollection.md +11 -0
  28. data/docs/PaginatedWorkflowsCollection.md +11 -0
  29. data/docs/Profile.md +135 -0
  30. data/docs/ProfileBody.md +137 -0
  31. data/docs/ResubmitVideoBody.md +8 -0
  32. data/docs/RetriedResponse.md +8 -0
  33. data/docs/SignedVideoUrl.md +8 -0
  34. data/docs/UpdateEncodingBody.md +9 -0
  35. data/docs/UploadSession.md +13 -0
  36. data/docs/Video.md +31 -0
  37. data/docs/VideoMetadata.md +7 -0
  38. data/docs/VideoUploadBody.md +24 -0
  39. data/git_push.sh +55 -0
  40. data/lib/telestream_cloud_flip/api/flip_api.rb +2385 -0
  41. data/lib/telestream_cloud_flip/api_client.rb +389 -0
  42. data/lib/telestream_cloud_flip/api_error.rb +38 -0
  43. data/lib/telestream_cloud_flip/configuration.rb +209 -0
  44. data/lib/telestream_cloud_flip/models/canceled_response.rb +189 -0
  45. data/lib/telestream_cloud_flip/models/cloud_notification_settings.rb +237 -0
  46. data/lib/telestream_cloud_flip/models/cloud_notification_settings_events.rb +239 -0
  47. data/lib/telestream_cloud_flip/models/copy_profile_body.rb +209 -0
  48. data/lib/telestream_cloud_flip/models/count_response.rb +189 -0
  49. data/lib/telestream_cloud_flip/models/create_encoding_body.rb +214 -0
  50. data/lib/telestream_cloud_flip/models/create_video_body.rb +231 -0
  51. data/lib/telestream_cloud_flip/models/deleted_response.rb +189 -0
  52. data/lib/telestream_cloud_flip/models/encoding.rb +486 -0
  53. data/lib/telestream_cloud_flip/models/encoding_signed_url.rb +189 -0
  54. data/lib/telestream_cloud_flip/models/encoding_signed_urls.rb +191 -0
  55. data/lib/telestream_cloud_flip/models/error.rb +199 -0
  56. data/lib/telestream_cloud_flip/models/extra_file.rb +221 -0
  57. data/lib/telestream_cloud_flip/models/factory.rb +388 -0
  58. data/lib/telestream_cloud_flip/models/factory_body.rb +374 -0
  59. data/lib/telestream_cloud_flip/models/factory_body_storage_credential_attributes.rb +215 -0
  60. data/lib/telestream_cloud_flip/models/factory_sync.rb +222 -0
  61. data/lib/telestream_cloud_flip/models/factory_sync_body.rb +227 -0
  62. data/lib/telestream_cloud_flip/models/paginated_encodings_collection.rb +240 -0
  63. data/lib/telestream_cloud_flip/models/paginated_factory_collection.rb +220 -0
  64. data/lib/telestream_cloud_flip/models/paginated_profiles_collection.rb +220 -0
  65. data/lib/telestream_cloud_flip/models/paginated_video_collection.rb +220 -0
  66. data/lib/telestream_cloud_flip/models/paginated_workflows_collection.rb +220 -0
  67. data/lib/telestream_cloud_flip/models/profile.rb +1777 -0
  68. data/lib/telestream_cloud_flip/models/profile_body.rb +1762 -0
  69. data/lib/telestream_cloud_flip/models/resubmit_video_body.rb +189 -0
  70. data/lib/telestream_cloud_flip/models/retried_response.rb +189 -0
  71. data/lib/telestream_cloud_flip/models/signed_video_url.rb +189 -0
  72. data/lib/telestream_cloud_flip/models/update_encoding_body.rb +199 -0
  73. data/lib/telestream_cloud_flip/models/upload_session.rb +249 -0
  74. data/lib/telestream_cloud_flip/models/video.rb +418 -0
  75. data/lib/telestream_cloud_flip/models/video_metadata.rb +179 -0
  76. data/lib/telestream_cloud_flip/models/video_upload_body.rb +362 -0
  77. data/lib/telestream_cloud_flip/uploader.rb +244 -0
  78. data/lib/telestream_cloud_flip/version.rb +18 -0
  79. data/lib/telestream_cloud_flip.rb +79 -0
  80. data/spec/api/flip_api_spec.rb +550 -0
  81. data/spec/api_client_spec.rb +226 -0
  82. data/spec/configuration_spec.rb +42 -0
  83. data/spec/models/canceled_response_spec.rb +42 -0
  84. data/spec/models/cloud_notification_settings_events_spec.rb +60 -0
  85. data/spec/models/cloud_notification_settings_spec.rb +60 -0
  86. data/spec/models/copy_profile_body_spec.rb +48 -0
  87. data/spec/models/count_response_spec.rb +42 -0
  88. data/spec/models/create_encoding_body_spec.rb +54 -0
  89. data/spec/models/create_video_body_spec.rb +66 -0
  90. data/spec/models/deleted_response_spec.rb +42 -0
  91. data/spec/models/encoding_signed_url_spec.rb +42 -0
  92. data/spec/models/encoding_signed_urls_spec.rb +42 -0
  93. data/spec/models/encoding_spec.rb +222 -0
  94. data/spec/models/error_spec.rb +48 -0
  95. data/spec/models/extra_file_spec.rb +54 -0
  96. data/spec/models/factory_body_spec.rb +136 -0
  97. data/spec/models/factory_body_storage_credential_attributes_spec.rb +60 -0
  98. data/spec/models/factory_spec.rb +148 -0
  99. data/spec/models/factory_sync_body_spec.rb +46 -0
  100. data/spec/models/factory_sync_spec.rb +46 -0
  101. data/spec/models/paginated_encodings_collection_spec.rb +60 -0
  102. data/spec/models/paginated_factory_collection_spec.rb +60 -0
  103. data/spec/models/paginated_profiles_collection_spec.rb +60 -0
  104. data/spec/models/paginated_video_collection_spec.rb +60 -0
  105. data/spec/models/paginated_workflows_collection_spec.rb +60 -0
  106. data/spec/models/profile_body_spec.rb +916 -0
  107. data/spec/models/profile_spec.rb +916 -0
  108. data/spec/models/resubmit_video_body_spec.rb +42 -0
  109. data/spec/models/retried_response_spec.rb +42 -0
  110. data/spec/models/signed_video_url_spec.rb +42 -0
  111. data/spec/models/update_encoding_body_spec.rb +48 -0
  112. data/spec/models/upload_session_spec.rb +72 -0
  113. data/spec/models/video_metadata_spec.rb +36 -0
  114. data/spec/models/video_spec.rb +180 -0
  115. data/spec/models/video_upload_body_spec.rb +138 -0
  116. data/spec/spec_helper.rb +111 -0
  117. data/telestream_cloud_flip.gemspec +47 -0
  118. metadata +396 -0
@@ -0,0 +1,486 @@
1
+ =begin
2
+ #Flip API
3
+
4
+ #Description
5
+
6
+ OpenAPI spec version: 3.1.0
7
+ Contact: cloudsupport@telestream.net
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.3.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module TelestreamCloud::Flip
16
+
17
+ class Encoding
18
+ # A unique identifier of an Encoding.
19
+ attr_accessor :id
20
+
21
+ # Audio bitrate (in bits/s).
22
+ attr_accessor :audio_bitrate
23
+
24
+ # A number of audio channels.
25
+ attr_accessor :audio_channels
26
+
27
+ # A codec that is used to encode audio streams.
28
+ attr_accessor :audio_codec
29
+
30
+ # A number of samples of audio carried per second.
31
+ attr_accessor :audio_sample_rate
32
+
33
+ # A date and time when the Encoding has been created.
34
+ attr_accessor :created_at
35
+
36
+ attr_accessor :duration
37
+
38
+ attr_accessor :encoding_progress
39
+
40
+ attr_accessor :encoding_time
41
+
42
+ # A class of an error that has occurred during the encoding process. It is present only if the encoding status is equal to `fail`.
43
+ attr_accessor :error_class
44
+
45
+ # A message that explains why the encoding process has resulted in an error. It is present only if the encoding status is equal to `fail`.
46
+ attr_accessor :error_message
47
+
48
+ attr_accessor :external_id
49
+
50
+ # Extension of the output file.
51
+ attr_accessor :extname
52
+
53
+ # A size of the output file.
54
+ attr_accessor :file_size
55
+
56
+ # An array of output file names.
57
+ attr_accessor :files
58
+
59
+ # Number of frames per second.
60
+ attr_accessor :fps
61
+
62
+ # Height of the output video.
63
+ attr_accessor :height
64
+
65
+ # Width of the output video.
66
+ attr_accessor :width
67
+
68
+ # An URL pointing to a logfile.
69
+ attr_accessor :logfile_url
70
+
71
+ # A mime type of the encoded file.
72
+ attr_accessor :mime_type
73
+
74
+ attr_accessor :parent_encoding_id
75
+
76
+ attr_accessor :path
77
+
78
+ # An id of a related Profile.
79
+ attr_accessor :profile_id
80
+
81
+ # A name of the used Profile.
82
+ attr_accessor :profile_name
83
+
84
+ attr_accessor :screenshots
85
+
86
+ # A date and time when the encoding process has been started
87
+ attr_accessor :started_encoding_at
88
+
89
+ # Determines at what stage the encoding process is at the moment.
90
+ attr_accessor :status
91
+
92
+ # A date and time when a Encoding has been updated last time.
93
+ attr_accessor :updated_at
94
+
95
+ # video bitrate (in bits/s)
96
+ attr_accessor :video_bitrate
97
+
98
+ # A codec that is used to encode video streams.
99
+ attr_accessor :video_codec
100
+
101
+ # An id of a related Video object
102
+ attr_accessor :video_id
103
+
104
+
105
+ # Attribute mapping from ruby-style variable name to JSON key.
106
+ def self.attribute_map
107
+ {
108
+ :'id' => :'id',
109
+ :'audio_bitrate' => :'audio_bitrate',
110
+ :'audio_channels' => :'audio_channels',
111
+ :'audio_codec' => :'audio_codec',
112
+ :'audio_sample_rate' => :'audio_sample_rate',
113
+ :'created_at' => :'created_at',
114
+ :'duration' => :'duration',
115
+ :'encoding_progress' => :'encoding_progress',
116
+ :'encoding_time' => :'encoding_time',
117
+ :'error_class' => :'error_class',
118
+ :'error_message' => :'error_message',
119
+ :'external_id' => :'external_id',
120
+ :'extname' => :'extname',
121
+ :'file_size' => :'file_size',
122
+ :'files' => :'files',
123
+ :'fps' => :'fps',
124
+ :'height' => :'height',
125
+ :'width' => :'width',
126
+ :'logfile_url' => :'logfile_url',
127
+ :'mime_type' => :'mime_type',
128
+ :'parent_encoding_id' => :'parent_encoding_id',
129
+ :'path' => :'path',
130
+ :'profile_id' => :'profile_id',
131
+ :'profile_name' => :'profile_name',
132
+ :'screenshots' => :'screenshots',
133
+ :'started_encoding_at' => :'started_encoding_at',
134
+ :'status' => :'status',
135
+ :'updated_at' => :'updated_at',
136
+ :'video_bitrate' => :'video_bitrate',
137
+ :'video_codec' => :'video_codec',
138
+ :'video_id' => :'video_id'
139
+ }
140
+ end
141
+
142
+ # Attribute type mapping.
143
+ def self.swagger_types
144
+ {
145
+ :'id' => :'String',
146
+ :'audio_bitrate' => :'Integer',
147
+ :'audio_channels' => :'Integer',
148
+ :'audio_codec' => :'String',
149
+ :'audio_sample_rate' => :'String',
150
+ :'created_at' => :'String',
151
+ :'duration' => :'String',
152
+ :'encoding_progress' => :'String',
153
+ :'encoding_time' => :'String',
154
+ :'error_class' => :'String',
155
+ :'error_message' => :'String',
156
+ :'external_id' => :'String',
157
+ :'extname' => :'String',
158
+ :'file_size' => :'String',
159
+ :'files' => :'Array<String>',
160
+ :'fps' => :'String',
161
+ :'height' => :'String',
162
+ :'width' => :'String',
163
+ :'logfile_url' => :'String',
164
+ :'mime_type' => :'String',
165
+ :'parent_encoding_id' => :'String',
166
+ :'path' => :'String',
167
+ :'profile_id' => :'String',
168
+ :'profile_name' => :'String',
169
+ :'screenshots' => :'Array<String>',
170
+ :'started_encoding_at' => :'String',
171
+ :'status' => :'String',
172
+ :'updated_at' => :'String',
173
+ :'video_bitrate' => :'String',
174
+ :'video_codec' => :'String',
175
+ :'video_id' => :'String'
176
+ }
177
+ end
178
+
179
+ # Initializes the object
180
+ # @param [Hash] attributes Model attributes in the form of hash
181
+ def initialize(attributes = {})
182
+ return unless attributes.is_a?(Hash)
183
+
184
+ # convert string to symbol for hash key
185
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
186
+
187
+ if attributes.has_key?(:'id')
188
+ self.id = attributes[:'id']
189
+ end
190
+
191
+ if attributes.has_key?(:'audio_bitrate')
192
+ self.audio_bitrate = attributes[:'audio_bitrate']
193
+ end
194
+
195
+ if attributes.has_key?(:'audio_channels')
196
+ self.audio_channels = attributes[:'audio_channels']
197
+ end
198
+
199
+ if attributes.has_key?(:'audio_codec')
200
+ self.audio_codec = attributes[:'audio_codec']
201
+ end
202
+
203
+ if attributes.has_key?(:'audio_sample_rate')
204
+ self.audio_sample_rate = attributes[:'audio_sample_rate']
205
+ end
206
+
207
+ if attributes.has_key?(:'created_at')
208
+ self.created_at = attributes[:'created_at']
209
+ end
210
+
211
+ if attributes.has_key?(:'duration')
212
+ self.duration = attributes[:'duration']
213
+ end
214
+
215
+ if attributes.has_key?(:'encoding_progress')
216
+ self.encoding_progress = attributes[:'encoding_progress']
217
+ end
218
+
219
+ if attributes.has_key?(:'encoding_time')
220
+ self.encoding_time = attributes[:'encoding_time']
221
+ end
222
+
223
+ if attributes.has_key?(:'error_class')
224
+ self.error_class = attributes[:'error_class']
225
+ end
226
+
227
+ if attributes.has_key?(:'error_message')
228
+ self.error_message = attributes[:'error_message']
229
+ end
230
+
231
+ if attributes.has_key?(:'external_id')
232
+ self.external_id = attributes[:'external_id']
233
+ end
234
+
235
+ if attributes.has_key?(:'extname')
236
+ self.extname = attributes[:'extname']
237
+ end
238
+
239
+ if attributes.has_key?(:'file_size')
240
+ self.file_size = attributes[:'file_size']
241
+ end
242
+
243
+ if attributes.has_key?(:'files')
244
+ if (value = attributes[:'files']).is_a?(Array)
245
+ self.files = value
246
+ end
247
+ end
248
+
249
+ if attributes.has_key?(:'fps')
250
+ self.fps = attributes[:'fps']
251
+ end
252
+
253
+ if attributes.has_key?(:'height')
254
+ self.height = attributes[:'height']
255
+ end
256
+
257
+ if attributes.has_key?(:'width')
258
+ self.width = attributes[:'width']
259
+ end
260
+
261
+ if attributes.has_key?(:'logfile_url')
262
+ self.logfile_url = attributes[:'logfile_url']
263
+ end
264
+
265
+ if attributes.has_key?(:'mime_type')
266
+ self.mime_type = attributes[:'mime_type']
267
+ end
268
+
269
+ if attributes.has_key?(:'parent_encoding_id')
270
+ self.parent_encoding_id = attributes[:'parent_encoding_id']
271
+ end
272
+
273
+ if attributes.has_key?(:'path')
274
+ self.path = attributes[:'path']
275
+ end
276
+
277
+ if attributes.has_key?(:'profile_id')
278
+ self.profile_id = attributes[:'profile_id']
279
+ end
280
+
281
+ if attributes.has_key?(:'profile_name')
282
+ self.profile_name = attributes[:'profile_name']
283
+ end
284
+
285
+ if attributes.has_key?(:'screenshots')
286
+ if (value = attributes[:'screenshots']).is_a?(Array)
287
+ self.screenshots = value
288
+ end
289
+ end
290
+
291
+ if attributes.has_key?(:'started_encoding_at')
292
+ self.started_encoding_at = attributes[:'started_encoding_at']
293
+ end
294
+
295
+ if attributes.has_key?(:'status')
296
+ self.status = attributes[:'status']
297
+ end
298
+
299
+ if attributes.has_key?(:'updated_at')
300
+ self.updated_at = attributes[:'updated_at']
301
+ end
302
+
303
+ if attributes.has_key?(:'video_bitrate')
304
+ self.video_bitrate = attributes[:'video_bitrate']
305
+ end
306
+
307
+ if attributes.has_key?(:'video_codec')
308
+ self.video_codec = attributes[:'video_codec']
309
+ end
310
+
311
+ if attributes.has_key?(:'video_id')
312
+ self.video_id = attributes[:'video_id']
313
+ end
314
+
315
+ end
316
+
317
+ # Show invalid properties with the reasons. Usually used together with valid?
318
+ # @return Array for valid properties with the reasons
319
+ def list_invalid_properties
320
+ invalid_properties = Array.new
321
+ return invalid_properties
322
+ end
323
+
324
+ # Check to see if the all the properties in the model are valid
325
+ # @return true if the model is valid
326
+ def valid?
327
+ return true
328
+ end
329
+
330
+ # Checks equality by comparing each attribute.
331
+ # @param [Object] Object to be compared
332
+ def ==(o)
333
+ return true if self.equal?(o)
334
+ self.class == o.class &&
335
+ id == o.id &&
336
+ audio_bitrate == o.audio_bitrate &&
337
+ audio_channels == o.audio_channels &&
338
+ audio_codec == o.audio_codec &&
339
+ audio_sample_rate == o.audio_sample_rate &&
340
+ created_at == o.created_at &&
341
+ duration == o.duration &&
342
+ encoding_progress == o.encoding_progress &&
343
+ encoding_time == o.encoding_time &&
344
+ error_class == o.error_class &&
345
+ error_message == o.error_message &&
346
+ external_id == o.external_id &&
347
+ extname == o.extname &&
348
+ file_size == o.file_size &&
349
+ files == o.files &&
350
+ fps == o.fps &&
351
+ height == o.height &&
352
+ width == o.width &&
353
+ logfile_url == o.logfile_url &&
354
+ mime_type == o.mime_type &&
355
+ parent_encoding_id == o.parent_encoding_id &&
356
+ path == o.path &&
357
+ profile_id == o.profile_id &&
358
+ profile_name == o.profile_name &&
359
+ screenshots == o.screenshots &&
360
+ started_encoding_at == o.started_encoding_at &&
361
+ status == o.status &&
362
+ updated_at == o.updated_at &&
363
+ video_bitrate == o.video_bitrate &&
364
+ video_codec == o.video_codec &&
365
+ video_id == o.video_id
366
+ end
367
+
368
+ # @see the `==` method
369
+ # @param [Object] Object to be compared
370
+ def eql?(o)
371
+ self == o
372
+ end
373
+
374
+ # Calculates hash code according to all attributes.
375
+ # @return [Fixnum] Hash code
376
+ def hash
377
+ [id, audio_bitrate, audio_channels, audio_codec, audio_sample_rate, created_at, duration, encoding_progress, encoding_time, error_class, error_message, external_id, extname, file_size, files, fps, height, width, logfile_url, mime_type, parent_encoding_id, path, profile_id, profile_name, screenshots, started_encoding_at, status, updated_at, video_bitrate, video_codec, video_id].hash
378
+ end
379
+
380
+ # Builds the object from hash
381
+ # @param [Hash] attributes Model attributes in the form of hash
382
+ # @return [Object] Returns the model itself
383
+ def build_from_hash(attributes)
384
+ return nil unless attributes.is_a?(Hash)
385
+ self.class.swagger_types.each_pair do |key, type|
386
+ if type =~ /\AArray<(.*)>/i
387
+ # check to ensure the input is an array given that the the attribute
388
+ # is documented as an array but the input is not
389
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
390
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
391
+ end
392
+ elsif !attributes[self.class.attribute_map[key]].nil?
393
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
394
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
395
+ end
396
+
397
+ self
398
+ end
399
+
400
+ # Deserializes the data based on type
401
+ # @param string type Data type
402
+ # @param string value Value to be deserialized
403
+ # @return [Object] Deserialized data
404
+ def _deserialize(type, value)
405
+ case type.to_sym
406
+ when :DateTime
407
+ DateTime.parse(value)
408
+ when :Date
409
+ Date.parse(value)
410
+ when :String
411
+ value.to_s
412
+ when :Integer
413
+ value.to_i
414
+ when :Float
415
+ value.to_f
416
+ when :BOOLEAN
417
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
418
+ true
419
+ else
420
+ false
421
+ end
422
+ when :Object
423
+ # generic object (usually a Hash), return directly
424
+ value
425
+ when /\AArray<(?<inner_type>.+)>\z/
426
+ inner_type = Regexp.last_match[:inner_type]
427
+ value.map { |v| _deserialize(inner_type, v) }
428
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
429
+ k_type = Regexp.last_match[:k_type]
430
+ v_type = Regexp.last_match[:v_type]
431
+ {}.tap do |hash|
432
+ value.each do |k, v|
433
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
434
+ end
435
+ end
436
+ else # model
437
+ temp_model = TelestreamCloud::Flip.const_get(type).new
438
+ temp_model.build_from_hash(value)
439
+ end
440
+ end
441
+
442
+ # Returns the string representation of the object
443
+ # @return [String] String presentation of the object
444
+ def to_s
445
+ to_hash.to_s
446
+ end
447
+
448
+ # to_body is an alias to to_hash (backward compatibility)
449
+ # @return [Hash] Returns the object in the form of hash
450
+ def to_body
451
+ to_hash
452
+ end
453
+
454
+ # Returns the object in the form of hash
455
+ # @return [Hash] Returns the object in the form of hash
456
+ def to_hash
457
+ hash = {}
458
+ self.class.attribute_map.each_pair do |attr, param|
459
+ value = self.send(attr)
460
+ next if value.nil?
461
+ hash[param] = _to_hash(value)
462
+ end
463
+ hash
464
+ end
465
+
466
+ # Outputs non-array value in the form of hash
467
+ # For object, use to_hash. Otherwise, just return the value
468
+ # @param [Object] value Any valid value
469
+ # @return [Hash] Returns the value in the form of hash
470
+ def _to_hash(value)
471
+ if value.is_a?(Array)
472
+ value.compact.map{ |v| _to_hash(v) }
473
+ elsif value.is_a?(Hash)
474
+ {}.tap do |hash|
475
+ value.each { |k, v| hash[k] = _to_hash(v) }
476
+ end
477
+ elsif value.respond_to? :to_hash
478
+ value.to_hash
479
+ else
480
+ value
481
+ end
482
+ end
483
+
484
+ end
485
+
486
+ end
@@ -0,0 +1,189 @@
1
+ =begin
2
+ #Flip API
3
+
4
+ #Description
5
+
6
+ OpenAPI spec version: 3.1.0
7
+ Contact: cloudsupport@telestream.net
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.3.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module TelestreamCloud::Flip
16
+
17
+ class EncodingSignedUrl
18
+ # A signed URLs pointing to the encoding's output.
19
+ attr_accessor :signed_url
20
+
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'signed_url' => :'signed_url'
26
+ }
27
+ end
28
+
29
+ # Attribute type mapping.
30
+ def self.swagger_types
31
+ {
32
+ :'signed_url' => :'String'
33
+ }
34
+ end
35
+
36
+ # Initializes the object
37
+ # @param [Hash] attributes Model attributes in the form of hash
38
+ def initialize(attributes = {})
39
+ return unless attributes.is_a?(Hash)
40
+
41
+ # convert string to symbol for hash key
42
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
43
+
44
+ if attributes.has_key?(:'signed_url')
45
+ self.signed_url = attributes[:'signed_url']
46
+ end
47
+
48
+ end
49
+
50
+ # Show invalid properties with the reasons. Usually used together with valid?
51
+ # @return Array for valid properties with the reasons
52
+ def list_invalid_properties
53
+ invalid_properties = Array.new
54
+ return invalid_properties
55
+ end
56
+
57
+ # Check to see if the all the properties in the model are valid
58
+ # @return true if the model is valid
59
+ def valid?
60
+ return true
61
+ end
62
+
63
+ # Checks equality by comparing each attribute.
64
+ # @param [Object] Object to be compared
65
+ def ==(o)
66
+ return true if self.equal?(o)
67
+ self.class == o.class &&
68
+ signed_url == o.signed_url
69
+ end
70
+
71
+ # @see the `==` method
72
+ # @param [Object] Object to be compared
73
+ def eql?(o)
74
+ self == o
75
+ end
76
+
77
+ # Calculates hash code according to all attributes.
78
+ # @return [Fixnum] Hash code
79
+ def hash
80
+ [signed_url].hash
81
+ end
82
+
83
+ # Builds the object from hash
84
+ # @param [Hash] attributes Model attributes in the form of hash
85
+ # @return [Object] Returns the model itself
86
+ def build_from_hash(attributes)
87
+ return nil unless attributes.is_a?(Hash)
88
+ self.class.swagger_types.each_pair do |key, type|
89
+ if type =~ /\AArray<(.*)>/i
90
+ # check to ensure the input is an array given that the the attribute
91
+ # is documented as an array but the input is not
92
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
93
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
94
+ end
95
+ elsif !attributes[self.class.attribute_map[key]].nil?
96
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
97
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
98
+ end
99
+
100
+ self
101
+ end
102
+
103
+ # Deserializes the data based on type
104
+ # @param string type Data type
105
+ # @param string value Value to be deserialized
106
+ # @return [Object] Deserialized data
107
+ def _deserialize(type, value)
108
+ case type.to_sym
109
+ when :DateTime
110
+ DateTime.parse(value)
111
+ when :Date
112
+ Date.parse(value)
113
+ when :String
114
+ value.to_s
115
+ when :Integer
116
+ value.to_i
117
+ when :Float
118
+ value.to_f
119
+ when :BOOLEAN
120
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
121
+ true
122
+ else
123
+ false
124
+ end
125
+ when :Object
126
+ # generic object (usually a Hash), return directly
127
+ value
128
+ when /\AArray<(?<inner_type>.+)>\z/
129
+ inner_type = Regexp.last_match[:inner_type]
130
+ value.map { |v| _deserialize(inner_type, v) }
131
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
132
+ k_type = Regexp.last_match[:k_type]
133
+ v_type = Regexp.last_match[:v_type]
134
+ {}.tap do |hash|
135
+ value.each do |k, v|
136
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
137
+ end
138
+ end
139
+ else # model
140
+ temp_model = TelestreamCloud::Flip.const_get(type).new
141
+ temp_model.build_from_hash(value)
142
+ end
143
+ end
144
+
145
+ # Returns the string representation of the object
146
+ # @return [String] String presentation of the object
147
+ def to_s
148
+ to_hash.to_s
149
+ end
150
+
151
+ # to_body is an alias to to_hash (backward compatibility)
152
+ # @return [Hash] Returns the object in the form of hash
153
+ def to_body
154
+ to_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
+ next if value.nil?
164
+ hash[param] = _to_hash(value)
165
+ end
166
+ hash
167
+ end
168
+
169
+ # Outputs non-array value in the form of hash
170
+ # For object, use to_hash. Otherwise, just return the value
171
+ # @param [Object] value Any valid value
172
+ # @return [Hash] Returns the value in the form of hash
173
+ def _to_hash(value)
174
+ if value.is_a?(Array)
175
+ value.compact.map{ |v| _to_hash(v) }
176
+ elsif value.is_a?(Hash)
177
+ {}.tap do |hash|
178
+ value.each { |k, v| hash[k] = _to_hash(v) }
179
+ end
180
+ elsif value.respond_to? :to_hash
181
+ value.to_hash
182
+ else
183
+ value
184
+ end
185
+ end
186
+
187
+ end
188
+
189
+ end