ilovevideoeditor-sdk 1.0.1 → 1.0.2

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.
@@ -0,0 +1,200 @@
1
+ =begin
2
+ #iLoveVideoEditor API
3
+
4
+ #Cloud video rendering API for iLoveVideoEditor. Submit a `VideoJSON` payload, queue a render job, and download the resulting MP4. **Authentication** - **API Key** (`x-api-key` header) — accepted by render pipeline and tool endpoints. - **Bearer Token** (`Authorization: Bearer <jwt>`) — required for user-scoped project, asset, billing, and webhook endpoints. - Many endpoints accept either form of authentication. **SDKs** Official typed SDKs are available for JavaScript/TypeScript, PHP, Python, Ruby, and Go. See https://ilovevideoeditor.com/docs/sdks **Outbound Webhooks** Render lifecycle events (`render.completed`, `render.failed`) are delivered to your endpoints as signed HTTP POST requests. See the `Webhooks` tag and the root-level `x-webhook-docs` extension for the payload format (`RenderWebhookPayload`), signature headers, HMAC verification, and the retry policy.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.22.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module ILoveVideoEditor
17
+ class ReviewWorkflowStepRequest < ApiModelBase
18
+ attr_accessor :action
19
+
20
+ # Variable edits applied on approve.
21
+ attr_accessor :variables
22
+
23
+ class EnumAttributeValidator
24
+ attr_reader :datatype
25
+ attr_reader :allowable_values
26
+
27
+ def initialize(datatype, allowable_values)
28
+ @allowable_values = allowable_values.map do |value|
29
+ case datatype.to_s
30
+ when /Integer/i
31
+ value.to_i
32
+ when /Float/i
33
+ value.to_f
34
+ else
35
+ value
36
+ end
37
+ end
38
+ end
39
+
40
+ def valid?(value)
41
+ !value || allowable_values.include?(value)
42
+ end
43
+ end
44
+
45
+ # Attribute mapping from ruby-style variable name to JSON key.
46
+ def self.attribute_map
47
+ {
48
+ :'action' => :'action',
49
+ :'variables' => :'variables'
50
+ }
51
+ end
52
+
53
+ # Returns attribute mapping this model knows about
54
+ def self.acceptable_attribute_map
55
+ attribute_map
56
+ end
57
+
58
+ # Returns all the JSON keys this model knows about
59
+ def self.acceptable_attributes
60
+ acceptable_attribute_map.values
61
+ end
62
+
63
+ # Attribute type mapping.
64
+ def self.openapi_types
65
+ {
66
+ :'action' => :'String',
67
+ :'variables' => :'Hash<String, Object>'
68
+ }
69
+ end
70
+
71
+ # List of attributes with nullable: true
72
+ def self.openapi_nullable
73
+ Set.new([
74
+ ])
75
+ end
76
+
77
+ # Initializes the object
78
+ # @param [Hash] attributes Model attributes in the form of hash
79
+ def initialize(attributes = {})
80
+ if (!attributes.is_a?(Hash))
81
+ fail ArgumentError, "The input argument (attributes) must be a hash in `ILoveVideoEditor::ReviewWorkflowStepRequest` initialize method"
82
+ end
83
+
84
+ # check to see if the attribute exists and convert string to symbol for hash key
85
+ acceptable_attribute_map = self.class.acceptable_attribute_map
86
+ attributes = attributes.each_with_object({}) { |(k, v), h|
87
+ if (!acceptable_attribute_map.key?(k.to_sym))
88
+ fail ArgumentError, "`#{k}` is not a valid attribute in `ILoveVideoEditor::ReviewWorkflowStepRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
89
+ end
90
+ h[k.to_sym] = v
91
+ }
92
+
93
+ if attributes.key?(:'action')
94
+ self.action = attributes[:'action']
95
+ else
96
+ self.action = nil
97
+ end
98
+
99
+ if attributes.key?(:'variables')
100
+ if (value = attributes[:'variables']).is_a?(Hash)
101
+ self.variables = value
102
+ end
103
+ end
104
+ end
105
+
106
+ # Show invalid properties with the reasons. Usually used together with valid?
107
+ # @return Array for valid properties with the reasons
108
+ def list_invalid_properties
109
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
110
+ invalid_properties = Array.new
111
+ if @action.nil?
112
+ invalid_properties.push('invalid value for "action", action 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
+ warn '[DEPRECATED] the `valid?` method is obsolete'
122
+ return false if @action.nil?
123
+ action_validator = EnumAttributeValidator.new('String', ["approve", "reject"])
124
+ return false unless action_validator.valid?(@action)
125
+ true
126
+ end
127
+
128
+ # Custom attribute writer method checking allowed values (enum).
129
+ # @param [Object] action Object to be assigned
130
+ def action=(action)
131
+ validator = EnumAttributeValidator.new('String', ["approve", "reject"])
132
+ unless validator.valid?(action)
133
+ fail ArgumentError, "invalid value for \"action\", must be one of #{validator.allowable_values}."
134
+ end
135
+ @action = action
136
+ end
137
+
138
+ # Checks equality by comparing each attribute.
139
+ # @param [Object] Object to be compared
140
+ def ==(o)
141
+ return true if self.equal?(o)
142
+ self.class == o.class &&
143
+ action == o.action &&
144
+ variables == o.variables
145
+ end
146
+
147
+ # @see the `==` method
148
+ # @param [Object] Object to be compared
149
+ def eql?(o)
150
+ self == o
151
+ end
152
+
153
+ # Calculates hash code according to all attributes.
154
+ # @return [Integer] Hash code
155
+ def hash
156
+ [action, variables].hash
157
+ end
158
+
159
+ # Builds the object from hash
160
+ # @param [Hash] attributes Model attributes in the form of hash
161
+ # @return [Object] Returns the model itself
162
+ def self.build_from_hash(attributes)
163
+ return nil unless attributes.is_a?(Hash)
164
+ attributes = attributes.transform_keys(&:to_sym)
165
+ transformed_hash = {}
166
+ openapi_types.each_pair do |key, type|
167
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
168
+ transformed_hash["#{key}"] = nil
169
+ elsif type =~ /\AArray<(.*)>/i
170
+ # check to ensure the input is an array given that the attribute
171
+ # is documented as an array but the input is not
172
+ if attributes[attribute_map[key]].is_a?(Array)
173
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
174
+ end
175
+ elsif !attributes[attribute_map[key]].nil?
176
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
177
+ end
178
+ end
179
+ new(transformed_hash)
180
+ end
181
+
182
+ # Returns the object in the form of hash
183
+ # @return [Hash] Returns the object in the form of hash
184
+ def to_hash
185
+ hash = {}
186
+ self.class.attribute_map.each_pair do |attr, param|
187
+ value = self.send(attr)
188
+ if value.nil?
189
+ is_nullable = self.class.openapi_nullable.include?(attr)
190
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
191
+ end
192
+
193
+ hash[param] = _to_hash(value)
194
+ end
195
+ hash
196
+ end
197
+
198
+ end
199
+
200
+ end
@@ -28,6 +28,8 @@ module ILoveVideoEditor
28
28
 
29
29
  attr_accessor :icon
30
30
 
31
+ attr_accessor :mode
32
+
31
33
  attr_accessor :tool_id
32
34
 
33
35
  attr_accessor :variables_schema
@@ -63,6 +65,7 @@ module ILoveVideoEditor
63
65
  :'platform' => :'platform',
64
66
  :'accent_color' => :'accentColor',
65
67
  :'icon' => :'icon',
68
+ :'mode' => :'mode',
66
69
  :'tool_id' => :'toolId',
67
70
  :'variables_schema' => :'variablesSchema'
68
71
  }
