turnkey_client 0.0.9 → 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.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/lib/turnkey_client/api/features_api.rb +4 -4
  3. data/lib/turnkey_client/api/organizations_api.rb +60 -2
  4. data/lib/turnkey_client/api/user_auth_api.rb +348 -0
  5. data/lib/turnkey_client/api/users_api.rb +0 -232
  6. data/lib/turnkey_client/api/wallets_api.rb +58 -0
  7. data/lib/turnkey_client/models/activity_type.rb +4 -0
  8. data/lib/turnkey_client/models/address_format.rb +7 -0
  9. data/lib/turnkey_client/models/create_sub_organization_intent_v7.rb +292 -0
  10. data/lib/turnkey_client/models/create_sub_organization_request.rb +2 -2
  11. data/lib/turnkey_client/models/create_sub_organization_result_v7.rb +230 -0
  12. data/lib/turnkey_client/models/credential_type.rb +1 -0
  13. data/lib/turnkey_client/models/email_auth_intent.rb +14 -4
  14. data/lib/turnkey_client/models/email_auth_intent_v2.rb +14 -4
  15. data/lib/turnkey_client/models/feature_name.rb +2 -0
  16. data/lib/turnkey_client/models/get_sub_org_ids_request.rb +1 -1
  17. data/lib/turnkey_client/models/get_verified_sub_org_ids_request.rb +240 -0
  18. data/lib/turnkey_client/models/get_verified_sub_org_ids_response.rb +213 -0
  19. data/lib/turnkey_client/models/init_otp_auth_intent.rb +264 -0
  20. data/lib/turnkey_client/models/init_otp_auth_request.rb +288 -0
  21. data/lib/turnkey_client/models/init_otp_auth_result.rb +211 -0
  22. data/lib/turnkey_client/models/intent.rb +40 -4
  23. data/lib/turnkey_client/models/otp_auth_intent.rb +266 -0
  24. data/lib/turnkey_client/models/otp_auth_request.rb +288 -0
  25. data/lib/turnkey_client/models/otp_auth_result.rb +231 -0
  26. data/lib/turnkey_client/models/result.rb +40 -4
  27. data/lib/turnkey_client/models/root_user_params_v4.rb +282 -0
  28. data/lib/turnkey_client/models/sms_customization_params.rb +206 -0
  29. data/lib/turnkey_client/models/update_user_intent.rb +14 -4
  30. data/lib/turnkey_client/models/update_wallet_intent.rb +221 -0
  31. data/lib/turnkey_client/models/update_wallet_request.rb +288 -0
  32. data/lib/turnkey_client/models/update_wallet_result.rb +211 -0
  33. data/lib/turnkey_client/models/user.rb +11 -1
  34. data/lib/turnkey_client/models/wallet_account.rb +16 -1
  35. data/lib/turnkey_client/version.rb +1 -1
  36. data/lib/turnkey_client.rb +15 -0
  37. data/turnkey_client-0.0.9.gem +0 -0
  38. metadata +18 -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
@@ -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
@@ -88,6 +88,10 @@ module TurnkeyClient
88
88
  DELETE_WALLETS = 'ACTIVITY_TYPE_DELETE_WALLETS'.freeze
89
89
  CREATE_READ_WRITE_SESSION_V2 = 'ACTIVITY_TYPE_CREATE_READ_WRITE_SESSION_V2'.freeze
90
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
91
95
 
92
96
  # Builds the enum from string
93
97
  # @param [String] The enum value in the form of the string
@@ -40,6 +40,13 @@ module TurnkeyClient
40
40
  BITCOIN_REGTEST_P2_WPKH = 'ADDRESS_FORMAT_BITCOIN_REGTEST_P2WPKH'.freeze
41
41
  BITCOIN_REGTEST_P2_WSH = 'ADDRESS_FORMAT_BITCOIN_REGTEST_P2WSH'.freeze
42
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
43
50
 
44
51
  # Builds the enum from string
45
52
  # @param [String] The enum value in the form of the string
