shotstack 0.0.10 → 0.1.3

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.
@@ -1,24 +1,36 @@
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
- OpenAPI spec version: v1
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-beta3
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
- # The video output format
16
+ # The video output format.
17
17
  class Output
18
+ # `mp4` video or animated `gif`
18
19
  attr_accessor :format
19
20
 
21
+ # The output resolution of the video. <ul> <li>`preview` - 512px x 288px @ 15fps</li> <li>`mobile` - 640px x 360px @ 25fps</li> <li>`sd` - 1024px x 576px @ 25fps</li> <li>`hd` - 1280px x 720px @ 25fps</li> <li>`1080` - 1920px x 1080px @ 25fps</li> </ul>
20
22
  attr_accessor :resolution
21
23
 
24
+ # The aspect ratio (shape) of the video. Useful for social media sites. Options are: <ul> <li>`16:9` - regular landscape/horizontal aspect ratio (default)</li> <li>`9:16` - vertical/portrait aspect ratio.</li> <li>`1:1` - square aspect ratio.</li> </ul>
25
+ attr_accessor :aspect_ratio
26
+
27
+ # Override the resolution and scale the video to render at a different size. When using scaleTo the video should be edited at the resolution dimensions, i.e. use font sizes that look best at HD, then use scaleTo to output the video at SD and the text will be scaled to the correct size. This is useful if you want to create multiple video sizes. <ul> <li>`preview` - 512px x 288px @ 15fps</li> <li>`mobile` - 640px x 360px @ 25fps</li> <li>`sd` - 1024px x 576px @25fps</li> <li>`hd` - 1280px x 720px @25fps</li> <li>`1080` - 1920px x 1080px @25fps</li> </ul>
28
+ attr_accessor :scale_to
29
+
30
+ attr_accessor :poster
31
+
32
+ attr_accessor :thumbnail
33
+
22
34
  class EnumAttributeValidator
23
35
  attr_reader :datatype
24
36
  attr_reader :allowable_values
@@ -45,7 +57,11 @@ module Shotstack
45
57
  def self.attribute_map
46
58
  {
47
59
  :'format' => :'format',
48
- :'resolution' => :'resolution'
60
+ :'resolution' => :'resolution',
61
+ :'aspect_ratio' => :'aspectRatio',
62
+ :'scale_to' => :'scaleTo',
63
+ :'poster' => :'poster',
64
+ :'thumbnail' => :'thumbnail'
49
65
  }
50
66
  end
51
67
 
@@ -53,10 +69,20 @@ module Shotstack
53
69
  def self.openapi_types
54
70
  {
55
71
  :'format' => :'String',
56
- :'resolution' => :'String'
72
+ :'resolution' => :'String',
73
+ :'aspect_ratio' => :'String',
74
+ :'scale_to' => :'String',
75
+ :'poster' => :'Poster',
76
+ :'thumbnail' => :'Thumbnail'
57
77
  }
58
78
  end
59
79
 
80
+ # List of attributes with nullable: true
81
+ def self.openapi_nullable
82
+ Set.new([
83
+ ])
84
+ end
85
+
60
86
  # Initializes the object
61
87
  # @param [Hash] attributes Model attributes in the form of hash
62
88
  def initialize(attributes = {})
@@ -79,6 +105,22 @@ module Shotstack
79
105
  if attributes.key?(:'resolution')
80
106
  self.resolution = attributes[:'resolution']
81
107
  end
108
+
109
+ if attributes.key?(:'aspect_ratio')
110
+ self.aspect_ratio = attributes[:'aspect_ratio']
111
+ end
112
+
113
+ if attributes.key?(:'scale_to')
114
+ self.scale_to = attributes[:'scale_to']
115
+ end
116
+
117
+ if attributes.key?(:'poster')
118
+ self.poster = attributes[:'poster']
119
+ end
120
+
121
+ if attributes.key?(:'thumbnail')
122
+ self.thumbnail = attributes[:'thumbnail']
123
+ end
82
124
  end
