class SwaggerClient::UserTokenApi
Attributes
Public Class Methods
# File lib/swagger_client/api/user_token_api.rb, line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
Get a staff user token. @param request @param site_id ID of the site from which to pull data. @param version @param [Hash] opts the optional parameters @return [IssueResponse]
# File lib/swagger_client/api/user_token_api.rb, line 28 def user_token_issue(request, site_id, version, opts = {}) data, _status_code, _headers = user_token_issue_with_http_info(request, site_id, version, opts) data end
Get a staff user token. @param request @param site_id ID of the site from which to pull data. @param version @param [Hash] opts the optional parameters @return [Array<(IssueResponse
, Fixnum, Hash)>] IssueResponse
data, response status code and response headers
# File lib/swagger_client/api/user_token_api.rb, line 39 def user_token_issue_with_http_info(request, site_id, version, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UserTokenApi.user_token_issue ...' end # verify the required parameter 'request' is set if @api_client.config.client_side_validation && request.nil? fail ArgumentError, "Missing the required parameter 'request' when calling UserTokenApi.user_token_issue" end # verify the required parameter 'site_id' is set if @api_client.config.client_side_validation && site_id.nil? fail ArgumentError, "Missing the required parameter 'site_id' when calling UserTokenApi.user_token_issue" end # verify the required parameter 'version' is set if @api_client.config.client_side_validation && version.nil? fail ArgumentError, "Missing the required parameter 'version' when calling UserTokenApi.user_token_issue" end # resource path local_var_path = '/public/v{version}/usertoken/issue'.sub('{' + 'version' + '}', version.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml', 'multipart/form-data']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded', 'multipart/form-data']) header_params[:'siteId'] = site_id # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(request) 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 => 'IssueResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: UserTokenApi#user_token_issue\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Revoke a user token. Revokes the user token in the Authorization header. @param site_id ID of the site from which to pull data. @param version @param [Hash] opts the optional parameters @option opts [String] :authorization A staff user authorization token. (default to ) @return [Object]
# File lib/swagger_client/api/user_token_api.rb, line 94 def user_token_revoke(site_id, version, opts = {}) data, _status_code, _headers = user_token_revoke_with_http_info(site_id, version, opts) data end
Revoke a user token. Revokes the user token in the Authorization header. @param site_id ID of the site from which to pull data. @param version @param [Hash] opts the optional parameters @option opts [String] :authorization A staff user authorization token. @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers
# File lib/swagger_client/api/user_token_api.rb, line 106 def user_token_revoke_with_http_info(site_id, version, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UserTokenApi.user_token_revoke ...' end # verify the required parameter 'site_id' is set if @api_client.config.client_side_validation && site_id.nil? fail ArgumentError, "Missing the required parameter 'site_id' when calling UserTokenApi.user_token_revoke" end # verify the required parameter 'version' is set if @api_client.config.client_side_validation && version.nil? fail ArgumentError, "Missing the required parameter 'version' when calling UserTokenApi.user_token_revoke" end # resource path local_var_path = '/public/v{version}/usertoken/revoke'.sub('{' + 'version' + '}', version.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml', 'multipart/form-data']) header_params[:'siteId'] = site_id header_params[:'authorization'] = opts[:'authorization'] if !opts[:'authorization'].nil? # form parameters form_params = {} # http body (model) post_body = nil auth_names = [] 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, :return_type => 'Object') if @api_client.config.debugging @api_client.config.logger.debug "API called: UserTokenApi#user_token_revoke\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end