shotstack 0.1.8 → 0.1.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1099 -11
- data/lib/shotstack/api/edit_api.rb +80 -8
- data/lib/shotstack/api/serve_api.rb +7 -7
- data/lib/shotstack/api_client.rb +3 -3
- data/lib/shotstack/api_error.rb +1 -1
- data/lib/shotstack/configuration.rb +8 -5
- data/lib/shotstack/models/asset_render_response.rb +1 -1
- data/lib/shotstack/models/asset_response.rb +1 -1
- data/lib/shotstack/models/asset_response_attributes.rb +1 -1
- data/lib/shotstack/models/asset_response_data.rb +1 -1
- data/lib/shotstack/models/audio_asset.rb +1 -1
- data/lib/shotstack/models/clip.rb +15 -6
- data/lib/shotstack/models/crop.rb +1 -1
- data/lib/shotstack/models/edit.rb +14 -2
- data/lib/shotstack/models/flip_transformation.rb +234 -0
- data/lib/shotstack/models/font.rb +1 -1
- data/lib/shotstack/models/html_asset.rb +1 -1
- data/lib/shotstack/models/image_asset.rb +2 -2
- data/lib/shotstack/models/luma_asset.rb +1 -1
- data/lib/shotstack/models/merge_field.rb +236 -0
- data/lib/shotstack/models/offset.rb +1 -1
- data/lib/shotstack/models/output.rb +18 -8
- data/lib/shotstack/models/poster.rb +1 -1
- data/lib/shotstack/models/probe_response.rb +255 -0
- data/lib/shotstack/models/queued_response.rb +1 -1
- data/lib/shotstack/models/queued_response_data.rb +1 -1
- data/lib/shotstack/models/range.rb +1 -1
- data/lib/shotstack/models/render_response.rb +1 -1
- data/lib/shotstack/models/render_response_data.rb +1 -1
- data/lib/shotstack/models/rotate_transformation.rb +222 -0
- data/lib/shotstack/models/shotstack_destination.rb +1 -1
- data/lib/shotstack/models/size.rb +1 -1
- data/lib/shotstack/models/skew_transformation.rb +234 -0
- data/lib/shotstack/models/soundtrack.rb +1 -1
- data/lib/shotstack/models/thumbnail.rb +1 -1
- data/lib/shotstack/models/timeline.rb +1 -1
- data/lib/shotstack/models/title_asset.rb +1 -1
- data/lib/shotstack/models/track.rb +1 -1
- data/lib/shotstack/models/transformation.rb +237 -0
- data/lib/shotstack/models/transition.rb +1 -1
- data/lib/shotstack/models/video_asset.rb +1 -1
- data/lib/shotstack/version.rb +2 -2
- data/lib/shotstack.rb +7 -1
- data/shotstack.gemspec +1 -1
- metadata +15 -10
@@ -0,0 +1,234 @@
|
|
1
|
+
=begin
|
2
|
+
#Shotstack
|
3
|
+
|
4
|
+
#Shotstack is a video, image and audio editing service that allows for the automated generation of videos, images and audio using JSON and a RESTful API. You arrange and configure an edit and POST it to the API which will render your media and provide a file location when complete. For more details visit [shotstack.io](https://shotstack.io) or checkout our [getting started](https://shotstack.gitbook.io/docs/guides/getting-started) documentation. There are two main API's, one for editing and generating assets (Edit API) and one for managing hosted assets (Serve API). The Edit API base URL is: <b>https://api.shotstack.io/{version}</b> The Serve API base URL is: <b>https://api.shotstack.io/serve/{version}</b>
|
5
|
+
|
6
|
+
The version of the OpenAPI document: v1
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.4.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module Shotstack
|
17
|
+
# Flip a clip vertically or horizontally. Acts as a mirror effect of the clip along the selected plane.
|
18
|
+
class FlipTransformation
|
19
|
+
# Flip a clip horizontally.
|
20
|
+
attr_accessor :horizontal
|
21
|
+
|
22
|
+
# Flip a clip vertically.
|
23
|
+
attr_accessor :vertical
|
24
|
+
|
25
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
26
|
+
def self.attribute_map
|
27
|
+
{
|
28
|
+
:'horizontal' => :'horizontal',
|
29
|
+
:'vertical' => :'vertical'
|
30
|
+
}
|
31
|
+
end
|
32
|
+
|
33
|
+
# Returns all the JSON keys this model knows about
|
34
|
+
def self.acceptable_attributes
|
35
|
+
attribute_map.values
|
36
|
+
end
|
37
|
+
|
38
|
+
# Attribute type mapping.
|
39
|
+
def self.openapi_types
|
40
|
+
{
|
41
|
+
:'horizontal' => :'Boolean',
|
42
|
+
:'vertical' => :'Boolean'
|
43
|
+
}
|
44
|
+
end
|
45
|
+
|
46
|
+
# List of attributes with nullable: true
|
47
|
+
def self.openapi_nullable
|
48
|
+
Set.new([
|
49
|
+
])
|
50
|
+
end
|
51
|
+
|
52
|
+
# Initializes the object
|
53
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
54
|
+
def initialize(attributes = {})
|
55
|
+
if (!attributes.is_a?(Hash))
|
56
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Shotstack::FlipTransformation` initialize method"
|
57
|
+
end
|
58
|
+
|
59
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
60
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
61
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
62
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Shotstack::FlipTransformation`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
63
|
+
end
|
64
|
+
h[k.to_sym] = v
|
65
|
+
}
|
66
|
+
|
67
|
+
if attributes.key?(:'horizontal')
|
68
|
+
self.horizontal = attributes[:'horizontal']
|
69
|
+
else
|
70
|
+
self.horizontal = false
|
71
|
+
end
|
72
|
+
|
73
|
+
if attributes.key?(:'vertical')
|
74
|
+
self.vertical = attributes[:'vertical']
|
75
|
+
else
|
76
|
+
self.vertical = false
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
81
|
+
# @return Array for valid properties with the reasons
|
82
|
+
def list_invalid_properties
|
83
|
+
invalid_properties = Array.new
|
84
|
+
invalid_properties
|
85
|
+
end
|
86
|
+
|
87
|
+
# Check to see if the all the properties in the model are valid
|
88
|
+
# @return true if the model is valid
|
89
|
+
def valid?
|
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
|
+
horizontal == o.horizontal &&
|
99
|
+
vertical == o.vertical
|
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
|
+
[horizontal, vertical].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 attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
128
|
+
self.send("#{key}=", nil)
|
129
|
+
elsif type =~ /\AArray<(.*)>/i
|
130
|
+
# check to ensure the input is an array given that the attribute
|
131
|
+
# is documented as an array but the input is not
|
132
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
133
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
134
|
+
end
|
135
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
136
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
137
|
+
end
|
138
|
+
end
|
139
|
+
|
140
|
+
self
|
141
|
+
end
|
142
|
+
|
143
|
+
# Deserializes the data based on type
|
144
|
+
# @param string type Data type
|
145
|
+
# @param string value Value to be deserialized
|
146
|
+
# @return [Object] Deserialized data
|
147
|
+
def _deserialize(type, value)
|
148
|
+
case type.to_sym
|
149
|
+
when :Time
|
150
|
+
Time.parse(value)
|
151
|
+
when :Date
|
152
|
+
Date.parse(value)
|
153
|
+
when :String
|
154
|
+
value.to_s
|
155
|
+
when :Integer
|
156
|
+
value.to_i
|
157
|
+
when :Float
|
158
|
+
value.to_f
|
159
|
+
when :Boolean
|
160
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
161
|
+
true
|
162
|
+
else
|
163
|
+
false
|
164
|
+
end
|
165
|
+
when :Object
|
166
|
+
# generic object (usually a Hash), return directly
|
167
|
+
value
|
168
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
169
|
+
inner_type = Regexp.last_match[:inner_type]
|
170
|
+
value.map { |v| _deserialize(inner_type, v) }
|
171
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
172
|
+
k_type = Regexp.last_match[:k_type]
|
173
|
+
v_type = Regexp.last_match[:v_type]
|
174
|
+
{}.tap do |hash|
|
175
|
+
value.each do |k, v|
|
176
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
177
|
+
end
|
178
|
+
end
|
179
|
+
else # model
|
180
|
+
# models (e.g. Pet) or oneOf
|
181
|
+
klass = Shotstack.const_get(type)
|
182
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
183
|
+
end
|
184
|
+
end
|
185
|
+
|
186
|
+
# Returns the string representation of the object
|
187
|
+
# @return [String] String presentation of the object
|
188
|
+
def to_s
|
189
|
+
to_hash.to_s
|
190
|
+
end
|
191
|
+
|
192
|
+
# to_body is an alias to to_hash (backward compatibility)
|
193
|
+
# @return [Hash] Returns the object in the form of hash
|
194
|
+
def to_body
|
195
|
+
to_hash
|
196
|
+
end
|
197
|
+
|
198
|
+
# Returns the object in the form of hash
|
199
|
+
# @return [Hash] Returns the object in the form of hash
|
200
|
+
def to_hash
|
201
|
+
hash = {}
|
202
|
+
self.class.attribute_map.each_pair do |attr, param|
|
203
|
+
value = self.send(attr)
|
204
|
+
if value.nil?
|
205
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
206
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
207
|
+
end
|
208
|
+
|
209
|
+
hash[param] = _to_hash(value)
|
210
|
+
end
|
211
|
+
hash
|
212
|
+
end
|
213
|
+
|
214
|
+
# Outputs non-array value in the form of hash
|
215
|
+
# For object, use to_hash. Otherwise, just return the value
|
216
|
+
# @param [Object] value Any valid value
|
217
|
+
# @return [Hash] Returns the value in the form of hash
|
218
|
+
def _to_hash(value)
|
219
|
+
if value.is_a?(Array)
|
220
|
+
value.compact.map { |v| _to_hash(v) }
|
221
|
+
elsif value.is_a?(Hash)
|
222
|
+
{}.tap do |hash|
|
223
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
224
|
+
end
|
225
|
+
elsif value.respond_to? :to_hash
|
226
|
+
value.to_hash
|
227
|
+
else
|
228
|
+
value
|
229
|
+
end
|
230
|
+
end
|
231
|
+
|
232
|
+
end
|
233
|
+
|
234
|
+
end
|
@@ -6,7 +6,7 @@
|
|
6
6
|
The version of the OpenAPI document: v1
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 5.
|
9
|
+
OpenAPI Generator version: 5.4.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -15,7 +15,7 @@ require 'time'
|
|
15
15
|
require_relative 'asset'
|
16
16
|
|
17
17
|
module Shotstack
|
18
|
-
# The ImageAsset is used to create video from images. The src must be a publicly accessible URL to an image resource such as a jpg or png file.
|
18
|
+
# The ImageAsset is used to create video from images to compose an image. The src must be a publicly accessible URL to an image resource such as a jpg or png file.
|
19
19
|
class ImageAsset < Asset
|
20
20
|
# The type of asset - set to `image` for images.
|
21
21
|
attr_accessor :type
|
@@ -0,0 +1,236 @@
|
|
1
|
+
=begin
|
2
|
+
#Shotstack
|
3
|
+
|
4
|
+
#Shotstack is a video, image and audio editing service that allows for the automated generation of videos, images and audio using JSON and a RESTful API. You arrange and configure an edit and POST it to the API which will render your media and provide a file location when complete. For more details visit [shotstack.io](https://shotstack.io) or checkout our [getting started](https://shotstack.gitbook.io/docs/guides/getting-started) documentation. There are two main API's, one for editing and generating assets (Edit API) and one for managing hosted assets (Serve API). The Edit API base URL is: <b>https://api.shotstack.io/{version}</b> The Serve API base URL is: <b>https://api.shotstack.io/serve/{version}</b>
|
5
|
+
|
6
|
+
The version of the OpenAPI document: v1
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.4.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module Shotstack
|
17
|
+
# A merge field consists of a key; `find`, and a value; `replace`. Merge fields can be used to replace placeholders within the JSON edit to create re-usable templates. Placeholders should be a string with double brace delimiters, i.e. `\"{{NAME}}\"`. A placeholder can be used for any value within the JSON edit.
|
18
|
+
class MergeField
|
19
|
+
# The string to find <u>without</u> delimiters.
|
20
|
+
attr_accessor :find
|
21
|
+
|
22
|
+
# The replacement value. The replacement can be any valid JSON type - string, boolean, number, etc...
|
23
|
+
attr_accessor :replace
|
24
|
+
|
25
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
26
|
+
def self.attribute_map
|
27
|
+
{
|
28
|
+
:'find' => :'find',
|
29
|
+
:'replace' => :'replace'
|
30
|
+
}
|
31
|
+
end
|
32
|
+
|
33
|
+
# Returns all the JSON keys this model knows about
|
34
|
+
def self.acceptable_attributes
|
35
|
+
attribute_map.values
|
36
|
+
end
|
37
|
+
|
38
|
+
# Attribute type mapping.
|
39
|
+
def self.openapi_types
|
40
|
+
{
|
41
|
+
:'find' => :'String',
|
42
|
+
:'replace' => :'AnyType'
|
43
|
+
}
|
44
|
+
end
|
45
|
+
|
46
|
+
# List of attributes with nullable: true
|
47
|
+
def self.openapi_nullable
|
48
|
+
Set.new([
|
49
|
+
:'replace'
|
50
|
+
])
|
51
|
+
end
|
52
|
+
|
53
|
+
# Initializes the object
|
54
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
55
|
+
def initialize(attributes = {})
|
56
|
+
if (!attributes.is_a?(Hash))
|
57
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Shotstack::MergeField` initialize method"
|
58
|
+
end
|
59
|
+
|
60
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
61
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
62
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
63
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Shotstack::MergeField`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
64
|
+
end
|
65
|
+
h[k.to_sym] = v
|
66
|
+
}
|
67
|
+
|
68
|
+
if attributes.key?(:'find')
|
69
|
+
self.find = attributes[:'find']
|
70
|
+
end
|
71
|
+
|
72
|
+
if attributes.key?(:'replace')
|
73
|
+
self.replace = attributes[:'replace']
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
78
|
+
# @return Array for valid properties with the reasons
|
79
|
+
def list_invalid_properties
|
80
|
+
invalid_properties = Array.new
|
81
|
+
if @find.nil?
|
82
|
+
invalid_properties.push('invalid value for "find", find cannot be nil.')
|
83
|
+
end
|
84
|
+
|
85
|
+
invalid_properties
|
86
|
+
end
|
87
|
+
|
88
|
+
# Check to see if the all the properties in the model are valid
|
89
|
+
# @return true if the model is valid
|
90
|
+
def valid?
|
91
|
+
return false if @find.nil?
|
92
|
+
true
|
93
|
+
end
|
94
|
+
|
95
|
+
# Checks equality by comparing each attribute.
|
96
|
+
# @param [Object] Object to be compared
|
97
|
+
def ==(o)
|
98
|
+
return true if self.equal?(o)
|
99
|
+
self.class == o.class &&
|
100
|
+
find == o.find &&
|
101
|
+
replace == o.replace
|
102
|
+
end
|
103
|
+
|
104
|
+
# @see the `==` method
|
105
|
+
# @param [Object] Object to be compared
|
106
|
+
def eql?(o)
|
107
|
+
self == o
|
108
|
+
end
|
109
|
+
|
110
|
+
# Calculates hash code according to all attributes.
|
111
|
+
# @return [Integer] Hash code
|
112
|
+
def hash
|
113
|
+
[find, replace].hash
|
114
|
+
end
|
115
|
+
|
116
|
+
# Builds the object from hash
|
117
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
118
|
+
# @return [Object] Returns the model itself
|
119
|
+
def self.build_from_hash(attributes)
|
120
|
+
new.build_from_hash(attributes)
|
121
|
+
end
|
122
|
+
|
123
|
+
# Builds the object from hash
|
124
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
125
|
+
# @return [Object] Returns the model itself
|
126
|
+
def build_from_hash(attributes)
|
127
|
+
return nil unless attributes.is_a?(Hash)
|
128
|
+
self.class.openapi_types.each_pair do |key, type|
|
129
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
130
|
+
self.send("#{key}=", nil)
|
131
|
+
elsif type =~ /\AArray<(.*)>/i
|
132
|
+
# check to ensure the input is an array given that the attribute
|
133
|
+
# is documented as an array but the input is not
|
134
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
135
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
136
|
+
end
|
137
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
138
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
139
|
+
end
|
140
|
+
end
|
141
|
+
|
142
|
+
self
|
143
|
+
end
|
144
|
+
|
145
|
+
# Deserializes the data based on type
|
146
|
+
# @param string type Data type
|
147
|
+
# @param string value Value to be deserialized
|
148
|
+
# @return [Object] Deserialized data
|
149
|
+
def _deserialize(type, value)
|
150
|
+
case type.to_sym
|
151
|
+
when :Time
|
152
|
+
Time.parse(value)
|
153
|
+
when :Date
|
154
|
+
Date.parse(value)
|
155
|
+
when :String
|
156
|
+
value.to_s
|
157
|
+
when :Integer
|
158
|
+
value.to_i
|
159
|
+
when :Float
|
160
|
+
value.to_f
|
161
|
+
when :Boolean
|
162
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
163
|
+
true
|
164
|
+
else
|
165
|
+
false
|
166
|
+
end
|
167
|
+
when :Object
|
168
|
+
# generic object (usually a Hash), return directly
|
169
|
+
value
|
170
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
171
|
+
inner_type = Regexp.last_match[:inner_type]
|
172
|
+
value.map { |v| _deserialize(inner_type, v) }
|
173
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
174
|
+
k_type = Regexp.last_match[:k_type]
|
175
|
+
v_type = Regexp.last_match[:v_type]
|
176
|
+
{}.tap do |hash|
|
177
|
+
value.each do |k, v|
|
178
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
179
|
+
end
|
180
|
+
end
|
181
|
+
else # model
|
182
|
+
# models (e.g. Pet) or oneOf
|
183
|
+
klass = Shotstack.const_get(type)
|
184
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
185
|
+
end
|
186
|
+
end
|
187
|
+
|
188
|
+
# Returns the string representation of the object
|
189
|
+
# @return [String] String presentation of the object
|
190
|
+
def to_s
|
191
|
+
to_hash.to_s
|
192
|
+
end
|
193
|
+
|
194
|
+
# to_body is an alias to to_hash (backward compatibility)
|
195
|
+
# @return [Hash] Returns the object in the form of hash
|
196
|
+
def to_body
|
197
|
+
to_hash
|
198
|
+
end
|
199
|
+
|
200
|
+
# Returns the object in the form of hash
|
201
|
+
# @return [Hash] Returns the object in the form of hash
|
202
|
+
def to_hash
|
203
|
+
hash = {}
|
204
|
+
self.class.attribute_map.each_pair do |attr, param|
|
205
|
+
value = self.send(attr)
|
206
|
+
if value.nil?
|
207
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
208
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
209
|
+
end
|
210
|
+
|
211
|
+
hash[param] = _to_hash(value)
|
212
|
+
end
|
213
|
+
hash
|
214
|
+
end
|
215
|
+
|
216
|
+
# Outputs non-array value in the form of hash
|
217
|
+
# For object, use to_hash. Otherwise, just return the value
|
218
|
+
# @param [Object] value Any valid value
|
219
|
+
# @return [Hash] Returns the value in the form of hash
|
220
|
+
def _to_hash(value)
|
221
|
+
if value.is_a?(Array)
|
222
|
+
value.compact.map { |v| _to_hash(v) }
|
223
|
+
elsif value.is_a?(Hash)
|
224
|
+
{}.tap do |hash|
|
225
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
226
|
+
end
|
227
|
+
elsif value.respond_to? :to_hash
|
228
|
+
value.to_hash
|
229
|
+
else
|
230
|
+
value
|
231
|
+
end
|
232
|
+
end
|
233
|
+
|
234
|
+
end
|
235
|
+
|
236
|
+
end
|
@@ -6,7 +6,7 @@
|
|
6
6
|
The version of the OpenAPI document: v1
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 5.
|
9
|
+
OpenAPI Generator version: 5.4.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -27,7 +27,7 @@ module Shotstack
|
|
27
27
|
|
28
28
|
attr_accessor :size
|
29
29
|
|
30
|
-
# Override the default frames per second. Useful for when the source footage is recorded at 30fps, i.e. on mobile devices. Lower frame rates can be used to add cinematic quality (24fps) or to create smaller file size/faster render times or animated gifs (12 or 15fps). Default is 25fps. <ul> <li>`12` - 12fps</li> <li>`15` - 15fps</li> <li>`24` - 24fps</li> <li>`25` - 25fps</li> <li>`30` - 30fps</li> </ul>
|
30
|
+
# Override the default frames per second. Useful for when the source footage is recorded at 30fps, i.e. on mobile devices. Lower frame rates can be used to add cinematic quality (24fps) or to create smaller file size/faster render times or animated gifs (12 or 15fps). Default is 25fps. <ul> <li>`12` - 12fps</li> <li>`15` - 15fps</li> <li>`24` - 24fps</li> <li>`23.976` - 23.976fps</li> <li>`25` - 25fps</li> <li>`29.97` - 29.97fps</li> <li>`30` - 30fps</li> </ul>
|
31
31
|
attr_accessor :fps
|
32
32
|
|
33
33
|
# Override the resolution and scale the video or image to render at a different size. When using scaleTo the asset should be edited at the resolution dimensions, i.e. use font sizes that look best at HD, then use scaleTo to output the file at SD and the text will be scaled to the correct size. This is useful if you want to create multiple asset 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>
|
@@ -36,6 +36,9 @@ module Shotstack
|
|
36
36
|
# Adjust the output quality of the video, image or audio. Adjusting quality affects render speed, download speeds and storage requirements due to file size. The default `medium` provides the most optimized choice for all three factors. <ul> <li>`low` - slightly reduced quality, smaller file size</li> <li>`medium` - optimized quality, render speeds and file size</li> <li>`high` - slightly increased quality, larger file size</li> </ul>
|
37
37
|
attr_accessor :quality
|
38
38
|
|
39
|
+
# Loop settings for gif files. Set to `true` to loop, `false` to play only once.
|
40
|
+
attr_accessor :repeat
|
41
|
+
|
39
42
|
attr_accessor :range
|
40
43
|
|
41
44
|
attr_accessor :poster
|
@@ -77,6 +80,7 @@ module Shotstack
|
|
77
80
|
:'fps' => :'fps',
|
78
81
|
:'scale_to' => :'scaleTo',
|
79
82
|
:'quality' => :'quality',
|
83
|
+
:'repeat' => :'repeat',
|
80
84
|
:'range' => :'range',
|
81
85
|
:'poster' => :'poster',
|
82
86
|
:'thumbnail' => :'thumbnail',
|
@@ -96,9 +100,10 @@ module Shotstack
|
|
96
100
|
:'resolution' => :'String',
|
97
101
|
:'aspect_ratio' => :'String',
|
98
102
|
:'size' => :'Size',
|
99
|
-
:'fps' => :'
|
103
|
+
:'fps' => :'Float',
|
100
104
|
:'scale_to' => :'String',
|
101
105
|
:'quality' => :'String',
|
106
|
+
:'repeat' => :'Boolean',
|
102
107
|
:'range' => :'Range',
|
103
108
|
:'poster' => :'Poster',
|
104
109
|
:'thumbnail' => :'Thumbnail',
|
@@ -145,8 +150,6 @@ module Shotstack
|
|
145
150
|
|
146
151
|
if attributes.key?(:'fps')
|
147
152
|
self.fps = attributes[:'fps']
|
148
|
-
else
|
149
|
-
self.fps = 25
|
150
153
|
end
|
151
154
|
|
152
155
|
if attributes.key?(:'scale_to')
|
@@ -159,6 +162,12 @@ module Shotstack
|
|
159
162
|
self.quality = 'medium'
|
160
163
|
end
|
161
164
|
|
165
|
+
if attributes.key?(:'repeat')
|
166
|
+
self.repeat = attributes[:'repeat']
|
167
|
+
else
|
168
|
+
self.repeat = true
|
169
|
+
end
|
170
|
+
|
162
171
|
if attributes.key?(:'range')
|
163
172
|
self.range = attributes[:'range']
|
164
173
|
end
|
@@ -199,7 +208,7 @@ module Shotstack
|
|
199
208
|
return false unless resolution_validator.valid?(@resolution)
|
200
209
|
aspect_ratio_validator = EnumAttributeValidator.new('String', ["16:9", "9:16", "1:1", "4:5", "4:3"])
|
201
210
|
return false unless aspect_ratio_validator.valid?(@aspect_ratio)
|
202
|
-
fps_validator = EnumAttributeValidator.new('
|
211
|
+
fps_validator = EnumAttributeValidator.new('Float', [12, 15, 23.976, 24, 25, 29.97, 30])
|
203
212
|
return false unless fps_validator.valid?(@fps)
|
204
213
|
scale_to_validator = EnumAttributeValidator.new('String', ["preview", "mobile", "sd", "hd", "1080"])
|
205
214
|
return false unless scale_to_validator.valid?(@scale_to)
|
@@ -241,7 +250,7 @@ module Shotstack
|
|
241
250
|
# Custom attribute writer method checking allowed values (enum).
|
242
251
|
# @param [Object] fps Object to be assigned
|
243
252
|
def fps=(fps)
|
244
|
-
validator = EnumAttributeValidator.new('
|
253
|
+
validator = EnumAttributeValidator.new('Float', [12, 15, 23.976, 24, 25, 29.97, 30])
|
245
254
|
unless validator.valid?(fps)
|
246
255
|
fail ArgumentError, "invalid value for \"fps\", must be one of #{validator.allowable_values}."
|
247
256
|
end
|
@@ -280,6 +289,7 @@ module Shotstack
|
|
280
289
|
fps == o.fps &&
|
281
290
|
scale_to == o.scale_to &&
|
282
291
|
quality == o.quality &&
|
292
|
+
repeat == o.repeat &&
|
283
293
|
range == o.range &&
|
284
294
|
poster == o.poster &&
|
285
295
|
thumbnail == o.thumbnail &&
|
@@ -295,7 +305,7 @@ module Shotstack
|
|
295
305
|
# Calculates hash code according to all attributes.
|
296
306
|
# @return [Integer] Hash code
|
297
307
|
def hash
|
298
|
-
[format, resolution, aspect_ratio, size, fps, scale_to, quality, range, poster, thumbnail, destinations].hash
|
308
|
+
[format, resolution, aspect_ratio, size, fps, scale_to, quality, repeat, range, poster, thumbnail, destinations].hash
|
299
309
|
end
|
300
310
|
|
301
311
|
# Builds the object from hash
|