83
125
 
84
126
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -105,6 +147,10 @@ module Shotstack
105
147
  return false if @resolution.nil?
106
148
  resolution_validator = EnumAttributeValidator.new('String', ["preview", "mobile", "sd", "hd", "1080"])
107
149
  return false unless resolution_validator.valid?(@resolution)
150
+ aspect_ratio_validator = EnumAttributeValidator.new('String', ["16:9", "9:16", "1:1"])
151
+ return false unless aspect_ratio_validator.valid?(@aspect_ratio)
152
+ scale_to_validator = EnumAttributeValidator.new('String', ["preview", "mobile", "sd", "hd", "1080"])
153
+ return false unless scale_to_validator.valid?(@scale_to)
108
154
  true
109
155
  end
110
156
 
@@ -128,13 +174,37 @@ module Shotstack
128
174
  @resolution = resolution
129
175
  end
130
176
 
177
+ # Custom attribute writer method checking allowed values (enum).
178
+ # @param [Object] aspect_ratio Object to be assigned
179
+ def aspect_ratio=(aspect_ratio)
180
+ validator = EnumAttributeValidator.new('String', ["16:9", "9:16", "1:1"])
181
+ unless validator.valid?(aspect_ratio)
182
+ fail ArgumentError, "invalid value for \"aspect_ratio\", must be one of #{validator.allowable_values}."
183
+ end
184
+ @aspect_ratio = aspect_ratio
185
+ end
186
+
187
+ # Custom attribute writer method checking allowed values (enum).
188
+ # @param [Object] scale_to Object to be assigned
189
+ def scale_to=(scale_to)
190
+ validator = EnumAttributeValidator.new('String', ["preview", "mobile", "sd", "hd", "1080"])
191
+ unless validator.valid?(scale_to)
192
+ fail ArgumentError, "invalid value for \"scale_to\", must be one of #{validator.allowable_values}."
193
+ end
194
+ @scale_to = scale_to
195
+ end
196
+
131
197
  # Checks equality by comparing each attribute.
132
198
  # @param [Object] Object to be compared
133
199
  def ==(o)
134
200
  return true if self.equal?(o)
135
201
  self.class == o.class &&
136
202
  format == o.format &&
137
- resolution == o.resolution
203
+ resolution == o.resolution &&
204
+ aspect_ratio == o.aspect_ratio &&
205
+ scale_to == o.scale_to &&
206
+ poster == o.poster &&
207
+ thumbnail == o.thumbnail
138
208
  end
139
209
 
140
210
  # @see the `==` method
@@ -146,7 +216,7 @@ module Shotstack
146
216
  # Calculates hash code according to all attributes.
147
217
  # @return [Integer] Hash code
148
218
  def hash
149
- [format, resolution].hash
219
+ [format, resolution, aspect_ratio, scale_to, poster, thumbnail].hash
150
220
  end
151
221
 
152
222
  # Builds the object from hash
@@ -235,7 +305,11 @@ module Shotstack
235
305
  hash = {}
236
306
  self.class.attribute_map.each_pair do |attr, param|
237
307
  value = self.send(attr)
238
- next if value.nil?
308
+ if value.nil?
309
+ is_nullable = self.class.openapi_nullable.include?(attr)
310
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
311
+ end
312
+
239
313
  hash[param] = _to_hash(value)
240
314
  end
241
315
  hash
