Class: Aimastering::MasteringApi

Inherits:
Object
  • Object
show all
Defined in:
lib/aimastering/api/mastering_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ MasteringApi

Returns a new instance of MasteringApi.



19
20
21
# File 'lib/aimastering/api/mastering_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/aimastering/api/mastering_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#cancel_mastering(id, opts = {}) ⇒ Mastering

Cancel a mastering by id.

Parameters:

  • id

    Mastering id

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



28
29
30
31
# File 'lib/aimastering/api/mastering_api.rb', line 28

def cancel_mastering(id, opts = {})
  data, _status_code, _headers = cancel_mastering_with_http_info(id, opts)
  return data
end

#cancel_mastering_with_http_info(id, opts = {}) ⇒ Array<(Mastering, Fixnum, Hash)>

Cancel a mastering by id.

Parameters:

  • id

    Mastering id

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Mastering, Fixnum, Hash)>)

    Mastering data, response status code and response headers



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/aimastering/api/mastering_api.rb', line 38

def cancel_mastering_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: MasteringApi.cancel_mastering ..."
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling MasteringApi.cancel_mastering"
  end
  if @api_client.config.client_side_validation && id < 1
    fail ArgumentError, 'invalid value for "id" when calling MasteringApi.cancel_mastering, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = "/masterings/{id}/cancel".sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['bearer']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Mastering')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: MasteringApi#cancel_mastering\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_mastering(input_audio_id, opts = {}) ⇒ Mastering

Create a new mastering.

Parameters:

  • input_audio_id

    Input audio id

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :mode (String)

    Mode (default to default)

  • :bass_preservation (BOOLEAN)

    This parameter represents if the bass preservation is enabled. (default to false)

  • :mastering (BOOLEAN)

    This parameter represents if the mastering is enabled. This parameter is effective only when the mode is &quot;default&quot; or &quot;custom&quot;. (default to false)

  • :mastering_algorithm (String) — default: default to v2
  • :noise_reduction (BOOLEAN)

    This parameter represents if the nosie reduction is enabled. This parameter is effective only when the mode is &quot;custom&quot;. (default to false)

  • :preset (String)

    This parameter is effective only when the mode is &quot;custom&quot;. (default to general)

  • :target_loudness (Float)

    This parameter represents the target loudness of the output audio in dB. This parameter is effective only when the mode is &quot;custom&quot;. (default to -5)

  • :target_loudness_mode (String) — default: default to loudness
  • :mastering_matching_level (Float)

    This parameter represents the mastering reference matching level. This parameter is effective only when the mode is &quot;custom&quot; and the mastering is enabled. (default to 0.5)

  • :mastering_reverb (BOOLEAN)

    This parameter represents if the mastering reverb is enabled. This parameter is effective only when the mode is &quot;custom&quot; and the mastering is enabled. (default to false)

  • :mastering_reverb_gain (Float)

    This parameter represents the mastering reverb gain relative to the dry sound in dB. This parameter is effective only when the mode is &quot;custom&quot; and the mastering is &quot;true&quot; and the mastering_reverb is &quot;true&quot;. (default to -36)

  • :reference_audio_id (Integer)

    Reference audio id. This parameter is effective only when the mode is &quot;custom&quot; and the mastering is enabled.

  • :low_cut_freq (Float)

    This parameter represents the low cut freq of the output audio in Hz. This parameter is effective only when the mode is &quot;custom&quot;. (default to 20)

  • :high_cut_freq (Float)

    This parameter represents the high cut freq of the output audio in Hz. This parameter is effective only when the mode is &quot;custom&quot;. (default to 20000)

  • :ceiling (Float) — default: default to 0
  • :ceiling_mode (String) — default: default to 0
  • :oversample (Integer) — default: default to 1
  • :sample_rate (Integer)

    This parameter represents the sample rate of the output audio in dB. This parameter is effective only when the mode is &quot;custom&quot;. (default to 44100)

  • :bit_depth (Integer)

    This parameter represents the bit depth of the output audio in dB. This parameter is effective only when the mode is &quot;custom&quot;. (default to 16)

  • :output_format (String)

    This parameter represents the format of the output audio. This parameter is effective only when the mode is &quot;custom&quot;. (default to wav)

  • :for_preview (BOOLEAN)

    If this is true, the mastering is treated for preview purpose (ex. not purchasable, not publishable, short lifetime). (default to false)

  • :start_at (Float)

    Partial mastering start at. (default to 0)

  • :end_at (Float)

    Partial mastering end at. (default to -1)

  • :video_title (String)

    This parameter represents the title of output video. (default to )

