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