Class: Pier::TokenApi

Inherits:
Object
  • Object
show all
Defined in:
lib/pier-sdk-ruby/api/token_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ TokenApi

Returns a new instance of TokenApi.



23
24
25
# File 'lib/pier-sdk-ruby/api/token_api.rb', line 23

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



21
22
23
# File 'lib/pier-sdk-ruby/api/token_api.rb', line 21

def api_client
  @api_client
end

Instance Method Details

#callback_using_post(body_access_token, opts = {}) ⇒ BodyAccessToken

/tokens/callback

Parameters:

  • body_access_token

    bodyAccessToken

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

    the optional parameters

Returns:



32
33
34
35
# File 'lib/pier-sdk-ruby/api/token_api.rb', line 32

def callback_using_post(body_access_token, opts = {})
  data, _status_code, _headers = callback_using_post_with_http_info(body_access_token, opts)
  return data
end

#callback_using_post_with_http_info(body_access_token, opts = {}) ⇒ Array<(BodyAccessToken, Fixnum, Hash)>

/tokens/callback

Parameters:

  • body_access_token

    bodyAccessToken

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

    the optional parameters

Returns:

  • (Array<(BodyAccessToken, Fixnum, Hash)>)

    BodyAccessToken data, response status code and response headers



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
83
84
85
86
87
88
89
90
# File 'lib/pier-sdk-ruby/api/token_api.rb', line 42

def callback_using_post_with_http_info(body_access_token, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: TokenApi.callback_using_post ..."
  end
  
  
  # verify the required parameter 'body_access_token' is set
  fail ArgumentError, "Missing the required parameter 'body_access_token' when calling TokenApi.callback_using_post" if body_access_token.nil?
  
  
  
  
  
  # resource path
  local_var_path = "/v1/tokens/callback".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(body_access_token)
  
  auth_names = ['access_token']
  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 => 'BodyAccessToken')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TokenApi#callback_using_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#validar_using_post(body_access_token, opts = {}) ⇒ Object

/tokens/validar

Parameters:

  • body_access_token

    bodyAccessToken

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

    the optional parameters

Returns:

  • (Object)


97
98
99
100
# File 'lib/pier-sdk-ruby/api/token_api.rb', line 97

def validar_using_post(body_access_token, opts = {})
  data, _status_code, _headers = validar_using_post_with_http_info(body_access_token, opts)
  return data
end

#validar_using_post_with_http_info(body_access_token, opts = {}) ⇒ Array<(Object, Fixnum, Hash)>

/tokens/validar

Parameters:

  • body_access_token

    bodyAccessToken

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

    the optional parameters

Returns:

  • (Array<(Object, Fixnum, Hash)>)

    Object data, response status code and response headers



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
150
151
152
153
154
155
# File 'lib/pier-sdk-ruby/api/token_api.rb', line 107

def validar_using_post_with_http_info(body_access_token, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: TokenApi.validar_using_post ..."
  end
  
  
  # verify the required parameter 'body_access_token' is set
  fail ArgumentError, "Missing the required parameter 'body_access_token' when calling TokenApi.validar_using_post" if body_access_token.nil?
  
  
  
  
  
  # resource path
  local_var_path = "/v1/tokens/validar".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(body_access_token)
  
  auth_names = ['access_token']
  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 => 'Object')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TokenApi#validar_using_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end