class Aimastering::MasteringApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/aimastering/api/mastering_api.rb, line 19
def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Public Instance Methods

cancel_mastering(id, opts = {}) click to toggle source

Cancel a mastering by id.

@param id Mastering id @param [Hash] opts the optional parameters @return [Mastering]

# 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 = {}) click to toggle source

Cancel a mastering by id.

@param id Mastering id @param [Hash] opts the optional parameters @return [Array<(Mastering, Fixnum, Hash)>] Mastering data, response status code and response headers

# 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 = {}) click to toggle source

Create a new mastering.

@param input_audio_id Input audio id @param [Hash] opts the optional parameters @option opts [String] :mode Mode (default to default) @option opts [BOOLEAN] :bass_preservation This parameter represents if the bass preservation is enabled. (default to false) @option opts [BOOLEAN] :mastering This parameter represents if the mastering is enabled. This parameter is effective only when the mode is "default&quot; or "custom&quot;. (default to false) @option opts [String] :mastering_algorithm (default to v2) @option opts [BOOLEAN] :noise_reduction This parameter represents if the nosie reduction is enabled. This parameter is effective only when the mode is "custom&quot;. (default to false) @option opts [String] :preset This parameter is effective only when the mode is "custom&quot;. (default to general) @option opts [Float] :target_loudness This parameter represents the target loudness of the output audio in dB. This parameter is effective only when the mode is "custom&quot;. (default to -5) @option opts [String] :target_loudness_mode (default to loudness) @option opts [Float] :mastering_matching_level This parameter represents the mastering reference matching level. This parameter is effective only when the mode is "custom&quot; and the mastering is enabled. (default to 0.5) @option opts [BOOLEAN] :mastering_reverb This parameter represents if the mastering reverb is enabled. This parameter is effective only when the mode is "custom&quot; and the mastering is enabled. (default to false) @option opts [Float] :mastering_reverb_gain This parameter represents the mastering reverb gain relative to the dry sound in dB. This parameter is effective only when the mode is "custom&quot; and the mastering is "true&quot; and the mastering_reverb is "true&quot;. (default to -36) @option opts [Integer] :reference_audio_id Reference audio id. This parameter is effective only when the mode is "custom&quot; and the mastering is enabled. @option opts [Float] :low_cut_freq This parameter represents the low cut freq of the output audio in Hz. This parameter is effective only when the mode is "custom&quot;. (default to 20) @option opts [Float] :high_cut_freq This parameter represents the high cut freq of the output audio in Hz. This parameter is effective only when the mode is "custom&quot;. (default to 20000) @option opts [Float] :ceiling (default to 0) @option opts [String] :ceiling_mode (default to 0) @option opts [Integer] :oversample (default to 1) @option opts [Integer] :sample_rate This parameter represents the sample rate of the output audio in dB. This parameter is effective only when the mode is "custom&quot;. (default to 44100) @option opts [Integer] :bit_depth This parameter represents the bit depth of the output audio in dB. This parameter is effective only when the mode is "custom&quot;. (default to 16) @option opts [String] :output_format This parameter represents the format of the output audio. This parameter is effective only when the mode is "custom&quot;. (default to wav) @option opts [BOOLEAN] :for_preview If this is true, the mastering is treated for preview purpose (ex. not purchasable, not publishable, short lifetime). (default to false) @option opts [Float] :start_at Partial mastering start at. (default to 0) @option opts [Float] :end_at Partial mastering end at. (default to -1) @option opts [String] :video_title This parameter represents the title of output video. (default to ) @return [Mastering]

# 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 = {}) click to toggle source

Create a new mastering.

@param input_audio_id Input audio id @param [Hash] opts the optional parameters @option opts [String] :mode Mode @option opts [BOOLEAN] :bass_preservation This parameter represents if the bass preservation is enabled. @option opts [BOOLEAN] :mastering This parameter represents if the mastering is enabled. This parameter is effective only when the mode is "default&quot; or "custom&quot;. @option opts [String] :mastering_algorithm @option opts [BOOLEAN] :noise_reduction This parameter represents if the nosie reduction is enabled. This parameter is effective only when the mode is "custom&quot;. @option opts [String] :preset This parameter is effective only when the mode is "custom&quot;. @option opts [Float] :target_loudness This parameter represents the target loudness of the output audio in dB. This parameter is effective only when the mode is "custom&quot;. @option opts [String] :target_loudness_mode @option opts [Float] :mastering_matching_level This parameter represents the mastering reference matching level. This parameter is effective only when the mode is "custom&quot; and the mastering is enabled. @option opts [BOOLEAN] :mastering_reverb This parameter represents if the mastering reverb is enabled. This parameter is effective only when the mode is "custom&quot; and the mastering is enabled. @option opts [Float] :mastering_reverb_gain This parameter represents the mastering reverb gain relative to the dry sound in dB. This parameter is effective only when the mode is "custom&quot; and the mastering is "true&quot; and the mastering_reverb is "true&quot;. @option opts [Integer] :reference_audio_id Reference audio id. This parameter is effective only when the mode is "custom&quot; and the mastering is enabled. @option opts [Float] :low_cut_freq This parameter represents the low cut freq of the output audio in Hz. This parameter is effective only when the mode is "custom&quot;. @option opts [Float] :high_cut_freq This parameter represents the high cut freq of the output audio in Hz. This parameter is effective only when the mode is "custom&quot;. @option opts [Float] :ceiling @option opts [String] :ceiling_mode @option opts [Integer] :oversample @option opts [Integer] :sample_rate This parameter represents the sample rate of the output audio in dB. This parameter is effective only when the mode is "custom&quot;. @option opts [Integer] :bit_depth This parameter represents the bit depth of the output audio in dB. This parameter is effective only when the mode is "custom&quot;. @option opts [String] :output_format This parameter represents the format of the output audio. This parameter is effective only when the mode is "custom&quot;. @option opts [BOOLEAN] :for_preview If this is true, the mastering is treated for preview purpose (ex. not purchasable, not publishable, short lifetime). @option opts [Float] :start_at Partial mastering start at. @option opts [Float] :end_at Partial mastering end at. @option opts [String] :video_title This parameter represents the title of output video. @return [Array<(Mastering, Fixnum, Hash)>] Mastering data, response status code and response headers

