Method: OpenapiClient::UserAttributesApi#get_user_attribute_with_http_info

Defined in:
lib/openapi_client/api/user_attributes_api.rb

#get_user_attribute_with_http_info(proj_id, env_id, attribute_id, opts = {}) ⇒ Array<(ResourceAttributeRead, Integer, Hash)>

Get User Attribute Gets a single attribute defined on the User resource, if such attribute exists.

Parameters:

  • proj_id (String)

    Either the unique id of the project, or the URL-friendly key of the project (i.e: the &quot;slug&quot;).

  • env_id (String)

    Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the &quot;slug&quot;).

  • attribute_id (String)

    Either the unique id of the attribute, or the URL-friendly key of the attribute (i.e: the &quot;slug&quot;).

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :resource_id (String) — default: default to '__user'

Returns:

  • (Array<(ResourceAttributeRead, Integer, Hash)>)

    ResourceAttributeRead data, response status code and response headers



222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
# File 'lib/openapi_client/api/user_attributes_api.rb', line 222

def get_user_attribute_with_http_info(proj_id, env_id, attribute_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UserAttributesApi.get_user_attribute ...'
  end
  # verify the required parameter 'proj_id' is set
  if @api_client.config.client_side_validation && proj_id.nil?
    fail ArgumentError, "Missing the required parameter 'proj_id' when calling UserAttributesApi.get_user_attribute"
  end
  # verify the required parameter 'env_id' is set
  if @api_client.config.client_side_validation && env_id.nil?
    fail ArgumentError, "Missing the required parameter 'env_id' when calling UserAttributesApi.get_user_attribute"
  end
  # verify the required parameter 'attribute_id' is set
  if @api_client.config.client_side_validation && attribute_id.nil?
    fail ArgumentError, "Missing the required parameter 'attribute_id' when calling UserAttributesApi.get_user_attribute"
  end
  # resource path
  local_var_path = '/v2/schema/{proj_id}/{env_id}/users/attributes/{attribute_id}'.sub('{' + 'proj_id' + '}', CGI.escape(proj_id.to_s)).sub('{' + 'env_id' + '}', CGI.escape(env_id.to_s)).sub('{' + 'attribute_id' + '}', CGI.escape(attribute_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'resource_id'] = opts[:'resource_id'] if !opts[:'resource_id'].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] || 'ResourceAttributeRead'

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

  new_options = opts.merge(
    :operation => :"UserAttributesApi.get_user_attribute",
    :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: UserAttributesApi#get_user_attribute\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end