@@ -87,6 +90,7 @@ module ILoveVideoEditor
87
90
  :'platform' => :'String',
88
91
  :'accent_color' => :'String',
89
92
  :'icon' => :'String',
93
+ :'mode' => :'String',
90
94
  :'tool_id' => :'String',
91
95
  :'variables_schema' => :'Array<Hash<String, Object>>'
92
96
  }
@@ -150,6 +154,12 @@ module ILoveVideoEditor
150
154
  self.icon = nil
151
155
  end
152
156
 
157
+ if attributes.key?(:'mode')
158
+ self.mode = attributes[:'mode']
159
+ else
160
+ self.mode = nil
161
+ end
162
+
153
163
  if attributes.key?(:'tool_id')
154
164
  self.tool_id = attributes[:'tool_id']
155
165
  end
@@ -186,6 +196,10 @@ module ILoveVideoEditor
186
196
  invalid_properties.push('invalid value for "icon", icon cannot be nil.')
187
197
  end
188
198
 
199
+ if @mode.nil?
200
+ invalid_properties.push('invalid value for "mode", mode cannot be nil.')
201
+ end
202
+
189
203
  invalid_properties
190
204
  end
191
205
 
@@ -200,6 +214,9 @@ module ILoveVideoEditor
200
214
  return false unless platform_validator.valid?(@platform)
