Class: Aimastering::AudioApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ AudioApi

Returns a new instance of AudioApi.



19
20
21
# File 'lib/aimastering/api/audio_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/audio_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#create_audio(opts = {}) ⇒ Audio

Create a new audio.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :file (File)

    The file to upload.

Returns:



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

def create_audio(opts = {})
  data, _status_code, _headers = create_audio_with_http_info(opts)
  return data
end

#create_audio_with_http_info(opts = {}) ⇒ Array<(Audio, Fixnum, Hash)>

Create a new audio.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :file (File)

    The file to upload.

Returns:

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

    Audio 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
# File 'lib/aimastering/api/audio_api.rb', line 38

def create_audio_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AudioApi.create_audio ..."
  end
  # resource path
  local_var_path = "/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 => 'Audio')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AudioApi#create_audio\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#download_audio(id, opts = {}) ⇒ String

Download an audio data by id.

Parameters:

  • id

    Audio id

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

    the optional parameters

Returns:

  • (String)


80
81
82
83
# File 'lib/aimastering/api/audio_api.rb', line 80

def download_audio(id, opts = {})
  data, _status_code, _headers = download_audio_with_http_info(id, opts)
  return data
end

#download_audio_by_token(download_token, opts = {}) ⇒ String

Download an audio data by audio_download_token.

Parameters:

  • download_token

    Audio download token

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

    the optional parameters

Returns:

  • (String)


137
138
139
140
# File 'lib/aimastering/api/audio_api.rb', line 137

def download_audio_by_token(download_token, opts = {})
  data, _status_code, _headers = download_audio_by_token_with_http_info(download_token, opts)
  return data
end

#download_audio_by_token_with_http_info(download_token, opts = {}) ⇒ Array<(String, Fixnum, Hash)>

Download an audio data by audio_download_token.

Parameters:

  • download_token

    Audio download token

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

    the optional parameters

Returns:

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

    String data, response status code and response headers



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
# File 'lib/aimastering/api/audio_api.rb', line 147

def download_audio_by_token_with_http_info(download_token, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AudioApi.download_audio_by_token ..."
  end
  # verify the required parameter 'download_token' is set
  if @api_client.config.client_side_validation && download_token.nil?
    fail ArgumentError, "Missing the required parameter 'download_token' when calling AudioApi.download_audio_by_token"
  end
  # resource path
  local_var_path = "/audios/download_by_token"

  # query parameters
  query_params = {}
  query_params[:'download_token'] = download_token

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

  # 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 => 'String')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AudioApi#download_audio_by_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#download_audio_with_http_info(id, opts = {}) ⇒ Array<(String, Fixnum, Hash)>

Download an audio data by id.

Parameters:

  • id

    Audio id

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

    the optional parameters

Returns:

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

    String data, response status code and response headers



90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# File 'lib/aimastering/api/audio_api.rb', line 90

def download_audio_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AudioApi.download_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 AudioApi.download_audio"
  end
  if @api_client.config.client_side_validation && id < 1
    fail ArgumentError, 'invalid value for "id" when calling AudioApi.download_audio, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = "/audios/{id}/download".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/octet-stream'])

  # 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 => 'String')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AudioApi#download_audio\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_audio(id, opts = {}) ⇒ Audio

Get an audio by id.

Parameters:

  • id

    Audio id

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

    the optional parameters

Returns:



191
192
193
194
# File 'lib/aimastering/api/audio_api.rb', line 191

def get_audio(id, opts = {})
  data, _status_code, _headers = get_audio_with_http_info(id, opts)
  return data
end

#get_audio_analysis(id, opts = {}) ⇒ AudioAnalysis

Get an audio analysis by id.

Parameters:

  • id

    Audio id

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

    the optional parameters

Returns:



248
249
250
251
# File 'lib/aimastering/api/audio_api.rb', line 248

def get_audio_analysis(id, opts = {})
  data, _status_code, _headers = get_audio_analysis_with_http_info(id, opts)
  return data
end

#get_audio_analysis_with_http_info(id, opts = {}) ⇒ Array<(AudioAnalysis, Fixnum, Hash)>

Get an audio analysis by id.

Parameters:

  • id

    Audio id

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

    the optional parameters

Returns:

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

    AudioAnalysis data, response status code and response headers



258
259
260
261
262
263
264
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
# File 'lib/aimastering/api/audio_api.rb', line 258

def get_audio_analysis_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AudioApi.get_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 AudioApi.get_audio_analysis"
  end
  if @api_client.config.client_side_validation && id < 1
    fail ArgumentError, 'invalid value for "id" when calling AudioApi.get_audio_analysis, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = "/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 => 'AudioAnalysis')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AudioApi#get_audio_analysis\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_audio_download_token(id, opts = {}) ⇒ AudioDownloadToken

Get an audio download token by id.

Parameters:

  • id

    Audio id

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

    the optional parameters

Returns:



305
306
307
308
# File 'lib/aimastering/api/audio_api.rb', line 305

def get_audio_download_token(id, opts = {})
  data, _status_code, _headers = get_audio_download_token_with_http_info(id, opts)
  return data
end

#get_audio_download_token_with_http_info(id, opts = {}) ⇒ Array<(AudioDownloadToken, Fixnum, Hash)>

Get an audio download token by id.

Parameters:

  • id

    Audio id

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

    the optional parameters

Returns:

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

    AudioDownloadToken data, response status code and response headers



315
316
317
318
319
320
321
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
# File 'lib/aimastering/api/audio_api.rb', line 315

def get_audio_download_token_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AudioApi.get_audio_download_token ..."
  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 AudioApi.get_audio_download_token"
  end
  if @api_client.config.client_side_validation && id < 1
    fail ArgumentError, 'invalid value for "id" when calling AudioApi.get_audio_download_token, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = "/audios/{id}/download_token".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 => 'AudioDownloadToken')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AudioApi#get_audio_download_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_audio_with_http_info(id, opts = {}) ⇒ Array<(Audio, Fixnum, Hash)>

Get an audio by id.

Parameters:

  • id

    Audio id

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

    the optional parameters

Returns:

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

    Audio data, response status code and response headers



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
# File 'lib/aimastering/api/audio_api.rb', line 201

def get_audio_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AudioApi.get_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 AudioApi.get_audio"
  end
  if @api_client.config.client_side_validation && id < 1
    fail ArgumentError, 'invalid value for "id" when calling AudioApi.get_audio, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = "/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 => 'Audio')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AudioApi#get_audio\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_audios(opts = {}) ⇒ Array<Audio>

Get all audios accessable.

Parameters:

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

    the optional parameters

Returns:



361
362
363
364
# File 'lib/aimastering/api/audio_api.rb', line 361

def list_audios(opts = {})
  data, _status_code, _headers = list_audios_with_http_info(opts)
  return data
end

#list_audios_with_http_info(opts = {}) ⇒ Array<(Array<Audio>, Fixnum, Hash)>

Get all audios accessable.

Parameters:

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

    the optional parameters

Returns:

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

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



370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
# File 'lib/aimastering/api/audio_api.rb', line 370

def list_audios_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AudioApi.list_audios ..."
  end
  # resource path
  local_var_path = "/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<Audio>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AudioApi#list_audios\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end