songtradr_api_client_ruby 1.12.21

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