class TriglavClient::AuthApi
Attributes
Public Class Methods
# File lib/triglav_client/api/auth_api.rb, line 30 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
Creates a new token @param credential @param [Hash] opts the optional parameters @return [TokenResponse]
# File lib/triglav_client/api/auth_api.rb, line 39 def create_token(credential, opts = {}) data, _status_code, _headers = create_token_with_http_info(credential, opts) return data end
Creates a new token @param credential @param [Hash] opts the optional parameters @return [Array<(TokenResponse
, Fixnum, Hash)>] TokenResponse
data, response status code and response headers
# File lib/triglav_client/api/auth_api.rb, line 49 def create_token_with_http_info(credential, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: AuthApi.create_token ..." end # verify the required parameter 'credential' is set fail ArgumentError, "Missing the required parameter 'credential' when calling AuthApi.create_token" if credential.nil? # resource path local_var_path = "/auth/token".sub('{format}','json') # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(credential) auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'TokenResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: AuthApi#create_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Deletes (Expires) a token of header @param [Hash] opts the optional parameters @return [nil]
# File lib/triglav_client/api/auth_api.rb, line 95 def delete_token(opts = {}) delete_token_with_http_info(opts) return nil end
Deletes (Expires) a token of header @param [Hash] opts the optional parameters @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
# File lib/triglav_client/api/auth_api.rb, line 104 def delete_token_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: AuthApi.delete_token ..." end # resource path local_var_path = "/auth/token".sub('{format}','json') # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api_key'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: AuthApi#delete_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Returns a user property of the access_token @param [Hash] opts the optional parameters @return [UserResponse]
# File lib/triglav_client/api/auth_api.rb, line 147 def me(opts = {}) data, _status_code, _headers = me_with_http_info(opts) return data end
Returns a user property of the access_token @param [Hash] opts the optional parameters @return [Array<(UserResponse
, Fixnum, Hash)>] UserResponse
data, response status code and response headers
# File lib/triglav_client/api/auth_api.rb, line 156 def me_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: AuthApi.me ..." end # resource path local_var_path = "/auth/me".sub('{format}','json') # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api_key'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'UserResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: AuthApi#me\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end