201
215
  return false if @accent_color.nil?
202
216
  return false if @icon.nil?
217
+ return false if @mode.nil?
218
+ mode_validator = EnumAttributeValidator.new('String', ["preset", "project"])
219
+ return false unless mode_validator.valid?(@mode)
203
220
  true
204
221
  end
205
222
 
@@ -253,6 +270,16 @@ module ILoveVideoEditor
253
270
  @icon = icon
254
271
  end
255
272
 
273
+ # Custom attribute writer method checking allowed values (enum).
274
+ # @param [Object] mode Object to be assigned
275
+ def mode=(mode)
276
+ validator = EnumAttributeValidator.new('String', ["preset", "project"])
277
+ unless validator.valid?(mode)
278
+ fail ArgumentError, "invalid value for \"mode\", must be one of #{validator.allowable_values}."
279
+ end
280
+ @mode = mode
281
+ end
282
+
256
283
  # Checks equality by comparing each attribute.
257
284
  # @param [Object] Object to be compared
258
285
  def ==(o)
@@ -264,6 +291,7 @@ module ILoveVideoEditor
264
291
  platform == o.platform &&
265
292
  accent_color == o.accent_color &&
266
293
  icon == o.icon &&
294
+ mode == o.mode &&
267
295
  tool_id == o.tool_id &&
268
296
  variables_schema == o.variables_schema
269
297
  end
@@ -277,7 +305,7 @@ module ILoveVideoEditor
277
305
  # Calculates hash code according to all attributes.
278
306
  # @return [Integer] Hash code
279
307
  def hash
280
- [id, name, description, platform, accent_color, icon, tool_id, variables_schema].hash
308
+ [id, name, description, platform, accent_color, icon, mode, tool_id, variables_schema].hash
281
309
  end
282
310
 
283
311
  # Builds the object from hash
@@ -27,6 +27,8 @@ module ILoveVideoEditor
27
27
 
28
28
  attr_accessor :icon
29
29
 
30
+ attr_accessor :mode
31
+
30
32
  attr_accessor :tool_id
31
33
 
32
34
  attr_accessor :variables_schema
@@ -62,6 +64,7 @@ module ILoveVideoEditor
62
64
  :'platform' => :'platform',
63
65
  :'accent_color' => :'accentColor',
64
66
  :'icon' => :'icon',
67
+ :'mode' => :'mode',
65
68
  :'tool_id' => :'toolId',
66
69
  :'variables_schema' => :'variablesSchema'
67
70
  }
@@ -86,6 +89,7 @@ module ILoveVideoEditor
86
89
  :'platform' => :'String',
87
90
  :'accent_color' => :'String',
88
91
  :'icon' => :'String',
92
+ :'mode' => :'String',
89
93
  :'tool_id' => :'String',
90
94
  :'variables_schema' => :'Array<Hash<String, Object>>'
91
95
  }
@@ -148,6 +152,12 @@ module ILoveVideoEditor
148
152
  self.icon = nil
149
153
  end
150
154
 
155
+ if attributes.key?(:'mode')
156
+ self.mode = attributes[:'mode']
157
+ else
158
+ self.mode = nil
159
+ end
160
+
151
161
  if attributes.key?(:'tool_id')
152
162
  self.tool_id = attributes[:'tool_id']
153
163
  end
@@ -184,6 +194,10 @@ module ILoveVideoEditor
184
194
  invalid_properties.push('invalid value for "icon", icon cannot be nil.')
185
195
  end
186
196
 
197
+ if @mode.nil?
198
+ invalid_properties.push('invalid value for "mode", mode cannot be nil.')
199
+ end
200
+
187
201
  invalid_properties
188
202
  end
189
203
 
@@ -198,6 +212,9 @@ module ILoveVideoEditor
198
212
  return false unless platform_validator.valid?(@platform)
199
213
  return false if @accent_color.nil?
200
214
  return false if @icon.nil?
