class VeloPayments::TokensApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/velopayments/api/tokens_api.rb, line 19
def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Public Instance Methods

resend_token(user_id, resend_token_request, opts = {}) click to toggle source

Resend a token <p>Resend the specified token </p> <p>The token to resend must already exist for the user </p> <p>It will be revoked and a new one issued</p> @param user_id [String] The UUID of the User. @param resend_token_request [ResendTokenRequest] The type of token to resend @param [Hash] opts the optional parameters @return [nil]

# File lib/velopayments/api/tokens_api.rb, line 28
def resend_token(user_id, resend_token_request, opts = {})
  resend_token_with_http_info(user_id, resend_token_request, opts)
  nil
end
resend_token_with_http_info(user_id, resend_token_request, opts = {}) click to toggle source

Resend a token &lt;p&gt;Resend the specified token &lt;/p&gt; &lt;p&gt;The token to resend must already exist for the user &lt;/p&gt; &lt;p&gt;It will be revoked and a new one issued&lt;/p&gt; @param user_id [String] The UUID of the User. @param resend_token_request [ResendTokenRequest] The type of token to resend @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/velopayments/api/tokens_api.rb, line 39
def resend_token_with_http_info(user_id, resend_token_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TokensApi.resend_token ...'
  end
  # verify the required parameter 'user_id' is set
  if @api_client.config.client_side_validation && user_id.nil?
    fail ArgumentError, "Missing the required parameter 'user_id' when calling TokensApi.resend_token"
  end
  # verify the required parameter 'resend_token_request' is set
  if @api_client.config.client_side_validation && resend_token_request.nil?
    fail ArgumentError, "Missing the required parameter 'resend_token_request' when calling TokensApi.resend_token"
  end
  # resource path
  local_var_path = '/v2/users/{userId}/tokens'.sub('{' + 'userId' + '}', CGI.escape(user_id.to_s))

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

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

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

  # http body (model)
  post_body = opts[:body] || @api_client.object_to_http_body(resend_token_request) 

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['OAuth2']

  new_options = opts.merge(
    :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(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TokensApi#resend_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end