shotstack 0.0.9 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (34) hide show
  1. checksums.yaml +5 -5
  2. data/README.md +17 -0
  3. data/lib/shotstack.rb +24 -15
  4. data/lib/shotstack/api/default_api.rb +131 -0
  5. data/lib/shotstack/api_client.rb +120 -51
  6. data/lib/shotstack/api_error.rb +38 -5
  7. data/lib/shotstack/configuration.rb +90 -3
  8. data/lib/shotstack/models/asset.rb +17 -0
  9. data/lib/shotstack/models/clip.rb +308 -0
  10. data/lib/shotstack/models/edit.rb +104 -45
  11. data/lib/shotstack/models/image_asset.rb +221 -0
  12. data/lib/shotstack/models/output.rb +128 -41
  13. data/lib/shotstack/models/queued_response.rb +110 -48
  14. data/lib/shotstack/models/queued_response_data.rb +105 -45
  15. data/lib/shotstack/models/render_response.rb +110 -48
  16. data/lib/shotstack/models/render_response_data.rb +172 -68
  17. data/lib/shotstack/models/soundtrack.rb +106 -45
  18. data/lib/shotstack/models/timeline.rb +101 -46
  19. data/lib/shotstack/models/title_asset.rb +265 -0
  20. data/lib/shotstack/models/track.rb +89 -33
  21. data/lib/shotstack/models/transition.rb +121 -42
  22. data/lib/shotstack/models/video_asset.rb +241 -0
  23. data/lib/shotstack/version.rb +13 -1
  24. data/shotstack.gemspec +26 -13
  25. metadata +38 -40
  26. data/lib/shotstack/api/render_api.rb +0 -137
  27. data/lib/shotstack/models/clips.rb +0 -147
  28. data/lib/shotstack/models/image_clip.rb +0 -216
  29. data/lib/shotstack/models/image_clip_options.rb +0 -175
  30. data/lib/shotstack/models/title_clip.rb +0 -216
  31. data/lib/shotstack/models/title_clip_options.rb +0 -194
  32. data/lib/shotstack/models/video_clip.rb +0 -216
  33. data/lib/shotstack/models/video_clip_options.rb +0 -185
  34. data/tags +0 -306