@@ -0,0 +1,292 @@
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 CreateSubOrganizationIntentV7
15
+ # Name for this sub-organization
16
+ attr_accessor :sub_organization_name
17
+
18
+ # Root users to create within this sub-organization
19
+ attr_accessor :root_users
20
+
21
+ # The threshold of unique approvals to reach root quorum. This value must be less than or equal to the number of root users
22
+ attr_accessor :root_quorum_threshold
23
+
24
+ attr_accessor :wallet
25
+
26
+ # Disable email recovery for the sub-organization
27
+ attr_accessor :disable_email_recovery
28
+
29
+ # Disable email auth for the sub-organization
30
+ attr_accessor :disable_email_auth
31
+
32
+ # Disable OTP SMS auth for the sub-organization
33
+ attr_accessor :disable_sms_auth
34
+
35
+ # Disable OTP email auth for the sub-organization
36
+ attr_accessor :disable_otp_email_auth
37
+
38
+ # Attribute mapping from ruby-style variable name to JSON key.
39
+ def self.attribute_map
40
+ {
41
+ :'sub_organization_name' => :'subOrganizationName',
42
+ :'root_users' => :'rootUsers',
43
+ :'root_quorum_threshold' => :'rootQuorumThreshold',
44
+ :'wallet' => :'wallet',
45
+ :'disable_email_recovery' => :'disableEmailRecovery',
46
+ :'disable_email_auth' => :'disableEmailAuth',
47
+ :'disable_sms_auth' => :'disableSmsAuth',
48
+ :'disable_otp_email_auth' => :'disableOtpEmailAuth'
49
+ }
50
+ end
51
+
52
+ # Attribute type mapping.
53
+ def self.openapi_types
54
+ {
55
+ :'sub_organization_name' => :'Object',
56
+ :'root_users' => :'Object',
57
+ :'root_quorum_threshold' => :'Object',
58
+ :'wallet' => :'Object',
59
+ :'disable_email_recovery' => :'Object',
60
+ :'disable_email_auth' => :'Object',
61
+ :'disable_sms_auth' => :'Object',
62
+ :'disable_otp_email_auth' => :'Object'
63
+ }
64
+ end
65
+
66
+ # List of attributes with nullable: true
67
+ def self.openapi_nullable
68
+ Set.new([
69
+ ])
70
+ end
71
+
72
+ # Initializes the object
73
+ # @param [Hash] attributes Model attributes in the form of hash
74
+ def initialize(attributes = {})
75
+ if (!attributes.is_a?(Hash))
76
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::CreateSubOrganizationIntentV7` initialize method"
77
+ end
78
+
79
+ # check to see if the attribute exists and convert string to symbol for hash key
80
+ attributes = attributes.each_with_object({}) { |(k, v), h|
81
+ if (!self.class.attribute_map.key?(k.to_sym))
82
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::CreateSubOrganizationIntentV7`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
83
+ end
84
+ h[k.to_sym] = v
85
+ }
86
+
87
+ if attributes.key?(:'sub_organization_name')
88
+ self.sub_organization_name = attributes[:'sub_organization_name']
89
+ end
90
+
91
+ if attributes.key?(:'root_users')
92
+ if (value = attributes[:'root_users']).is_a?(Array)
93
+ self.root_users = value
94
+ end
95
+ end
96
+
97
+ if attributes.key?(:'root_quorum_threshold')
98
+ self.root_quorum_threshold = attributes[:'root_quorum_threshold']
99
+ end
100
+
101
+ if attributes.key?(:'wallet')
102
+ self.wallet = attributes[:'wallet']
103
+ end
104
+
105
+ if attributes.key?(:'disable_email_recovery')
106
+ self.disable_email_recovery = attributes[:'disable_email_recovery']
107
+ end
108
+
109
+ if attributes.key?(:'disable_email_auth')
110
+ self.disable_email_auth = attributes[:'disable_email_auth']
111
+ end
112
+
113
+ if attributes.key?(:'disable_sms_auth')
114
+ self.disable_sms_auth = attributes[:'disable_sms_auth']
115
+ end
116
+
117
+ if attributes.key?(:'disable_otp_email_auth')
118
+ self.disable_otp_email_auth = attributes[:'disable_otp_email_auth']
119
+ end
120
+ end
121
+
122
+ # Show invalid properties with the reasons. Usually used together with valid?
123
+ # @return Array for valid properties with the reasons
124
+ def list_invalid_properties
125
+ invalid_properties = Array.new
126
+ if @sub_organization_name.nil?
127
+ invalid_properties.push('invalid value for "sub_organization_name", sub_organization_name cannot be nil.')
128
+ end
129
+
130
+ if @root_users.nil?
131
+ invalid_properties.push('invalid value for "root_users", root_users cannot be nil.')
132
+ end
133
+
134
+ if @root_quorum_threshold.nil?
135
+ invalid_properties.push('invalid value for "root_quorum_threshold", root_quorum_threshold cannot be nil.')
136
+ end
137
+
138
+ invalid_properties
139
+ end
140
+
141
+ # Check to see if the all the properties in the model are valid
142
+ # @return true if the model is valid
143
+ def valid?
144
+ return false if @sub_organization_name.nil?
145
+ return false if @root_users.nil?
146
+ return false if @root_quorum_threshold.nil?
147
+ true
148
+ end
149
+
150
+ # Checks equality by comparing each attribute.
151
+ # @param [Object] Object to be compared
152
+ def ==(o)
153
+ return true if self.equal?(o)
154
+ self.class == o.class &&
155
+ sub_organization_name == o.sub_organization_name &&
156
+ root_users == o.root_users &&
157
+ root_quorum_threshold == o.root_quorum_threshold &&
158
+ wallet == o.wallet &&
159
+ disable_email_recovery == o.disable_email_recovery &&
160
+ disable_email_auth == o.disable_email_auth &&
161
+ disable_sms_auth == o.disable_sms_auth &&
162
+ disable_otp_email_auth == o.disable_otp_email_auth
163
+ end
164
+
165
+ # @see the `==` method
166
+ # @param [Object] Object to be compared
167
+ def eql?(o)
168
+ self == o
169
+ end
170
+
171
+ # Calculates hash code according to all attributes.
172
+ # @return [Integer] Hash code
173
+ def hash
174
+ [sub_organization_name, root_users, root_quorum_threshold, wallet, disable_email_recovery, disable_email_auth, disable_sms_auth, disable_otp_email_auth].hash
175
+ end
176
+
177
+ # Builds the object from hash
178
+ # @param [Hash] attributes Model attributes in the form of hash
179
+ # @return [Object] Returns the model itself
180
+ def self.build_from_hash(attributes)
181
+ new.build_from_hash(attributes)
182
+ end
183
+
184
+ # Builds the object from hash
185
+ # @param [Hash] attributes Model attributes in the form of hash
186
+ # @return [Object] Returns the model itself
187
+ def build_from_hash(attributes)
188
+ return nil unless attributes.is_a?(Hash)
189
+ self.class.openapi_types.each_pair do |key, type|
190
+ if type =~ /\AArray<(.*)>/i
191
+ # check to ensure the input is an array given that the attribute
192
+ # is documented as an array but the input is not
193
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
194
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
195
+ end
196
+ elsif !attributes[self.class.attribute_map[key]].nil?
197
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
198
+ elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
199
+ self.send("#{key}=", nil)
200
+ end
201
+ end
202
+
203
+ self
204
+ end
205
+
206
+ # Deserializes the data based on type
207
+ # @param string type Data type
208
+ # @param string value Value to be deserialized
209
+ # @return [Object] Deserialized data
210
+ def _deserialize(type, value)
211
+ case type.to_sym
212
+ when :DateTime
213
+ DateTime.parse(value)
214
+ when :Date
215
+ Date.parse(value)
216
+ when :String
217
+ value.to_s
218
+ when :Integer
219
+ value.to_i
220
+ when :Float
221
+ value.to_f
222
+ when :Boolean
223
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
224
+ true
225
+ else
226
+ false
227
+ end
228
+ when :Object
229
+ # generic object (usually a Hash), return directly
230
+ value
231
+ when /\AArray<(?<inner_type>.+)>\z/
232
+ inner_type = Regexp.last_match[:inner_type]
233
+ value.map { |v| _deserialize(inner_type, v) }
234
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
235
+ k_type = Regexp.last_match[:k_type]
236
+ v_type = Regexp.last_match[:v_type]
237
+ {}.tap do |hash|
238
+ value.each do |k, v|
239
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
240
+ end
241
+ end
242
+ else # model
243
+ TurnkeyClient.const_get(type).build_from_hash(value)
244
+ end
245
+ end
246
+
247
+ # Returns the string representation of the object
248
+ # @return [String] String presentation of the object
249
+ def to_s
250
+ to_hash.to_s
251
+ end
252
+
253
+ # to_body is an alias to to_hash (backward compatibility)
254
+ # @return [Hash] Returns the object in the form of hash
255
+ def to_body
256
+ to_hash
257
+ end
258
+
259
+ # Returns the object in the form of hash
260
+ # @return [Hash] Returns the object in the form of hash
261
+ def to_hash
262
+ hash = {}
263
+ self.class.attribute_map.each_pair do |attr, param|
264
+ value = self.send(attr)
265
+ if value.nil?
266
+ is_nullable = self.class.openapi_nullable.include?(attr)
267
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
268
+ end
269
+
270
+ hash[param] = _to_hash(value)
271
+ end
272
+ hash
273
+ end
274
+
275
+ # Outputs non-array value in the form of hash
276
+ # For object, use to_hash. Otherwise, just return the value
277
+ # @param [Object] value Any valid value
278
+ # @return [Hash] Returns the value in the form of hash
279
+ def _to_hash(value)
280
+ if value.is_a?(Array)
281
+ value.compact.map { |v| _to_hash(v) }
282
+ elsif value.is_a?(Hash)
283
+ {}.tap do |hash|
284
+ value.each { |k, v| hash[k] = _to_hash(v) }
285
+ end
286
+ elsif value.respond_to? :to_hash
287
+ value.to_hash
288
+ else
289
+ value
290
+ end
291
+ end end
292
+ 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', ['ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V6'])
132
+ type_validator = EnumAttributeValidator.new('Object', ['ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V7'])
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', ['ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V6'])
143
+ validator = EnumAttributeValidator.new('Object', ['ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V7'])
144
144
  unless validator.valid?(type)
145
145
  fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
146
146
  end