Returns:



109
110
111
112
# File 'lib/aimastering/api/mastering_api.rb', line 109

def create_mastering(input_audio_id, opts = {})
  data, _status_code, _headers = create_mastering_with_http_info(input_audio_id, opts)
  return data
end

#create_mastering_with_http_info(input_audio_id, opts = {}) ⇒ Array<(Mastering, Fixnum, Hash)>

Create a new mastering.

Parameters:

  • input_audio_id

    Input audio id

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :mode (String)

    Mode

  • :bass_preservation (BOOLEAN)

    This parameter represents if the bass preservation is enabled.

  • :mastering (BOOLEAN)

    This parameter represents if the mastering is enabled. This parameter is effective only when the mode is &quot;default&quot; or &quot;custom&quot;.

  • :mastering_algorithm (String)
  • :noise_reduction (BOOLEAN)

    This parameter represents if the nosie reduction is enabled. This parameter is effective only when the mode is &quot;custom&quot;.

  • :preset (String)

    This parameter is effective only when the mode is &quot;custom&quot;.

  • :target_loudness (Float)

    This parameter represents the target loudness of the output audio in dB. This parameter is effective only when the mode is &quot;custom&quot;.

  • :target_loudness_mode (String)
  • :mastering_matching_level (Float)

    This parameter represents the mastering reference matching level. This parameter is effective only when the mode is &quot;custom&quot; and the mastering is enabled.

  • :mastering_reverb (BOOLEAN)

    This parameter represents if the mastering reverb is enabled. This parameter is effective only when the mode is &quot;custom&quot; and the mastering is enabled.

  • :mastering_reverb_gain (Float)

    This parameter represents the mastering reverb gain relative to the dry sound in dB. This parameter is effective only when the mode is &quot;custom&quot; and the mastering is &quot;true&quot; and the mastering_reverb is &quot;true&quot;.

  • :reference_audio_id (Integer)

    Reference audio id. This parameter is effective only when the mode is &quot;custom&quot; and the mastering is enabled.

  • :low_cut_freq (Float)

    This parameter represents the low cut freq of the output audio in Hz. This parameter is effective only when the mode is &quot;custom&quot;.

  • :high_cut_freq (Float)

    This parameter represents the high cut freq of the output audio in Hz. This parameter is effective only when the mode is &quot;custom&quot;.

  • :ceiling (Float)
  • :ceiling_mode (String)
  • :oversample (Integer)
  • :sample_rate (Integer)

    This parameter represents the sample rate of the output audio in dB. This parameter is effective only when the mode is &quot;custom&quot;.

  • :bit_depth (Integer)

    This parameter represents the bit depth of the output audio in dB. This parameter is effective only when the mode is &quot;custom&quot;.

  • :output_format (String)

    This parameter represents the format of the output audio. This parameter is effective only when the mode is &quot;custom&quot;.

  • :for_preview (BOOLEAN)

    If this is true, the mastering is treated for preview purpose (ex. not purchasable, not publishable, short lifetime).

  • :start_at (Float)

    Partial mastering start at.

  • :end_at (Float)

    Partial mastering end at.

  • :video_title (String)

    This parameter represents the title of output video.

Returns:

  • (Array<(Mastering, Fixnum, Hash)>)

    Mastering data, response status code and response headers



143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
# File 'lib/aimastering/api/mastering_api.rb', line 143

