Class: UltracartClient::SsoApi

Inherits:
Object
  • Object
show all
Defined in:
lib/ultracart_api/api/sso_api.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ SsoApi

Returns a new instance of SsoApi.



19
20
21
# File 'lib/ultracart_api/api/sso_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/ultracart_api/api/sso_api.rb', line 17

def api_client
  @api_client
end

Class Method Details

.new_using_api_key(simple_key, verify_ssl = true, debugging = false) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
# File 'lib/ultracart_api/api/sso_api.rb', line 23

def self.new_using_api_key(simple_key, verify_ssl = true, debugging = false)
  api_config = Configuration.new
  api_config.api_key_prefix['x-ultracart-simple-key'] = simple_key
  api_config.api_version = '2017-03-01'
  api_config.verify_ssl = verify_ssl

  api_client = ApiClient.new(api_config)
  api_client.config.debugging = debugging

  UltracartClient::SsoApi.new(api_client)
end

Instance Method Details

#get_sso_session_user(opts = {}) ⇒ User

Get single sign on session user This is the equivalent of logging out of the single sign on session

Parameters:

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

    the optional parameters

Returns:



39
40
41
42
# File 'lib/ultracart_api/api/sso_api.rb', line 39

def get_sso_session_user(opts = {})
  data, _status_code, _headers = get_sso_session_user_with_http_info(opts)
  data
end

#get_sso_session_user_with_http_info(opts = {}) ⇒ Array<(User, Integer, Hash)>

Get single sign on session user This is the equivalent of logging out of the single sign on session

Parameters:

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

    the optional parameters

Returns:

  • (Array<(User, Integer, Hash)>)

    User data, response status code and response headers



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
91
# File 'lib/ultracart_api/api/sso_api.rb', line 48

def get_sso_session_user_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SsoApi.get_sso_session_user ...'
  end
  # resource path
  local_var_path = '/sso/session/user'

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

  # header parameters
  header_params = opts[:header_params] || {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

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

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'User'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']

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

#sso_authorize(authorization_request, opts = {}) ⇒ SingleSignOnAuthorizeResponse

Authorize a single sign on session Starts the process of authorizing a single sign on session.

Parameters:

Returns:



98
99
100
101
# File 'lib/ultracart_api/api/sso_api.rb', line 98

def sso_authorize(authorization_request, opts = {})
  data, _status_code, _headers = sso_authorize_with_http_info(authorization_request, opts)
  data
end

#sso_authorize_with_http_info(authorization_request, opts = {}) ⇒ Array<(SingleSignOnAuthorizeResponse, Integer, Hash)>

Authorize a single sign on session Starts the process of authorizing a single sign on session.

Parameters:

Returns:



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
156
157
158
159
160
# File 'lib/ultracart_api/api/sso_api.rb', line 108

def sso_authorize_with_http_info(authorization_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SsoApi.sso_authorize ...'
  end
  # verify the required parameter 'authorization_request' is set
  if @api_client.config.client_side_validation && authorization_request.nil?
    fail ArgumentError, "Missing the required parameter 'authorization_request' when calling SsoApi.sso_authorize"
  end
  # resource path
  local_var_path = '/sso/authorize'

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

  # header parameters
  header_params = opts[:header_params] || {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json; charset=UTF-8'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

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

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

  # return_type
  return_type = opts[:debug_return_type] || 'SingleSignOnAuthorizeResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']

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

#sso_session_revoke(opts = {}) ⇒ nil

Revoke single sign on session This is the equivalent of logging out of the single sign on session

Parameters:

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

    the optional parameters

Returns:

  • (nil)


166
167
168
169
# File 'lib/ultracart_api/api/sso_api.rb', line 166

def sso_session_revoke(opts = {})
  sso_session_revoke_with_http_info(opts)
  nil
end

#sso_session_revoke_with_http_info(opts = {}) ⇒ Array<(nil, Integer, Hash)>

Revoke single sign on session This is the equivalent of logging out of the single sign on session

Parameters:

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
# File 'lib/ultracart_api/api/sso_api.rb', line 175

def sso_session_revoke_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SsoApi.sso_session_revoke ...'
  end
  # resource path
  local_var_path = '/sso/session/revoke'

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

  # header parameters
  header_params = opts[:header_params] || {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

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

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']

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

#sso_token(token_request, opts = {}) ⇒ SingleSignOnTokenResponse

Exchange a single sign on code for a simple key token Called by your application after receiving the code back on the redirect URI to obtain a simple key token to make API calls with

Parameters:

Returns:



225
226
227
228
# File 'lib/ultracart_api/api/sso_api.rb', line 225

def sso_token(token_request, opts = {})
  data, _status_code, _headers = sso_token_with_http_info(token_request, opts)
  data
end

#sso_token_with_http_info(token_request, opts = {}) ⇒ Array<(SingleSignOnTokenResponse, Integer, Hash)>

Exchange a single sign on code for a simple key token Called by your application after receiving the code back on the redirect URI to obtain a simple key token to make API calls with

Parameters:

Returns:

  • (Array<(SingleSignOnTokenResponse, Integer, Hash)>)

    SingleSignOnTokenResponse data, response status code and response headers



235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
# File 'lib/ultracart_api/api/sso_api.rb', line 235

def sso_token_with_http_info(token_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SsoApi.sso_token ...'
  end
  # verify the required parameter 'token_request' is set
  if @api_client.config.client_side_validation && token_request.nil?
    fail ArgumentError, "Missing the required parameter 'token_request' when calling SsoApi.sso_token"
  end
  # resource path
  local_var_path = '/sso/token'

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

  # header parameters
  header_params = opts[:header_params] || {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json; charset=UTF-8'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

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

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

  # return_type
  return_type = opts[:debug_return_type] || 'SingleSignOnTokenResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']

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