shotstack 0.1.8 → 0.1.9
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.
- checksums.yaml +4 -4
- data/lib/shotstack/api/edit_api.rb +75 -6
- data/lib/shotstack/api/serve_api.rb +6 -6
- data/lib/shotstack/models/clip.rb +14 -5
- data/lib/shotstack/models/edit.rb +13 -1
- data/lib/shotstack/models/flip_transformation.rb +234 -0
- data/lib/shotstack/models/image_asset.rb +1 -1
- data/lib/shotstack/models/merge_field.rb +236 -0
- data/lib/shotstack/models/output.rb +13 -1
- data/lib/shotstack/models/probe_response.rb +255 -0
- data/lib/shotstack/models/rotate_transformation.rb +222 -0
- data/lib/shotstack/models/skew_transformation.rb +234 -0
- data/lib/shotstack/models/transformation.rb +237 -0
- data/lib/shotstack/version.rb +1 -1
- data/lib/shotstack.rb +6 -0
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e9c1ddaba061aa41da26da530d278ab2ff9239268111a56aedd4a717114030e6
|
4
|
+
data.tar.gz: f3e7cffc5cbaefa285b48927d45f741cb27176f95dfc9c804b568407a8843a03
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a8c458a14834895ca0b889df64602048133a445d3b746cb9d6f0999e16c18a1f74f70d98a2818a1dca9d4dffd29af4110240e45cb642e95601ab151387fda14
|
7
|
+
data.tar.gz: dbc5351392e398c9ed963c5ce69e1b115db6d5f7a97401dc1c06c2c8972dfa11b3653b6756599b33c85ce1a8694f280ac0b7024794db210467f363ab05852a7e
|
@@ -20,9 +20,11 @@ module Shotstack
|
|
20
20
|
@api_client = api_client
|
21
21
|
end
|
22
22
|
# Get Render Status
|
23
|
-
# Get the rendering status, temporary asset url and details of a render by ID. **
|
23
|
+
# Get the rendering status, temporary asset url and details of a render by ID. **Base URL:** https://api.shotstack.io/{version}
|
24
24
|
# @param id [String] The id of the timeline render task in UUID format
|
25
25
|
# @param [Hash] opts the optional parameters
|
26
|
+
# @option opts [Boolean] :data Include the data parameter in the response. The data parameter includes the original timeline, output and other settings sent to the API.<br><br><b>Note:</b> the default is currently `true`, this is deprecated and the default will soon be `false`. If you rely on the data being returned in the response you should explicitly set the parameter to `true`.
|
27
|
+
# @option opts [Boolean] :merged Used when data is set to true, it will show the [merge fields](#tocs_mergefield) merged in to the data response.
|
26
28
|
# @return [RenderResponse]
|
27
29
|
def get_render(id, opts = {})
|
28
30
|
data, _status_code, _headers = get_render_with_http_info(id, opts)
|
@@ -30,9 +32,11 @@ module Shotstack
|
|
30
32
|
end
|
31
33
|
|
32
34
|
# Get Render Status
|
33
|
-
# Get the rendering status, temporary asset url and details of a render by ID. **
|
35
|
+
# Get the rendering status, temporary asset url and details of a render by ID. **Base URL:** https://api.shotstack.io/{version}
|
34
36
|
# @param id [String] The id of the timeline render task in UUID format
|
35
37
|
# @param [Hash] opts the optional parameters
|
38
|
+
# @option opts [Boolean] :data Include the data parameter in the response. The data parameter includes the original timeline, output and other settings sent to the API.<br><br><b>Note:</b> the default is currently `true`, this is deprecated and the default will soon be `false`. If you rely on the data being returned in the response you should explicitly set the parameter to `true`.
|
39
|
+
# @option opts [Boolean] :merged Used when data is set to true, it will show the [merge fields](#tocs_mergefield) merged in to the data response.
|
36
40
|
# @return [Array<(RenderResponse, Integer, Hash)>] RenderResponse data, response status code and response headers
|
37
41
|
def get_render_with_http_info(id, opts = {})
|
38
42
|
if @api_client.config.debugging
|
@@ -52,6 +56,8 @@ module Shotstack
|
|
52
56
|
|
53
57
|
# query parameters
|
54
58
|
query_params = opts[:query_params] || {}
|
59
|
+
query_params[:'data'] = opts[:'data'] if !opts[:'data'].nil?
|
60
|
+
query_params[:'merged'] = opts[:'merged'] if !opts[:'merged'].nil?
|
55
61
|
|
56
62
|
# header parameters
|
57
63
|
header_params = opts[:header_params] || {}
|
@@ -88,8 +94,8 @@ module Shotstack
|
|
88
94
|
end
|
89
95
|
|
90
96
|
# Render Asset
|
91
|
-
# Queue and render the contents of a timeline as a video, image or audio file.
|
92
|
-
# @param edit [Edit] The video, image or audio edit specified using JSON.
|
97
|
+
# Queue and render the contents of a timeline as a video, image or audio file. **Base URL:** https://api.shotstack.io/{version}
|
98
|
+
# @param edit [Edit] The video, image or audio edit specified using JSON.
|
93
99
|
# @param [Hash] opts the optional parameters
|
94
100
|
# @return [QueuedResponse]
|
95
101
|
def post_render(edit, opts = {})
|
@@ -98,8 +104,8 @@ module Shotstack
|
|
98
104
|
end
|
99
105
|
|
100
106
|
# Render Asset
|
101
|
-
# Queue and render the contents of a timeline as a video, image or audio file.
|
102
|
-
# @param edit [Edit] The video, image or audio edit specified using JSON.
|
107
|
+
# Queue and render the contents of a timeline as a video, image or audio file. **Base URL:** https://api.shotstack.io/{version}
|
108
|
+
# @param edit [Edit] The video, image or audio edit specified using JSON.
|
103
109
|
# @param [Hash] opts the optional parameters
|
104
110
|
# @return [Array<(QueuedResponse, Integer, Hash)>] QueuedResponse data, response status code and response headers
|
105
111
|
def post_render_with_http_info(edit, opts = {})
|
@@ -151,5 +157,68 @@ module Shotstack
|
|
151
157
|
end
|
152
158
|
return data, status_code, headers
|
153
159
|
end
|
160
|
+
|
161
|
+
# Inspect Media
|
162
|
+
# Inspects any media asset (image, video, audio) on the internet using a hosted version of [FFprobe](https://ffmpeg.org/ffprobe.html). The probe endpoint returns useful information about an asset such as width, height, duration, rotation, framerate, etc... **Base URL:** https://api.shotstack.io/{version}
|
163
|
+
# @param url [String] The URL of the media to inspect, must be **URL encoded**.
|
164
|
+
# @param [Hash] opts the optional parameters
|
165
|
+
# @return [ProbeResponse]
|
166
|
+
def probe(url, opts = {})
|
167
|
+
data, _status_code, _headers = probe_with_http_info(url, opts)
|
168
|
+
data
|
169
|
+
end
|
170
|
+
|
171
|
+
# Inspect Media
|
172
|
+
# Inspects any media asset (image, video, audio) on the internet using a hosted version of [FFprobe](https://ffmpeg.org/ffprobe.html). The probe endpoint returns useful information about an asset such as width, height, duration, rotation, framerate, etc... **Base URL:** https://api.shotstack.io/{version}
|
173
|
+
# @param url [String] The URL of the media to inspect, must be **URL encoded**.
|
174
|
+
# @param [Hash] opts the optional parameters
|
175
|
+
# @return [Array<(ProbeResponse, Integer, Hash)>] ProbeResponse data, response status code and response headers
|
176
|
+
def probe_with_http_info(url, opts = {})
|
177
|
+
if @api_client.config.debugging
|
178
|
+
@api_client.config.logger.debug 'Calling API: EditApi.probe ...'
|
179
|
+
end
|
180
|
+
# verify the required parameter 'url' is set
|
181
|
+
if @api_client.config.client_side_validation && url.nil?
|
182
|
+
fail ArgumentError, "Missing the required parameter 'url' when calling EditApi.probe"
|
183
|
+
end
|
184
|
+
# resource path
|
185
|
+
local_var_path = '/probe/{url}'.sub('{' + 'url' + '}', CGI.escape(url.to_s))
|
186
|
+
|
187
|
+
# query parameters
|
188
|
+
query_params = opts[:query_params] || {}
|
189
|
+
|
190
|
+
# header parameters
|
191
|
+
header_params = opts[:header_params] || {}
|
192
|
+
# HTTP header 'Accept' (if needed)
|
193
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
194
|
+
|
195
|
+
# form parameters
|
196
|
+
form_params = opts[:form_params] || {}
|
197
|
+
|
198
|
+
# http body (model)
|
199
|
+
post_body = opts[:debug_body]
|
200
|
+
|
201
|
+
# return_type
|
202
|
+
return_type = opts[:debug_return_type] || 'ProbeResponse'
|
203
|
+
|
204
|
+
# auth_names
|
205
|
+
auth_names = opts[:debug_auth_names] || ['DeveloperKey']
|
206
|
+
|
207
|
+
new_options = opts.merge(
|
208
|
+
:operation => :"EditApi.probe",
|
209
|
+
:header_params => header_params,
|
210
|
+
:query_params => query_params,
|
211
|
+
:form_params => form_params,
|
212
|
+
:body => post_body,
|
213
|
+
:auth_names => auth_names,
|
214
|
+
:return_type => return_type
|
215
|
+
)
|
216
|
+
|
217
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
218
|
+
if @api_client.config.debugging
|
219
|
+
@api_client.config.logger.debug "API called: EditApi#probe\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
220
|
+
end
|
221
|
+
return data, status_code, headers
|
222
|
+
end
|
154
223
|
end
|
155
224
|
end
|
@@ -20,7 +20,7 @@ module Shotstack
|
|
20
20
|
@api_client = api_client
|
21
21
|
end
|
22
22
|
# Delete Asset
|
23
|
-
# Delete an asset by its asset id. If a render creates multiple assets, such as thumbnail and poster images, each asset must be deleted individually by the asset id. **
|
23
|
+
# Delete an asset by its asset id. If a render creates multiple assets, such as thumbnail and poster images, each asset must be deleted individually by the asset id. **Base URL:** https://api.shotstack.io/serve/{version}
|
24
24
|
# @param id [String] The id of the asset in UUID format
|
25
25
|
# @param [Hash] opts the optional parameters
|
26
26
|
# @return [nil]
|
@@ -30,7 +30,7 @@ module Shotstack
|
|
30
30
|
end
|
31
31
|
|
32
32
|
# Delete Asset
|
33
|
-
# Delete an asset by its asset id. If a render creates multiple assets, such as thumbnail and poster images, each asset must be deleted individually by the asset id. **
|
33
|
+
# Delete an asset by its asset id. If a render creates multiple assets, such as thumbnail and poster images, each asset must be deleted individually by the asset id. **Base URL:** https://api.shotstack.io/serve/{version}
|
34
34
|
# @param id [String] The id of the asset in UUID format
|
35
35
|
# @param [Hash] opts the optional parameters
|
36
36
|
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
@@ -86,7 +86,7 @@ module Shotstack
|
|
86
86
|
end
|
87
87
|
|
88
88
|
# Get Asset
|
89
|
-
# The Serve API is used to interact with, and delete hosted assets including videos, images, audio files, thumbnails and poster images. Use this endpoint to fetch an asset by asset id. Note that an asset id is unique for each asset and different from the render id. **
|
89
|
+
# The Serve API is used to interact with, and delete hosted assets including videos, images, audio files, thumbnails and poster images. Use this endpoint to fetch an asset by asset id. Note that an asset id is unique for each asset and different from the render id. **Base URL:** https://api.shotstack.io/serve/{version}
|
90
90
|
# @param id [String] The id of the asset in UUID format
|
91
91
|
# @param [Hash] opts the optional parameters
|
92
92
|
# @return [AssetResponse]
|
@@ -96,7 +96,7 @@ module Shotstack
|
|
96
96
|
end
|
97
97
|
|
98
98
|
# Get Asset
|
99
|
-
# The Serve API is used to interact with, and delete hosted assets including videos, images, audio files, thumbnails and poster images. Use this endpoint to fetch an asset by asset id. Note that an asset id is unique for each asset and different from the render id. **
|
99
|
+
# The Serve API is used to interact with, and delete hosted assets including videos, images, audio files, thumbnails and poster images. Use this endpoint to fetch an asset by asset id. Note that an asset id is unique for each asset and different from the render id. **Base URL:** https://api.shotstack.io/serve/{version}
|
100
100
|
# @param id [String] The id of the asset in UUID format
|
101
101
|
# @param [Hash] opts the optional parameters
|
102
102
|
# @return [Array<(AssetResponse, Integer, Hash)>] AssetResponse data, response status code and response headers
|
@@ -154,7 +154,7 @@ module Shotstack
|
|
154
154
|
end
|
155
155
|
|
156
156
|
# Get Asset by Render ID
|
157
|
-
# A render may generate more than one file, such as a video, thumbnail and poster image. When the assets are created the only known id is the render id returned by the original [render request](#render-video), status request or webhook. This endpoint lets you look up one or more assets by the render id. **
|
157
|
+
# A render may generate more than one file, such as a video, thumbnail and poster image. When the assets are created the only known id is the render id returned by the original [render request](#render-video), status request or webhook. This endpoint lets you look up one or more assets by the render id. **Base URL:** https://api.shotstack.io/serve/{version}
|
158
158
|
# @param id [String] The render id associated with the asset in UUID format
|
159
159
|
# @param [Hash] opts the optional parameters
|
160
160
|
# @return [AssetRenderResponse]
|
@@ -164,7 +164,7 @@ module Shotstack
|
|
164
164
|
end
|
165
165
|
|
166
166
|
# Get Asset by Render ID
|
167
|
-
# A render may generate more than one file, such as a video, thumbnail and poster image. When the assets are created the only known id is the render id returned by the original [render request](#render-video), status request or webhook. This endpoint lets you look up one or more assets by the render id. **
|
167
|
+
# A render may generate more than one file, such as a video, thumbnail and poster image. When the assets are created the only known id is the render id returned by the original [render request](#render-video), status request or webhook. This endpoint lets you look up one or more assets by the render id. **Base URL:** https://api.shotstack.io/serve/{version}
|
168
168
|
# @param id [String] The render id associated with the asset in UUID format
|
169
169
|
# @param [Hash] opts the optional parameters
|
170
170
|
# @return [Array<(AssetRenderResponse, Integer, Hash)>] AssetRenderResponse data, response status code and response headers
|
@@ -16,7 +16,7 @@ require 'time'
|
|
16
16
|
module Shotstack
|
17
17
|
# A clip is a container for a specific type of asset, i.e. a title, image, video, audio or html. You use a Clip to define when an asset will display on the timeline, how long it will play for and transitions, filters and effects to apply to it.
|
18
18
|
class Clip
|
19
|
-
# The type of asset to display for the duration of this Clip. Value must be one of
|
19
|
+
# The type of asset to display for the duration of this Clip. Value must be one of: <ul> <li><a href=\"#tocs_videoasset\">VideoAsset</a></li> <li><a href=\"#tocs_imageasset\">ImageAsset</a></li> <li><a href=\"#tocs_titleasset\">TitleAsset</a></li> <li><a href=\"#tocs_htmlasset\">HtmlAsset</a></li> <li><a href=\"#tocs_audioasset\">AudioAsset</a></li> <li><a href=\"#tocs_lumaasset\">LumaAsset</a></li> </ul>
|
20
20
|
attr_accessor :asset
|
21
21
|
|
22
22
|
# The start position of the Clip on the timeline, in seconds.
|
@@ -47,6 +47,8 @@ module Shotstack
|
|
47
47
|
# Sets the opacity of the Clip where 1 is opaque and 0 is transparent.
|
48
48
|
attr_accessor :opacity
|
49
49
|
|
50
|
+
attr_accessor :transform
|
51
|
+
|
50
52
|
class EnumAttributeValidator
|
51
53
|
attr_reader :datatype
|
52
54
|
attr_reader :allowable_values
|
@@ -82,7 +84,8 @@ module Shotstack
|
|
82
84
|
:'transition' => :'transition',
|
83
85
|
:'effect' => :'effect',
|
84
86
|
:'filter' => :'filter',
|
85
|
-
:'opacity' => :'opacity'
|
87
|
+
:'opacity' => :'opacity',
|
88
|
+
:'transform' => :'transform'
|
86
89
|
}
|
87
90
|
end
|
88
91
|
|
@@ -104,7 +107,8 @@ module Shotstack
|
|
104
107
|
:'transition' => :'Transition',
|
105
108
|
:'effect' => :'String',
|
106
109
|
:'filter' => :'String',
|
107
|
-
:'opacity' => :'Float'
|
110
|
+
:'opacity' => :'Float',
|
111
|
+
:'transform' => :'Transformation'
|
108
112
|
}
|
109
113
|
end
|
110
114
|
|
@@ -178,6 +182,10 @@ module Shotstack
|
|
178
182
|
else
|
179
183
|
self.opacity = 1
|
180
184
|
end
|
185
|
+
|
186
|
+
if attributes.key?(:'transform')
|
187
|
+
self.transform = attributes[:'transform']
|
188
|
+
end
|
181
189
|
end
|
182
190
|
|
183
191
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -271,7 +279,8 @@ module Shotstack
|
|
271
279
|
transition == o.transition &&
|
272
280
|
effect == o.effect &&
|
273
281
|
filter == o.filter &&
|
274
|
-
opacity == o.opacity
|
282
|
+
opacity == o.opacity &&
|
283
|
+
transform == o.transform
|
275
284
|
end
|
276
285
|
|
277
286
|
# @see the `==` method
|
@@ -283,7 +292,7 @@ module Shotstack
|
|
283
292
|
# Calculates hash code according to all attributes.
|
284
293
|
# @return [Integer] Hash code
|
285
294
|
def hash
|
286
|
-
[asset, start, length, fit, scale, position, offset, transition, effect, filter, opacity].hash
|
295
|
+
[asset, start, length, fit, scale, position, offset, transition, effect, filter, opacity, transform].hash
|
287
296
|
end
|
288
297
|
|
289
298
|
# Builds the object from hash
|
@@ -20,6 +20,9 @@ module Shotstack
|
|
20
20
|
|
21
21
|
attr_accessor :output
|
22
22
|
|
23
|
+
# An array of key/value pairs that provides an easy way to create templates with placeholders. The placeholders can be used to find and replace keys with values. For example you can search for the placeholder `{{NAME}}` and replace it with the value `Jane`.
|
24
|
+
attr_accessor :merge
|
25
|
+
|
23
26
|
# An optional webhook callback URL used to receive status notifications when a render completes or fails. See [webhooks](https://shotstack.gitbook.io/docs/guides/architecting-an-application/webhooks) for more details.
|
24
27
|
attr_accessor :callback
|
25
28
|
|
@@ -53,6 +56,7 @@ module Shotstack
|
|
53
56
|
{
|
54
57
|
:'timeline' => :'timeline',
|
55
58
|
:'output' => :'output',
|
59
|
+
:'merge' => :'merge',
|
56
60
|
:'callback' => :'callback',
|
57
61
|
:'disk' => :'disk'
|
58
62
|
}
|
@@ -68,6 +72,7 @@ module Shotstack
|
|
68
72
|
{
|
69
73
|
:'timeline' => :'Timeline',
|
70
74
|
:'output' => :'Output',
|
75
|
+
:'merge' => :'Array<MergeField>',
|
71
76
|
:'callback' => :'String',
|
72
77
|
:'disk' => :'String'
|
73
78
|
}
|
@@ -102,6 +107,12 @@ module Shotstack
|
|
102
107
|
self.output = attributes[:'output']
|
103
108
|
end
|
104
109
|
|
110
|
+
if attributes.key?(:'merge')
|
111
|
+
if (value = attributes[:'merge']).is_a?(Array)
|
112
|
+
self.merge = value
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
105
116
|
if attributes.key?(:'callback')
|
106
117
|
self.callback = attributes[:'callback']
|
107
118
|
end
|
@@ -155,6 +166,7 @@ module Shotstack
|
|
155
166
|
self.class == o.class &&
|
156
167
|
timeline == o.timeline &&
|
157
168
|
output == o.output &&
|
169
|
+
merge == o.merge &&
|
158
170
|
callback == o.callback &&
|
159
171
|
disk == o.disk
|
160
172
|
end
|
@@ -168,7 +180,7 @@ module Shotstack
|
|
168
180
|
# Calculates hash code according to all attributes.
|
169
181
|
# @return [Integer] Hash code
|
170
182
|
def hash
|
171
|
-
[timeline, output, callback, disk].hash
|
183
|
+
[timeline, output, merge, callback, disk].hash
|
172
184
|
end
|
173
185
|
|
174
186
|
# Builds the object from hash
|
@@ -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.0.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
|
@@ -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
|