aimastering 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- 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
@@ -0,0 +1,311 @@
|
|
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 SubscriptionApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
|
23
|
+
# Cancel a subscription by id.
|
24
|
+
#
|
25
|
+
# @param id Subscription id
|
26
|
+
# @param [Hash] opts the optional parameters
|
27
|
+
# @return [Subscription]
|
28
|
+
def cancel_subscription(id, opts = {})
|
29
|
+
data, _status_code, _headers = cancel_subscription_with_http_info(id, opts)
|
30
|
+
return data
|
31
|
+
end
|
32
|
+
|
33
|
+
# Cancel a subscription by id.
|
34
|
+
#
|
35
|
+
# @param id Subscription id
|
36
|
+
# @param [Hash] opts the optional parameters
|
37
|
+
# @return [Array<(Subscription, Fixnum, Hash)>] Subscription data, response status code and response headers
|
38
|
+
def cancel_subscription_with_http_info(id, opts = {})
|
39
|
+
if @api_client.config.debugging
|
40
|
+
@api_client.config.logger.debug "Calling API: SubscriptionApi.cancel_subscription ..."
|
41
|
+
end
|
42
|
+
# verify the required parameter 'id' is set
|
43
|
+
if @api_client.config.client_side_validation && id.nil?
|
44
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling SubscriptionApi.cancel_subscription"
|
45
|
+
end
|
46
|
+
if @api_client.config.client_side_validation && id < 1
|
47
|
+
fail ArgumentError, 'invalid value for "id" when calling SubscriptionApi.cancel_subscription, must be greater than or equal to 1.'
|
48
|
+
end
|
49
|
+
|
50
|
+
# resource path
|
51
|
+
local_var_path = "/subscriptions/{id}/cancel".sub('{' + 'id' + '}', id.to_s)
|
52
|
+
|
53
|
+
# query parameters
|
54
|
+
query_params = {}
|
55
|
+
|
56
|
+
# header parameters
|
57
|
+
header_params = {}
|
58
|
+
# HTTP header 'Accept' (if needed)
|
59
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
60
|
+
# HTTP header 'Content-Type'
|
61
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
|
62
|
+
|
63
|
+
# form parameters
|
64
|
+
form_params = {}
|
65
|
+
|
66
|
+
# http body (model)
|
67
|
+
post_body = nil
|
68
|
+
auth_names = ['bearer']
|
69
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
|
70
|
+
:header_params => header_params,
|
71
|
+
:query_params => query_params,
|
72
|
+
:form_params => form_params,
|
73
|
+
:body => post_body,
|
74
|
+
:auth_names => auth_names,
|
75
|
+
:return_type => 'Subscription')
|
76
|
+
if @api_client.config.debugging
|
77
|
+
@api_client.config.logger.debug "API called: SubscriptionApi#cancel_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
78
|
+
end
|
79
|
+
return data, status_code, headers
|
80
|
+
end
|
81
|
+
|
82
|
+
# Cancel the subscription cancellation by id.
|
83
|
+
#
|
84
|
+
# @param id Subscription id
|
85
|
+
# @param [Hash] opts the optional parameters
|
86
|
+
# @return [Subscription]
|
87
|
+
def cancel_subscription_cancellation(id, opts = {})
|
88
|
+
data, _status_code, _headers = cancel_subscription_cancellation_with_http_info(id, opts)
|
89
|
+
return data
|
90
|
+
end
|
91
|
+
|
92
|
+
# Cancel the subscription cancellation by id.
|
93
|
+
#
|
94
|
+
# @param id Subscription id
|
95
|
+
# @param [Hash] opts the optional parameters
|
96
|
+
# @return [Array<(Subscription, Fixnum, Hash)>] Subscription data, response status code and response headers
|
97
|
+
def cancel_subscription_cancellation_with_http_info(id, opts = {})
|
98
|
+
if @api_client.config.debugging
|
99
|
+
@api_client.config.logger.debug "Calling API: SubscriptionApi.cancel_subscription_cancellation ..."
|
100
|
+
end
|
101
|
+
# verify the required parameter 'id' is set
|
102
|
+
if @api_client.config.client_side_validation && id.nil?
|
103
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling SubscriptionApi.cancel_subscription_cancellation"
|
104
|
+
end
|
105
|
+
if @api_client.config.client_side_validation && id < 1
|
106
|
+
fail ArgumentError, 'invalid value for "id" when calling SubscriptionApi.cancel_subscription_cancellation, must be greater than or equal to 1.'
|
107
|
+
end
|
108
|
+
|
109
|
+
# resource path
|
110
|
+
local_var_path = "/subscriptions/{id}/cancel_cancellation".sub('{' + 'id' + '}', id.to_s)
|
111
|
+
|
112
|
+
# query parameters
|
113
|
+
query_params = {}
|
114
|
+
|
115
|
+
# header parameters
|
116
|
+
header_params = {}
|
117
|
+
# HTTP header 'Accept' (if needed)
|
118
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
119
|
+
# HTTP header 'Content-Type'
|
120
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
|
121
|
+
|
122
|
+
# form parameters
|
123
|
+
form_params = {}
|
124
|
+
|
125
|
+
# http body (model)
|
126
|
+
post_body = nil
|
127
|
+
auth_names = ['bearer']
|
128
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
|
129
|
+
:header_params => header_params,
|
130
|
+
:query_params => query_params,
|
131
|
+
:form_params => form_params,
|
132
|
+
:body => post_body,
|
133
|
+
:auth_names => auth_names,
|
134
|
+
:return_type => 'Subscription')
|
135
|
+
if @api_client.config.debugging
|
136
|
+
@api_client.config.logger.debug "API called: SubscriptionApi#cancel_subscription_cancellation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
137
|
+
end
|
138
|
+
return data, status_code, headers
|
139
|
+
end
|
140
|
+
|
141
|
+
# Create a new subscription.
|
142
|
+
#
|
143
|
+
# @param service This parameter represents the payment message.
|
144
|
+
# @param [Hash] opts the optional parameters
|
145
|
+
# @option opts [String] :stripe_plan_id The Stripe plan id. This parameter is effective only when the service is \"stripe\".
|
146
|
+
# @option opts [String] :token This parameter represents the card token. This parameter is effective only when the service is \"stripe\".
|
147
|
+
# @return [Subscription]
|
148
|
+
def create_subscription(service, opts = {})
|
149
|
+
data, _status_code, _headers = create_subscription_with_http_info(service, opts)
|
150
|
+
return data
|
151
|
+
end
|
152
|
+
|
153
|
+
# Create a new subscription.
|
154
|
+
#
|
155
|
+
# @param service This parameter represents the payment message.
|
156
|
+
# @param [Hash] opts the optional parameters
|
157
|
+
# @option opts [String] :stripe_plan_id The Stripe plan id. This parameter is effective only when the service is \"stripe\".
|
158
|
+
# @option opts [String] :token This parameter represents the card token. This parameter is effective only when the service is \"stripe\".
|
159
|
+
# @return [Array<(Subscription, Fixnum, Hash)>] Subscription data, response status code and response headers
|
160
|
+
def create_subscription_with_http_info(service, opts = {})
|
161
|
+
if @api_client.config.debugging
|
162
|
+
@api_client.config.logger.debug "Calling API: SubscriptionApi.create_subscription ..."
|
163
|
+
end
|
164
|
+
# verify the required parameter 'service' is set
|
165
|
+
if @api_client.config.client_side_validation && service.nil?
|
166
|
+
fail ArgumentError, "Missing the required parameter 'service' when calling SubscriptionApi.create_subscription"
|
167
|
+
end
|
168
|
+
# verify enum value
|
169
|
+
if @api_client.config.client_side_validation && !['stripe'].include?(service)
|
170
|
+
fail ArgumentError, "invalid value for 'service', must be one of stripe"
|
171
|
+
end
|
172
|
+
# resource path
|
173
|
+
local_var_path = "/subscriptions"
|
174
|
+
|
175
|
+
# query parameters
|
176
|
+
query_params = {}
|
177
|
+
|
178
|
+
# header parameters
|
179
|
+
header_params = {}
|
180
|
+
# HTTP header 'Accept' (if needed)
|
181
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
182
|
+
# HTTP header 'Content-Type'
|
183
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
|
184
|
+
|
185
|
+
# form parameters
|
186
|
+
form_params = {}
|
187
|
+
form_params["service"] = service
|
188
|
+
form_params["stripe_plan_id"] = opts[:'stripe_plan_id'] if !opts[:'stripe_plan_id'].nil?
|
189
|
+
form_params["token"] = opts[:'token'] if !opts[:'token'].nil?
|
190
|
+
|
191
|
+
# http body (model)
|
192
|
+
post_body = nil
|
193
|
+
auth_names = ['bearer']
|
194
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
195
|
+
:header_params => header_params,
|
196
|
+
:query_params => query_params,
|
197
|
+
:form_params => form_params,
|
198
|
+
:body => post_body,
|
199
|
+
:auth_names => auth_names,
|
200
|
+
:return_type => 'Subscription')
|
201
|
+
if @api_client.config.debugging
|
202
|
+
@api_client.config.logger.debug "API called: SubscriptionApi#create_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
203
|
+
end
|
204
|
+
return data, status_code, headers
|
205
|
+
end
|
206
|
+
|
207
|
+
# Get a subscription by id.
|
208
|
+
#
|
209
|
+
# @param id Subscription id
|
210
|
+
# @param [Hash] opts the optional parameters
|
211
|
+
# @return [Subscription]
|
212
|
+
def get_subscription(id, opts = {})
|
213
|
+
data, _status_code, _headers = get_subscription_with_http_info(id, opts)
|
214
|
+
return data
|
215
|
+
end
|
216
|
+
|
217
|
+
# Get a subscription by id.
|
218
|
+
#
|
219
|
+
# @param id Subscription id
|
220
|
+
# @param [Hash] opts the optional parameters
|
221
|
+
# @return [Array<(Subscription, Fixnum, Hash)>] Subscription data, response status code and response headers
|
222
|
+
def get_subscription_with_http_info(id, opts = {})
|
223
|
+
if @api_client.config.debugging
|
224
|
+
@api_client.config.logger.debug "Calling API: SubscriptionApi.get_subscription ..."
|
225
|
+
end
|
226
|
+
# verify the required parameter 'id' is set
|
227
|
+
if @api_client.config.client_side_validation && id.nil?
|
228
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling SubscriptionApi.get_subscription"
|
229
|
+
end
|
230
|
+
if @api_client.config.client_side_validation && id < 1
|
231
|
+
fail ArgumentError, 'invalid value for "id" when calling SubscriptionApi.get_subscription, must be greater than or equal to 1.'
|
232
|
+
end
|
233
|
+
|
234
|
+
# resource path
|
235
|
+
local_var_path = "/subscriptions/{id}".sub('{' + 'id' + '}', id.to_s)
|
236
|
+
|
237
|
+
# query parameters
|
238
|
+
query_params = {}
|
239
|
+
|
240
|
+
# header parameters
|
241
|
+
header_params = {}
|
242
|
+
# HTTP header 'Accept' (if needed)
|
243
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
244
|
+
|
245
|
+
# form parameters
|
246
|
+
form_params = {}
|
247
|
+
|
248
|
+
# http body (model)
|
249
|
+
post_body = nil
|
250
|
+
auth_names = ['bearer']
|
251
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
252
|
+
:header_params => header_params,
|
253
|
+
:query_params => query_params,
|
254
|
+
:form_params => form_params,
|
255
|
+
:body => post_body,
|
256
|
+
:auth_names => auth_names,
|
257
|
+
:return_type => 'Subscription')
|
258
|
+
if @api_client.config.debugging
|
259
|
+
@api_client.config.logger.debug "API called: SubscriptionApi#get_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
260
|
+
end
|
261
|
+
return data, status_code, headers
|
262
|
+
end
|
263
|
+
|
264
|
+
# Get all accessable subscriptions.
|
265
|
+
#
|
266
|
+
# @param [Hash] opts the optional parameters
|
267
|
+
# @return [Array<Subscription>]
|
268
|
+
def list_subscriptions(opts = {})
|
269
|
+
data, _status_code, _headers = list_subscriptions_with_http_info(opts)
|
270
|
+
return data
|
271
|
+
end
|
272
|
+
|
273
|
+
# Get all accessable subscriptions.
|
274
|
+
#
|
275
|
+
# @param [Hash] opts the optional parameters
|
276
|
+
# @return [Array<(Array<Subscription>, Fixnum, Hash)>] Array<Subscription> data, response status code and response headers
|
277
|
+
def list_subscriptions_with_http_info(opts = {})
|
278
|
+
if @api_client.config.debugging
|
279
|
+
@api_client.config.logger.debug "Calling API: SubscriptionApi.list_subscriptions ..."
|
280
|
+
end
|
281
|
+
# resource path
|
282
|
+
local_var_path = "/subscriptions"
|
283
|
+
|
284
|
+
# query parameters
|
285
|
+
query_params = {}
|
286
|
+
|
287
|
+
# header parameters
|
288
|
+
header_params = {}
|
289
|
+
# HTTP header 'Accept' (if needed)
|
290
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
291
|
+
|
292
|
+
# form parameters
|
293
|
+
form_params = {}
|
294
|
+
|
295
|
+
# http body (model)
|
296
|
+
post_body = nil
|
297
|
+
auth_names = ['bearer']
|
298
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
299
|
+
:header_params => header_params,
|
300
|
+
:query_params => query_params,
|
301
|
+
:form_params => form_params,
|
302
|
+
:body => post_body,
|
303
|
+
:auth_names => auth_names,
|
304
|
+
:return_type => 'Array<Subscription>')
|
305
|
+
if @api_client.config.debugging
|
306
|
+
@api_client.config.logger.debug "API called: SubscriptionApi#list_subscriptions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
307
|
+
end
|
308
|
+
return data, status_code, headers
|
309
|
+
end
|
310
|
+
end
|
311
|
+
end
|
@@ -0,0 +1,125 @@
|
|
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 UserApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
|
23
|
+
# Get self user.
|
24
|
+
#
|
25
|
+
# @param [Hash] opts the optional parameters
|
26
|
+
# @return [User]
|
27
|
+
def get_self(opts = {})
|
28
|
+
data, _status_code, _headers = get_self_with_http_info(opts)
|
29
|
+
return data
|
30
|
+
end
|
31
|
+
|
32
|
+
# Get self user.
|
33
|
+
#
|
34
|
+
# @param [Hash] opts the optional parameters
|
35
|
+
# @return [Array<(User, Fixnum, Hash)>] User data, response status code and response headers
|
36
|
+
def get_self_with_http_info(opts = {})
|
37
|
+
if @api_client.config.debugging
|
38
|
+
@api_client.config.logger.debug "Calling API: UserApi.get_self ..."
|
39
|
+
end
|
40
|
+
# resource path
|
41
|
+
local_var_path = "/users/self"
|
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(:GET, 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 => 'User')
|
64
|
+
if @api_client.config.debugging
|
65
|
+
@api_client.config.logger.debug "API called: UserApi#get_self\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
66
|
+
end
|
67
|
+
return data, status_code, headers
|
68
|
+
end
|
69
|
+
|
70
|
+
# Update self user.
|
71
|
+
#
|
72
|
+
# @param [Hash] opts the optional parameters
|
73
|
+
# @option opts [BOOLEAN] :agreed_terms_of_service Whether you agreed terms of service.
|
74
|
+
# @option opts [String] :email The email.
|
75
|
+
# @return [User]
|
76
|
+
def update_self(opts = {})
|
77
|
+
data, _status_code, _headers = update_self_with_http_info(opts)
|
78
|
+
return data
|
79
|
+
end
|
80
|
+
|
81
|
+
# Update self user.
|
82
|
+
#
|
83
|
+
# @param [Hash] opts the optional parameters
|
84
|
+
# @option opts [BOOLEAN] :agreed_terms_of_service Whether you agreed terms of service.
|
85
|
+
# @option opts [String] :email The email.
|
86
|
+
# @return [Array<(User, Fixnum, Hash)>] User data, response status code and response headers
|
87
|
+
def update_self_with_http_info(opts = {})
|
88
|
+
if @api_client.config.debugging
|
89
|
+
@api_client.config.logger.debug "Calling API: UserApi.update_self ..."
|
90
|
+
end
|
91
|
+
# resource path
|
92
|
+
local_var_path = "/users/self"
|
93
|
+
|
94
|
+
# query parameters
|
95
|
+
query_params = {}
|
96
|
+
|
97
|
+
# header parameters
|
98
|
+
header_params = {}
|
99
|
+
# HTTP header 'Accept' (if needed)
|
100
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
101
|
+
# HTTP header 'Content-Type'
|
102
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
|
103
|
+
|
104
|
+
# form parameters
|
105
|
+
form_params = {}
|
106
|
+
form_params["agreed_terms_of_service"] = opts[:'agreed_terms_of_service'] if !opts[:'agreed_terms_of_service'].nil?
|
107
|
+
form_params["email"] = opts[:'email'] if !opts[:'email'].nil?
|
108
|
+
|
109
|
+
# http body (model)
|
110
|
+
post_body = nil
|
111
|
+
auth_names = ['bearer']
|
112
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
|
113
|
+
:header_params => header_params,
|
114
|
+
:query_params => query_params,
|
115
|
+
:form_params => form_params,
|
116
|
+
:body => post_body,
|
117
|
+
:auth_names => auth_names,
|
118
|
+
:return_type => 'User')
|
119
|
+
if @api_client.config.debugging
|
120
|
+
@api_client.config.logger.debug "API called: UserApi#update_self\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
121
|
+
end
|
122
|
+
return data, status_code, headers
|
123
|
+
end
|
124
|
+
end
|
125
|
+
end
|
@@ -0,0 +1,295 @@
|
|
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 VideoApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
|
23
|
+
# Download an video data by id.
|
24
|
+
#
|
25
|
+
# @param id Video id
|
26
|
+
# @param [Hash] opts the optional parameters
|
27
|
+
# @return [String]
|
28
|
+
def download_video(id, opts = {})
|
29
|
+
data, _status_code, _headers = download_video_with_http_info(id, opts)
|
30
|
+
return data
|
31
|
+
end
|
32
|
+
|
33
|
+
# Download an video data by id.
|
34
|
+
#
|
35
|
+
# @param id Video id
|
36
|
+
# @param [Hash] opts the optional parameters
|
37
|
+
# @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
|
38
|
+
def download_video_with_http_info(id, opts = {})
|
39
|
+
if @api_client.config.debugging
|
40
|
+
@api_client.config.logger.debug "Calling API: VideoApi.download_video ..."
|
41
|
+
end
|
42
|
+
# verify the required parameter 'id' is set
|
43
|
+
if @api_client.config.client_side_validation && id.nil?
|
44
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling VideoApi.download_video"
|
45
|
+
end
|
46
|
+
if @api_client.config.client_side_validation && id < 1
|
47
|
+
fail ArgumentError, 'invalid value for "id" when calling VideoApi.download_video, must be greater than or equal to 1.'
|
48
|
+
end
|
49
|
+
|
50
|
+
# resource path
|
51
|
+
local_var_path = "/videos/{id}/download".sub('{' + 'id' + '}', id.to_s)
|
52
|
+
|
53
|
+
# query parameters
|
54
|
+
query_params = {}
|
55
|
+
|
56
|
+
# header parameters
|
57
|
+
header_params = {}
|
58
|
+
# HTTP header 'Accept' (if needed)
|
59
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
|
60
|
+
|
61
|
+
# form parameters
|
62
|
+
form_params = {}
|
63
|
+
|
64
|
+
# http body (model)
|
65
|
+
post_body = nil
|
66
|
+
auth_names = ['bearer']
|
67
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
68
|
+
:header_params => header_params,
|
69
|
+
:query_params => query_params,
|
70
|
+
:form_params => form_params,
|
71
|
+
:body => post_body,
|
72
|
+
:auth_names => auth_names,
|
73
|
+
:return_type => 'String')
|
74
|
+
if @api_client.config.debugging
|
75
|
+
@api_client.config.logger.debug "API called: VideoApi#download_video\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
76
|
+
end
|
77
|
+
return data, status_code, headers
|
78
|
+
end
|
79
|
+
|
80
|
+
# Download an video data by video_download_token.
|
81
|
+
#
|
82
|
+
# @param download_token Video download token
|
83
|
+
# @param [Hash] opts the optional parameters
|
84
|
+
# @return [String]
|
85
|
+
def download_video_by_token(download_token, opts = {})
|
86
|
+
data, _status_code, _headers = download_video_by_token_with_http_info(download_token, opts)
|
87
|
+
return data
|
88
|
+
end
|
89
|
+
|
90
|
+
# Download an video data by video_download_token.
|
91
|
+
#
|
92
|
+
# @param download_token Video download token
|
93
|
+
# @param [Hash] opts the optional parameters
|
94
|
+
# @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
|
95
|
+
def download_video_by_token_with_http_info(download_token, opts = {})
|
96
|
+
if @api_client.config.debugging
|
97
|
+
@api_client.config.logger.debug "Calling API: VideoApi.download_video_by_token ..."
|
98
|
+
end
|
99
|
+
# verify the required parameter 'download_token' is set
|
100
|
+
if @api_client.config.client_side_validation && download_token.nil?
|
101
|
+
fail ArgumentError, "Missing the required parameter 'download_token' when calling VideoApi.download_video_by_token"
|
102
|
+
end
|
103
|
+
# resource path
|
104
|
+
local_var_path = "/videos/download_by_token"
|
105
|
+
|
106
|
+
# query parameters
|
107
|
+
query_params = {}
|
108
|
+
query_params[:'download_token'] = download_token
|
109
|
+
|
110
|
+
# header parameters
|
111
|
+
header_params = {}
|
112
|
+
# HTTP header 'Accept' (if needed)
|
113
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
|
114
|
+
|
115
|
+
# form parameters
|
116
|
+
form_params = {}
|
117
|
+
|
118
|
+
# http body (model)
|
119
|
+
post_body = nil
|
120
|
+
auth_names = ['bearer']
|
121
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
122
|
+
:header_params => header_params,
|
123
|
+
:query_params => query_params,
|
124
|
+
:form_params => form_params,
|
125
|
+
:body => post_body,
|
126
|
+
:auth_names => auth_names,
|
127
|
+
:return_type => 'String')
|
128
|
+
if @api_client.config.debugging
|
129
|
+
@api_client.config.logger.debug "API called: VideoApi#download_video_by_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
130
|
+
end
|
131
|
+
return data, status_code, headers
|
132
|
+
end
|
133
|
+
|
134
|
+
# Get an video by id.
|
135
|
+
#
|
136
|
+
# @param id Video id
|
137
|
+
# @param [Hash] opts the optional parameters
|
138
|
+
# @return [Video]
|
139
|
+
def get_video(id, opts = {})
|
140
|
+
data, _status_code, _headers = get_video_with_http_info(id, opts)
|
141
|
+
return data
|
142
|
+
end
|
143
|
+
|
144
|
+
# Get an video by id.
|
145
|
+
#
|
146
|
+
# @param id Video id
|
147
|
+
# @param [Hash] opts the optional parameters
|
148
|
+
# @return [Array<(Video, Fixnum, Hash)>] Video data, response status code and response headers
|
149
|
+
def get_video_with_http_info(id, opts = {})
|
150
|
+
if @api_client.config.debugging
|
151
|
+
@api_client.config.logger.debug "Calling API: VideoApi.get_video ..."
|
152
|
+
end
|
153
|
+
# verify the required parameter 'id' is set
|
154
|
+
if @api_client.config.client_side_validation && id.nil?
|
155
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling VideoApi.get_video"
|
156
|
+
end
|
157
|
+
if @api_client.config.client_side_validation && id < 1
|
158
|
+
fail ArgumentError, 'invalid value for "id" when calling VideoApi.get_video, must be greater than or equal to 1.'
|
159
|
+
end
|
160
|
+
|
161
|
+
# resource path
|
162
|
+
local_var_path = "/videos/{id}".sub('{' + 'id' + '}', id.to_s)
|
163
|
+
|
164
|
+
# query parameters
|
165
|
+
query_params = {}
|
166
|
+
|
167
|
+
# header parameters
|
168
|
+
header_params = {}
|
169
|
+
# HTTP header 'Accept' (if needed)
|
170
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
171
|
+
|
172
|
+
# form parameters
|
173
|
+
form_params = {}
|
174
|
+
|
175
|
+
# http body (model)
|
176
|
+
post_body = nil
|
177
|
+
auth_names = ['bearer']
|
178
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
179
|
+
:header_params => header_params,
|
180
|
+
:query_params => query_params,
|
181
|
+
:form_params => form_params,
|
182
|
+
:body => post_body,
|
183
|
+
:auth_names => auth_names,
|
184
|
+
:return_type => 'Video')
|
185
|
+
if @api_client.config.debugging
|
186
|
+
@api_client.config.logger.debug "API called: VideoApi#get_video\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
187
|
+
end
|
188
|
+
return data, status_code, headers
|
189
|
+
end
|
190
|
+
|
191
|
+
# Get an video download token by id.
|
192
|
+
#
|
193
|
+
# @param id Video id
|
194
|
+
# @param [Hash] opts the optional parameters
|
195
|
+
# @return [VideoDownloadToken]
|
196
|
+
def get_video_download_token(id, opts = {})
|
197
|
+
data, _status_code, _headers = get_video_download_token_with_http_info(id, opts)
|
198
|
+
return data
|
199
|
+
end
|
200
|
+
|
201
|
+
# Get an video download token by id.
|
202
|
+
#
|
203
|
+
# @param id Video id
|
204
|
+
# @param [Hash] opts the optional parameters
|
205
|
+
# @return [Array<(VideoDownloadToken, Fixnum, Hash)>] VideoDownloadToken data, response status code and response headers
|
206
|
+
def get_video_download_token_with_http_info(id, opts = {})
|
207
|
+
if @api_client.config.debugging
|
208
|
+
@api_client.config.logger.debug "Calling API: VideoApi.get_video_download_token ..."
|
209
|
+
end
|
210
|
+
# verify the required parameter 'id' is set
|
211
|
+
if @api_client.config.client_side_validation && id.nil?
|
212
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling VideoApi.get_video_download_token"
|
213
|
+
end
|
214
|
+
if @api_client.config.client_side_validation && id < 1
|
215
|
+
fail ArgumentError, 'invalid value for "id" when calling VideoApi.get_video_download_token, must be greater than or equal to 1.'
|
216
|
+
end
|
217
|
+
|
218
|
+
# resource path
|
219
|
+
local_var_path = "/videos/{id}/download_token".sub('{' + 'id' + '}', id.to_s)
|
220
|
+
|
221
|
+
# query parameters
|
222
|
+
query_params = {}
|
223
|
+
|
224
|
+
# header parameters
|
225
|
+
header_params = {}
|
226
|
+
# HTTP header 'Accept' (if needed)
|
227
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
228
|
+
|
229
|
+
# form parameters
|
230
|
+
form_params = {}
|
231
|
+
|
232
|
+
# http body (model)
|
233
|
+
post_body = nil
|
234
|
+
auth_names = ['bearer']
|
235
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
236
|
+
:header_params => header_params,
|
237
|
+
:query_params => query_params,
|
238
|
+
:form_params => form_params,
|
239
|
+
:body => post_body,
|
240
|
+
:auth_names => auth_names,
|
241
|
+
:return_type => 'VideoDownloadToken')
|
242
|
+
if @api_client.config.debugging
|
243
|
+
@api_client.config.logger.debug "API called: VideoApi#get_video_download_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
244
|
+
end
|
245
|
+
return data, status_code, headers
|
246
|
+
end
|
247
|
+
|
248
|
+
# Get all videos accessable.
|
249
|
+
#
|
250
|
+
# @param [Hash] opts the optional parameters
|
251
|
+
# @return [Array<Video>]
|
252
|
+
def list_videos(opts = {})
|
253
|
+
data, _status_code, _headers = list_videos_with_http_info(opts)
|
254
|
+
return data
|
255
|
+
end
|
256
|
+
|
257
|
+
# Get all videos accessable.
|
258
|
+
#
|
259
|
+
# @param [Hash] opts the optional parameters
|
260
|
+
# @return [Array<(Array<Video>, Fixnum, Hash)>] Array<Video> data, response status code and response headers
|
261
|
+
def list_videos_with_http_info(opts = {})
|
262
|
+
if @api_client.config.debugging
|
263
|
+
@api_client.config.logger.debug "Calling API: VideoApi.list_videos ..."
|
264
|
+
end
|
265
|
+
# resource path
|
266
|
+
local_var_path = "/videos"
|
267
|
+
|
268
|
+
# query parameters
|
269
|
+
query_params = {}
|
270
|
+
|
271
|
+
# header parameters
|
272
|
+
header_params = {}
|
273
|
+
# HTTP header 'Accept' (if needed)
|
274
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
275
|
+
|
276
|
+
# form parameters
|
277
|
+
form_params = {}
|
278
|
+
|
279
|
+
# http body (model)
|
280
|
+
post_body = nil
|
281
|
+
auth_names = ['bearer']
|
282
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
283
|
+
:header_params => header_params,
|
284
|
+
:query_params => query_params,
|
285
|
+
:form_params => form_params,
|
286
|
+
:body => post_body,
|
287
|
+
:auth_names => auth_names,
|
288
|
+
:return_type => 'Array<Video>')
|
289
|
+
if @api_client.config.debugging
|
290
|
+
@api_client.config.logger.debug "API called: VideoApi#list_videos\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
291
|
+
end
|
292
|
+
return data, status_code, headers
|
293
|
+
end
|
294
|
+
end
|
295
|
+
end
|