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.
Files changed (132) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +7 -0
  3. data/README.md +167 -0
  4. data/Rakefile +8 -0
  5. data/aimastering.gemspec +45 -0
  6. data/docs/AccessToken.md +8 -0
  7. data/docs/AccessTokenApi.md +55 -0
  8. data/docs/AnonymizedMastering.md +29 -0
  9. data/docs/Audio.md +29 -0
  10. data/docs/AudioAnalysis.md +10 -0
  11. data/docs/AudioApi.md +374 -0
  12. data/docs/AudioDownloadToken.md +9 -0
  13. data/docs/Config.md +10 -0
  14. data/docs/ConfigApi.md +55 -0
  15. data/docs/ConfigAuth0.md +10 -0
  16. data/docs/ConfigPaypal.md +9 -0
  17. data/docs/ConfigStripe.md +8 -0
  18. data/docs/DateTime.md +7 -0
  19. data/docs/ExternalSearchApi.md +64 -0
  20. data/docs/ExternalSearchResult.md +9 -0
  21. data/docs/ExternalSearchResultItunes.md +18 -0
  22. data/docs/ExternalSearchResultYoutube.md +15 -0
  23. data/docs/JWT.md +7 -0
  24. data/docs/Kpi.md +7 -0
  25. data/docs/LibraryAudio.md +38 -0
  26. data/docs/LibraryAudioAnalysis.md +10 -0
  27. data/docs/LibraryAudioApi.md +378 -0
  28. data/docs/LibraryAudioLike.md +10 -0
  29. data/docs/Mastering.md +35 -0
  30. data/docs/MasteringApi.md +482 -0
  31. data/docs/Payment.md +14 -0
  32. data/docs/PaymentApi.md +224 -0
  33. data/docs/PaymentCustomer.md +11 -0
  34. data/docs/PaymentCustomerApi.md +55 -0
  35. data/docs/Plan.md +12 -0
  36. data/docs/PlanApi.md +55 -0
  37. data/docs/StatisticsApi.md +102 -0
  38. data/docs/Subscription.md +17 -0
  39. data/docs/SubscriptionApi.md +273 -0
  40. data/docs/User.md +14 -0
  41. data/docs/UserApi.md +111 -0
  42. data/docs/Video.md +13 -0
  43. data/docs/VideoApi.md +267 -0
  44. data/docs/VideoDownloadToken.md +9 -0
  45. data/git_push.sh +55 -0
  46. data/lib/aimastering.rb +77 -0
  47. data/lib/aimastering/api/access_token_api.rb +70 -0
  48. data/lib/aimastering/api/audio_api.rb +404 -0
  49. data/lib/aimastering/api/config_api.rb +70 -0
  50. data/lib/aimastering/api/external_search_api.rb +84 -0
  51. data/lib/aimastering/api/library_audio_api.rb +416 -0
  52. data/lib/aimastering/api/mastering_api.rb +596 -0
  53. data/lib/aimastering/api/payment_api.rb +263 -0
  54. data/lib/aimastering/api/payment_customer_api.rb +70 -0
  55. data/lib/aimastering/api/plan_api.rb +70 -0
  56. data/lib/aimastering/api/statistics_api.rb +117 -0
  57. data/lib/aimastering/api/subscription_api.rb +311 -0
  58. data/lib/aimastering/api/user_api.rb +125 -0
  59. data/lib/aimastering/api/video_api.rb +295 -0
  60. data/lib/aimastering/api_client.rb +389 -0
  61. data/lib/aimastering/api_error.rb +38 -0
  62. data/lib/aimastering/configuration.rb +209 -0
  63. data/lib/aimastering/models/access_token.rb +188 -0
  64. data/lib/aimastering/models/anonymized_mastering.rb +520 -0
  65. data/lib/aimastering/models/audio.rb +377 -0
  66. data/lib/aimastering/models/audio_analysis.rb +209 -0
  67. data/lib/aimastering/models/audio_download_token.rb +197 -0
  68. data/lib/aimastering/models/config.rb +206 -0
  69. data/lib/aimastering/models/config_auth0.rb +206 -0
  70. data/lib/aimastering/models/config_paypal.rb +197 -0
  71. data/lib/aimastering/models/config_stripe.rb +188 -0
  72. data/lib/aimastering/models/date_time.rb +179 -0
  73. data/lib/aimastering/models/external_search_result.rb +201 -0
  74. data/lib/aimastering/models/external_search_result_itunes.rb +278 -0
  75. data/lib/aimastering/models/external_search_result_youtube.rb +251 -0
  76. data/lib/aimastering/models/jwt.rb +179 -0
  77. data/lib/aimastering/models/kpi.rb +179 -0
  78. data/lib/aimastering/models/library_audio.rb +458 -0
  79. data/lib/aimastering/models/library_audio_analysis.rb +209 -0
  80. data/lib/aimastering/models/library_audio_like.rb +209 -0
  81. data/lib/aimastering/models/mastering.rb +587 -0
  82. data/lib/aimastering/models/payment.rb +275 -0
  83. data/lib/aimastering/models/payment_customer.rb +215 -0
  84. data/lib/aimastering/models/plan.rb +269 -0
  85. data/lib/aimastering/models/subscription.rb +302 -0
  86. data/lib/aimastering/models/user.rb +275 -0
  87. data/lib/aimastering/models/video.rb +233 -0
  88. data/lib/aimastering/models/video_download_token.rb +197 -0
  89. data/lib/aimastering/version.rb +15 -0
  90. data/spec/api/access_token_api_spec.rb +46 -0
  91. data/spec/api/audio_api_spec.rb +118 -0
  92. data/spec/api/config_api_spec.rb +46 -0
  93. data/spec/api/external_search_api_spec.rb +48 -0
  94. data/spec/api/library_audio_api_spec.rb +119 -0
  95. data/spec/api/mastering_api_spec.rb +154 -0
  96. data/spec/api/payment_api_spec.rb +85 -0
  97. data/spec/api/payment_customer_api_spec.rb +46 -0
  98. data/spec/api/plan_api_spec.rb +46 -0
  99. data/spec/api/statistics_api_spec.rb +57 -0
  100. data/spec/api/subscription_api_spec.rb +96 -0
  101. data/spec/api/user_api_spec.rb +59 -0
  102. data/spec/api/video_api_spec.rb +94 -0
  103. data/spec/api_client_spec.rb +226 -0
  104. data/spec/configuration_spec.rb +42 -0
  105. data/spec/models/access_token_spec.rb +42 -0
  106. data/spec/models/anonymized_mastering_spec.rb +192 -0
  107. data/spec/models/audio_analysis_spec.rb +54 -0
  108. data/spec/models/audio_download_token_spec.rb +48 -0
  109. data/spec/models/audio_spec.rb +168 -0
  110. data/spec/models/config_auth0_spec.rb +54 -0
  111. data/spec/models/config_paypal_spec.rb +48 -0
  112. data/spec/models/config_spec.rb +54 -0
  113. data/spec/models/config_stripe_spec.rb +42 -0
  114. data/spec/models/date_time_spec.rb +36 -0
  115. data/spec/models/external_search_result_itunes_spec.rb +102 -0
  116. data/spec/models/external_search_result_spec.rb +48 -0
  117. data/spec/models/external_search_result_youtube_spec.rb +84 -0
  118. data/spec/models/jwt_spec.rb +36 -0
  119. data/spec/models/kpi_spec.rb +36 -0
  120. data/spec/models/library_audio_analysis_spec.rb +54 -0
  121. data/spec/models/library_audio_like_spec.rb +54 -0
  122. data/spec/models/library_audio_spec.rb +222 -0
  123. data/spec/models/mastering_spec.rb +224 -0
  124. data/spec/models/payment_customer_spec.rb +60 -0
  125. data/spec/models/payment_spec.rb +82 -0
  126. data/spec/models/plan_spec.rb +74 -0
  127. data/spec/models/subscription_spec.rb +100 -0
  128. data/spec/models/user_spec.rb +82 -0
  129. data/spec/models/video_download_token_spec.rb +48 -0
  130. data/spec/models/video_spec.rb +72 -0
  131. data/spec/spec_helper.rb +111 -0
  132. metadata +397 -0
