songtradr_api_client_ruby 1.13.7 → 1.16.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +5 -5
- data/README.md +5 -37
- data/docs/FileSmallDTO.md +2 -2
- data/docs/MusicalFeaturesDTO.md +25 -25
- data/docs/PlaylistApi.md +0 -214
- data/docs/RecordingApi.md +2 -204
- data/docs/RecordingGenrePredictionDTO.md +3 -3
- data/docs/RecordingMediumDTO.md +2 -2
- data/docs/RecordingPartyDTO.md +3 -3
- data/docs/UserApi.md +8 -456
- data/lib/songtradr_api_client_ruby/api/allowed_values_api.rb +2 -2
- data/lib/songtradr_api_client_ruby/api/playlist_api.rb +2 -202
- data/lib/songtradr_api_client_ruby/api/recording_api.rb +6 -191
- data/lib/songtradr_api_client_ruby/api/user_api.rb +161 -749
- data/lib/songtradr_api_client_ruby/api_client.rb +38 -36
- data/lib/songtradr_api_client_ruby/api_error.rb +2 -2
- data/lib/songtradr_api_client_ruby/configuration.rb +2 -2
- data/lib/songtradr_api_client_ruby/models/age_range.rb +3 -3
- data/lib/songtradr_api_client_ruby/models/beard.rb +3 -3
- data/lib/songtradr_api_client_ruby/models/bounding_box.rb +3 -3
- data/lib/songtradr_api_client_ruby/models/category_medium_dto.rb +3 -3
- data/lib/songtradr_api_client_ruby/models/category_minimal_dto.rb +3 -3
- data/lib/songtradr_api_client_ruby/models/config_access_dto.rb +3 -3
- data/lib/songtradr_api_client_ruby/models/config_identifier_dto.rb +3 -3
- data/lib/songtradr_api_client_ruby/models/contributor_type_dto.rb +3 -3
- data/lib/songtradr_api_client_ruby/models/curate_playlist_dto.rb +3 -3
- data/lib/songtradr_api_client_ruby/models/curate_playlist_response_dto.rb +3 -3
- data/lib/songtradr_api_client_ruby/models/dominant_color.rb +3 -3
- data/lib/songtradr_api_client_ruby/models/emotion.rb +3 -3
- data/lib/songtradr_api_client_ruby/models/error_response.rb +3 -3
- data/lib/songtradr_api_client_ruby/models/eye_direction.rb +3 -3
- data/lib/songtradr_api_client_ruby/models/eye_open.rb +3 -3
- data/lib/songtradr_api_client_ruby/models/eyeglasses.rb +3 -3
- data/lib/songtradr_api_client_ruby/models/face_detail.rb +3 -3
- data/lib/songtradr_api_client_ruby/models/face_detection.rb +3 -3
- data/lib/songtradr_api_client_ruby/models/face_occluded.rb +3 -3
- data/lib/songtradr_api_client_ruby/models/field_summary_dto.rb +3 -3
- data/lib/songtradr_api_client_ruby/models/file_dto.rb +3 -3
- data/lib/songtradr_api_client_ruby/models/file_list_dto.rb +3 -3
- data/lib/songtradr_api_client_ruby/models/file_small_dto.rb +15 -15
- data/lib/songtradr_api_client_ruby/models/file_upload_dto.rb +3 -3
- data/lib/songtradr_api_client_ruby/models/file_w_ith_url_dto.rb +3 -3
- data/lib/songtradr_api_client_ruby/models/files_summary_dto.rb +3 -3
- data/lib/songtradr_api_client_ruby/models/forgot_password_dto.rb +3 -3
- data/lib/songtradr_api_client_ruby/models/gender.rb +3 -3
- data/lib/songtradr_api_client_ruby/models/genre_dto.rb +3 -3
- data/lib/songtradr_api_client_ruby/models/genre_minimal_dto.rb +3 -3
- data/lib/songtradr_api_client_ruby/models/genres_summary_dto.rb +3 -3
- data/lib/songtradr_api_client_ruby/models/image_quality.rb +3 -3
- data/lib/songtradr_api_client_ruby/models/image_recognition_response.rb +3 -3
- data/lib/songtradr_api_client_ruby/models/init_put_recording_audio_dto.rb +3 -3
- data/lib/songtradr_api_client_ruby/models/instance.rb +3 -3
- data/lib/songtradr_api_client_ruby/models/jwt_token_dto.rb +3 -3
- data/lib/songtradr_api_client_ruby/models/label.rb +3 -3
- data/lib/songtradr_api_client_ruby/models/label_alias.rb +3 -3
- data/lib/songtradr_api_client_ruby/models/label_category.rb +3 -3
- data/lib/songtradr_api_client_ruby/models/label_detection.rb +3 -3
- data/lib/songtradr_api_client_ruby/models/landmark.rb +3 -3
- data/lib/songtradr_api_client_ruby/models/login_dto.rb +3 -3
- data/lib/songtradr_api_client_ruby/models/mouth_open.rb +3 -3
- data/lib/songtradr_api_client_ruby/models/musical_features_dto.rb +270 -270
- data/lib/songtradr_api_client_ruby/models/mustache.rb +3 -3
- data/lib/songtradr_api_client_ruby/models/parent.rb +3 -3
- data/lib/songtradr_api_client_ruby/models/party_small_dto.rb +3 -3
- data/lib/songtradr_api_client_ruby/models/pose.rb +3 -3
- data/lib/songtradr_api_client_ruby/models/recording_for_similarity_search_dto.rb +3 -3
- data/lib/songtradr_api_client_ruby/models/recording_genre_prediction_dto.rb +23 -23
- data/lib/songtradr_api_client_ruby/models/recording_list_dto.rb +3 -3
- data/lib/songtradr_api_client_ruby/models/recording_medium_dto.rb +13 -13
- data/lib/songtradr_api_client_ruby/models/recording_minimal_with_musical_features_dto.rb +3 -3
- data/lib/songtradr_api_client_ruby/models/recording_minimal_with_taggrams_dto.rb +3 -3
- data/lib/songtradr_api_client_ruby/models/recording_minimal_with_tagstrengths_dto.rb +3 -3
- data/lib/songtradr_api_client_ruby/models/recording_party_dto.rb +18 -18
- data/lib/songtradr_api_client_ruby/models/recording_small_dto.rb +3 -3
- data/lib/songtradr_api_client_ruby/models/recording_tag_small_dto.rb +3 -3
- data/lib/songtradr_api_client_ruby/models/save_user_dto.rb +3 -3
- data/lib/songtradr_api_client_ruby/models/search_filter_values_dto.rb +3 -3
- data/lib/songtradr_api_client_ruby/models/search_recording_granular_dto.rb +3 -3
- data/lib/songtradr_api_client_ruby/models/sign_up_dto.rb +3 -3
- data/lib/songtradr_api_client_ruby/models/smile.rb +3 -3
- data/lib/songtradr_api_client_ruby/models/sunglasses.rb +3 -3
- data/lib/songtradr_api_client_ruby/models/tag_dto.rb +3 -3
- data/lib/songtradr_api_client_ruby/models/tag_small_dto.rb +3 -3
- data/lib/songtradr_api_client_ruby/models/taggram_dto.rb +3 -3
- data/lib/songtradr_api_client_ruby/models/tags_summary_dto.rb +3 -3
- data/lib/songtradr_api_client_ruby/models/tagstrength_dto.rb +3 -3
- data/lib/songtradr_api_client_ruby/models/title_dto.rb +3 -3
- data/lib/songtradr_api_client_ruby/models/token_request.rb +3 -3
- data/lib/songtradr_api_client_ruby/models/track_dto.rb +3 -3
- data/lib/songtradr_api_client_ruby/models/update_password_dto.rb +3 -3
- data/lib/songtradr_api_client_ruby/models/user_dto.rb +3 -3
- data/lib/songtradr_api_client_ruby/models/video_recognition_response.rb +3 -3
- data/lib/songtradr_api_client_ruby/version.rb +3 -3
- data/lib/songtradr_api_client_ruby.rb +2 -23
- data/openapi-generator-config.yaml +1 -1
- data/songtradr_api_client_ruby.gemspec +3 -2
- data/spec/api/allowed_values_api_spec.rb +2 -2
- data/spec/api/playlist_api_spec.rb +2 -39
- data/spec/api/recording_api_spec.rb +3 -35
- data/spec/api/user_api_spec.rb +6 -111
- data/spec/api_client_spec.rb +2 -2
- data/spec/configuration_spec.rb +2 -2
- data/spec/models/age_range_spec.rb +2 -2
- data/spec/models/beard_spec.rb +2 -2
- data/spec/models/bounding_box_spec.rb +2 -2
- data/spec/models/category_medium_dto_spec.rb +2 -2
- data/spec/models/category_minimal_dto_spec.rb +2 -2
- data/spec/models/config_access_dto_spec.rb +2 -2
- data/spec/models/config_identifier_dto_spec.rb +2 -2
- data/spec/models/contributor_type_dto_spec.rb +2 -2
- data/spec/models/curate_playlist_dto_spec.rb +2 -2
- data/spec/models/curate_playlist_response_dto_spec.rb +2 -2
- data/spec/models/dominant_color_spec.rb +2 -2
- data/spec/models/emotion_spec.rb +2 -2
- data/spec/models/error_response_spec.rb +2 -2
- data/spec/models/eye_direction_spec.rb +2 -2
- data/spec/models/eye_open_spec.rb +2 -2
- data/spec/models/eyeglasses_spec.rb +2 -2
- data/spec/models/face_detail_spec.rb +2 -2
- data/spec/models/face_detection_spec.rb +2 -2
- data/spec/models/face_occluded_spec.rb +2 -2
- data/spec/models/field_summary_dto_spec.rb +2 -2
- data/spec/models/file_dto_spec.rb +2 -2
- data/spec/models/file_list_dto_spec.rb +2 -2
- data/spec/models/file_small_dto_spec.rb +5 -5
- data/spec/models/file_upload_dto_spec.rb +2 -2
- data/spec/models/file_w_ith_url_dto_spec.rb +2 -2
- data/spec/models/files_summary_dto_spec.rb +2 -2
- data/spec/models/forgot_password_dto_spec.rb +2 -2
- data/spec/models/gender_spec.rb +2 -2
- data/spec/models/genre_dto_spec.rb +2 -2
- data/spec/models/genre_minimal_dto_spec.rb +2 -2
- data/spec/models/genres_summary_dto_spec.rb +2 -2
- data/spec/models/image_quality_spec.rb +2 -2
- data/spec/models/image_recognition_response_spec.rb +2 -2
- data/spec/models/init_put_recording_audio_dto_spec.rb +2 -2
- data/spec/models/instance_spec.rb +2 -2
- data/spec/models/jwt_token_dto_spec.rb +2 -2
- data/spec/models/label_alias_spec.rb +2 -2
- data/spec/models/label_category_spec.rb +2 -2
- data/spec/models/label_detection_spec.rb +2 -2
- data/spec/models/label_spec.rb +2 -2
- data/spec/models/landmark_spec.rb +2 -2
- data/spec/models/login_dto_spec.rb +2 -2
- data/spec/models/mouth_open_spec.rb +2 -2
- data/spec/models/musical_features_dto_spec.rb +81 -81
- data/spec/models/mustache_spec.rb +2 -2
- data/spec/models/parent_spec.rb +2 -2
- data/spec/models/party_small_dto_spec.rb +2 -2
- data/spec/models/pose_spec.rb +2 -2
- data/spec/models/recording_for_similarity_search_dto_spec.rb +2 -2
- data/spec/models/recording_genre_prediction_dto_spec.rb +5 -5
- data/spec/models/recording_list_dto_spec.rb +2 -2
- data/spec/models/recording_medium_dto_spec.rb +4 -4
- data/spec/models/recording_minimal_with_musical_features_dto_spec.rb +2 -2
- data/spec/models/recording_minimal_with_taggrams_dto_spec.rb +2 -2
- data/spec/models/recording_minimal_with_tagstrengths_dto_spec.rb +2 -2
- data/spec/models/recording_party_dto_spec.rb +4 -4
- data/spec/models/recording_small_dto_spec.rb +2 -2
- data/spec/models/recording_tag_small_dto_spec.rb +2 -2
- data/spec/models/save_user_dto_spec.rb +2 -2
- data/spec/models/search_filter_values_dto_spec.rb +2 -2
- data/spec/models/search_recording_granular_dto_spec.rb +2 -2
- data/spec/models/sign_up_dto_spec.rb +2 -2
- data/spec/models/smile_spec.rb +2 -2
- data/spec/models/sunglasses_spec.rb +2 -2
- data/spec/models/tag_dto_spec.rb +2 -2
- data/spec/models/tag_small_dto_spec.rb +2 -2
- data/spec/models/taggram_dto_spec.rb +2 -2
- data/spec/models/tags_summary_dto_spec.rb +2 -2
- data/spec/models/tagstrength_dto_spec.rb +2 -2
- data/spec/models/title_dto_spec.rb +2 -2
- data/spec/models/token_request_spec.rb +2 -2
- data/spec/models/track_dto_spec.rb +2 -2
- data/spec/models/update_password_dto_spec.rb +2 -2
- data/spec/models/user_dto_spec.rb +2 -2
- data/spec/models/video_recognition_response_spec.rb +2 -2
- data/spec/spec_helper.rb +2 -2
- metadata +65 -149
- data/docs/ContextValue.md +0 -18
- data/docs/FileMinimalWithUrlDTO.md +0 -22
- data/docs/PLineDTO.md +0 -20
- data/docs/PartyApi.md +0 -75
- data/docs/PartyLargeDTO.md +0 -32
- data/docs/PlaylistLargeDTO.md +0 -38
- data/docs/ProductMediumDTO.md +0 -34
- data/docs/ProductPartyDTO.md +0 -20
- data/docs/RecordingLargeDTO.md +0 -40
- data/docs/RecordingPlaylistDTO.md +0 -24
- data/docs/SaveFileRecordingDTO.md +0 -240
- data/docs/SavePlaylistDTO.md +0 -34
- data/docs/SaveRecordingGenreDTO.md +0 -22
- data/docs/SaveRecordingPartyDTO.md +0 -20
- data/docs/SaveRecordingPlaylistDTO.md +0 -22
- data/docs/SaveRecordingTagDTO.md +0 -20
- data/docs/SaveReferrerDTO.md +0 -20
- data/docs/SaveTaggramsDTO.md +0 -82
- data/docs/SearchRecordingGranularAbstractionDTO.md +0 -20
- data/docs/TrackToMediumProductDTO.md +0 -22
- data/docs/UsageDTO.md +0 -18
- data/lib/songtradr_api_client_ruby/api/party_api.rb +0 -84
- data/lib/songtradr_api_client_ruby/models/context_value.rb +0 -216
- data/lib/songtradr_api_client_ruby/models/file_minimal_with_url_dto.rb +0 -254
- data/lib/songtradr_api_client_ruby/models/p_line_dto.rb +0 -231
- data/lib/songtradr_api_client_ruby/models/party_large_dto.rb +0 -285
- data/lib/songtradr_api_client_ruby/models/playlist_large_dto.rb +0 -350
- data/lib/songtradr_api_client_ruby/models/product_medium_dto.rb +0 -323
- data/lib/songtradr_api_client_ruby/models/product_party_dto.rb +0 -233
- data/lib/songtradr_api_client_ruby/models/recording_large_dto.rb +0 -383
- data/lib/songtradr_api_client_ruby/models/recording_playlist_dto.rb +0 -242
- data/lib/songtradr_api_client_ruby/models/save_file_recording_dto.rb +0 -1864
- data/lib/songtradr_api_client_ruby/models/save_playlist_dto.rb +0 -353
- data/lib/songtradr_api_client_ruby/models/save_recording_genre_dto.rb +0 -240
- data/lib/songtradr_api_client_ruby/models/save_recording_party_dto.rb +0 -272
- data/lib/songtradr_api_client_ruby/models/save_recording_playlist_dto.rb +0 -247
- data/lib/songtradr_api_client_ruby/models/save_recording_tag_dto.rb +0 -231
- data/lib/songtradr_api_client_ruby/models/save_referrer_dto.rb +0 -224
- data/lib/songtradr_api_client_ruby/models/save_taggrams_dto.rb +0 -569
- data/lib/songtradr_api_client_ruby/models/search_recording_granular_abstraction_dto.rb +0 -267
- data/lib/songtradr_api_client_ruby/models/track_to_medium_product_dto.rb +0 -247
- data/lib/songtradr_api_client_ruby/models/usage_dto.rb +0 -215
- data/spec/api/party_api_spec.rb +0 -46
- data/spec/models/context_value_spec.rb +0 -36
- data/spec/models/file_minimal_with_url_dto_spec.rb +0 -48
- data/spec/models/p_line_dto_spec.rb +0 -42
- data/spec/models/party_large_dto_spec.rb +0 -78
- data/spec/models/playlist_large_dto_spec.rb +0 -100
- data/spec/models/product_medium_dto_spec.rb +0 -84
- data/spec/models/product_party_dto_spec.rb +0 -42
- data/spec/models/recording_large_dto_spec.rb +0 -102
- data/spec/models/recording_playlist_dto_spec.rb +0 -54
- data/spec/models/save_file_recording_dto_spec.rb +0 -894
- data/spec/models/save_playlist_dto_spec.rb +0 -88
- data/spec/models/save_recording_genre_dto_spec.rb +0 -48
- data/spec/models/save_recording_party_dto_spec.rb +0 -46
- data/spec/models/save_recording_playlist_dto_spec.rb +0 -48
- data/spec/models/save_recording_tag_dto_spec.rb +0 -42
- data/spec/models/save_referrer_dto_spec.rb +0 -42
- data/spec/models/save_taggrams_dto_spec.rb +0 -228
- data/spec/models/search_recording_granular_abstraction_dto_spec.rb +0 -46
- data/spec/models/track_to_medium_product_dto_spec.rb +0 -48
- data/spec/models/usage_dto_spec.rb +0 -36
@@ -1,216 +0,0 @@
|
|
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.13.7
|
7
|
-
Contact: info@songtradr.com
|
8
|
-
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 7.1.0-SNAPSHOT
|
10
|
-
|
11
|
-
=end
|
12
|
-
|
13
|
-
require 'date'
|
14
|
-
require 'time'
|
15
|
-
|
16
|
-
module SongtradrApiClientRuby
|
17
|
-
class ContextValue
|
18
|
-
attr_accessor :trackids
|
19
|
-
|
20
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
21
|
-
def self.attribute_map
|
22
|
-
{
|
23
|
-
:'trackids' => :'trackids'
|
24
|
-
}
|
25
|
-
end
|
26
|
-
|
27
|
-
# Returns all the JSON keys this model knows about
|
28
|
-
def self.acceptable_attributes
|
29
|
-
attribute_map.values
|
30
|
-
end
|
31
|
-
|
32
|
-
# Attribute type mapping.
|
33
|
-
def self.openapi_types
|
34
|
-
{
|
35
|
-
:'trackids' => :'Array<Integer>'
|
36
|
-
}
|
37
|
-
end
|
38
|
-
|
39
|
-
# List of attributes with nullable: true
|
40
|
-
def self.openapi_nullable
|
41
|
-
Set.new([
|
42
|
-
])
|
43
|
-
end
|
44
|
-
|
45
|
-
# Initializes the object
|
46
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
47
|
-
def initialize(attributes = {})
|
48
|
-
if (!attributes.is_a?(Hash))
|
49
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `SongtradrApiClientRuby::ContextValue` initialize method"
|
50
|
-
end
|
51
|
-
|
52
|
-
# check to see if the attribute exists and convert string to symbol for hash key
|
53
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
54
|
-
if (!self.class.attribute_map.key?(k.to_sym))
|
55
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `SongtradrApiClientRuby::ContextValue`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
56
|
-
end
|
57
|
-
h[k.to_sym] = v
|
58
|
-
}
|
59
|
-
|
60
|
-
if attributes.key?(:'trackids')
|
61
|
-
if (value = attributes[:'trackids']).is_a?(Array)
|
62
|
-
self.trackids = value
|
63
|
-
end
|
64
|
-
end
|
65
|
-
end
|
66
|
-
|
67
|
-
# Show invalid properties with the reasons. Usually used together with valid?
|
68
|
-
# @return Array for valid properties with the reasons
|
69
|
-
def list_invalid_properties
|
70
|
-
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
71
|
-
invalid_properties = Array.new
|
72
|
-
invalid_properties
|
73
|
-
end
|
74
|
-
|
75
|
-
# Check to see if the all the properties in the model are valid
|
76
|
-
# @return true if the model is valid
|
77
|
-
def valid?
|
78
|
-
warn '[DEPRECATED] the `valid?` method is obsolete'
|
79
|
-
true
|
80
|
-
end
|
81
|
-
|
82
|
-
# Checks equality by comparing each attribute.
|
83
|
-
# @param [Object] Object to be compared
|
84
|
-
def ==(o)
|
85
|
-
return true if self.equal?(o)
|
86
|
-
self.class == o.class &&
|
87
|
-
trackids == o.trackids
|
88
|
-
end
|
89
|
-
|
90
|
-
# @see the `==` method
|
91
|
-
# @param [Object] Object to be compared
|
92
|
-
def eql?(o)
|
93
|
-
self == o
|
94
|
-
end
|
95
|
-
|
96
|
-
# Calculates hash code according to all attributes.
|
97
|
-
# @return [Integer] Hash code
|
98
|
-
def hash
|
99
|
-
[trackids].hash
|
100
|
-
end
|
101
|
-
|
102
|
-
# Builds the object from hash
|
103
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
104
|
-
# @return [Object] Returns the model itself
|
105
|
-
def self.build_from_hash(attributes)
|
106
|
-
return nil unless attributes.is_a?(Hash)
|
107
|
-
attributes = attributes.transform_keys(&:to_sym)
|
108
|
-
transformed_hash = {}
|
109
|
-
openapi_types.each_pair do |key, type|
|
110
|
-
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
111
|
-
transformed_hash["#{key}"] = nil
|
112
|
-
elsif type =~ /\AArray<(.*)>/i
|
113
|
-
# check to ensure the input is an array given that the attribute
|
114
|
-
# is documented as an array but the input is not
|
115
|
-
if attributes[attribute_map[key]].is_a?(Array)
|
116
|
-
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
117
|
-
end
|
118
|
-
elsif !attributes[attribute_map[key]].nil?
|
119
|
-
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
120
|
-
end
|
121
|
-
end
|
122
|
-
new(transformed_hash)
|
123
|
-
end
|
124
|
-
|
125
|
-
# Deserializes the data based on type
|
126
|
-
# @param string type Data type
|
127
|
-
# @param string value Value to be deserialized
|
128
|
-
# @return [Object] Deserialized data
|
129
|
-
def self._deserialize(type, value)
|
130
|
-
case type.to_sym
|
131
|
-
when :Time
|
132
|
-
Time.parse(value)
|
133
|
-
when :Date
|
134
|
-
Date.parse(value)
|
135
|
-
when :String
|
136
|
-
value.to_s
|
137
|
-
when :Integer
|
138
|
-
value.to_i
|
139
|
-
when :Float
|
140
|
-
value.to_f
|
141
|
-
when :Boolean
|
142
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
143
|
-
true
|
144
|
-
else
|
145
|
-
false
|
146
|
-
end
|
147
|
-
when :Object
|
148
|
-
# generic object (usually a Hash), return directly
|
149
|
-
value
|
150
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
151
|
-
inner_type = Regexp.last_match[:inner_type]
|
152
|
-
value.map { |v| _deserialize(inner_type, v) }
|
153
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
154
|
-
k_type = Regexp.last_match[:k_type]
|
155
|
-
v_type = Regexp.last_match[:v_type]
|
156
|
-
{}.tap do |hash|
|
157
|
-
value.each do |k, v|
|
158
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
159
|
-
end
|
160
|
-
end
|
161
|
-
else # model
|
162
|
-
# models (e.g. Pet) or oneOf
|
163
|
-
klass = SongtradrApiClientRuby.const_get(type)
|
164
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
165
|
-
end
|
166
|
-
end
|
167
|
-
|
168
|
-
# Returns the string representation of the object
|
169
|
-
# @return [String] String presentation of the object
|
170
|
-
def to_s
|
171
|
-
to_hash.to_s
|
172
|
-
end
|
173
|
-
|
174
|
-
# to_body is an alias to to_hash (backward compatibility)
|
175
|
-
# @return [Hash] Returns the object in the form of hash
|
176
|
-
def to_body
|
177
|
-
to_hash
|
178
|
-
end
|
179
|
-
|
180
|
-
# Returns the object in the form of hash
|
181
|
-
# @return [Hash] Returns the object in the form of hash
|
182
|
-
def to_hash
|
183
|
-
hash = {}
|
184
|
-
self.class.attribute_map.each_pair do |attr, param|
|
185
|
-
value = self.send(attr)
|
186
|
-
if value.nil?
|
187
|
-
is_nullable = self.class.openapi_nullable.include?(attr)
|
188
|
-
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
189
|
-
end
|
190
|
-
|
191
|
-
hash[param] = _to_hash(value)
|
192
|
-
end
|
193
|
-
hash
|
194
|
-
end
|
195
|
-
|
196
|
-
# Outputs non-array value in the form of hash
|
197
|
-
# For object, use to_hash. Otherwise, just return the value
|
198
|
-
# @param [Object] value Any valid value
|
199
|
-
# @return [Hash] Returns the value in the form of hash
|
200
|
-
def _to_hash(value)
|
201
|
-
if value.is_a?(Array)
|
202
|
-
value.compact.map { |v| _to_hash(v) }
|
203
|
-
elsif value.is_a?(Hash)
|
204
|
-
{}.tap do |hash|
|
205
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
206
|
-
end
|
207
|
-
elsif value.respond_to? :to_hash
|
208
|
-
value.to_hash
|
209
|
-
else
|
210
|
-
value
|
211
|
-
end
|
212
|
-
end
|
213
|
-
|
214
|
-
end
|
215
|
-
|
216
|
-
end
|
@@ -1,254 +0,0 @@
|
|
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.13.7
|
7
|
-
Contact: info@songtradr.com
|
8
|
-
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 7.1.0-SNAPSHOT
|
10
|
-
|
11
|
-
=end
|
12
|
-
|
13
|
-
require 'date'
|
14
|
-
require 'time'
|
15
|
-
|
16
|
-
module SongtradrApiClientRuby
|
17
|
-
# Minimal infos on a file that has been uploaded for auto-tagging or audio-recognition purposes. including download path.
|
18
|
-
class FileMinimalWithUrlDTO
|
19
|
-
attr_accessor :file_name
|
20
|
-
|
21
|
-
attr_accessor :url
|
22
|
-
|
23
|
-
attr_accessor :isrc
|
24
|
-
|
25
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
26
|
-
def self.attribute_map
|
27
|
-
{
|
28
|
-
:'file_name' => :'fileName',
|
29
|
-
:'url' => :'url',
|
30
|
-
:'isrc' => :'isrc'
|
31
|
-
}
|
32
|
-
end
|
33
|
-
|
34
|
-
# Returns all the JSON keys this model knows about
|
35
|
-
def self.acceptable_attributes
|
36
|
-
attribute_map.values
|
37
|
-
end
|
38
|
-
|
39
|
-
# Attribute type mapping.
|
40
|
-
def self.openapi_types
|
41
|
-
{
|
42
|
-
:'file_name' => :'String',
|
43
|
-
:'url' => :'String',
|
44
|
-
:'isrc' => :'String'
|
45
|
-
}
|
46
|
-
end
|
47
|
-
|
48
|
-
# List of attributes with nullable: true
|
49
|
-
def self.openapi_nullable
|
50
|
-
Set.new([
|
51
|
-
])
|
52
|
-
end
|
53
|
-
|
54
|
-
# Initializes the object
|
55
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
56
|
-
def initialize(attributes = {})
|
57
|
-
if (!attributes.is_a?(Hash))
|
58
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `SongtradrApiClientRuby::FileMinimalWithUrlDTO` initialize method"
|
59
|
-
end
|
60
|
-
|
61
|
-
# check to see if the attribute exists and convert string to symbol for hash key
|
62
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
63
|
-
if (!self.class.attribute_map.key?(k.to_sym))
|
64
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `SongtradrApiClientRuby::FileMinimalWithUrlDTO`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
65
|
-
end
|
66
|
-
h[k.to_sym] = v
|
67
|
-
}
|
68
|
-
|
69
|
-
if attributes.key?(:'file_name')
|
70
|
-
self.file_name = attributes[:'file_name']
|
71
|
-
else
|
72
|
-
self.file_name = nil
|
73
|
-
end
|
74
|
-
|
75
|
-
if attributes.key?(:'url')
|
76
|
-
self.url = attributes[:'url']
|
77
|
-
else
|
78
|
-
self.url = nil
|
79
|
-
end
|
80
|
-
|
81
|
-
if attributes.key?(:'isrc')
|
82
|
-
self.isrc = attributes[:'isrc']
|
83
|
-
else
|
84
|
-
self.isrc = nil
|
85
|
-
end
|
86
|
-
end
|
87
|
-
|
88
|
-
# Show invalid properties with the reasons. Usually used together with valid?
|
89
|
-
# @return Array for valid properties with the reasons
|
90
|
-
def list_invalid_properties
|
91
|
-
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
92
|
-
invalid_properties = Array.new
|
93
|
-
if @file_name.nil?
|
94
|
-
invalid_properties.push('invalid value for "file_name", file_name cannot be nil.')
|
95
|
-
end
|
96
|
-
|
97
|
-
if @url.nil?
|
98
|
-
invalid_properties.push('invalid value for "url", url cannot be nil.')
|
99
|
-
end
|
100
|
-
|
101
|
-
if @isrc.nil?
|
102
|
-
invalid_properties.push('invalid value for "isrc", isrc cannot be nil.')
|
103
|
-
end
|
104
|
-
|
105
|
-
invalid_properties
|
106
|
-
end
|
107
|
-
|
108
|
-
# Check to see if the all the properties in the model are valid
|
109
|
-
# @return true if the model is valid
|
110
|
-
def valid?
|
111
|
-
warn '[DEPRECATED] the `valid?` method is obsolete'
|
112
|
-
return false if @file_name.nil?
|
113
|
-
return false if @url.nil?
|
114
|
-
return false if @isrc.nil?
|
115
|
-
true
|
116
|
-
end
|
117
|
-
|
118
|
-
# Checks equality by comparing each attribute.
|
119
|
-
# @param [Object] Object to be compared
|
120
|
-
def ==(o)
|
121
|
-
return true if self.equal?(o)
|
122
|
-
self.class == o.class &&
|
123
|
-
file_name == o.file_name &&
|
124
|
-
url == o.url &&
|
125
|
-
isrc == o.isrc
|
126
|
-
end
|
127
|
-
|
128
|
-
# @see the `==` method
|
129
|
-
# @param [Object] Object to be compared
|
130
|
-
def eql?(o)
|
131
|
-
self == o
|
132
|
-
end
|
133
|
-
|
134
|
-
# Calculates hash code according to all attributes.
|
135
|
-
# @return [Integer] Hash code
|
136
|
-
def hash
|
137
|
-
[file_name, url, isrc].hash
|
138
|
-
end
|
139
|
-
|
140
|
-
# Builds the object from hash
|
141
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
142
|
-
# @return [Object] Returns the model itself
|
143
|
-
def self.build_from_hash(attributes)
|
144
|
-
return nil unless attributes.is_a?(Hash)
|
145
|
-
attributes = attributes.transform_keys(&:to_sym)
|
146
|
-
transformed_hash = {}
|
147
|
-
openapi_types.each_pair do |key, type|
|
148
|
-
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
149
|
-
transformed_hash["#{key}"] = nil
|
150
|
-
elsif type =~ /\AArray<(.*)>/i
|
151
|
-
# check to ensure the input is an array given that the attribute
|
152
|
-
# is documented as an array but the input is not
|
153
|
-
if attributes[attribute_map[key]].is_a?(Array)
|
154
|
-
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
155
|
-
end
|
156
|
-
elsif !attributes[attribute_map[key]].nil?
|
157
|
-
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
158
|
-
end
|
159
|
-
end
|
160
|
-
new(transformed_hash)
|
161
|
-
end
|
162
|
-
|
163
|
-
# Deserializes the data based on type
|
164
|
-
# @param string type Data type
|
165
|
-
# @param string value Value to be deserialized
|
166
|
-
# @return [Object] Deserialized data
|
167
|
-
def self._deserialize(type, value)
|
168
|
-
case type.to_sym
|
169
|
-
when :Time
|
170
|
-
Time.parse(value)
|
171
|
-
when :Date
|
172
|
-
Date.parse(value)
|
173
|
-
when :String
|
174
|
-
value.to_s
|
175
|
-
when :Integer
|
176
|
-
value.to_i
|
177
|
-
when :Float
|
178
|
-
value.to_f
|
179
|
-
when :Boolean
|
180
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
181
|
-
true
|
182
|
-
else
|
183
|
-
false
|
184
|
-
end
|
185
|
-
when :Object
|
186
|
-
# generic object (usually a Hash), return directly
|
187
|
-
value
|
188
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
189
|
-
inner_type = Regexp.last_match[:inner_type]
|
190
|
-
value.map { |v| _deserialize(inner_type, v) }
|
191
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
192
|
-
k_type = Regexp.last_match[:k_type]
|
193
|
-
v_type = Regexp.last_match[:v_type]
|
194
|
-
{}.tap do |hash|
|
195
|
-
value.each do |k, v|
|
196
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
197
|
-
end
|
198
|
-
end
|
199
|
-
else # model
|
200
|
-
# models (e.g. Pet) or oneOf
|
201
|
-
klass = SongtradrApiClientRuby.const_get(type)
|
202
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
203
|
-
end
|
204
|
-
end
|
205
|
-
|
206
|
-
# Returns the string representation of the object
|
207
|
-
# @return [String] String presentation of the object
|
208
|
-
def to_s
|
209
|
-
to_hash.to_s
|
210
|
-
end
|
211
|
-
|
212
|
-
# to_body is an alias to to_hash (backward compatibility)
|
213
|
-
# @return [Hash] Returns the object in the form of hash
|
214
|
-
def to_body
|
215
|
-
to_hash
|
216
|
-
end
|
217
|
-
|
218
|
-
# Returns the object in the form of hash
|
219
|
-
# @return [Hash] Returns the object in the form of hash
|
220
|
-
def to_hash
|
221
|
-
hash = {}
|
222
|
-
self.class.attribute_map.each_pair do |attr, param|
|
223
|
-
value = self.send(attr)
|
224
|
-
if value.nil?
|
225
|
-
is_nullable = self.class.openapi_nullable.include?(attr)
|
226
|
-
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
227
|
-
end
|
228
|
-
|
229
|
-
hash[param] = _to_hash(value)
|
230
|
-
end
|
231
|
-
hash
|
232
|
-
end
|
233
|
-
|
234
|
-
# Outputs non-array value in the form of hash
|
235
|
-
# For object, use to_hash. Otherwise, just return the value
|
236
|
-
# @param [Object] value Any valid value
|
237
|
-
# @return [Hash] Returns the value in the form of hash
|
238
|
-
def _to_hash(value)
|
239
|
-
if value.is_a?(Array)
|
240
|
-
value.compact.map { |v| _to_hash(v) }
|
241
|
-
elsif value.is_a?(Hash)
|
242
|
-
{}.tap do |hash|
|
243
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
244
|
-
end
|
245
|
-
elsif value.respond_to? :to_hash
|
246
|
-
value.to_hash
|
247
|
-
else
|
248
|
-
value
|
249
|
-
end
|
250
|
-
end
|
251
|
-
|
252
|
-
end
|
253
|
-
|
254
|
-
end
|
@@ -1,231 +0,0 @@
|
|
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.13.7
|
7
|
-
Contact: info@songtradr.com
|
8
|
-
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 7.1.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
|
-
else
|
72
|
-
self.text = nil
|
73
|
-
end
|
74
|
-
end
|
75
|
-
|
76
|
-
# Show invalid properties with the reasons. Usually used together with valid?
|
77
|
-
# @return Array for valid properties with the reasons
|
78
|
-
def list_invalid_properties
|
79
|
-
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
80
|
-
invalid_properties = Array.new
|
81
|
-
if @text.nil?
|
82
|
-
invalid_properties.push('invalid value for "text", text cannot be nil.')
|
83
|
-
end
|
84
|
-
|
85
|
-
invalid_properties
|
86
|
-
end
|
87
|
-
|
88
|
-
# Check to see if the all the properties in the model are valid
|
89
|
-
# @return true if the model is valid
|
90
|
-
def valid?
|
91
|
-
warn '[DEPRECATED] the `valid?` method is obsolete'
|
92
|
-
return false if @text.nil?
|
93
|
-
true
|
94
|
-
end
|
95
|
-
|
96
|
-
# Checks equality by comparing each attribute.
|
97
|
-
# @param [Object] Object to be compared
|
98
|
-
def ==(o)
|
99
|
-
return true if self.equal?(o)
|
100
|
-
self.class == o.class &&
|
101
|
-
year == o.year &&
|
102
|
-
text == o.text
|
103
|
-
end
|
104
|
-
|
105
|
-
# @see the `==` method
|
106
|
-
# @param [Object] Object to be compared
|
107
|
-
def eql?(o)
|
108
|
-
self == o
|
109
|
-
end
|
110
|
-
|
111
|
-
# Calculates hash code according to all attributes.
|
112
|
-
# @return [Integer] Hash code
|
113
|
-
def hash
|
114
|
-
[year, text].hash
|
115
|
-
end
|
116
|
-
|
117
|
-
# Builds the object from hash
|
118
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
119
|
-
# @return [Object] Returns the model itself
|
120
|
-
def self.build_from_hash(attributes)
|
121
|
-
return nil unless attributes.is_a?(Hash)
|
122
|
-
attributes = attributes.transform_keys(&:to_sym)
|
123
|
-
transformed_hash = {}
|
124
|
-
openapi_types.each_pair do |key, type|
|
125
|
-
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
126
|
-
transformed_hash["#{key}"] = nil
|
127
|
-
elsif type =~ /\AArray<(.*)>/i
|
128
|
-
# check to ensure the input is an array given that the attribute
|
129
|
-
# is documented as an array but the input is not
|
130
|
-
if attributes[attribute_map[key]].is_a?(Array)
|
131
|
-
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
132
|
-
end
|
133
|
-
elsif !attributes[attribute_map[key]].nil?
|
134
|
-
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
135
|
-
end
|
136
|
-
end
|
137
|
-
new(transformed_hash)
|
138
|
-
end
|
139
|
-
|
140
|
-
# Deserializes the data based on type
|
141
|
-
# @param string type Data type
|
142
|
-
# @param string value Value to be deserialized
|
143
|
-
# @return [Object] Deserialized data
|
144
|
-
def self._deserialize(type, value)
|
145
|
-
case type.to_sym
|
146
|
-
when :Time
|
147
|
-
Time.parse(value)
|
148
|
-
when :Date
|
149
|
-
Date.parse(value)
|
150
|
-
when :String
|
151
|
-
value.to_s
|
152
|
-
when :Integer
|
153
|
-
value.to_i
|
154
|
-
when :Float
|
155
|
-
value.to_f
|
156
|
-
when :Boolean
|
157
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
158
|
-
true
|
159
|
-
else
|
160
|
-
false
|
161
|
-
end
|
162
|
-
when :Object
|
163
|
-
# generic object (usually a Hash), return directly
|
164
|
-
value
|
165
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
166
|
-
inner_type = Regexp.last_match[:inner_type]
|
167
|
-
value.map { |v| _deserialize(inner_type, v) }
|
168
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
169
|
-
k_type = Regexp.last_match[:k_type]
|
170
|
-
v_type = Regexp.last_match[:v_type]
|
171
|
-
{}.tap do |hash|
|
172
|
-
value.each do |k, v|
|
173
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
174
|
-
end
|
175
|
-
end
|
176
|
-
else # model
|
177
|
-
# models (e.g. Pet) or oneOf
|
178
|
-
klass = SongtradrApiClientRuby.const_get(type)
|
179
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
180
|
-
end
|
181
|
-
end
|
182
|
-
|
183
|
-
# Returns the string representation of the object
|
184
|
-
# @return [String] String presentation of the object
|
185
|
-
def to_s
|
186
|
-
to_hash.to_s
|
187
|
-
end
|
188
|
-
|
189
|
-
# to_body is an alias to to_hash (backward compatibility)
|
190
|
-
# @return [Hash] Returns the object in the form of hash
|
191
|
-
def to_body
|
192
|
-
to_hash
|
193
|
-
end
|
194
|
-
|
195
|
-
# Returns the object in the form of hash
|
196
|
-
# @return [Hash] Returns the object in the form of hash
|
197
|
-
def to_hash
|
198
|
-
hash = {}
|
199
|
-
self.class.attribute_map.each_pair do |attr, param|
|
200
|
-
value = self.send(attr)
|
201
|
-
if value.nil?
|
202
|
-
is_nullable = self.class.openapi_nullable.include?(attr)
|
203
|
-
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
204
|
-
end
|
205
|
-
|
206
|
-
hash[param] = _to_hash(value)
|
207
|
-
end
|
208
|
-
hash
|
209
|
-
end
|
210
|
-
|
211
|
-
# Outputs non-array value in the form of hash
|
212
|
-
# For object, use to_hash. Otherwise, just return the value
|
213
|
-
# @param [Object] value Any valid value
|
214
|
-
# @return [Hash] Returns the value in the form of hash
|
215
|
-
def _to_hash(value)
|
216
|
-
if value.is_a?(Array)
|
217
|
-
value.compact.map { |v| _to_hash(v) }
|
218
|
-
elsif value.is_a?(Hash)
|
219
|
-
{}.tap do |hash|
|
220
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
221
|
-
end
|
222
|
-
elsif value.respond_to? :to_hash
|
223
|
-
value.to_hash
|
224
|
-
else
|
225
|
-
value
|
226
|
-
end
|
227
|
-
end
|
228
|
-
|
229
|
-
end
|
230
|
-
|
231
|
-
end
|