musicube_api_client_ruby 1.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CODE_OF_CONDUCT.md +84 -0
- data/Gemfile +9 -0
- data/README.md +223 -0
- data/Rakefile +10 -0
- data/bin/console +15 -0
- data/bin/setup +8 -0
- data/docs/AllowedValuesApi.md +200 -0
- data/docs/CategoryMediumDTO.md +22 -0
- data/docs/CategoryMinimalDTO.md +18 -0
- data/docs/ConfigAccessDTO.md +20 -0
- data/docs/ConfigIdentifierDTO.md +20 -0
- data/docs/ContributorTypeDTO.md +18 -0
- data/docs/ErrorResponse.md +26 -0
- data/docs/FieldSummaryDTO.md +22 -0
- data/docs/FileDTO.md +50 -0
- data/docs/FileListDTO.md +24 -0
- data/docs/FileMinimalWithUrlDTO.md +22 -0
- data/docs/FileSmallDTO.md +46 -0
- data/docs/FileUploadDTO.md +22 -0
- data/docs/FileWIthUrlDTO.md +20 -0
- data/docs/FilesSummaryDTO.md +30 -0
- data/docs/ForgotPasswordDTO.md +20 -0
- data/docs/GenreDTO.md +20 -0
- data/docs/GenreMinimalDTO.md +18 -0
- data/docs/GenresSummaryDTO.md +22 -0
- data/docs/InitPutRecordingAudioDTO.md +22 -0
- data/docs/JwtTokenDTO.md +22 -0
- data/docs/LoginDTO.md +24 -0
- data/docs/MusicalFeaturesDTO.md +186 -0
- data/docs/PLineDTO.md +20 -0
- data/docs/PartyApi.md +75 -0
- data/docs/PartyLargeDTO.md +32 -0
- data/docs/PartySmallDTO.md +20 -0
- data/docs/PlaylistApi.md +221 -0
- data/docs/PlaylistLargeDTO.md +38 -0
- data/docs/ProductMediumDTO.md +34 -0
- data/docs/ProductPartyDTO.md +20 -0
- data/docs/RecordingApi.md +789 -0
- data/docs/RecordingForSimilaritySearchDTO.md +20 -0
- data/docs/RecordingGenrePredictionDTO.md +22 -0
- data/docs/RecordingLargeDTO.md +40 -0
- data/docs/RecordingListDTO.md +24 -0
- data/docs/RecordingMediumDTO.md +36 -0
- data/docs/RecordingMinimalWithMusicalFeaturesDTO.md +20 -0
- data/docs/RecordingMinimalWithTaggramsDTO.md +22 -0
- data/docs/RecordingMinimalWithTagstrengthsDTO.md +20 -0
- data/docs/RecordingPartyDTO.md +20 -0
- data/docs/RecordingPlaylistDTO.md +24 -0
- data/docs/RecordingSmallDTO.md +24 -0
- data/docs/RecordingTagSmallDTO.md +18 -0
- data/docs/SaveFileRecordingDTO.md +236 -0
- data/docs/SavePlaylistDTO.md +34 -0
- data/docs/SaveRecordingGenreDTO.md +22 -0
- data/docs/SaveRecordingPartyDTO.md +20 -0
- data/docs/SaveRecordingPlaylistDTO.md +22 -0
- data/docs/SaveRecordingTagDTO.md +20 -0
- data/docs/SaveReferrerDTO.md +20 -0
- data/docs/SaveTaggramsDTO.md +82 -0
- data/docs/SaveUserDTO.md +28 -0
- data/docs/SearchFilterValuesDTO.md +98 -0
- data/docs/SearchRecordingGranularAbstractionDTO.md +20 -0
- data/docs/SearchRecordingGranularDTO.md +22 -0
- data/docs/SignUpDTO.md +24 -0
- data/docs/TagDTO.md +22 -0
- data/docs/TagSmallDTO.md +20 -0
- data/docs/TaggramDTO.md +26 -0
- data/docs/TagsSummaryDTO.md +22 -0
- data/docs/TagstrengthDTO.md +26 -0
- data/docs/TitleDTO.md +18 -0
- data/docs/TokenRequest.md +18 -0
- data/docs/TrackToMediumProductDTO.md +22 -0
- data/docs/UpdatePasswordDTO.md +20 -0
- data/docs/UsageDTO.md +18 -0
- data/docs/UserApi.md +1936 -0
- data/docs/UserDTO.md +56 -0
- data/git_push.sh +57 -0
- data/lib/musicube_api_client_ruby/api/allowed_values_api.rb +213 -0
- data/lib/musicube_api_client_ruby/api/party_api.rb +84 -0
- data/lib/musicube_api_client_ruby/api/playlist_api.rb +222 -0
- data/lib/musicube_api_client_ruby/api/recording_api.rb +900 -0
- data/lib/musicube_api_client_ruby/api/user_api.rb +2642 -0
- data/lib/musicube_api_client_ruby/api_client.rb +428 -0
- data/lib/musicube_api_client_ruby/api_error.rb +58 -0
- data/lib/musicube_api_client_ruby/configuration.rb +380 -0
- data/lib/musicube_api_client_ruby/models/category_medium_dto.rb +250 -0
- data/lib/musicube_api_client_ruby/models/category_minimal_dto.rb +225 -0
- data/lib/musicube_api_client_ruby/models/config_access_dto.rb +287 -0
- data/lib/musicube_api_client_ruby/models/config_identifier_dto.rb +239 -0
- data/lib/musicube_api_client_ruby/models/contributor_type_dto.rb +225 -0
- data/lib/musicube_api_client_ruby/models/error_response.rb +276 -0
- data/lib/musicube_api_client_ruby/models/field_summary_dto.rb +253 -0
- data/lib/musicube_api_client_ruby/models/file_dto.rb +450 -0
- data/lib/musicube_api_client_ruby/models/file_list_dto.rb +269 -0
- data/lib/musicube_api_client_ruby/models/file_minimal_with_url_dto.rb +253 -0
- data/lib/musicube_api_client_ruby/models/file_small_dto.rb +432 -0
- data/lib/musicube_api_client_ruby/models/file_upload_dto.rb +244 -0
- data/lib/musicube_api_client_ruby/models/file_w_ith_url_dto.rb +239 -0
- data/lib/musicube_api_client_ruby/models/files_summary_dto.rb +287 -0
- data/lib/musicube_api_client_ruby/models/forgot_password_dto.rb +267 -0
- data/lib/musicube_api_client_ruby/models/genre_dto.rb +239 -0
- data/lib/musicube_api_client_ruby/models/genre_minimal_dto.rb +225 -0
- data/lib/musicube_api_client_ruby/models/genres_summary_dto.rb +248 -0
- data/lib/musicube_api_client_ruby/models/init_put_recording_audio_dto.rb +238 -0
- data/lib/musicube_api_client_ruby/models/jwt_token_dto.rb +248 -0
- data/lib/musicube_api_client_ruby/models/login_dto.rb +257 -0
- data/lib/musicube_api_client_ruby/models/musical_features_dto.rb +1532 -0
- data/lib/musicube_api_client_ruby/models/p_line_dto.rb +234 -0
- data/lib/musicube_api_client_ruby/models/party_large_dto.rb +288 -0
- data/lib/musicube_api_client_ruby/models/party_small_dto.rb +239 -0
- data/lib/musicube_api_client_ruby/models/playlist_large_dto.rb +353 -0
- data/lib/musicube_api_client_ruby/models/product_medium_dto.rb +316 -0
- data/lib/musicube_api_client_ruby/models/product_party_dto.rb +236 -0
- data/lib/musicube_api_client_ruby/models/recording_for_similarity_search_dto.rb +239 -0
- data/lib/musicube_api_client_ruby/models/recording_genre_prediction_dto.rb +253 -0
- data/lib/musicube_api_client_ruby/models/recording_large_dto.rb +366 -0
- data/lib/musicube_api_client_ruby/models/recording_list_dto.rb +269 -0
- data/lib/musicube_api_client_ruby/models/recording_medium_dto.rb +340 -0
- data/lib/musicube_api_client_ruby/models/recording_minimal_with_musical_features_dto.rb +236 -0
- data/lib/musicube_api_client_ruby/models/recording_minimal_with_taggrams_dto.rb +248 -0
- data/lib/musicube_api_client_ruby/models/recording_minimal_with_tagstrengths_dto.rb +236 -0
- data/lib/musicube_api_client_ruby/models/recording_party_dto.rb +236 -0
- data/lib/musicube_api_client_ruby/models/recording_playlist_dto.rb +247 -0
- data/lib/musicube_api_client_ruby/models/recording_small_dto.rb +268 -0
- data/lib/musicube_api_client_ruby/models/recording_tag_small_dto.rb +225 -0
- data/lib/musicube_api_client_ruby/models/save_file_recording_dto.rb +1847 -0
- data/lib/musicube_api_client_ruby/models/save_playlist_dto.rb +350 -0
- data/lib/musicube_api_client_ruby/models/save_recording_genre_dto.rb +243 -0
- data/lib/musicube_api_client_ruby/models/save_recording_party_dto.rb +273 -0
- data/lib/musicube_api_client_ruby/models/save_recording_playlist_dto.rb +248 -0
- data/lib/musicube_api_client_ruby/models/save_recording_tag_dto.rb +234 -0
- data/lib/musicube_api_client_ruby/models/save_referrer_dto.rb +229 -0
- data/lib/musicube_api_client_ruby/models/save_taggrams_dto.rb +574 -0
- data/lib/musicube_api_client_ruby/models/save_user_dto.rb +317 -0
- data/lib/musicube_api_client_ruby/models/search_filter_values_dto.rb +867 -0
- data/lib/musicube_api_client_ruby/models/search_recording_granular_abstraction_dto.rb +270 -0
- data/lib/musicube_api_client_ruby/models/search_recording_granular_dto.rb +245 -0
- data/lib/musicube_api_client_ruby/models/sign_up_dto.rb +262 -0
- data/lib/musicube_api_client_ruby/models/tag_dto.rb +250 -0
- data/lib/musicube_api_client_ruby/models/tag_small_dto.rb +239 -0
- data/lib/musicube_api_client_ruby/models/taggram_dto.rb +271 -0
- data/lib/musicube_api_client_ruby/models/tags_summary_dto.rb +250 -0
- data/lib/musicube_api_client_ruby/models/tagstrength_dto.rb +269 -0
- data/lib/musicube_api_client_ruby/models/title_dto.rb +225 -0
- data/lib/musicube_api_client_ruby/models/token_request.rb +224 -0
- data/lib/musicube_api_client_ruby/models/track_to_medium_product_dto.rb +248 -0
- data/lib/musicube_api_client_ruby/models/update_password_dto.rb +238 -0
- data/lib/musicube_api_client_ruby/models/usage_dto.rb +220 -0
- data/lib/musicube_api_client_ruby/models/user_dto.rb +481 -0
- data/lib/musicube_api_client_ruby/version.rb +15 -0
- data/lib/musicube_api_client_ruby.rb +108 -0
- data/musicube_api_client_ruby.gemspec +39 -0
- data/openapi-generator-config.yaml +9 -0
- data/spec/api/allowed_values_api_spec.rb +68 -0
- data/spec/api/party_api_spec.rb +46 -0
- data/spec/api/playlist_api_spec.rb +72 -0
- data/spec/api/recording_api_spec.rb +192 -0
- data/spec/api/user_api_spec.rb +507 -0
- data/spec/api_client_spec.rb +223 -0
- data/spec/configuration_spec.rb +82 -0
- data/spec/models/category_medium_dto_spec.rb +46 -0
- data/spec/models/category_minimal_dto_spec.rb +34 -0
- data/spec/models/config_access_dto_spec.rb +48 -0
- data/spec/models/config_identifier_dto_spec.rb +40 -0
- data/spec/models/contributor_type_dto_spec.rb +34 -0
- data/spec/models/error_response_spec.rb +58 -0
- data/spec/models/field_summary_dto_spec.rb +46 -0
- data/spec/models/file_dto_spec.rb +142 -0
- data/spec/models/file_list_dto_spec.rb +52 -0
- data/spec/models/file_minimal_with_url_dto_spec.rb +46 -0
- data/spec/models/file_small_dto_spec.rb +130 -0
- data/spec/models/file_upload_dto_spec.rb +46 -0
- data/spec/models/file_w_ith_url_dto_spec.rb +40 -0
- data/spec/models/files_summary_dto_spec.rb +70 -0
- data/spec/models/forgot_password_dto_spec.rb +44 -0
- data/spec/models/genre_dto_spec.rb +40 -0
- data/spec/models/genre_minimal_dto_spec.rb +34 -0
- data/spec/models/genres_summary_dto_spec.rb +46 -0
- data/spec/models/init_put_recording_audio_dto_spec.rb +46 -0
- data/spec/models/jwt_token_dto_spec.rb +46 -0
- data/spec/models/login_dto_spec.rb +52 -0
- data/spec/models/musical_features_dto_spec.rb +706 -0
- data/spec/models/p_line_dto_spec.rb +40 -0
- data/spec/models/party_large_dto_spec.rb +76 -0
- data/spec/models/party_small_dto_spec.rb +40 -0
- data/spec/models/playlist_large_dto_spec.rb +98 -0
- data/spec/models/product_medium_dto_spec.rb +82 -0
- data/spec/models/product_party_dto_spec.rb +40 -0
- data/spec/models/recording_for_similarity_search_dto_spec.rb +40 -0
- data/spec/models/recording_genre_prediction_dto_spec.rb +46 -0
- data/spec/models/recording_large_dto_spec.rb +100 -0
- data/spec/models/recording_list_dto_spec.rb +52 -0
- data/spec/models/recording_medium_dto_spec.rb +88 -0
- data/spec/models/recording_minimal_with_musical_features_dto_spec.rb +40 -0
- data/spec/models/recording_minimal_with_taggrams_dto_spec.rb +46 -0
- data/spec/models/recording_minimal_with_tagstrengths_dto_spec.rb +40 -0
- data/spec/models/recording_party_dto_spec.rb +40 -0
- data/spec/models/recording_playlist_dto_spec.rb +52 -0
- data/spec/models/recording_small_dto_spec.rb +52 -0
- data/spec/models/recording_tag_small_dto_spec.rb +34 -0
- data/spec/models/save_file_recording_dto_spec.rb +880 -0
- data/spec/models/save_playlist_dto_spec.rb +86 -0
- data/spec/models/save_recording_genre_dto_spec.rb +46 -0
- data/spec/models/save_recording_party_dto_spec.rb +44 -0
- data/spec/models/save_recording_playlist_dto_spec.rb +46 -0
- data/spec/models/save_recording_tag_dto_spec.rb +40 -0
- data/spec/models/save_referrer_dto_spec.rb +40 -0
- data/spec/models/save_taggrams_dto_spec.rb +226 -0
- data/spec/models/save_user_dto_spec.rb +72 -0
- data/spec/models/search_filter_values_dto_spec.rb +274 -0
- data/spec/models/search_recording_granular_abstraction_dto_spec.rb +44 -0
- data/spec/models/search_recording_granular_dto_spec.rb +46 -0
- data/spec/models/sign_up_dto_spec.rb +52 -0
- data/spec/models/tag_dto_spec.rb +46 -0
- data/spec/models/tag_small_dto_spec.rb +40 -0
- data/spec/models/taggram_dto_spec.rb +58 -0
- data/spec/models/tags_summary_dto_spec.rb +46 -0
- data/spec/models/tagstrength_dto_spec.rb +58 -0
- data/spec/models/title_dto_spec.rb +34 -0
- data/spec/models/token_request_spec.rb +34 -0
- data/spec/models/track_to_medium_product_dto_spec.rb +46 -0
- data/spec/models/update_password_dto_spec.rb +40 -0
- data/spec/models/usage_dto_spec.rb +34 -0
- data/spec/models/user_dto_spec.rb +148 -0
- data/spec/musicube_api_client_ruby_spec.rb +11 -0
- data/spec/spec_helper.rb +111 -0
- metadata +415 -0
@@ -0,0 +1,366 @@
|
|
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
|
+
# Recording with a large field set.
|
18
|
+
class RecordingLargeDTO
|
19
|
+
attr_accessor :duration
|
20
|
+
|
21
|
+
attr_accessor :tags
|
22
|
+
|
23
|
+
attr_accessor :spotify_id
|
24
|
+
|
25
|
+
attr_accessor :pline
|
26
|
+
|
27
|
+
attr_accessor :genre_predictions
|
28
|
+
|
29
|
+
attr_accessor :genres
|
30
|
+
|
31
|
+
attr_accessor :language_of_performance
|
32
|
+
|
33
|
+
attr_accessor :titles
|
34
|
+
|
35
|
+
attr_accessor :tracks
|
36
|
+
|
37
|
+
attr_accessor :musical_features
|
38
|
+
|
39
|
+
attr_accessor :parties
|
40
|
+
|
41
|
+
attr_accessor :isrc
|
42
|
+
|
43
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
44
|
+
def self.attribute_map
|
45
|
+
{
|
46
|
+
:'duration' => :'duration',
|
47
|
+
:'tags' => :'tags',
|
48
|
+
:'spotify_id' => :'spotifyId',
|
49
|
+
:'pline' => :'pline',
|
50
|
+
:'genre_predictions' => :'genrePredictions',
|
51
|
+
:'genres' => :'genres',
|
52
|
+
:'language_of_performance' => :'languageOfPerformance',
|
53
|
+
:'titles' => :'titles',
|
54
|
+
:'tracks' => :'tracks',
|
55
|
+
:'musical_features' => :'musicalFeatures',
|
56
|
+
:'parties' => :'parties',
|
57
|
+
:'isrc' => :'isrc'
|
58
|
+
}
|
59
|
+
end
|
60
|
+
|
61
|
+
# Returns all the JSON keys this model knows about
|
62
|
+
def self.acceptable_attributes
|
63
|
+
attribute_map.values
|
64
|
+
end
|
65
|
+
|
66
|
+
# Attribute type mapping.
|
67
|
+
def self.openapi_types
|
68
|
+
{
|
69
|
+
:'duration' => :'Integer',
|
70
|
+
:'tags' => :'Array<RecordingTagSmallDTO>',
|
71
|
+
:'spotify_id' => :'String',
|
72
|
+
:'pline' => :'PLineDTO',
|
73
|
+
:'genre_predictions' => :'Array<RecordingGenrePredictionDTO>',
|
74
|
+
:'genres' => :'Array<GenreDTO>',
|
75
|
+
:'language_of_performance' => :'String',
|
76
|
+
:'titles' => :'Array<TitleDTO>',
|
77
|
+
:'tracks' => :'Array<TrackToMediumProductDTO>',
|
78
|
+
:'musical_features' => :'MusicalFeaturesDTO',
|
79
|
+
:'parties' => :'Array<RecordingPartyDTO>',
|
80
|
+
:'isrc' => :'String'
|
81
|
+
}
|
82
|
+
end
|
83
|
+
|
84
|
+
# List of attributes with nullable: true
|
85
|
+
def self.openapi_nullable
|
86
|
+
Set.new([
|
87
|
+
])
|
88
|
+
end
|
89
|
+
|
90
|
+
# Initializes the object
|
91
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
92
|
+
def initialize(attributes = {})
|
93
|
+
if (!attributes.is_a?(Hash))
|
94
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `MusicubeApiClientRuby::RecordingLargeDTO` initialize method"
|
95
|
+
end
|
96
|
+
|
97
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
98
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
99
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
100
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `MusicubeApiClientRuby::RecordingLargeDTO`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
101
|
+
end
|
102
|
+
h[k.to_sym] = v
|
103
|
+
}
|
104
|
+
|
105
|
+
if attributes.key?(:'duration')
|
106
|
+
self.duration = attributes[:'duration']
|
107
|
+
end
|
108
|
+
|
109
|
+
if attributes.key?(:'tags')
|
110
|
+
if (value = attributes[:'tags']).is_a?(Array)
|
111
|
+
self.tags = value
|
112
|
+
end
|
113
|
+
end
|
114
|
+
|
115
|
+
if attributes.key?(:'spotify_id')
|
116
|
+
self.spotify_id = attributes[:'spotify_id']
|
117
|
+
end
|
118
|
+
|
119
|
+
if attributes.key?(:'pline')
|
120
|
+
self.pline = attributes[:'pline']
|
121
|
+
end
|
122
|
+
|
123
|
+
if attributes.key?(:'genre_predictions')
|
124
|
+
if (value = attributes[:'genre_predictions']).is_a?(Array)
|
125
|
+
self.genre_predictions = value
|
126
|
+
end
|
127
|
+
end
|
128
|
+
|
129
|
+
if attributes.key?(:'genres')
|
130
|
+
if (value = attributes[:'genres']).is_a?(Array)
|
131
|
+
self.genres = value
|
132
|
+
end
|
133
|
+
end
|
134
|
+
|
135
|
+
if attributes.key?(:'language_of_performance')
|
136
|
+
self.language_of_performance = attributes[:'language_of_performance']
|
137
|
+
end
|
138
|
+
|
139
|
+
if attributes.key?(:'titles')
|
140
|
+
if (value = attributes[:'titles']).is_a?(Array)
|
141
|
+
self.titles = value
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
145
|
+
if attributes.key?(:'tracks')
|
146
|
+
if (value = attributes[:'tracks']).is_a?(Array)
|
147
|
+
self.tracks = value
|
148
|
+
end
|
149
|
+
end
|
150
|
+
|
151
|
+
if attributes.key?(:'musical_features')
|
152
|
+
self.musical_features = attributes[:'musical_features']
|
153
|
+
end
|
154
|
+
|
155
|
+
if attributes.key?(:'parties')
|
156
|
+
if (value = attributes[:'parties']).is_a?(Array)
|
157
|
+
self.parties = value
|
158
|
+
end
|
159
|
+
end
|
160
|
+
|
161
|
+
if attributes.key?(:'isrc')
|
162
|
+
self.isrc = attributes[:'isrc']
|
163
|
+
end
|
164
|
+
end
|
165
|
+
|
166
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
167
|
+
# @return Array for valid properties with the reasons
|
168
|
+
def list_invalid_properties
|
169
|
+
invalid_properties = Array.new
|
170
|
+
if @isrc.nil?
|
171
|
+
invalid_properties.push('invalid value for "isrc", isrc cannot be nil.')
|
172
|
+
end
|
173
|
+
|
174
|
+
invalid_properties
|
175
|
+
end
|
176
|
+
|
177
|
+
# Check to see if the all the properties in the model are valid
|
178
|
+
# @return true if the model is valid
|
179
|
+
def valid?
|
180
|
+
return false if @isrc.nil?
|
181
|
+
true
|
182
|
+
end
|
183
|
+
|
184
|
+
# Custom attribute writer method with validation
|
185
|
+
# @param [Object] genre_predictions Value to be assigned
|
186
|
+
def genre_predictions=(genre_predictions)
|
187
|
+
@genre_predictions = genre_predictions
|
188
|
+
end
|
189
|
+
|
190
|
+
# Custom attribute writer method with validation
|
191
|
+
# @param [Object] genres Value to be assigned
|
192
|
+
def genres=(genres)
|
193
|
+
@genres = genres
|
194
|
+
end
|
195
|
+
|
196
|
+
# Custom attribute writer method with validation
|
197
|
+
# @param [Object] titles Value to be assigned
|
198
|
+
def titles=(titles)
|
199
|
+
@titles = titles
|
200
|
+
end
|
201
|
+
|
202
|
+
# Custom attribute writer method with validation
|
203
|
+
# @param [Object] tracks Value to be assigned
|
204
|
+
def tracks=(tracks)
|
205
|
+
@tracks = tracks
|
206
|
+
end
|
207
|
+
|
208
|
+
# Custom attribute writer method with validation
|
209
|
+
# @param [Object] parties Value to be assigned
|
210
|
+
def parties=(parties)
|
211
|
+
@parties = parties
|
212
|
+
end
|
213
|
+
|
214
|
+
# Checks equality by comparing each attribute.
|
215
|
+
# @param [Object] Object to be compared
|
216
|
+
def ==(o)
|
217
|
+
return true if self.equal?(o)
|
218
|
+
self.class == o.class &&
|
219
|
+
duration == o.duration &&
|
220
|
+
tags == o.tags &&
|
221
|
+
spotify_id == o.spotify_id &&
|
222
|
+
pline == o.pline &&
|
223
|
+
genre_predictions == o.genre_predictions &&
|
224
|
+
genres == o.genres &&
|
225
|
+
language_of_performance == o.language_of_performance &&
|
226
|
+
titles == o.titles &&
|
227
|
+
tracks == o.tracks &&
|
228
|
+
musical_features == o.musical_features &&
|
229
|
+
parties == o.parties &&
|
230
|
+
isrc == o.isrc
|
231
|
+
end
|
232
|
+
|
233
|
+
# @see the `==` method
|
234
|
+
# @param [Object] Object to be compared
|
235
|
+
def eql?(o)
|
236
|
+
self == o
|
237
|
+
end
|
238
|
+
|
239
|
+
# Calculates hash code according to all attributes.
|
240
|
+
# @return [Integer] Hash code
|
241
|
+
def hash
|
242
|
+
[duration, tags, spotify_id, pline, genre_predictions, genres, language_of_performance, titles, tracks, musical_features, parties, isrc].hash
|
243
|
+
end
|
244
|
+
|
245
|
+
# Builds the object from hash
|
246
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
247
|
+
# @return [Object] Returns the model itself
|
248
|
+
def self.build_from_hash(attributes)
|
249
|
+
new.build_from_hash(attributes)
|
250
|
+
end
|
251
|
+
|
252
|
+
# Builds the object from hash
|
253
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
254
|
+
# @return [Object] Returns the model itself
|
255
|
+
def build_from_hash(attributes)
|
256
|
+
return nil unless attributes.is_a?(Hash)
|
257
|
+
attributes = attributes.transform_keys(&:to_sym)
|
258
|
+
self.class.openapi_types.each_pair do |key, type|
|
259
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
260
|
+
self.send("#{key}=", nil)
|
261
|
+
elsif type =~ /\AArray<(.*)>/i
|
262
|
+
# check to ensure the input is an array given that the attribute
|
263
|
+
# is documented as an array but the input is not
|
264
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
265
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
266
|
+
end
|
267
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
268
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
269
|
+
end
|
270
|
+
end
|
271
|
+
|
272
|
+
self
|
273
|
+
end
|
274
|
+
|
275
|
+
# Deserializes the data based on type
|
276
|
+
# @param string type Data type
|
277
|
+
# @param string value Value to be deserialized
|
278
|
+
# @return [Object] Deserialized data
|
279
|
+
def _deserialize(type, value)
|
280
|
+
case type.to_sym
|
281
|
+
when :Time
|
282
|
+
Time.parse(value)
|
283
|
+
when :Date
|
284
|
+
Date.parse(value)
|
285
|
+
when :String
|
286
|
+
value.to_s
|
287
|
+
when :Integer
|
288
|
+
value.to_i
|
289
|
+
when :Float
|
290
|
+
value.to_f
|
291
|
+
when :Boolean
|
292
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
293
|
+
true
|
294
|
+
else
|
295
|
+
false
|
296
|
+
end
|
297
|
+
when :Object
|
298
|
+
# generic object (usually a Hash), return directly
|
299
|
+
value
|
300
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
301
|
+
inner_type = Regexp.last_match[:inner_type]
|
302
|
+
value.map { |v| _deserialize(inner_type, v) }
|
303
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
304
|
+
k_type = Regexp.last_match[:k_type]
|
305
|
+
v_type = Regexp.last_match[:v_type]
|
306
|
+
{}.tap do |hash|
|
307
|
+
value.each do |k, v|
|
308
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
309
|
+
end
|
310
|
+
end
|
311
|
+
else # model
|
312
|
+
# models (e.g. Pet) or oneOf
|
313
|
+
klass = MusicubeApiClientRuby.const_get(type)
|
314
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
315
|
+
end
|
316
|
+
end
|
317
|
+
|
318
|
+
# Returns the string representation of the object
|
319
|
+
# @return [String] String presentation of the object
|
320
|
+
def to_s
|
321
|
+
to_hash.to_s
|
322
|
+
end
|
323
|
+
|
324
|
+
# to_body is an alias to to_hash (backward compatibility)
|
325
|
+
# @return [Hash] Returns the object in the form of hash
|
326
|
+
def to_body
|
327
|
+
to_hash
|
328
|
+
end
|
329
|
+
|
330
|
+
# Returns the object in the form of hash
|
331
|
+
# @return [Hash] Returns the object in the form of hash
|
332
|
+
def to_hash
|
333
|
+
hash = {}
|
334
|
+
self.class.attribute_map.each_pair do |attr, param|
|
335
|
+
value = self.send(attr)
|
336
|
+
if value.nil?
|
337
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
338
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
339
|
+
end
|
340
|
+
|
341
|
+
hash[param] = _to_hash(value)
|
342
|
+
end
|
343
|
+
hash
|
344
|
+
end
|
345
|
+
|
346
|
+
# Outputs non-array value in the form of hash
|
347
|
+
# For object, use to_hash. Otherwise, just return the value
|
348
|
+
# @param [Object] value Any valid value
|
349
|
+
# @return [Hash] Returns the value in the form of hash
|
350
|
+
def _to_hash(value)
|
351
|
+
if value.is_a?(Array)
|
352
|
+
value.compact.map { |v| _to_hash(v) }
|
353
|
+
elsif value.is_a?(Hash)
|
354
|
+
{}.tap do |hash|
|
355
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
356
|
+
end
|
357
|
+
elsif value.respond_to? :to_hash
|
358
|
+
value.to_hash
|
359
|
+
else
|
360
|
+
value
|
361
|
+
end
|
362
|
+
end
|
363
|
+
|
364
|
+
end
|
365
|
+
|
366
|
+
end
|
@@ -0,0 +1,269 @@
|
|
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
|
+
# List of recordings with with a mid-sized field set.
|
18
|
+
class RecordingListDTO
|
19
|
+
attr_accessor :recordings
|
20
|
+
|
21
|
+
attr_accessor :has_next_page
|
22
|
+
|
23
|
+
attr_accessor :current_page_number
|
24
|
+
|
25
|
+
attr_accessor :total_results
|
26
|
+
|
27
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
28
|
+
def self.attribute_map
|
29
|
+
{
|
30
|
+
:'recordings' => :'recordings',
|
31
|
+
:'has_next_page' => :'hasNextPage',
|
32
|
+
:'current_page_number' => :'currentPageNumber',
|
33
|
+
:'total_results' => :'totalResults'
|
34
|
+
}
|
35
|
+
end
|
36
|
+
|
37
|
+
# Returns all the JSON keys this model knows about
|
38
|
+
def self.acceptable_attributes
|
39
|
+
attribute_map.values
|
40
|
+
end
|
41
|
+
|
42
|
+
# Attribute type mapping.
|
43
|
+
def self.openapi_types
|
44
|
+
{
|
45
|
+
:'recordings' => :'Array<RecordingMediumDTO>',
|
46
|
+
:'has_next_page' => :'Boolean',
|
47
|
+
:'current_page_number' => :'Integer',
|
48
|
+
:'total_results' => :'Integer'
|
49
|
+
}
|
50
|
+
end
|
51
|
+
|
52
|
+
# List of attributes with nullable: true
|
53
|
+
def self.openapi_nullable
|
54
|
+
Set.new([
|
55
|
+
])
|
56
|
+
end
|
57
|
+
|
58
|
+
# Initializes the object
|
59
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
60
|
+
def initialize(attributes = {})
|
61
|
+
if (!attributes.is_a?(Hash))
|
62
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `MusicubeApiClientRuby::RecordingListDTO` initialize method"
|
63
|
+
end
|
64
|
+
|
65
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
66
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
67
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
68
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `MusicubeApiClientRuby::RecordingListDTO`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
69
|
+
end
|
70
|
+
h[k.to_sym] = v
|
71
|
+
}
|
72
|
+
|
73
|
+
if attributes.key?(:'recordings')
|
74
|
+
if (value = attributes[:'recordings']).is_a?(Array)
|
75
|
+
self.recordings = value
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
if attributes.key?(:'has_next_page')
|
80
|
+
self.has_next_page = attributes[:'has_next_page']
|
81
|
+
end
|
82
|
+
|
83
|
+
if attributes.key?(:'current_page_number')
|
84
|
+
self.current_page_number = attributes[:'current_page_number']
|
85
|
+
end
|
86
|
+
|
87
|
+
if attributes.key?(:'total_results')
|
88
|
+
self.total_results = attributes[:'total_results']
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
93
|
+
# @return Array for valid properties with the reasons
|
94
|
+
def list_invalid_properties
|
95
|
+
invalid_properties = Array.new
|
96
|
+
if @recordings.nil?
|
97
|
+
invalid_properties.push('invalid value for "recordings", recordings cannot be nil.')
|
98
|
+
end
|
99
|
+
|
100
|
+
if @has_next_page.nil?
|
101
|
+
invalid_properties.push('invalid value for "has_next_page", has_next_page cannot be nil.')
|
102
|
+
end
|
103
|
+
|
104
|
+
if @current_page_number.nil?
|
105
|
+
invalid_properties.push('invalid value for "current_page_number", current_page_number cannot be nil.')
|
106
|
+
end
|
107
|
+
|
108
|
+
if @total_results.nil?
|
109
|
+
invalid_properties.push('invalid value for "total_results", total_results cannot be nil.')
|
110
|
+
end
|
111
|
+
|
112
|
+
invalid_properties
|
113
|
+
end
|
114
|
+
|
115
|
+
# Check to see if the all the properties in the model are valid
|
116
|
+
# @return true if the model is valid
|
117
|
+
def valid?
|
118
|
+
return false if @recordings.nil?
|
119
|
+
return false if @has_next_page.nil?
|
120
|
+
return false if @current_page_number.nil?
|
121
|
+
return false if @total_results.nil?
|
122
|
+
true
|
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
|
+
recordings == o.recordings &&
|
131
|
+
has_next_page == o.has_next_page &&
|
132
|
+
current_page_number == o.current_page_number &&
|
133
|
+
total_results == o.total_results
|
134
|
+
end
|
135
|
+
|
136
|
+
# @see the `==` method
|
137
|
+
# @param [Object] Object to be compared
|
138
|
+
def eql?(o)
|
139
|
+
self == o
|
140
|
+
end
|
141
|
+
|
142
|
+
# Calculates hash code according to all attributes.
|
143
|
+
# @return [Integer] Hash code
|
144
|
+
def hash
|
145
|
+
[recordings, has_next_page, current_page_number, total_results].hash
|
146
|
+
end
|
147
|
+
|
148
|
+
# Builds the object from hash
|
149
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
150
|
+
# @return [Object] Returns the model itself
|
151
|
+
def self.build_from_hash(attributes)
|
152
|
+
new.build_from_hash(attributes)
|
153
|
+
end
|
154
|
+
|
155
|
+
# Builds the object from hash
|
156
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
157
|
+
# @return [Object] Returns the model itself
|
158
|
+
def build_from_hash(attributes)
|
159
|
+
return nil unless attributes.is_a?(Hash)
|
160
|
+
attributes = attributes.transform_keys(&:to_sym)
|
161
|
+
self.class.openapi_types.each_pair do |key, type|
|
162
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
163
|
+
self.send("#{key}=", nil)
|
164
|
+
elsif type =~ /\AArray<(.*)>/i
|
165
|
+
# check to ensure the input is an array given that the attribute
|
166
|
+
# is documented as an array but the input is not
|
167
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
168
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
169
|
+
end
|
170
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
171
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
172
|
+
end
|
173
|
+
end
|
174
|
+
|
175
|
+
self
|
176
|
+
end
|
177
|
+
|
178
|
+
# Deserializes the data based on type
|
179
|
+
# @param string type Data type
|
180
|
+
# @param string value Value to be deserialized
|
181
|
+
# @return [Object] Deserialized data
|
182
|
+
def _deserialize(type, value)
|
183
|
+
case type.to_sym
|
184
|
+
when :Time
|
185
|
+
Time.parse(value)
|
186
|
+
when :Date
|
187
|
+
Date.parse(value)
|
188
|
+
when :String
|
189
|
+
value.to_s
|
190
|
+
when :Integer
|
191
|
+
value.to_i
|
192
|
+
when :Float
|
193
|
+
value.to_f
|
194
|
+
when :Boolean
|
195
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
196
|
+
true
|
197
|
+
else
|
198
|
+
false
|
199
|
+
end
|
200
|
+
when :Object
|
201
|
+
# generic object (usually a Hash), return directly
|
202
|
+
value
|
203
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
204
|
+
inner_type = Regexp.last_match[:inner_type]
|
205
|
+
value.map { |v| _deserialize(inner_type, v) }
|
206
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
207
|
+
k_type = Regexp.last_match[:k_type]
|
208
|
+
v_type = Regexp.last_match[:v_type]
|
209
|
+
{}.tap do |hash|
|
210
|
+
value.each do |k, v|
|
211
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
212
|
+
end
|
213
|
+
end
|
214
|
+
else # model
|
215
|
+
# models (e.g. Pet) or oneOf
|
216
|
+
klass = MusicubeApiClientRuby.const_get(type)
|
217
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
218
|
+
end
|
219
|
+
end
|
220
|
+
|
221
|
+
# Returns the string representation of the object
|
222
|
+
# @return [String] String presentation of the object
|
223
|
+
def to_s
|
224
|
+
to_hash.to_s
|
225
|
+
end
|
226
|
+
|
227
|
+
# to_body is an alias to to_hash (backward compatibility)
|
228
|
+
# @return [Hash] Returns the object in the form of hash
|
229
|
+
def to_body
|
230
|
+
to_hash
|
231
|
+
end
|
232
|
+
|
233
|
+
# Returns the object in the form of hash
|
234
|
+
# @return [Hash] Returns the object in the form of hash
|
235
|
+
def to_hash
|
236
|
+
hash = {}
|
237
|
+
self.class.attribute_map.each_pair do |attr, param|
|
238
|
+
value = self.send(attr)
|
239
|
+
if value.nil?
|
240
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
241
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
242
|
+
end
|
243
|
+
|
244
|
+
hash[param] = _to_hash(value)
|
245
|
+
end
|
246
|
+
hash
|
247
|
+
end
|
248
|
+
|
249
|
+
# Outputs non-array value in the form of hash
|
250
|
+
# For object, use to_hash. Otherwise, just return the value
|
251
|
+
# @param [Object] value Any valid value
|
252
|
+
# @return [Hash] Returns the value in the form of hash
|
253
|
+
def _to_hash(value)
|
254
|
+
if value.is_a?(Array)
|
255
|
+
value.compact.map { |v| _to_hash(v) }
|
256
|
+
elsif value.is_a?(Hash)
|
257
|
+
{}.tap do |hash|
|
258
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
259
|
+
end
|
260
|
+
elsif value.respond_to? :to_hash
|
261
|
+
value.to_hash
|
262
|
+
else
|
263
|
+
value
|
264
|
+
end
|
265
|
+
end
|
266
|
+
|
267
|
+
end
|
268
|
+
|
269
|
+
end
|