def create_mastering_with_http_info(input_audio_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: MasteringApi.create_mastering ..."
  end
  # verify the required parameter 'input_audio_id' is set
  if @api_client.config.client_side_validation && input_audio_id.nil?
    fail ArgumentError, "Missing the required parameter 'input_audio_id' when calling MasteringApi.create_mastering"
  end
  if @api_client.config.client_side_validation && input_audio_id < 1
    fail ArgumentError, 'invalid value for "input_audio_id" when calling MasteringApi.create_mastering, must be greater than or equal to 1.'
  end

  if @api_client.config.client_side_validation && opts[:'mode'] && !['default', 'custom'].include?(opts[:'mode'])
    fail ArgumentError, 'invalid value for "mode", must be one of default, custom'
  end
  if @api_client.config.client_side_validation && opts[:'mastering_algorithm'] && !['v1', 'v2'].include?(opts[:'mastering_algorithm'])
    fail ArgumentError, 'invalid value for "mastering_algorithm", must be one of v1, v2'
  end
  if @api_client.config.client_side_validation && opts[:'preset'] && !['general', 'pop', 'classical', 'jazz'].include?(opts[:'preset'])
    fail ArgumentError, 'invalid value for "preset", must be one of general, pop, classical, jazz'
  end
  if @api_client.config.client_side_validation && opts[:'target_loudness_mode'] && !['loudness', 'rms', 'peak', 'youtube_loudness'].include?(opts[:'target_loudness_mode'])
    fail ArgumentError, 'invalid value for "target_loudness_mode", must be one of loudness, rms, peak, youtube_loudness'
  end
  if @api_client.config.client_side_validation && !opts[:'mastering_matching_level'].nil? && opts[:'mastering_matching_level'] > 1
    fail ArgumentError, 'invalid value for "opts[:"mastering_matching_level"]" when calling MasteringApi.create_mastering, must be smaller than or equal to 1.'
  end

  if @api_client.config.client_side_validation && !opts[:'mastering_matching_level'].nil? && opts[:'mastering_matching_level'] < 0
    fail ArgumentError, 'invalid value for "opts[:"mastering_matching_level"]" when calling MasteringApi.create_mastering, must be greater than or equal to 0.'
  end

  if @api_client.config.client_side_validation && !opts[:'reference_audio_id'].nil? && opts[:'reference_audio_id'] < 1
    fail ArgumentError, 'invalid value for "opts[:"reference_audio_id"]" when calling MasteringApi.create_mastering, must be greater than or equal to 1.'
  end

  if @api_client.config.client_side_validation && !opts[:'low_cut_freq'].nil? && opts[:'low_cut_freq'] < 0
    fail ArgumentError, 'invalid value for "opts[:"low_cut_freq"]" when calling MasteringApi.create_mastering, must be greater than or equal to 0.'
  end

  if @api_client.config.client_side_validation && !opts[:'high_cut_freq'].nil? && opts[:'high_cut_freq'] < 0
    fail ArgumentError, 'invalid value for "opts[:"high_cut_freq"]" when calling MasteringApi.create_mastering, must be greater than or equal to 0.'
  end

  if @api_client.config.client_side_validation && opts[:'ceiling_mode'] && !['peak', 'true_peak', 'lowpass_true_peak'].include?(opts[:'ceiling_mode'])
    fail ArgumentError, 'invalid value for "ceiling_mode", must be one of peak, true_peak, lowpass_true_peak'
  end
  if @api_client.config.client_side_validation && opts[:'output_format'] && !['wav', 'mp3'].include?(opts[:'output_format'])
    fail ArgumentError, 'invalid value for "output_format", must be one of wav, mp3'
  end
  # resource path
  local_var_path = "/masterings"

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])

  # form parameters
  form_params = {}
  form_params["input_audio_id"] = input_audio_id
  form_params["mode"] = opts[:'mode'] if !opts[:'mode'].nil?
  form_params["bass_preservation"] = opts[:'bass_preservation'] if !opts[:'bass_preservation'].nil?
  form_params["mastering"] = opts[:'mastering'] if !opts[:'mastering'].nil?
  form_params["mastering_algorithm"] = opts[:'mastering_algorithm'] if !opts[:'mastering_algorithm'].nil?
  form_params["noise_reduction"] = opts[:'noise_reduction'] if !opts[:'noise_reduction'].nil?
  form_params["preset"] = opts[:'preset'] if !opts[:'preset'].nil?
  form_params["target_loudness"] = opts[:'target_loudness'] if !opts[:'target_loudness'].nil?
  form_params["target_loudness_mode"] = opts[:'target_loudness_mode'] if !opts[:'target_loudness_mode'].nil?
  form_params["mastering_matching_level"] = opts[:'mastering_matching_level'] if !opts[:'mastering_matching_level'].nil?
  form_params["mastering_reverb"] = opts[:'mastering_reverb'] if !opts[:'mastering_reverb'].nil?
  form_params["mastering_reverb_gain"] = opts[:'mastering_reverb_gain'] if !opts[:'mastering_reverb_gain'].nil?
  form_params["reference_audio_id"] = opts[:'reference_audio_id'] if !opts[:'reference_audio_id'].nil?
  form_params["low_cut_freq"] = opts[:'low_cut_freq'] if !opts[:'low_cut_freq'].nil?
  form_params["high_cut_freq"] = opts[:'high_cut_freq'] if !opts[:'high_cut_freq'].nil?
  form_params["ceiling"] = opts[:'ceiling'] if !opts[:'ceiling'].nil?
  form_params["ceiling_mode"] = opts[:'ceiling_mode'] if !opts[:'ceiling_mode'].nil?
  form_params["oversample"] = opts[:'oversample'] if !opts[:'oversample'].nil?
  form_params["sample_rate"] = opts[:'sample_rate'] if !opts[:'sample_rate'].nil?
  form_params["bit_depth"] = opts[:'bit_depth'] if !opts[:'bit_depth'].nil?
  form_params["output_format"] = opts[:'output_format'] if !opts[:'output_format'].nil?
  form_params["for_preview"] = opts[:'for_preview'] if !opts[:'for_preview'].nil?
  form_params["start_at"] = opts[:'start_at'] if !opts[:'start_at'].nil?
  form_params["end_at"] = opts[:'end_at'] if !opts[:'end_at'].nil?
  form_params["video_title"] = opts[:'video_title'] if !opts[:'video_title'].nil?

  # http body (model)
  post_body = nil
  auth_names = ['bearer']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Mastering')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: MasteringApi#create_mastering\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_mastering(id, opts = {}) ⇒ Mastering

