Class: SongtradrApiClientRuby::AllowedValuesApi

Inherits:
Object
  • Object
show all
Defined in:
lib/songtradr_api_client_ruby/api/allowed_values_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ AllowedValuesApi



19
20
21
# File 'lib/songtradr_api_client_ruby/api/allowed_values_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/songtradr_api_client_ruby/api/allowed_values_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#allowed_musical_features(opts = {}) ⇒ SearchFilterValuesDTO

Allowed values for music descriptive parameters to be used in the searchAll endpoint.

Options Hash (opts):

  • :response_size (String)

    Size the response should have. (default to 's')



26
27
28
29
# File 'lib/songtradr_api_client_ruby/api/allowed_values_api.rb', line 26

def allowed_musical_features(opts = {})
  data, _status_code, _headers = allowed_musical_features_with_http_info(opts)
  data
end

#allowed_musical_features_with_http_info(opts = {}) ⇒ Array<(SearchFilterValuesDTO, Integer, Hash)>

Allowed values for music descriptive parameters to be used in the searchAll endpoint.

Options Hash (opts):

  • :response_size (String)

    Size the response should have. (default to 's')



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/songtradr_api_client_ruby/api/allowed_values_api.rb', line 35

def allowed_musical_features_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AllowedValuesApi.allowed_musical_features ...'
  end
  allowable_values = ["s", "l"]
  if @api_client.config.client_side_validation && opts[:'response_size'] && !allowable_values.include?(opts[:'response_size'])
    fail ArgumentError, "invalid value for \"response_size\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/api/v1/allowedValues/musicalFeatures'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'responseSize'] = opts[:'response_size'] if !opts[:'response_size'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'SearchFilterValuesDTO'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"AllowedValuesApi.allowed_musical_features",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AllowedValuesApi#allowed_musical_features\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#genres(genre_type, opts = {}) ⇒ Array<GenreDTO>

Allowed values for genres.



88
89
90
91
# File 'lib/songtradr_api_client_ruby/api/allowed_values_api.rb', line 88

def genres(genre_type, opts = {})
  data, _status_code, _headers = genres_with_http_info(genre_type, opts)
  data
end

#genres_with_http_info(genre_type, opts = {}) ⇒ Array<(Array<GenreDTO>, Integer, Hash)>

Allowed values for genres.



97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
# File 'lib/songtradr_api_client_ruby/api/allowed_values_api.rb', line 97

def genres_with_http_info(genre_type, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AllowedValuesApi.genres ...'
  end
  # verify the required parameter 'genre_type' is set
  if @api_client.config.client_side_validation && genre_type.nil?
    fail ArgumentError, "Missing the required parameter 'genre_type' when calling AllowedValuesApi.genres"
  end
  # verify enum value
  allowable_values = ["musicubeLevel1Genre", "secondaryMusicubeLevel1Genre", "tertiaryMusicubeLevel1Genre", "musicubeLevel2Genre", "secondaryMusicubeLevel2Genre", "tertiaryMusicubeLevel2Genre", "level1Genre", "level2Genre"]
  if @api_client.config.client_side_validation && !allowable_values.include?(genre_type)
    fail ArgumentError, "invalid value for \"genre_type\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/api/v1/allowedValues/genre'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'genreType'] = genre_type

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Array<GenreDTO>'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"AllowedValuesApi.genres",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AllowedValuesApi#genres\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#tags(opts = {}) ⇒ Array<CategoryMediumDTO>

All descriptive tags inside of tag-categories.

Options Hash (opts):

  • :category_name (String)

    Filters tags for one category only



155
156
157
158
# File 'lib/songtradr_api_client_ruby/api/allowed_values_api.rb', line 155

def tags(opts = {})
  data, _status_code, _headers = tags_with_http_info(opts)
  data
end

#tags_with_http_info(opts = {}) ⇒ Array<(Array<CategoryMediumDTO>, Integer, Hash)>

All descriptive tags inside of tag-categories.

Options Hash (opts):

  • :category_name (String)

    Filters tags for one category only



164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
# File 'lib/songtradr_api_client_ruby/api/allowed_values_api.rb', line 164

def tags_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AllowedValuesApi.tags ...'
  end
  allowable_values = ["mood", "instrument", "soundFeature", "era", "musicalFeature", "originRegion", "effectAndContext", "formation", "form", "vocals", "energy", "soundGeneration", "tempo", "key", "rhythm", "productionMusicMood"]
  if @api_client.config.client_side_validation && opts[:'category_name'] && !allowable_values.include?(opts[:'category_name'])
    fail ArgumentError, "invalid value for \"category_name\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/api/v1/allowedValues/tag'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'categoryName'] = opts[:'category_name'] if !opts[:'category_name'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Array<CategoryMediumDTO>'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"AllowedValuesApi.tags",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AllowedValuesApi#tags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end