musicube_api_client_ruby 1.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (227) hide show
  1. checksums.yaml +7 -0
  2. data/CODE_OF_CONDUCT.md +84 -0
  3. data/Gemfile +9 -0
  4. data/README.md +223 -0
  5. data/Rakefile +10 -0
  6. data/bin/console +15 -0
  7. data/bin/setup +8 -0
  8. data/docs/AllowedValuesApi.md +200 -0
  9. data/docs/CategoryMediumDTO.md +22 -0
  10. data/docs/CategoryMinimalDTO.md +18 -0
  11. data/docs/ConfigAccessDTO.md +20 -0
  12. data/docs/ConfigIdentifierDTO.md +20 -0
  13. data/docs/ContributorTypeDTO.md +18 -0
  14. data/docs/ErrorResponse.md +26 -0
  15. data/docs/FieldSummaryDTO.md +22 -0
  16. data/docs/FileDTO.md +50 -0
  17. data/docs/FileListDTO.md +24 -0
  18. data/docs/FileMinimalWithUrlDTO.md +22 -0
  19. data/docs/FileSmallDTO.md +46 -0
  20. data/docs/FileUploadDTO.md +22 -0
  21. data/docs/FileWIthUrlDTO.md +20 -0
  22. data/docs/FilesSummaryDTO.md +30 -0
  23. data/docs/ForgotPasswordDTO.md +20 -0
  24. data/docs/GenreDTO.md +20 -0
  25. data/docs/GenreMinimalDTO.md +18 -0
  26. data/docs/GenresSummaryDTO.md +22 -0
  27. data/docs/InitPutRecordingAudioDTO.md +22 -0
  28. data/docs/JwtTokenDTO.md +22 -0
  29. data/docs/LoginDTO.md +24 -0
  30. data/docs/MusicalFeaturesDTO.md +186 -0
  31. data/docs/PLineDTO.md +20 -0
  32. data/docs/PartyApi.md +75 -0
  33. data/docs/PartyLargeDTO.md +32 -0
  34. data/docs/PartySmallDTO.md +20 -0
  35. data/docs/PlaylistApi.md +221 -0
  36. data/docs/PlaylistLargeDTO.md +38 -0
  37. data/docs/ProductMediumDTO.md +34 -0
  38. data/docs/ProductPartyDTO.md +20 -0
  39. data/docs/RecordingApi.md +789 -0
  40. data/docs/RecordingForSimilaritySearchDTO.md +20 -0
  41. data/docs/RecordingGenrePredictionDTO.md +22 -0
  42. data/docs/RecordingLargeDTO.md +40 -0
  43. data/docs/RecordingListDTO.md +24 -0
  44. data/docs/RecordingMediumDTO.md +36 -0
  45. data/docs/RecordingMinimalWithMusicalFeaturesDTO.md +20 -0
  46. data/docs/RecordingMinimalWithTaggramsDTO.md +22 -0
  47. data/docs/RecordingMinimalWithTagstrengthsDTO.md +20 -0
  48. data/docs/RecordingPartyDTO.md +20 -0
  49. data/docs/RecordingPlaylistDTO.md +24 -0
  50. data/docs/RecordingSmallDTO.md +24 -0
  51. data/docs/RecordingTagSmallDTO.md +18 -0
  52. data/docs/SaveFileRecordingDTO.md +236 -0
  53. data/docs/SavePlaylistDTO.md +34 -0
  54. data/docs/SaveRecordingGenreDTO.md +22 -0
  55. data/docs/SaveRecordingPartyDTO.md +20 -0
  56. data/docs/SaveRecordingPlaylistDTO.md +22 -0
  57. data/docs/SaveRecordingTagDTO.md +20 -0
  58. data/docs/SaveReferrerDTO.md +20 -0
  59. data/docs/SaveTaggramsDTO.md +82 -0
  60. data/docs/SaveUserDTO.md +28 -0
  61. data/docs/SearchFilterValuesDTO.md +98 -0
  62. data/docs/SearchRecordingGranularAbstractionDTO.md +20 -0
  63. data/docs/SearchRecordingGranularDTO.md +22 -0
  64. data/docs/SignUpDTO.md +24 -0
  65. data/docs/TagDTO.md +22 -0
  66. data/docs/TagSmallDTO.md +20 -0
  67. data/docs/TaggramDTO.md +26 -0
  68. data/docs/TagsSummaryDTO.md +22 -0
  69. data/docs/TagstrengthDTO.md +26 -0
  70. data/docs/TitleDTO.md +18 -0
  71. data/docs/TokenRequest.md +18 -0
  72. data/docs/TrackToMediumProductDTO.md +22 -0
  73. data/docs/UpdatePasswordDTO.md +20 -0
  74. data/docs/UsageDTO.md +18 -0
  75. data/docs/UserApi.md +1936 -0
  76. data/docs/UserDTO.md +56 -0
  77. data/git_push.sh +57 -0
  78. data/lib/musicube_api_client_ruby/api/allowed_values_api.rb +213 -0
  79. data/lib/musicube_api_client_ruby/api/party_api.rb +84 -0
  80. data/lib/musicube_api_client_ruby/api/playlist_api.rb +222 -0
  81. data/lib/musicube_api_client_ruby/api/recording_api.rb +900 -0
  82. data/lib/musicube_api_client_ruby/api/user_api.rb +2642 -0
  83. data/lib/musicube_api_client_ruby/api_client.rb +428 -0
  84. data/lib/musicube_api_client_ruby/api_error.rb +58 -0
  85. data/lib/musicube_api_client_ruby/configuration.rb +380 -0
  86. data/lib/musicube_api_client_ruby/models/category_medium_dto.rb +250 -0
  87. data/lib/musicube_api_client_ruby/models/category_minimal_dto.rb +225 -0
  88. data/lib/musicube_api_client_ruby/models/config_access_dto.rb +287 -0
  89. data/lib/musicube_api_client_ruby/models/config_identifier_dto.rb +239 -0
  90. data/lib/musicube_api_client_ruby/models/contributor_type_dto.rb +225 -0
  91. data/lib/musicube_api_client_ruby/models/error_response.rb +276 -0
  92. data/lib/musicube_api_client_ruby/models/field_summary_dto.rb +253 -0
  93. data/lib/musicube_api_client_ruby/models/file_dto.rb +450 -0
  94. data/lib/musicube_api_client_ruby/models/file_list_dto.rb +269 -0
  95. data/lib/musicube_api_client_ruby/models/file_minimal_with_url_dto.rb +253 -0
  96. data/lib/musicube_api_client_ruby/models/file_small_dto.rb +432 -0
  97. data/lib/musicube_api_client_ruby/models/file_upload_dto.rb +244 -0
  98. data/lib/musicube_api_client_ruby/models/file_w_ith_url_dto.rb +239 -0
  99. data/lib/musicube_api_client_ruby/models/files_summary_dto.rb +287 -0
  100. data/lib/musicube_api_client_ruby/models/forgot_password_dto.rb +267 -0
  101. data/lib/musicube_api_client_ruby/models/genre_dto.rb +239 -0
  102. data/lib/musicube_api_client_ruby/models/genre_minimal_dto.rb +225 -0
  103. data/lib/musicube_api_client_ruby/models/genres_summary_dto.rb +248 -0
  104. data/lib/musicube_api_client_ruby/models/init_put_recording_audio_dto.rb +238 -0
  105. data/lib/musicube_api_client_ruby/models/jwt_token_dto.rb +248 -0
  106. data/lib/musicube_api_client_ruby/models/login_dto.rb +257 -0
  107. data/lib/musicube_api_client_ruby/models/musical_features_dto.rb +1532 -0
  108. data/lib/musicube_api_client_ruby/models/p_line_dto.rb +234 -0
  109. data/lib/musicube_api_client_ruby/models/party_large_dto.rb +288 -0
  110. data/lib/musicube_api_client_ruby/models/party_small_dto.rb +239 -0
  111. data/lib/musicube_api_client_ruby/models/playlist_large_dto.rb +353 -0
  112. data/lib/musicube_api_client_ruby/models/product_medium_dto.rb +316 -0
  113. data/lib/musicube_api_client_ruby/models/product_party_dto.rb +236 -0
  114. data/lib/musicube_api_client_ruby/models/recording_for_similarity_search_dto.rb +239 -0
  115. data/lib/musicube_api_client_ruby/models/recording_genre_prediction_dto.rb +253 -0
  116. data/lib/musicube_api_client_ruby/models/recording_large_dto.rb +366 -0
  117. data/lib/musicube_api_client_ruby/models/recording_list_dto.rb +269 -0
  118. data/lib/musicube_api_client_ruby/models/recording_medium_dto.rb +340 -0
  119. data/lib/musicube_api_client_ruby/models/recording_minimal_with_musical_features_dto.rb +236 -0
  120. data/lib/musicube_api_client_ruby/models/recording_minimal_with_taggrams_dto.rb +248 -0
  121. data/lib/musicube_api_client_ruby/models/recording_minimal_with_tagstrengths_dto.rb +236 -0
  122. data/lib/musicube_api_client_ruby/models/recording_party_dto.rb +236 -0
  123. data/lib/musicube_api_client_ruby/models/recording_playlist_dto.rb +247 -0
  124. data/lib/musicube_api_client_ruby/models/recording_small_dto.rb +268 -0
  125. data/lib/musicube_api_client_ruby/models/recording_tag_small_dto.rb +225 -0
  126. data/lib/musicube_api_client_ruby/models/save_file_recording_dto.rb +1847 -0
  127. data/lib/musicube_api_client_ruby/models/save_playlist_dto.rb +350 -0
  128. data/lib/musicube_api_client_ruby/models/save_recording_genre_dto.rb +243 -0
  129. data/lib/musicube_api_client_ruby/models/save_recording_party_dto.rb +273 -0
  130. data/lib/musicube_api_client_ruby/models/save_recording_playlist_dto.rb +248 -0
  131. data/lib/musicube_api_client_ruby/models/save_recording_tag_dto.rb +234 -0
  132. data/lib/musicube_api_client_ruby/models/save_referrer_dto.rb +229 -0
  133. data/lib/musicube_api_client_ruby/models/save_taggrams_dto.rb +574 -0
  134. data/lib/musicube_api_client_ruby/models/save_user_dto.rb +317 -0
  135. data/lib/musicube_api_client_ruby/models/search_filter_values_dto.rb +867 -0
  136. data/lib/musicube_api_client_ruby/models/search_recording_granular_abstraction_dto.rb +270 -0
  137. data/lib/musicube_api_client_ruby/models/search_recording_granular_dto.rb +245 -0
  138. data/lib/musicube_api_client_ruby/models/sign_up_dto.rb +262 -0
  139. data/lib/musicube_api_client_ruby/models/tag_dto.rb +250 -0
  140. data/lib/musicube_api_client_ruby/models/tag_small_dto.rb +239 -0
  141. data/lib/musicube_api_client_ruby/models/taggram_dto.rb +271 -0
  142. data/lib/musicube_api_client_ruby/models/tags_summary_dto.rb +250 -0
  143. data/lib/musicube_api_client_ruby/models/tagstrength_dto.rb +269 -0
  144. data/lib/musicube_api_client_ruby/models/title_dto.rb +225 -0
  145. data/lib/musicube_api_client_ruby/models/token_request.rb +224 -0
  146. data/lib/musicube_api_client_ruby/models/track_to_medium_product_dto.rb +248 -0
  147. data/lib/musicube_api_client_ruby/models/update_password_dto.rb +238 -0
  148. data/lib/musicube_api_client_ruby/models/usage_dto.rb +220 -0
  149. data/lib/musicube_api_client_ruby/models/user_dto.rb +481 -0
  150. data/lib/musicube_api_client_ruby/version.rb +15 -0
  151. data/lib/musicube_api_client_ruby.rb +108 -0
  152. data/musicube_api_client_ruby.gemspec +39 -0
  153. data/openapi-generator-config.yaml +9 -0
  154. data/spec/api/allowed_values_api_spec.rb +68 -0
  155. data/spec/api/party_api_spec.rb +46 -0
  156. data/spec/api/playlist_api_spec.rb +72 -0
  157. data/spec/api/recording_api_spec.rb +192 -0
  158. data/spec/api/user_api_spec.rb +507 -0
  159. data/spec/api_client_spec.rb +223 -0
  160. data/spec/configuration_spec.rb +82 -0
  161. data/spec/models/category_medium_dto_spec.rb +46 -0
  162. data/spec/models/category_minimal_dto_spec.rb +34 -0
  163. data/spec/models/config_access_dto_spec.rb +48 -0
  164. data/spec/models/config_identifier_dto_spec.rb +40 -0
  165. data/spec/models/contributor_type_dto_spec.rb +34 -0
  166. data/spec/models/error_response_spec.rb +58 -0
  167. data/spec/models/field_summary_dto_spec.rb +46 -0
  168. data/spec/models/file_dto_spec.rb +142 -0
  169. data/spec/models/file_list_dto_spec.rb +52 -0
  170. data/spec/models/file_minimal_with_url_dto_spec.rb +46 -0
  171. data/spec/models/file_small_dto_spec.rb +130 -0
  172. data/spec/models/file_upload_dto_spec.rb +46 -0
  173. data/spec/models/file_w_ith_url_dto_spec.rb +40 -0
  174. data/spec/models/files_summary_dto_spec.rb +70 -0
  175. data/spec/models/forgot_password_dto_spec.rb +44 -0
  176. data/spec/models/genre_dto_spec.rb +40 -0
  177. data/spec/models/genre_minimal_dto_spec.rb +34 -0
  178. data/spec/models/genres_summary_dto_spec.rb +46 -0
  179. data/spec/models/init_put_recording_audio_dto_spec.rb +46 -0
  180. data/spec/models/jwt_token_dto_spec.rb +46 -0
  181. data/spec/models/login_dto_spec.rb +52 -0
  182. data/spec/models/musical_features_dto_spec.rb +706 -0
  183. data/spec/models/p_line_dto_spec.rb +40 -0
  184. data/spec/models/party_large_dto_spec.rb +76 -0
  185. data/spec/models/party_small_dto_spec.rb +40 -0
  186. data/spec/models/playlist_large_dto_spec.rb +98 -0
  187. data/spec/models/product_medium_dto_spec.rb +82 -0
  188. data/spec/models/product_party_dto_spec.rb +40 -0
  189. data/spec/models/recording_for_similarity_search_dto_spec.rb +40 -0
  190. data/spec/models/recording_genre_prediction_dto_spec.rb +46 -0
  191. data/spec/models/recording_large_dto_spec.rb +100 -0
  192. data/spec/models/recording_list_dto_spec.rb +52 -0
  193. data/spec/models/recording_medium_dto_spec.rb +88 -0
  194. data/spec/models/recording_minimal_with_musical_features_dto_spec.rb +40 -0
  195. data/spec/models/recording_minimal_with_taggrams_dto_spec.rb +46 -0
  196. data/spec/models/recording_minimal_with_tagstrengths_dto_spec.rb +40 -0
  197. data/spec/models/recording_party_dto_spec.rb +40 -0
  198. data/spec/models/recording_playlist_dto_spec.rb +52 -0
  199. data/spec/models/recording_small_dto_spec.rb +52 -0
  200. data/spec/models/recording_tag_small_dto_spec.rb +34 -0
  201. data/spec/models/save_file_recording_dto_spec.rb +880 -0
  202. data/spec/models/save_playlist_dto_spec.rb +86 -0
  203. data/spec/models/save_recording_genre_dto_spec.rb +46 -0
  204. data/spec/models/save_recording_party_dto_spec.rb +44 -0
  205. data/spec/models/save_recording_playlist_dto_spec.rb +46 -0
  206. data/spec/models/save_recording_tag_dto_spec.rb +40 -0
  207. data/spec/models/save_referrer_dto_spec.rb +40 -0
  208. data/spec/models/save_taggrams_dto_spec.rb +226 -0
  209. data/spec/models/save_user_dto_spec.rb +72 -0
  210. data/spec/models/search_filter_values_dto_spec.rb +274 -0
  211. data/spec/models/search_recording_granular_abstraction_dto_spec.rb +44 -0
  212. data/spec/models/search_recording_granular_dto_spec.rb +46 -0
  213. data/spec/models/sign_up_dto_spec.rb +52 -0
  214. data/spec/models/tag_dto_spec.rb +46 -0
  215. data/spec/models/tag_small_dto_spec.rb +40 -0
  216. data/spec/models/taggram_dto_spec.rb +58 -0
  217. data/spec/models/tags_summary_dto_spec.rb +46 -0
  218. data/spec/models/tagstrength_dto_spec.rb +58 -0
  219. data/spec/models/title_dto_spec.rb +34 -0
  220. data/spec/models/token_request_spec.rb +34 -0
  221. data/spec/models/track_to_medium_product_dto_spec.rb +46 -0
  222. data/spec/models/update_password_dto_spec.rb +40 -0
  223. data/spec/models/usage_dto_spec.rb +34 -0
  224. data/spec/models/user_dto_spec.rb +148 -0
  225. data/spec/musicube_api_client_ruby_spec.rb +11 -0
  226. data/spec/spec_helper.rb +111 -0
  227. metadata +415 -0
