shotstack 0.2.1 → 0.2.6
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/Gemfile +9 -0
- data/README.md +387 -23
- data/Rakefile +10 -0
- data/lib/shotstack/api/create_api.rb +158 -0
- data/lib/shotstack/api/edit_api.rb +20 -20
- data/lib/shotstack/api/ingest_api.rb +338 -0
- data/lib/shotstack/api/serve_api.rb +76 -8
- data/lib/shotstack/api_client.rb +28 -24
- data/lib/shotstack/api_error.rb +3 -2
- data/lib/shotstack/configuration.rb +55 -9
- data/lib/shotstack/models/asset.rb +4 -4
- data/lib/shotstack/models/asset_render_response.rb +23 -20
- data/lib/shotstack/models/asset_response.rb +23 -20
- data/lib/shotstack/models/asset_response_attributes.rb +38 -21
- data/lib/shotstack/models/asset_response_data.rb +30 -20
- data/lib/shotstack/models/audio_asset.rb +57 -23
- data/lib/shotstack/models/audio_enhancement.rb +43 -0
- data/lib/shotstack/models/clip.rb +29 -33
- data/lib/shotstack/models/crop.rb +40 -28
- data/lib/shotstack/models/destinations.rb +78 -244
- data/lib/shotstack/models/did_generated_asset.rb +273 -0
- data/lib/shotstack/models/did_generated_asset_options.rb +54 -0
- data/lib/shotstack/models/did_text_to_avatar_options.rb +313 -0
- data/lib/shotstack/models/dolby_enhancement.rb +239 -0
- data/lib/shotstack/models/dolby_enhancement_options.rb +257 -0
- data/lib/shotstack/models/edit.rb +22 -24
- data/lib/shotstack/models/eleven_labs_generated_asset.rb +273 -0
- data/lib/shotstack/models/eleven_labs_generated_asset_options.rb +54 -0
- data/lib/shotstack/models/eleven_labs_text_to_speech_options.rb +303 -0
- data/lib/shotstack/models/enhancements.rb +215 -0
- data/lib/shotstack/models/flip_transformation.rb +16 -24
- data/lib/shotstack/models/font.rb +18 -20
- data/lib/shotstack/models/generated_asset.rb +48 -0
- data/lib/shotstack/models/generated_asset_error_response.rb +225 -0
- data/lib/shotstack/models/generated_asset_error_response_data.rb +257 -0
- data/lib/shotstack/models/generated_asset_response.rb +222 -0
- data/lib/shotstack/models/generated_asset_response_attributes.rb +376 -0
- data/lib/shotstack/models/generated_asset_response_data.rb +256 -0
- data/lib/shotstack/models/google_cloud_storage_destination.rb +232 -0
- data/lib/shotstack/models/google_cloud_storage_destination_options.rb +243 -0
- data/lib/shotstack/models/google_drive_destination.rb +239 -0
- data/lib/shotstack/models/google_drive_destination_options.rb +233 -0
- data/lib/shotstack/models/hey_gen_generated_asset.rb +273 -0
- data/lib/shotstack/models/hey_gen_generated_asset_options.rb +54 -0
- data/lib/shotstack/models/hey_gen_text_to_avatar_options.rb +396 -0
- data/lib/shotstack/models/html_asset.rb +20 -26
- data/lib/shotstack/models/image_asset.rb +18 -20
- data/lib/shotstack/models/ingest_error_response.rb +225 -0
- data/lib/shotstack/models/ingest_error_response_data.rb +257 -0
- data/lib/shotstack/models/luma_asset.rb +18 -20
- data/lib/shotstack/models/merge_field.rb +20 -20
- data/lib/shotstack/models/mux_destination.rb +18 -22
- data/lib/shotstack/models/mux_destination_options.rb +50 -25
- data/lib/shotstack/models/offset.rb +46 -46
- data/lib/shotstack/models/open_ai_generated_asset.rb +273 -0
- data/lib/shotstack/models/open_ai_generated_asset_options.rb +54 -0
- data/lib/shotstack/models/open_ai_text_generator_options.rb +313 -0
- data/lib/shotstack/models/output.rb +40 -35
- data/lib/shotstack/models/outputs.rb +227 -0
- data/lib/shotstack/models/outputs_response.rb +218 -0
- data/lib/shotstack/models/poster.rb +18 -20
- data/lib/shotstack/models/probe_response.rb +22 -20
- data/lib/shotstack/models/queued_response.rb +22 -20
- data/lib/shotstack/models/queued_response_data.rb +20 -20
- data/lib/shotstack/models/queued_source_response.rb +222 -0
- data/lib/shotstack/models/queued_source_response_data.rb +240 -0
- data/lib/shotstack/models/range.rb +26 -22
- data/lib/shotstack/models/render_response.rb +22 -20
- data/lib/shotstack/models/render_response_data.rb +24 -35
- data/lib/shotstack/models/rendition.rb +429 -0
- data/lib/shotstack/models/rendition_response_attributes.rb +336 -0
- data/lib/shotstack/models/rotate_transformation.rb +16 -22
- data/lib/shotstack/models/s3_destination.rb +232 -0
- data/lib/shotstack/models/s3_destination_options.rb +270 -0
- data/lib/shotstack/models/shotstack_destination.rb +19 -25
- data/lib/shotstack/models/shotstack_generated_asset.rb +273 -0
- data/lib/shotstack/models/shotstack_generated_asset_options.rb +60 -0
- data/lib/shotstack/models/shotstack_image_to_video_options.rb +298 -0
- data/lib/shotstack/models/shotstack_text_generator_options.rb +274 -0
- data/lib/shotstack/models/shotstack_text_to_image_options.rb +308 -0
- data/lib/shotstack/models/shotstack_text_to_speech_options.rb +339 -0
- data/lib/shotstack/models/size.rb +39 -35
- data/lib/shotstack/models/skew_transformation.rb +16 -24
- data/lib/shotstack/models/soundtrack.rb +18 -22
- data/lib/shotstack/models/source.rb +244 -0
- data/lib/shotstack/models/source_list_response.rb +225 -0
- data/lib/shotstack/models/source_response.rb +222 -0
- data/lib/shotstack/models/source_response_attributes.rb +373 -0
- data/lib/shotstack/models/source_response_data.rb +256 -0
- data/lib/shotstack/models/speed.rb +254 -0
- data/lib/shotstack/models/stability_ai_generated_asset.rb +273 -0
- data/lib/shotstack/models/stability_ai_generated_asset_options.rb +54 -0
- data/lib/shotstack/models/stability_ai_text_to_image_options.rb +390 -0
- data/lib/shotstack/models/template.rb +18 -20
- data/lib/shotstack/models/template_data_response.rb +24 -22
- data/lib/shotstack/models/template_data_response_data.rb +25 -22
- data/lib/shotstack/models/template_list_response.rb +24 -22
- data/lib/shotstack/models/template_list_response_data.rb +20 -20
- data/lib/shotstack/models/template_list_response_item.rb +20 -30
- data/lib/shotstack/models/template_render.rb +19 -21
- data/lib/shotstack/models/template_response.rb +23 -21
- data/lib/shotstack/models/template_response_data.rb +20 -20
- data/lib/shotstack/models/thumbnail.rb +20 -20
- data/lib/shotstack/models/timeline.rb +19 -25
- data/lib/shotstack/models/title_asset.rb +19 -27
- data/lib/shotstack/models/track.rb +18 -20
- data/lib/shotstack/models/transcription.rb +250 -0
- data/lib/shotstack/models/transfer.rb +259 -0
- data/lib/shotstack/models/transfer_response.rb +222 -0
- data/lib/shotstack/models/transfer_response_attributes.rb +280 -0
- data/lib/shotstack/models/transfer_response_data.rb +225 -0
- data/lib/shotstack/models/transformation.rb +16 -20
- data/lib/shotstack/models/transition.rb +16 -20
- data/lib/shotstack/models/upload_response.rb +222 -0
- data/lib/shotstack/models/upload_response_attributes.rb +257 -0
- data/lib/shotstack/models/upload_response_data.rb +256 -0
- data/lib/shotstack/models/video_asset.rb +102 -22
- data/lib/shotstack/version.rb +3 -3
- data/lib/shotstack.rb +63 -2
- data/shotstack.gemspec +8 -8
- metadata +80 -24
@@ -0,0 +1,396 @@
|
|
1
|
+
=begin
|
2
|
+
#Shotstack
|
3
|
+
|
4
|
+
# Official Ruby SDK for the Shotstack Cloud Video Editing API
|
5
|
+
|
6
|
+
The version of the OpenAPI document: v1
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
Generator version: 7.4.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module Shotstack
|
17
|
+
# Options for the HeyGen text-to-avatar service. Set the text to be converted to an avatar and configure the avatars voice, speaking style, appearance and background. The output will be generated as an MP4 video file available at the URL returned in the response.
|
18
|
+
class HeyGenTextToAvatarOptions
|
19
|
+
# The type of asset to generate - set to `text-to-avatar` for text-to-avatar.
|
20
|
+
attr_accessor :type
|
21
|
+
|
22
|
+
# The text or script that the avatar will narrate.
|
23
|
+
attr_accessor :text
|
24
|
+
|
25
|
+
# The avatar character to generate. Select from the list of available avatars: <ul> <li>`Angela`</li> <li>`Bill`</li> <li>`Daisy`</li> <li>`Derek`</li> <li>`Eva`</li> <li>`Jake`</li> <li>`Jeff`</li> <li>`Jerome`</li> <li>`Joon`</li> <li>`Kayla`</li> <li>`Kent`</li> <li>`Luna`</li> <li>`Mark`</li> <li>`Matthew`</li> <li>`Monica`</li> <li>`Peter`</li> <li>`Selina`</li> <li>`Tanya`</li> <li>`Thomas`</li> <li>`Tina`</li> <li>`Tyler`</li> <li>`Vanessa`</li> <li>`Vera`</li> <li>`Wilson`</li> <li>`Zoey`</li> </ul>
|
26
|
+
attr_accessor :avatar
|
27
|
+
|
28
|
+
# The avatars voice and speaking style. Select from the list of available voices: <ul> <li>`Abb- - Natural`</li> <li>`Adam - Natural`</li> <li>`Aiston - Friendly`</li> <li>`Alice - Newscaster`</li> <li>`Alison - Cheerful`</li> <li>`Amber - Friendly`</li> <li>`Amy - Warm`</li> <li>`Ana - Cheerful`</li> <li>`Antoni - Friendly`</li> <li>`Aria - Newscaster`</li> <li>`Arnold - Cheerful`</li> <li>`Arthur - Natural`</li> <li>`Bella - Friendly`</li> <li>`Belle - Natural`</li> <li>`Brandon - Warm`</li> <li>`Brian - Natural`</li> <li>`Bruce - Natural`</li> <li>`Cerise - Cheerful`</li> <li>`Christopher - Calm`</li> <li>`Clara - Professional`</li> <li>`Connor - Natural`</li> <li>`Dahlia - Friendly`</li> <li>`Davis - Professional`</li> <li>`Dean - Natural`</li> <li>`Delbert - Cheerful`</li> <li>`Edward - Friendly`</li> <li>`Elaine - Calm`</li> <li>`Emily - Natural`</li> <li>`Emma - Newscaster`</li> <li>`Eric - Newscaster`</li> <li>`Grace - Natural`</li> <li>`Hailey - Calm`</li> <li>`Indira - Cheerful`</li> <li>`Isabella - Cheerful`</li> <li>`Jacob - Natural`</li> <li>`Jahmai - Friendly`</li> <li>`Jane - Serious`</li> <li>`Jason - Serious`</li> <li>`Jelle - Friendly`</li> <li>`Jen - Natural`</li> <li>`Jenny - Professional`</li> <li>`Jodi - Cheerful`</li> <li>`Joey - Calm`</li> <li>`Johan - Friendly`</li> <li>`Josie - Cheerful`</li> <li>`Keanan - Natural`</li> <li>`Keith - Cheerful`</li> <li>`Kellie - Friendly`</li> <li>`Lauren - Friendly`</li> <li>`Leah - Natural`</li> <li>`Liam - Professional`</li> <li>`Libby - Natural`</li> <li>`Lily - Professional`</li> <li>`Lucas - Natural`</li> <li>`Luke - Professional`</li> <li>`Luna - Natural`</li> <li>`Marieke - Natural`</li> <li>`Matthew - Professional`</li> <li>`Michelle - Natural`</li> <li>`Mitchell - Natural`</li> <li>`Molly - Newscaster`</li> <li>`Monica - Calm`</li> <li>`Natasha - Professional`</li> <li>`Neerja - Newscaster`</li> <li>`Noah - Serious`</li> <li>`Oliver - Newscaster`</li> <li>`Olivia - Calm`</li> <li>`Paul - Natural`</li> <li>`Prabhat - Natural`</li> <li>`Raveena - Natural`</li> <li>`Rudi - Friendly`</li> <li>`Ryan - Professional`</li> <li>`Sam - Natural`</li> <li>`Sara - Cheerful`</li> <li>`Sherry - Friendly`</li> <li>`Sonia - Warm`</li> <li>`Thomas - Natural`</li> <li>`Todd - Professional`</li> <li>`Tony - Professional`</li> <li>`Tracy - Cheerful`</li> <li>`Wayne - Natural`</li> <li>`Wilder - Natural`</li> <li>`Wille - Natural`</li> <li>`William - Friendly`</li> </ul>
|
29
|
+
attr_accessor :voice
|
30
|
+
|
31
|
+
# The display style of the avatar, a rectangle `normal` or circular `circle` background. Defaults to `normal`.
|
32
|
+
attr_accessor :avatar_style
|
33
|
+
|
34
|
+
# The background color of the video. Defaults to `#ffffff`.
|
35
|
+
attr_accessor :background
|
36
|
+
|
37
|
+
# The aspect ratio of the video, `16:9` horizontal or `9:16` vertical. Defaults to `16:9`.
|
38
|
+
attr_accessor :ratio
|
39
|
+
|
40
|
+
# A boolean flag indicating whether the video is for testing purposes. See the \"test\" parameter in [HeyGen](https://docs.heygen.com/reference/generate-video) for more details.
|
41
|
+
attr_accessor :test
|
42
|
+
|
43
|
+
class EnumAttributeValidator
|
44
|
+
attr_reader :datatype
|
45
|
+
attr_reader :allowable_values
|
46
|
+
|
47
|
+
def initialize(datatype, allowable_values)
|
48
|
+
@allowable_values = allowable_values.map do |value|
|
49
|
+
case datatype.to_s
|
50
|
+
when /Integer/i
|
51
|
+
value.to_i
|
52
|
+
when /Float/i
|
53
|
+
value.to_f
|
54
|
+
else
|
55
|
+
value
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
def valid?(value)
|
61
|
+
!value || allowable_values.include?(value)
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
66
|
+
def self.attribute_map
|
67
|
+
{
|
68
|
+
:'type' => :'type',
|
69
|
+
:'text' => :'text',
|
70
|
+
:'avatar' => :'avatar',
|
71
|
+
:'voice' => :'voice',
|
72
|
+
:'avatar_style' => :'avatarStyle',
|
73
|
+
:'background' => :'background',
|
74
|
+
:'ratio' => :'ratio',
|
75
|
+
:'test' => :'test'
|
76
|
+
}
|
77
|
+
end
|
78
|
+
|
79
|
+
# Returns all the JSON keys this model knows about
|
80
|
+
def self.acceptable_attributes
|
81
|
+
attribute_map.values
|
82
|
+
end
|
83
|
+
|
84
|
+
# Attribute type mapping.
|
85
|
+
def self.openapi_types
|
86
|
+
{
|
87
|
+
:'type' => :'String',
|
88
|
+
:'text' => :'String',
|
89
|
+
:'avatar' => :'String',
|
90
|
+
:'voice' => :'String',
|
91
|
+
:'avatar_style' => :'String',
|
92
|
+
:'background' => :'String',
|
93
|
+
:'ratio' => :'String',
|
94
|
+
:'test' => :'Boolean'
|
95
|
+
}
|
96
|
+
end
|
97
|
+
|
98
|
+
# List of attributes with nullable: true
|
99
|
+
def self.openapi_nullable
|
100
|
+
Set.new([
|
101
|
+
])
|
102
|
+
end
|
103
|
+
|
104
|
+
# Initializes the object
|
105
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
106
|
+
def initialize(attributes = {})
|
107
|
+
if (!attributes.is_a?(Hash))
|
108
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Shotstack::HeyGenTextToAvatarOptions` initialize method"
|
109
|
+
end
|
110
|
+
|
111
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
112
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
113
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
114
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Shotstack::HeyGenTextToAvatarOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
115
|
+
end
|
116
|
+
h[k.to_sym] = v
|
117
|
+
}
|
118
|
+
|
119
|
+
if attributes.key?(:'type')
|
120
|
+
self.type = attributes[:'type']
|
121
|
+
else
|
122
|
+
self.type = nil
|
123
|
+
end
|
124
|
+
|
125
|
+
if attributes.key?(:'text')
|
126
|
+
self.text = attributes[:'text']
|
127
|
+
else
|
128
|
+
self.text = nil
|
129
|
+
end
|
130
|
+
|
131
|
+
if attributes.key?(:'avatar')
|
132
|
+
self.avatar = attributes[:'avatar']
|
133
|
+
else
|
134
|
+
self.avatar = nil
|
135
|
+
end
|
136
|
+
|
137
|
+
if attributes.key?(:'voice')
|
138
|
+
self.voice = attributes[:'voice']
|
139
|
+
else
|
140
|
+
self.voice = nil
|
141
|
+
end
|
142
|
+
|
143
|
+
if attributes.key?(:'avatar_style')
|
144
|
+
self.avatar_style = attributes[:'avatar_style']
|
145
|
+
end
|
146
|
+
|
147
|
+
if attributes.key?(:'background')
|
148
|
+
self.background = attributes[:'background']
|
149
|
+
end
|
150
|
+
|
151
|
+
if attributes.key?(:'ratio')
|
152
|
+
self.ratio = attributes[:'ratio']
|
153
|
+
end
|
154
|
+
|
155
|
+
if attributes.key?(:'test')
|
156
|
+
self.test = attributes[:'test']
|
157
|
+
end
|
158
|
+
end
|
159
|
+
|
160
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
161
|
+
# @return Array for valid properties with the reasons
|
162
|
+
def list_invalid_properties
|
163
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
164
|
+
invalid_properties = Array.new
|
165
|
+
if @type.nil?
|
166
|
+
invalid_properties.push('invalid value for "type", type cannot be nil.')
|
167
|
+
end
|
168
|
+
|
169
|
+
if @text.nil?
|
170
|
+
invalid_properties.push('invalid value for "text", text cannot be nil.')
|
171
|
+
end
|
172
|
+
|
173
|
+
if @avatar.nil?
|
174
|
+
invalid_properties.push('invalid value for "avatar", avatar cannot be nil.')
|
175
|
+
end
|
176
|
+
|
177
|
+
if @voice.nil?
|
178
|
+
invalid_properties.push('invalid value for "voice", voice cannot be nil.')
|
179
|
+
end
|
180
|
+
|
181
|
+
invalid_properties
|
182
|
+
end
|
183
|
+
|
184
|
+
# Check to see if the all the properties in the model are valid
|
185
|
+
# @return true if the model is valid
|
186
|
+
def valid?
|
187
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
188
|
+
return false if @type.nil?
|
189
|
+
type_validator = EnumAttributeValidator.new('String', ["text-to-avatar"])
|
190
|
+
return false unless type_validator.valid?(@type)
|
191
|
+
return false if @text.nil?
|
192
|
+
return false if @avatar.nil?
|
193
|
+
avatar_validator = EnumAttributeValidator.new('String', ["Angela", "Bill", "Daisy", "Derek", "Eva", "Jake", "Jeff", "Jerome", "Joon", "Kayla", "Kent", "Luna", "Mark", "Matthew", "Monica", "Peter", "Selina", "Tanya", "Thomas", "Tina", "Tyler", "Vanessa", "Vera", "Wilson", "Zoey"])
|
194
|
+
return false unless avatar_validator.valid?(@avatar)
|
195
|
+
return false if @voice.nil?
|
196
|
+
voice_validator = EnumAttributeValidator.new('String', ["Abbi - Natural", "Adam - Natural", "Aiston - Friendly", "Alice - Newscaster", "Alison - Cheerful", "Amber - Friendly", "Amy - Warm", "Ana - Cheerful", "Antoni - Friendly", "Aria - Newscaster", "Arnold - Cheerful", "Arthur - Natural", "Bella - Friendly", "Belle - Natural", "Brandon - Warm", "Brian - Natural", "Bruce - Natural", "Cerise - Cheerful", "Christopher - Calm", "Clara - Professional", "Connor - Natural", "Dahlia - Friendly", "Davis - Professional", "Dean - Natural", "Delbert - Cheerful", "Edward - Friendly", "Elaine - Calm", "Emily - Natural", "Emma - Newscaster", "Eric - Newscaster", "Grace - Natural", "Hailey - Calm", "Indira - Cheerful", "Isabella - Cheerful", "Jacob - Natural", "Jahmai - Friendly", "Jane - Serious", "Jason - Serious", "Jelle - Friendly", "Jen - Natural", "Jenny - Professional", "Jodi - Cheerful", "Joey - Calm", "Johan - Friendly", "Josie - Cheerful", "Keanan - Natural", "Keith - Cheerful", "Kellie - Friendly", "Lauren - Friendly", "Leah - Natural", "Liam - Professional", "Libby - Natural", "Lily - Professional", "Lucas - Natural", "Luke - Professional", "Luna - Natural", "Marieke - Natural", "Matthew - Professional", "Michelle - Natural", "Mitchell - Natural", "Molly - Newscaster", "Monica - Calm", "Natasha - Professional", "Neerja - Newscaster", "Noah - Serious", "Oliver - Newscaster", "Olivia - Calm", "Paul - Natural", "Prabhat - Natural", "Raveena - Natural", "Rudi - Friendly", "Ryan - Professional", "Sam - Natural", "Sara - Cheerful", "Sherry - Friendly", "Sonia - Warm", "Thomas - Natural", "Todd - Professional", "Tony - Professional", "Tracy - Cheerful", "Wayne - Natural", "Wilder - Natural", "Wille - Natural", "William - Friendly"])
|
197
|
+
return false unless voice_validator.valid?(@voice)
|
198
|
+
avatar_style_validator = EnumAttributeValidator.new('String', ["normal", "circle"])
|
199
|
+
return false unless avatar_style_validator.valid?(@avatar_style)
|
200
|
+
ratio_validator = EnumAttributeValidator.new('String', ["16:9", "9:16"])
|
201
|
+
return false unless ratio_validator.valid?(@ratio)
|
202
|
+
true
|
203
|
+
end
|
204
|
+
|
205
|
+
# Custom attribute writer method checking allowed values (enum).
|
206
|
+
# @param [Object] type Object to be assigned
|
207
|
+
def type=(type)
|
208
|
+
validator = EnumAttributeValidator.new('String', ["text-to-avatar"])
|
209
|
+
unless validator.valid?(type)
|
210
|
+
fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
|
211
|
+
end
|
212
|
+
@type = type
|
213
|
+
end
|
214
|
+
|
215
|
+
# Custom attribute writer method checking allowed values (enum).
|
216
|
+
# @param [Object] avatar Object to be assigned
|
217
|
+
def avatar=(avatar)
|
218
|
+
validator = EnumAttributeValidator.new('String', ["Angela", "Bill", "Daisy", "Derek", "Eva", "Jake", "Jeff", "Jerome", "Joon", "Kayla", "Kent", "Luna", "Mark", "Matthew", "Monica", "Peter", "Selina", "Tanya", "Thomas", "Tina", "Tyler", "Vanessa", "Vera", "Wilson", "Zoey"])
|
219
|
+
unless validator.valid?(avatar)
|
220
|
+
fail ArgumentError, "invalid value for \"avatar\", must be one of #{validator.allowable_values}."
|
221
|
+
end
|
222
|
+
@avatar = avatar
|
223
|
+
end
|
224
|
+
|
225
|
+
# Custom attribute writer method checking allowed values (enum).
|
226
|
+
# @param [Object] voice Object to be assigned
|
227
|
+
def voice=(voice)
|
228
|
+
validator = EnumAttributeValidator.new('String', ["Abbi - Natural", "Adam - Natural", "Aiston - Friendly", "Alice - Newscaster", "Alison - Cheerful", "Amber - Friendly", "Amy - Warm", "Ana - Cheerful", "Antoni - Friendly", "Aria - Newscaster", "Arnold - Cheerful", "Arthur - Natural", "Bella - Friendly", "Belle - Natural", "Brandon - Warm", "Brian - Natural", "Bruce - Natural", "Cerise - Cheerful", "Christopher - Calm", "Clara - Professional", "Connor - Natural", "Dahlia - Friendly", "Davis - Professional", "Dean - Natural", "Delbert - Cheerful", "Edward - Friendly", "Elaine - Calm", "Emily - Natural", "Emma - Newscaster", "Eric - Newscaster", "Grace - Natural", "Hailey - Calm", "Indira - Cheerful", "Isabella - Cheerful", "Jacob - Natural", "Jahmai - Friendly", "Jane - Serious", "Jason - Serious", "Jelle - Friendly", "Jen - Natural", "Jenny - Professional", "Jodi - Cheerful", "Joey - Calm", "Johan - Friendly", "Josie - Cheerful", "Keanan - Natural", "Keith - Cheerful", "Kellie - Friendly", "Lauren - Friendly", "Leah - Natural", "Liam - Professional", "Libby - Natural", "Lily - Professional", "Lucas - Natural", "Luke - Professional", "Luna - Natural", "Marieke - Natural", "Matthew - Professional", "Michelle - Natural", "Mitchell - Natural", "Molly - Newscaster", "Monica - Calm", "Natasha - Professional", "Neerja - Newscaster", "Noah - Serious", "Oliver - Newscaster", "Olivia - Calm", "Paul - Natural", "Prabhat - Natural", "Raveena - Natural", "Rudi - Friendly", "Ryan - Professional", "Sam - Natural", "Sara - Cheerful", "Sherry - Friendly", "Sonia - Warm", "Thomas - Natural", "Todd - Professional", "Tony - Professional", "Tracy - Cheerful", "Wayne - Natural", "Wilder - Natural", "Wille - Natural", "William - Friendly"])
|
229
|
+
unless validator.valid?(voice)
|
230
|
+
fail ArgumentError, "invalid value for \"voice\", must be one of #{validator.allowable_values}."
|
231
|
+
end
|
232
|
+
@voice = voice
|
233
|
+
end
|
234
|
+
|
235
|
+
# Custom attribute writer method checking allowed values (enum).
|
236
|
+
# @param [Object] avatar_style Object to be assigned
|
237
|
+
def avatar_style=(avatar_style)
|
238
|
+
validator = EnumAttributeValidator.new('String', ["normal", "circle"])
|
239
|
+
unless validator.valid?(avatar_style)
|
240
|
+
fail ArgumentError, "invalid value for \"avatar_style\", must be one of #{validator.allowable_values}."
|
241
|
+
end
|
242
|
+
@avatar_style = avatar_style
|
243
|
+
end
|
244
|
+
|
245
|
+
# Custom attribute writer method checking allowed values (enum).
|
246
|
+
# @param [Object] ratio Object to be assigned
|
247
|
+
def ratio=(ratio)
|
248
|
+
validator = EnumAttributeValidator.new('String', ["16:9", "9:16"])
|
249
|
+
unless validator.valid?(ratio)
|
250
|
+
fail ArgumentError, "invalid value for \"ratio\", must be one of #{validator.allowable_values}."
|
251
|
+
end
|
252
|
+
@ratio = ratio
|
253
|
+
end
|
254
|
+
|
255
|
+
# Checks equality by comparing each attribute.
|
256
|
+
# @param [Object] Object to be compared
|
257
|
+
def ==(o)
|
258
|
+
return true if self.equal?(o)
|
259
|
+
self.class == o.class &&
|
260
|
+
type == o.type &&
|
261
|
+
text == o.text &&
|
262
|
+
avatar == o.avatar &&
|
263
|
+
voice == o.voice &&
|
264
|
+
avatar_style == o.avatar_style &&
|
265
|
+
background == o.background &&
|
266
|
+
ratio == o.ratio &&
|
267
|
+
test == o.test
|
268
|
+
end
|
269
|
+
|
270
|
+
# @see the `==` method
|
271
|
+
# @param [Object] Object to be compared
|
272
|
+
def eql?(o)
|
273
|
+
self == o
|
274
|
+
end
|
275
|
+
|
276
|
+
# Calculates hash code according to all attributes.
|
277
|
+
# @return [Integer] Hash code
|
278
|
+
def hash
|
279
|
+
[type, text, avatar, voice, avatar_style, background, ratio, test].hash
|
280
|
+
end
|
281
|
+
|
282
|
+
# Builds the object from hash
|
283
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
284
|
+
# @return [Object] Returns the model itself
|
285
|
+
def self.build_from_hash(attributes)
|
286
|
+
return nil unless attributes.is_a?(Hash)
|
287
|
+
attributes = attributes.transform_keys(&:to_sym)
|
288
|
+
transformed_hash = {}
|
289
|
+
openapi_types.each_pair do |key, type|
|
290
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
291
|
+
transformed_hash["#{key}"] = nil
|
292
|
+
elsif type =~ /\AArray<(.*)>/i
|
293
|
+
# check to ensure the input is an array given that the attribute
|
294
|
+
# is documented as an array but the input is not
|
295
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
296
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
297
|
+
end
|
298
|
+
elsif !attributes[attribute_map[key]].nil?
|
299
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
300
|
+
end
|
301
|
+
end
|
302
|
+
new(transformed_hash)
|
303
|
+
end
|
304
|
+
|
305
|
+
# Deserializes the data based on type
|
306
|
+
# @param string type Data type
|
307
|
+
# @param string value Value to be deserialized
|
308
|
+
# @return [Object] Deserialized data
|
309
|
+
def self._deserialize(type, value)
|
310
|
+
case type.to_sym
|
311
|
+
when :Time
|
312
|
+
Time.parse(value)
|
313
|
+
when :Date
|
314
|
+
Date.parse(value)
|
315
|
+
when :String
|
316
|
+
value.to_s
|
317
|
+
when :Integer
|
318
|
+
value.to_i
|
319
|
+
when :Float
|
320
|
+
value.to_f
|
321
|
+
when :Boolean
|
322
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
323
|
+
true
|
324
|
+
else
|
325
|
+
false
|
326
|
+
end
|
327
|
+
when :Object
|
328
|
+
# generic object (usually a Hash), return directly
|
329
|
+
value
|
330
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
331
|
+
inner_type = Regexp.last_match[:inner_type]
|
332
|
+
value.map { |v| _deserialize(inner_type, v) }
|
333
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
334
|
+
k_type = Regexp.last_match[:k_type]
|
335
|
+
v_type = Regexp.last_match[:v_type]
|
336
|
+
{}.tap do |hash|
|
337
|
+
value.each do |k, v|
|
338
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
339
|
+
end
|
340
|
+
end
|
341
|
+
else # model
|
342
|
+
# models (e.g. Pet) or oneOf
|
343
|
+
klass = Shotstack.const_get(type)
|
344
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
345
|
+
end
|
346
|
+
end
|
347
|
+
|
348
|
+
# Returns the string representation of the object
|
349
|
+
# @return [String] String presentation of the object
|
350
|
+
def to_s
|
351
|
+
to_hash.to_s
|
352
|
+
end
|
353
|
+
|
354
|
+
# to_body is an alias to to_hash (backward compatibility)
|
355
|
+
# @return [Hash] Returns the object in the form of hash
|
356
|
+
def to_body
|
357
|
+
to_hash
|
358
|
+
end
|
359
|
+
|
360
|
+
# Returns the object in the form of hash
|
361
|
+
# @return [Hash] Returns the object in the form of hash
|
362
|
+
def to_hash
|
363
|
+
hash = {}
|
364
|
+
self.class.attribute_map.each_pair do |attr, param|
|
365
|
+
value = self.send(attr)
|
366
|
+
if value.nil?
|
367
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
368
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
369
|
+
end
|
370
|
+
|
371
|
+
hash[param] = _to_hash(value)
|
372
|
+
end
|
373
|
+
hash
|
374
|
+
end
|
375
|
+
|
376
|
+
# Outputs non-array value in the form of hash
|
377
|
+
# For object, use to_hash. Otherwise, just return the value
|
378
|
+
# @param [Object] value Any valid value
|
379
|
+
# @return [Hash] Returns the value in the form of hash
|
380
|
+
def _to_hash(value)
|
381
|
+
if value.is_a?(Array)
|
382
|
+
value.compact.map { |v| _to_hash(v) }
|
383
|
+
elsif value.is_a?(Hash)
|
384
|
+
{}.tap do |hash|
|
385
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
386
|
+
end
|
387
|
+
elsif value.respond_to? :to_hash
|
388
|
+
value.to_hash
|
389
|
+
else
|
390
|
+
value
|
391
|
+
end
|
392
|
+
end
|
393
|
+
|
394
|
+
end
|
395
|
+
|
396
|
+
end
|
@@ -1,12 +1,12 @@
|
|
1
1
|
=begin
|
2
2
|
#Shotstack
|
3
3
|
|
4
|
-
#
|
4
|
+
# Official Ruby SDK for the Shotstack Cloud Video Editing API
|
5
5
|
|
6
6
|
The version of the OpenAPI document: v1
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
|
9
|
+
Generator version: 7.4.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -19,10 +19,10 @@ module Shotstack
|
|
19
19
|
# The type of asset - set to `html` for HTML.
|
20
20
|
attr_accessor :type
|
21
21
|
|
22
|
-
# The HTML text string. See list of [supported HTML tags](https://shotstack.io/docs/guide/architecting-an-application/html-support
|
22
|
+
# The HTML text string. See list of [supported HTML tags](https://shotstack.io/docs/guide/architecting-an-application/html-support/#supported-html-tags).
|
23
23
|
attr_accessor :html
|
24
24
|
|
25
|
-
# The CSS text string to apply styling to the HTML. See list of [support CSS properties](https://shotstack.io/docs/guide/architecting-an-application/html-support
|
25
|
+
# The CSS text string to apply styling to the HTML. See list of [support CSS properties](https://shotstack.io/docs/guide/architecting-an-application/html-support/#supported-css-properties).
|
26
26
|
attr_accessor :css
|
27
27
|
|
28
28
|
# Set the width of the HTML asset bounding box in pixels. Text will wrap to fill the bounding box.
|
@@ -119,6 +119,8 @@ module Shotstack
|
|
119
119
|
|
120
120
|
if attributes.key?(:'html')
|
121
121
|
self.html = attributes[:'html']
|
122
|
+
else
|
123
|
+
self.html = nil
|
122
124
|
end
|
123
125
|
|
124
126
|
if attributes.key?(:'css')
|
@@ -135,20 +137,17 @@ module Shotstack
|
|
135
137
|
|
136
138
|
if attributes.key?(:'background')
|
137
139
|
self.background = attributes[:'background']
|
138
|
-
else
|
139
|
-
self.background = 'transparent'
|
140
140
|
end
|
141
141
|
|
142
142
|
if attributes.key?(:'position')
|
143
143
|
self.position = attributes[:'position']
|
144
|
-
else
|
145
|
-
self.position = 'center'
|
146
144
|
end
|
147
145
|
end
|
148
146
|
|
149
147
|
# Show invalid properties with the reasons. Usually used together with valid?
|
150
148
|
# @return Array for valid properties with the reasons
|
151
149
|
def list_invalid_properties
|
150
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
152
151
|
invalid_properties = Array.new
|
153
152
|
if @type.nil?
|
154
153
|
invalid_properties.push('invalid value for "type", type cannot be nil.')
|
@@ -164,6 +163,7 @@ module Shotstack
|
|
164
163
|
# Check to see if the all the properties in the model are valid
|
165
164
|
# @return true if the model is valid
|
166
165
|
def valid?
|
166
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
167
167
|
return false if @type.nil?
|
168
168
|
return false if @html.nil?
|
169
169
|
position_validator = EnumAttributeValidator.new('String', ["top", "topRight", "right", "bottomRight", "bottom", "bottomLeft", "left", "topLeft", "center"])
|
@@ -211,36 +211,30 @@ module Shotstack
|
|
211
211
|
# @param [Hash] attributes Model attributes in the form of hash
|
212
212
|
# @return [Object] Returns the model itself
|
213
213
|
def self.build_from_hash(attributes)
|
214
|
-
new.build_from_hash(attributes)
|
215
|
-
end
|
216
|
-
|
217
|
-
# Builds the object from hash
|
218
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
219
|
-
# @return [Object] Returns the model itself
|
220
|
-
def build_from_hash(attributes)
|
221
214
|
return nil unless attributes.is_a?(Hash)
|
222
|
-
|
223
|
-
|
224
|
-
|
215
|
+
attributes = attributes.transform_keys(&:to_sym)
|
216
|
+
transformed_hash = {}
|
217
|
+
openapi_types.each_pair do |key, type|
|
218
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
219
|
+
transformed_hash["#{key}"] = nil
|
225
220
|
elsif type =~ /\AArray<(.*)>/i
|
226
221
|
# check to ensure the input is an array given that the attribute
|
227
222
|
# is documented as an array but the input is not
|
228
|
-
if attributes[
|
229
|
-
|
223
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
224
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
230
225
|
end
|
231
|
-
elsif !attributes[
|
232
|
-
|
226
|
+
elsif !attributes[attribute_map[key]].nil?
|
227
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
233
228
|
end
|
234
229
|
end
|
235
|
-
|
236
|
-
self
|
230
|
+
new(transformed_hash)
|
237
231
|
end
|
238
232
|
|
239
233
|
# Deserializes the data based on type
|
240
234
|
# @param string type Data type
|
241
235
|
# @param string value Value to be deserialized
|
242
236
|
# @return [Object] Deserialized data
|
243
|
-
def _deserialize(type, value)
|
237
|
+
def self._deserialize(type, value)
|
244
238
|
case type.to_sym
|
245
239
|
when :Time
|
246
240
|
Time.parse(value)
|
@@ -275,7 +269,7 @@ module Shotstack
|
|
275
269
|
else # model
|
276
270
|
# models (e.g. Pet) or oneOf
|
277
271
|
klass = Shotstack.const_get(type)
|
278
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
272
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
279
273
|
end
|
280
274
|
end
|
281
275
|
|
@@ -1,12 +1,12 @@
|
|
1
1
|
=begin
|
2
2
|
#Shotstack
|
3
3
|
|
4
|
-
#
|
4
|
+
# Official Ruby SDK for the Shotstack Cloud Video Editing API
|
5
5
|
|
6
6
|
The version of the OpenAPI document: v1
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
|
9
|
+
Generator version: 7.4.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -76,6 +76,8 @@ module Shotstack
|
|
76
76
|
|
77
77
|
if attributes.key?(:'src')
|
78
78
|
self.src = attributes[:'src']
|
79
|
+
else
|
80
|
+
self.src = nil
|
79
81
|
end
|
80
82
|
|
81
83
|
if attributes.key?(:'crop')
|
@@ -86,6 +88,7 @@ module Shotstack
|
|
86
88
|
# Show invalid properties with the reasons. Usually used together with valid?
|
87
89
|
# @return Array for valid properties with the reasons
|
88
90
|
def list_invalid_properties
|
91
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
89
92
|
invalid_properties = Array.new
|
90
93
|
if @type.nil?
|
91
94
|
invalid_properties.push('invalid value for "type", type cannot be nil.')
|
@@ -101,6 +104,7 @@ module Shotstack
|
|
101
104
|
# Check to see if the all the properties in the model are valid
|
102
105
|
# @return true if the model is valid
|
103
106
|
def valid?
|
107
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
104
108
|
return false if @type.nil?
|
105
109
|
return false if @src.nil?
|
106
110
|
true
|
@@ -132,36 +136,30 @@ module Shotstack
|
|
132
136
|
# @param [Hash] attributes Model attributes in the form of hash
|
133
137
|
# @return [Object] Returns the model itself
|
134
138
|
def self.build_from_hash(attributes)
|
135
|
-
new.build_from_hash(attributes)
|
136
|
-
end
|
137
|
-
|
138
|
-
# Builds the object from hash
|
139
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
140
|
-
# @return [Object] Returns the model itself
|
141
|
-
def build_from_hash(attributes)
|
142
139
|
return nil unless attributes.is_a?(Hash)
|
143
|
-
|
144
|
-
|
145
|
-
|
140
|
+
attributes = attributes.transform_keys(&:to_sym)
|
141
|
+
transformed_hash = {}
|
142
|
+
openapi_types.each_pair do |key, type|
|
143
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
144
|
+
transformed_hash["#{key}"] = nil
|
146
145
|
elsif type =~ /\AArray<(.*)>/i
|
147
146
|
# check to ensure the input is an array given that the attribute
|
148
147
|
# is documented as an array but the input is not
|
149
|
-
if attributes[
|
150
|
-
|
148
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
149
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
151
150
|
end
|
152
|
-
elsif !attributes[
|
153
|
-
|
151
|
+
elsif !attributes[attribute_map[key]].nil?
|
152
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
154
153
|
end
|
155
154
|
end
|
156
|
-
|
157
|
-
self
|
155
|
+
new(transformed_hash)
|
158
156
|
end
|
159
157
|
|
160
158
|
# Deserializes the data based on type
|
161
159
|
# @param string type Data type
|
162
160
|
# @param string value Value to be deserialized
|
163
161
|
# @return [Object] Deserialized data
|
164
|
-
def _deserialize(type, value)
|
162
|
+
def self._deserialize(type, value)
|
165
163
|
case type.to_sym
|
166
164
|
when :Time
|
167
165
|
Time.parse(value)
|
@@ -196,7 +194,7 @@ module Shotstack
|
|
196
194
|
else # model
|
197
195
|
# models (e.g. Pet) or oneOf
|
198
196
|
klass = Shotstack.const_get(type)
|
199
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
197
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
200
198
|
end
|
201
199
|
end
|
202
200
|
|