songtradr_api_client_ruby 1.12.22 → 1.12.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +4 -4
- data/README.md +26 -12
- data/docs/APIKeysApi.md +217 -0
- data/docs/AdminApiUserDTO.md +70 -0
- data/docs/AllowedValuesApi.md +2 -2
- data/docs/ApiKeyDTO.md +24 -0
- data/docs/CreateApiKeyDTO.md +18 -0
- data/docs/FileSmallDTO.md +16 -16
- data/docs/MusicalFeaturesDTO.md +82 -82
- data/docs/PlaylistLargeDTO.md +9 -9
- data/docs/ProductMediumDTO.md +2 -2
- data/docs/RecordingApi.md +2 -0
- data/docs/RecordingGenrePredictionDTO.md +3 -3
- data/docs/RecordingLargeDTO.md +11 -11
- data/docs/RecordingMediumDTO.md +7 -7
- data/docs/RecordingMinimalWithMusicalFeaturesDTO.md +3 -3
- data/docs/RecordingPlaylistDTO.md +3 -3
- data/docs/RecordingSmallDTO.md +3 -3
- data/docs/UserApi.md +4 -0
- data/docs/UserDTO.md +20 -0
- data/lib/songtradr_api_client_ruby/api/allowed_values_api.rb +4 -4
- data/lib/songtradr_api_client_ruby/api/api_keys_api.rb +213 -0
- data/lib/songtradr_api_client_ruby/api/party_api.rb +1 -1
- data/lib/songtradr_api_client_ruby/api/playlist_api.rb +1 -1
- data/lib/songtradr_api_client_ruby/api/recording_api.rb +4 -1
- data/lib/songtradr_api_client_ruby/api/user_api.rb +7 -1
- data/lib/songtradr_api_client_ruby/api_client.rb +1 -1
- data/lib/songtradr_api_client_ruby/api_error.rb +1 -1
- data/lib/songtradr_api_client_ruby/configuration.rb +10 -8
- data/lib/songtradr_api_client_ruby/models/admin_api_user_dto.rb +448 -0
- data/lib/songtradr_api_client_ruby/models/api_key_dto.rb +262 -0
- data/lib/songtradr_api_client_ruby/models/category_medium_dto.rb +17 -18
- data/lib/songtradr_api_client_ruby/models/category_minimal_dto.rb +15 -18
- data/lib/songtradr_api_client_ruby/models/config_access_dto.rb +17 -18
- data/lib/songtradr_api_client_ruby/models/config_identifier_dto.rb +17 -18
- data/lib/songtradr_api_client_ruby/models/contributor_type_dto.rb +15 -18
- data/lib/songtradr_api_client_ruby/models/create_api_key_dto.rb +214 -0
- data/lib/songtradr_api_client_ruby/models/error_response.rb +19 -18
- data/lib/songtradr_api_client_ruby/models/field_summary_dto.rb +19 -18
- data/lib/songtradr_api_client_ruby/models/file_dto.rb +23 -18
- data/lib/songtradr_api_client_ruby/models/file_list_dto.rb +21 -18
- data/lib/songtradr_api_client_ruby/models/file_minimal_with_url_dto.rb +19 -18
- data/lib/songtradr_api_client_ruby/models/file_small_dto.rb +81 -76
- data/lib/songtradr_api_client_ruby/models/file_upload_dto.rb +13 -18
- data/lib/songtradr_api_client_ruby/models/file_w_ith_url_dto.rb +17 -18
- data/lib/songtradr_api_client_ruby/models/files_summary_dto.rb +15 -18
- data/lib/songtradr_api_client_ruby/models/forgot_password_dto.rb +15 -18
- data/lib/songtradr_api_client_ruby/models/genre_dto.rb +17 -18
- data/lib/songtradr_api_client_ruby/models/genre_minimal_dto.rb +15 -18
- data/lib/songtradr_api_client_ruby/models/genres_summary_dto.rb +17 -18
- data/lib/songtradr_api_client_ruby/models/init_put_recording_audio_dto.rb +13 -18
- data/lib/songtradr_api_client_ruby/models/jwt_token_dto.rb +17 -18
- data/lib/songtradr_api_client_ruby/models/login_dto.rb +17 -18
- data/lib/songtradr_api_client_ruby/models/musical_features_dto.rb +529 -534
- data/lib/songtradr_api_client_ruby/models/p_line_dto.rb +15 -18
- data/lib/songtradr_api_client_ruby/models/party_large_dto.rb +15 -18
- data/lib/songtradr_api_client_ruby/models/party_small_dto.rb +17 -18
- data/lib/songtradr_api_client_ruby/models/playlist_large_dto.rb +54 -57
- data/lib/songtradr_api_client_ruby/models/product_medium_dto.rb +35 -28
- data/lib/songtradr_api_client_ruby/models/product_party_dto.rb +15 -18
- data/lib/songtradr_api_client_ruby/models/recording_for_similarity_search_dto.rb +17 -18
- data/lib/songtradr_api_client_ruby/models/recording_genre_prediction_dto.rb +37 -36
- data/lib/songtradr_api_client_ruby/models/recording_large_dto.rb +94 -77
- data/lib/songtradr_api_client_ruby/models/recording_list_dto.rb +21 -18
- data/lib/songtradr_api_client_ruby/models/recording_medium_dto.rb +64 -51
- data/lib/songtradr_api_client_ruby/models/recording_minimal_with_musical_features_dto.rb +28 -31
- data/lib/songtradr_api_client_ruby/models/recording_minimal_with_taggrams_dto.rb +15 -18
- data/lib/songtradr_api_client_ruby/models/recording_minimal_with_tagstrengths_dto.rb +15 -18
- data/lib/songtradr_api_client_ruby/models/recording_party_dto.rb +15 -18
- data/lib/songtradr_api_client_ruby/models/recording_playlist_dto.rb +26 -31
- data/lib/songtradr_api_client_ruby/models/recording_small_dto.rb +36 -31
- data/lib/songtradr_api_client_ruby/models/recording_tag_small_dto.rb +15 -18
- data/lib/songtradr_api_client_ruby/models/save_file_recording_dto.rb +17 -18
- data/lib/songtradr_api_client_ruby/models/save_playlist_dto.rb +21 -18
- data/lib/songtradr_api_client_ruby/models/save_recording_genre_dto.rb +15 -18
- data/lib/songtradr_api_client_ruby/models/save_recording_party_dto.rb +17 -18
- data/lib/songtradr_api_client_ruby/models/save_recording_playlist_dto.rb +17 -18
- data/lib/songtradr_api_client_ruby/models/save_recording_tag_dto.rb +15 -18
- data/lib/songtradr_api_client_ruby/models/save_referrer_dto.rb +13 -18
- data/lib/songtradr_api_client_ruby/models/save_taggrams_dto.rb +13 -18
- data/lib/songtradr_api_client_ruby/models/save_user_dto.rb +15 -18
- data/lib/songtradr_api_client_ruby/models/search_filter_values_dto.rb +95 -18
- data/lib/songtradr_api_client_ruby/models/search_recording_granular_abstraction_dto.rb +15 -18
- data/lib/songtradr_api_client_ruby/models/search_recording_granular_dto.rb +15 -18
- data/lib/songtradr_api_client_ruby/models/sign_up_dto.rb +19 -18
- data/lib/songtradr_api_client_ruby/models/tag_dto.rb +17 -18
- data/lib/songtradr_api_client_ruby/models/tag_small_dto.rb +17 -18
- data/lib/songtradr_api_client_ruby/models/taggram_dto.rb +17 -18
- data/lib/songtradr_api_client_ruby/models/tags_summary_dto.rb +17 -18
- data/lib/songtradr_api_client_ruby/models/tagstrength_dto.rb +17 -18
- data/lib/songtradr_api_client_ruby/models/title_dto.rb +15 -18
- data/lib/songtradr_api_client_ruby/models/token_request.rb +15 -18
- data/lib/songtradr_api_client_ruby/models/track_to_medium_product_dto.rb +17 -18
- data/lib/songtradr_api_client_ruby/models/update_password_dto.rb +17 -18
- data/lib/songtradr_api_client_ruby/models/usage_dto.rb +13 -18
- data/lib/songtradr_api_client_ruby/models/user_dto.rb +210 -19
- data/lib/songtradr_api_client_ruby/version.rb +2 -2
- data/lib/songtradr_api_client_ruby.rb +5 -1
- data/openapi-generator-config.yaml +1 -1
- data/songtradr_api_client_ruby.gemspec +1 -1
- data/spec/api/allowed_values_api_spec.rb +2 -2
- data/spec/api/api_keys_api_spec.rb +70 -0
- data/spec/api/party_api_spec.rb +1 -1
- data/spec/api/playlist_api_spec.rb +1 -1
- data/spec/api/recording_api_spec.rb +2 -1
- data/spec/api/user_api_spec.rb +3 -1
- data/spec/api_client_spec.rb +1 -1
- data/spec/configuration_spec.rb +1 -1
- data/spec/models/admin_api_user_dto_spec.rb +190 -0
- data/spec/models/api_key_dto_spec.rb +52 -0
- data/spec/models/category_medium_dto_spec.rb +1 -1
- data/spec/models/category_minimal_dto_spec.rb +1 -1
- data/spec/models/config_access_dto_spec.rb +1 -1
- data/spec/models/config_identifier_dto_spec.rb +1 -1
- data/spec/models/contributor_type_dto_spec.rb +1 -1
- data/spec/models/create_api_key_dto_spec.rb +34 -0
- data/spec/models/error_response_spec.rb +1 -1
- data/spec/models/field_summary_dto_spec.rb +1 -1
- data/spec/models/file_dto_spec.rb +1 -1
- data/spec/models/file_list_dto_spec.rb +1 -1
- data/spec/models/file_minimal_with_url_dto_spec.rb +1 -1
- data/spec/models/file_small_dto_spec.rb +15 -15
- data/spec/models/file_upload_dto_spec.rb +1 -1
- data/spec/models/file_w_ith_url_dto_spec.rb +1 -1
- data/spec/models/files_summary_dto_spec.rb +1 -1
- data/spec/models/forgot_password_dto_spec.rb +1 -1
- data/spec/models/genre_dto_spec.rb +1 -1
- data/spec/models/genre_minimal_dto_spec.rb +1 -1
- data/spec/models/genres_summary_dto_spec.rb +1 -1
- data/spec/models/init_put_recording_audio_dto_spec.rb +1 -1
- data/spec/models/jwt_token_dto_spec.rb +1 -1
- data/spec/models/login_dto_spec.rb +1 -1
- data/spec/models/musical_features_dto_spec.rb +175 -175
- data/spec/models/p_line_dto_spec.rb +1 -1
- data/spec/models/party_large_dto_spec.rb +1 -1
- data/spec/models/party_small_dto_spec.rb +1 -1
- data/spec/models/playlist_large_dto_spec.rb +10 -10
- data/spec/models/product_medium_dto_spec.rb +7 -7
- data/spec/models/product_party_dto_spec.rb +1 -1
- data/spec/models/recording_for_similarity_search_dto_spec.rb +1 -1
- data/spec/models/recording_genre_prediction_dto_spec.rb +3 -3
- data/spec/models/recording_large_dto_spec.rb +12 -12
- data/spec/models/recording_list_dto_spec.rb +1 -1
- data/spec/models/recording_medium_dto_spec.rb +9 -9
- data/spec/models/recording_minimal_with_musical_features_dto_spec.rb +3 -3
- data/spec/models/recording_minimal_with_taggrams_dto_spec.rb +1 -1
- data/spec/models/recording_minimal_with_tagstrengths_dto_spec.rb +1 -1
- data/spec/models/recording_party_dto_spec.rb +1 -1
- data/spec/models/recording_playlist_dto_spec.rb +4 -4
- data/spec/models/recording_small_dto_spec.rb +4 -4
- data/spec/models/recording_tag_small_dto_spec.rb +1 -1
- data/spec/models/save_file_recording_dto_spec.rb +1 -1
- data/spec/models/save_playlist_dto_spec.rb +1 -1
- data/spec/models/save_recording_genre_dto_spec.rb +1 -1
- data/spec/models/save_recording_party_dto_spec.rb +1 -1
- data/spec/models/save_recording_playlist_dto_spec.rb +1 -1
- data/spec/models/save_recording_tag_dto_spec.rb +1 -1
- data/spec/models/save_referrer_dto_spec.rb +1 -1
- data/spec/models/save_taggrams_dto_spec.rb +1 -1
- data/spec/models/save_user_dto_spec.rb +1 -1
- data/spec/models/search_filter_values_dto_spec.rb +1 -1
- data/spec/models/search_recording_granular_abstraction_dto_spec.rb +1 -1
- data/spec/models/search_recording_granular_dto_spec.rb +1 -1
- data/spec/models/sign_up_dto_spec.rb +1 -1
- data/spec/models/tag_dto_spec.rb +1 -1
- data/spec/models/tag_small_dto_spec.rb +1 -1
- data/spec/models/taggram_dto_spec.rb +1 -1
- data/spec/models/tags_summary_dto_spec.rb +1 -1
- data/spec/models/tagstrength_dto_spec.rb +1 -1
- data/spec/models/title_dto_spec.rb +1 -1
- data/spec/models/token_request_spec.rb +1 -1
- data/spec/models/track_to_medium_product_dto_spec.rb +1 -1
- data/spec/models/update_password_dto_spec.rb +1 -1
- data/spec/models/usage_dto_spec.rb +1 -1
- data/spec/models/user_dto_spec.rb +61 -1
- data/spec/spec_helper.rb +1 -1
- metadata +72 -56
|
@@ -0,0 +1,262 @@
|
|
|
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.24
|
|
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
|
+
class ApiKeyDTO
|
|
18
|
+
attr_accessor :name
|
|
19
|
+
|
|
20
|
+
attr_accessor :last_used_at
|
|
21
|
+
|
|
22
|
+
attr_accessor :created_at
|
|
23
|
+
|
|
24
|
+
attr_accessor :id
|
|
25
|
+
|
|
26
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
27
|
+
def self.attribute_map
|
|
28
|
+
{
|
|
29
|
+
:'name' => :'name',
|
|
30
|
+
:'last_used_at' => :'lastUsedAt',
|
|
31
|
+
:'created_at' => :'createdAt',
|
|
32
|
+
:'id' => :'id'
|
|
33
|
+
}
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Returns all the JSON keys this model knows about
|
|
37
|
+
def self.acceptable_attributes
|
|
38
|
+
attribute_map.values
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Attribute type mapping.
|
|
42
|
+
def self.openapi_types
|
|
43
|
+
{
|
|
44
|
+
:'name' => :'String',
|
|
45
|
+
:'last_used_at' => :'Time',
|
|
46
|
+
:'created_at' => :'Time',
|
|
47
|
+
:'id' => :'String'
|
|
48
|
+
}
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# List of attributes with nullable: true
|
|
52
|
+
def self.openapi_nullable
|
|
53
|
+
Set.new([
|
|
54
|
+
])
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# Initializes the object
|
|
58
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
59
|
+
def initialize(attributes = {})
|
|
60
|
+
if (!attributes.is_a?(Hash))
|
|
61
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `SongtradrApiClientRuby::ApiKeyDTO` initialize method"
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
65
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
66
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
67
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `SongtradrApiClientRuby::ApiKeyDTO`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
68
|
+
end
|
|
69
|
+
h[k.to_sym] = v
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if attributes.key?(:'name')
|
|
73
|
+
self.name = attributes[:'name']
|
|
74
|
+
else
|
|
75
|
+
self.name = nil
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
if attributes.key?(:'last_used_at')
|
|
79
|
+
self.last_used_at = attributes[:'last_used_at']
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
if attributes.key?(:'created_at')
|
|
83
|
+
self.created_at = attributes[:'created_at']
|
|
84
|
+
else
|
|
85
|
+
self.created_at = nil
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
if attributes.key?(:'id')
|
|
89
|
+
self.id = attributes[:'id']
|
|
90
|
+
else
|
|
91
|
+
self.id = nil
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
96
|
+
# @return Array for valid properties with the reasons
|
|
97
|
+
def list_invalid_properties
|
|
98
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
99
|
+
invalid_properties = Array.new
|
|
100
|
+
if @name.nil?
|
|
101
|
+
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
if @created_at.nil?
|
|
105
|
+
invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
if @id.nil?
|
|
109
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
invalid_properties
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
# Check to see if the all the properties in the model are valid
|
|
116
|
+
# @return true if the model is valid
|
|
117
|
+
def valid?
|
|
118
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
119
|
+
return false if @name.nil?
|
|
120
|
+
return false if @created_at.nil?
|
|
121
|
+
return false if @id.nil?
|
|
122
|
+
true
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
# Checks equality by comparing each attribute.
|
|
126
|
+
# @param [Object] Object to be compared
|
|
127
|
+
def ==(o)
|
|
128
|
+
return true if self.equal?(o)
|
|
129
|
+
self.class == o.class &&
|
|
130
|
+
name == o.name &&
|
|
131
|
+
last_used_at == o.last_used_at &&
|
|
132
|
+
created_at == o.created_at &&
|
|
133
|
+
id == o.id
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
# @see the `==` method
|
|
137
|
+
# @param [Object] Object to be compared
|
|
138
|
+
def eql?(o)
|
|
139
|
+
self == o
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
# Calculates hash code according to all attributes.
|
|
143
|
+
# @return [Integer] Hash code
|
|
144
|
+
def hash
|
|
145
|
+
[name, last_used_at, created_at, id].hash
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
# Builds the object from hash
|
|
149
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
150
|
+
# @return [Object] Returns the model itself
|
|
151
|
+
def self.build_from_hash(attributes)
|
|
152
|
+
return nil unless attributes.is_a?(Hash)
|
|
153
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
154
|
+
transformed_hash = {}
|
|
155
|
+
openapi_types.each_pair do |key, type|
|
|
156
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
157
|
+
transformed_hash["#{key}"] = nil
|
|
158
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
159
|
+
# check to ensure the input is an array given that the attribute
|
|
160
|
+
# is documented as an array but the input is not
|
|
161
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
162
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
163
|
+
end
|
|
164
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
165
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
166
|
+
end
|
|
167
|
+
end
|
|
168
|
+
new(transformed_hash)
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
# Deserializes the data based on type
|
|
172
|
+
# @param string type Data type
|
|
173
|
+
# @param string value Value to be deserialized
|
|
174
|
+
# @return [Object] Deserialized data
|
|
175
|
+
def self._deserialize(type, value)
|
|
176
|
+
case type.to_sym
|
|
177
|
+
when :Time
|
|
178
|
+
Time.parse(value)
|
|
179
|
+
when :Date
|
|
180
|
+
Date.parse(value)
|
|
181
|
+
when :String
|
|
182
|
+
value.to_s
|
|
183
|
+
when :Integer
|
|
184
|
+
value.to_i
|
|
185
|
+
when :Float
|
|
186
|
+
value.to_f
|
|
187
|
+
when :Boolean
|
|
188
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
189
|
+
true
|
|
190
|
+
else
|
|
191
|
+
false
|
|
192
|
+
end
|
|
193
|
+
when :Object
|
|
194
|
+
# generic object (usually a Hash), return directly
|
|
195
|
+
value
|
|
196
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
197
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
198
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
199
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
200
|
+
k_type = Regexp.last_match[:k_type]
|
|
201
|
+
v_type = Regexp.last_match[:v_type]
|
|
202
|
+
{}.tap do |hash|
|
|
203
|
+
value.each do |k, v|
|
|
204
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
205
|
+
end
|
|
206
|
+
end
|
|
207
|
+
else # model
|
|
208
|
+
# models (e.g. Pet) or oneOf
|
|
209
|
+
klass = SongtradrApiClientRuby.const_get(type)
|
|
210
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
211
|
+
end
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
# Returns the string representation of the object
|
|
215
|
+
# @return [String] String presentation of the object
|
|
216
|
+
def to_s
|
|
217
|
+
to_hash.to_s
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
221
|
+
# @return [Hash] Returns the object in the form of hash
|
|
222
|
+
def to_body
|
|
223
|
+
to_hash
|
|
224
|
+
end
|
|
225
|
+
|
|
226
|
+
# Returns the object in the form of hash
|
|
227
|
+
# @return [Hash] Returns the object in the form of hash
|
|
228
|
+
def to_hash
|
|
229
|
+
hash = {}
|
|
230
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
231
|
+
value = self.send(attr)
|
|
232
|
+
if value.nil?
|
|
233
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
234
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
235
|
+
end
|
|
236
|
+
|
|
237
|
+
hash[param] = _to_hash(value)
|
|
238
|
+
end
|
|
239
|
+
hash
|
|
240
|
+
end
|
|
241
|
+
|
|
242
|
+
# Outputs non-array value in the form of hash
|
|
243
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
244
|
+
# @param [Object] value Any valid value
|
|
245
|
+
# @return [Hash] Returns the value in the form of hash
|
|
246
|
+
def _to_hash(value)
|
|
247
|
+
if value.is_a?(Array)
|
|
248
|
+
value.compact.map { |v| _to_hash(v) }
|
|
249
|
+
elsif value.is_a?(Hash)
|
|
250
|
+
{}.tap do |hash|
|
|
251
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
252
|
+
end
|
|
253
|
+
elsif value.respond_to? :to_hash
|
|
254
|
+
value.to_hash
|
|
255
|
+
else
|
|
256
|
+
value
|
|
257
|
+
end
|
|
258
|
+
end
|
|
259
|
+
|
|
260
|
+
end
|
|
261
|
+
|
|
262
|
+
end
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
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
5
|
|
|
6
|
-
The version of the OpenAPI document: 1.12.
|
|
6
|
+
The version of the OpenAPI document: 1.12.24
|
|
7
7
|
Contact: info@songtradr.com
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
OpenAPI Generator version: 7.0.0-SNAPSHOT
|
|
@@ -68,10 +68,14 @@ module SongtradrApiClientRuby
|
|
|
68
68
|
|
|
69
69
|
if attributes.key?(:'id')
|
|
70
70
|
self.id = attributes[:'id']
|
|
71
|
+
else
|
|
72
|
+
self.id = nil
|
|
71
73
|
end
|
|
72
74
|
|
|
73
75
|
if attributes.key?(:'name')
|
|
74
76
|
self.name = attributes[:'name']
|
|
77
|
+
else
|
|
78
|
+
self.name = nil
|
|
75
79
|
end
|
|
76
80
|
|
|
77
81
|
if attributes.key?(:'tags')
|
|
@@ -84,6 +88,7 @@ module SongtradrApiClientRuby
|
|
|
84
88
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
85
89
|
# @return Array for valid properties with the reasons
|
|
86
90
|
def list_invalid_properties
|
|
91
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
87
92
|
invalid_properties = Array.new
|
|
88
93
|
if @id.nil?
|
|
89
94
|
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
|
@@ -99,6 +104,7 @@ module SongtradrApiClientRuby
|
|
|
99
104
|
# Check to see if the all the properties in the model are valid
|
|
100
105
|
# @return true if the model is valid
|
|
101
106
|
def valid?
|
|
107
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
102
108
|
return false if @id.nil?
|
|
103
109
|
return false if @name.nil?
|
|
104
110
|
true
|
|
@@ -130,37 +136,30 @@ module SongtradrApiClientRuby
|
|
|
130
136
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
131
137
|
# @return [Object] Returns the model itself
|
|
132
138
|
def self.build_from_hash(attributes)
|
|
133
|
-
new.build_from_hash(attributes)
|
|
134
|
-
end
|
|
135
|
-
|
|
136
|
-
# Builds the object from hash
|
|
137
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
|
138
|
-
# @return [Object] Returns the model itself
|
|
139
|
-
def build_from_hash(attributes)
|
|
140
139
|
return nil unless attributes.is_a?(Hash)
|
|
141
140
|
attributes = attributes.transform_keys(&:to_sym)
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
141
|
+
transformed_hash = {}
|
|
142
|
+
openapi_types.each_pair do |key, type|
|
|
143
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
144
|
+
transformed_hash["#{key}"] = nil
|
|
145
145
|
elsif type =~ /\AArray<(.*)>/i
|
|
146
146
|
# check to ensure the input is an array given that the attribute
|
|
147
147
|
# is documented as an array but the input is not
|
|
148
|
-
if attributes[
|
|
149
|
-
|
|
148
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
149
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
150
150
|
end
|
|
151
|
-
elsif !attributes[
|
|
152
|
-
|
|
151
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
152
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
153
153
|
end
|
|
154
154
|
end
|
|
155
|
-
|
|
156
|
-
self
|
|
155
|
+
new(transformed_hash)
|
|
157
156
|
end
|
|
158
157
|
|
|
159
158
|
# Deserializes the data based on type
|
|
160
159
|
# @param string type Data type
|
|
161
160
|
# @param string value Value to be deserialized
|
|
162
161
|
# @return [Object] Deserialized data
|
|
163
|
-
def _deserialize(type, value)
|
|
162
|
+
def self._deserialize(type, value)
|
|
164
163
|
case type.to_sym
|
|
165
164
|
when :Time
|
|
166
165
|
Time.parse(value)
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
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
5
|
|
|
6
|
-
The version of the OpenAPI document: 1.12.
|
|
6
|
+
The version of the OpenAPI document: 1.12.24
|
|
7
7
|
Contact: info@songtradr.com
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
OpenAPI Generator version: 7.0.0-SNAPSHOT
|
|
@@ -60,12 +60,15 @@ module SongtradrApiClientRuby
|
|
|
60
60
|
|
|
61
61
|
if attributes.key?(:'category_name')
|
|
62
62
|
self.category_name = attributes[:'category_name']
|
|
63
|
+
else
|
|
64
|
+
self.category_name = nil
|
|
63
65
|
end
|
|
64
66
|
end
|
|
65
67
|
|
|
66
68
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
67
69
|
# @return Array for valid properties with the reasons
|
|
68
70
|
def list_invalid_properties
|
|
71
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
69
72
|
invalid_properties = Array.new
|
|
70
73
|
if @category_name.nil?
|
|
71
74
|
invalid_properties.push('invalid value for "category_name", category_name cannot be nil.')
|
|
@@ -77,6 +80,7 @@ module SongtradrApiClientRuby
|
|
|
77
80
|
# Check to see if the all the properties in the model are valid
|
|
78
81
|
# @return true if the model is valid
|
|
79
82
|
def valid?
|
|
83
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
80
84
|
return false if @category_name.nil?
|
|
81
85
|
true
|
|
82
86
|
end
|
|
@@ -105,37 +109,30 @@ module SongtradrApiClientRuby
|
|
|
105
109
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
106
110
|
# @return [Object] Returns the model itself
|
|
107
111
|
def self.build_from_hash(attributes)
|
|
108
|
-
new.build_from_hash(attributes)
|
|
109
|
-
end
|
|
110
|
-
|
|
111
|
-
# Builds the object from hash
|
|
112
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
|
113
|
-
# @return [Object] Returns the model itself
|
|
114
|
-
def build_from_hash(attributes)
|
|
115
112
|
return nil unless attributes.is_a?(Hash)
|
|
116
113
|
attributes = attributes.transform_keys(&:to_sym)
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
114
|
+
transformed_hash = {}
|
|
115
|
+
openapi_types.each_pair do |key, type|
|
|
116
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
117
|
+
transformed_hash["#{key}"] = nil
|
|
120
118
|
elsif type =~ /\AArray<(.*)>/i
|
|
121
119
|
# check to ensure the input is an array given that the attribute
|
|
122
120
|
# is documented as an array but the input is not
|
|
123
|
-
if attributes[
|
|
124
|
-
|
|
121
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
122
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
125
123
|
end
|
|
126
|
-
elsif !attributes[
|
|
127
|
-
|
|
124
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
125
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
128
126
|
end
|
|
129
127
|
end
|
|
130
|
-
|
|
131
|
-
self
|
|
128
|
+
new(transformed_hash)
|
|
132
129
|
end
|
|
133
130
|
|
|
134
131
|
# Deserializes the data based on type
|
|
135
132
|
# @param string type Data type
|
|
136
133
|
# @param string value Value to be deserialized
|
|
137
134
|
# @return [Object] Deserialized data
|
|
138
|
-
def _deserialize(type, value)
|
|
135
|
+
def self._deserialize(type, value)
|
|
139
136
|
case type.to_sym
|
|
140
137
|
when :Time
|
|
141
138
|
Time.parse(value)
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
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
5
|
|
|
6
|
-
The version of the OpenAPI document: 1.12.
|
|
6
|
+
The version of the OpenAPI document: 1.12.24
|
|
7
7
|
Contact: info@songtradr.com
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
OpenAPI Generator version: 7.0.0-SNAPSHOT
|
|
@@ -88,16 +88,21 @@ module SongtradrApiClientRuby
|
|
|
88
88
|
|
|
89
89
|
if attributes.key?(:'accessor_id')
|
|
90
90
|
self.accessor_id = attributes[:'accessor_id']
|
|
91
|
+
else
|
|
92
|
+
self.accessor_id = nil
|
|
91
93
|
end
|
|
92
94
|
|
|
93
95
|
if attributes.key?(:'rights')
|
|
94
96
|
self.rights = attributes[:'rights']
|
|
97
|
+
else
|
|
98
|
+
self.rights = nil
|
|
95
99
|
end
|
|
96
100
|
end
|
|
97
101
|
|
|
98
102
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
99
103
|
# @return Array for valid properties with the reasons
|
|
100
104
|
def list_invalid_properties
|
|
105
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
101
106
|
invalid_properties = Array.new
|
|
102
107
|
if @accessor_id.nil?
|
|
103
108
|
invalid_properties.push('invalid value for "accessor_id", accessor_id cannot be nil.')
|
|
@@ -113,6 +118,7 @@ module SongtradrApiClientRuby
|
|
|
113
118
|
# Check to see if the all the properties in the model are valid
|
|
114
119
|
# @return true if the model is valid
|
|
115
120
|
def valid?
|
|
121
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
116
122
|
return false if @accessor_id.nil?
|
|
117
123
|
accessor_id_validator = EnumAttributeValidator.new('String', ["full", "readOnly"])
|
|
118
124
|
return false unless accessor_id_validator.valid?(@accessor_id)
|
|
@@ -167,37 +173,30 @@ module SongtradrApiClientRuby
|
|
|
167
173
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
168
174
|
# @return [Object] Returns the model itself
|
|
169
175
|
def self.build_from_hash(attributes)
|
|
170
|
-
new.build_from_hash(attributes)
|
|
171
|
-
end
|
|
172
|
-
|
|
173
|
-
# Builds the object from hash
|
|
174
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
|
175
|
-
# @return [Object] Returns the model itself
|
|
176
|
-
def build_from_hash(attributes)
|
|
177
176
|
return nil unless attributes.is_a?(Hash)
|
|
178
177
|
attributes = attributes.transform_keys(&:to_sym)
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
178
|
+
transformed_hash = {}
|
|
179
|
+
openapi_types.each_pair do |key, type|
|
|
180
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
181
|
+
transformed_hash["#{key}"] = nil
|
|
182
182
|
elsif type =~ /\AArray<(.*)>/i
|
|
183
183
|
# check to ensure the input is an array given that the attribute
|
|
184
184
|
# is documented as an array but the input is not
|
|
185
|
-
if attributes[
|
|
186
|
-
|
|
185
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
186
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
187
187
|
end
|
|
188
|
-
elsif !attributes[
|
|
189
|
-
|
|
188
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
189
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
190
190
|
end
|
|
191
191
|
end
|
|
192
|
-
|
|
193
|
-
self
|
|
192
|
+
new(transformed_hash)
|
|
194
193
|
end
|
|
195
194
|
|
|
196
195
|
# Deserializes the data based on type
|
|
197
196
|
# @param string type Data type
|
|
198
197
|
# @param string value Value to be deserialized
|
|
199
198
|
# @return [Object] Deserialized data
|
|
200
|
-
def _deserialize(type, value)
|
|
199
|
+
def self._deserialize(type, value)
|
|
201
200
|
case type.to_sym
|
|
202
201
|
when :Time
|
|
203
202
|
Time.parse(value)
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
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
5
|
|
|
6
|
-
The version of the OpenAPI document: 1.12.
|
|
6
|
+
The version of the OpenAPI document: 1.12.24
|
|
7
7
|
Contact: info@songtradr.com
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
OpenAPI Generator version: 7.0.0-SNAPSHOT
|
|
@@ -64,16 +64,21 @@ module SongtradrApiClientRuby
|
|
|
64
64
|
|
|
65
65
|
if attributes.key?(:'identifier_type')
|
|
66
66
|
self.identifier_type = attributes[:'identifier_type']
|
|
67
|
+
else
|
|
68
|
+
self.identifier_type = nil
|
|
67
69
|
end
|
|
68
70
|
|
|
69
71
|
if attributes.key?(:'identifier_value')
|
|
70
72
|
self.identifier_value = attributes[:'identifier_value']
|
|
73
|
+
else
|
|
74
|
+
self.identifier_value = nil
|
|
71
75
|
end
|
|
72
76
|
end
|
|
73
77
|
|
|
74
78
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
75
79
|
# @return Array for valid properties with the reasons
|
|
76
80
|
def list_invalid_properties
|
|
81
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
77
82
|
invalid_properties = Array.new
|
|
78
83
|
if @identifier_type.nil?
|
|
79
84
|
invalid_properties.push('invalid value for "identifier_type", identifier_type cannot be nil.')
|
|
@@ -89,6 +94,7 @@ module SongtradrApiClientRuby
|
|
|
89
94
|
# Check to see if the all the properties in the model are valid
|
|
90
95
|
# @return true if the model is valid
|
|
91
96
|
def valid?
|
|
97
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
92
98
|
return false if @identifier_type.nil?
|
|
93
99
|
return false if @identifier_value.nil?
|
|
94
100
|
true
|
|
@@ -119,37 +125,30 @@ module SongtradrApiClientRuby
|
|
|
119
125
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
120
126
|
# @return [Object] Returns the model itself
|
|
121
127
|
def self.build_from_hash(attributes)
|
|
122
|
-
new.build_from_hash(attributes)
|
|
123
|
-
end
|
|
124
|
-
|
|
125
|
-
# Builds the object from hash
|
|
126
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
|
127
|
-
# @return [Object] Returns the model itself
|
|
128
|
-
def build_from_hash(attributes)
|
|
129
128
|
return nil unless attributes.is_a?(Hash)
|
|
130
129
|
attributes = attributes.transform_keys(&:to_sym)
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
130
|
+
transformed_hash = {}
|
|
131
|
+
openapi_types.each_pair do |key, type|
|
|
132
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
133
|
+
transformed_hash["#{key}"] = nil
|
|
134
134
|
elsif type =~ /\AArray<(.*)>/i
|
|
135
135
|
# check to ensure the input is an array given that the attribute
|
|
136
136
|
# is documented as an array but the input is not
|
|
137
|
-
if attributes[
|
|
138
|
-
|
|
137
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
138
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
139
139
|
end
|
|
140
|
-
elsif !attributes[
|
|
141
|
-
|
|
140
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
141
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
142
142
|
end
|
|
143
143
|
end
|
|
144
|
-
|
|
145
|
-
self
|
|
144
|
+
new(transformed_hash)
|
|
146
145
|
end
|
|
147
146
|
|
|
148
147
|
# Deserializes the data based on type
|
|
149
148
|
# @param string type Data type
|
|
150
149
|
# @param string value Value to be deserialized
|
|
151
150
|
# @return [Object] Deserialized data
|
|
152
|
-
def _deserialize(type, value)
|
|
151
|
+
def self._deserialize(type, value)
|
|
153
152
|
case type.to_sym
|
|
154
153
|
when :Time
|
|
155
154
|
Time.parse(value)
|