class Aimastering::LibraryAudioApi

Attributes

api_client[RW]

Public Class Methods

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

Public Instance Methods

create_library_audio(opts = {}) click to toggle source

Create a new library audio.

@param [Hash] opts the optional parameters @option opts [File] :file The file to upload. @return [LibraryAudio]

# File lib/aimastering/api/library_audio_api.rb, line 28
def create_library_audio(opts = {})
  data, _status_code, _headers = create_library_audio_with_http_info(opts)
  return data
end
create_library_audio_like(id, opts = {}) click to toggle source

Create a new library audio like.

@param id Library audio id @param [Hash] opts the optional parameters @return [LibraryAudioLike]

# File lib/aimastering/api/library_audio_api.rb, line 80
def create_library_audio_like(id, opts = {})
  data, _status_code, _headers = create_library_audio_like_with_http_info(id, opts)
  return data
end
create_library_audio_like_with_http_info(id, opts = {}) click to toggle source

Create a new library audio like.

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

# File lib/aimastering/api/library_audio_api.rb, line 90
def create_library_audio_like_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: LibraryAudioApi.create_library_audio_like ..."
  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 LibraryAudioApi.create_library_audio_like"
  end
  if @api_client.config.client_side_validation && id < 1
    fail ArgumentError, 'invalid value for "id" when calling LibraryAudioApi.create_library_audio_like, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = "/library_audios/{id}/like".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 = {}

  # 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 => 'LibraryAudioLike')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LibraryAudioApi#create_library_audio_like\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
create_library_audio_with_http_info(opts = {}) click to toggle source

Create a new library audio.

@param [Hash] opts the optional parameters @option opts [File] :file The file to upload. @return [Array<(LibraryAudio, Fixnum, Hash)>] LibraryAudio data, response status code and response headers

# File lib/aimastering/api/library_audio_api.rb, line 38
def create_library_audio_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: LibraryAudioApi.create_library_audio ..."
  end
  # resource path
  local_var_path = "/library_audios"

  # 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["file"] = opts[:'file'] if !opts[:'file'].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 => 'LibraryAudio')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LibraryAudioApi#create_library_audio\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
delete_library_audio(id, opts = {}) click to toggle source

Delete library audio.

@param id Library audio id @param [Hash] opts the optional parameters @return [LibraryAudio]

# File lib/aimastering/api/library_audio_api.rb, line 139
def delete_library_audio(id, opts = {})
  data, _status_code, _headers = delete_library_audio_with_http_info(id, opts)
  return data
end
delete_library_audio_with_http_info(id, opts = {}) click to toggle source

Delete library audio.

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

# File lib/aimastering/api/library_audio_api.rb, line 149
def delete_library_audio_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: LibraryAudioApi.delete_library_audio ..."
  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 LibraryAudioApi.delete_library_audio"
  end
  if @api_client.config.client_side_validation && id < 1
    fail ArgumentError, 'invalid value for "id" when calling LibraryAudioApi.delete_library_audio, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = "/library_audios/{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 = {}

  # 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 => 'LibraryAudio')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LibraryAudioApi#delete_library_audio\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_library_audio(id, opts = {}) click to toggle source

Get a library audio by id.

@param id Library audio id @param [Hash] opts the optional parameters @return [LibraryAudio]

# File lib/aimastering/api/library_audio_api.rb, line 198
def get_library_audio(id, opts = {})
  data, _status_code, _headers = get_library_audio_with_http_info(id, opts)
  return data
end
get_library_audio_analysis(id, opts = {}) click to toggle source

Get a library audio analysis by id.

@param id Library audio id @param [Hash] opts the optional parameters @return [LibraryAudioAnalysis]

# File lib/aimastering/api/library_audio_api.rb, line 255
def get_library_audio_analysis(id, opts = {})
  data, _status_code, _headers = get_library_audio_analysis_with_http_info(id, opts)
  return data
end
get_library_audio_analysis_with_http_info(id, opts = {}) click to toggle source

Get a library audio analysis by id.

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

# File lib/aimastering/api/library_audio_api.rb, line 265
def get_library_audio_analysis_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: LibraryAudioApi.get_library_audio_analysis ..."
  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 LibraryAudioApi.get_library_audio_analysis"
  end
  if @api_client.config.client_side_validation && id < 1
    fail ArgumentError, 'invalid value for "id" when calling LibraryAudioApi.get_library_audio_analysis, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = "/library_audios/{id}/analysis".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 => 'LibraryAudioAnalysis')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LibraryAudioApi#get_library_audio_analysis\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_library_audio_with_http_info(id, opts = {}) click to toggle source

Get a library audio by id.

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

# File lib/aimastering/api/library_audio_api.rb, line 208
def get_library_audio_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: LibraryAudioApi.get_library_audio ..."
  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 LibraryAudioApi.get_library_audio"
  end
  if @api_client.config.client_side_validation && id < 1
    fail ArgumentError, 'invalid value for "id" when calling LibraryAudioApi.get_library_audio, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = "/library_audios/{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 => 'LibraryAudio')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LibraryAudioApi#get_library_audio\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
list_library_audios(opts = {}) click to toggle source

Get all library audios accessable.

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

# File lib/aimastering/api/library_audio_api.rb, line 311
def list_library_audios(opts = {})
  data, _status_code, _headers = list_library_audios_with_http_info(opts)
  return data
end
list_library_audios_with_http_info(opts = {}) click to toggle source

Get all library audios accessable.

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

# File lib/aimastering/api/library_audio_api.rb, line 320
def list_library_audios_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: LibraryAudioApi.list_library_audios ..."
  end
  # resource path
  local_var_path = "/library_audios"

  # 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<LibraryAudio>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LibraryAudioApi#list_library_audios\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
update_library_audio(id, opts = {}) click to toggle source

Update library audio.

@param id Library audio id @param [Hash] opts the optional parameters @option opts [BOOLEAN] :is_public Whether the library audio is public. @return [LibraryAudio]

# File lib/aimastering/api/library_audio_api.rb, line 360
def update_library_audio(id, opts = {})
  data, _status_code, _headers = update_library_audio_with_http_info(id, opts)
  return data
end
update_library_audio_with_http_info(id, opts = {}) click to toggle source

Update library audio.

@param id Library audio id @param [Hash] opts the optional parameters @option opts [BOOLEAN] :is_public Whether the library audio is public. @return [Array<(LibraryAudio, Fixnum, Hash)>] LibraryAudio data, response status code and response headers

# File lib/aimastering/api/library_audio_api.rb, line 371
def update_library_audio_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: LibraryAudioApi.update_library_audio ..."
  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 LibraryAudioApi.update_library_audio"
  end
  if @api_client.config.client_side_validation && id < 1
    fail ArgumentError, 'invalid value for "id" when calling LibraryAudioApi.update_library_audio, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = "/library_audios/{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["is_public"] = opts[:'is_public'] if !opts[:'is_public'].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 => 'LibraryAudio')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LibraryAudioApi#update_library_audio\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end