turnkey_client 0.0.8 → 0.0.12
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 +4 -4
- data/lib/turnkey_client/api/features_api.rb +4 -4
- data/lib/turnkey_client/api/organizations_api.rb +118 -2
- data/lib/turnkey_client/api/private_keys_api.rb +2 -2
- data/lib/turnkey_client/api/user_auth_api.rb +348 -0
- data/lib/turnkey_client/api/users_api.rb +0 -232
- data/lib/turnkey_client/api/wallets_api.rb +60 -2
- data/lib/turnkey_client/models/activity_type.rb +6 -0
- data/lib/turnkey_client/models/address_format.rb +29 -0
- data/lib/turnkey_client/models/create_read_write_session_intent_v2.rb +241 -0
- data/lib/turnkey_client/models/create_read_write_session_request.rb +2 -2
- data/lib/turnkey_client/models/create_read_write_session_result_v2.rb +286 -0
- data/lib/turnkey_client/models/create_sub_organization_intent_v7.rb +292 -0
- data/lib/turnkey_client/models/create_sub_organization_request.rb +2 -2
- data/lib/turnkey_client/models/create_sub_organization_result_v7.rb +230 -0
- data/lib/turnkey_client/models/credential_type.rb +1 -0
- data/lib/turnkey_client/models/delete_sub_organization_intent.rb +206 -0
- data/lib/turnkey_client/models/delete_sub_organization_request.rb +288 -0
- data/lib/turnkey_client/models/delete_sub_organization_result.rb +211 -0
- data/lib/turnkey_client/models/email_auth_intent.rb +14 -4
- data/lib/turnkey_client/models/email_auth_intent_v2.rb +14 -4
- data/lib/turnkey_client/models/feature_name.rb +2 -0
- data/lib/turnkey_client/models/get_sub_org_ids_request.rb +1 -1
- data/lib/turnkey_client/models/get_verified_sub_org_ids_request.rb +240 -0
- data/lib/turnkey_client/models/get_verified_sub_org_ids_response.rb +213 -0
- data/lib/turnkey_client/models/init_otp_auth_intent.rb +264 -0
- data/lib/turnkey_client/models/init_otp_auth_request.rb +288 -0
- data/lib/turnkey_client/models/init_otp_auth_result.rb +211 -0
- data/lib/turnkey_client/models/intent.rb +58 -4
- data/lib/turnkey_client/models/otp_auth_intent.rb +266 -0
- data/lib/turnkey_client/models/otp_auth_request.rb +288 -0
- data/lib/turnkey_client/models/otp_auth_result.rb +231 -0
- data/lib/turnkey_client/models/result.rb +58 -4
- data/lib/turnkey_client/models/root_user_params_v4.rb +282 -0
- data/lib/turnkey_client/models/sms_customization_params.rb +206 -0
- data/lib/turnkey_client/models/transaction_type.rb +2 -1
- data/lib/turnkey_client/models/update_user_intent.rb +14 -4
- data/lib/turnkey_client/models/update_wallet_intent.rb +221 -0
- data/lib/turnkey_client/models/update_wallet_request.rb +288 -0
- data/lib/turnkey_client/models/update_wallet_result.rb +211 -0
- data/lib/turnkey_client/models/user.rb +11 -1
- data/lib/turnkey_client/models/wallet_account.rb +16 -1
- data/lib/turnkey_client/version.rb +1 -1
- data/lib/turnkey_client.rb +20 -0
- data/turnkey_client-0.0.8.gem +0 -0
- data/turnkey_client-0.0.9.gem +0 -0
- metadata +24 -2
@@ -15,64 +15,6 @@ module TurnkeyClient
|
|
15
15
|
def initialize(api_client = ApiClient.default)
|
16
16
|
@api_client = api_client
|
17
17
|
end
|
18
|
-
# Create Oauth Providers
|
19
|
-
# Creates Oauth providers for a specified user - BETA
|
20
|
-
# @param body
|
21
|
-
# @param [Hash] opts the optional parameters
|
22
|
-
# @return [ActivityResponse]
|
23
|
-
def create_oauth_providers(body, opts = {})
|
24
|
-
data, _status_code, _headers = create_oauth_providers_with_http_info(body, opts)
|
25
|
-
data
|
26
|
-
end
|
27
|
-
|
28
|
-
# Create Oauth Providers
|
29
|
-
# Creates Oauth providers for a specified user - BETA
|
30
|
-
# @param body
|
31
|
-
# @param [Hash] opts the optional parameters
|
32
|
-
# @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers
|
33
|
-
def create_oauth_providers_with_http_info(body, opts = {})
|
34
|
-
if @api_client.config.debugging
|
35
|
-
@api_client.config.logger.debug 'Calling API: UsersApi.create_oauth_providers ...'
|
36
|
-
end
|
37
|
-
# verify the required parameter 'body' is set
|
38
|
-
if @api_client.config.client_side_validation && body.nil?
|
39
|
-
fail ArgumentError, "Missing the required parameter 'body' when calling UsersApi.create_oauth_providers"
|
40
|
-
end
|
41
|
-
# resource path
|
42
|
-
local_var_path = '/public/v1/submit/create_oauth_providers'
|
43
|
-
|
44
|
-
# query parameters
|
45
|
-
query_params = opts[:query_params] || {}
|
46
|
-
|
47
|
-
# header parameters
|
48
|
-
header_params = opts[:header_params] || {}
|
49
|
-
# HTTP header 'Accept' (if needed)
|
50
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
51
|
-
# HTTP header 'Content-Type'
|
52
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
53
|
-
|
54
|
-
# form parameters
|
55
|
-
form_params = opts[:form_params] || {}
|
56
|
-
|
57
|
-
# http body (model)
|
58
|
-
post_body = opts[:body] || @api_client.object_to_http_body(body)
|
59
|
-
|
60
|
-
return_type = opts[:return_type] || 'ActivityResponse'
|
61
|
-
|
62
|
-
auth_names = opts[:auth_names] || ['ApiKeyAuth', 'AuthenticatorAuth']
|
63
|
-
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
64
|
-
:header_params => header_params,
|
65
|
-
:query_params => query_params,
|
66
|
-
:form_params => form_params,
|
67
|
-
:body => post_body,
|
68
|
-
:auth_names => auth_names,
|
69
|
-
:return_type => return_type)
|
70
|
-
|
71
|
-
if @api_client.config.debugging
|
72
|
-
@api_client.config.logger.debug "API called: UsersApi#create_oauth_providers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
73
|
-
end
|
74
|
-
return data, status_code, headers
|
75
|
-
end
|
76
18
|
# Create Users
|
77
19
|
# Create Users in an existing Organization
|
78
20
|
# @param body
|
@@ -131,64 +73,6 @@ module TurnkeyClient
|
|
131
73
|
end
|
132
74
|
return data, status_code, headers
|
133
75
|
end
|
134
|
-
# Delete Oauth Providers
|
135
|
-
# Removes Oauth providers for a specified user - BETA
|
136
|
-
# @param body
|
137
|
-
# @param [Hash] opts the optional parameters
|
138
|
-
# @return [ActivityResponse]
|
139
|
-
def delete_oauth_providers(body, opts = {})
|
140
|
-
data, _status_code, _headers = delete_oauth_providers_with_http_info(body, opts)
|
141
|
-
data
|
142
|
-
end
|
143
|
-
|
144
|
-
# Delete Oauth Providers
|
145
|
-
# Removes Oauth providers for a specified user - BETA
|
146
|
-
# @param body
|
147
|
-
# @param [Hash] opts the optional parameters
|
148
|
-
# @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers
|
149
|
-
def delete_oauth_providers_with_http_info(body, opts = {})
|
150
|
-
if @api_client.config.debugging
|
151
|
-
@api_client.config.logger.debug 'Calling API: UsersApi.delete_oauth_providers ...'
|
152
|
-
end
|
153
|
-
# verify the required parameter 'body' is set
|
154
|
-
if @api_client.config.client_side_validation && body.nil?
|
155
|
-
fail ArgumentError, "Missing the required parameter 'body' when calling UsersApi.delete_oauth_providers"
|
156
|
-
end
|
157
|
-
# resource path
|
158
|
-
local_var_path = '/public/v1/submit/delete_oauth_providers'
|
159
|
-
|
160
|
-
# query parameters
|
161
|
-
query_params = opts[:query_params] || {}
|
162
|
-
|
163
|
-
# header parameters
|
164
|
-
header_params = opts[:header_params] || {}
|
165
|
-
# HTTP header 'Accept' (if needed)
|
166
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
167
|
-
# HTTP header 'Content-Type'
|
168
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
169
|
-
|
170
|
-
# form parameters
|
171
|
-
form_params = opts[:form_params] || {}
|
172
|
-
|
173
|
-
# http body (model)
|
174
|
-
post_body = opts[:body] || @api_client.object_to_http_body(body)
|
175
|
-
|
176
|
-
return_type = opts[:return_type] || 'ActivityResponse'
|
177
|
-
|
178
|
-
auth_names = opts[:auth_names] || ['ApiKeyAuth', 'AuthenticatorAuth']
|
179
|
-
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
180
|
-
:header_params => header_params,
|
181
|
-
:query_params => query_params,
|
182
|
-
:form_params => form_params,
|
183
|
-
:body => post_body,
|
184
|
-
:auth_names => auth_names,
|
185
|
-
:return_type => return_type)
|
186
|
-
|
187
|
-
if @api_client.config.debugging
|
188
|
-
@api_client.config.logger.debug "API called: UsersApi#delete_oauth_providers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
189
|
-
end
|
190
|
-
return data, status_code, headers
|
191
|
-
end
|
192
76
|
# Delete Users
|
193
77
|
# Delete Users within an Organization
|
194
78
|
# @param body
|
@@ -247,64 +131,6 @@ module TurnkeyClient
|
|
247
131
|
end
|
248
132
|
return data, status_code, headers
|
249
133
|
end
|
250
|
-
# Get Oauth providers
|
251
|
-
# Get details about Oauth providers for a user
|
252
|
-
# @param body
|
253
|
-
# @param [Hash] opts the optional parameters
|
254
|
-
# @return [GetOauthProvidersResponse]
|
255
|
-
def get_oauth_providers(body, opts = {})
|
256
|
-
data, _status_code, _headers = get_oauth_providers_with_http_info(body, opts)
|
257
|
-
data
|
258
|
-
end
|
259
|
-
|
260
|
-
# Get Oauth providers
|
261
|
-
# Get details about Oauth providers for a user
|
262
|
-
# @param body
|
263
|
-
# @param [Hash] opts the optional parameters
|
264
|
-
# @return [Array<(GetOauthProvidersResponse, Integer, Hash)>] GetOauthProvidersResponse data, response status code and response headers
|
265
|
-
def get_oauth_providers_with_http_info(body, opts = {})
|
266
|
-
if @api_client.config.debugging
|
267
|
-
@api_client.config.logger.debug 'Calling API: UsersApi.get_oauth_providers ...'
|
268
|
-
end
|
269
|
-
# verify the required parameter 'body' is set
|
270
|
-
if @api_client.config.client_side_validation && body.nil?
|
271
|
-
fail ArgumentError, "Missing the required parameter 'body' when calling UsersApi.get_oauth_providers"
|
272
|
-
end
|
273
|
-
# resource path
|
274
|
-
local_var_path = '/public/v1/query/get_oauth_providers'
|
275
|
-
|
276
|
-
# query parameters
|
277
|
-
query_params = opts[:query_params] || {}
|
278
|
-
|
279
|
-
# header parameters
|
280
|
-
header_params = opts[:header_params] || {}
|
281
|
-
# HTTP header 'Accept' (if needed)
|
282
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
283
|
-
# HTTP header 'Content-Type'
|
284
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
285
|
-
|
286
|
-
# form parameters
|
287
|
-
form_params = opts[:form_params] || {}
|
288
|
-
|
289
|
-
# http body (model)
|
290
|
-
post_body = opts[:body] || @api_client.object_to_http_body(body)
|
291
|
-
|
292
|
-
return_type = opts[:return_type] || 'GetOauthProvidersResponse'
|
293
|
-
|
294
|
-
auth_names = opts[:auth_names] || ['ApiKeyAuth', 'AuthenticatorAuth']
|
295
|
-
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
296
|
-
:header_params => header_params,
|
297
|
-
:query_params => query_params,
|
298
|
-
:form_params => form_params,
|
299
|
-
:body => post_body,
|
300
|
-
:auth_names => auth_names,
|
301
|
-
:return_type => return_type)
|
302
|
-
|
303
|
-
if @api_client.config.debugging
|
304
|
-
@api_client.config.logger.debug "API called: UsersApi#get_oauth_providers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
305
|
-
end
|
306
|
-
return data, status_code, headers
|
307
|
-
end
|
308
134
|
# Get User
|
309
135
|
# Get details about a User
|
310
136
|
# @param body
|
@@ -421,64 +247,6 @@ module TurnkeyClient
|
|
421
247
|
end
|
422
248
|
return data, status_code, headers
|
423
249
|
end
|
424
|
-
# Oauth
|
425
|
-
# Authenticate a user with an Oidc token (Oauth) - BETA
|
426
|
-
# @param body
|
427
|
-
# @param [Hash] opts the optional parameters
|
428
|
-
# @return [ActivityResponse]
|
429
|
-
def oauth(body, opts = {})
|
430
|
-
data, _status_code, _headers = oauth_with_http_info(body, opts)
|
431
|
-
data
|
432
|
-
end
|
433
|
-
|
434
|
-
# Oauth
|
435
|
-
# Authenticate a user with an Oidc token (Oauth) - BETA
|
436
|
-
# @param body
|
437
|
-
# @param [Hash] opts the optional parameters
|
438
|
-
# @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers
|
439
|
-
def oauth_with_http_info(body, opts = {})
|
440
|
-
if @api_client.config.debugging
|
441
|
-
@api_client.config.logger.debug 'Calling API: UsersApi.oauth ...'
|
442
|
-
end
|
443
|
-
# verify the required parameter 'body' is set
|
444
|
-
if @api_client.config.client_side_validation && body.nil?
|
445
|
-
fail ArgumentError, "Missing the required parameter 'body' when calling UsersApi.oauth"
|
446
|
-
end
|
447
|
-
# resource path
|
448
|
-
local_var_path = '/public/v1/submit/oauth'
|
449
|
-
|
450
|
-
# query parameters
|
451
|
-
query_params = opts[:query_params] || {}
|
452
|
-
|
453
|
-
# header parameters
|
454
|
-
header_params = opts[:header_params] || {}
|
455
|
-
# HTTP header 'Accept' (if needed)
|
456
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
457
|
-
# HTTP header 'Content-Type'
|
458
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
459
|
-
|
460
|
-
# form parameters
|
461
|
-
form_params = opts[:form_params] || {}
|
462
|
-
|
463
|
-
# http body (model)
|
464
|
-
post_body = opts[:body] || @api_client.object_to_http_body(body)
|
465
|
-
|
466
|
-
return_type = opts[:return_type] || 'ActivityResponse'
|
467
|
-
|
468
|
-
auth_names = opts[:auth_names] || ['ApiKeyAuth', 'AuthenticatorAuth']
|
469
|
-
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
470
|
-
:header_params => header_params,
|
471
|
-
:query_params => query_params,
|
472
|
-
:form_params => form_params,
|
473
|
-
:body => post_body,
|
474
|
-
:auth_names => auth_names,
|
475
|
-
:return_type => return_type)
|
476
|
-
|
477
|
-
if @api_client.config.debugging
|
478
|
-
@api_client.config.logger.debug "API called: UsersApi#oauth\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
479
|
-
end
|
480
|
-
return data, status_code, headers
|
481
|
-
end
|
482
250
|
# Update User
|
483
251
|
# Update a User in an existing Organization
|
484
252
|
# @param body
|
@@ -131,7 +131,7 @@ module TurnkeyClient
|
|
131
131
|
end
|
132
132
|
return data, status_code, headers
|
133
133
|
end
|
134
|
-
# Delete
|
134
|
+
# Delete Wallets
|
135
135
|
# Deletes wallets for an organization
|
136
136
|
# @param body
|
137
137
|
# @param [Hash] opts the optional parameters
|
@@ -141,7 +141,7 @@ module TurnkeyClient
|
|
141
141
|
data
|
142
142
|
end
|
143
143
|
|
144
|
-
# Delete
|
144
|
+
# Delete Wallets
|
145
145
|
# Deletes wallets for an organization
|
146
146
|
# @param body
|
147
147
|
# @param [Hash] opts the optional parameters
|
@@ -595,5 +595,63 @@ module TurnkeyClient
|
|
595
595
|
end
|
596
596
|
return data, status_code, headers
|
597
597
|
end
|
598
|
+
# Update Wallet
|
599
|
+
# Update a wallet for an organization
|
600
|
+
# @param body
|
601
|
+
# @param [Hash] opts the optional parameters
|
602
|
+
# @return [ActivityResponse]
|
603
|
+
def update_wallet(body, opts = {})
|
604
|
+
data, _status_code, _headers = update_wallet_with_http_info(body, opts)
|
605
|
+
data
|
606
|
+
end
|
607
|
+
|
608
|
+
# Update Wallet
|
609
|
+
# Update a wallet for an organization
|
610
|
+
# @param body
|
611
|
+
# @param [Hash] opts the optional parameters
|
612
|
+
# @return [Array<(ActivityResponse, Integer, Hash)>] ActivityResponse data, response status code and response headers
|
613
|
+
def update_wallet_with_http_info(body, opts = {})
|
614
|
+
if @api_client.config.debugging
|
615
|
+
@api_client.config.logger.debug 'Calling API: WalletsApi.update_wallet ...'
|
616
|
+
end
|
617
|
+
# verify the required parameter 'body' is set
|
618
|
+
if @api_client.config.client_side_validation && body.nil?
|
619
|
+
fail ArgumentError, "Missing the required parameter 'body' when calling WalletsApi.update_wallet"
|
620
|
+
end
|
621
|
+
# resource path
|
622
|
+
local_var_path = '/public/v1/submit/update_wallet'
|
623
|
+
|
624
|
+
# query parameters
|
625
|
+
query_params = opts[:query_params] || {}
|
626
|
+
|
627
|
+
# header parameters
|
628
|
+
header_params = opts[:header_params] || {}
|
629
|
+
# HTTP header 'Accept' (if needed)
|
630
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
631
|
+
# HTTP header 'Content-Type'
|
632
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
633
|
+
|
634
|
+
# form parameters
|
635
|
+
form_params = opts[:form_params] || {}
|
636
|
+
|
637
|
+
# http body (model)
|
638
|
+
post_body = opts[:body] || @api_client.object_to_http_body(body)
|
639
|
+
|
640
|
+
return_type = opts[:return_type] || 'ActivityResponse'
|
641
|
+
|
642
|
+
auth_names = opts[:auth_names] || ['ApiKeyAuth', 'AuthenticatorAuth']
|
643
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
644
|
+
:header_params => header_params,
|
645
|
+
:query_params => query_params,
|
646
|
+
:form_params => form_params,
|
647
|
+
:body => post_body,
|
648
|
+
:auth_names => auth_names,
|
649
|
+
:return_type => return_type)
|
650
|
+
|
651
|
+
if @api_client.config.debugging
|
652
|
+
@api_client.config.logger.debug "API called: WalletsApi#update_wallet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
653
|
+
end
|
654
|
+
return data, status_code, headers
|
655
|
+
end
|
598
656
|
end
|
599
657
|
end
|
@@ -86,6 +86,12 @@ module TurnkeyClient
|
|
86
86
|
CREATE_SUB_ORGANIZATION_V6 = 'ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V6'.freeze
|
87
87
|
DELETE_PRIVATE_KEYS = 'ACTIVITY_TYPE_DELETE_PRIVATE_KEYS'.freeze
|
88
88
|
DELETE_WALLETS = 'ACTIVITY_TYPE_DELETE_WALLETS'.freeze
|
89
|
+
CREATE_READ_WRITE_SESSION_V2 = 'ACTIVITY_TYPE_CREATE_READ_WRITE_SESSION_V2'.freeze
|
90
|
+
DELETE_SUB_ORGANIZATION = 'ACTIVITY_TYPE_DELETE_SUB_ORGANIZATION'.freeze
|
91
|
+
INIT_OTP_AUTH = 'ACTIVITY_TYPE_INIT_OTP_AUTH'.freeze
|
92
|
+
OTP_AUTH = 'ACTIVITY_TYPE_OTP_AUTH'.freeze
|
93
|
+
CREATE_SUB_ORGANIZATION_V7 = 'ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V7'.freeze
|
94
|
+
UPDATE_WALLET = 'ACTIVITY_TYPE_UPDATE_WALLET'.freeze
|
89
95
|
|
90
96
|
# Builds the enum from string
|
91
97
|
# @param [String] The enum value in the form of the string
|
@@ -18,6 +18,35 @@ module TurnkeyClient
|
|
18
18
|
SOLANA = 'ADDRESS_FORMAT_SOLANA'.freeze
|
19
19
|
COSMOS = 'ADDRESS_FORMAT_COSMOS'.freeze
|
20
20
|
TRON = 'ADDRESS_FORMAT_TRON'.freeze
|
21
|
+
SUI = 'ADDRESS_FORMAT_SUI'.freeze
|
22
|
+
APTOS = 'ADDRESS_FORMAT_APTOS'.freeze
|
23
|
+
BITCOIN_MAINNET_P2_PKH = 'ADDRESS_FORMAT_BITCOIN_MAINNET_P2PKH'.freeze
|
24
|
+
BITCOIN_MAINNET_P2_SH = 'ADDRESS_FORMAT_BITCOIN_MAINNET_P2SH'.freeze
|
25
|
+
BITCOIN_MAINNET_P2_WPKH = 'ADDRESS_FORMAT_BITCOIN_MAINNET_P2WPKH'.freeze
|
26
|
+
BITCOIN_MAINNET_P2_WSH = 'ADDRESS_FORMAT_BITCOIN_MAINNET_P2WSH'.freeze
|
27
|
+
BITCOIN_MAINNET_P2_TR = 'ADDRESS_FORMAT_BITCOIN_MAINNET_P2TR'.freeze
|
28
|
+
BITCOIN_TESTNET_P2_PKH = 'ADDRESS_FORMAT_BITCOIN_TESTNET_P2PKH'.freeze
|
29
|
+
BITCOIN_TESTNET_P2_SH = 'ADDRESS_FORMAT_BITCOIN_TESTNET_P2SH'.freeze
|
30
|
+
BITCOIN_TESTNET_P2_WPKH = 'ADDRESS_FORMAT_BITCOIN_TESTNET_P2WPKH'.freeze
|
31
|
+
BITCOIN_TESTNET_P2_WSH = 'ADDRESS_FORMAT_BITCOIN_TESTNET_P2WSH'.freeze
|
32
|
+
BITCOIN_TESTNET_P2_TR = 'ADDRESS_FORMAT_BITCOIN_TESTNET_P2TR'.freeze
|
33
|
+
BITCOIN_SIGNET_P2_PKH = 'ADDRESS_FORMAT_BITCOIN_SIGNET_P2PKH'.freeze
|
34
|
+
BITCOIN_SIGNET_P2_SH = 'ADDRESS_FORMAT_BITCOIN_SIGNET_P2SH'.freeze
|
35
|
+
BITCOIN_SIGNET_P2_WPKH = 'ADDRESS_FORMAT_BITCOIN_SIGNET_P2WPKH'.freeze
|
36
|
+
BITCOIN_SIGNET_P2_WSH = 'ADDRESS_FORMAT_BITCOIN_SIGNET_P2WSH'.freeze
|
37
|
+
BITCOIN_SIGNET_P2_TR = 'ADDRESS_FORMAT_BITCOIN_SIGNET_P2TR'.freeze
|
38
|
+
BITCOIN_REGTEST_P2_PKH = 'ADDRESS_FORMAT_BITCOIN_REGTEST_P2PKH'.freeze
|
39
|
+
BITCOIN_REGTEST_P2_SH = 'ADDRESS_FORMAT_BITCOIN_REGTEST_P2SH'.freeze
|
40
|
+
BITCOIN_REGTEST_P2_WPKH = 'ADDRESS_FORMAT_BITCOIN_REGTEST_P2WPKH'.freeze
|
41
|
+
BITCOIN_REGTEST_P2_WSH = 'ADDRESS_FORMAT_BITCOIN_REGTEST_P2WSH'.freeze
|
42
|
+
BITCOIN_REGTEST_P2_TR = 'ADDRESS_FORMAT_BITCOIN_REGTEST_P2TR'.freeze
|
43
|
+
SEI = 'ADDRESS_FORMAT_SEI'.freeze
|
44
|
+
XLM = 'ADDRESS_FORMAT_XLM'.freeze
|
45
|
+
DOGE_MAINNET = 'ADDRESS_FORMAT_DOGE_MAINNET'.freeze
|
46
|
+
DOGE_TESTNET = 'ADDRESS_FORMAT_DOGE_TESTNET'.freeze
|
47
|
+
TON_V3_R2 = 'ADDRESS_FORMAT_TON_V3R2'.freeze
|
48
|
+
TON_V4_R2 = 'ADDRESS_FORMAT_TON_V4R2'.freeze
|
49
|
+
XRP = 'ADDRESS_FORMAT_XRP'.freeze
|
21
50
|
|
22
51
|
# Builds the enum from string
|
23
52
|
# @param [String] The enum value in the form of the string
|
@@ -0,0 +1,241 @@
|
|
1
|
+
=begin
|
2
|
+
#API Reference
|
3
|
+
|
4
|
+
#Review our [API Introduction](../api-introduction) to get started.
|
5
|
+
|
6
|
+
OpenAPI spec version: 1.0
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
=end
|
10
|
+
|
11
|
+
require 'date'
|
12
|
+
|
13
|
+
module TurnkeyClient
|
14
|
+
class CreateReadWriteSessionIntentV2
|
15
|
+
# Client-side public key generated by the user, to which the read write session bundle (credentials) will be encrypted.
|
16
|
+
attr_accessor :target_public_key
|
17
|
+
|
18
|
+
# Unique identifier for a given User.
|
19
|
+
attr_accessor :user_id
|
20
|
+
|
21
|
+
# Optional human-readable name for an API Key. If none provided, default to Read Write Session - <Timestamp>
|
22
|
+
attr_accessor :api_key_name
|
23
|
+
|
24
|
+
# Expiration window (in seconds) indicating how long the API key is valid. If not provided, a default of 15 minutes will be used.
|
25
|
+
attr_accessor :expiration_seconds
|
26
|
+
|
27
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
28
|
+
def self.attribute_map
|
29
|
+
{
|
30
|
+
:'target_public_key' => :'targetPublicKey',
|
31
|
+
:'user_id' => :'userId',
|
32
|
+
:'api_key_name' => :'apiKeyName',
|
33
|
+
:'expiration_seconds' => :'expirationSeconds'
|
34
|
+
}
|
35
|
+
end
|
36
|
+
|
37
|
+
# Attribute type mapping.
|
38
|
+
def self.openapi_types
|
39
|
+
{
|
40
|
+
:'target_public_key' => :'Object',
|
41
|
+
:'user_id' => :'Object',
|
42
|
+
:'api_key_name' => :'Object',
|
43
|
+
:'expiration_seconds' => :'Object'
|
44
|
+
}
|
45
|
+
end
|
46
|
+
|
47
|
+
# List of attributes with nullable: true
|
48
|
+
def self.openapi_nullable
|
49
|
+
Set.new([
|
50
|
+
])
|
51
|
+
end
|
52
|
+
|
53
|
+
# Initializes the object
|
54
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
55
|
+
def initialize(attributes = {})
|
56
|
+
if (!attributes.is_a?(Hash))
|
57
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::CreateReadWriteSessionIntentV2` initialize method"
|
58
|
+
end
|
59
|
+
|
60
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
61
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
62
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
63
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::CreateReadWriteSessionIntentV2`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
64
|
+
end
|
65
|
+
h[k.to_sym] = v
|
66
|
+
}
|
67
|
+
|
68
|
+
if attributes.key?(:'target_public_key')
|
69
|
+
self.target_public_key = attributes[:'target_public_key']
|
70
|
+
end
|
71
|
+
|
72
|
+
if attributes.key?(:'user_id')
|
73
|
+
self.user_id = attributes[:'user_id']
|
74
|
+
end
|
75
|
+
|
76
|
+
if attributes.key?(:'api_key_name')
|
77
|
+
self.api_key_name = attributes[:'api_key_name']
|
78
|
+
end
|
79
|
+
|
80
|
+
if attributes.key?(:'expiration_seconds')
|
81
|
+
self.expiration_seconds = attributes[:'expiration_seconds']
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
86
|
+
# @return Array for valid properties with the reasons
|
87
|
+
def list_invalid_properties
|
88
|
+
invalid_properties = Array.new
|
89
|
+
if @target_public_key.nil?
|
90
|
+
invalid_properties.push('invalid value for "target_public_key", target_public_key cannot be nil.')
|
91
|
+
end
|
92
|
+
|
93
|
+
invalid_properties
|
94
|
+
end
|
95
|
+
|
96
|
+
# Check to see if the all the properties in the model are valid
|
97
|
+
# @return true if the model is valid
|
98
|
+
def valid?
|
99
|
+
return false if @target_public_key.nil?
|
100
|
+
true
|
101
|
+
end
|
102
|
+
|
103
|
+
# Checks equality by comparing each attribute.
|
104
|
+
# @param [Object] Object to be compared
|
105
|
+
def ==(o)
|
106
|
+
return true if self.equal?(o)
|
107
|
+
self.class == o.class &&
|
108
|
+
target_public_key == o.target_public_key &&
|
109
|
+
user_id == o.user_id &&
|
110
|
+
api_key_name == o.api_key_name &&
|
111
|
+
expiration_seconds == o.expiration_seconds
|
112
|
+
end
|
113
|
+
|
114
|
+
# @see the `==` method
|
115
|
+
# @param [Object] Object to be compared
|
116
|
+
def eql?(o)
|
117
|
+
self == o
|
118
|
+
end
|
119
|
+
|
120
|
+
# Calculates hash code according to all attributes.
|
121
|
+
# @return [Integer] Hash code
|
122
|
+
def hash
|
123
|
+
[target_public_key, user_id, api_key_name, expiration_seconds].hash
|
124
|
+
end
|
125
|
+
|
126
|
+
# Builds the object from hash
|
127
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
128
|
+
# @return [Object] Returns the model itself
|
129
|
+
def self.build_from_hash(attributes)
|
130
|
+
new.build_from_hash(attributes)
|
131
|
+
end
|
132
|
+
|
133
|
+
# Builds the object from hash
|
134
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
135
|
+
# @return [Object] Returns the model itself
|
136
|
+
def build_from_hash(attributes)
|
137
|
+
return nil unless attributes.is_a?(Hash)
|
138
|
+
self.class.openapi_types.each_pair do |key, type|
|
139
|
+
if type =~ /\AArray<(.*)>/i
|
140
|
+
# check to ensure the input is an array given that the attribute
|
141
|
+
# is documented as an array but the input is not
|
142
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
143
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
144
|
+
end
|
145
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
146
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
147
|
+
elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
148
|
+
self.send("#{key}=", nil)
|
149
|
+
end
|
150
|
+
end
|
151
|
+
|
152
|
+
self
|
153
|
+
end
|
154
|
+
|
155
|
+
# Deserializes the data based on type
|
156
|
+
# @param string type Data type
|
157
|
+
# @param string value Value to be deserialized
|
158
|
+
# @return [Object] Deserialized data
|
159
|
+
def _deserialize(type, value)
|
160
|
+
case type.to_sym
|
161
|
+
when :DateTime
|
162
|
+
DateTime.parse(value)
|
163
|
+
when :Date
|
164
|
+
Date.parse(value)
|
165
|
+
when :String
|
166
|
+
value.to_s
|
167
|
+
when :Integer
|
168
|
+
value.to_i
|
169
|
+
when :Float
|
170
|
+
value.to_f
|
171
|
+
when :Boolean
|
172
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
173
|
+
true
|
174
|
+
else
|
175
|
+
false
|
176
|
+
end
|
177
|
+
when :Object
|
178
|
+
# generic object (usually a Hash), return directly
|
179
|
+
value
|
180
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
181
|
+
inner_type = Regexp.last_match[:inner_type]
|
182
|
+
value.map { |v| _deserialize(inner_type, v) }
|
183
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
184
|
+
k_type = Regexp.last_match[:k_type]
|
185
|
+
v_type = Regexp.last_match[:v_type]
|
186
|
+
{}.tap do |hash|
|
187
|
+
value.each do |k, v|
|
188
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
189
|
+
end
|
190
|
+
end
|
191
|
+
else # model
|
192
|
+
TurnkeyClient.const_get(type).build_from_hash(value)
|
193
|
+
end
|
194
|
+
end
|
195
|
+
|
196
|
+
# Returns the string representation of the object
|
197
|
+
# @return [String] String presentation of the object
|
198
|
+
def to_s
|
199
|
+
to_hash.to_s
|
200
|
+
end
|
201
|
+
|
202
|
+
# to_body is an alias to to_hash (backward compatibility)
|
203
|
+
# @return [Hash] Returns the object in the form of hash
|
204
|
+
def to_body
|
205
|
+
to_hash
|
206
|
+
end
|
207
|
+
|
208
|
+
# Returns the object in the form of hash
|
209
|
+
# @return [Hash] Returns the object in the form of hash
|
210
|
+
def to_hash
|
211
|
+
hash = {}
|
212
|
+
self.class.attribute_map.each_pair do |attr, param|
|
213
|
+
value = self.send(attr)
|
214
|
+
if value.nil?
|
215
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
216
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
217
|
+
end
|
218
|
+
|
219
|
+
hash[param] = _to_hash(value)
|
220
|
+
end
|
221
|
+
hash
|
222
|
+
end
|
223
|
+
|
224
|
+
# Outputs non-array value in the form of hash
|
225
|
+
# For object, use to_hash. Otherwise, just return the value
|
226
|
+
# @param [Object] value Any valid value
|
227
|
+
# @return [Hash] Returns the value in the form of hash
|
228
|
+
def _to_hash(value)
|
229
|
+
if value.is_a?(Array)
|
230
|
+
value.compact.map { |v| _to_hash(v) }
|
231
|
+
elsif value.is_a?(Hash)
|
232
|
+
{}.tap do |hash|
|
233
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
234
|
+
end
|
235
|
+
elsif value.respond_to? :to_hash
|
236
|
+
value.to_hash
|
237
|
+
else
|
238
|
+
value
|
239
|
+
end
|
240
|
+
end end
|
241
|
+
end
|
@@ -129,7 +129,7 @@ module TurnkeyClient
|
|
129
129
|
# @return true if the model is valid
|
130
130
|
def valid?
|
131
131
|
return false if @type.nil?
|
132
|
-
type_validator = EnumAttributeValidator.new('Object', ['
|
132
|
+
type_validator = EnumAttributeValidator.new('Object', ['ACTIVITY_TYPE_CREATE_READ_WRITE_SESSION_V2'])
|
133
133
|
return false unless type_validator.valid?(@type)
|
134
134
|
return false if @timestamp_ms.nil?
|
135
135
|
return false if @organization_id.nil?
|
@@ -140,7 +140,7 @@ module TurnkeyClient
|
|
140
140
|
# Custom attribute writer method checking allowed values (enum).
|
141
141
|
# @param [Object] type Object to be assigned
|
142
142
|
def type=(type)
|
143
|
-
validator = EnumAttributeValidator.new('Object', ['
|
143
|
+
validator = EnumAttributeValidator.new('Object', ['ACTIVITY_TYPE_CREATE_READ_WRITE_SESSION_V2'])
|
144
144
|
unless validator.valid?(type)
|
145
145
|
fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
|
146
146
|
end
|