shotstack 0.0.11 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,12 +1,12 @@
1
1
  =begin
2
- #shotstack
2
+ #Shotstack
3
3
 
4
- #The Shotstack API is a video editing service that allows for the programatic creation of videos using JSON.
4
+ #The Shotstack API is a video editing service that allows for the automated creation of videos using JSON. You can configure an edit and POST it to the Shotstack API which will render your video and provide a file location when complete. For more details check https://shotstack.io
5
5
 
6
6
  The version of the OpenAPI document: v1
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.0.0
9
+ OpenAPI Generator version: 4.2.1
10
10
 
11
11
  =end
12
12
 
@@ -38,6 +38,12 @@ module Shotstack
38
38
  }
39
39
  end
40
40
 
41
+ # List of attributes with nullable: true
42
+ def self.openapi_nullable
43
+ Set.new([
44
+ ])
45
+ end
46
+
41
47
  # Initializes the object
42
48
  # @param [Hash] attributes Model attributes in the form of hash
43
49
  def initialize(attributes = {})
@@ -202,7 +208,11 @@ module Shotstack
202
208
  hash = {}
203
209
  self.class.attribute_map.each_pair do |attr, param|
204
210
  value = self.send(attr)
205
- next if value.nil?
211
+ if value.nil?
212
+ is_nullable = self.class.openapi_nullable.include?(attr)
213
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
214
+ end
215
+
206
216
  hash[param] = _to_hash(value)
207
217
  end
208
218
  hash
@@ -1,12 +1,12 @@
1
1
  =begin
2
- #shotstack
2
+ #Shotstack
3
3
 
4
- #The Shotstack API is a video editing service that allows for the programatic creation of videos using JSON.
4
+ #The Shotstack API is a video editing service that allows for the automated creation of videos using JSON. You can configure an edit and POST it to the Shotstack API which will render your video and provide a file location when complete. For more details check https://shotstack.io
5
5
 
6
6
  The version of the OpenAPI document: v1
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.0.0
9
+ OpenAPI Generator version: 4.2.1
10
10
 
11
11
  =end
12
12
 
@@ -36,6 +36,12 @@ module Shotstack
36
36
  }
37
37
  end
38
38
 
39
+ # List of attributes with nullable: true
40
+ def self.openapi_nullable
41
+ Set.new([
42
+ ])
43
+ end
44
+
39
45
  # Initializes the object
40
46
  # @param [Hash] attributes Model attributes in the form of hash
41
47
  def initialize(attributes = {})
@@ -190,7 +196,11 @@ module Shotstack
190
196
  hash = {}
191
197
  self.class.attribute_map.each_pair do |attr, param|
192
198
  value = self.send(attr)
193
- next if value.nil?
199
+ if value.nil?
200
+ is_nullable = self.class.openapi_nullable.include?(attr)
201
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
202
+ end
203
+
194
204
  hash[param] = _to_hash(value)
195
205
  end
196
206
  hash
@@ -1,12 +1,12 @@
1
1
  =begin
2
- #shotstack
2
+ #Shotstack
3
3
 
4
- #The Shotstack API is a video editing service that allows for the programatic creation of videos using JSON.
4
+ #The Shotstack API is a video editing service that allows for the automated creation of videos using JSON. You can configure an edit and POST it to the Shotstack API which will render your video and provide a file location when complete. For more details check https://shotstack.io
5
5
 
6
6
  The version of the OpenAPI document: v1
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.0.0
9
+ OpenAPI Generator version: 4.2.1
10
10
 
11
11
  =end
12
12
 
@@ -38,6 +38,12 @@ module Shotstack
38
38
  }
39
39
  end
40
40
 
41
+ # List of attributes with nullable: true
42
+ def self.openapi_nullable
43
+ Set.new([
44
+ ])
45
+ end
46
+
41
47
  # Initializes the object
42
48
  # @param [Hash] attributes Model attributes in the form of hash
43
49
  def initialize(attributes = {})
@@ -202,7 +208,11 @@ module Shotstack
202
208
  hash = {}
203
209
  self.class.attribute_map.each_pair do |attr, param|
204
210
  value = self.send(attr)
205
- next if value.nil?
211
+ if value.nil?
212
+ is_nullable = self.class.openapi_nullable.include?(attr)
213
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
214
+ end
215
+
206
216
  hash[param] = _to_hash(value)