@@ -0,0 +1,596 @@
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 MasteringApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+
23
+ # Cancel a mastering by id.
24
+ #
25
+ # @param id Mastering id
26
+ # @param [Hash] opts the optional parameters
27
+ # @return [Mastering]
28
+ def cancel_mastering(id, opts = {})
29
+ data, _status_code, _headers = cancel_mastering_with_http_info(id, opts)
30
+ return data
31
+ end
32
+
33
+ # Cancel a mastering by id.
34
+ #
35
+ # @param id Mastering id
36
+ # @param [Hash] opts the optional parameters
37
+ # @return [Array<(Mastering, Fixnum, Hash)>] Mastering data, response status code and response headers
38
+ def cancel_mastering_with_http_info(id, opts = {})
39
+ if @api_client.config.debugging
40
+ @api_client.config.logger.debug "Calling API: MasteringApi.cancel_mastering ..."
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 MasteringApi.cancel_mastering"
45
+ end
46
+ if @api_client.config.client_side_validation && id < 1
47
+ fail ArgumentError, 'invalid value for "id" when calling MasteringApi.cancel_mastering, must be greater than or equal to 1.'
48
+ end
49
+
50
+ # resource path
51
+ local_var_path = "/masterings/{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
+
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(:PUT, 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 => 'Mastering')
74
+ if @api_client.config.debugging
75
+ @api_client.config.logger.debug "API called: MasteringApi#cancel_mastering\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
76
+ end
77
+ return data, status_code, headers
78
+ end
79
+
80
+ # Create a new mastering.
81
+ #
82
+ # @param input_audio_id Input audio id
83
+ # @param [Hash] opts the optional parameters
84
+ # @option opts [String] :mode Mode (default to default)
85
+ # @option opts [BOOLEAN] :bass_preservation This parameter represents if the bass preservation is enabled. (default to false)
86
+ # @option opts [BOOLEAN] :mastering This parameter represents if the mastering is enabled. This parameter is effective only when the mode is \&quot;default\&quot; or \&quot;custom\&quot;. (default to true)
87
+ # @option opts [String] :preset This parameter is effective only when the mode is \&quot;preset\&quot;. (default to general)
88
+ # @option opts [Float] :target_loudness This parameter represents the target loudness of the output audio in dB. This parameter is effective only when the mode is \&quot;custom\&quot;. (default to -5.0)
89
+ # @option opts [Float] :mastering_matching_level This parameter represents the mastering reference matching level. This parameter is effective only when the mode is \&quot;custom\&quot; and the mastering is enabled. (default to 0.5)
90
+ # @option opts [BOOLEAN] :mastering_reverb This parameter represents if the mastering reverb is enabled. This parameter is effective only when the mode is \&quot;custom\&quot; and the mastering is enabled. (default to false)
91
+ # @option opts [Float] :mastering_reverb_gain This parameter represents the mastering reverb gain relative to the dry sound in dB. This parameter is effective only when the mode is \&quot;custom\&quot; and the mastering is \&quot;true\&quot; and the mastering_reverb is \&quot;true\&quot;. (default to -36.0)
92
+ # @option opts [Integer] :reference_audio_id Reference audio id. This parameter is effective only when the mode is \&quot;custom\&quot; and the mastering is enabled.
93
+ # @option opts [Float] :low_cut_freq This parameter represents the low cut freq of the output audio in Hz. This parameter is effective only when the mode is \&quot;custom\&quot;. (default to 20.0)
94
+ # @option opts [Float] :high_cut_freq This parameter represents the target loudness of the output audio in Hz. This parameter is effective only when the mode is \&quot;custom\&quot;. (default to 20000.0)
95
+ # @option opts [Integer] :sample_rate This parameter represents the sample rate of the output audio in dB. This parameter is effective only when the mode is \&quot;custom\&quot;. (default to 44100)
96
+ # @option opts [Integer] :bit_depth This parameter represents the bit depth of the output audio in dB. This parameter is effective only when the mode is \&quot;custom\&quot;. (default to 16)
97
+ # @option opts [String] :output_format This parameter represents the format of the output audio. This parameter is effective only when the mode is \&quot;custom\&quot;. (default to wav)
98
+ # @option opts [BOOLEAN] :for_preview If this is true, the mastering is treated for preview purpose (ex. not purchasable, not publishable, short lifetime). (default to false)
99
+ # @option opts [Float] :start_at Partial mastering start at. (default to 0.0)
100
+ # @option opts [Float] :end_at Partial mastering end at. (default to -1.0)
101
+ # @option opts [BOOLEAN] :is_bakuage Deprecated. For backward compatibility. (default to false)
102
+ # @return [Mastering]
103
+ def create_mastering(input_audio_id, opts = {})
104
+ data, _status_code, _headers = create_mastering_with_http_info(input_audio_id, opts)
105
+ return data
106
+ end
107
+
108
+ # Create a new mastering.
109
+ #
110
+ # @param input_audio_id Input audio id
111
+ # @param [Hash] opts the optional parameters
112
+ # @option opts [String] :mode Mode
113
+ # @option opts [BOOLEAN] :bass_preservation This parameter represents if the bass preservation is enabled.
114
+ # @option opts [BOOLEAN] :mastering This parameter represents if the mastering is enabled. This parameter is effective only when the mode is \&quot;default\&quot; or \&quot;custom\&quot;.
115
+ # @option opts [String] :preset This parameter is effective only when the mode is \&quot;preset\&quot;.
116
+ # @option opts [Float] :target_loudness This parameter represents the target loudness of the output audio in dB. This parameter is effective only when the mode is \&quot;custom\&quot;.
117
+ # @option opts [Float] :mastering_matching_level This parameter represents the mastering reference matching level. This parameter is effective only when the mode is \&quot;custom\&quot; and the mastering is enabled.
118
+ # @option opts [BOOLEAN] :mastering_reverb This parameter represents if the mastering reverb is enabled. This parameter is effective only when the mode is \&quot;custom\&quot; and the mastering is enabled.
119
+ # @option opts [Float] :mastering_reverb_gain This parameter represents the mastering reverb gain relative to the dry sound in dB. This parameter is effective only when the mode is \&quot;custom\&quot; and the mastering is \&quot;true\&quot; and the mastering_reverb is \&quot;true\&quot;.
120
+ # @option opts [Integer] :reference_audio_id Reference audio id. This parameter is effective only when the mode is \&quot;custom\&quot; and the mastering is enabled.
121
+ # @option opts [Float] :low_cut_freq This parameter represents the low cut freq of the output audio in Hz. This parameter is effective only when the mode is \&quot;custom\&quot;.
122
+ # @option opts [Float] :high_cut_freq This parameter represents the target loudness of the output audio in Hz. This parameter is effective only when the mode is \&quot;custom\&quot;.
123
+ # @option opts [Integer] :sample_rate This parameter represents the sample rate of the output audio in dB. This parameter is effective only when the mode is \&quot;custom\&quot;.
124
+ # @option opts [Integer] :bit_depth This parameter represents the bit depth of the output audio in dB. This parameter is effective only when the mode is \&quot;custom\&quot;.
125
+ # @option opts [String] :output_format This parameter represents the format of the output audio. This parameter is effective only when the mode is \&quot;custom\&quot;.
126
+ # @option opts [BOOLEAN] :for_preview If this is true, the mastering is treated for preview purpose (ex. not purchasable, not publishable, short lifetime).
127
+ # @option opts [Float] :start_at Partial mastering start at.
128
+ # @option opts [Float] :end_at Partial mastering end at.
129
+ # @option opts [BOOLEAN] :is_bakuage Deprecated. For backward compatibility.
130
+ # @return [Array<(Mastering, Fixnum, Hash)>] Mastering data, response status code and response headers
131
+ def create_mastering_with_http_info(input_audio_id, opts = {})
132
+ if @api_client.config.debugging
133
+ @api_client.config.logger.debug "Calling API: MasteringApi.create_mastering ..."
134
+ end
135
+ # verify the required parameter 'input_audio_id' is set
136
+ if @api_client.config.client_side_validation && input_audio_id.nil?
137
+ fail ArgumentError, "Missing the required parameter 'input_audio_id' when calling MasteringApi.create_mastering"
138
+ end
139
+ if @api_client.config.client_side_validation && input_audio_id < 1
140
+ fail ArgumentError, 'invalid value for "input_audio_id" when calling MasteringApi.create_mastering, must be greater than or equal to 1.'
141
+ end
142
+
143
+ if @api_client.config.client_side_validation && opts[:'mode'] && !['default', 'custom', 'preset'].include?(opts[:'mode'])
144
+ fail ArgumentError, 'invalid value for "mode", must be one of default, custom, preset'
145
+ end
146
+ if @api_client.config.client_side_validation && opts[:'preset'] && !['general', 'pop', 'classical', 'jazz'].include?(opts[:'preset'])
147
+ fail ArgumentError, 'invalid value for "preset", must be one of general, pop, classical, jazz'
148
+ end
149
+ if @api_client.config.client_side_validation && !opts[:'mastering_matching_level'].nil? && opts[:'mastering_matching_level'] > 1
150
+ fail ArgumentError, 'invalid value for "opts[:"mastering_matching_level"]" when calling MasteringApi.create_mastering, must be smaller than or equal to 1.'
151
+ end
152
+
153
+ if @api_client.config.client_side_validation && !opts[:'mastering_matching_level'].nil? && opts[:'mastering_matching_level'] < 0
154
+ fail ArgumentError, 'invalid value for "opts[:"mastering_matching_level"]" when calling MasteringApi.create_mastering, must be greater than or equal to 0.'
155
+ end
156
+
157
+ if @api_client.config.client_side_validation && !opts[:'reference_audio_id'].nil? && opts[:'reference_audio_id'] < 1
158
+ fail ArgumentError, 'invalid value for "opts[:"reference_audio_id"]" when calling MasteringApi.create_mastering, must be greater than or equal to 1.'
159
+ end
160
+
161
+ if @api_client.config.client_side_validation && !opts[:'low_cut_freq'].nil? && opts[:'low_cut_freq'] < 0
162
+ fail ArgumentError, 'invalid value for "opts[:"low_cut_freq"]" when calling MasteringApi.create_mastering, must be greater than or equal to 0.'
163
+ end
164
+
165
+ if @api_client.config.client_side_validation && !opts[:'high_cut_freq'].nil? && opts[:'high_cut_freq'] < 0
166
+ fail ArgumentError, 'invalid value for "opts[:"high_cut_freq"]" when calling MasteringApi.create_mastering, must be greater than or equal to 0.'
167
+ end
168
+
169
+ if @api_client.config.client_side_validation && opts[:'output_format'] && !['wav', 'mp3'].include?(opts[:'output_format'])
170
+ fail ArgumentError, 'invalid value for "output_format", must be one of wav, mp3'
171
+ end
172
+ # resource path
173
+ local_var_path = "/masterings"
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["input_audio_id"] = input_audio_id
188
+ form_params["mode"] = opts[:'mode'] if !opts[:'mode'].nil?
189
+ form_params["bass_preservation"] = opts[:'bass_preservation'] if !opts[:'bass_preservation'].nil?
190
+ form_params["mastering"] = opts[:'mastering'] if !opts[:'mastering'].nil?
191
+ form_params["preset"] = opts[:'preset'] if !opts[:'preset'].nil?
192
+ form_params["target_loudness"] = opts[:'target_loudness'] if !opts[:'target_loudness'].nil?
193
+ form_params["mastering_matching_level"] = opts[:'mastering_matching_level'] if !opts[:'mastering_matching_level'].nil?
194
+ form_params["mastering_reverb"] = opts[:'mastering_reverb'] if !opts[:'mastering_reverb'].nil?
195
+ form_params["mastering_reverb_gain"] = opts[:'mastering_reverb_gain'] if !opts[:'mastering_reverb_gain'].nil?
196
+ form_params["reference_audio_id"] = opts[:'reference_audio_id'] if !opts[:'reference_audio_id'].nil?
197
+ form_params["low_cut_freq"] = opts[:'low_cut_freq'] if !opts[:'low_cut_freq'].nil?
198
+ form_params["high_cut_freq"] = opts[:'high_cut_freq'] if !opts[:'high_cut_freq'].nil?
199
+ form_params["sample_rate"] = opts[:'sample_rate'] if !opts[:'sample_rate'].nil?
200
+ form_params["bit_depth"] = opts[:'bit_depth'] if !opts[:'bit_depth'].nil?
201
+ form_params["output_format"] = opts[:'output_format'] if !opts[:'output_format'].nil?
202
+ form_params["for_preview"] = opts[:'for_preview'] if !opts[:'for_preview'].nil?
203
+ form_params["start_at"] = opts[:'start_at'] if !opts[:'start_at'].nil?
204
+ form_params["end_at"] = opts[:'end_at'] if !opts[:'end_at'].nil?
205
+ form_params["is_bakuage"] = opts[:'is_bakuage'] if !opts[:'is_bakuage'].nil?
206
+
207
+ # http body (model)
208
+ post_body = nil
209
+ auth_names = ['bearer']
210
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
211
+ :header_params => header_params,
212
+ :query_params => query_params,
213
+ :form_params => form_params,
214
+ :body => post_body,
215
+ :auth_names => auth_names,
216
+ :return_type => 'Mastering')
217
+ if @api_client.config.debugging
218
+ @api_client.config.logger.debug "API called: MasteringApi#create_mastering\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
219
+ end
220
+ return data, status_code, headers
221
+ end
222
+
223
+ # Delete mastering.
224
+ #
225
+ # @param id Mastering id
226
+ # @param [Hash] opts the optional parameters
227
+ # @return [Mastering]
228
+ def delete_mastering(id, opts = {})
229
+ data, _status_code, _headers = delete_mastering_with_http_info(id, opts)
230
+ return data
231
+ end
232
+
233
+ # Delete mastering.
234
+ #
235
+ # @param id Mastering id
236
+ # @param [Hash] opts the optional parameters
237
+ # @return [Array<(Mastering, Fixnum, Hash)>] Mastering data, response status code and response headers
238
+ def delete_mastering_with_http_info(id, opts = {})
239
+ if @api_client.config.debugging
240
+ @api_client.config.logger.debug "Calling API: MasteringApi.delete_mastering ..."
241
+ end
242
+ # verify the required parameter 'id' is set
243
+ if @api_client.config.client_side_validation && id.nil?
244
+ fail ArgumentError, "Missing the required parameter 'id' when calling MasteringApi.delete_mastering"
245
+ end
246
+ if @api_client.config.client_side_validation && id < 1
247
+ fail ArgumentError, 'invalid value for "id" when calling MasteringApi.delete_mastering, must be greater than or equal to 1.'
248
+ end
249
+
250
+ # resource path
251
+ local_var_path = "/masterings/{id}".sub('{' + 'id' + '}', id.to_s)
252
+
253
+ # query parameters
254
+ query_params = {}
255
+
256
+ # header parameters
257
+ header_params = {}
258
+ # HTTP header 'Accept' (if needed)
259
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
260
+
261
+ # form parameters
262
+ form_params = {}
263
+
264
+ # http body (model)
265
+ post_body = nil
266
+ auth_names = ['bearer']
267
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
268
+ :header_params => header_params,
269
+ :query_params => query_params,
270
+ :form_params => form_params,
271
+ :body => post_body,
272
+ :auth_names => auth_names,
273
+ :return_type => 'Mastering')
274
+ if @api_client.config.debugging
275
+ @api_client.config.logger.debug "API called: MasteringApi#delete_mastering\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
276
+ end
277
+ return data, status_code, headers
278
+ end
279
+
280
+ # Get a mastering by id.
281
+ #
282
+ # @param id Mastering id
283
+ # @param [Hash] opts the optional parameters
284
+ # @return [Mastering]
285
+ def get_mastering(id, opts = {})
286
+ data, _status_code, _headers = get_mastering_with_http_info(id, opts)
287
+ return data
288
+ end
289
+
290
+ # Get a mastering by id.
291
+ #
292
+ # @param id Mastering id
293
+ # @param [Hash] opts the optional parameters
294
+ # @return [Array<(Mastering, Fixnum, Hash)>] Mastering data, response status code and response headers
295
+ def get_mastering_with_http_info(id, opts = {})
296
+ if @api_client.config.debugging
297
+ @api_client.config.logger.debug "Calling API: MasteringApi.get_mastering ..."
298
+ end
299
+ # verify the required parameter 'id' is set
300
+ if @api_client.config.client_side_validation && id.nil?
301
+ fail ArgumentError, "Missing the required parameter 'id' when calling MasteringApi.get_mastering"
302
+ end
303
+ if @api_client.config.client_side_validation && id < 1
304
+ fail ArgumentError, 'invalid value for "id" when calling MasteringApi.get_mastering, must be greater than or equal to 1.'
305
+ end
306
+
307
+ # resource path
308
+ local_var_path = "/masterings/{id}".sub('{' + 'id' + '}', id.to_s)
309
+
310
+ # query parameters
311
+ query_params = {}
312
+
313
+ # header parameters
314
+ header_params = {}
315
+ # HTTP header 'Accept' (if needed)
316
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
317
+
318
+ # form parameters
319
+ form_params = {}
320
+
321
+ # http body (model)
322
+ post_body = nil
323
+ auth_names = ['bearer']
324
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
325
+ :header_params => header_params,
326
+ :query_params => query_params,
327
+ :form_params => form_params,
328
+ :body => post_body,
329
+ :auth_names => auth_names,
330
+ :return_type => 'Mastering')
331
+ if @api_client.config.debugging
332
+ @api_client.config.logger.debug "API called: MasteringApi#get_mastering\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
333
+ end
334
+ return data, status_code, headers
335
+ end
336
+
337
+ # Review a mastering by id.
338
+ #
339
+ # @param id Mastering id
340
+ # @param [Hash] opts the optional parameters
341
+ # @return [Mastering]
342
+ def get_mastering_unlock_product(id, opts = {})
343
+ data, _status_code, _headers = get_mastering_unlock_product_with_http_info(id, opts)
344
+ return data
345
+ end
346
+
347
+ # Review a mastering by id.
348
+ #
349
+ # @param id Mastering id
350
+ # @param [Hash] opts the optional parameters
351
+ # @return [Array<(Mastering, Fixnum, Hash)>] Mastering data, response status code and response headers
352
+ def get_mastering_unlock_product_with_http_info(id, opts = {})
353
+ if @api_client.config.debugging
354
+ @api_client.config.logger.debug "Calling API: MasteringApi.get_mastering_unlock_product ..."
355
+ end
356
+ # verify the required parameter 'id' is set
357
+ if @api_client.config.client_side_validation && id.nil?
358
+ fail ArgumentError, "Missing the required parameter 'id' when calling MasteringApi.get_mastering_unlock_product"
359
+ end
360
+ if @api_client.config.client_side_validation && id < 1
361
+ fail ArgumentError, 'invalid value for "id" when calling MasteringApi.get_mastering_unlock_product, must be greater than or equal to 1.'
362
+ end
363
+
364
+ # resource path
365
+ local_var_path = "/masterings/{id}/unlock_product".sub('{' + 'id' + '}', id.to_s)
366
+
367
+ # query parameters
368
+ query_params = {}
369
+
370
+ # header parameters
371
+ header_params = {}
372
+ # HTTP header 'Accept' (if needed)
373
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
374
+
375
+ # form parameters
376
+ form_params = {}
377
+
378
+ # http body (model)
379
+ post_body = nil
380
+ auth_names = ['bearer']
381
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
382
+ :header_params => header_params,
383
+ :query_params => query_params,
384
+ :form_params => form_params,
385
+ :body => post_body,
386
+ :auth_names => auth_names,
387
+ :return_type => 'Mastering')
388
+ if @api_client.config.debugging
389
+ @api_client.config.logger.debug "API called: MasteringApi#get_mastering_unlock_product\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
390
+ end
391
+ return data, status_code, headers
392
+ end
393
+
394
+ # Get all accessable masterings.
395
+ #
396
+ # @param [Hash] opts the optional parameters
397
+ # @return [Array<Mastering>]
398
+ def list_masterings(opts = {})
399
+ data, _status_code, _headers = list_masterings_with_http_info(opts)
400
+ return data
401
+ end
402
+
403
+ # Get all accessable masterings.
404
+ #
405
+ # @param [Hash] opts the optional parameters
406
+ # @return [Array<(Array<Mastering>, Fixnum, Hash)>] Array<Mastering> data, response status code and response headers
407
+ def list_masterings_with_http_info(opts = {})
408
+ if @api_client.config.debugging
409
+ @api_client.config.logger.debug "Calling API: MasteringApi.list_masterings ..."
410
+ end
411
+ # resource path
412
+ local_var_path = "/masterings"
413
+
414
+ # query parameters
415
+ query_params = {}
416
+
417
+ # header parameters
418
+ header_params = {}
419
+ # HTTP header 'Accept' (if needed)
420
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
421
+
422
+ # form parameters
423
+ form_params = {}
424
+
425
+ # http body (model)
426
+ post_body = nil
427
+ auth_names = ['bearer']
428
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
429
+ :header_params => header_params,
430
+ :query_params => query_params,
431
+ :form_params => form_params,
432
+ :body => post_body,
433
+ :auth_names => auth_names,
434
+ :return_type => 'Array<Mastering>')
435
+ if @api_client.config.debugging
436
+ @api_client.config.logger.debug "API called: MasteringApi#list_masterings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
437
+ end
438
+ return data, status_code, headers
439
+ end
440
+
441
+ # Publish a mastering by id.
442
+ #
443
+ # @param id Mastering id
444
+ # @param access_token This parameter represents if the access token of the publishment service API.
445
+ # @param message This parameter represents the publishment message.
446
+ # @param [Hash] opts the optional parameters
447
+ # @option opts [String] :service This parameter represents the publishment service.
448
+ # @option opts [String] :access_token_secret This parameter represents the access token secret of the publishment service API. This parameter is effective only when the service is \&quot;twitter\&quot;.
449
+ # @return [Mastering]
450
+ def publish_mastering(id, access_token, message, opts = {})
451
+ data, _status_code, _headers = publish_mastering_with_http_info(id, access_token, message, opts)
452
+ return data
453
+ end
454
+
455
+ # Publish a mastering by id.
456
+ #
457
+ # @param id Mastering id
458
+ # @param access_token This parameter represents if the access token of the publishment service API.
459
+ # @param message This parameter represents the publishment message.
460
+ # @param [Hash] opts the optional parameters
461
+ # @option opts [String] :service This parameter represents the publishment service.
462
+ # @option opts [String] :access_token_secret This parameter represents the access token secret of the publishment service API. This parameter is effective only when the service is \&quot;twitter\&quot;.
463
+ # @return [Array<(Mastering, Fixnum, Hash)>] Mastering data, response status code and response headers
464
+ def publish_mastering_with_http_info(id, access_token, message, opts = {})
465
+ if @api_client.config.debugging
466
+ @api_client.config.logger.debug "Calling API: MasteringApi.publish_mastering ..."
467
+ end
468
+ # verify the required parameter 'id' is set
469
+ if @api_client.config.client_side_validation && id.nil?
470
+ fail ArgumentError, "Missing the required parameter 'id' when calling MasteringApi.publish_mastering"
471
+ end
472
+ if @api_client.config.client_side_validation && id < 1
473
+ fail ArgumentError, 'invalid value for "id" when calling MasteringApi.publish_mastering, must be greater than or equal to 1.'
474
+ end
475
+
476
+ # verify the required parameter 'access_token' is set
477
+ if @api_client.config.client_side_validation && access_token.nil?
478
+ fail ArgumentError, "Missing the required parameter 'access_token' when calling MasteringApi.publish_mastering"
479
+ end
480
+ # verify the required parameter 'message' is set
481
+ if @api_client.config.client_side_validation && message.nil?
482
+ fail ArgumentError, "Missing the required parameter 'message' when calling MasteringApi.publish_mastering"
483
+ end
484
+ if @api_client.config.client_side_validation && opts[:'service'] && !['twitter', 'youtube'].include?(opts[:'service'])
485
+ fail ArgumentError, 'invalid value for "service", must be one of twitter, youtube'
486
+ end
487
+ # resource path
488
+ local_var_path = "/masterings/{id}/publish".sub('{' + 'id' + '}', id.to_s)
489
+
490
+ # query parameters
491
+ query_params = {}
492
+
493
+ # header parameters
494
+ header_params = {}
495
+ # HTTP header 'Accept' (if needed)
496
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
497
+ # HTTP header 'Content-Type'
498
+ header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
499
+
500
+ # form parameters
501
+ form_params = {}
502
+ form_params["access_token"] = access_token
503
+ form_params["message"] = message
504
+ form_params["service"] = opts[:'service'] if !opts[:'service'].nil?
505
+ form_params["access_token_secret"] = opts[:'access_token_secret'] if !opts[:'access_token_secret'].nil?
506
+
507
+ # http body (model)
508
+ post_body = nil
509
+ auth_names = ['bearer']
510
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
511
+ :header_params => header_params,
512
+ :query_params => query_params,
513
+ :form_params => form_params,
514
+ :body => post_body,
515
+ :auth_names => auth_names,
516
+ :return_type => 'Mastering')
517
+ if @api_client.config.debugging
518
+ @api_client.config.logger.debug "API called: MasteringApi#publish_mastering\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
519
+ end
520
+ return data, status_code, headers
521
+ end
522
+
523
+ # Review a mastering by id.
524
+ #
525
+ # @param id Mastering id
526
+ # @param [Hash] opts the optional parameters
527
+ # @option opts [String] :review_comment This parameter represents the review comment.
528
+ # @option opts [Float] :review_score This parameter represents the review score.
529
+ # @return [Mastering]
530
+ def review_mastering(id, opts = {})
531
+ data, _status_code, _headers = review_mastering_with_http_info(id, opts)
532
+ return data
533
+ end
534
+
535
+ # Review a mastering by id.
536
+ #
537
+ # @param id Mastering id
538
+ # @param [Hash] opts the optional parameters
539
+ # @option opts [String] :review_comment This parameter represents the review comment.
540
+ # @option opts [Float] :review_score This parameter represents the review score.
541
+ # @return [Array<(Mastering, Fixnum, Hash)>] Mastering data, response status code and response headers
542
+ def review_mastering_with_http_info(id, opts = {})
543
+ if @api_client.config.debugging
544
+ @api_client.config.logger.debug "Calling API: MasteringApi.review_mastering ..."
545
+ end
546
+ # verify the required parameter 'id' is set
547
+ if @api_client.config.client_side_validation && id.nil?
548
+ fail ArgumentError, "Missing the required parameter 'id' when calling MasteringApi.review_mastering"
549
+ end
550
+ if @api_client.config.client_side_validation && id < 1
551
+ fail ArgumentError, 'invalid value for "id" when calling MasteringApi.review_mastering, must be greater than or equal to 1.'
552
+ end
553
+
554
+ if @api_client.config.client_side_validation && !opts[:'review_score'].nil? && opts[:'review_score'] > 1
555
+ fail ArgumentError, 'invalid value for "opts[:"review_score"]" when calling MasteringApi.review_mastering, must be smaller than or equal to 1.'
556
+ end
557
+
558
+ if @api_client.config.client_side_validation && !opts[:'review_score'].nil? && opts[:'review_score'] < 0
559
+ fail ArgumentError, 'invalid value for "opts[:"review_score"]" when calling MasteringApi.review_mastering, must be greater than or equal to 0.'
560
+ end
561
+
562
+ # resource path
563
+ local_var_path = "/masterings/{id}/review".sub('{' + 'id' + '}', id.to_s)
564
+
565
+ # query parameters
566
+ query_params = {}
567
+
568
+ # header parameters
569
+ header_params = {}
570
+ # HTTP header 'Accept' (if needed)
571
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
572
+ # HTTP header 'Content-Type'
573
+ header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
574
+
575
+ # form parameters
576
+ form_params = {}
577
+ form_params["review_comment"] = opts[:'review_comment'] if !opts[:'review_comment'].nil?
578
+ form_params["review_score"] = opts[:'review_score'] if !opts[:'review_score'].nil?
579
+
580
+ # http body (model)
581
+ post_body = nil
582
+ auth_names = ['bearer']
583
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
584
+ :header_params => header_params,
585
+ :query_params => query_params,
586
+ :form_params => form_params,
587
+ :body => post_body,
588
+ :auth_names => auth_names,
589
+ :return_type => 'Mastering')
590
+ if @api_client.config.debugging
591
+ @api_client.config.logger.debug "API called: MasteringApi#review_mastering\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
592
+ end
593
+ return data, status_code, headers
594
+ end
595
+ end
596
+ end