@@ -0,0 +1,241 @@
1
+ =begin
2
+ #shotstack
3
+
4
+ #The Shotstack API is a video editing service that allows for the programatic creation of videos using JSON.
5
+
6
+ OpenAPI spec version: v1
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.0.0-beta3
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require_relative 'asset'
15
+
16
+ module Shotstack
17
+ # The VideoAsset is used to create video sequences from video files. The src must be a publicly accesible URL to a video resource such as an mp4 file. The in and out attributes of the parent Clip let you trim the video file by setting the start and end point to use.
18
+ class VideoAsset < Asset
19
+ # The type of asset - set to <b>video</b> for videos.
20
+ attr_accessor :type
21
+
22
+ # The video source URL. The URL must be publicly accessible or include credentials.
23
+ attr_accessor :src
24
+
25
+ # The start trim point of the clip, in seconds (defaults to 0). Videos will start from the in trim point. The video will play until the file ends or the Clip length is reached.
26
+ attr_accessor :trim
27
+
28
+ # Set the volume for the clip between 0 and 1 where 0 is muted and 1 is full volume (defaults to 0).
29
+ attr_accessor :volume
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ def self.attribute_map
33
+ {
34
+ :'type' => :'type',
35
+ :'src' => :'src',
36
+ :'trim' => :'trim',
37
+ :'volume' => :'volume'
38
+ }
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.openapi_types
43
+ {
44
+ :'type' => :'String',
45
+ :'src' => :'String',
46
+ :'trim' => :'Float',
47
+ :'volume' => :'Float'
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::VideoAsset` 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::VideoAsset`. 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?(:'type')
67
+ self.type = attributes[:'type']
68
+ else
69
+ self.type = 'video'
70
+ end
71
+
72
+ if attributes.key?(:'src')
73
+ self.src = attributes[:'src']
74
+ end
75
+
76
+ if attributes.key?(:'trim')
77
+ self.trim = attributes[:'trim']
78
+ end
79
+
80
+ if attributes.key?(:'volume')
81
+ self.volume = attributes[:'volume']
82
+ end
83
+ end
84
+
85
+ # Show invalid properties with the reasons. Usually used together with valid?
86
+ # @return Array for valid properties with the reasons
87
+ def list_invalid_properties
88
+ invalid_properties = Array.new
89
+ if @type.nil?
90
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
91
+ end
92
+
93
+ if @src.nil?
94
+ invalid_properties.push('invalid value for "src", src cannot be nil.')
95
+ end
96
+
97
+ invalid_properties
98
+ end
99
+
100
+ # Check to see if the all the properties in the model are valid
101
+ # @return true if the model is valid
102
+ def valid?
103
+ return false if @type.nil?
104
+ return false if @src.nil?
105
+ true
106
+ end
107
+
108
+ # Checks equality by comparing each attribute.
109
+ # @param [Object] Object to be compared
110
+ def ==(o)
111
+ return true if self.equal?(o)
112
+ self.class == o.class &&
113
+ type == o.type &&
114
+ src == o.src &&
115
+ trim == o.trim &&
116
+ volume == o.volume
117
+ end
118
+
119
+ # @see the `==` method
120
+ # @param [Object] Object to be compared
121
+ def eql?(o)
122
+ self == o
123
+ end
124
+
125
+ # Calculates hash code according to all attributes.
126
+ # @return [Integer] Hash code
127
+ def hash
128
+ [type, src, trim, volume].hash
129
+ end
130
+
131
+ # Builds the object from hash
132
+ # @param [Hash] attributes Model attributes in the form of hash
133
+ # @return [Object] Returns the model itself
134
+ 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
+ return nil unless attributes.is_a?(Hash)
143
+ self.class.openapi_types.each_pair do |key, type|
144
+ if type =~ /\AArray<(.*)>/i
145
+ # check to ensure the input is an array given that the attribute
146
+ # is documented as an array but the input is not
147
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
148
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
149
+ end
150
+ elsif !attributes[self.class.attribute_map[key]].nil?
151
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
152
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
153
+ end
154
+
155
+ self
156
+ end
157
+
158
+ # Deserializes the data based on type
159
+ # @param string type Data type
160
+ # @param string value Value to be deserialized
161
+ # @return [Object] Deserialized data
162
+ def _deserialize(type, value)
163
+ case type.to_sym
164
+ when :DateTime
165
+ DateTime.parse(value)
166
+ when :Date
167
+ Date.parse(value)
168
+ when :String
169
+ value.to_s
170
+ when :Integer
171
+ value.to_i
172
+ when :Float
173
+ value.to_f
174
+ when :Boolean
175
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
176
+ true
177
+ else
178
+ false
179
+ end
180
+ when :Object
181
+ # generic object (usually a Hash), return directly
182
+ value
183
+ when /\AArray<(?<inner_type>.+)>\z/
184
+ inner_type = Regexp.last_match[:inner_type]
185
+ value.map { |v| _deserialize(inner_type, v) }
186
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
187
+ k_type = Regexp.last_match[:k_type]
188
+ v_type = Regexp.last_match[:v_type]
189
+ {}.tap do |hash|
190
+ value.each do |k, v|
191
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
192
+ end
193
+ end
194
+ else # model
195
+ Shotstack.const_get(type).build_from_hash(value)
196
+ end
197
+ end
198
+
199
+ # Returns the string representation of the object
200
+ # @return [String] String presentation of the object
201
+ def to_s
202
+ to_hash.to_s
203
+ end
204
+
205
+ # to_body is an alias to to_hash (backward compatibility)
206
+ # @return [Hash] Returns the object in the form of hash
207
+ def to_body
208
+ to_hash
209
+ end
210
+
211
+ # Returns the object in the form of hash
212
+ # @return [Hash] Returns the object in the form of hash
213
+ def to_hash
214
+ hash = {}
215
+ self.class.attribute_map.each_pair do |attr, param|
216
+ value = self.send(attr)
217
+ next if value.nil?
218
+ hash[param] = _to_hash(value)
219
+ end
220
+ hash
221
+ end
222
+
223
+ # Outputs non-array value in the form of hash
224
+ # For object, use to_hash. Otherwise, just return the value
225
+ # @param [Object] value Any valid value
226
+ # @return [Hash] Returns the value in the form of hash
227
+ def _to_hash(value)
228
+ if value.is_a?(Array)
229
+ value.compact.map { |v| _to_hash(v) }
230
+ elsif value.is_a?(Hash)
231
+ {}.tap do |hash|
232
+ value.each { |k, v| hash[k] = _to_hash(v) }
233
+ end
234
+ elsif value.respond_to? :to_hash
235
+ value.to_hash
236
+ else
237
+ value
238
+ end
239
+ end
240
+ end
241
+ end
@@ -1,3 +1,15 @@
1
+ =begin
2
+ #shotstack
3
+
4
+ #The Shotstack API is a video editing service that allows for the programatic creation of videos using JSON.
5
+
6
+ OpenAPI spec version: v1
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.0.0-beta3
10
+
11
+ =end
12
+
1
13
  module Shotstack
2
- VERSION = "0.0.9"
14
+ VERSION = "0.0.10"
3
15
  end
data/shotstack.gemspec CHANGED
@@ -1,4 +1,17 @@
1
1
  # -*- encoding: utf-8 -*-
2
+
3
+ =begin
4
+ #shotstack
5
+
6
+ #The Shotstack API is a video editing service that allows for the programatic creation of videos using JSON.
7
+
8
+ OpenAPI spec version: v1
9
+
10
+ Generated by: https://openapi-generator.tech
11
+ OpenAPI Generator version: 4.0.0-beta3
12
+
13
+ =end
14
+
2
15
  $:.push File.expand_path("../lib", __FILE__)
3
16
  require "shotstack/version"
4
17
 
@@ -6,26 +19,26 @@ Gem::Specification.new do |s|
6
19
  s.name = "shotstack"
7
20
  s.version = Shotstack::VERSION
8
21
  s.platform = Gem::Platform::RUBY
9
- s.authors = [""]
22
+ s.authors = ["OpenAPI-Generator"]
10
23
  s.email = [""]
11
- s.homepage = ""
12
- s.summary = ""
13
- s.description = ""
14
- s.license = ""
15
-
24
+ s.homepage = "https://openapi-generator.tech"
25
+ s.summary = "shotstack Ruby Gem"
26
+ s.description = "The Shotstack API is a video editing service that allows for the programatic creation of videos using JSON. "
27
+ s.license = "Unlicense"
28
+ s.required_ruby_version = ">= 1.9"
16
29
 
17
- s.add_runtime_dependency 'typhoeus', '~> 0.2', '>= 0.2.1'
18
- s.add_runtime_dependency 'json', '~> 1.4', '>= 1.4.6'
30
+ s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1'
31
+ s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0'
19
32
 
20
- s.add_development_dependency 'rspec', '~> 3.2', '>= 3.2.0'
21
- s.add_development_dependency 'vcr', '~> 2.9', '>= 2.9.3'
22
- s.add_development_dependency 'webmock', '~> 1.6', '>= 1.6.2'
33
+ s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0'
34
+ s.add_development_dependency 'vcr', '~> 3.0', '>= 3.0.1'
35
+ s.add_development_dependency 'webmock', '~> 1.24', '>= 1.24.3'
23
36
  s.add_development_dependency 'autotest', '~> 4.4', '>= 4.4.6'
24
37
  s.add_development_dependency 'autotest-rails-pure', '~> 4.1', '>= 4.1.2'
25
38
  s.add_development_dependency 'autotest-growl', '~> 0.2', '>= 0.2.16'
26
- s.add_development_dependency 'autotest-fsevent', '~> 0.2', '>= 0.2.11'
39
+ s.add_development_dependency 'autotest-fsevent', '~> 0.2', '>= 0.2.12'
27
40
 
28
- s.files = `find *`.split("\n").uniq.sort.select{|f| !f.empty? }
41
+ s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? }
29
42
  s.test_files = `find spec/*`.split("\n")
