aimastering 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/Gemfile +7 -0
- data/README.md +167 -0
- data/Rakefile +8 -0
- data/aimastering.gemspec +45 -0
- data/docs/AccessToken.md +8 -0
- data/docs/AccessTokenApi.md +55 -0
- data/docs/AnonymizedMastering.md +29 -0
- data/docs/Audio.md +29 -0
- data/docs/AudioAnalysis.md +10 -0
- data/docs/AudioApi.md +374 -0
- data/docs/AudioDownloadToken.md +9 -0
- data/docs/Config.md +10 -0
- data/docs/ConfigApi.md +55 -0
- data/docs/ConfigAuth0.md +10 -0
- data/docs/ConfigPaypal.md +9 -0
- data/docs/ConfigStripe.md +8 -0
- data/docs/DateTime.md +7 -0
- data/docs/ExternalSearchApi.md +64 -0
- data/docs/ExternalSearchResult.md +9 -0
- data/docs/ExternalSearchResultItunes.md +18 -0
- data/docs/ExternalSearchResultYoutube.md +15 -0
- data/docs/JWT.md +7 -0
- data/docs/Kpi.md +7 -0
- data/docs/LibraryAudio.md +38 -0
- data/docs/LibraryAudioAnalysis.md +10 -0
- data/docs/LibraryAudioApi.md +378 -0
- data/docs/LibraryAudioLike.md +10 -0
- data/docs/Mastering.md +35 -0
- data/docs/MasteringApi.md +482 -0
- data/docs/Payment.md +14 -0
- data/docs/PaymentApi.md +224 -0
- data/docs/PaymentCustomer.md +11 -0
- data/docs/PaymentCustomerApi.md +55 -0
- data/docs/Plan.md +12 -0
- data/docs/PlanApi.md +55 -0
- data/docs/StatisticsApi.md +102 -0
- data/docs/Subscription.md +17 -0
- data/docs/SubscriptionApi.md +273 -0
- data/docs/User.md +14 -0
- data/docs/UserApi.md +111 -0
- data/docs/Video.md +13 -0
- data/docs/VideoApi.md +267 -0
- data/docs/VideoDownloadToken.md +9 -0
- data/git_push.sh +55 -0
- data/lib/aimastering.rb +77 -0
- data/lib/aimastering/api/access_token_api.rb +70 -0
- data/lib/aimastering/api/audio_api.rb +404 -0
- data/lib/aimastering/api/config_api.rb +70 -0
- data/lib/aimastering/api/external_search_api.rb +84 -0
- data/lib/aimastering/api/library_audio_api.rb +416 -0
- data/lib/aimastering/api/mastering_api.rb +596 -0
- data/lib/aimastering/api/payment_api.rb +263 -0
- data/lib/aimastering/api/payment_customer_api.rb +70 -0
- data/lib/aimastering/api/plan_api.rb +70 -0
- data/lib/aimastering/api/statistics_api.rb +117 -0
- data/lib/aimastering/api/subscription_api.rb +311 -0
- data/lib/aimastering/api/user_api.rb +125 -0
- data/lib/aimastering/api/video_api.rb +295 -0
- data/lib/aimastering/api_client.rb +389 -0
- data/lib/aimastering/api_error.rb +38 -0
- data/lib/aimastering/configuration.rb +209 -0
- data/lib/aimastering/models/access_token.rb +188 -0
- data/lib/aimastering/models/anonymized_mastering.rb +520 -0
- data/lib/aimastering/models/audio.rb +377 -0
- data/lib/aimastering/models/audio_analysis.rb +209 -0
- data/lib/aimastering/models/audio_download_token.rb +197 -0
- data/lib/aimastering/models/config.rb +206 -0
- data/lib/aimastering/models/config_auth0.rb +206 -0
- data/lib/aimastering/models/config_paypal.rb +197 -0
- data/lib/aimastering/models/config_stripe.rb +188 -0
- data/lib/aimastering/models/date_time.rb +179 -0
- data/lib/aimastering/models/external_search_result.rb +201 -0
- data/lib/aimastering/models/external_search_result_itunes.rb +278 -0
- data/lib/aimastering/models/external_search_result_youtube.rb +251 -0
- data/lib/aimastering/models/jwt.rb +179 -0
- data/lib/aimastering/models/kpi.rb +179 -0
- data/lib/aimastering/models/library_audio.rb +458 -0
- data/lib/aimastering/models/library_audio_analysis.rb +209 -0
- data/lib/aimastering/models/library_audio_like.rb +209 -0
- data/lib/aimastering/models/mastering.rb +587 -0
- data/lib/aimastering/models/payment.rb +275 -0
- data/lib/aimastering/models/payment_customer.rb +215 -0
- data/lib/aimastering/models/plan.rb +269 -0
- data/lib/aimastering/models/subscription.rb +302 -0
- data/lib/aimastering/models/user.rb +275 -0
- data/lib/aimastering/models/video.rb +233 -0
- data/lib/aimastering/models/video_download_token.rb +197 -0
- data/lib/aimastering/version.rb +15 -0
- data/spec/api/access_token_api_spec.rb +46 -0
- data/spec/api/audio_api_spec.rb +118 -0
- data/spec/api/config_api_spec.rb +46 -0
- data/spec/api/external_search_api_spec.rb +48 -0
- data/spec/api/library_audio_api_spec.rb +119 -0
- data/spec/api/mastering_api_spec.rb +154 -0
- data/spec/api/payment_api_spec.rb +85 -0
- data/spec/api/payment_customer_api_spec.rb +46 -0
- data/spec/api/plan_api_spec.rb +46 -0
- data/spec/api/statistics_api_spec.rb +57 -0
- data/spec/api/subscription_api_spec.rb +96 -0
- data/spec/api/user_api_spec.rb +59 -0
- data/spec/api/video_api_spec.rb +94 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/access_token_spec.rb +42 -0
- data/spec/models/anonymized_mastering_spec.rb +192 -0
- data/spec/models/audio_analysis_spec.rb +54 -0
- data/spec/models/audio_download_token_spec.rb +48 -0
- data/spec/models/audio_spec.rb +168 -0
- data/spec/models/config_auth0_spec.rb +54 -0
- data/spec/models/config_paypal_spec.rb +48 -0
- data/spec/models/config_spec.rb +54 -0
- data/spec/models/config_stripe_spec.rb +42 -0
- data/spec/models/date_time_spec.rb +36 -0
- data/spec/models/external_search_result_itunes_spec.rb +102 -0
- data/spec/models/external_search_result_spec.rb +48 -0
- data/spec/models/external_search_result_youtube_spec.rb +84 -0
- data/spec/models/jwt_spec.rb +36 -0
- data/spec/models/kpi_spec.rb +36 -0
- data/spec/models/library_audio_analysis_spec.rb +54 -0
- data/spec/models/library_audio_like_spec.rb +54 -0
- data/spec/models/library_audio_spec.rb +222 -0
- data/spec/models/mastering_spec.rb +224 -0
- data/spec/models/payment_customer_spec.rb +60 -0
- data/spec/models/payment_spec.rb +82 -0
- data/spec/models/plan_spec.rb +74 -0
- data/spec/models/subscription_spec.rb +100 -0
- data/spec/models/user_spec.rb +82 -0
- data/spec/models/video_download_token_spec.rb +48 -0
- data/spec/models/video_spec.rb +72 -0
- data/spec/spec_helper.rb +111 -0
- metadata +397 -0
data/git_push.sh
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
#
|
|
3
|
+
# Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
4
|
+
#
|
|
5
|
+
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
|
|
6
|
+
#
|
|
7
|
+
# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update"
|
|
8
|
+
|
|
9
|
+
git_user_id=$1
|
|
10
|
+
git_repo_id=$2
|
|
11
|
+
release_note=$3
|
|
12
|
+
|
|
13
|
+
if [ "$git_user_id" = "" ]; then
|
|
14
|
+
git_user_id="GIT_USER_ID"
|
|
15
|
+
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
|
|
16
|
+
fi
|
|
17
|
+
|
|
18
|
+
if [ "$git_repo_id" = "" ]; then
|
|
19
|
+
git_repo_id="GIT_REPO_ID"
|
|
20
|
+
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
|
|
21
|
+
fi
|
|
22
|
+
|
|
23
|
+
if [ "$release_note" = "" ]; then
|
|
24
|
+
release_note="Minor update"
|
|
25
|
+
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
|
|
26
|
+
fi
|
|
27
|
+
|
|
28
|
+
# Initialize the local directory as a Git repository
|
|
29
|
+
git init
|
|
30
|
+
|
|
31
|
+
# Adds the files in the local repository and stages them for commit.
|
|
32
|
+
git add .
|
|
33
|
+
|
|
34
|
+
# Commits the tracked changes and prepares them to be pushed to a remote repository.
|
|
35
|
+
git commit -m "$release_note"
|
|
36
|
+
|
|
37
|
+
# Sets the new remote
|
|
38
|
+
git_remote=`git remote`
|
|
39
|
+
if [ "$git_remote" = "" ]; then # git remote not defined
|
|
40
|
+
|
|
41
|
+
if [ "$GIT_TOKEN" = "" ]; then
|
|
42
|
+
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
|
|
43
|
+
git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
|
|
44
|
+
else
|
|
45
|
+
git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
|
|
46
|
+
fi
|
|
47
|
+
|
|
48
|
+
fi
|
|
49
|
+
|
|
50
|
+
git pull origin master
|
|
51
|
+
|
|
52
|
+
# Pushes (Forces) the changes in the local repository up to the remote repository
|
|
53
|
+
echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git"
|
|
54
|
+
git push origin master 2>&1 | grep -v 'To https'
|
|
55
|
+
|
data/lib/aimastering.rb
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#AI Mastering API
|
|
3
|
+
|
|
4
|
+
#This is a AI Mastering API document. You can use the mastering feature of [AI Mastering](https://aimastering.com) through this API.
|
|
5
|
+
|
|
6
|
+
OpenAPI spec version: 1.0.0
|
|
7
|
+
Contact: aimasteringcom@gmail.com
|
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
9
|
+
Swagger Codegen version: 2.3.1
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
# Common files
|
|
14
|
+
require 'aimastering/api_client'
|
|
15
|
+
require 'aimastering/api_error'
|
|
16
|
+
require 'aimastering/version'
|
|
17
|
+
require 'aimastering/configuration'
|
|
18
|
+
|
|
19
|
+
# Models
|
|
20
|
+
require 'aimastering/models/access_token'
|
|
21
|
+
require 'aimastering/models/anonymized_mastering'
|
|
22
|
+
require 'aimastering/models/audio'
|
|
23
|
+
require 'aimastering/models/audio_analysis'
|
|
24
|
+
require 'aimastering/models/audio_download_token'
|
|
25
|
+
require 'aimastering/models/config'
|
|
26
|
+
require 'aimastering/models/config_auth0'
|
|
27
|
+
require 'aimastering/models/config_paypal'
|
|
28
|
+
require 'aimastering/models/config_stripe'
|
|
29
|
+
require 'aimastering/models/external_search_result'
|
|
30
|
+
require 'aimastering/models/external_search_result_itunes'
|
|
31
|
+
require 'aimastering/models/external_search_result_youtube'
|
|
32
|
+
require 'aimastering/models/jwt'
|
|
33
|
+
require 'aimastering/models/kpi'
|
|
34
|
+
require 'aimastering/models/library_audio'
|
|
35
|
+
require 'aimastering/models/library_audio_analysis'
|
|
36
|
+
require 'aimastering/models/library_audio_like'
|
|
37
|
+
require 'aimastering/models/mastering'
|
|
38
|
+
require 'aimastering/models/payment'
|
|
39
|
+
require 'aimastering/models/payment_customer'
|
|
40
|
+
require 'aimastering/models/plan'
|
|
41
|
+
require 'aimastering/models/subscription'
|
|
42
|
+
require 'aimastering/models/user'
|
|
43
|
+
require 'aimastering/models/video'
|
|
44
|
+
require 'aimastering/models/video_download_token'
|
|
45
|
+
|
|
46
|
+
# APIs
|
|
47
|
+
require 'aimastering/api/access_token_api'
|
|
48
|
+
require 'aimastering/api/audio_api'
|
|
49
|
+
require 'aimastering/api/config_api'
|
|
50
|
+
require 'aimastering/api/external_search_api'
|
|
51
|
+
require 'aimastering/api/library_audio_api'
|
|
52
|
+
require 'aimastering/api/mastering_api'
|
|
53
|
+
require 'aimastering/api/payment_api'
|
|
54
|
+
require 'aimastering/api/payment_customer_api'
|
|
55
|
+
require 'aimastering/api/plan_api'
|
|
56
|
+
require 'aimastering/api/statistics_api'
|
|
57
|
+
require 'aimastering/api/subscription_api'
|
|
58
|
+
require 'aimastering/api/user_api'
|
|
59
|
+
require 'aimastering/api/video_api'
|
|
60
|
+
|
|
61
|
+
module Aimastering
|
|
62
|
+
class << self
|
|
63
|
+
# Customize default settings for the SDK using block.
|
|
64
|
+
# Aimastering.configure do |config|
|
|
65
|
+
# config.username = "xxx"
|
|
66
|
+
# config.password = "xxx"
|
|
67
|
+
# end
|
|
68
|
+
# If no block given, return the default Configuration object.
|
|
69
|
+
def configure
|
|
70
|
+
if block_given?
|
|
71
|
+
yield(Configuration.default)
|
|
72
|
+
else
|
|
73
|
+
Configuration.default
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
end
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#AI Mastering API
|
|
3
|
+
|
|
4
|
+
#This is a AI Mastering API document. You can use the mastering feature of [AI Mastering](https://aimastering.com) through this API.
|
|
5
|
+
|
|
6
|
+
OpenAPI spec version: 1.0.0
|
|
7
|
+
Contact: aimasteringcom@gmail.com
|
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
9
|
+
Swagger Codegen version: 2.3.1
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require "uri"
|
|
14
|
+
|
|
15
|
+
module Aimastering
|
|
16
|
+
class AccessTokenApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# Create an API access token.
|
|
24
|
+
#
|
|
25
|
+
# @param [Hash] opts the optional parameters
|
|
26
|
+
# @return [AccessToken]
|
|
27
|
+
def create_access_token(opts = {})
|
|
28
|
+
data, _status_code, _headers = create_access_token_with_http_info(opts)
|
|
29
|
+
return data
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Create an API access token.
|
|
33
|
+
#
|
|
34
|
+
# @param [Hash] opts the optional parameters
|
|
35
|
+
# @return [Array<(AccessToken, Fixnum, Hash)>] AccessToken data, response status code and response headers
|
|
36
|
+
def create_access_token_with_http_info(opts = {})
|
|
37
|
+
if @api_client.config.debugging
|
|
38
|
+
@api_client.config.logger.debug "Calling API: AccessTokenApi.create_access_token ..."
|
|
39
|
+
end
|
|
40
|
+
# resource path
|
|
41
|
+
local_var_path = "/access_tokens"
|
|
42
|
+
|
|
43
|
+
# query parameters
|
|
44
|
+
query_params = {}
|
|
45
|
+
|
|
46
|
+
# header parameters
|
|
47
|
+
header_params = {}
|
|
48
|
+
# HTTP header 'Accept' (if needed)
|
|
49
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
50
|
+
|
|
51
|
+
# form parameters
|
|
52
|
+
form_params = {}
|
|
53
|
+
|
|
54
|
+
# http body (model)
|
|
55
|
+
post_body = nil
|
|
56
|
+
auth_names = ['bearer']
|
|
57
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
|
58
|
+
:header_params => header_params,
|
|
59
|
+
:query_params => query_params,
|
|
60
|
+
:form_params => form_params,
|
|
61
|
+
:body => post_body,
|
|
62
|
+
:auth_names => auth_names,
|
|
63
|
+
:return_type => 'AccessToken')
|
|
64
|
+
if @api_client.config.debugging
|
|
65
|
+
@api_client.config.logger.debug "API called: AccessTokenApi#create_access_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
66
|
+
end
|
|
67
|
+
return data, status_code, headers
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
end
|
|
@@ -0,0 +1,404 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#AI Mastering API
|
|
3
|
+
|
|
4
|
+
#This is a AI Mastering API document. You can use the mastering feature of [AI Mastering](https://aimastering.com) through this API.
|
|
5
|
+
|
|
6
|
+
OpenAPI spec version: 1.0.0
|
|
7
|
+
Contact: aimasteringcom@gmail.com
|
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
9
|
+
Swagger Codegen version: 2.3.1
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require "uri"
|
|
14
|
+
|
|
15
|
+
module Aimastering
|
|
16
|
+
class AudioApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# Create a new audio.
|
|
24
|
+
#
|
|
25
|
+
# @param [Hash] opts the optional parameters
|
|
26
|
+
# @option opts [File] :file The file to upload.
|
|
27
|
+
# @return [Audio]
|
|
28
|
+
def create_audio(opts = {})
|
|
29
|
+
data, _status_code, _headers = create_audio_with_http_info(opts)
|
|
30
|
+
return data
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Create a new audio.
|
|
34
|
+
#
|
|
35
|
+
# @param [Hash] opts the optional parameters
|
|
36
|
+
# @option opts [File] :file The file to upload.
|
|
37
|
+
# @return [Array<(Audio, Fixnum, Hash)>] Audio data, response status code and response headers
|
|
38
|
+
def create_audio_with_http_info(opts = {})
|
|
39
|
+
if @api_client.config.debugging
|
|
40
|
+
@api_client.config.logger.debug "Calling API: AudioApi.create_audio ..."
|
|
41
|
+
end
|
|
42
|
+
# resource path
|
|
43
|
+
local_var_path = "/audios"
|
|
44
|
+
|
|
45
|
+
# query parameters
|
|
46
|
+
query_params = {}
|
|
47
|
+
|
|
48
|
+
# header parameters
|
|
49
|
+
header_params = {}
|
|
50
|
+
# HTTP header 'Accept' (if needed)
|
|
51
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
52
|
+
# HTTP header 'Content-Type'
|
|
53
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
|
|
54
|
+
|
|
55
|
+
# form parameters
|
|
56
|
+
form_params = {}
|
|
57
|
+
form_params["file"] = opts[:'file'] if !opts[:'file'].nil?
|
|
58
|
+
|
|
59
|
+
# http body (model)
|
|
60
|
+
post_body = nil
|
|
61
|
+
auth_names = ['bearer']
|
|
62
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
|
63
|
+
:header_params => header_params,
|
|
64
|
+
:query_params => query_params,
|
|
65
|
+
:form_params => form_params,
|
|
66
|
+
:body => post_body,
|
|
67
|
+
:auth_names => auth_names,
|
|
68
|
+
:return_type => 'Audio')
|
|
69
|
+
if @api_client.config.debugging
|
|
70
|
+
@api_client.config.logger.debug "API called: AudioApi#create_audio\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
71
|
+
end
|
|
72
|
+
return data, status_code, headers
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# Download an audio data by id.
|
|
76
|
+
#
|
|
77
|
+
# @param id Audio id
|
|
78
|
+
# @param [Hash] opts the optional parameters
|
|
79
|
+
# @return [String]
|
|
80
|
+
def download_audio(id, opts = {})
|
|
81
|
+
data, _status_code, _headers = download_audio_with_http_info(id, opts)
|
|
82
|
+
return data
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# Download an audio data by id.
|
|
86
|
+
#
|
|
87
|
+
# @param id Audio id
|
|
88
|
+
# @param [Hash] opts the optional parameters
|
|
89
|
+
# @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
|
|
90
|
+
def download_audio_with_http_info(id, opts = {})
|
|
91
|
+
if @api_client.config.debugging
|
|
92
|
+
@api_client.config.logger.debug "Calling API: AudioApi.download_audio ..."
|
|
93
|
+
end
|
|
94
|
+
# verify the required parameter 'id' is set
|
|
95
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
96
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling AudioApi.download_audio"
|
|
97
|
+
end
|
|
98
|
+
if @api_client.config.client_side_validation && id < 1
|
|
99
|
+
fail ArgumentError, 'invalid value for "id" when calling AudioApi.download_audio, must be greater than or equal to 1.'
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
# resource path
|
|
103
|
+
local_var_path = "/audios/{id}/download".sub('{' + 'id' + '}', id.to_s)
|
|
104
|
+
|
|
105
|
+
# query parameters
|
|
106
|
+
query_params = {}
|
|
107
|
+
|
|
108
|
+
# header parameters
|
|
109
|
+
header_params = {}
|
|
110
|
+
# HTTP header 'Accept' (if needed)
|
|
111
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
|
|
112
|
+
|
|
113
|
+
# form parameters
|
|
114
|
+
form_params = {}
|
|
115
|
+
|
|
116
|
+
# http body (model)
|
|
117
|
+
post_body = nil
|
|
118
|
+
auth_names = ['bearer']
|
|
119
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
|
120
|
+
:header_params => header_params,
|
|
121
|
+
:query_params => query_params,
|
|
122
|
+
:form_params => form_params,
|
|
123
|
+
:body => post_body,
|
|
124
|
+
:auth_names => auth_names,
|
|
125
|
+
:return_type => 'String')
|
|
126
|
+
if @api_client.config.debugging
|
|
127
|
+
@api_client.config.logger.debug "API called: AudioApi#download_audio\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
128
|
+
end
|
|
129
|
+
return data, status_code, headers
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
# Download an audio data by audio_download_token.
|
|
133
|
+
#
|
|
134
|
+
# @param download_token Audio download token
|
|
135
|
+
# @param [Hash] opts the optional parameters
|
|
136
|
+
# @return [String]
|
|
137
|
+
def download_audio_by_token(download_token, opts = {})
|
|
138
|
+
data, _status_code, _headers = download_audio_by_token_with_http_info(download_token, opts)
|
|
139
|
+
return data
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
# Download an audio data by audio_download_token.
|
|
143
|
+
#
|
|
144
|
+
# @param download_token Audio download token
|
|
145
|
+
# @param [Hash] opts the optional parameters
|
|
146
|
+
# @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
|
|
147
|
+
def download_audio_by_token_with_http_info(download_token, opts = {})
|
|
148
|
+
if @api_client.config.debugging
|
|
149
|
+
@api_client.config.logger.debug "Calling API: AudioApi.download_audio_by_token ..."
|
|
150
|
+
end
|
|
151
|
+
# verify the required parameter 'download_token' is set
|
|
152
|
+
if @api_client.config.client_side_validation && download_token.nil?
|
|
153
|
+
fail ArgumentError, "Missing the required parameter 'download_token' when calling AudioApi.download_audio_by_token"
|
|
154
|
+
end
|
|
155
|
+
# resource path
|
|
156
|
+
local_var_path = "/audios/download_by_token"
|
|
157
|
+
|
|
158
|
+
# query parameters
|
|
159
|
+
query_params = {}
|
|
160
|
+
query_params[:'download_token'] = download_token
|
|
161
|
+
|
|
162
|
+
# header parameters
|
|
163
|
+
header_params = {}
|
|
164
|
+
# HTTP header 'Accept' (if needed)
|
|
165
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
|
|
166
|
+
|
|
167
|
+
# form parameters
|
|
168
|
+
form_params = {}
|
|
169
|
+
|
|
170
|
+
# http body (model)
|
|
171
|
+
post_body = nil
|
|
172
|
+
auth_names = ['bearer']
|
|
173
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
|
174
|
+
:header_params => header_params,
|
|
175
|
+
:query_params => query_params,
|
|
176
|
+
:form_params => form_params,
|
|
177
|
+
:body => post_body,
|
|
178
|
+
:auth_names => auth_names,
|
|
179
|
+
:return_type => 'String')
|
|
180
|
+
if @api_client.config.debugging
|
|
181
|
+
@api_client.config.logger.debug "API called: AudioApi#download_audio_by_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
182
|
+
end
|
|
183
|
+
return data, status_code, headers
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
# Get an audio by id.
|
|
187
|
+
#
|
|
188
|
+
# @param id Audio id
|
|
189
|
+
# @param [Hash] opts the optional parameters
|
|
190
|
+
# @return [Audio]
|
|
191
|
+
def get_audio(id, opts = {})
|
|
192
|
+
data, _status_code, _headers = get_audio_with_http_info(id, opts)
|
|
193
|
+
return data
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
# Get an audio by id.
|
|
197
|
+
#
|
|
198
|
+
# @param id Audio id
|
|
199
|
+
# @param [Hash] opts the optional parameters
|
|
200
|
+
# @return [Array<(Audio, Fixnum, Hash)>] Audio data, response status code and response headers
|
|
201
|
+
def get_audio_with_http_info(id, opts = {})
|
|
202
|
+
if @api_client.config.debugging
|
|
203
|
+
@api_client.config.logger.debug "Calling API: AudioApi.get_audio ..."
|
|
204
|
+
end
|
|
205
|
+
# verify the required parameter 'id' is set
|
|
206
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
207
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling AudioApi.get_audio"
|
|
208
|
+
end
|
|
209
|
+
if @api_client.config.client_side_validation && id < 1
|
|
210
|
+
fail ArgumentError, 'invalid value for "id" when calling AudioApi.get_audio, must be greater than or equal to 1.'
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
# resource path
|
|
214
|
+
local_var_path = "/audios/{id}".sub('{' + 'id' + '}', id.to_s)
|
|
215
|
+
|
|
216
|
+
# query parameters
|
|
217
|
+
query_params = {}
|
|
218
|
+
|
|
219
|
+
# header parameters
|
|
220
|
+
header_params = {}
|
|
221
|
+
# HTTP header 'Accept' (if needed)
|
|
222
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
223
|
+
|
|
224
|
+
# form parameters
|
|
225
|
+
form_params = {}
|
|
226
|
+
|
|
227
|
+
# http body (model)
|
|
228
|
+
post_body = nil
|
|
229
|
+
auth_names = ['bearer']
|
|
230
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
|
231
|
+
:header_params => header_params,
|
|
232
|
+
:query_params => query_params,
|
|
233
|
+
:form_params => form_params,
|
|
234
|
+
:body => post_body,
|
|
235
|
+
:auth_names => auth_names,
|
|
236
|
+
:return_type => 'Audio')
|
|
237
|
+
if @api_client.config.debugging
|
|
238
|
+
@api_client.config.logger.debug "API called: AudioApi#get_audio\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
239
|
+
end
|
|
240
|
+
return data, status_code, headers
|
|
241
|
+
end
|
|
242
|
+
|
|
243
|
+
# Get an audio analysis by id.
|
|
244
|
+
#
|
|
245
|
+
# @param id Audio id
|
|
246
|
+
# @param [Hash] opts the optional parameters
|
|
247
|
+
# @return [AudioAnalysis]
|
|
248
|
+
def get_audio_analysis(id, opts = {})
|
|
249
|
+
data, _status_code, _headers = get_audio_analysis_with_http_info(id, opts)
|
|
250
|
+
return data
|
|
251
|
+
end
|
|
252
|
+
|
|
253
|
+
# Get an audio analysis by id.
|
|
254
|
+
#
|
|
255
|
+
# @param id Audio id
|
|
256
|
+
# @param [Hash] opts the optional parameters
|
|
257
|
+
# @return [Array<(AudioAnalysis, Fixnum, Hash)>] AudioAnalysis data, response status code and response headers
|
|
258
|
+
def get_audio_analysis_with_http_info(id, opts = {})
|
|
259
|
+
if @api_client.config.debugging
|
|
260
|
+
@api_client.config.logger.debug "Calling API: AudioApi.get_audio_analysis ..."
|
|
261
|
+
end
|
|
262
|
+
# verify the required parameter 'id' is set
|
|
263
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
264
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling AudioApi.get_audio_analysis"
|
|
265
|
+
end
|
|
266
|
+
if @api_client.config.client_side_validation && id < 1
|
|
267
|
+
fail ArgumentError, 'invalid value for "id" when calling AudioApi.get_audio_analysis, must be greater than or equal to 1.'
|
|
268
|
+
end
|
|
269
|
+
|
|
270
|
+
# resource path
|
|
271
|
+
local_var_path = "/audios/{id}/analysis".sub('{' + 'id' + '}', id.to_s)
|
|
272
|
+
|
|
273
|
+
# query parameters
|
|
274
|
+
query_params = {}
|
|
275
|
+
|
|
276
|
+
# header parameters
|
|
277
|
+
header_params = {}
|
|
278
|
+
# HTTP header 'Accept' (if needed)
|
|
279
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
280
|
+
|
|
281
|
+
# form parameters
|
|
282
|
+
form_params = {}
|
|
283
|
+
|
|
284
|
+
# http body (model)
|
|
285
|
+
post_body = nil
|
|
286
|
+
auth_names = ['bearer']
|
|
287
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
|
288
|
+
:header_params => header_params,
|
|
289
|
+
:query_params => query_params,
|
|
290
|
+
:form_params => form_params,
|
|
291
|
+
:body => post_body,
|
|
292
|
+
:auth_names => auth_names,
|
|
293
|
+
:return_type => 'AudioAnalysis')
|
|
294
|
+
if @api_client.config.debugging
|
|
295
|
+
@api_client.config.logger.debug "API called: AudioApi#get_audio_analysis\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
296
|
+
end
|
|
297
|
+
return data, status_code, headers
|
|
298
|
+
end
|
|
299
|
+
|
|
300
|
+
# Get an audio download token by id.
|
|
301
|
+
#
|
|
302
|
+
# @param id Audio id
|
|
303
|
+
# @param [Hash] opts the optional parameters
|
|
304
|
+
# @return [AudioDownloadToken]
|
|
305
|
+
def get_audio_download_token(id, opts = {})
|
|
306
|
+
data, _status_code, _headers = get_audio_download_token_with_http_info(id, opts)
|
|
307
|
+
return data
|
|
308
|
+
end
|
|
309
|
+
|
|
310
|
+
# Get an audio download token by id.
|
|
311
|
+
#
|
|
312
|
+
# @param id Audio id
|
|
313
|
+
# @param [Hash] opts the optional parameters
|
|
314
|
+
# @return [Array<(AudioDownloadToken, Fixnum, Hash)>] AudioDownloadToken data, response status code and response headers
|
|
315
|
+
def get_audio_download_token_with_http_info(id, opts = {})
|
|
316
|
+
if @api_client.config.debugging
|
|
317
|
+
@api_client.config.logger.debug "Calling API: AudioApi.get_audio_download_token ..."
|
|
318
|
+
end
|
|
319
|
+
# verify the required parameter 'id' is set
|
|
320
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
321
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling AudioApi.get_audio_download_token"
|
|
322
|
+
end
|
|
323
|
+
if @api_client.config.client_side_validation && id < 1
|
|
324
|
+
fail ArgumentError, 'invalid value for "id" when calling AudioApi.get_audio_download_token, must be greater than or equal to 1.'
|
|
325
|
+
end
|
|
326
|
+
|
|
327
|
+
# resource path
|
|
328
|
+
local_var_path = "/audios/{id}/download_token".sub('{' + 'id' + '}', id.to_s)
|
|
329
|
+
|
|
330
|
+
# query parameters
|
|
331
|
+
query_params = {}
|
|
332
|
+
|
|
333
|
+
# header parameters
|
|
334
|
+
header_params = {}
|
|
335
|
+
# HTTP header 'Accept' (if needed)
|
|
336
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
337
|
+
|
|
338
|
+
# form parameters
|
|
339
|
+
form_params = {}
|
|
340
|
+
|
|
341
|
+
# http body (model)
|
|
342
|
+
post_body = nil
|
|
343
|
+
auth_names = ['bearer']
|
|
344
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
|
345
|
+
:header_params => header_params,
|
|
346
|
+
:query_params => query_params,
|
|
347
|
+
:form_params => form_params,
|
|
348
|
+
:body => post_body,
|
|
349
|
+
:auth_names => auth_names,
|
|
350
|
+
:return_type => 'AudioDownloadToken')
|
|
351
|
+
if @api_client.config.debugging
|
|
352
|
+
@api_client.config.logger.debug "API called: AudioApi#get_audio_download_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
353
|
+
end
|
|
354
|
+
return data, status_code, headers
|
|
355
|
+
end
|
|
356
|
+
|
|
357
|
+
# Get all audios accessable.
|
|
358
|
+
#
|
|
359
|
+
# @param [Hash] opts the optional parameters
|
|
360
|
+
# @return [Array<Audio>]
|
|
361
|
+
def list_audios(opts = {})
|
|
362
|
+
data, _status_code, _headers = list_audios_with_http_info(opts)
|
|
363
|
+
return data
|
|
364
|
+
end
|
|
365
|
+
|
|
366
|
+
# Get all audios accessable.
|
|
367
|
+
#
|
|
368
|
+
# @param [Hash] opts the optional parameters
|
|
369
|
+
# @return [Array<(Array<Audio>, Fixnum, Hash)>] Array<Audio> data, response status code and response headers
|
|
370
|
+
def list_audios_with_http_info(opts = {})
|
|
371
|
+
if @api_client.config.debugging
|
|
372
|
+
@api_client.config.logger.debug "Calling API: AudioApi.list_audios ..."
|
|
373
|
+
end
|
|
374
|
+
# resource path
|
|
375
|
+
local_var_path = "/audios"
|
|
376
|
+
|
|
377
|
+
# query parameters
|
|
378
|
+
query_params = {}
|
|
379
|
+
|
|
380
|
+
# header parameters
|
|
381
|
+
header_params = {}
|
|
382
|
+
# HTTP header 'Accept' (if needed)
|
|
383
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
384
|
+
|
|
385
|
+
# form parameters
|
|
386
|
+
form_params = {}
|
|
387
|
+
|
|
388
|
+
# http body (model)
|
|
389
|
+
post_body = nil
|
|
390
|
+
auth_names = ['bearer']
|
|
391
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
|
392
|
+
:header_params => header_params,
|
|
393
|
+
:query_params => query_params,
|
|
394
|
+
:form_params => form_params,
|
|
395
|
+
:body => post_body,
|
|
396
|
+
:auth_names => auth_names,
|
|
397
|
+
:return_type => 'Array<Audio>')
|
|
398
|
+
if @api_client.config.debugging
|
|
399
|
+
@api_client.config.logger.debug "API called: AudioApi#list_audios\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
400
|
+
end
|
|
401
|
+
return data, status_code, headers
|
|
402
|
+
end
|
|
403
|
+
end
|
|
404
|
+
end
|