Delete mastering.

Parameters:

  • id

    Mastering id

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



255
256
257
258
# File 'lib/aimastering/api/mastering_api.rb', line 255

def delete_mastering(id, opts = {})
  data, _status_code, _headers = delete_mastering_with_http_info(id, opts)
  return data
end

#delete_mastering_with_http_info(id, opts = {}) ⇒ Array<(Mastering, Fixnum, Hash)>

Delete mastering.

Parameters:

  • id

    Mastering id

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Mastering, Fixnum, Hash)>)

    Mastering data, response status code and response headers



265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
# File 'lib/aimastering/api/mastering_api.rb', line 265

def delete_mastering_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: MasteringApi.delete_mastering ..."
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling MasteringApi.delete_mastering"
  end
  if @api_client.config.client_side_validation && id < 1
    fail ArgumentError, 'invalid value for "id" when calling MasteringApi.delete_mastering, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = "/masterings/{id}".sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['bearer']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Mastering')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: MasteringApi#delete_mastering\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#free_unlock_mastering(id, opts = {}) ⇒ Mastering

Free unlock a mastering by id.

Parameters:

  • id

    Mastering id

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



312
313
314
315
# File 'lib/aimastering/api/mastering_api.rb', line 312

def free_unlock_mastering(id, opts = {})
  data, _status_code, _headers = free_unlock_mastering_with_http_info(id, opts)
  return data
end

#free_unlock_mastering_with_http_info(id, opts = {}) ⇒ Array<(Mastering, Fixnum, Hash)>

Free unlock a mastering by id.

Parameters:

  • id

    Mastering id

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Mastering, Fixnum, Hash)>)

    Mastering data, response status code and response headers



322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
# File 'lib/aimastering/api/mastering_api.rb', line 322

def free_unlock_mastering_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: MasteringApi.free_unlock_mastering ..."
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling MasteringApi.free_unlock_mastering"
  end
  if @api_client.config.client_side_validation && id < 1
    fail ArgumentError, 'invalid value for "id" when calling MasteringApi.free_unlock_mastering, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = "/masterings/{id}/free_unlock".sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['bearer']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Mastering')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: MasteringApi#free_unlock_mastering\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_mastering(id, opts = {}) ⇒ Mastering

Get a mastering by id.

Parameters:

  • id

    Mastering id

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



369
370
371
372
# File 'lib/aimastering/api/mastering_api.rb', line 369

def get_mastering(id, opts = {})
  data, _status_code, _headers = get_mastering_with_http_info(id, opts)
  return data
end

#get_mastering_unlock_product(id, opts = {}) ⇒ Mastering

Review a mastering by id.

Parameters:

  • id

    Mastering id

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



426
427
428
429
# File 'lib/aimastering/api/mastering_api.rb', line 426

def get_mastering_unlock_product(id, opts = {})
  data, _status_code, _headers = get_mastering_unlock_product_with_http_info(id, opts)
  return data
end

#get_mastering_unlock_product_with_http_info(id, opts = {}) ⇒ Array<(Mastering, Fixnum, Hash)>

