Class: TripletexApi::TokensessionApi

Inherits:
Object
  • Object
show all
Defined in:
lib/tripletex_api/api/tokensession_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ TokensessionApi

Returns a new instance of TokensessionApi.



19
20
21
# File 'lib/tripletex_api/api/tokensession_api.rb', line 19

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/tripletex_api/api/tokensession_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#create(consumer_token, employee_token, expiration_date, opts = {}) ⇒ ResponseWrapperSessionToken

Create session token.

Parameters:

  • consumer_token

    Token of the API consumer

  • employee_token

    The employees token

  • expiration_date

    Expiration date for the combined token

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

    the optional parameters

Returns:



30
31
32
33
# File 'lib/tripletex_api/api/tokensession_api.rb', line 30

def create(consumer_token, employee_token, expiration_date, opts = {})
  data, _status_code, _headers = create_with_http_info(consumer_token, employee_token, expiration_date, opts)
  return data
end

#create_with_http_info(consumer_token, employee_token, expiration_date, opts = {}) ⇒ Array<(ResponseWrapperSessionToken, Fixnum, Hash)>

Create session token.

Parameters:

  • consumer_token

    Token of the API consumer

  • employee_token

    The employees token

  • expiration_date

    Expiration date for the combined token

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

    the optional parameters

Returns:



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
# File 'lib/tripletex_api/api/tokensession_api.rb', line 42

def create_with_http_info(consumer_token, employee_token, expiration_date, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: TokensessionApi.create ..."
  end
  # verify the required parameter 'consumer_token' is set
  if @api_client.config.client_side_validation && consumer_token.nil?
    fail ArgumentError, "Missing the required parameter 'consumer_token' when calling TokensessionApi.create"
  end
  # verify the required parameter 'employee_token' is set
  if @api_client.config.client_side_validation && employee_token.nil?
    fail ArgumentError, "Missing the required parameter 'employee_token' when calling TokensessionApi.create"
  end
  # verify the required parameter 'expiration_date' is set
  if @api_client.config.client_side_validation && expiration_date.nil?
    fail ArgumentError, "Missing the required parameter 'expiration_date' when calling TokensessionApi.create"
  end
  # resource path
  local_var_path = "/token/session/:create"

  # query parameters
  query_params = {}
  query_params[:'consumerToken'] = consumer_token
  query_params[:'employeeToken'] = employee_token
  query_params[:'expirationDate'] = expiration_date

  # header parameters
  header_params = {}

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ResponseWrapperSessionToken')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TokensessionApi#create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete(token, opts = {}) ⇒ nil

Delete session token.

Parameters:

  • token

    The login token string to delete

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

    the optional parameters

Returns:

  • (nil)


94
95
96
97
# File 'lib/tripletex_api/api/tokensession_api.rb', line 94

def delete(token, opts = {})
  delete_with_http_info(token, opts)
  return nil
end

#delete_with_http_info(token, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Delete session token.

Parameters:

  • token

    The login token string to delete

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



104
105
106
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
# File 'lib/tripletex_api/api/tokensession_api.rb', line 104

def delete_with_http_info(token, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: TokensessionApi.delete ..."
  end
  # verify the required parameter 'token' is set
  if @api_client.config.client_side_validation && token.nil?
    fail ArgumentError, "Missing the required parameter 'token' when calling TokensessionApi.delete"
  end
  # resource path
  local_var_path = "/token/session/{token}".sub('{' + 'token' + '}', token.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['tokenAuthScheme']
  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: TokensessionApi#delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#who_am_i(opts = {}) ⇒ ResponseWrapperLoggedInUserInfoDTO

Find information about the current user.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :fields (String)

    Fields filter pattern

Returns:



144
145
146
147
# File 'lib/tripletex_api/api/tokensession_api.rb', line 144

def who_am_i(opts = {})
  data, _status_code, _headers = who_am_i_with_http_info(opts)
  return data
end

#who_am_i_with_http_info(opts = {}) ⇒ Array<(ResponseWrapperLoggedInUserInfoDTO, Fixnum, Hash)>

Find information about the current user.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :fields (String)

    Fields filter pattern

Returns:



154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
# File 'lib/tripletex_api/api/tokensession_api.rb', line 154

def who_am_i_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: TokensessionApi.who_am_i ..."
  end
  # resource path
  local_var_path = "/token/session/>whoAmI"

  # query parameters
  query_params = {}
  query_params[:'fields'] = opts[:'fields'] if !opts[:'fields'].nil?

  # header parameters
  header_params = {}

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['tokenAuthScheme']
  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 => 'ResponseWrapperLoggedInUserInfoDTO')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TokensessionApi#who_am_i\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end