207
217
  end
208
218
  hash
@@ -1,12 +1,12 @@
1
1
  =begin
2
- #shotstack
2
+ #Shotstack
3
3
 
4
- #The Shotstack API is a video editing service that allows for the programatic creation of videos using JSON.
4
+ #The Shotstack API is a video editing service that allows for the automated creation of videos using JSON. You can configure an edit and POST it to the Shotstack API which will render your video and provide a file location when complete. For more details check https://shotstack.io
5
5
 
6
6
  The version of the OpenAPI document: v1
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.0.0
9
+ OpenAPI Generator version: 4.2.1
10
10
 
11
11
  =end
12
12
 
@@ -82,6 +82,12 @@ module Shotstack
82
82
  }
83
83
  end
84
84
 
85
+ # List of attributes with nullable: true
86
+ def self.openapi_nullable
87
+ Set.new([
88
+ ])
89
+ end
90
+
85
91
  # Initializes the object
86
92
  # @param [Hash] attributes Model attributes in the form of hash
87
93
  def initialize(attributes = {})
@@ -293,7 +299,11 @@ module Shotstack
293
299
  hash = {}
294
300
  self.class.attribute_map.each_pair do |attr, param|
295
301
  value = self.send(attr)
296
- next if value.nil?
302
+ if value.nil?
303
+ is_nullable = self.class.openapi_nullable.include?(attr)
304
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
305
+ end
306
+
297
307
  hash[param] = _to_hash(value)
298
308
  end
299
309
  hash
@@ -1,26 +1,29 @@
1
1
  =begin
2
- #shotstack
2
+ #Shotstack
3
3
 
4
- #The Shotstack API is a video editing service that allows for the programatic creation of videos using JSON.
4
+ #The Shotstack API is a video editing service that allows for the automated creation of videos using JSON. You can configure an edit and POST it to the Shotstack API which will render your video and provide a file location when complete. For more details check https://shotstack.io
5
5
 
6
6
  The version of the OpenAPI document: v1
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.0.0
9
+ OpenAPI Generator version: 4.2.1
10
10
 
11
11
  =end
12
12
 
13
13
  require 'date'
14
14
 
15
15
  module Shotstack
16
- # A music or audio file in mp3 format that plays for the duration of the rendered video or the length of the audio file, which ever is shortest.
16
+ # A music or audio file in mp3 format that plays for the duration of the rendered video or the length of the audio file, which ever is shortest.
17
17
  class Soundtrack
18
- # The URL of the mp3 audio file. The URL must be publicly accessible or include credentials.
18
+ # The URL of the mp3 audio file. The URL must be publicly accessible or include credentials.
19
19
  attr_accessor :src
20
20
 
21
21
  # The effect to apply to the audio file
22
22
  attr_accessor :effect
23
23
 
24
+ # Set the volume for the soundtrack between 0 and 1 where 0 is muted and 1 is full volume (defaults to 1).
25
+ attr_accessor :volume
26
+
24
27
  class EnumAttributeValidator
25
28
  attr_reader :datatype
26
29
  attr_reader :allowable_values
@@ -47,7 +50,8 @@ module Shotstack
47
50
  def self.attribute_map
48
51
  {
49
52
  :'src' => :'src',
50
- :'effect' => :'effect'
53
+ :'effect' => :'effect',
54
+ :'volume' => :'volume'
51
55
  }
52
56
  end
53
57
 
@@ -55,10 +59,17 @@ module Shotstack
55
59
  def self.openapi_types
56
60
  {
57
61
  :'src' => :'String',
58
- :'effect' => :'String'
62
+ :'effect' => :'String',
63
+ :'volume' => :'Float'
59
64
  }
60
65
  end
61
66
 
67
+ # List of attributes with nullable: true
68
+ def self.openapi_nullable
69
+ Set.new([
70
+ ])
71
+ end
72
+
62
73
  # Initializes the object
63
74
  # @param [Hash] attributes Model attributes in the form of hash
64
75
  def initialize(attributes = {})
@@ -81,6 +92,10 @@ module Shotstack
81
92
  if attributes.key?(:'effect')
82
93
  self.effect = attributes[:'effect']
83
94
  end
