trinsic_api 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/README.md +137 -0
- data/Rakefile +10 -0
- data/docs/Address.md +32 -0
- data/docs/Attachments.md +24 -0
- data/docs/AttachmentsApi.md +76 -0
- data/docs/CancelSessionResponse.md +18 -0
- data/docs/CreateSessionRequest.md +22 -0
- data/docs/CreateSessionResponse.md +20 -0
- data/docs/DisclosedFields.md +40 -0
- data/docs/DisclosedFieldsRequest.md +40 -0
- data/docs/DocumentData.md +28 -0
- data/docs/ExchangeAttachmentAccessKeyRequest.md +18 -0
- data/docs/ExchangeResultsKeyRequest.md +18 -0
- data/docs/ExchangeResultsKeyResponse.md +20 -0
- data/docs/FailureMessage.md +18 -0
- data/docs/GetSessionResponse.md +18 -0
- data/docs/IdentityData.md +24 -0
- data/docs/IdentityLookupResponse.md +18 -0
- data/docs/ListProvidersResponse.md +18 -0
- data/docs/ListSessionsResponse.md +22 -0
- data/docs/NetworkApi.md +140 -0
- data/docs/OrderDirection.md +15 -0
- data/docs/PersonData.md +34 -0
- data/docs/ProviderInfo.md +22 -0
- data/docs/Session.md +30 -0
- data/docs/SessionFailCode.md +15 -0
- data/docs/SessionOrdering.md +15 -0
- data/docs/SessionState.md +15 -0
- data/docs/SessionsApi.md +428 -0
- data/docs/ValidationResult.md +20 -0
- data/docs/Verification.md +20 -0
- data/docs/VerificationFailCode.md +15 -0
- data/git_push.sh +57 -0
- data/lib/trinsic_api/api/attachments_api.rb +84 -0
- data/lib/trinsic_api/api/network_api.rb +138 -0
- data/lib/trinsic_api/api/sessions_api.rb +418 -0
- data/lib/trinsic_api/api_client.rb +394 -0
- data/lib/trinsic_api/api_error.rb +58 -0
- data/lib/trinsic_api/configuration.rb +308 -0
- data/lib/trinsic_api/models/address.rb +279 -0
- data/lib/trinsic_api/models/attachments.rb +246 -0
- data/lib/trinsic_api/models/cancel_session_response.rb +221 -0
- data/lib/trinsic_api/models/create_session_request.rb +237 -0
- data/lib/trinsic_api/models/create_session_response.rb +232 -0
- data/lib/trinsic_api/models/disclosed_fields.rb +397 -0
- data/lib/trinsic_api/models/disclosed_fields_request.rb +313 -0
- data/lib/trinsic_api/models/document_data.rb +259 -0
- data/lib/trinsic_api/models/exchange_attachment_access_key_request.rb +241 -0
- data/lib/trinsic_api/models/exchange_results_key_request.rb +222 -0
- data/lib/trinsic_api/models/exchange_results_key_response.rb +230 -0
- data/lib/trinsic_api/models/failure_message.rb +221 -0
- data/lib/trinsic_api/models/get_session_response.rb +221 -0
- data/lib/trinsic_api/models/identity_data.rb +245 -0
- data/lib/trinsic_api/models/identity_lookup_response.rb +222 -0
- data/lib/trinsic_api/models/list_providers_response.rb +224 -0
- data/lib/trinsic_api/models/list_sessions_response.rb +257 -0
- data/lib/trinsic_api/models/order_direction.rb +40 -0
- data/lib/trinsic_api/models/person_data.rb +292 -0
- data/lib/trinsic_api/models/provider_info.rb +257 -0
- data/lib/trinsic_api/models/session.rb +338 -0
- data/lib/trinsic_api/models/session_fail_code.rb +45 -0
- data/lib/trinsic_api/models/session_ordering.rb +41 -0
- data/lib/trinsic_api/models/session_state.rb +44 -0
- data/lib/trinsic_api/models/validation_result.rb +232 -0
- data/lib/trinsic_api/models/verification.rb +248 -0
- data/lib/trinsic_api/models/verification_fail_code.rb +43 -0
- data/lib/trinsic_api/version.rb +15 -0
- data/lib/trinsic_api.rb +69 -0
- data/spec/api/attachments_api_spec.rb +46 -0
- data/spec/api/network_api_spec.rb +56 -0
- data/spec/api/sessions_api_spec.rb +105 -0
- data/spec/models/address_spec.rb +78 -0
- data/spec/models/attachments_spec.rb +54 -0
- data/spec/models/cancel_session_response_spec.rb +36 -0
- data/spec/models/create_session_request_spec.rb +48 -0
- data/spec/models/create_session_response_spec.rb +42 -0
- data/spec/models/disclosed_fields_request_spec.rb +102 -0
- data/spec/models/disclosed_fields_spec.rb +102 -0
- data/spec/models/document_data_spec.rb +66 -0
- data/spec/models/exchange_attachment_access_key_request_spec.rb +36 -0
- data/spec/models/exchange_results_key_request_spec.rb +36 -0
- data/spec/models/exchange_results_key_response_spec.rb +42 -0
- data/spec/models/failure_message_spec.rb +36 -0
- data/spec/models/get_session_response_spec.rb +36 -0
- data/spec/models/identity_data_spec.rb +54 -0
- data/spec/models/identity_lookup_response_spec.rb +36 -0
- data/spec/models/list_providers_response_spec.rb +36 -0
- data/spec/models/list_sessions_response_spec.rb +48 -0
- data/spec/models/order_direction_spec.rb +30 -0
- data/spec/models/person_data_spec.rb +84 -0
- data/spec/models/provider_info_spec.rb +48 -0
- data/spec/models/session_fail_code_spec.rb +30 -0
- data/spec/models/session_ordering_spec.rb +30 -0
- data/spec/models/session_spec.rb +72 -0
- data/spec/models/session_state_spec.rb +30 -0
- data/spec/models/validation_result_spec.rb +42 -0
- data/spec/models/verification_fail_code_spec.rb +30 -0
- data/spec/models/verification_spec.rb +42 -0
- data/spec/spec_helper.rb +111 -0
- data/trinsic_api.gemspec +39 -0
- metadata +215 -0
@@ -0,0 +1,138 @@
|
|
1
|
+
=begin
|
2
|
+
#Connect API
|
3
|
+
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
5
|
+
|
6
|
+
The version of the OpenAPI document: v1
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
Generator version: 7.7.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'cgi'
|
14
|
+
|
15
|
+
module TrinsicApi
|
16
|
+
class NetworkApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Query the availability of an identity in the Trinsic Network by phone number
|
23
|
+
# @param phone_number [String]
|
24
|
+
# @param [Hash] opts the optional parameters
|
25
|
+
# @return [IdentityLookupResponse]
|
26
|
+
def identity_lookup(phone_number, opts = {})
|
27
|
+
data, _status_code, _headers = identity_lookup_with_http_info(phone_number, opts)
|
28
|
+
data
|
29
|
+
end
|
30
|
+
|
31
|
+
# Query the availability of an identity in the Trinsic Network by phone number
|
32
|
+
# @param phone_number [String]
|
33
|
+
# @param [Hash] opts the optional parameters
|
34
|
+
# @return [Array<(IdentityLookupResponse, Integer, Hash)>] IdentityLookupResponse data, response status code and response headers
|
35
|
+
def identity_lookup_with_http_info(phone_number, opts = {})
|
36
|
+
if @api_client.config.debugging
|
37
|
+
@api_client.config.logger.debug 'Calling API: NetworkApi.identity_lookup ...'
|
38
|
+
end
|
39
|
+
# verify the required parameter 'phone_number' is set
|
40
|
+
if @api_client.config.client_side_validation && phone_number.nil?
|
41
|
+
fail ArgumentError, "Missing the required parameter 'phone_number' when calling NetworkApi.identity_lookup"
|
42
|
+
end
|
43
|
+
# resource path
|
44
|
+
local_var_path = '/api/v1/network/identities/{phoneNumber}'.sub('{' + 'phoneNumber' + '}', CGI.escape(phone_number.to_s))
|
45
|
+
|
46
|
+
# query parameters
|
47
|
+
query_params = opts[:query_params] || {}
|
48
|
+
|
49
|
+
# header parameters
|
50
|
+
header_params = opts[:header_params] || {}
|
51
|
+
# HTTP header 'Accept' (if needed)
|
52
|
+
header_params['Accept'] = @api_client.select_header_accept(['text/plain', 'application/json', 'text/json'])
|
53
|
+
|
54
|
+
# form parameters
|
55
|
+
form_params = opts[:form_params] || {}
|
56
|
+
|
57
|
+
# http body (model)
|
58
|
+
post_body = opts[:debug_body]
|
59
|
+
|
60
|
+
# return_type
|
61
|
+
return_type = opts[:debug_return_type] || 'IdentityLookupResponse'
|
62
|
+
|
63
|
+
# auth_names
|
64
|
+
auth_names = opts[:debug_auth_names] || ['Bearer']
|
65
|
+
|
66
|
+
new_options = opts.merge(
|
67
|
+
:operation => :"NetworkApi.identity_lookup",
|
68
|
+
:header_params => header_params,
|
69
|
+
:query_params => query_params,
|
70
|
+
:form_params => form_params,
|
71
|
+
:body => post_body,
|
72
|
+
:auth_names => auth_names,
|
73
|
+
:return_type => return_type
|
74
|
+
)
|
75
|
+
|
76
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
77
|
+
if @api_client.config.debugging
|
78
|
+
@api_client.config.logger.debug "API called: NetworkApi#identity_lookup\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
79
|
+
end
|
80
|
+
return data, status_code, headers
|
81
|
+
end
|
82
|
+
|
83
|
+
# List all identity providers available for use
|
84
|
+
# @param [Hash] opts the optional parameters
|
85
|
+
# @return [ListProvidersResponse]
|
86
|
+
def list_providers(opts = {})
|
87
|
+
data, _status_code, _headers = list_providers_with_http_info(opts)
|
88
|
+
data
|
89
|
+
end
|
90
|
+
|
91
|
+
# List all identity providers available for use
|
92
|
+
# @param [Hash] opts the optional parameters
|
93
|
+
# @return [Array<(ListProvidersResponse, Integer, Hash)>] ListProvidersResponse data, response status code and response headers
|
94
|
+
def list_providers_with_http_info(opts = {})
|
95
|
+
if @api_client.config.debugging
|
96
|
+
@api_client.config.logger.debug 'Calling API: NetworkApi.list_providers ...'
|
97
|
+
end
|
98
|
+
# resource path
|
99
|
+
local_var_path = '/api/v1/network/providers'
|
100
|
+
|
101
|
+
# query parameters
|
102
|
+
query_params = opts[:query_params] || {}
|
103
|
+
|
104
|
+
# header parameters
|
105
|
+
header_params = opts[:header_params] || {}
|
106
|
+
# HTTP header 'Accept' (if needed)
|
107
|
+
header_params['Accept'] = @api_client.select_header_accept(['text/plain', 'application/json', 'text/json'])
|
108
|
+
|
109
|
+
# form parameters
|
110
|
+
form_params = opts[:form_params] || {}
|
111
|
+
|
112
|
+
# http body (model)
|
113
|
+
post_body = opts[:debug_body]
|
114
|
+
|
115
|
+
# return_type
|
116
|
+
return_type = opts[:debug_return_type] || 'ListProvidersResponse'
|
117
|
+
|
118
|
+
# auth_names
|
119
|
+
auth_names = opts[:debug_auth_names] || ['Bearer']
|
120
|
+
|
121
|
+
new_options = opts.merge(
|
122
|
+
:operation => :"NetworkApi.list_providers",
|
123
|
+
:header_params => header_params,
|
124
|
+
:query_params => query_params,
|
125
|
+
:form_params => form_params,
|
126
|
+
:body => post_body,
|
127
|
+
:auth_names => auth_names,
|
128
|
+
:return_type => return_type
|
129
|
+
)
|
130
|
+
|
131
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
132
|
+
if @api_client.config.debugging
|
133
|
+
@api_client.config.logger.debug "API called: NetworkApi#list_providers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
134
|
+
end
|
135
|
+
return data, status_code, headers
|
136
|
+
end
|
137
|
+
end
|
138
|
+
end
|
@@ -0,0 +1,418 @@
|
|
1
|
+
=begin
|
2
|
+
#Connect API
|
3
|
+
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
5
|
+
|
6
|
+
The version of the OpenAPI document: v1
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
Generator version: 7.7.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'cgi'
|
14
|
+
|
15
|
+
module TrinsicApi
|
16
|
+
class SessionsApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Cancel a Session by its ID
|
23
|
+
# @param session_id [String]
|
24
|
+
# @param [Hash] opts the optional parameters
|
25
|
+
# @return [CancelSessionResponse]
|
26
|
+
def cancel_session(session_id, opts = {})
|
27
|
+
data, _status_code, _headers = cancel_session_with_http_info(session_id, opts)
|
28
|
+
data
|
29
|
+
end
|
30
|
+
|
31
|
+
# Cancel a Session by its ID
|
32
|
+
# @param session_id [String]
|
33
|
+
# @param [Hash] opts the optional parameters
|
34
|
+
# @return [Array<(CancelSessionResponse, Integer, Hash)>] CancelSessionResponse data, response status code and response headers
|
35
|
+
def cancel_session_with_http_info(session_id, opts = {})
|
36
|
+
if @api_client.config.debugging
|
37
|
+
@api_client.config.logger.debug 'Calling API: SessionsApi.cancel_session ...'
|
38
|
+
end
|
39
|
+
# verify the required parameter 'session_id' is set
|
40
|
+
if @api_client.config.client_side_validation && session_id.nil?
|
41
|
+
fail ArgumentError, "Missing the required parameter 'session_id' when calling SessionsApi.cancel_session"
|
42
|
+
end
|
43
|
+
# resource path
|
44
|
+
local_var_path = '/api/v1/sessions/{sessionId}/cancel'.sub('{' + 'sessionId' + '}', CGI.escape(session_id.to_s))
|
45
|
+
|
46
|
+
# query parameters
|
47
|
+
query_params = opts[:query_params] || {}
|
48
|
+
|
49
|
+
# header parameters
|
50
|
+
header_params = opts[:header_params] || {}
|
51
|
+
# HTTP header 'Accept' (if needed)
|
52
|
+
header_params['Accept'] = @api_client.select_header_accept(['text/plain', 'application/json', 'text/json'])
|
53
|
+
|
54
|
+
# form parameters
|
55
|
+
form_params = opts[:form_params] || {}
|
56
|
+
|
57
|
+
# http body (model)
|
58
|
+
post_body = opts[:debug_body]
|
59
|
+
|
60
|
+
# return_type
|
61
|
+
return_type = opts[:debug_return_type] || 'CancelSessionResponse'
|
62
|
+
|
63
|
+
# auth_names
|
64
|
+
auth_names = opts[:debug_auth_names] || ['Bearer']
|
65
|
+
|
66
|
+
new_options = opts.merge(
|
67
|
+
:operation => :"SessionsApi.cancel_session",
|
68
|
+
:header_params => header_params,
|
69
|
+
:query_params => query_params,
|
70
|
+
:form_params => form_params,
|
71
|
+
:body => post_body,
|
72
|
+
:auth_names => auth_names,
|
73
|
+
:return_type => return_type
|
74
|
+
)
|
75
|
+
|
76
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
77
|
+
if @api_client.config.debugging
|
78
|
+
@api_client.config.logger.debug "API called: SessionsApi#cancel_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
79
|
+
end
|
80
|
+
return data, status_code, headers
|
81
|
+
end
|
82
|
+
|
83
|
+
# Create a Session to verify a user's identity
|
84
|
+
# @param [Hash] opts the optional parameters
|
85
|
+
# @option opts [CreateSessionRequest] :create_session_request
|
86
|
+
# @return [CreateSessionResponse]
|
87
|
+
def create_session(opts = {})
|
88
|
+
data, _status_code, _headers = create_session_with_http_info(opts)
|
89
|
+
data
|
90
|
+
end
|
91
|
+
|
92
|
+
# Create a Session to verify a user's identity
|
93
|
+
# @param [Hash] opts the optional parameters
|
94
|
+
# @option opts [CreateSessionRequest] :create_session_request
|
95
|
+
# @return [Array<(CreateSessionResponse, Integer, Hash)>] CreateSessionResponse data, response status code and response headers
|
96
|
+
def create_session_with_http_info(opts = {})
|
97
|
+
if @api_client.config.debugging
|
98
|
+
@api_client.config.logger.debug 'Calling API: SessionsApi.create_session ...'
|
99
|
+
end
|
100
|
+
# resource path
|
101
|
+
local_var_path = '/api/v1/sessions'
|
102
|
+
|
103
|
+
# query parameters
|
104
|
+
query_params = opts[:query_params] || {}
|
105
|
+
|
106
|
+
# header parameters
|
107
|
+
header_params = opts[:header_params] || {}
|
108
|
+
# HTTP header 'Accept' (if needed)
|
109
|
+
header_params['Accept'] = @api_client.select_header_accept(['text/plain', 'application/json', 'text/json'])
|
110
|
+
# HTTP header 'Content-Type'
|
111
|
+
content_type = @api_client.select_header_content_type(['application/json', 'text/json', 'application/*+json'])
|
112
|
+
if !content_type.nil?
|
113
|
+
header_params['Content-Type'] = content_type
|
114
|
+
end
|
115
|
+
|
116
|
+
# form parameters
|
117
|
+
form_params = opts[:form_params] || {}
|
118
|
+
|
119
|
+
# http body (model)
|
120
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'create_session_request'])
|
121
|
+
|
122
|
+
# return_type
|
123
|
+
return_type = opts[:debug_return_type] || 'CreateSessionResponse'
|
124
|
+
|
125
|
+
# auth_names
|
126
|
+
auth_names = opts[:debug_auth_names] || ['Bearer']
|
127
|
+
|
128
|
+
new_options = opts.merge(
|
129
|
+
:operation => :"SessionsApi.create_session",
|
130
|
+
:header_params => header_params,
|
131
|
+
:query_params => query_params,
|
132
|
+
:form_params => form_params,
|
133
|
+
:body => post_body,
|
134
|
+
:auth_names => auth_names,
|
135
|
+
:return_type => return_type
|
136
|
+
)
|
137
|
+
|
138
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
139
|
+
if @api_client.config.debugging
|
140
|
+
@api_client.config.logger.debug "API called: SessionsApi#create_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
141
|
+
end
|
142
|
+
return data, status_code, headers
|
143
|
+
end
|
144
|
+
|
145
|
+
# Exchange a Results Access Key for Identity Data
|
146
|
+
# @param session_id [String]
|
147
|
+
# @param [Hash] opts the optional parameters
|
148
|
+
# @option opts [ExchangeResultsKeyRequest] :exchange_results_key_request
|
149
|
+
# @return [ExchangeResultsKeyResponse]
|
150
|
+
def exchange_results_key(session_id, opts = {})
|
151
|
+
data, _status_code, _headers = exchange_results_key_with_http_info(session_id, opts)
|
152
|
+
data
|
153
|
+
end
|
154
|
+
|
155
|
+
# Exchange a Results Access Key for Identity Data
|
156
|
+
# @param session_id [String]
|
157
|
+
# @param [Hash] opts the optional parameters
|
158
|
+
# @option opts [ExchangeResultsKeyRequest] :exchange_results_key_request
|
159
|
+
# @return [Array<(ExchangeResultsKeyResponse, Integer, Hash)>] ExchangeResultsKeyResponse data, response status code and response headers
|
160
|
+
def exchange_results_key_with_http_info(session_id, opts = {})
|
161
|
+
if @api_client.config.debugging
|
162
|
+
@api_client.config.logger.debug 'Calling API: SessionsApi.exchange_results_key ...'
|
163
|
+
end
|
164
|
+
# verify the required parameter 'session_id' is set
|
165
|
+
if @api_client.config.client_side_validation && session_id.nil?
|
166
|
+
fail ArgumentError, "Missing the required parameter 'session_id' when calling SessionsApi.exchange_results_key"
|
167
|
+
end
|
168
|
+
# resource path
|
169
|
+
local_var_path = '/api/v1/sessions/{sessionId}/results/exchange'.sub('{' + 'sessionId' + '}', CGI.escape(session_id.to_s))
|
170
|
+
|
171
|
+
# query parameters
|
172
|
+
query_params = opts[:query_params] || {}
|
173
|
+
|
174
|
+
# header parameters
|
175
|
+
header_params = opts[:header_params] || {}
|
176
|
+
# HTTP header 'Accept' (if needed)
|
177
|
+
header_params['Accept'] = @api_client.select_header_accept(['text/plain', 'application/json', 'text/json'])
|
178
|
+
# HTTP header 'Content-Type'
|
179
|
+
content_type = @api_client.select_header_content_type(['application/json', 'text/json', 'application/*+json'])
|
180
|
+
if !content_type.nil?
|
181
|
+
header_params['Content-Type'] = content_type
|
182
|
+
end
|
183
|
+
|
184
|
+
# form parameters
|
185
|
+
form_params = opts[:form_params] || {}
|
186
|
+
|
187
|
+
# http body (model)
|
188
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'exchange_results_key_request'])
|
189
|
+
|
190
|
+
# return_type
|
191
|
+
return_type = opts[:debug_return_type] || 'ExchangeResultsKeyResponse'
|
192
|
+
|
193
|
+
# auth_names
|
194
|
+
auth_names = opts[:debug_auth_names] || ['Bearer']
|
195
|
+
|
196
|
+
new_options = opts.merge(
|
197
|
+
:operation => :"SessionsApi.exchange_results_key",
|
198
|
+
:header_params => header_params,
|
199
|
+
:query_params => query_params,
|
200
|
+
:form_params => form_params,
|
201
|
+
:body => post_body,
|
202
|
+
:auth_names => auth_names,
|
203
|
+
:return_type => return_type
|
204
|
+
)
|
205
|
+
|
206
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
207
|
+
if @api_client.config.debugging
|
208
|
+
@api_client.config.logger.debug "API called: SessionsApi#exchange_results_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
209
|
+
end
|
210
|
+
return data, status_code, headers
|
211
|
+
end
|
212
|
+
|
213
|
+
# Get a Session by its ID
|
214
|
+
# @param session_id [String]
|
215
|
+
# @param [Hash] opts the optional parameters
|
216
|
+
# @return [GetSessionResponse]
|
217
|
+
def get_session(session_id, opts = {})
|
218
|
+
data, _status_code, _headers = get_session_with_http_info(session_id, opts)
|
219
|
+
data
|
220
|
+
end
|
221
|
+
|
222
|
+
# Get a Session by its ID
|
223
|
+
# @param session_id [String]
|
224
|
+
# @param [Hash] opts the optional parameters
|
225
|
+
# @return [Array<(GetSessionResponse, Integer, Hash)>] GetSessionResponse data, response status code and response headers
|
226
|
+
def get_session_with_http_info(session_id, opts = {})
|
227
|
+
if @api_client.config.debugging
|
228
|
+
@api_client.config.logger.debug 'Calling API: SessionsApi.get_session ...'
|
229
|
+
end
|
230
|
+
# verify the required parameter 'session_id' is set
|
231
|
+
if @api_client.config.client_side_validation && session_id.nil?
|
232
|
+
fail ArgumentError, "Missing the required parameter 'session_id' when calling SessionsApi.get_session"
|
233
|
+
end
|
234
|
+
# resource path
|
235
|
+
local_var_path = '/api/v1/sessions/{sessionId}'.sub('{' + 'sessionId' + '}', CGI.escape(session_id.to_s))
|
236
|
+
|
237
|
+
# query parameters
|
238
|
+
query_params = opts[:query_params] || {}
|
239
|
+
|
240
|
+
# header parameters
|
241
|
+
header_params = opts[:header_params] || {}
|
242
|
+
# HTTP header 'Accept' (if needed)
|
243
|
+
header_params['Accept'] = @api_client.select_header_accept(['text/plain', 'application/json', 'text/json'])
|
244
|
+
|
245
|
+
# form parameters
|
246
|
+
form_params = opts[:form_params] || {}
|
247
|
+
|
248
|
+
# http body (model)
|
249
|
+
post_body = opts[:debug_body]
|
250
|
+
|
251
|
+
# return_type
|
252
|
+
return_type = opts[:debug_return_type] || 'GetSessionResponse'
|
253
|
+
|
254
|
+
# auth_names
|
255
|
+
auth_names = opts[:debug_auth_names] || ['Bearer']
|
256
|
+
|
257
|
+
new_options = opts.merge(
|
258
|
+
:operation => :"SessionsApi.get_session",
|
259
|
+
:header_params => header_params,
|
260
|
+
:query_params => query_params,
|
261
|
+
:form_params => form_params,
|
262
|
+
:body => post_body,
|
263
|
+
:auth_names => auth_names,
|
264
|
+
:return_type => return_type
|
265
|
+
)
|
266
|
+
|
267
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
268
|
+
if @api_client.config.debugging
|
269
|
+
@api_client.config.logger.debug "API called: SessionsApi#get_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
270
|
+
end
|
271
|
+
return data, status_code, headers
|
272
|
+
end
|
273
|
+
|
274
|
+
# List Sessions created by your account
|
275
|
+
# @param [Hash] opts the optional parameters
|
276
|
+
# @option opts [SessionOrdering] :order_by The field by which sessions should be ordered
|
277
|
+
# @option opts [OrderDirection] :order_direction
|
278
|
+
# @option opts [Integer] :page_size The number of items to return per page -- must be between `1` and `50`
|
279
|
+
# @option opts [Integer] :page The page number to return -- starts at `1`
|
280
|
+
# @return [ListSessionsResponse]
|
281
|
+
def list_sessions(opts = {})
|
282
|
+
data, _status_code, _headers = list_sessions_with_http_info(opts)
|
283
|
+
data
|
284
|
+
end
|
285
|
+
|
286
|
+
# List Sessions created by your account
|
287
|
+
# @param [Hash] opts the optional parameters
|
288
|
+
# @option opts [SessionOrdering] :order_by The field by which sessions should be ordered
|
289
|
+
# @option opts [OrderDirection] :order_direction
|
290
|
+
# @option opts [Integer] :page_size The number of items to return per page -- must be between `1` and `50`
|
291
|
+
# @option opts [Integer] :page The page number to return -- starts at `1`
|
292
|
+
# @return [Array<(ListSessionsResponse, Integer, Hash)>] ListSessionsResponse data, response status code and response headers
|
293
|
+
def list_sessions_with_http_info(opts = {})
|
294
|
+
if @api_client.config.debugging
|
295
|
+
@api_client.config.logger.debug 'Calling API: SessionsApi.list_sessions ...'
|
296
|
+
end
|
297
|
+
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 50
|
298
|
+
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling SessionsApi.list_sessions, must be smaller than or equal to 50.'
|
299
|
+
end
|
300
|
+
|
301
|
+
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
|
302
|
+
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling SessionsApi.list_sessions, must be greater than or equal to 1.'
|
303
|
+
end
|
304
|
+
|
305
|
+
if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] > 2147483647
|
306
|
+
fail ArgumentError, 'invalid value for "opts[:"page"]" when calling SessionsApi.list_sessions, must be smaller than or equal to 2147483647.'
|
307
|
+
end
|
308
|
+
|
309
|
+
if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
|
310
|
+
fail ArgumentError, 'invalid value for "opts[:"page"]" when calling SessionsApi.list_sessions, must be greater than or equal to 1.'
|
311
|
+
end
|
312
|
+
|
313
|
+
# resource path
|
314
|
+
local_var_path = '/api/v1/sessions'
|
315
|
+
|
316
|
+
# query parameters
|
317
|
+
query_params = opts[:query_params] || {}
|
318
|
+
query_params[:'OrderBy'] = opts[:'order_by'] if !opts[:'order_by'].nil?
|
319
|
+
query_params[:'OrderDirection'] = opts[:'order_direction'] if !opts[:'order_direction'].nil?
|
320
|
+
query_params[:'PageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?
|
321
|
+
query_params[:'Page'] = opts[:'page'] if !opts[:'page'].nil?
|
322
|
+
|
323
|
+
# header parameters
|
324
|
+
header_params = opts[:header_params] || {}
|
325
|
+
# HTTP header 'Accept' (if needed)
|
326
|
+
header_params['Accept'] = @api_client.select_header_accept(['text/plain', 'application/json', 'text/json'])
|
327
|
+
|
328
|
+
# form parameters
|
329
|
+
form_params = opts[:form_params] || {}
|
330
|
+
|
331
|
+
# http body (model)
|
332
|
+
post_body = opts[:debug_body]
|
333
|
+
|
334
|
+
# return_type
|
335
|
+
return_type = opts[:debug_return_type] || 'ListSessionsResponse'
|
336
|
+
|
337
|
+
# auth_names
|
338
|
+
auth_names = opts[:debug_auth_names] || ['Bearer']
|
339
|
+
|
340
|
+
new_options = opts.merge(
|
341
|
+
:operation => :"SessionsApi.list_sessions",
|
342
|
+
:header_params => header_params,
|
343
|
+
:query_params => query_params,
|
344
|
+
:form_params => form_params,
|
345
|
+
:body => post_body,
|
346
|
+
:auth_names => auth_names,
|
347
|
+
:return_type => return_type
|
348
|
+
)
|
349
|
+
|
350
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
351
|
+
if @api_client.config.debugging
|
352
|
+
@api_client.config.logger.debug "API called: SessionsApi#list_sessions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
353
|
+
end
|
354
|
+
return data, status_code, headers
|
355
|
+
end
|
356
|
+
|
357
|
+
# Redact a Session, removing all identity data from Trinsic's servers. Identity data that a user has chosen to save in their passkey-protected wallet will not be deleted.
|
358
|
+
# @param session_id [String]
|
359
|
+
# @param [Hash] opts the optional parameters
|
360
|
+
# @return [nil]
|
361
|
+
def redact_session(session_id, opts = {})
|
362
|
+
redact_session_with_http_info(session_id, opts)
|
363
|
+
nil
|
364
|
+
end
|
365
|
+
|
366
|
+
# Redact a Session, removing all identity data from Trinsic's servers. Identity data that a user has chosen to save in their passkey-protected wallet will not be deleted.
|
367
|
+
# @param session_id [String]
|
368
|
+
# @param [Hash] opts the optional parameters
|
369
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
370
|
+
def redact_session_with_http_info(session_id, opts = {})
|
371
|
+
if @api_client.config.debugging
|
372
|
+
@api_client.config.logger.debug 'Calling API: SessionsApi.redact_session ...'
|
373
|
+
end
|
374
|
+
# verify the required parameter 'session_id' is set
|
375
|
+
if @api_client.config.client_side_validation && session_id.nil?
|
376
|
+
fail ArgumentError, "Missing the required parameter 'session_id' when calling SessionsApi.redact_session"
|
377
|
+
end
|
378
|
+
# resource path
|
379
|
+
local_var_path = '/api/v1/sessions/{sessionId}/redact'.sub('{' + 'sessionId' + '}', CGI.escape(session_id.to_s))
|
380
|
+
|
381
|
+
# query parameters
|
382
|
+
query_params = opts[:query_params] || {}
|
383
|
+
|
384
|
+
# header parameters
|
385
|
+
header_params = opts[:header_params] || {}
|
386
|
+
# HTTP header 'Accept' (if needed)
|
387
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
388
|
+
|
389
|
+
# form parameters
|
390
|
+
form_params = opts[:form_params] || {}
|
391
|
+
|
392
|
+
# http body (model)
|
393
|
+
post_body = opts[:debug_body]
|
394
|
+
|
395
|
+
# return_type
|
396
|
+
return_type = opts[:debug_return_type]
|
397
|
+
|
398
|
+
# auth_names
|
399
|
+
auth_names = opts[:debug_auth_names] || ['Bearer']
|
400
|
+
|
401
|
+
new_options = opts.merge(
|
402
|
+
:operation => :"SessionsApi.redact_session",
|
403
|
+
:header_params => header_params,
|
404
|
+
:query_params => query_params,
|
405
|
+
:form_params => form_params,
|
406
|
+
:body => post_body,
|
407
|
+
:auth_names => auth_names,
|
408
|
+
:return_type => return_type
|
409
|
+
)
|
410
|
+
|
411
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
412
|
+
if @api_client.config.debugging
|
413
|
+
@api_client.config.logger.debug "API called: SessionsApi#redact_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
414
|
+
end
|
415
|
+
return data, status_code, headers
|
416
|
+
end
|
417
|
+
end
|
418
|
+
end
|