Review a mastering by id.

Parameters:

  • id

    Mastering id

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Mastering, Fixnum, Hash)>)

    Mastering data, response status code and response headers



436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
# File 'lib/aimastering/api/mastering_api.rb', line 436

def get_mastering_unlock_product_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: MasteringApi.get_mastering_unlock_product ..."
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling MasteringApi.get_mastering_unlock_product"
  end
  if @api_client.config.client_side_validation && id < 1
    fail ArgumentError, 'invalid value for "id" when calling MasteringApi.get_mastering_unlock_product, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = "/masterings/{id}/unlock_product".sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['bearer']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Mastering')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: MasteringApi#get_mastering_unlock_product\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_mastering_with_http_info(id, opts = {}) ⇒ Array<(Mastering, Fixnum, Hash)>

Get a mastering by id.

Parameters:

  • id

    Mastering id

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Mastering, Fixnum, Hash)>)

    Mastering data, response status code and response headers



379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
# File 'lib/aimastering/api/mastering_api.rb', line 379

def get_mastering_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: MasteringApi.get_mastering ..."
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling MasteringApi.get_mastering"
  end
  if @api_client.config.client_side_validation && id < 1
    fail ArgumentError, 'invalid value for "id" when calling MasteringApi.get_mastering, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = "/masterings/{id}".sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['bearer']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Mastering')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: MasteringApi#get_mastering\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_masterings(opts = {}) ⇒ Array<Mastering>

Get all accessable masterings.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



482
483
484
485
# File 'lib/aimastering/api/mastering_api.rb', line 482

def list_masterings(opts = {})
  data, _status_code, _headers = list_masterings_with_http_info(opts)
  return data
end

#list_masterings_with_http_info(opts = {}) ⇒ Array<(Array<Mastering>, Fixnum, Hash)>

Get all accessable masterings.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Array<Mastering>, Fixnum, Hash)>)

    Array<Mastering> data, response status code and response headers



491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
# File 'lib/aimastering/api/mastering_api.rb', line 491

def list_masterings_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: MasteringApi.list_masterings ..."
  end
  # resource path
  local_var_path = "/masterings"

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['bearer']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Array<Mastering>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: MasteringApi#list_masterings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#publish_mastering(id, access_token, message, opts = {}) ⇒ Mastering

Publish a mastering by id.

Parameters:

  • id

    Mastering id

  • access_token

    This parameter represents if the access token of the publishment service API.

  • message

    This parameter represents the publishment message.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :service (String)

    This parameter represents the publishment service.

  • :access_token_secret (String)

    This parameter represents the access token secret of the publishment service API. This parameter is effective only when the service is &quot;twitter&quot;.

Returns:



534
535
536
537
# File 'lib/aimastering/api/mastering_api.rb', line 534

def publish_mastering(id, access_token, message, opts = {})
  data, _status_code, _headers = publish_mastering_with_http_info(id, access_token, message, opts)
  return data
end

#publish_mastering_with_http_info(id, access_token, message, opts = {}) ⇒ Array<(Mastering, Fixnum, Hash)>

Publish a mastering by id.

Parameters:

  • id

    Mastering id

  • access_token

    This parameter represents if the access token of the publishment service API.

  • message

    This parameter represents the publishment message.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :service (String)

    This parameter represents the publishment service.

  • :access_token_secret (String)

    This parameter represents the access token secret of the publishment service API. This parameter is effective only when the service is &quot;twitter&quot;.

Returns:

  • (Array<(Mastering, Fixnum, Hash)>)

    Mastering data, response status code and response headers



548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
# File 'lib/aimastering/api/mastering_api.rb', line 548

