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,267 @@
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 ForgotPasswordDTO
18
+ attr_accessor :email_or_username
19
+
20
+ attr_accessor :system
21
+
22
+ class EnumAttributeValidator
23
+ attr_reader :datatype
24
+ attr_reader :allowable_values
25
+
26
+ def initialize(datatype, allowable_values)
27
+ @allowable_values = allowable_values.map do |value|
28
+ case datatype.to_s
29
+ when /Integer/i
30
+ value.to_i
31
+ when /Float/i
32
+ value.to_f
33
+ else
34
+ value
35
+ end
36
+ end
37
+ end
38
+
39
+ def valid?(value)
40
+ !value || allowable_values.include?(value)
41
+ end
42
+ end
43
+
44
+ # Attribute mapping from ruby-style variable name to JSON key.
45
+ def self.attribute_map
46
+ {
47
+ :'email_or_username' => :'emailOrUsername',
48
+ :'system' => :'system'
49
+ }
50
+ end
51
+
52
+ # Returns all the JSON keys this model knows about
53
+ def self.acceptable_attributes
54
+ attribute_map.values
55
+ end
56
+
57
+ # Attribute type mapping.
58
+ def self.openapi_types
59
+ {
60
+ :'email_or_username' => :'String',
61
+ :'system' => :'String'
62
+ }
63
+ end
64
+
65
+ # List of attributes with nullable: true
66
+ def self.openapi_nullable
67
+ Set.new([
68
+ ])
69
+ end
70
+
71
+ # Initializes the object
72
+ # @param [Hash] attributes Model attributes in the form of hash
73
+ def initialize(attributes = {})
74
+ if (!attributes.is_a?(Hash))
75
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MusicubeApiClientRuby::ForgotPasswordDTO` initialize method"
76
+ end
77
+
78
+ # check to see if the attribute exists and convert string to symbol for hash key
79
+ attributes = attributes.each_with_object({}) { |(k, v), h|
80
+ if (!self.class.attribute_map.key?(k.to_sym))
81
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MusicubeApiClientRuby::ForgotPasswordDTO`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
82
+ end
83
+ h[k.to_sym] = v
84
+ }
85
+
86
+ if attributes.key?(:'email_or_username')
87
+ self.email_or_username = attributes[:'email_or_username']
88
+ end
89
+
90
+ if attributes.key?(:'system')
91
+ self.system = attributes[:'system']
92
+ end
93
+ end
94
+
95
+ # Show invalid properties with the reasons. Usually used together with valid?
96
+ # @return Array for valid properties with the reasons
97
+ def list_invalid_properties
98
+ invalid_properties = Array.new
99
+ if @email_or_username.nil?
100
+ invalid_properties.push('invalid value for "email_or_username", email_or_username cannot be nil.')
101
+ end
102
+
103
+ invalid_properties
104
+ end
105
+
106
+ # Check to see if the all the properties in the model are valid
107
+ # @return true if the model is valid
108
+ def valid?
109
+ return false if @email_or_username.nil?
110
+ system_validator = EnumAttributeValidator.new('String', ["musicube", "cloud"])
111
+ return false unless system_validator.valid?(@system)
112
+ true
113
+ end
114
+
115
+ # Custom attribute writer method checking allowed values (enum).
116
+ # @param [Object] system Object to be assigned
117
+ def system=(system)
118
+ validator = EnumAttributeValidator.new('String', ["musicube", "cloud"])
119
+ unless validator.valid?(system)
120
+ fail ArgumentError, "invalid value for \"system\", must be one of #{validator.allowable_values}."
121
+ end
122
+ @system = system
123
+ end
124
+
125
+ # Checks equality by comparing each attribute.
126
+ # @param [Object] Object to be compared
127
+ def ==(o)
128
+ return true if self.equal?(o)
129
+ self.class == o.class &&
130
+ email_or_username == o.email_or_username &&
131
+ system == o.system
132
+ end
133
+
134
+ # @see the `==` method
135
+ # @param [Object] Object to be compared
136
+ def eql?(o)
137
+ self == o
138
+ end
139
+
140
+ # Calculates hash code according to all attributes.
141
+ # @return [Integer] Hash code
142
+ def hash
143
+ [email_or_username, system].hash
144
+ end
145
+
146
+ # Builds the object from hash
147
+ # @param [Hash] attributes Model attributes in the form of hash
148
+ # @return [Object] Returns the model itself
149
+ def self.build_from_hash(attributes)
150
+ new.build_from_hash(attributes)
151
+ end
152
+
153
+ # Builds the object from hash
154
+ # @param [Hash] attributes Model attributes in the form of hash
155
+ # @return [Object] Returns the model itself
156
+ def build_from_hash(attributes)
157
+ return nil unless attributes.is_a?(Hash)
158
+ attributes = attributes.transform_keys(&:to_sym)
159
+ self.class.openapi_types.each_pair do |key, type|
160
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
161
+ self.send("#{key}=", nil)
162
+ elsif type =~ /\AArray<(.*)>/i
163
+ # check to ensure the input is an array given that the attribute
164
+ # is documented as an array but the input is not
165
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
166
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
167
+ end
168
+ elsif !attributes[self.class.attribute_map[key]].nil?
169
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
170
+ end
171
+ end
172
+
173
+ self
174
+ end
175
+
176
+ # Deserializes the data based on type
177
+ # @param string type Data type
178
+ # @param string value Value to be deserialized
179
+ # @return [Object] Deserialized data
180
+ def _deserialize(type, value)
181
+ case type.to_sym
182
+ when :Time
183
+ Time.parse(value)
184
+ when :Date
185
+ Date.parse(value)
186
+ when :String
187
+ value.to_s
188
+ when :Integer
189
+ value.to_i
190
+ when :Float
191
+ value.to_f
192
+ when :Boolean
193
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
194
+ true
195
+ else
196
+ false
197
+ end
198
+ when :Object
199
+ # generic object (usually a Hash), return directly
200
+ value
201
+ when /\AArray<(?<inner_type>.+)>\z/
202
+ inner_type = Regexp.last_match[:inner_type]
203
+ value.map { |v| _deserialize(inner_type, v) }
204
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
205
+ k_type = Regexp.last_match[:k_type]
206
+ v_type = Regexp.last_match[:v_type]
207
+ {}.tap do |hash|
208
+ value.each do |k, v|
209
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
210
+ end
211
+ end
212
+ else # model
213
+ # models (e.g. Pet) or oneOf
214
+ klass = MusicubeApiClientRuby.const_get(type)
215
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
216
+ end
217
+ end
218
+
219
+ # Returns the string representation of the object
220
+ # @return [String] String presentation of the object
221
+ def to_s
222
+ to_hash.to_s
223
+ end
224
+
225
+ # to_body is an alias to to_hash (backward compatibility)
226
+ # @return [Hash] Returns the object in the form of hash
227
+ def to_body
228
+ to_hash
229
+ end
230
+
231
+ # Returns the object in the form of hash
232
+ # @return [Hash] Returns the object in the form of hash
233
+ def to_hash
234
+ hash = {}
235
+ self.class.attribute_map.each_pair do |attr, param|
236
+ value = self.send(attr)
237
+ if value.nil?
238
+ is_nullable = self.class.openapi_nullable.include?(attr)
239
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
240
+ end
241
+
242
+ hash[param] = _to_hash(value)
243
+ end
244
+ hash
245
+ end
246
+
247
+ # Outputs non-array value in the form of hash
248
+ # For object, use to_hash. Otherwise, just return the value
249
+ # @param [Object] value Any valid value
250
+ # @return [Hash] Returns the value in the form of hash
251
+ def _to_hash(value)
252
+ if value.is_a?(Array)
253
+ value.compact.map { |v| _to_hash(v) }
254
+ elsif value.is_a?(Hash)
255
+ {}.tap do |hash|
256
+ value.each { |k, v| hash[k] = _to_hash(v) }
257
+ end
258
+ elsif value.respond_to? :to_hash
259
+ value.to_hash
260
+ else
261
+ value
262
+ end
263
+ end
264
+
265
+ end
266
+
267
+ end
@@ -0,0 +1,239 @@
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
+ # Genre including its sub-genres.
18
+ class GenreDTO
19
+ attr_accessor :id
20
+
21
+ attr_accessor :name
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'id' => :'id',
27
+ :'name' => :'name'
28
+ }
29
+ end
30
+
31
+ # Returns all the JSON keys this model knows about
32
+ def self.acceptable_attributes
33
+ attribute_map.values
34
+ end
35
+
36
+ # Attribute type mapping.
37
+ def self.openapi_types
38
+ {
39
+ :'id' => :'Integer',
40
+ :'name' => :'String'
41
+ }
42
+ end
43
+
44
+ # List of attributes with nullable: true
45
+ def self.openapi_nullable
46
+ Set.new([
47
+ ])
48
+ end
49
+
50
+ # Initializes the object
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ def initialize(attributes = {})
53
+ if (!attributes.is_a?(Hash))
54
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MusicubeApiClientRuby::GenreDTO` initialize method"
55
+ end
56
+
57
+ # check to see if the attribute exists and convert string to symbol for hash key
58
+ attributes = attributes.each_with_object({}) { |(k, v), h|
59
+ if (!self.class.attribute_map.key?(k.to_sym))
60
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MusicubeApiClientRuby::GenreDTO`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
61
+ end
62
+ h[k.to_sym] = v
63
+ }
64
+
65
+ if attributes.key?(:'id')
66
+ self.id = attributes[:'id']
67
+ end
68
+
69
+ if attributes.key?(:'name')
70
+ self.name = attributes[:'name']
71
+ end
72
+ end
73
+
74
+ # Show invalid properties with the reasons. Usually used together with valid?
75
+ # @return Array for valid properties with the reasons
76
+ def list_invalid_properties
77
+ invalid_properties = Array.new
78
+ if @id.nil?
79
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
80
+ end
81
+
82
+ if @name.nil?
83
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
84
+ end
85
+
86
+ invalid_properties
87
+ end
88
+
89
+ # Check to see if the all the properties in the model are valid
90
+ # @return true if the model is valid
91
+ def valid?
92
+ return false if @id.nil?
93
+ return false if @name.nil?
94
+ true
95
+ end
96
+
97
+ # Checks equality by comparing each attribute.
98
+ # @param [Object] Object to be compared
99
+ def ==(o)
100
+ return true if self.equal?(o)
101
+ self.class == o.class &&
102
+ id == o.id &&
103
+ name == o.name
104
+ end
105
+
106
+ # @see the `==` method
107
+ # @param [Object] Object to be compared
108
+ def eql?(o)
109
+ self == o
110
+ end
111
+
112
+ # Calculates hash code according to all attributes.
113
+ # @return [Integer] Hash code
114
+ def hash
115
+ [id, name].hash
116
+ end
117
+
118
+ # Builds the object from hash
119
+ # @param [Hash] attributes Model attributes in the form of hash
120
+ # @return [Object] Returns the model itself
121
+ def self.build_from_hash(attributes)
122
+ new.build_from_hash(attributes)
123
+ end
124
+
125
+ # Builds the object from hash
126
+ # @param [Hash] attributes Model attributes in the form of hash
127
+ # @return [Object] Returns the model itself
128
+ def build_from_hash(attributes)
129
+ return nil unless attributes.is_a?(Hash)
130
+ attributes = attributes.transform_keys(&:to_sym)
131
+ self.class.openapi_types.each_pair do |key, type|
132
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
133
+ self.send("#{key}=", nil)
134
+ elsif type =~ /\AArray<(.*)>/i
135
+ # check to ensure the input is an array given that the attribute
136
+ # is documented as an array but the input is not
137
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
138
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
139
+ end
140
+ elsif !attributes[self.class.attribute_map[key]].nil?
141
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
142
+ end
143
+ end
144
+
145
+ self
146
+ end
147
+
148
+ # Deserializes the data based on type
149
+ # @param string type Data type
150
+ # @param string value Value to be deserialized
151
+ # @return [Object] Deserialized data
152
+ def _deserialize(type, value)
153
+ case type.to_sym
154
+ when :Time
155
+ Time.parse(value)
156
+ when :Date
157
+ Date.parse(value)
158
+ when :String
159
+ value.to_s
160
+ when :Integer
161
+ value.to_i
162
+ when :Float
163
+ value.to_f
164
+ when :Boolean
165
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
166
+ true
167
+ else
168
+ false
169
+ end
170
+ when :Object
171
+ # generic object (usually a Hash), return directly
172
+ value
173
+ when /\AArray<(?<inner_type>.+)>\z/
174
+ inner_type = Regexp.last_match[:inner_type]
175
+ value.map { |v| _deserialize(inner_type, v) }
176
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
177
+ k_type = Regexp.last_match[:k_type]
178
+ v_type = Regexp.last_match[:v_type]
179
+ {}.tap do |hash|
180
+ value.each do |k, v|
181
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
182
+ end
183
+ end
184
+ else # model
185
+ # models (e.g. Pet) or oneOf
186
+ klass = MusicubeApiClientRuby.const_get(type)
187
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
188
+ end
189
+ end
190
+
191
+ # Returns the string representation of the object
192
+ # @return [String] String presentation of the object
193
+ def to_s
194
+ to_hash.to_s
195
+ end
196
+
197
+ # to_body is an alias to to_hash (backward compatibility)
198
+ # @return [Hash] Returns the object in the form of hash
199
+ def to_body
200
+ to_hash
201
+ end
202
+
203
+ # Returns the object in the form of hash
204
+ # @return [Hash] Returns the object in the form of hash
205
+ def to_hash
206
+ hash = {}
207
+ self.class.attribute_map.each_pair do |attr, param|
208
+ value = self.send(attr)
209
+ if value.nil?
210
+ is_nullable = self.class.openapi_nullable.include?(attr)
211
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
212
+ end
213
+
214
+ hash[param] = _to_hash(value)
215
+ end
216
+ hash
217
+ end
218
+
219
+ # Outputs non-array value in the form of hash
220
+ # For object, use to_hash. Otherwise, just return the value
221
+ # @param [Object] value Any valid value
222
+ # @return [Hash] Returns the value in the form of hash
223
+ def _to_hash(value)
224
+ if value.is_a?(Array)
225
+ value.compact.map { |v| _to_hash(v) }
226
+ elsif value.is_a?(Hash)
227
+ {}.tap do |hash|
228
+ value.each { |k, v| hash[k] = _to_hash(v) }
229
+ end
230
+ elsif value.respond_to? :to_hash
231
+ value.to_hash
232
+ else
233
+ value
234
+ end
235
+ end
236
+
237
+ end
238
+
239
+ end