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,450 @@
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 file that has been uploaded for auto-tagging or audio-recognition purposes.
18
+ class FileDTO
19
+ attr_accessor :id
20
+
21
+ attr_accessor :name
22
+
23
+ attr_accessor :object_key
24
+
25
+ attr_accessor :folder
26
+
27
+ # extension of the file
28
+ attr_accessor :extension
29
+
30
+ attr_accessor :url
31
+
32
+ attr_accessor :upload_start_time
33
+
34
+ attr_accessor :upload_end_time
35
+
36
+ # status of the audio recognition
37
+ attr_accessor :fingerprint_status
38
+
39
+ attr_accessor :fingerprint_start_time
40
+
41
+ attr_accessor :fingerprint_end_time
42
+
43
+ # status of the auto-tagging
44
+ attr_accessor :inference_status
45
+
46
+ attr_accessor :inference_start_time
47
+
48
+ attr_accessor :inference_end_time
49
+
50
+ attr_accessor :recording
51
+
52
+ attr_accessor :error_time
53
+
54
+ attr_accessor :error_message
55
+
56
+ class EnumAttributeValidator
57
+ attr_reader :datatype
58
+ attr_reader :allowable_values
59
+
60
+ def initialize(datatype, allowable_values)
61
+ @allowable_values = allowable_values.map do |value|
62
+ case datatype.to_s
63
+ when /Integer/i
64
+ value.to_i
65
+ when /Float/i
66
+ value.to_f
67
+ else
68
+ value
69
+ end
70
+ end
71
+ end
72
+
73
+ def valid?(value)
74
+ !value || allowable_values.include?(value)
75
+ end
76
+ end
77
+
78
+ # Attribute mapping from ruby-style variable name to JSON key.
79
+ def self.attribute_map
80
+ {
81
+ :'id' => :'id',
82
+ :'name' => :'name',
83
+ :'object_key' => :'objectKey',
84
+ :'folder' => :'folder',
85
+ :'extension' => :'extension',
86
+ :'url' => :'url',
87
+ :'upload_start_time' => :'uploadStartTime',
88
+ :'upload_end_time' => :'uploadEndTime',
89
+ :'fingerprint_status' => :'fingerprintStatus',
90
+ :'fingerprint_start_time' => :'fingerprintStartTime',
91
+ :'fingerprint_end_time' => :'fingerprintEndTime',
92
+ :'inference_status' => :'inferenceStatus',
93
+ :'inference_start_time' => :'inferenceStartTime',
94
+ :'inference_end_time' => :'inferenceEndTime',
95
+ :'recording' => :'recording',
96
+ :'error_time' => :'error_time',
97
+ :'error_message' => :'error_message'
98
+ }
99
+ end
100
+
101
+ # Returns all the JSON keys this model knows about
102
+ def self.acceptable_attributes
103
+ attribute_map.values
104
+ end
105
+
106
+ # Attribute type mapping.
107
+ def self.openapi_types
108
+ {
109
+ :'id' => :'Integer',
110
+ :'name' => :'String',
111
+ :'object_key' => :'String',
112
+ :'folder' => :'String',
113
+ :'extension' => :'String',
114
+ :'url' => :'String',
115
+ :'upload_start_time' => :'Time',
116
+ :'upload_end_time' => :'Time',
117
+ :'fingerprint_status' => :'String',
118
+ :'fingerprint_start_time' => :'Time',
119
+ :'fingerprint_end_time' => :'Time',
120
+ :'inference_status' => :'String',
121
+ :'inference_start_time' => :'Time',
122
+ :'inference_end_time' => :'Time',
123
+ :'recording' => :'RecordingMediumDTO',
124
+ :'error_time' => :'Time',
125
+ :'error_message' => :'String'
126
+ }
127
+ end
128
+
129
+ # List of attributes with nullable: true
130
+ def self.openapi_nullable
131
+ Set.new([
132
+ ])
133
+ end
134
+
135
+ # Initializes the object
136
+ # @param [Hash] attributes Model attributes in the form of hash
137
+ def initialize(attributes = {})
138
+ if (!attributes.is_a?(Hash))
139
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SongtradrApiClientRuby::FileDTO` initialize method"
140
+ end
141
+
142
+ # check to see if the attribute exists and convert string to symbol for hash key
143
+ attributes = attributes.each_with_object({}) { |(k, v), h|
144
+ if (!self.class.attribute_map.key?(k.to_sym))
145
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SongtradrApiClientRuby::FileDTO`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
146
+ end
147
+ h[k.to_sym] = v
148
+ }
149
+
150
+ if attributes.key?(:'id')
151
+ self.id = attributes[:'id']
152
+ end
153
+
154
+ if attributes.key?(:'name')
155
+ self.name = attributes[:'name']
156
+ end
157
+
158
+ if attributes.key?(:'object_key')
159
+ self.object_key = attributes[:'object_key']
160
+ end
161
+
162
+ if attributes.key?(:'folder')
163
+ self.folder = attributes[:'folder']
164
+ end
165
+
166
+ if attributes.key?(:'extension')
167
+ self.extension = attributes[:'extension']
168
+ end
169
+
170
+ if attributes.key?(:'url')
171
+ self.url = attributes[:'url']
172
+ end
173
+
174
+ if attributes.key?(:'upload_start_time')
175
+ self.upload_start_time = attributes[:'upload_start_time']
176
+ end
177
+
178
+ if attributes.key?(:'upload_end_time')
179
+ self.upload_end_time = attributes[:'upload_end_time']
180
+ end
181
+
182
+ if attributes.key?(:'fingerprint_status')
183
+ self.fingerprint_status = attributes[:'fingerprint_status']
184
+ end
185
+
186
+ if attributes.key?(:'fingerprint_start_time')
187
+ self.fingerprint_start_time = attributes[:'fingerprint_start_time']
188
+ end
189
+
190
+ if attributes.key?(:'fingerprint_end_time')
191
+ self.fingerprint_end_time = attributes[:'fingerprint_end_time']
192
+ end
193
+
194
+ if attributes.key?(:'inference_status')
195
+ self.inference_status = attributes[:'inference_status']
196
+ end
197
+
198
+ if attributes.key?(:'inference_start_time')
199
+ self.inference_start_time = attributes[:'inference_start_time']
200
+ end
201
+
202
+ if attributes.key?(:'inference_end_time')
203
+ self.inference_end_time = attributes[:'inference_end_time']
204
+ end
205
+
206
+ if attributes.key?(:'recording')
207
+ self.recording = attributes[:'recording']
208
+ end
209
+
210
+ if attributes.key?(:'error_time')
211
+ self.error_time = attributes[:'error_time']
212
+ end
213
+
214
+ if attributes.key?(:'error_message')
215
+ self.error_message = attributes[:'error_message']
216
+ end
217
+ end
218
+
219
+ # Show invalid properties with the reasons. Usually used together with valid?
220
+ # @return Array for valid properties with the reasons
221
+ def list_invalid_properties
222
+ invalid_properties = Array.new
223
+ if @id.nil?
224
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
225
+ end
226
+
227
+ if @name.nil?
228
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
229
+ end
230
+
231
+ if @object_key.nil?
232
+ invalid_properties.push('invalid value for "object_key", object_key cannot be nil.')
233
+ end
234
+
235
+ if @folder.nil?
236
+ invalid_properties.push('invalid value for "folder", folder cannot be nil.')
237
+ end
238
+
239
+ if @extension.nil?
240
+ invalid_properties.push('invalid value for "extension", extension cannot be nil.')
241
+ end
242
+
243
+ invalid_properties
244
+ end
245
+
246
+ # Check to see if the all the properties in the model are valid
247
+ # @return true if the model is valid
248
+ def valid?
249
+ return false if @id.nil?
250
+ return false if @name.nil?
251
+ return false if @object_key.nil?
252
+ return false if @folder.nil?
253
+ return false if @extension.nil?
254
+ extension_validator = EnumAttributeValidator.new('String', ["mp3", "wav", "flac"])
255
+ return false unless extension_validator.valid?(@extension)
256
+ fingerprint_status_validator = EnumAttributeValidator.new('String', ["processing", "error", "found", "not_found", "not_started"])
257
+ return false unless fingerprint_status_validator.valid?(@fingerprint_status)
258
+ inference_status_validator = EnumAttributeValidator.new('String', ["processing", "error", "done", "not_started"])
259
+ return false unless inference_status_validator.valid?(@inference_status)
260
+ true
261
+ end
262
+
263
+ # Custom attribute writer method checking allowed values (enum).
264
+ # @param [Object] extension Object to be assigned
265
+ def extension=(extension)
266
+ validator = EnumAttributeValidator.new('String', ["mp3", "wav", "flac"])
267
+ unless validator.valid?(extension)
268
+ fail ArgumentError, "invalid value for \"extension\", must be one of #{validator.allowable_values}."
269
+ end
270
+ @extension = extension
271
+ end
272
+
273
+ # Custom attribute writer method checking allowed values (enum).
274
+ # @param [Object] fingerprint_status Object to be assigned
275
+ def fingerprint_status=(fingerprint_status)
276
+ validator = EnumAttributeValidator.new('String', ["processing", "error", "found", "not_found", "not_started"])
277
+ unless validator.valid?(fingerprint_status)
278
+ fail ArgumentError, "invalid value for \"fingerprint_status\", must be one of #{validator.allowable_values}."
279
+ end
280
+ @fingerprint_status = fingerprint_status
281
+ end
282
+
283
+ # Custom attribute writer method checking allowed values (enum).
284
+ # @param [Object] inference_status Object to be assigned
285
+ def inference_status=(inference_status)
286
+ validator = EnumAttributeValidator.new('String', ["processing", "error", "done", "not_started"])
287
+ unless validator.valid?(inference_status)
288
+ fail ArgumentError, "invalid value for \"inference_status\", must be one of #{validator.allowable_values}."
289
+ end
290
+ @inference_status = inference_status
291
+ end
292
+
293
+ # Checks equality by comparing each attribute.
294
+ # @param [Object] Object to be compared
295
+ def ==(o)
296
+ return true if self.equal?(o)
297
+ self.class == o.class &&
298
+ id == o.id &&
299
+ name == o.name &&
300
+ object_key == o.object_key &&
301
+ folder == o.folder &&
302
+ extension == o.extension &&
303
+ url == o.url &&
304
+ upload_start_time == o.upload_start_time &&
305
+ upload_end_time == o.upload_end_time &&
306
+ fingerprint_status == o.fingerprint_status &&
307
+ fingerprint_start_time == o.fingerprint_start_time &&
308
+ fingerprint_end_time == o.fingerprint_end_time &&
309
+ inference_status == o.inference_status &&
310
+ inference_start_time == o.inference_start_time &&
311
+ inference_end_time == o.inference_end_time &&
312
+ recording == o.recording &&
313
+ error_time == o.error_time &&
314
+ error_message == o.error_message
315
+ end
316
+
317
+ # @see the `==` method
318
+ # @param [Object] Object to be compared
319
+ def eql?(o)
320
+ self == o
321
+ end
322
+
323
+ # Calculates hash code according to all attributes.
324
+ # @return [Integer] Hash code
325
+ def hash
326
+ [id, name, object_key, folder, extension, url, upload_start_time, upload_end_time, fingerprint_status, fingerprint_start_time, fingerprint_end_time, inference_status, inference_start_time, inference_end_time, recording, error_time, error_message].hash
327
+ end
328
+
329
+ # Builds the object from hash
330
+ # @param [Hash] attributes Model attributes in the form of hash
331
+ # @return [Object] Returns the model itself
332
+ def self.build_from_hash(attributes)
333
+ new.build_from_hash(attributes)
334
+ end
335
+
336
+ # Builds the object from hash
337
+ # @param [Hash] attributes Model attributes in the form of hash
338
+ # @return [Object] Returns the model itself
339
+ def build_from_hash(attributes)
340
+ return nil unless attributes.is_a?(Hash)
341
+ attributes = attributes.transform_keys(&:to_sym)
342
+ self.class.openapi_types.each_pair do |key, type|
343
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
344
+ self.send("#{key}=", nil)
345
+ elsif type =~ /\AArray<(.*)>/i
346
+ # check to ensure the input is an array given that the attribute
347
+ # is documented as an array but the input is not
348
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
349
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
350
+ end
351
+ elsif !attributes[self.class.attribute_map[key]].nil?
352
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
353
+ end
354
+ end
355
+
356
+ self
357
+ end
358
+
359
+ # Deserializes the data based on type
360
+ # @param string type Data type
361
+ # @param string value Value to be deserialized
362
+ # @return [Object] Deserialized data
363
+ def _deserialize(type, value)
364
+ case type.to_sym
365
+ when :Time
366
+ Time.parse(value)
367
+ when :Date
368
+ Date.parse(value)
369
+ when :String
370
+ value.to_s
371
+ when :Integer
372
+ value.to_i
373
+ when :Float
374
+ value.to_f
375
+ when :Boolean
376
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
377
+ true
378
+ else
379
+ false
380
+ end
381
+ when :Object
382
+ # generic object (usually a Hash), return directly
383
+ value
384
+ when /\AArray<(?<inner_type>.+)>\z/
385
+ inner_type = Regexp.last_match[:inner_type]
386
+ value.map { |v| _deserialize(inner_type, v) }
387
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
388
+ k_type = Regexp.last_match[:k_type]
389
+ v_type = Regexp.last_match[:v_type]
390
+ {}.tap do |hash|
391
+ value.each do |k, v|
392
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
393
+ end
394
+ end
395
+ else # model
396
+ # models (e.g. Pet) or oneOf
397
+ klass = SongtradrApiClientRuby.const_get(type)
398
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
399
+ end
400
+ end
401
+
402
+ # Returns the string representation of the object
403
+ # @return [String] String presentation of the object
404
+ def to_s
405
+ to_hash.to_s
406
+ end
407
+
408
+ # to_body is an alias to to_hash (backward compatibility)
409
+ # @return [Hash] Returns the object in the form of hash
410
+ def to_body
411
+ to_hash
412
+ end
413
+
414
+ # Returns the object in the form of hash
415
+ # @return [Hash] Returns the object in the form of hash
416
+ def to_hash
417
+ hash = {}
418
+ self.class.attribute_map.each_pair do |attr, param|
419
+ value = self.send(attr)
420
+ if value.nil?
421
+ is_nullable = self.class.openapi_nullable.include?(attr)
422
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
423
+ end
424
+
425
+ hash[param] = _to_hash(value)
426
+ end
427
+ hash
428
+ end
429
+
430
+ # Outputs non-array value in the form of hash
431
+ # For object, use to_hash. Otherwise, just return the value
432
+ # @param [Object] value Any valid value
433
+ # @return [Hash] Returns the value in the form of hash
434
+ def _to_hash(value)
435
+ if value.is_a?(Array)
436
+ value.compact.map { |v| _to_hash(v) }
437
+ elsif value.is_a?(Hash)
438
+ {}.tap do |hash|
439
+ value.each { |k, v| hash[k] = _to_hash(v) }
440
+ end
441
+ elsif value.respond_to? :to_hash
442
+ value.to_hash
443
+ else
444
+ value
445
+ end
446
+ end
447
+
448
+ end
449
+
450
+ end