# 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 = {}) click to toggle source

Delete mastering.

@param id Mastering id @param [Hash] opts the optional parameters @return [Mastering]

# 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 = {}) click to toggle source

Delete mastering.

@param id Mastering id @param [Hash] opts the optional parameters @return [Array<(Mastering, Fixnum, Hash)>] Mastering data, response status code and response headers

# 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 = {}) click to toggle source

Free unlock a mastering by id.

@param id Mastering id @param [Hash] opts the optional parameters @return [Mastering]

# 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 = {}) click to toggle source

Free unlock a mastering by id.

@param id Mastering id @param [Hash] opts the optional parameters @return [Array<(Mastering, Fixnum, Hash)>] Mastering data, response status code and response headers

# 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 = {}) click to toggle source

Get a mastering by id.

@param id Mastering id @param [Hash] opts the optional parameters @return [Mastering]

# 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 = {}) click to toggle source

Review a mastering by id.

@param id Mastering id @param [Hash] opts the optional parameters @return [Mastering]

# 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 = {}) click to toggle source

Review a mastering by id.

@param id Mastering id @param [Hash] opts the optional parameters @return [Array<(Mastering, Fixnum, Hash)>] Mastering data, response status code and response headers

# 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 = {}) click to toggle source

Get a mastering by id.

@param id Mastering id @param [Hash] opts the optional parameters @return [Array<(Mastering, Fixnum, Hash)>] Mastering data, response status code and response headers

# 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 = {}) click to toggle source

Get all accessable masterings.

@param [Hash] opts the optional parameters @return [Array<Mastering>]

# 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 = {}) click to toggle source

Get all accessable masterings.

@param [Hash] opts the optional parameters @return [Array<(Array<Mastering>, Fixnum, Hash)>] Array<Mastering> data, response status code and response headers

# 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 = {}) click to toggle source

Publish a mastering by id.

@param id Mastering id @param access_token This parameter represents if the access token of the publishment service API. @param message This parameter represents the publishment message. @param [Hash] opts the optional parameters @option opts [String] :service This parameter represents the publishment service. @option opts [String] :access_token_secret This parameter represents the access token secret of the publishment service API. This parameter is effective only when the service is "twitter&quot;. @return [Mastering]

# 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 = {}) click to toggle source

Publish a mastering by id.

@param id Mastering id @param access_token This parameter represents if the access token of the publishment service API. @param message This parameter represents the publishment message. @param [Hash] opts the optional parameters @option opts [String] :service This parameter represents the publishment service. @option opts [String] :access_token_secret This parameter represents the access token secret of the publishment service API. This parameter is effective only when the service is "twitter&quot;. @return [Array<(Mastering, Fixnum, Hash)>] Mastering data, response status code and response headers

# 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 = {}) click to toggle source

Review a mastering by id.

@param id Mastering id @param [Hash] opts the optional parameters @option opts [String] :review_comment This parameter represents the review comment. @option opts [Float] :review_score This parameter represents the review score. @return [Mastering]

# 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 = {}) click to toggle source

Review a mastering by id.

@param id Mastering id @param [Hash] opts the optional parameters @option opts [String] :review_comment This parameter represents the review comment. @option opts [Float] :review_score This parameter represents the review score. @return [Array<(Mastering, Fixnum, Hash)>] Mastering data, response status code and response headers

# 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 = {}) click to toggle source

Update a mastering.

@param id Mastering id @param [Hash] opts the optional parameters @option opts [BOOLEAN] :preserved Disable auto delete. @return [Mastering]

# 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 = {}) click to toggle source

Update a mastering.

@param id Mastering id @param [Hash] opts the optional parameters @option opts [BOOLEAN] :preserved Disable auto delete. @return [Array<(Mastering, Fixnum, Hash)>] Mastering data, response status code and response headers

# 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