@@ -0,0 +1,238 @@
1
+ =begin
2
+ #Songtradr API
3
+
4
+ #This is the Songtradr API. Use it to retrieve deep music metadata and trigger processes like auto-tagging. You can also use the API to manage your account and musicube cloud data. **Authentication** 1. Reach out to support@songtradr.com to receive a free account or use your login data if you are already signed up. 2. To authenticate, you need to login via the POST /api/v1/user/login endpoint. 3. The endpoint responds with a jwtToken which you can use in all following API requests as a bearer token. **Rate Limiting** The current limit is 120 Requests per minute. Reach out to us via support@songtradr.com if you need to request more. **Getting Started with auto-tagging** 1. If you want to get your own files auto-tagged, use the POST /api/v1/user/file/{name}/initUpload endpoint. It responds with a presigned S3 link where you can upload your file. 2. You can check the processing status of your file via the GET /api/v1/user/file/{name}/filesStatus endpoint. 3. As soon as processing is done, you can request the generated data via the GET /api/v1/user/files endpoint. **Getting Started with search** You can either search the released music via the /public/recording endpoints or your own private uploaded music via the /user/file/ endpoints. 1. If you want to search the world's released music, a good starting point is the GET /api/v1/public/recording/search endpoint. Please find the extensive list of parameters that serve as semantic search filters. 2. If you want to search your own previously uploaded music, a good starting point is the GET GET /api/v1/user/files endpoint. It has the same extensive list of parameters that serve as semantic search filters.
5
+
6
+ The version of the OpenAPI document: 1.12.21
7
+ Contact: info@songtradr.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.6.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module MusicubeApiClientRuby
17
+ class UpdatePasswordDTO
18
+ attr_accessor :token
19
+
20
+ attr_accessor :password
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'token' => :'token',
26
+ :'password' => :'password'
27
+ }
28
+ end
29
+
30
+ # Returns all the JSON keys this model knows about
31
+ def self.acceptable_attributes
32
+ attribute_map.values
33
+ end
34
+
35
+ # Attribute type mapping.
36
+ def self.openapi_types
37
+ {
38
+ :'token' => :'String',
39
+ :'password' => :'String'
40
+ }
41
+ end
42
+
43
+ # List of attributes with nullable: true
44
+ def self.openapi_nullable
45
+ Set.new([
46
+ ])
47
+ end
48
+
49
+ # Initializes the object
50
+ # @param [Hash] attributes Model attributes in the form of hash
51
+ def initialize(attributes = {})
52
+ if (!attributes.is_a?(Hash))
53
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MusicubeApiClientRuby::UpdatePasswordDTO` initialize method"
54
+ end
55
+
56
+ # check to see if the attribute exists and convert string to symbol for hash key
57
+ attributes = attributes.each_with_object({}) { |(k, v), h|
58
+ if (!self.class.attribute_map.key?(k.to_sym))
59
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MusicubeApiClientRuby::UpdatePasswordDTO`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
60
+ end
61
+ h[k.to_sym] = v
62
+ }
63
+
64
+ if attributes.key?(:'token')
65
+ self.token = attributes[:'token']
66
+ end
67
+
68
+ if attributes.key?(:'password')
69
+ self.password = attributes[:'password']
70
+ end
71
+ end
72
+
73
+ # Show invalid properties with the reasons. Usually used together with valid?
74
+ # @return Array for valid properties with the reasons
75
+ def list_invalid_properties
76
+ invalid_properties = Array.new
77
+ if @token.nil?
78
+ invalid_properties.push('invalid value for "token", token cannot be nil.')
79
+ end
80
+
81
+ if @password.nil?
82
+ invalid_properties.push('invalid value for "password", password cannot be nil.')
83
+ end
84
+
85
+ invalid_properties
86
+ end
87
+
88
+ # Check to see if the all the properties in the model are valid
89
+ # @return true if the model is valid
90
+ def valid?
91
+ return false if @token.nil?
92
+ return false if @password.nil?
93
+ true
94
+ end
95
+
96
+ # Checks equality by comparing each attribute.
97
+ # @param [Object] Object to be compared
98
+ def ==(o)
99
+ return true if self.equal?(o)
100
+ self.class == o.class &&
101
+ token == o.token &&
102
+ password == o.password
103
+ end
104
+
105
+ # @see the `==` method
106
+ # @param [Object] Object to be compared
107
+ def eql?(o)
108
+ self == o
109
+ end
110
+
111
+ # Calculates hash code according to all attributes.
112
+ # @return [Integer] Hash code
113
+ def hash
114
+ [token, password].hash
115
+ end
116
+
117
+ # Builds the object from hash
118
+ # @param [Hash] attributes Model attributes in the form of hash
119
+ # @return [Object] Returns the model itself
120
+ def self.build_from_hash(attributes)
121
+ new.build_from_hash(attributes)
122
+ end
123
+
124
+ # Builds the object from hash
125
+ # @param [Hash] attributes Model attributes in the form of hash
126
+ # @return [Object] Returns the model itself
127
+ def build_from_hash(attributes)
128
+ return nil unless attributes.is_a?(Hash)
129
+ attributes = attributes.transform_keys(&:to_sym)
130
+ self.class.openapi_types.each_pair do |key, type|
131
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
132
+ self.send("#{key}=", nil)
133
+ elsif type =~ /\AArray<(.*)>/i
134
+ # check to ensure the input is an array given that the attribute
135
+ # is documented as an array but the input is not
136
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
137
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
138
+ end
139
+ elsif !attributes[self.class.attribute_map[key]].nil?
140
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
141
+ end
142
+ end
143
+
144
+ self
145
+ end
146
+
147
+ # Deserializes the data based on type
148
+ # @param string type Data type
149
+ # @param string value Value to be deserialized
150
+ # @return [Object] Deserialized data
151
+ def _deserialize(type, value)
152
+ case type.to_sym
153
+ when :Time
154
+ Time.parse(value)
155
+ when :Date
156
+ Date.parse(value)
157
+ when :String
158
+ value.to_s
159
+ when :Integer
160
+ value.to_i
161
+ when :Float
162
+ value.to_f
163
+ when :Boolean
164
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
165
+ true
166
+ else
167
+ false
168
+ end
169
+ when :Object
170
+ # generic object (usually a Hash), return directly
171
+ value
172
+ when /\AArray<(?<inner_type>.+)>\z/
173
+ inner_type = Regexp.last_match[:inner_type]
174
+ value.map { |v| _deserialize(inner_type, v) }
175
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
176
+ k_type = Regexp.last_match[:k_type]
177
+ v_type = Regexp.last_match[:v_type]
178
+ {}.tap do |hash|
179
+ value.each do |k, v|
180
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
181
+ end
182
+ end
183
+ else # model
184
+ # models (e.g. Pet) or oneOf
185
+ klass = MusicubeApiClientRuby.const_get(type)
186
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
187
+ end
188
+ end
189
+
190
+ # Returns the string representation of the object
191
+ # @return [String] String presentation of the object
192
+ def to_s
193
+ to_hash.to_s
194
+ end
195
+
196
+ # to_body is an alias to to_hash (backward compatibility)
197
+ # @return [Hash] Returns the object in the form of hash
198
+ def to_body
199
+ to_hash
200
+ end
201
+
202
+ # Returns the object in the form of hash
203
+ # @return [Hash] Returns the object in the form of hash
204
+ def to_hash
205
+ hash = {}
206
+ self.class.attribute_map.each_pair do |attr, param|
207
+ value = self.send(attr)
208
+ if value.nil?
209
+ is_nullable = self.class.openapi_nullable.include?(attr)
210
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
211
+ end
212
+
213
+ hash[param] = _to_hash(value)
214
+ end
215
+ hash
216
+ end
217
+
218
+ # Outputs non-array value in the form of hash
219
+ # For object, use to_hash. Otherwise, just return the value
220
+ # @param [Object] value Any valid value
221
+ # @return [Hash] Returns the value in the form of hash
222
+ def _to_hash(value)
223
+ if value.is_a?(Array)
224
+ value.compact.map { |v| _to_hash(v) }
225
+ elsif value.is_a?(Hash)
226
+ {}.tap do |hash|
227
+ value.each { |k, v| hash[k] = _to_hash(v) }
228
+ end
229
+ elsif value.respond_to? :to_hash
230
+ value.to_hash
231
+ else
232
+ value
233
+ end
234
+ end
235
+
236
+ end
237
+
238
+ end
@@ -0,0 +1,220 @@
1
+ =begin
2
+ #Songtradr API
3
+
4
+ #This is the Songtradr API. Use it to retrieve deep music metadata and trigger processes like auto-tagging. You can also use the API to manage your account and musicube cloud data. **Authentication** 1. Reach out to support@songtradr.com to receive a free account or use your login data if you are already signed up. 2. To authenticate, you need to login via the POST /api/v1/user/login endpoint. 3. The endpoint responds with a jwtToken which you can use in all following API requests as a bearer token. **Rate Limiting** The current limit is 120 Requests per minute. Reach out to us via support@songtradr.com if you need to request more. **Getting Started with auto-tagging** 1. If you want to get your own files auto-tagged, use the POST /api/v1/user/file/{name}/initUpload endpoint. It responds with a presigned S3 link where you can upload your file. 2. You can check the processing status of your file via the GET /api/v1/user/file/{name}/filesStatus endpoint. 3. As soon as processing is done, you can request the generated data via the GET /api/v1/user/files endpoint. **Getting Started with search** You can either search the released music via the /public/recording endpoints or your own private uploaded music via the /user/file/ endpoints. 1. If you want to search the world's released music, a good starting point is the GET /api/v1/public/recording/search endpoint. Please find the extensive list of parameters that serve as semantic search filters. 2. If you want to search your own previously uploaded music, a good starting point is the GET GET /api/v1/user/files endpoint. It has the same extensive list of parameters that serve as semantic search filters.
5
+
6
+ The version of the OpenAPI document: 1.12.21
7
+ Contact: info@songtradr.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.6.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module MusicubeApiClientRuby
17
+ # Details on a track's or playlist's usage permissions.
18
+ class UsageDTO
19
+ attr_accessor :name
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'name' => :'name'
25
+ }
26
+ end
27
+
28
+ # Returns all the JSON keys this model knows about
29
+ def self.acceptable_attributes
30
+ attribute_map.values
31
+ end
32
+
33
+ # Attribute type mapping.
34
+ def self.openapi_types
35
+ {
36
+ :'name' => :'String'
37
+ }
38
+ end
39
+
40
+ # List of attributes with nullable: true
41
+ def self.openapi_nullable
42
+ Set.new([
43
+ ])
44
+ end
45
+
46
+ # Initializes the object
47
+ # @param [Hash] attributes Model attributes in the form of hash
48
+ def initialize(attributes = {})
49
+ if (!attributes.is_a?(Hash))
50
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MusicubeApiClientRuby::UsageDTO` initialize method"
51
+ end
52
+
53
+ # check to see if the attribute exists and convert string to symbol for hash key
54
+ attributes = attributes.each_with_object({}) { |(k, v), h|
55
+ if (!self.class.attribute_map.key?(k.to_sym))
56
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MusicubeApiClientRuby::UsageDTO`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
57
+ end
58
+ h[k.to_sym] = v
59
+ }
60
+
61
+ if attributes.key?(:'name')
62
+ self.name = attributes[:'name']
63
+ end
64
+ end
65
+
66
+ # Show invalid properties with the reasons. Usually used together with valid?
67
+ # @return Array for valid properties with the reasons
68
+ def list_invalid_properties
69
+ invalid_properties = Array.new
70
+ invalid_properties
71
+ end
72
+
73
+ # Check to see if the all the properties in the model are valid
74
+ # @return true if the model is valid
75
+ def valid?
76
+ true
77
+ end
78
+
79
+ # Checks equality by comparing each attribute.
80
+ # @param [Object] Object to be compared
81
+ def ==(o)
82
+ return true if self.equal?(o)
83
+ self.class == o.class &&
84
+ name == o.name
85
+ end
86
+
87
+ # @see the `==` method
88
+ # @param [Object] Object to be compared
89
+ def eql?(o)
90
+ self == o
91
+ end
92
+
93
+ # Calculates hash code according to all attributes.
94
+ # @return [Integer] Hash code
95
+ def hash
96
+ [name].hash
97
+ end
98
+
99
+ # Builds the object from hash
100
+ # @param [Hash] attributes Model attributes in the form of hash
101
+ # @return [Object] Returns the model itself
102
+ def self.build_from_hash(attributes)
103
+ new.build_from_hash(attributes)
104
+ end
105
+
106
+ # Builds the object from hash
107
+ # @param [Hash] attributes Model attributes in the form of hash
108
+ # @return [Object] Returns the model itself
109
+ def build_from_hash(attributes)
110
+ return nil unless attributes.is_a?(Hash)
111
+ attributes = attributes.transform_keys(&:to_sym)
112
+ self.class.openapi_types.each_pair do |key, type|
113
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
114
+ self.send("#{key}=", nil)
115
+ elsif type =~ /\AArray<(.*)>/i
116
+ # check to ensure the input is an array given that the attribute
117
+ # is documented as an array but the input is not
118
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
119
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
120
+ end
121
+ elsif !attributes[self.class.attribute_map[key]].nil?
122
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
123
+ end
124
+ end
125
+
126
+ self
127
+ end
128
+
129
+ # Deserializes the data based on type
130
+ # @param string type Data type
131
+ # @param string value Value to be deserialized
132
+ # @return [Object] Deserialized data
133
+ def _deserialize(type, value)
134
+ case type.to_sym
135
+ when :Time
136
+ Time.parse(value)
137
+ when :Date
138
+ Date.parse(value)
139
+ when :String
140
+ value.to_s
141
+ when :Integer
142
+ value.to_i
143
+ when :Float
144
+ value.to_f
145
+ when :Boolean
146
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
147
+ true
148
+ else
149
+ false
150
+ end
151
+ when :Object
152
+ # generic object (usually a Hash), return directly
153
+ value
154
+ when /\AArray<(?<inner_type>.+)>\z/
155
+ inner_type = Regexp.last_match[:inner_type]
156
+ value.map { |v| _deserialize(inner_type, v) }
157
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
158
+ k_type = Regexp.last_match[:k_type]
159
+ v_type = Regexp.last_match[:v_type]
160
+ {}.tap do |hash|
161
+ value.each do |k, v|
162
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
163
+ end
164
+ end
165
+ else # model
166
+ # models (e.g. Pet) or oneOf
167
+ klass = MusicubeApiClientRuby.const_get(type)
168
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
169
+ end
170
+ end
171
+
172
+ # Returns the string representation of the object
173
+ # @return [String] String presentation of the object
174
+ def to_s
175
+ to_hash.to_s
176
+ end
177
+
178
+ # to_body is an alias to to_hash (backward compatibility)
179
+ # @return [Hash] Returns the object in the form of hash
180
+ def to_body
181
+ to_hash
182
+ end
183
+
184
+ # Returns the object in the form of hash
185
+ # @return [Hash] Returns the object in the form of hash
186
+ def to_hash
187
+ hash = {}
188
+ self.class.attribute_map.each_pair do |attr, param|
189
+ value = self.send(attr)
190
+ if value.nil?
191
+ is_nullable = self.class.openapi_nullable.include?(attr)
192
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
193
+ end
194
+
195
+ hash[param] = _to_hash(value)
196
+ end
197
+ hash
198
+ end
199
+
200
+ # Outputs non-array value in the form of hash
201
+ # For object, use to_hash. Otherwise, just return the value
202
+ # @param [Object] value Any valid value
203
+ # @return [Hash] Returns the value in the form of hash
204
+ def _to_hash(value)
205
+ if value.is_a?(Array)
206
+ value.compact.map { |v| _to_hash(v) }
207
+ elsif value.is_a?(Hash)
208
+ {}.tap do |hash|
209
+ value.each { |k, v| hash[k] = _to_hash(v) }
210
+ end
211
+ elsif value.respond_to? :to_hash
212
+ value.to_hash
213
+ else
214
+ value
215
+ end
216
+ end
217
+
218
+ end
219
+
220
+ end