songtradr_api_client_ruby 1.12.21
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/Gemfile.lock +76 -0
- data/README.md +223 -0
- data/Rakefile +10 -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 +20 -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/getspec.rb +10 -0
- data/git_push.sh +57 -0
- data/lib/songtradr_api_client_ruby/api/allowed_values_api.rb +213 -0
- data/lib/songtradr_api_client_ruby/api/party_api.rb +84 -0
- data/lib/songtradr_api_client_ruby/api/playlist_api.rb +222 -0
- data/lib/songtradr_api_client_ruby/api/recording_api.rb +900 -0
- data/lib/songtradr_api_client_ruby/api/user_api.rb +2642 -0
- data/lib/songtradr_api_client_ruby/api_client.rb +428 -0
- data/lib/songtradr_api_client_ruby/api_error.rb +58 -0
- data/lib/songtradr_api_client_ruby/configuration.rb +380 -0
- data/lib/songtradr_api_client_ruby/models/category_medium_dto.rb +250 -0
- data/lib/songtradr_api_client_ruby/models/category_minimal_dto.rb +225 -0
- data/lib/songtradr_api_client_ruby/models/config_access_dto.rb +287 -0
- data/lib/songtradr_api_client_ruby/models/config_identifier_dto.rb +239 -0
- data/lib/songtradr_api_client_ruby/models/contributor_type_dto.rb +225 -0
- data/lib/songtradr_api_client_ruby/models/error_response.rb +276 -0
- data/lib/songtradr_api_client_ruby/models/field_summary_dto.rb +253 -0
- data/lib/songtradr_api_client_ruby/models/file_dto.rb +450 -0
- data/lib/songtradr_api_client_ruby/models/file_list_dto.rb +269 -0
- data/lib/songtradr_api_client_ruby/models/file_minimal_with_url_dto.rb +253 -0
- data/lib/songtradr_api_client_ruby/models/file_small_dto.rb +432 -0
- data/lib/songtradr_api_client_ruby/models/file_upload_dto.rb +244 -0
- data/lib/songtradr_api_client_ruby/models/file_w_ith_url_dto.rb +239 -0
- data/lib/songtradr_api_client_ruby/models/files_summary_dto.rb +287 -0
- data/lib/songtradr_api_client_ruby/models/forgot_password_dto.rb +267 -0
- data/lib/songtradr_api_client_ruby/models/genre_dto.rb +239 -0
- data/lib/songtradr_api_client_ruby/models/genre_minimal_dto.rb +225 -0
- data/lib/songtradr_api_client_ruby/models/genres_summary_dto.rb +248 -0
- data/lib/songtradr_api_client_ruby/models/init_put_recording_audio_dto.rb +238 -0
- data/lib/songtradr_api_client_ruby/models/jwt_token_dto.rb +248 -0
- data/lib/songtradr_api_client_ruby/models/login_dto.rb +257 -0
- data/lib/songtradr_api_client_ruby/models/musical_features_dto.rb +1532 -0
- data/lib/songtradr_api_client_ruby/models/p_line_dto.rb +234 -0
- data/lib/songtradr_api_client_ruby/models/party_large_dto.rb +288 -0
- data/lib/songtradr_api_client_ruby/models/party_small_dto.rb +239 -0
- data/lib/songtradr_api_client_ruby/models/playlist_large_dto.rb +353 -0
- data/lib/songtradr_api_client_ruby/models/product_medium_dto.rb +316 -0
- data/lib/songtradr_api_client_ruby/models/product_party_dto.rb +236 -0
- data/lib/songtradr_api_client_ruby/models/recording_for_similarity_search_dto.rb +239 -0
- data/lib/songtradr_api_client_ruby/models/recording_genre_prediction_dto.rb +253 -0
- data/lib/songtradr_api_client_ruby/models/recording_large_dto.rb +366 -0
- data/lib/songtradr_api_client_ruby/models/recording_list_dto.rb +269 -0
- data/lib/songtradr_api_client_ruby/models/recording_medium_dto.rb +340 -0
- data/lib/songtradr_api_client_ruby/models/recording_minimal_with_musical_features_dto.rb +236 -0
- data/lib/songtradr_api_client_ruby/models/recording_minimal_with_taggrams_dto.rb +248 -0
- data/lib/songtradr_api_client_ruby/models/recording_minimal_with_tagstrengths_dto.rb +236 -0
- data/lib/songtradr_api_client_ruby/models/recording_party_dto.rb +236 -0
- data/lib/songtradr_api_client_ruby/models/recording_playlist_dto.rb +247 -0
- data/lib/songtradr_api_client_ruby/models/recording_small_dto.rb +268 -0
- data/lib/songtradr_api_client_ruby/models/recording_tag_small_dto.rb +225 -0
- data/lib/songtradr_api_client_ruby/models/save_file_recording_dto.rb +1847 -0
- data/lib/songtradr_api_client_ruby/models/save_playlist_dto.rb +350 -0
- data/lib/songtradr_api_client_ruby/models/save_recording_genre_dto.rb +243 -0
- data/lib/songtradr_api_client_ruby/models/save_recording_party_dto.rb +273 -0
- data/lib/songtradr_api_client_ruby/models/save_recording_playlist_dto.rb +248 -0
- data/lib/songtradr_api_client_ruby/models/save_recording_tag_dto.rb +234 -0
- data/lib/songtradr_api_client_ruby/models/save_referrer_dto.rb +229 -0
- data/lib/songtradr_api_client_ruby/models/save_taggrams_dto.rb +574 -0
- data/lib/songtradr_api_client_ruby/models/save_user_dto.rb +317 -0
- data/lib/songtradr_api_client_ruby/models/search_filter_values_dto.rb +867 -0
- data/lib/songtradr_api_client_ruby/models/search_recording_granular_abstraction_dto.rb +270 -0
- data/lib/songtradr_api_client_ruby/models/search_recording_granular_dto.rb +235 -0
- data/lib/songtradr_api_client_ruby/models/sign_up_dto.rb +262 -0
- data/lib/songtradr_api_client_ruby/models/tag_dto.rb +250 -0
- data/lib/songtradr_api_client_ruby/models/tag_small_dto.rb +239 -0
- data/lib/songtradr_api_client_ruby/models/taggram_dto.rb +271 -0
- data/lib/songtradr_api_client_ruby/models/tags_summary_dto.rb +250 -0
- data/lib/songtradr_api_client_ruby/models/tagstrength_dto.rb +269 -0
- data/lib/songtradr_api_client_ruby/models/title_dto.rb +225 -0
- data/lib/songtradr_api_client_ruby/models/token_request.rb +224 -0
- data/lib/songtradr_api_client_ruby/models/track_to_medium_product_dto.rb +248 -0
- data/lib/songtradr_api_client_ruby/models/update_password_dto.rb +238 -0
- data/lib/songtradr_api_client_ruby/models/usage_dto.rb +220 -0
- data/lib/songtradr_api_client_ruby/models/user_dto.rb +481 -0
- data/lib/songtradr_api_client_ruby/version.rb +15 -0
- data/lib/songtradr_api_client_ruby.rb +108 -0
- data/openapi-generator-config.yaml +10 -0
- data/songtradr_api_client_ruby.gemspec +39 -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 +40 -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/spec_helper.rb +111 -0
- metadata +412 -0
@@ -0,0 +1,273 @@
|
|
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: 7.0.0-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module SongtradrApiClientRuby
|
17
|
+
# Recording-party-connection to be saved the API.
|
18
|
+
class SaveRecordingPartyDTO
|
19
|
+
attr_accessor :full_name
|
20
|
+
|
21
|
+
attr_accessor :contributor_type
|
22
|
+
|
23
|
+
class EnumAttributeValidator
|
24
|
+
attr_reader :datatype
|
25
|
+
attr_reader :allowable_values
|
26
|
+
|
27
|
+
def initialize(datatype, allowable_values)
|
28
|
+
@allowable_values = allowable_values.map do |value|
|
29
|
+
case datatype.to_s
|
30
|
+
when /Integer/i
|
31
|
+
value.to_i
|
32
|
+
when /Float/i
|
33
|
+
value.to_f
|
34
|
+
else
|
35
|
+
value
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
def valid?(value)
|
41
|
+
!value || allowable_values.include?(value)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
46
|
+
def self.attribute_map
|
47
|
+
{
|
48
|
+
:'full_name' => :'fullName',
|
49
|
+
:'contributor_type' => :'contributorType'
|
50
|
+
}
|
51
|
+
end
|
52
|
+
|
53
|
+
# Returns all the JSON keys this model knows about
|
54
|
+
def self.acceptable_attributes
|
55
|
+
attribute_map.values
|
56
|
+
end
|
57
|
+
|
58
|
+
# Attribute type mapping.
|
59
|
+
def self.openapi_types
|
60
|
+
{
|
61
|
+
:'full_name' => :'String',
|
62
|
+
:'contributor_type' => :'String'
|
63
|
+
}
|
64
|
+
end
|
65
|
+
|
66
|
+
# List of attributes with nullable: true
|
67
|
+
def self.openapi_nullable
|
68
|
+
Set.new([
|
69
|
+
])
|
70
|
+
end
|
71
|
+
|
72
|
+
# Initializes the object
|
73
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
74
|
+
def initialize(attributes = {})
|
75
|
+
if (!attributes.is_a?(Hash))
|
76
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `SongtradrApiClientRuby::SaveRecordingPartyDTO` initialize method"
|
77
|
+
end
|
78
|
+
|
79
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
80
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
81
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
82
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `SongtradrApiClientRuby::SaveRecordingPartyDTO`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
83
|
+
end
|
84
|
+
h[k.to_sym] = v
|
85
|
+
}
|
86
|
+
|
87
|
+
if attributes.key?(:'full_name')
|
88
|
+
self.full_name = attributes[:'full_name']
|
89
|
+
end
|
90
|
+
|
91
|
+
if attributes.key?(:'contributor_type')
|
92
|
+
self.contributor_type = attributes[:'contributor_type']
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
97
|
+
# @return Array for valid properties with the reasons
|
98
|
+
def list_invalid_properties
|
99
|
+
invalid_properties = Array.new
|
100
|
+
if @full_name.nil?
|
101
|
+
invalid_properties.push('invalid value for "full_name", full_name cannot be nil.')
|
102
|
+
end
|
103
|
+
|
104
|
+
if @contributor_type.nil?
|
105
|
+
invalid_properties.push('invalid value for "contributor_type", contributor_type cannot be nil.')
|
106
|
+
end
|
107
|
+
|
108
|
+
invalid_properties
|
109
|
+
end
|
110
|
+
|
111
|
+
# Check to see if the all the properties in the model are valid
|
112
|
+
# @return true if the model is valid
|
113
|
+
def valid?
|
114
|
+
return false if @full_name.nil?
|
115
|
+
return false if @contributor_type.nil?
|
116
|
+
contributor_type_validator = EnumAttributeValidator.new('String', ["trackArtist", "composer", "author"])
|
117
|
+
return false unless contributor_type_validator.valid?(@contributor_type)
|
118
|
+
true
|
119
|
+
end
|
120
|
+
|
121
|
+
# Custom attribute writer method checking allowed values (enum).
|
122
|
+
# @param [Object] contributor_type Object to be assigned
|
123
|
+
def contributor_type=(contributor_type)
|
124
|
+
validator = EnumAttributeValidator.new('String', ["trackArtist", "composer", "author"])
|
125
|
+
unless validator.valid?(contributor_type)
|
126
|
+
fail ArgumentError, "invalid value for \"contributor_type\", must be one of #{validator.allowable_values}."
|
127
|
+
end
|
128
|
+
@contributor_type = contributor_type
|
129
|
+
end
|
130
|
+
|
131
|
+
# Checks equality by comparing each attribute.
|
132
|
+
# @param [Object] Object to be compared
|
133
|
+
def ==(o)
|
134
|
+
return true if self.equal?(o)
|
135
|
+
self.class == o.class &&
|
136
|
+
full_name == o.full_name &&
|
137
|
+
contributor_type == o.contributor_type
|
138
|
+
end
|
139
|
+
|
140
|
+
# @see the `==` method
|
141
|
+
# @param [Object] Object to be compared
|
142
|
+
def eql?(o)
|
143
|
+
self == o
|
144
|
+
end
|
145
|
+
|
146
|
+
# Calculates hash code according to all attributes.
|
147
|
+
# @return [Integer] Hash code
|
148
|
+
def hash
|
149
|
+
[full_name, contributor_type].hash
|
150
|
+
end
|
151
|
+
|
152
|
+
# Builds the object from hash
|
153
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
154
|
+
# @return [Object] Returns the model itself
|
155
|
+
def self.build_from_hash(attributes)
|
156
|
+
new.build_from_hash(attributes)
|
157
|
+
end
|
158
|
+
|
159
|
+
# Builds the object from hash
|
160
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
161
|
+
# @return [Object] Returns the model itself
|
162
|
+
def build_from_hash(attributes)
|
163
|
+
return nil unless attributes.is_a?(Hash)
|
164
|
+
attributes = attributes.transform_keys(&:to_sym)
|
165
|
+
self.class.openapi_types.each_pair do |key, type|
|
166
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
167
|
+
self.send("#{key}=", nil)
|
168
|
+
elsif type =~ /\AArray<(.*)>/i
|
169
|
+
# check to ensure the input is an array given that the attribute
|
170
|
+
# is documented as an array but the input is not
|
171
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
172
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
173
|
+
end
|
174
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
175
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
176
|
+
end
|
177
|
+
end
|
178
|
+
|
179
|
+
self
|
180
|
+
end
|
181
|
+
|
182
|
+
# Deserializes the data based on type
|
183
|
+
# @param string type Data type
|
184
|
+
# @param string value Value to be deserialized
|
185
|
+
# @return [Object] Deserialized data
|
186
|
+
def _deserialize(type, value)
|
187
|
+
case type.to_sym
|
188
|
+
when :Time
|
189
|
+
Time.parse(value)
|
190
|
+
when :Date
|
191
|
+
Date.parse(value)
|
192
|
+
when :String
|
193
|
+
value.to_s
|
194
|
+
when :Integer
|
195
|
+
value.to_i
|
196
|
+
when :Float
|
197
|
+
value.to_f
|
198
|
+
when :Boolean
|
199
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
200
|
+
true
|
201
|
+
else
|
202
|
+
false
|
203
|
+
end
|
204
|
+
when :Object
|
205
|
+
# generic object (usually a Hash), return directly
|
206
|
+
value
|
207
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
208
|
+
inner_type = Regexp.last_match[:inner_type]
|
209
|
+
value.map { |v| _deserialize(inner_type, v) }
|
210
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
211
|
+
k_type = Regexp.last_match[:k_type]
|
212
|
+
v_type = Regexp.last_match[:v_type]
|
213
|
+
{}.tap do |hash|
|
214
|
+
value.each do |k, v|
|
215
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
216
|
+
end
|
217
|
+
end
|
218
|
+
else # model
|
219
|
+
# models (e.g. Pet) or oneOf
|
220
|
+
klass = SongtradrApiClientRuby.const_get(type)
|
221
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
222
|
+
end
|
223
|
+
end
|
224
|
+
|
225
|
+
# Returns the string representation of the object
|
226
|
+
# @return [String] String presentation of the object
|
227
|
+
def to_s
|
228
|
+
to_hash.to_s
|
229
|
+
end
|
230
|
+
|
231
|
+
# to_body is an alias to to_hash (backward compatibility)
|
232
|
+
# @return [Hash] Returns the object in the form of hash
|
233
|
+
def to_body
|
234
|
+
to_hash
|
235
|
+
end
|
236
|
+
|
237
|
+
# Returns the object in the form of hash
|
238
|
+
# @return [Hash] Returns the object in the form of hash
|
239
|
+
def to_hash
|
240
|
+
hash = {}
|
241
|
+
self.class.attribute_map.each_pair do |attr, param|
|
242
|
+
value = self.send(attr)
|
243
|
+
if value.nil?
|
244
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
245
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
246
|
+
end
|
247
|
+
|
248
|
+
hash[param] = _to_hash(value)
|
249
|
+
end
|
250
|
+
hash
|
251
|
+
end
|
252
|
+
|
253
|
+
# Outputs non-array value in the form of hash
|
254
|
+
# For object, use to_hash. Otherwise, just return the value
|
255
|
+
# @param [Object] value Any valid value
|
256
|
+
# @return [Hash] Returns the value in the form of hash
|
257
|
+
def _to_hash(value)
|
258
|
+
if value.is_a?(Array)
|
259
|
+
value.compact.map { |v| _to_hash(v) }
|
260
|
+
elsif value.is_a?(Hash)
|
261
|
+
{}.tap do |hash|
|
262
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
263
|
+
end
|
264
|
+
elsif value.respond_to? :to_hash
|
265
|
+
value.to_hash
|
266
|
+
else
|
267
|
+
value
|
268
|
+
end
|
269
|
+
end
|
270
|
+
|
271
|
+
end
|
272
|
+
|
273
|
+
end
|
@@ -0,0 +1,248 @@
|
|
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: 7.0.0-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module SongtradrApiClientRuby
|
17
|
+
# Recording Playlist connection
|
18
|
+
class SaveRecordingPlaylistDTO
|
19
|
+
attr_accessor :songtradr_track_guid
|
20
|
+
|
21
|
+
attr_accessor :assigned_by_id
|
22
|
+
|
23
|
+
attr_accessor :sequence
|
24
|
+
|
25
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
26
|
+
def self.attribute_map
|
27
|
+
{
|
28
|
+
:'songtradr_track_guid' => :'songtradrTrackGuid',
|
29
|
+
:'assigned_by_id' => :'assignedById',
|
30
|
+
:'sequence' => :'sequence'
|
31
|
+
}
|
32
|
+
end
|
33
|
+
|
34
|
+
# Returns all the JSON keys this model knows about
|
35
|
+
def self.acceptable_attributes
|
36
|
+
attribute_map.values
|
37
|
+
end
|
38
|
+
|
39
|
+
# Attribute type mapping.
|
40
|
+
def self.openapi_types
|
41
|
+
{
|
42
|
+
:'songtradr_track_guid' => :'String',
|
43
|
+
:'assigned_by_id' => :'Integer',
|
44
|
+
:'sequence' => :'Integer'
|
45
|
+
}
|
46
|
+
end
|
47
|
+
|
48
|
+
# List of attributes with nullable: true
|
49
|
+
def self.openapi_nullable
|
50
|
+
Set.new([
|
51
|
+
])
|
52
|
+
end
|
53
|
+
|
54
|
+
# Initializes the object
|
55
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
56
|
+
def initialize(attributes = {})
|
57
|
+
if (!attributes.is_a?(Hash))
|
58
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `SongtradrApiClientRuby::SaveRecordingPlaylistDTO` initialize method"
|
59
|
+
end
|
60
|
+
|
61
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
62
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
63
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
64
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `SongtradrApiClientRuby::SaveRecordingPlaylistDTO`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
65
|
+
end
|
66
|
+
h[k.to_sym] = v
|
67
|
+
}
|
68
|
+
|
69
|
+
if attributes.key?(:'songtradr_track_guid')
|
70
|
+
self.songtradr_track_guid = attributes[:'songtradr_track_guid']
|
71
|
+
end
|
72
|
+
|
73
|
+
if attributes.key?(:'assigned_by_id')
|
74
|
+
self.assigned_by_id = attributes[:'assigned_by_id']
|
75
|
+
end
|
76
|
+
|
77
|
+
if attributes.key?(:'sequence')
|
78
|
+
self.sequence = attributes[:'sequence']
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
83
|
+
# @return Array for valid properties with the reasons
|
84
|
+
def list_invalid_properties
|
85
|
+
invalid_properties = Array.new
|
86
|
+
if @songtradr_track_guid.nil?
|
87
|
+
invalid_properties.push('invalid value for "songtradr_track_guid", songtradr_track_guid cannot be nil.')
|
88
|
+
end
|
89
|
+
|
90
|
+
if @assigned_by_id.nil?
|
91
|
+
invalid_properties.push('invalid value for "assigned_by_id", assigned_by_id cannot be nil.')
|
92
|
+
end
|
93
|
+
|
94
|
+
invalid_properties
|
95
|
+
end
|
96
|
+
|
97
|
+
# Check to see if the all the properties in the model are valid
|
98
|
+
# @return true if the model is valid
|
99
|
+
def valid?
|
100
|
+
return false if @songtradr_track_guid.nil?
|
101
|
+
return false if @assigned_by_id.nil?
|
102
|
+
true
|
103
|
+
end
|
104
|
+
|
105
|
+
# Checks equality by comparing each attribute.
|
106
|
+
# @param [Object] Object to be compared
|
107
|
+
def ==(o)
|
108
|
+
return true if self.equal?(o)
|
109
|
+
self.class == o.class &&
|
110
|
+
songtradr_track_guid == o.songtradr_track_guid &&
|
111
|
+
assigned_by_id == o.assigned_by_id &&
|
112
|
+
sequence == o.sequence
|
113
|
+
end
|
114
|
+
|
115
|
+
# @see the `==` method
|
116
|
+
# @param [Object] Object to be compared
|
117
|
+
def eql?(o)
|
118
|
+
self == o
|
119
|
+
end
|
120
|
+
|
121
|
+
# Calculates hash code according to all attributes.
|
122
|
+
# @return [Integer] Hash code
|
123
|
+
def hash
|
124
|
+
[songtradr_track_guid, assigned_by_id, sequence].hash
|
125
|
+
end
|
126
|
+
|
127
|
+
# Builds the object from hash
|
128
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
129
|
+
# @return [Object] Returns the model itself
|
130
|
+
def self.build_from_hash(attributes)
|
131
|
+
new.build_from_hash(attributes)
|
132
|
+
end
|
133
|
+
|
134
|
+
# Builds the object from hash
|
135
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
136
|
+
# @return [Object] Returns the model itself
|
137
|
+
def build_from_hash(attributes)
|
138
|
+
return nil unless attributes.is_a?(Hash)
|
139
|
+
attributes = attributes.transform_keys(&:to_sym)
|
140
|
+
self.class.openapi_types.each_pair do |key, type|
|
141
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
142
|
+
self.send("#{key}=", nil)
|
143
|
+
elsif type =~ /\AArray<(.*)>/i
|
144
|
+
# check to ensure the input is an array given that the attribute
|
145
|
+
# is documented as an array but the input is not
|
146
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
147
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
148
|
+
end
|
149
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
150
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
151
|
+
end
|
152
|
+
end
|
153
|
+
|
154
|
+
self
|
155
|
+
end
|
156
|
+
|
157
|
+
# Deserializes the data based on type
|
158
|
+
# @param string type Data type
|
159
|
+
# @param string value Value to be deserialized
|
160
|
+
# @return [Object] Deserialized data
|
161
|
+
def _deserialize(type, value)
|
162
|
+
case type.to_sym
|
163
|
+
when :Time
|
164
|
+
Time.parse(value)
|
165
|
+
when :Date
|
166
|
+
Date.parse(value)
|
167
|
+
when :String
|
168
|
+
value.to_s
|
169
|
+
when :Integer
|
170
|
+
value.to_i
|
171
|
+
when :Float
|
172
|
+
value.to_f
|
173
|
+
when :Boolean
|
174
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
175
|
+
true
|
176
|
+
else
|
177
|
+
false
|
178
|
+
end
|
179
|
+
when :Object
|
180
|
+
# generic object (usually a Hash), return directly
|
181
|
+
value
|
182
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
183
|
+
inner_type = Regexp.last_match[:inner_type]
|
184
|
+
value.map { |v| _deserialize(inner_type, v) }
|
185
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
186
|
+
k_type = Regexp.last_match[:k_type]
|
187
|
+
v_type = Regexp.last_match[:v_type]
|
188
|
+
{}.tap do |hash|
|
189
|
+
value.each do |k, v|
|
190
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
191
|
+
end
|
192
|
+
end
|
193
|
+
else # model
|
194
|
+
# models (e.g. Pet) or oneOf
|
195
|
+
klass = SongtradrApiClientRuby.const_get(type)
|
196
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
197
|
+
end
|
198
|
+
end
|
199
|
+
|
200
|
+
# Returns the string representation of the object
|
201
|
+
# @return [String] String presentation of the object
|
202
|
+
def to_s
|
203
|
+
to_hash.to_s
|
204
|
+
end
|
205
|
+
|
206
|
+
# to_body is an alias to to_hash (backward compatibility)
|
207
|
+
# @return [Hash] Returns the object in the form of hash
|
208
|
+
def to_body
|
209
|
+
to_hash
|
210
|
+
end
|
211
|
+
|
212
|
+
# Returns the object in the form of hash
|
213
|
+
# @return [Hash] Returns the object in the form of hash
|
214
|
+
def to_hash
|
215
|
+
hash = {}
|
216
|
+
self.class.attribute_map.each_pair do |attr, param|
|
217
|
+
value = self.send(attr)
|
218
|
+
if value.nil?
|
219
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
220
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
221
|
+
end
|
222
|
+
|
223
|
+
hash[param] = _to_hash(value)
|
224
|
+
end
|
225
|
+
hash
|
226
|
+
end
|
227
|
+
|
228
|
+
# Outputs non-array value in the form of hash
|
229
|
+
# For object, use to_hash. Otherwise, just return the value
|
230
|
+
# @param [Object] value Any valid value
|
231
|
+
# @return [Hash] Returns the value in the form of hash
|
232
|
+
def _to_hash(value)
|
233
|
+
if value.is_a?(Array)
|
234
|
+
value.compact.map { |v| _to_hash(v) }
|
235
|
+
elsif value.is_a?(Hash)
|
236
|
+
{}.tap do |hash|
|
237
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
238
|
+
end
|
239
|
+
elsif value.respond_to? :to_hash
|
240
|
+
value.to_hash
|
241
|
+
else
|
242
|
+
value
|
243
|
+
end
|
244
|
+
end
|
245
|
+
|
246
|
+
end
|
247
|
+
|
248
|
+
end
|