215
+ return false if @mode.nil?
216
+ mode_validator = EnumAttributeValidator.new('String', ["preset", "project"])
217
+ return false unless mode_validator.valid?(@mode)
201
218
  true
202
219
  end
203
220
 
@@ -251,6 +268,16 @@ module ILoveVideoEditor
251
268
  @icon = icon
252
269
  end
253
270
 
271
+ # Custom attribute writer method checking allowed values (enum).
272
+ # @param [Object] mode Object to be assigned
273
+ def mode=(mode)
274
+ validator = EnumAttributeValidator.new('String', ["preset", "project"])
275
+ unless validator.valid?(mode)
276
+ fail ArgumentError, "invalid value for \"mode\", must be one of #{validator.allowable_values}."
277
+ end
278
+ @mode = mode
279
+ end
280
+
254
281
  # Checks equality by comparing each attribute.
255
282
  # @param [Object] Object to be compared
256
283
  def ==(o)
@@ -262,6 +289,7 @@ module ILoveVideoEditor
262
289
  platform == o.platform &&
263
290
  accent_color == o.accent_color &&
264
291
  icon == o.icon &&
292
+ mode == o.mode &&
265
293
  tool_id == o.tool_id &&
266
294
  variables_schema == o.variables_schema
267
295
  end
@@ -275,7 +303,7 @@ module ILoveVideoEditor
275
303
  # Calculates hash code according to all attributes.
276
304
  # @return [Integer] Hash code
277
305
  def hash
278
- [id, name, description, platform, accent_color, icon, tool_id, variables_schema].hash
306
+ [id, name, description, platform, accent_color, icon, mode, tool_id, variables_schema].hash
279
307
  end
280
308
 
281
309
  # Builds the object from hash
@@ -29,6 +29,9 @@ module ILoveVideoEditor
29
29
 
30
30
  attr_accessor :is_active
31
31
 
32
+ # Id of the system preset this workflow was imported from (null when built from scratch).
33
+ attr_accessor :source_preset_id
34
+
32
35
  attr_accessor :created_at
33
36
 
34
37
  attr_accessor :updated_at
@@ -43,6 +46,7 @@ module ILoveVideoEditor
43
46
  :'description' => :'description',
44
47
  :'definition' => :'definition',
45
48
  :'is_active' => :'isActive',
49
+ :'source_preset_id' => :'sourcePresetId',
46
50
  :'created_at' => :'createdAt',
47
51
  :'updated_at' => :'updatedAt'
48
52
  }
@@ -68,6 +72,7 @@ module ILoveVideoEditor
68
72
  :'description' => :'String',
69
73
  :'definition' => :'WorkflowDefinition',
70
74
  :'is_active' => :'Boolean',
75
+ :'source_preset_id' => :'String',
71
76
  :'created_at' => :'Time',
72
77
  :'updated_at' => :'Time'
73
78
  }
@@ -77,6 +82,7 @@ module ILoveVideoEditor
77
82
  def self.openapi_nullable
78
83
  Set.new([
79
84
  :'description',
85
+ :'source_preset_id',
80
86
  ])
81
87
  end
82
88
 
@@ -136,6 +142,10 @@ module ILoveVideoEditor
136
142
  self.is_active = nil
137
143
  end
138
144
 
145
+ if attributes.key?(:'source_preset_id')
146
+ self.source_preset_id = attributes[:'source_preset_id']
147
+ end
148
+
139
149
  if attributes.key?(:'created_at')
140
150
  self.created_at = attributes[:'created_at']
141
151
  else
@@ -296,6 +306,7 @@ module ILoveVideoEditor
296
306
  description == o.description &&
297
307
  definition == o.definition &&
298
308
  is_active == o.is_active &&
309
+ source_preset_id == o.source_preset_id &&
299
310
  created_at == o.created_at &&
300
311
  updated_at == o.updated_at
301
312
  end
@@ -309,7 +320,7 @@ module ILoveVideoEditor
309
320
  # Calculates hash code according to all attributes.
310
321
  # @return [Integer] Hash code
311
322
  def hash
312
- [id, workspace_id, created_by, name, description, definition, is_active, created_at, updated_at].hash
323
+ [id, workspace_id, created_by, name, description, definition, is_active, source_preset_id, created_at, updated_at].hash
313
324
  end
314
325
 
315
326
  # Builds the object from hash