30
43
  s.executables = []
31
44
  s.require_paths = ["lib"]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shotstack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
- - ''
7
+ - OpenAPI-Generator
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-12-19 00:00:00.000000000 Z
11
+ date: 2019-05-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -16,100 +16,100 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.2'
19
+ version: '1.0'
20
20
  - - ">="
21
21
  - !ruby/object:Gem::Version
22
- version: 0.2.1
22
+ version: 1.0.1
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - "~>"
28
28
  - !ruby/object:Gem::Version
29
- version: '0.2'
29
+ version: '1.0'
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
- version: 0.2.1
32
+ version: 1.0.1
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: json
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: '1.4'
39
+ version: '2.1'
40
40
  - - ">="
41
41
  - !ruby/object:Gem::Version
42
- version: 1.4.6
42
+ version: 2.1.0
43
43
  type: :runtime
44
44
  prerelease: false
45
45
  version_requirements: !ruby/object:Gem::Requirement
46
46
  requirements:
47
47
  - - "~>"
48
48
  - !ruby/object:Gem::Version
49
- version: '1.4'
49
+ version: '2.1'
50
50
  - - ">="
51
51
  - !ruby/object:Gem::Version
52
- version: 1.4.6
52
+ version: 2.1.0
53
53
  - !ruby/object:Gem::Dependency