95
+
96
+ if attributes.key?(:'volume')
97
+ self.volume = attributes[:'volume']
98
+ end
84
99
  end
85
100
 
86
101
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -119,7 +134,8 @@ module Shotstack
119
134
  return true if self.equal?(o)
120
135
  self.class == o.class &&
121
136
  src == o.src &&
122
- effect == o.effect
137
+ effect == o.effect &&
138
+ volume == o.volume
123
139
  end
124
140
 
125
141
  # @see the `==` method
@@ -131,7 +147,7 @@ module Shotstack
131
147
  # Calculates hash code according to all attributes.
132
148
  # @return [Integer] Hash code
133
149
  def hash
134
- [src, effect].hash
150
+ [src, effect, volume].hash
135
151
  end
136
152
 
137
153
  # Builds the object from hash
@@ -220,7 +236,11 @@ module Shotstack
220
236
  hash = {}
221
237
  self.class.attribute_map.each_pair do |attr, param|
222
238
  value = self.send(attr)
223
- next if value.nil?
239
+ if value.nil?
240
+ is_nullable = self.class.openapi_nullable.include?(attr)
241
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
242
+ end
243
+
224
244
  hash[param] = _to_hash(value)
225
245
  end
226
246
  hash
@@ -0,0 +1,228 @@
1
+ =begin
2
+ #Shotstack
3
+
4
+ #The Shotstack API is a video editing service that allows for the automated creation of videos using JSON. You can configure an edit and POST it to the Shotstack API which will render your video and provide a file location when complete. For more details check https://shotstack.io
5
+
6
+ The version of the OpenAPI document: v1
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.2.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module Shotstack
16
+ # Generate a thumbnail image for the video at a specific point from the timeline.
17
+ class Thumbnail
18
+ # The point on the timeline in seconds to capture a single frame to use as the thumbnail image.
19
+ attr_accessor :capture
20
+
21
+ # Scale the thumbnail size to a fraction of the viewport size - i.e. setting the scale to 0.5 will scale the thumbnail to half the size of the viewport.
22
+ attr_accessor :scale
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'capture' => :'capture',
28
+ :'scale' => :'scale'
29
+ }
30
+ end
31
+
32
+ # Attribute type mapping.
33
+ def self.openapi_types
34
+ {
35
+ :'capture' => :'Float',
36
+ :'scale' => :'Float'
37
+ }
38
+ end
39
+
40
+ # List of attributes with nullable: true
41
+ def self.openapi_nullable
42
+ Set.new([
43
+ ])
44
+ end
45
+
46
+ # Initializes the object
47
+ # @param [Hash] attributes Model attributes in the form of hash
48
+ def initialize(attributes = {})
49
+ if (!attributes.is_a?(Hash))
50
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Shotstack::Thumbnail` initialize method"
51
+ end
52
+
53
+ # check to see if the attribute exists and convert string to symbol for hash key
54
+ attributes = attributes.each_with_object({}) { |(k, v), h|
55
+ if (!self.class.attribute_map.key?(k.to_sym))
56
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Shotstack::Thumbnail`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
57
+ end
58
+ h[k.to_sym] = v
59
+ }
60
+
61
+ if attributes.key?(:'capture')
62
+ self.capture = attributes[:'capture']
63
+ end
64
+
65
+ if attributes.key?(:'scale')
66
+ self.scale = attributes[:'scale']
67
+ end
68
+ end
69
+
70
+ # Show invalid properties with the reasons. Usually used together with valid?
71
+ # @return Array for valid properties with the reasons
72
+ def list_invalid_properties
73
+ invalid_properties = Array.new
74
+ if @capture.nil?
75
+ invalid_properties.push('invalid value for "capture", capture cannot be nil.')
76
+ end
77
+
78
+ if @scale.nil?
79
+ invalid_properties.push('invalid value for "scale", scale cannot be nil.')
80
+ end
81
+
82
+ invalid_properties
83
+ end
84
+
85
+ # Check to see if the all the properties in the model are valid
86
+ # @return true if the model is valid
87
+ def valid?
88
+ return false if @capture.nil?
89
+ return false if @scale.nil?
90
+ true
91
+ end
92
+
93
+ # Checks equality by comparing each attribute.
94
+ # @param [Object] Object to be compared
95
+ def ==(o)
96
+ return true if self.equal?(o)
97
+ self.class == o.class &&
98
+ capture == o.capture &&
99
+ scale == o.scale
100
+ end
101
+
102
+ # @see the `==` method
103
+ # @param [Object] Object to be compared
104
+ def eql?(o)
105
+ self == o
106
+ end
107
+
108
+ # Calculates hash code according to all attributes.
109
+ # @return [Integer] Hash code
110
+ def hash
111
+ [capture, scale].hash
112
+ end
113
+
114
+ # Builds the object from hash
115
+ # @param [Hash] attributes Model attributes in the form of hash
116
+ # @return [Object] Returns the model itself
117
+ def self.build_from_hash(attributes)
118
+ new.build_from_hash(attributes)
119
+ end
120
+
121
+ # Builds the object from hash
122
+ # @param [Hash] attributes Model attributes in the form of hash
123
+ # @return [Object] Returns the model itself
124
+ def build_from_hash(attributes)
125
+ return nil unless attributes.is_a?(Hash)
126
+ self.class.openapi_types.each_pair do |key, type|
127
+ if type =~ /\AArray<(.*)>/i
128
+ # check to ensure the input is an array given that the attribute
129
+ # is documented as an array but the input is not
130
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
131
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
132
+ end
133
+ elsif !attributes[self.class.attribute_map[key]].nil?
134
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
135
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
136
+ end
137
+
138
+ self
139
+ end
140
+
141
+ # Deserializes the data based on type
142
+ # @param string type Data type
143
+ # @param string value Value to be deserialized
144
+ # @return [Object] Deserialized data
145
+ def _deserialize(type, value)
146
+ case type.to_sym
147
+ when :DateTime
148
+ DateTime.parse(value)
149
+ when :Date
150
+ Date.parse(value)
151
+ when :String
152
+ value.to_s
153
+ when :Integer
154
+ value.to_i
155
+ when :Float
156
+ value.to_f
157
+ when :Boolean
158
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
159
+ true
160
+ else
161
+ false
162
+ end
163
+ when :Object
164
+ # generic object (usually a Hash), return directly
165
+ value
166
+ when /\AArray<(?<inner_type>.+)>\z/
167
+ inner_type = Regexp.last_match[:inner_type]
168
+ value.map { |v| _deserialize(inner_type, v) }
169
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
170
+ k_type = Regexp.last_match[:k_type]
171
+ v_type = Regexp.last_match[:v_type]
172
+ {}.tap do |hash|
173
+ value.each do |k, v|
174
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
175
+ end
176
+ end
177
+ else # model
178
+ Shotstack.const_get(type).build_from_hash(value)
179
+ end
180
+ end
181
+
182
+ # Returns the string representation of the object
183
+ # @return [String] String presentation of the object
184
+ def to_s
185
+ to_hash.to_s
186
+ end
187
+
188
+ # to_body is an alias to to_hash (backward compatibility)
189
+ # @return [Hash] Returns the object in the form of hash
190
+ def to_body
191
+ to_hash
192
+ end
193
+
194
+ # Returns the object in the form of hash
195
+ # @return [Hash] Returns the object in the form of hash
196
+ def to_hash
197
+ hash = {}
198
+ self.class.attribute_map.each_pair do |attr, param|
199
+ value = self.send(attr)
200
+ if value.nil?
201
+ is_nullable = self.class.openapi_nullable.include?(attr)
202
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
203
+ end
204
+
205
+ hash[param] = _to_hash(value)
206
+ end
207
+ hash
208
+ end
209
+
210
+ # Outputs non-array value in the form of hash
211
+ # For object, use to_hash. Otherwise, just return the value
212
+ # @param [Object] value Any valid value
213
+ # @return [Hash] Returns the value in the form of hash
214
+ def _to_hash(value)
215
+ if value.is_a?(Array)
216
+ value.compact.map { |v| _to_hash(v) }
217
+ elsif value.is_a?(Hash)
218
+ {}.tap do |hash|
219
+ value.each { |k, v| hash[k] = _to_hash(v) }
220
+ end
221
+ elsif value.respond_to? :to_hash
222
+ value.to_hash
223
+ else
224
+ value
225
+ end
226
+ end
227
+ end
228
+ end