@@ -0,0 +1,213 @@
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 poster image for the video at a specific point from the timeline. The poster image size will match the size of the output video.
17
+ class Poster
18
+ # The point on the timeline in seconds to capture a single frame to use as the poster image.
19
+ attr_accessor :capture
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'capture' => :'capture'
25
+ }
26
+ end
27
+
28
+ # Attribute type mapping.
29
+ def self.openapi_types
30
+ {
31
+ :'capture' => :'Float'
32
+ }
33
+ end
34
+
35
+ # List of attributes with nullable: true
36
+ def self.openapi_nullable
37
+ Set.new([
38
+ ])
39
+ end
40
+
41
+ # Initializes the object
42
+ # @param [Hash] attributes Model attributes in the form of hash
43
+ def initialize(attributes = {})
44
+ if (!attributes.is_a?(Hash))
45
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Shotstack::Poster` initialize method"
46
+ end
47
+
48
+ # check to see if the attribute exists and convert string to symbol for hash key
49
+ attributes = attributes.each_with_object({}) { |(k, v), h|
50
+ if (!self.class.attribute_map.key?(k.to_sym))
51
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Shotstack::Poster`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
52
+ end
53
+ h[k.to_sym] = v
54
+ }
55
+
56
+ if attributes.key?(:'capture')
57
+ self.capture = attributes[:'capture']
58
+ end
59
+ end
60
+
61
+ # Show invalid properties with the reasons. Usually used together with valid?
62
+ # @return Array for valid properties with the reasons
63
+ def list_invalid_properties
64
+ invalid_properties = Array.new
65
+ if @capture.nil?
66
+ invalid_properties.push('invalid value for "capture", capture cannot be nil.')
67
+ end
68
+
69
+ invalid_properties
70
+ end
71
+
72
+ # Check to see if the all the properties in the model are valid
73
+ # @return true if the model is valid
74
+ def valid?
75
+ return false if @capture.nil?
76
+ true
77
+ end
78
+
79
+ # Checks equality by comparing each attribute.
80
+ # @param [Object] Object to be compared
81
+ def ==(o)
82
+ return true if self.equal?(o)
83
+ self.class == o.class &&
84
+ capture == o.capture
85
+ end
86
+
87
+ # @see the `==` method
88
+ # @param [Object] Object to be compared
89
+ def eql?(o)
90
+ self == o
91
+ end
92
+
93
+ # Calculates hash code according to all attributes.
94
+ # @return [Integer] Hash code
95
+ def hash
96
+ [capture].hash
97
+ end
98
+
99
+ # Builds the object from hash
100
+ # @param [Hash] attributes Model attributes in the form of hash
101
+ # @return [Object] Returns the model itself
102
+ def self.build_from_hash(attributes)
103
+ new.build_from_hash(attributes)
104
+ end
105
+
106
+ # Builds the object from hash
107
+ # @param [Hash] attributes Model attributes in the form of hash
108
+ # @return [Object] Returns the model itself
109
+ def build_from_hash(attributes)
110
+ return nil unless attributes.is_a?(Hash)
111
+ self.class.openapi_types.each_pair do |key, type|
112
+ if type =~ /\AArray<(.*)>/i
113
+ # check to ensure the input is an array given that the attribute
114
+ # is documented as an array but the input is not
115
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
116
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
117
+ end
118
+ elsif !attributes[self.class.attribute_map[key]].nil?
119
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
120
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
121
+ end
122
+
123
+ self
124
+ end
125
+
126
+ # Deserializes the data based on type
127
+ # @param string type Data type
128
+ # @param string value Value to be deserialized
129
+ # @return [Object] Deserialized data
130
+ def _deserialize(type, value)
131
+ case type.to_sym
132
+ when :DateTime
133
+ DateTime.parse(value)
134
+ when :Date
135
+ Date.parse(value)
136
+ when :String
137
+ value.to_s
138
+ when :Integer
139
+ value.to_i
140
+ when :Float
141
+ value.to_f
142
+ when :Boolean
143
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
144
+ true
145
+ else
146
+ false
147
+ end
148
+ when :Object
149
+ # generic object (usually a Hash), return directly
150
+ value
151
+ when /\AArray<(?<inner_type>.+)>\z/
152
+ inner_type = Regexp.last_match[:inner_type]
153
+ value.map { |v| _deserialize(inner_type, v) }
154
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
155
+ k_type = Regexp.last_match[:k_type]
156
+ v_type = Regexp.last_match[:v_type]
157
+ {}.tap do |hash|
158
+ value.each do |k, v|
159
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
160
+ end
161
+ end
162
+ else # model
163
+ Shotstack.const_get(type).build_from_hash(value)
164
+ end
165
+ end
166
+
167
+ # Returns the string representation of the object
168
+ # @return [String] String presentation of the object
169
+ def to_s
170
+ to_hash.to_s
171
+ end
172
+
173
+ # to_body is an alias to to_hash (backward compatibility)
174
+ # @return [Hash] Returns the object in the form of hash
175
+ def to_body
176
+ to_hash
177
+ end
178
+
179
+ # Returns the object in the form of hash
180
+ # @return [Hash] Returns the object in the form of hash
181
+ def to_hash
182
+ hash = {}
183
+ self.class.attribute_map.each_pair do |attr, param|
184
+ value = self.send(attr)
185
+ if value.nil?
186
+ is_nullable = self.class.openapi_nullable.include?(attr)
187
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
188
+ end
189
+
190
+ hash[param] = _to_hash(value)
191
+ end
192
+ hash
193
+ end
194
+
195
+ # Outputs non-array value in the form of hash
196
+ # For object, use to_hash. Otherwise, just return the value
197
+ # @param [Object] value Any valid value
198
+ # @return [Hash] Returns the value in the form of hash
199
+ def _to_hash(value)
200
+ if value.is_a?(Array)
201
+ value.compact.map { |v| _to_hash(v) }
202
+ elsif value.is_a?(Hash)
203
+ {}.tap do |hash|
204
+ value.each { |k, v| hash[k] = _to_hash(v) }
205
+ end
206
+ elsif value.respond_to? :to_hash
207
+ value.to_hash
208
+ else
209
+ value
210
+ end
211
+ end
212
+ end
213
+ end
@@ -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
- OpenAPI spec version: v1
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-beta3
9
+ OpenAPI Generator version: 4.2.1
10
10
 