54
54
  name: rspec
55
55
  requirement: !ruby/object:Gem::Requirement
56
56
  requirements:
57
57
  - - "~>"
58
58
  - !ruby/object:Gem::Version
59
- version: '3.2'
59
+ version: '3.6'
60
60
  - - ">="
61
61
  - !ruby/object:Gem::Version
62
- version: 3.2.0
62
+ version: 3.6.0
63
63
  type: :development
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
67
  - - "~>"
68
68
  - !ruby/object:Gem::Version
69
- version: '3.2'
69
+ version: '3.6'
70
70
  - - ">="
71
71
  - !ruby/object:Gem::Version
72
- version: 3.2.0
72
+ version: 3.6.0
73
73
  - !ruby/object:Gem::Dependency
74
74
  name: vcr
75
75
  requirement: !ruby/object:Gem::Requirement
76
76
  requirements:
77
77
  - - "~>"
78
78
  - !ruby/object:Gem::Version
79
- version: '2.9'
79
+ version: '3.0'
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
- version: 2.9.3
82
+ version: 3.0.1
83
83
  type: :development
84
84
  prerelease: false
85
85
  version_requirements: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '2.9'
89
+ version: '3.0'
90
90
  - - ">="
91
91
  - !ruby/object:Gem::Version
92
- version: 2.9.3
92
+ version: 3.0.1
93
93
  - !ruby/object:Gem::Dependency
94
94
  name: webmock
95
95
  requirement: !ruby/object:Gem::Requirement
96
96
  requirements:
97
97
  - - "~>"
98
98
  - !ruby/object:Gem::Version
99
- version: '1.6'
99
+ version: '1.24'
100
100
  - - ">="
101
101
  - !ruby/object:Gem::Version
102
- version: 1.6.2
102
+ version: 1.24.3
103
103
  type: :development
104
104
  prerelease: false
105
105
  version_requirements: !ruby/object:Gem::Requirement
106
106
  requirements:
107
107
  - - "~>"
