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,574 @@
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
+ # Timeseries of tags.
18
+ class SaveTaggramsDTO
19
+ attr_accessor :timestamps
20
+
21
+ attr_accessor :level1_genre
22
+
23
+ attr_accessor :level2_genre
24
+
25
+ attr_accessor :song_rating
26
+
27
+ attr_accessor :performance_rating
28
+
29
+ attr_accessor :production_rating
30
+
31
+ attr_accessor :mood_cluster
32
+
33
+ attr_accessor :vocals
34
+
35
+ attr_accessor :dominant_instrument
36
+
37
+ attr_accessor :sound_generation
38
+
39
+ attr_accessor :rhythm
40
+
41
+ attr_accessor :tonality
42
+
43
+ attr_accessor :audience_age
44
+
45
+ attr_accessor :audience_gender
46
+
47
+ attr_accessor :audience_region
48
+
49
+ attr_accessor :origin_region
50
+
51
+ attr_accessor :origin_decade
52
+
53
+ attr_accessor :language_of_performance
54
+
55
+ attr_accessor :arousal
56
+
57
+ attr_accessor :valence
58
+
59
+ attr_accessor :pleasantness
60
+
61
+ attr_accessor :engagement
62
+
63
+ attr_accessor :energy
64
+
65
+ attr_accessor :timbre
66
+
67
+ attr_accessor :roughness
68
+
69
+ attr_accessor :harmony
70
+
71
+ attr_accessor :texture
72
+
73
+ attr_accessor :groovyness
74
+
75
+ attr_accessor :space
76
+
77
+ attr_accessor :curateability
78
+
79
+ attr_accessor :use_case
80
+
81
+ attr_accessor :social_media
82
+
83
+ attr_accessor :industry_suitability
84
+
85
+ # Attribute mapping from ruby-style variable name to JSON key.
86
+ def self.attribute_map
87
+ {
88
+ :'timestamps' => :'timestamps',
89
+ :'level1_genre' => :'level1Genre',
90
+ :'level2_genre' => :'level2Genre',
91
+ :'song_rating' => :'songRating',
92
+ :'performance_rating' => :'performanceRating',
93
+ :'production_rating' => :'productionRating',
94
+ :'mood_cluster' => :'moodCluster',
95
+ :'vocals' => :'vocals',
96
+ :'dominant_instrument' => :'dominantInstrument',
97
+ :'sound_generation' => :'soundGeneration',
98
+ :'rhythm' => :'rhythm',
99
+ :'tonality' => :'tonality',
100
+ :'audience_age' => :'audienceAge',
101
+ :'audience_gender' => :'audienceGender',
102
+ :'audience_region' => :'audienceRegion',
103
+ :'origin_region' => :'originRegion',
104
+ :'origin_decade' => :'originDecade',
105
+ :'language_of_performance' => :'languageOfPerformance',
106
+ :'arousal' => :'arousal',
107
+ :'valence' => :'valence',
108
+ :'pleasantness' => :'pleasantness',
109
+ :'engagement' => :'engagement',
110
+ :'energy' => :'energy',
111
+ :'timbre' => :'timbre',
112
+ :'roughness' => :'roughness',
113
+ :'harmony' => :'harmony',
114
+ :'texture' => :'texture',
115
+ :'groovyness' => :'groovyness',
116
+ :'space' => :'space',
117
+ :'curateability' => :'curateability',
118
+ :'use_case' => :'useCase',
119
+ :'social_media' => :'socialMedia',
120
+ :'industry_suitability' => :'industrySuitability'
121
+ }
122
+ end
123
+
124
+ # Returns all the JSON keys this model knows about
125
+ def self.acceptable_attributes
126
+ attribute_map.values
127
+ end
128
+
129
+ # Attribute type mapping.
130
+ def self.openapi_types
131
+ {
132
+ :'timestamps' => :'Array<Float>',
133
+ :'level1_genre' => :'Hash<String, Array<Float>>',
134
+ :'level2_genre' => :'Hash<String, Array<Float>>',
135
+ :'song_rating' => :'Hash<String, Array<Float>>',
136
+ :'performance_rating' => :'Hash<String, Array<Float>>',
137
+ :'production_rating' => :'Hash<String, Array<Float>>',
138
+ :'mood_cluster' => :'Hash<String, Array<Float>>',
139
+ :'vocals' => :'Hash<String, Array<Float>>',
140
+ :'dominant_instrument' => :'Hash<String, Array<Float>>',
141
+ :'sound_generation' => :'Hash<String, Array<Float>>',
142
+ :'rhythm' => :'Hash<String, Array<Float>>',
143
+ :'tonality' => :'Hash<String, Array<Float>>',
144
+ :'audience_age' => :'Hash<String, Array<Float>>',
145
+ :'audience_gender' => :'Hash<String, Array<Float>>',
146
+ :'audience_region' => :'Hash<String, Array<Float>>',
147
+ :'origin_region' => :'Hash<String, Array<Float>>',
148
+ :'origin_decade' => :'Hash<String, Array<Float>>',
149
+ :'language_of_performance' => :'Hash<String, Array<Float>>',
150
+ :'arousal' => :'Hash<String, Array<Float>>',
151
+ :'valence' => :'Hash<String, Array<Float>>',
152
+ :'pleasantness' => :'Hash<String, Array<Float>>',
153
+ :'engagement' => :'Hash<String, Array<Float>>',
154
+ :'energy' => :'Hash<String, Array<Float>>',
155
+ :'timbre' => :'Hash<String, Array<Float>>',
156
+ :'roughness' => :'Hash<String, Array<Float>>',
157
+ :'harmony' => :'Hash<String, Array<Float>>',
158
+ :'texture' => :'Hash<String, Array<Float>>',
159
+ :'groovyness' => :'Hash<String, Array<Float>>',
160
+ :'space' => :'Hash<String, Array<Float>>',
161
+ :'curateability' => :'Hash<String, Array<Float>>',
162
+ :'use_case' => :'Hash<String, Array<Float>>',
163
+ :'social_media' => :'Hash<String, Array<Float>>',
164
+ :'industry_suitability' => :'Hash<String, Array<Float>>'
165
+ }
166
+ end
167
+
168
+ # List of attributes with nullable: true
169
+ def self.openapi_nullable
170
+ Set.new([
171
+ ])
172
+ end
173
+
174
+ # Initializes the object
175
+ # @param [Hash] attributes Model attributes in the form of hash
176
+ def initialize(attributes = {})
177
+ if (!attributes.is_a?(Hash))
178
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MusicubeApiClientRuby::SaveTaggramsDTO` initialize method"
179
+ end
180
+
181
+ # check to see if the attribute exists and convert string to symbol for hash key
182
+ attributes = attributes.each_with_object({}) { |(k, v), h|
183
+ if (!self.class.attribute_map.key?(k.to_sym))
184
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MusicubeApiClientRuby::SaveTaggramsDTO`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
185
+ end
186
+ h[k.to_sym] = v
187
+ }
188
+
189
+ if attributes.key?(:'timestamps')
190
+ if (value = attributes[:'timestamps']).is_a?(Array)
191
+ self.timestamps = value
192
+ end
193
+ end
194
+
195
+ if attributes.key?(:'level1_genre')
196
+ if (value = attributes[:'level1_genre']).is_a?(Hash)
197
+ self.level1_genre = value
198
+ end
199
+ end
200
+
201
+ if attributes.key?(:'level2_genre')
202
+ if (value = attributes[:'level2_genre']).is_a?(Hash)
203
+ self.level2_genre = value
204
+ end
205
+ end
206
+
207
+ if attributes.key?(:'song_rating')
208
+ if (value = attributes[:'song_rating']).is_a?(Hash)
209
+ self.song_rating = value
210
+ end
211
+ end
212
+
213
+ if attributes.key?(:'performance_rating')
214
+ if (value = attributes[:'performance_rating']).is_a?(Hash)
215
+ self.performance_rating = value
216
+ end
217
+ end
218
+
219
+ if attributes.key?(:'production_rating')
220
+ if (value = attributes[:'production_rating']).is_a?(Hash)
221
+ self.production_rating = value
222
+ end
223
+ end
224
+
225
+ if attributes.key?(:'mood_cluster')
226
+ if (value = attributes[:'mood_cluster']).is_a?(Hash)
227
+ self.mood_cluster = value
228
+ end
229
+ end
230
+
231
+ if attributes.key?(:'vocals')
232
+ if (value = attributes[:'vocals']).is_a?(Hash)
233
+ self.vocals = value
234
+ end
235
+ end
236
+
237
+ if attributes.key?(:'dominant_instrument')
238
+ if (value = attributes[:'dominant_instrument']).is_a?(Hash)
239
+ self.dominant_instrument = value
240
+ end
241
+ end
242
+
243
+ if attributes.key?(:'sound_generation')
244
+ if (value = attributes[:'sound_generation']).is_a?(Hash)
245
+ self.sound_generation = value
246
+ end
247
+ end
248
+
249
+ if attributes.key?(:'rhythm')
250
+ if (value = attributes[:'rhythm']).is_a?(Hash)
251
+ self.rhythm = value
252
+ end
253
+ end
254
+
255
+ if attributes.key?(:'tonality')
256
+ if (value = attributes[:'tonality']).is_a?(Hash)
257
+ self.tonality = value
258
+ end
259
+ end
260
+
261
+ if attributes.key?(:'audience_age')
262
+ if (value = attributes[:'audience_age']).is_a?(Hash)
263
+ self.audience_age = value
264
+ end
265
+ end
266
+
267
+ if attributes.key?(:'audience_gender')
268
+ if (value = attributes[:'audience_gender']).is_a?(Hash)
269
+ self.audience_gender = value
270
+ end
271
+ end
272
+
273
+ if attributes.key?(:'audience_region')
274
+ if (value = attributes[:'audience_region']).is_a?(Hash)
275
+ self.audience_region = value
276
+ end
277
+ end
278
+
279
+ if attributes.key?(:'origin_region')
280
+ if (value = attributes[:'origin_region']).is_a?(Hash)
281
+ self.origin_region = value
282
+ end
283
+ end
284
+
285
+ if attributes.key?(:'origin_decade')
286
+ if (value = attributes[:'origin_decade']).is_a?(Hash)
287
+ self.origin_decade = value
288
+ end
289
+ end
290
+
291
+ if attributes.key?(:'language_of_performance')
292
+ if (value = attributes[:'language_of_performance']).is_a?(Hash)
293
+ self.language_of_performance = value
294
+ end
295
+ end
296
+
297
+ if attributes.key?(:'arousal')
298
+ if (value = attributes[:'arousal']).is_a?(Hash)
299
+ self.arousal = value
300
+ end
301
+ end
302
+
303
+ if attributes.key?(:'valence')
304
+ if (value = attributes[:'valence']).is_a?(Hash)
305
+ self.valence = value
306
+ end
307
+ end
308
+
309
+ if attributes.key?(:'pleasantness')
310
+ if (value = attributes[:'pleasantness']).is_a?(Hash)
311
+ self.pleasantness = value
312
+ end
313
+ end
314
+
315
+ if attributes.key?(:'engagement')
316
+ if (value = attributes[:'engagement']).is_a?(Hash)
317
+ self.engagement = value
318
+ end
319
+ end
320
+
321
+ if attributes.key?(:'energy')
322
+ if (value = attributes[:'energy']).is_a?(Hash)
323
+ self.energy = value
324
+ end
325
+ end
326
+
327
+ if attributes.key?(:'timbre')
328
+ if (value = attributes[:'timbre']).is_a?(Hash)
329
+ self.timbre = value
330
+ end
331
+ end
332
+
333
+ if attributes.key?(:'roughness')
334
+ if (value = attributes[:'roughness']).is_a?(Hash)
335
+ self.roughness = value
336
+ end
337
+ end
338
+
339
+ if attributes.key?(:'harmony')
340
+ if (value = attributes[:'harmony']).is_a?(Hash)
341
+ self.harmony = value
342
+ end
343
+ end
344
+
345
+ if attributes.key?(:'texture')
346
+ if (value = attributes[:'texture']).is_a?(Hash)
347
+ self.texture = value
348
+ end
349
+ end
350
+
351
+ if attributes.key?(:'groovyness')
352
+ if (value = attributes[:'groovyness']).is_a?(Hash)
353
+ self.groovyness = value
354
+ end
355
+ end
356
+
357
+ if attributes.key?(:'space')
358
+ if (value = attributes[:'space']).is_a?(Hash)
359
+ self.space = value
360
+ end
361
+ end
362
+
363
+ if attributes.key?(:'curateability')
364
+ if (value = attributes[:'curateability']).is_a?(Hash)
365
+ self.curateability = value
366
+ end
367
+ end
368
+
369
+ if attributes.key?(:'use_case')
370
+ if (value = attributes[:'use_case']).is_a?(Hash)
371
+ self.use_case = value
372
+ end
373
+ end
374
+
375
+ if attributes.key?(:'social_media')
376
+ if (value = attributes[:'social_media']).is_a?(Hash)
377
+ self.social_media = value
378
+ end
379
+ end
380
+
381
+ if attributes.key?(:'industry_suitability')
382
+ if (value = attributes[:'industry_suitability']).is_a?(Hash)
383
+ self.industry_suitability = value
384
+ end
385
+ end
386
+ end
387
+
388
+ # Show invalid properties with the reasons. Usually used together with valid?
389
+ # @return Array for valid properties with the reasons
390
+ def list_invalid_properties
391
+ invalid_properties = Array.new
392
+ invalid_properties
393
+ end
394
+
395
+ # Check to see if the all the properties in the model are valid
396
+ # @return true if the model is valid
397
+ def valid?
398
+ true
399
+ end
400
+
401
+ # Checks equality by comparing each attribute.
402
+ # @param [Object] Object to be compared
403
+ def ==(o)
404
+ return true if self.equal?(o)
405
+ self.class == o.class &&
406
+ timestamps == o.timestamps &&
407
+ level1_genre == o.level1_genre &&
408
+ level2_genre == o.level2_genre &&
409
+ song_rating == o.song_rating &&
410
+ performance_rating == o.performance_rating &&
411
+ production_rating == o.production_rating &&
412
+ mood_cluster == o.mood_cluster &&
413
+ vocals == o.vocals &&
414
+ dominant_instrument == o.dominant_instrument &&
415
+ sound_generation == o.sound_generation &&
416
+ rhythm == o.rhythm &&
417
+ tonality == o.tonality &&
418
+ audience_age == o.audience_age &&
419
+ audience_gender == o.audience_gender &&
420
+ audience_region == o.audience_region &&
421
+ origin_region == o.origin_region &&
422
+ origin_decade == o.origin_decade &&
423
+ language_of_performance == o.language_of_performance &&
424
+ arousal == o.arousal &&
425
+ valence == o.valence &&
426
+ pleasantness == o.pleasantness &&
427
+ engagement == o.engagement &&
428
+ energy == o.energy &&
429
+ timbre == o.timbre &&
430
+ roughness == o.roughness &&
431
+ harmony == o.harmony &&
432
+ texture == o.texture &&
433
+ groovyness == o.groovyness &&
434
+ space == o.space &&
435
+ curateability == o.curateability &&
436
+ use_case == o.use_case &&
437
+ social_media == o.social_media &&
438
+ industry_suitability == o.industry_suitability
439
+ end
440
+
441
+ # @see the `==` method
442
+ # @param [Object] Object to be compared
443
+ def eql?(o)
444
+ self == o
445
+ end
446
+
447
+ # Calculates hash code according to all attributes.
448
+ # @return [Integer] Hash code
449
+ def hash
450
+ [timestamps, level1_genre, level2_genre, song_rating, performance_rating, production_rating, mood_cluster, vocals, dominant_instrument, sound_generation, rhythm, tonality, audience_age, audience_gender, audience_region, origin_region, origin_decade, language_of_performance, arousal, valence, pleasantness, engagement, energy, timbre, roughness, harmony, texture, groovyness, space, curateability, use_case, social_media, industry_suitability].hash
451
+ end
452
+
453
+ # Builds the object from hash
454
+ # @param [Hash] attributes Model attributes in the form of hash
455
+ # @return [Object] Returns the model itself
456
+ def self.build_from_hash(attributes)
457
+ new.build_from_hash(attributes)
458
+ end
459
+
460
+ # Builds the object from hash
461
+ # @param [Hash] attributes Model attributes in the form of hash
462
+ # @return [Object] Returns the model itself
463
+ def build_from_hash(attributes)
464
+ return nil unless attributes.is_a?(Hash)
465
+ attributes = attributes.transform_keys(&:to_sym)
466
+ self.class.openapi_types.each_pair do |key, type|
467
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
468
+ self.send("#{key}=", nil)
469
+ elsif type =~ /\AArray<(.*)>/i
470
+ # check to ensure the input is an array given that the attribute
471
+ # is documented as an array but the input is not
472
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
473
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
474
+ end
475
+ elsif !attributes[self.class.attribute_map[key]].nil?
476
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
477
+ end
478
+ end
479
+
480
+ self
481
+ end
482
+
483
+ # Deserializes the data based on type
484
+ # @param string type Data type
485
+ # @param string value Value to be deserialized
486
+ # @return [Object] Deserialized data
487
+ def _deserialize(type, value)
488
+ case type.to_sym
489
+ when :Time
490
+ Time.parse(value)
491
+ when :Date
492
+ Date.parse(value)
493
+ when :String
494
+ value.to_s
495
+ when :Integer
496
+ value.to_i
497
+ when :Float
498
+ value.to_f
499
+ when :Boolean
500
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
501
+ true
502
+ else
503
+ false
504
+ end
505
+ when :Object
506
+ # generic object (usually a Hash), return directly
507
+ value
508
+ when /\AArray<(?<inner_type>.+)>\z/
509
+ inner_type = Regexp.last_match[:inner_type]
510
+ value.map { |v| _deserialize(inner_type, v) }
511
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
512
+ k_type = Regexp.last_match[:k_type]
513
+ v_type = Regexp.last_match[:v_type]
514
+ {}.tap do |hash|
515
+ value.each do |k, v|
516
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
517
+ end
518
+ end
519
+ else # model
520
+ # models (e.g. Pet) or oneOf
521
+ klass = MusicubeApiClientRuby.const_get(type)
522
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
523
+ end
524
+ end
525
+
526
+ # Returns the string representation of the object
527
+ # @return [String] String presentation of the object
528
+ def to_s
529
+ to_hash.to_s
530
+ end
531
+
532
+ # to_body is an alias to to_hash (backward compatibility)
533
+ # @return [Hash] Returns the object in the form of hash
534
+ def to_body
535
+ to_hash
536
+ end
537
+
538
+ # Returns the object in the form of hash
539
+ # @return [Hash] Returns the object in the form of hash
540
+ def to_hash
541
+ hash = {}
542
+ self.class.attribute_map.each_pair do |attr, param|
543
+ value = self.send(attr)
544
+ if value.nil?
545
+ is_nullable = self.class.openapi_nullable.include?(attr)
546
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
547
+ end
548
+
549
+ hash[param] = _to_hash(value)
550
+ end
551
+ hash
552
+ end
553
+
554
+ # Outputs non-array value in the form of hash
555
+ # For object, use to_hash. Otherwise, just return the value
556
+ # @param [Object] value Any valid value
557
+ # @return [Hash] Returns the value in the form of hash
558
+ def _to_hash(value)
559
+ if value.is_a?(Array)
560
+ value.compact.map { |v| _to_hash(v) }
561
+ elsif value.is_a?(Hash)
562
+ {}.tap do |hash|
563
+ value.each { |k, v| hash[k] = _to_hash(v) }
564
+ end
565
+ elsif value.respond_to? :to_hash
566
+ value.to_hash
567
+ else
568
+ value
569
+ end
570
+ end
571
+
572
+ end
573
+
574
+ end