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, Fixnum, 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, Fixnum, 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
# 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 = {}

  # header parameters
  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'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
  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 => 'User')
  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:

  • authorization_request

    Authorization request

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

    the optional parameters

Returns:



89
90
91
92
# File 'lib/ultracart_api/api/sso_api.rb', line 89

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, Fixnum, Hash)>

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

Parameters:

  • authorization_request

    Authorization request

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

    the optional parameters

Returns:



99
100
101
102
103
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
138
# File 'lib/ultracart_api/api/sso_api.rb', line 99

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 = {}

  # header parameters
  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'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json; charset=UTF-8'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(authorization_request)
  auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
  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 => 'SingleSignOnAuthorizeResponse')
  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)


143
144
145
146
# File 'lib/ultracart_api/api/sso_api.rb', line 143

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

#sso_session_revoke_with_http_info(opts = {}) ⇒ Array<(nil, Fixnum, 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, Fixnum, Hash)>)

    nil, response status code and response headers



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

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 = {}

  # header parameters
  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'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
  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: 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:

  • token_request

    Token request

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

    the optional parameters

Returns:



192
193
194
195
# File 'lib/ultracart_api/api/sso_api.rb', line 192

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, Fixnum, 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:

  • token_request

    Token request

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

    the optional parameters

Returns:

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

    SingleSignOnTokenResponse data, response status code and response headers



202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
# File 'lib/ultracart_api/api/sso_api.rb', line 202

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 = {}

  # header parameters
  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'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json; charset=UTF-8'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(token_request)
  auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
  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 => 'SingleSignOnTokenResponse')
  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