11
11
  =end
12
12
 
@@ -14,8 +14,10 @@ require 'date'
14
14
 
15
15
  module Shotstack
16
16
  class QueuedResponse
17
+ # `true` if successfully queued, else `false`.
17
18
  attr_accessor :success
18
19
 
20
+ # `Created`, `Bad Request` or an error message.
19
21
  attr_accessor :message
20
22
 
21
23
  attr_accessor :response
@@ -38,6 +40,12 @@ module Shotstack
38
40
  }
39
41
  end
40
42
 
43
+ # List of attributes with nullable: true
44
+ def self.openapi_nullable
45
+ Set.new([
46
+ ])
47
+ end
48
+
41
49
  # Initializes the object
42
50
  # @param [Hash] attributes Model attributes in the form of hash
43
51
  def initialize(attributes = {})
@@ -202,7 +210,11 @@ module Shotstack
202
210
  hash = {}
203
211
  self.class.attribute_map.each_pair do |attr, param|
204
212
  value = self.send(attr)
205
- next if value.nil?
213
+ if value.nil?
214
+ is_nullable = self.class.openapi_nullable.include?(attr)
215
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
216
+ end
217
+
206
218
  hash[param] = _to_hash(value)
207
219
  end
208
220
  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
- OpenAPI spec version: v1
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-beta3
9
+ OpenAPI Generator version: 4.2.1
10
10
 
11
11
  =end
12
12
 
@@ -14,10 +14,10 @@ require 'date'
14
14
 
15
15
  module Shotstack
16
16
  class QueuedResponseData
17
- # Success response message
17
+ # Success response message or error details.
18
18
  attr_accessor :message
19
19
 
20
- # The id of the render task in UUID format
20
+ # The id of the render task in UUID format.
21
21
  attr_accessor :id
22
22
 
23
23
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -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