shotstack 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +387 -23
- data/lib/shotstack/models/asset.rb +1 -1
- data/lib/shotstack/models/asset_render_response.rb +5 -0
- data/lib/shotstack/models/asset_response.rb +5 -0
- data/lib/shotstack/models/asset_response_attributes.rb +15 -0
- data/lib/shotstack/models/asset_response_data.rb +10 -0
- data/lib/shotstack/models/audio_asset.rb +0 -2
- data/lib/shotstack/models/clip.rb +5 -11
- data/lib/shotstack/models/destinations.rb +6 -7
- data/lib/shotstack/models/edit.rb +1 -3
- data/lib/shotstack/models/flip_transformation.rb +0 -4
- data/lib/shotstack/models/html_asset.rb +0 -4
- data/lib/shotstack/models/mux_destination.rb +1 -1
- data/lib/shotstack/models/offset.rb +22 -26
- data/lib/shotstack/models/output.rb +15 -8
- data/lib/shotstack/models/render_response_data.rb +2 -15
- data/lib/shotstack/models/rotate_transformation.rb +0 -2
- data/lib/shotstack/models/s3_destination.rb +236 -0
- data/lib/shotstack/models/s3_destination_options.rb +270 -0
- data/lib/shotstack/models/shotstack_destination.rb +2 -4
- data/lib/shotstack/models/size.rb +3 -3
- data/lib/shotstack/models/skew_transformation.rb +0 -4
- data/lib/shotstack/models/soundtrack.rb +0 -2
- data/lib/shotstack/models/template_data_response.rb +1 -1
- data/lib/shotstack/models/template_data_response_data.rb +1 -2
- data/lib/shotstack/models/template_list_response_item.rb +0 -10
- data/lib/shotstack/models/template_render.rb +1 -1
- data/lib/shotstack/models/template_response.rb +1 -1
- data/lib/shotstack/models/timeline.rb +0 -4
- data/lib/shotstack/models/title_asset.rb +1 -7
- data/lib/shotstack/models/video_asset.rb +46 -2
- data/lib/shotstack/version.rb +1 -1
- data/lib/shotstack.rb +2 -0
- metadata +15 -12
@@ -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.io/docs/guide/) 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
|
+
# Send rendered videos to an [Amazon S3](https://shotstack.io/docs/guide/serving-assets/destinations/s3) bucket. Send files to any region with your own prefix and filename. AWS credentials are required and added via the [dashboard](https://dashboard.shotstack.io/integrations/s3), not in the request.
|
18
|
+
class S3Destination
|
19
|
+
# The destination to send rendered assets to - set to `s3` for S3.
|
20
|
+
attr_accessor :provider
|
21
|
+
|
22
|
+
attr_accessor :options
|
23
|
+
|
24
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
25
|
+
def self.attribute_map
|
26
|
+
{
|
27
|
+
:'provider' => :'provider',
|
28
|
+
:'options' => :'options'
|
29
|
+
}
|
30
|
+
end
|
31
|
+
|
32
|
+
# Returns all the JSON keys this model knows about
|
33
|
+
def self.acceptable_attributes
|
34
|
+
attribute_map.values
|
35
|
+
end
|
36
|
+
|
37
|
+
# Attribute type mapping.
|
38
|
+
def self.openapi_types
|
39
|
+
{
|
40
|
+
:'provider' => :'String',
|
41
|
+
:'options' => :'S3DestinationOptions'
|
42
|
+
}
|
43
|
+
end
|
44
|
+
|
45
|
+
# List of attributes with nullable: true
|
46
|
+
def self.openapi_nullable
|
47
|
+
Set.new([
|
48
|
+
])
|
49
|
+
end
|
50
|
+
|
51
|
+
# Initializes the object
|
52
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
53
|
+
def initialize(attributes = {})
|
54
|
+
if (!attributes.is_a?(Hash))
|
55
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Shotstack::S3Destination` initialize method"
|
56
|
+
end
|
57
|
+
|
58
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
59
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
60
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
61
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Shotstack::S3Destination`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
62
|
+
end
|
63
|
+
h[k.to_sym] = v
|
64
|
+
}
|
65
|
+
|
66
|
+
if attributes.key?(:'provider')
|
67
|
+
self.provider = attributes[:'provider']
|
68
|
+
else
|
69
|
+
self.provider = 's3'
|
70
|
+
end
|
71
|
+
|
72
|
+
if attributes.key?(:'options')
|
73
|
+
self.options = attributes[:'options']
|
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 @provider.nil?
|
82
|
+
invalid_properties.push('invalid value for "provider", provider 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 @provider.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
|
+
provider == o.provider &&
|
101
|
+
options == o.options
|
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
|
+
[provider, options].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
|
@@ -0,0 +1,270 @@
|
|
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.io/docs/guide/) 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
|
+
# Pass additional options to control how files are stored in S3.
|
18
|
+
class S3DestinationOptions
|
19
|
+
# Choose the region to send the file to. Must be a valid [AWS region](https://docs.aws.amazon.com/general/latest/gr/s3.html#s3_region) string like `us-east-1` or `ap-southeast-2`.
|
20
|
+
attr_accessor :region
|
21
|
+
|
22
|
+
# The bucket name to send files to. The bucket must exist in the AWS account before files can be sent.
|
23
|
+
attr_accessor :bucket
|
24
|
+
|
25
|
+
# A prefix for the file being sent. This is typically a folder name, i.e. `videos` or `customerId/videos`.
|
26
|
+
attr_accessor :prefix
|
27
|
+
|
28
|
+
# Use your own filename instead of the default render ID filename. Note: omit the file extension as this will be appended depending n the output format. Also `poster.jpg` and `-thumb.jpg` will be appended for poster and thumbnail images.
|
29
|
+
attr_accessor :filename
|
30
|
+
|
31
|
+
# Sets the S3 Access Control List (acl) permissions. Default is `private`. Must use a valid S3 [Canned ACL](https://docs.aws.amazon.com/AmazonS3/latest/userguide/acl-overview.html#canned-acl).
|
32
|
+
attr_accessor :acl
|
33
|
+
|
34
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
35
|
+
def self.attribute_map
|
36
|
+
{
|
37
|
+
:'region' => :'region',
|
38
|
+
:'bucket' => :'bucket',
|
39
|
+
:'prefix' => :'prefix',
|
40
|
+
:'filename' => :'filename',
|
41
|
+
:'acl' => :'acl'
|
42
|
+
}
|
43
|
+
end
|
44
|
+
|
45
|
+
# Returns all the JSON keys this model knows about
|
46
|
+
def self.acceptable_attributes
|
47
|
+
attribute_map.values
|
48
|
+
end
|
49
|
+
|
50
|
+
# Attribute type mapping.
|
51
|
+
def self.openapi_types
|
52
|
+
{
|
53
|
+
:'region' => :'String',
|
54
|
+
:'bucket' => :'String',
|
55
|
+
:'prefix' => :'String',
|
56
|
+
:'filename' => :'String',
|
57
|
+
:'acl' => :'String'
|
58
|
+
}
|
59
|
+
end
|
60
|
+
|
61
|
+
# List of attributes with nullable: true
|
62
|
+
def self.openapi_nullable
|
63
|
+
Set.new([
|
64
|
+
])
|
65
|
+
end
|
66
|
+
|
67
|
+
# Initializes the object
|
68
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
69
|
+
def initialize(attributes = {})
|
70
|
+
if (!attributes.is_a?(Hash))
|
71
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Shotstack::S3DestinationOptions` initialize method"
|
72
|
+
end
|
73
|
+
|
74
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
75
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
76
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
77
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Shotstack::S3DestinationOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
78
|
+
end
|
79
|
+
h[k.to_sym] = v
|
80
|
+
}
|
81
|
+
|
82
|
+
if attributes.key?(:'region')
|
83
|
+
self.region = attributes[:'region']
|
84
|
+
end
|
85
|
+
|
86
|
+
if attributes.key?(:'bucket')
|
87
|
+
self.bucket = attributes[:'bucket']
|
88
|
+
end
|
89
|
+
|
90
|
+
if attributes.key?(:'prefix')
|
91
|
+
self.prefix = attributes[:'prefix']
|
92
|
+
end
|
93
|
+
|
94
|
+
if attributes.key?(:'filename')
|
95
|
+
self.filename = attributes[:'filename']
|
96
|
+
end
|
97
|
+
|
98
|
+
if attributes.key?(:'acl')
|
99
|
+
self.acl = attributes[:'acl']
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
104
|
+
# @return Array for valid properties with the reasons
|
105
|
+
def list_invalid_properties
|
106
|
+
invalid_properties = Array.new
|
107
|
+
if @region.nil?
|
108
|
+
invalid_properties.push('invalid value for "region", region cannot be nil.')
|
109
|
+
end
|
110
|
+
|
111
|
+
if @bucket.nil?
|
112
|
+
invalid_properties.push('invalid value for "bucket", bucket cannot be nil.')
|
113
|
+
end
|
114
|
+
|
115
|
+
invalid_properties
|
116
|
+
end
|
117
|
+
|
118
|
+
# Check to see if the all the properties in the model are valid
|
119
|
+
# @return true if the model is valid
|
120
|
+
def valid?
|
121
|
+
return false if @region.nil?
|
122
|
+
return false if @bucket.nil?
|
123
|
+
true
|
124
|
+
end
|
125
|
+
|
126
|
+
# Checks equality by comparing each attribute.
|
127
|
+
# @param [Object] Object to be compared
|
128
|
+
def ==(o)
|
129
|
+
return true if self.equal?(o)
|
130
|
+
self.class == o.class &&
|
131
|
+
region == o.region &&
|
132
|
+
bucket == o.bucket &&
|
133
|
+
prefix == o.prefix &&
|
134
|
+
filename == o.filename &&
|
135
|
+
acl == o.acl
|
136
|
+
end
|
137
|
+
|
138
|
+
# @see the `==` method
|
139
|
+
# @param [Object] Object to be compared
|
140
|
+
def eql?(o)
|
141
|
+
self == o
|
142
|
+
end
|
143
|
+
|
144
|
+
# Calculates hash code according to all attributes.
|
145
|
+
# @return [Integer] Hash code
|
146
|
+
def hash
|
147
|
+
[region, bucket, prefix, filename, acl].hash
|
148
|
+
end
|
149
|
+
|
150
|
+
# Builds the object from hash
|
151
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
152
|
+
# @return [Object] Returns the model itself
|
153
|
+
def self.build_from_hash(attributes)
|
154
|
+
new.build_from_hash(attributes)
|
155
|
+
end
|
156
|
+
|
157
|
+
# Builds the object from hash
|
158
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
159
|
+
# @return [Object] Returns the model itself
|
160
|
+
def build_from_hash(attributes)
|
161
|
+
return nil unless attributes.is_a?(Hash)
|
162
|
+
self.class.openapi_types.each_pair do |key, type|
|
163
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
164
|
+
self.send("#{key}=", nil)
|
165
|
+
elsif type =~ /\AArray<(.*)>/i
|
166
|
+
# check to ensure the input is an array given that the attribute
|
167
|
+
# is documented as an array but the input is not
|
168
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
169
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
170
|
+
end
|
171
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
172
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
173
|
+
end
|
174
|
+
end
|
175
|
+
|
176
|
+
self
|
177
|
+
end
|
178
|
+
|
179
|
+
# Deserializes the data based on type
|
180
|
+
# @param string type Data type
|
181
|
+
# @param string value Value to be deserialized
|
182
|
+
# @return [Object] Deserialized data
|
183
|
+
def _deserialize(type, value)
|
184
|
+
case type.to_sym
|
185
|
+
when :Time
|
186
|
+
Time.parse(value)
|
187
|
+
when :Date
|
188
|
+
Date.parse(value)
|
189
|
+
when :String
|
190
|
+
value.to_s
|
191
|
+
when :Integer
|
192
|
+
value.to_i
|
193
|
+
when :Float
|
194
|
+
value.to_f
|
195
|
+
when :Boolean
|
196
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
197
|
+
true
|
198
|
+
else
|
199
|
+
false
|
200
|
+
end
|
201
|
+
when :Object
|
202
|
+
# generic object (usually a Hash), return directly
|
203
|
+
value
|
204
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
205
|
+
inner_type = Regexp.last_match[:inner_type]
|
206
|
+
value.map { |v| _deserialize(inner_type, v) }
|
207
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
208
|
+
k_type = Regexp.last_match[:k_type]
|
209
|
+
v_type = Regexp.last_match[:v_type]
|
210
|
+
{}.tap do |hash|
|
211
|
+
value.each do |k, v|
|
212
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
213
|
+
end
|
214
|
+
end
|
215
|
+
else # model
|
216
|
+
# models (e.g. Pet) or oneOf
|
217
|
+
klass = Shotstack.const_get(type)
|
218
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
219
|
+
end
|
220
|
+
end
|
221
|
+
|
222
|
+
# Returns the string representation of the object
|
223
|
+
# @return [String] String presentation of the object
|
224
|
+
def to_s
|
225
|
+
to_hash.to_s
|
226
|
+
end
|
227
|
+
|
228
|
+
# to_body is an alias to to_hash (backward compatibility)
|
229
|
+
# @return [Hash] Returns the object in the form of hash
|
230
|
+
def to_body
|
231
|
+
to_hash
|
232
|
+
end
|
233
|
+
|
234
|
+
# Returns the object in the form of hash
|
235
|
+
# @return [Hash] Returns the object in the form of hash
|
236
|
+
def to_hash
|
237
|
+
hash = {}
|
238
|
+
self.class.attribute_map.each_pair do |attr, param|
|
239
|
+
value = self.send(attr)
|
240
|
+
if value.nil?
|
241
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
242
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
243
|
+
end
|
244
|
+
|
245
|
+
hash[param] = _to_hash(value)
|
246
|
+
end
|
247
|
+
hash
|
248
|
+
end
|
249
|
+
|
250
|
+
# Outputs non-array value in the form of hash
|
251
|
+
# For object, use to_hash. Otherwise, just return the value
|
252
|
+
# @param [Object] value Any valid value
|
253
|
+
# @return [Hash] Returns the value in the form of hash
|
254
|
+
def _to_hash(value)
|
255
|
+
if value.is_a?(Array)
|
256
|
+
value.compact.map { |v| _to_hash(v) }
|
257
|
+
elsif value.is_a?(Hash)
|
258
|
+
{}.tap do |hash|
|
259
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
260
|
+
end
|
261
|
+
elsif value.respond_to? :to_hash
|
262
|
+
value.to_hash
|
263
|
+
else
|
264
|
+
value
|
265
|
+
end
|
266
|
+
end
|
267
|
+
|
268
|
+
end
|
269
|
+
|
270
|
+
end
|
@@ -14,12 +14,12 @@ require 'date'
|
|
14
14
|
require 'time'
|
15
15
|
|
16
16
|
module Shotstack
|
17
|
-
# Send rendered assets to the
|
17
|
+
# Send rendered assets to the [Shotstack hosting and CDN](https://shotstack.io/docs/guide/serving-assets/destinations/shotstack) service. This destination is enabled by default.
|
18
18
|
class ShotstackDestination
|
19
19
|
# The destination to send rendered assets to - set to `shotstack` for Shotstack hosting and CDN.
|
20
20
|
attr_accessor :provider
|
21
21
|
|
22
|
-
# Set to `true` to opt-out from the Shotstack hosting and CDN service. All files must be downloaded within 24 hours of rendering.
|
22
|
+
# Set to `true` to [opt-out](https://shotstack.io/docs/guide/serving-assets/self-host) from the Shotstack hosting and CDN service. All files must be downloaded within 24 hours of rendering.
|
23
23
|
attr_accessor :exclude
|
24
24
|
|
25
25
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -72,8 +72,6 @@ module Shotstack
|
|
72
72
|
|
73
73
|
if attributes.key?(:'exclude')
|
74
74
|
self.exclude = attributes[:'exclude']
|
75
|
-
else
|
76
|
-
self.exclude = false
|
77
75
|
end
|
78
76
|
end
|
79
77
|
|
@@ -14,12 +14,12 @@ require 'date'
|
|
14
14
|
require 'time'
|
15
15
|
|
16
16
|
module Shotstack
|
17
|
-
# Set a custom size for a video or image. When using a custom size omit the `resolution` and `aspectRatio`. Custom sizes must be divisible by 2 based on the encoder specifications.
|
17
|
+
# Set a custom size for a video or image in pixels. When using a custom size omit the `resolution` and `aspectRatio`. Custom sizes must be divisible by 2 based on the encoder specifications.
|
18
18
|
class Size
|
19
|
-
# Set a custom width for the video or image file. Value must be divisible by 2. Maximum video width is 1920px, maximum image width is 4096px.
|
19
|
+
# Set a custom width for the video or image file in pixels. Value must be divisible by 2. Maximum video width is 1920px, maximum image width is 4096px.
|
20
20
|
attr_accessor :width
|
21
21
|
|
22
|
-
# Set a custom height for the video or image file. Value must be divisible by 2. Maximum video height is 1920px, maximum image height is 4096px.
|
22
|
+
# Set a custom height for the video or image file in pixels. Value must be divisible by 2. Maximum video height is 1920px, maximum image height is 4096px.
|
23
23
|
attr_accessor :height
|
24
24
|
|
25
25
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -14,7 +14,7 @@ require 'date'
|
|
14
14
|
require 'time'
|
15
15
|
|
16
16
|
module Shotstack
|
17
|
-
# The template data including the template name and Edit.
|
17
|
+
# The template data including the template name and [Edit](#tocs_edit).
|
18
18
|
class TemplateDataResponse
|
19
19
|
# `true` if successfully created, else `false`.
|
20
20
|
attr_accessor :success
|
@@ -25,7 +25,6 @@ module Shotstack
|
|
25
25
|
# The owner id of the templates.
|
26
26
|
attr_accessor :owner
|
27
27
|
|
28
|
-
# The [Edit](#tocs_edit) template.
|
29
28
|
attr_accessor :template
|
30
29
|
|
31
30
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -49,7 +48,7 @@ module Shotstack
|
|
49
48
|
:'id' => :'String',
|
50
49
|
:'name' => :'String',
|
51
50
|
:'owner' => :'String',
|
52
|
-
:'template' => :'
|
51
|
+
:'template' => :'Edit'
|
53
52
|
}
|
54
53
|
end
|
55
54
|
|
@@ -103,14 +103,6 @@ module Shotstack
|
|
103
103
|
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
104
104
|
end
|
105
105
|
|
106
|
-
if @created.nil?
|
107
|
-
invalid_properties.push('invalid value for "created", created cannot be nil.')
|
108
|
-
end
|
109
|
-
|
110
|
-
if @updated.nil?
|
111
|
-
invalid_properties.push('invalid value for "updated", updated cannot be nil.')
|
112
|
-
end
|
113
|
-
|
114
106
|
invalid_properties
|
115
107
|
end
|
116
108
|
|
@@ -119,8 +111,6 @@ module Shotstack
|
|
119
111
|
def valid?
|
120
112
|
return false if @id.nil?
|
121
113
|
return false if @name.nil?
|
122
|
-
return false if @created.nil?
|
123
|
-
return false if @updated.nil?
|
124
114
|
true
|
125
115
|
end
|
126
116
|
|
@@ -14,7 +14,7 @@ require 'date'
|
|
14
14
|
require 'time'
|
15
15
|
|
16
16
|
module Shotstack
|
17
|
-
#
|
17
|
+
# Configure the id and optional merge fields to render a template by id.
|
18
18
|
class TemplateRender
|
19
19
|
# The id of the template to render in UUID format.
|
20
20
|
attr_accessor :id
|
@@ -14,7 +14,7 @@ require 'date'
|
|
14
14
|
require 'time'
|
15
15
|
|
16
16
|
module Shotstack
|
17
|
-
# The response received after a [template](#create-
|
17
|
+
# The response received after a [template](#create-template) is submitted. The template is saved and a unique template id is returned.
|
18
18
|
class TemplateResponse
|
19
19
|
# `true` if successfully created, else `false`.
|
20
20
|
attr_accessor :success
|
@@ -84,8 +84,6 @@ module Shotstack
|
|
84
84
|
|
85
85
|
if attributes.key?(:'background')
|
86
86
|
self.background = attributes[:'background']
|
87
|
-
else
|
88
|
-
self.background = '#000000'
|
89
87
|
end
|
90
88
|
|
91
89
|
if attributes.key?(:'fonts')
|
@@ -102,8 +100,6 @@ module Shotstack
|
|
102
100
|
|
103
101
|
if attributes.key?(:'cache')
|
104
102
|
self.cache = attributes[:'cache']
|
105
|
-
else
|
106
|
-
self.cache = true
|
107
103
|
end
|
108
104
|
end
|
109
105
|
|