108
108
  - !ruby/object:Gem::Version
109
- version: '1.6'
109
+ version: '1.24'
110
110
  - - ">="
111
111
  - !ruby/object:Gem::Version
112
- version: 1.6.2
112
+ version: 1.24.3
113
113
  - !ruby/object:Gem::Dependency
114
114
  name: autotest
115
115
  requirement: !ruby/object:Gem::Requirement
@@ -179,7 +179,7 @@ dependencies:
179
179
  version: '0.2'
180
180
  - - ">="
181
181
  - !ruby/object:Gem::Version
182
- version: 0.2.11
182
+ version: 0.2.12
183
183
  type: :development
184
184
  prerelease: false
185
185
  version_requirements: !ruby/object:Gem::Requirement
@@ -189,8 +189,9 @@ dependencies:
189
189
  version: '0.2'
190
190
  - - ">="
191
191
  - !ruby/object:Gem::Version
192
- version: 0.2.11
193
- description: ''
192
+ version: 0.2.12
193
+ description: 'The Shotstack API is a video editing service that allows for the programatic
194
+ creation of videos using JSON. '
194
195
  email:
195
196
  - ''
196
197
  executables: []
@@ -199,14 +200,14 @@ extra_rdoc_files: []
199
200
  files:
200
201
  - README.md
201
202
  - lib/shotstack.rb
202
- - lib/shotstack/api/render_api.rb
203
+ - lib/shotstack/api/default_api.rb
203
204
  - lib/shotstack/api_client.rb
204
205
  - lib/shotstack/api_error.rb
205
206
  - lib/shotstack/configuration.rb
206
- - lib/shotstack/models/clips.rb
207
+ - lib/shotstack/models/asset.rb
208
+ - lib/shotstack/models/clip.rb
207
209
  - lib/shotstack/models/edit.rb
208
- - lib/shotstack/models/image_clip.rb
209
- - lib/shotstack/models/image_clip_options.rb
210
+ - lib/shotstack/models/image_asset.rb
210
211
  - lib/shotstack/models/output.rb
211
212
  - lib/shotstack/models/queued_response.rb
212
213
  - lib/shotstack/models/queued_response_data.rb
@@ -214,18 +215,15 @@ files:
214
215
  - lib/shotstack/models/render_response_data.rb
215
216
  - lib/shotstack/models/soundtrack.rb
216
217
  - lib/shotstack/models/timeline.rb
217
- - lib/shotstack/models/title_clip.rb
218
- - lib/shotstack/models/title_clip_options.rb
218
+ - lib/shotstack/models/title_asset.rb
219
219
  - lib/shotstack/models/track.rb
220
220
  - lib/shotstack/models/transition.rb
221
- - lib/shotstack/models/video_clip.rb
222
- - lib/shotstack/models/video_clip_options.rb
221
+ - lib/shotstack/models/video_asset.rb
223
222
  - lib/shotstack/version.rb
224
223
  - shotstack.gemspec
225
- - tags
226
- homepage: ''
224
+ homepage: https://openapi-generator.tech
227
225
  licenses:
228
- - ''
226
+ - Unlicense
229
227
  metadata: {}
230
228
  post_install_message:
231
229
  rdoc_options: []
@@ -235,7 +233,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
235
233
  requirements:
236
234
  - - ">="
237
235
  - !ruby/object:Gem::Version
238
- version: '0'
236
+ version: '1.9'
239
237
  required_rubygems_version: !ruby/object:Gem::Requirement
240
238
  requirements:
241
239
  - - ">="
@@ -243,8 +241,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
243
241
  version: '0'
244
242
  requirements: []
245
243
  rubyforge_project:
246
- rubygems_version: 2.6.14.1
244
+ rubygems_version: 2.7.6
247
245
  signing_key:
248
246
  specification_version: 4
249
- summary: ''
247
+ summary: shotstack Ruby Gem
250
248
  test_files: []