def publish_mastering_with_http_info(id, access_token, message, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: MasteringApi.publish_mastering ..."
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling MasteringApi.publish_mastering"
  end
  if @api_client.config.client_side_validation && id < 1
    fail ArgumentError, 'invalid value for "id" when calling MasteringApi.publish_mastering, must be greater than or equal to 1.'
  end

  # verify the required parameter 'access_token' is set
  if @api_client.config.client_side_validation && access_token.nil?
    fail ArgumentError, "Missing the required parameter 'access_token' when calling MasteringApi.publish_mastering"
  end
  # verify the required parameter 'message' is set
  if @api_client.config.client_side_validation && message.nil?
    fail ArgumentError, "Missing the required parameter 'message' when calling MasteringApi.publish_mastering"
  end
  if @api_client.config.client_side_validation && opts[:'service'] && !['twitter', 'youtube'].include?(opts[:'service'])
    fail ArgumentError, 'invalid value for "service", must be one of twitter, youtube'
  end
  # resource path
  local_var_path = "/masterings/{id}/publish".sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])

  # form parameters
  form_params = {}
  form_params["access_token"] = access_token
  form_params["message"] = message
  form_params["service"] = opts[:'service'] if !opts[:'service'].nil?
  form_params["access_token_secret"] = opts[:'access_token_secret'] if !opts[:'access_token_secret'].nil?

  # http body (model)
  post_body = nil
  auth_names = ['bearer']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Mastering')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: MasteringApi#publish_mastering\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#review_mastering(id, opts = {}) ⇒ Mastering

Review a mastering by id.

Parameters:

  • id

    Mastering id

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :review_comment (String)

    This parameter represents the review comment.

  • :review_score (Float)

    This parameter represents the review score.

Returns:



614
615
616
617
# File 'lib/aimastering/api/mastering_api.rb', line 614

def review_mastering(id, opts = {})
  data, _status_code, _headers = review_mastering_with_http_info(id, opts)
  return data
end

#review_mastering_with_http_info(id, opts = {}) ⇒ Array<(Mastering, Fixnum, Hash)>

Review a mastering by id.

Parameters:

  • id

    Mastering id

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :review_comment (String)

    This parameter represents the review comment.

  • :review_score (Float)

    This parameter represents the review score.

Returns:

  • (Array<(Mastering, Fixnum, Hash)>)

    Mastering data, response status code and response headers



626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
# File 'lib/aimastering/api/mastering_api.rb', line 626

def review_mastering_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: MasteringApi.review_mastering ..."
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling MasteringApi.review_mastering"
  end
  if @api_client.config.client_side_validation && id < 1
    fail ArgumentError, 'invalid value for "id" when calling MasteringApi.review_mastering, must be greater than or equal to 1.'
  end

  if @api_client.config.client_side_validation && !opts[:'review_score'].nil? && opts[:'review_score'] > 1
    fail ArgumentError, 'invalid value for "opts[:"review_score"]" when calling MasteringApi.review_mastering, must be smaller than or equal to 1.'
  end

  if @api_client.config.client_side_validation && !opts[:'review_score'].nil? && opts[:'review_score'] < 0
    fail ArgumentError, 'invalid value for "opts[:"review_score"]" when calling MasteringApi.review_mastering, must be greater than or equal to 0.'
  end

  # resource path
  local_var_path = "/masterings/{id}/review".sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])

  # form parameters
  form_params = {}
  form_params["review_comment"] = opts[:'review_comment'] if !opts[:'review_comment'].nil?
  form_params["review_score"] = opts[:'review_score'] if !opts[:'review_score'].nil?

  # http body (model)
  post_body = nil
  auth_names = ['bearer']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Mastering')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: MasteringApi#review_mastering\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_mastering(id, opts = {}) ⇒ Mastering

Update a mastering.

Parameters:

  • id

    Mastering id

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :preserved (BOOLEAN)

    Disable auto delete.

Returns:



686
687
688
689
# File 'lib/aimastering/api/mastering_api.rb', line 686

def update_mastering(id, opts = {})
  data, _status_code, _headers = update_mastering_with_http_info(id, opts)
  return data
end

#update_mastering_with_http_info(id, opts = {}) ⇒ Array<(Mastering, Fixnum, Hash)>

Update a mastering.

Parameters:

  • id

    Mastering id

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :preserved (BOOLEAN)

    Disable auto delete.

Returns:

  • (Array<(Mastering, Fixnum, Hash)>)

    Mastering data, response status code and response headers



697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
# File 'lib/aimastering/api/mastering_api.rb', line 697

def update_mastering_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: MasteringApi.update_mastering ..."
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling MasteringApi.update_mastering"
  end
  if @api_client.config.client_side_validation && id < 1
    fail ArgumentError, 'invalid value for "id" when calling MasteringApi.update_mastering, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = "/masterings/{id}".sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])

  # form parameters
  form_params = {}
  form_params["preserved"] = opts[:'preserved'] if !opts[:'preserved'].nil?

  # http body (model)
  post_body = nil
  auth_names = ['bearer']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Mastering')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: MasteringApi#update_mastering\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end