turnkey_client 0.0.9 → 0.0.13

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 (42) 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 +118 -2
  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/get_wallet_account_request.rb +246 -0
  20. data/lib/turnkey_client/models/get_wallet_account_response.rb +210 -0
  21. data/lib/turnkey_client/models/get_wallet_accounts_response.rb +1 -1
  22. data/lib/turnkey_client/models/init_otp_auth_intent.rb +264 -0
  23. data/lib/turnkey_client/models/init_otp_auth_request.rb +288 -0
  24. data/lib/turnkey_client/models/init_otp_auth_result.rb +211 -0
  25. data/lib/turnkey_client/models/intent.rb +40 -4
  26. data/lib/turnkey_client/models/otp_auth_intent.rb +266 -0
  27. data/lib/turnkey_client/models/otp_auth_request.rb +288 -0
  28. data/lib/turnkey_client/models/otp_auth_result.rb +231 -0
  29. data/lib/turnkey_client/models/result.rb +40 -4
  30. data/lib/turnkey_client/models/root_user_params_v4.rb +282 -0
  31. data/lib/turnkey_client/models/sms_customization_params.rb +206 -0
  32. data/lib/turnkey_client/models/update_user_intent.rb +14 -4
  33. data/lib/turnkey_client/models/update_wallet_intent.rb +221 -0
  34. data/lib/turnkey_client/models/update_wallet_request.rb +288 -0
  35. data/lib/turnkey_client/models/update_wallet_result.rb +211 -0
  36. data/lib/turnkey_client/models/user.rb +11 -1
  37. data/lib/turnkey_client/models/wallet_account.rb +16 -1
  38. data/lib/turnkey_client/version.rb +1 -1
  39. data/lib/turnkey_client.rb +17 -0
  40. data/turnkey_client-0.0.12.gem +0 -0
  41. data/turnkey_client-0.0.9.gem +0 -0
  42. metadata +21 -2
@@ -0,0 +1,210 @@
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 GetWalletAccountResponse
15
+ attr_accessor :account
16
+
17
+ # Attribute mapping from ruby-style variable name to JSON key.
18
+ def self.attribute_map
19
+ {
20
+ :'account' => :'account'
21
+ }
22
+ end
23
+
24
+ # Attribute type mapping.
25
+ def self.openapi_types
26
+ {
27
+ :'account' => :'Object'
28
+ }
29
+ end
30
+
31
+ # List of attributes with nullable: true
32
+ def self.openapi_nullable
33
+ Set.new([
34
+ ])
35
+ end
36
+
37
+ # Initializes the object
38
+ # @param [Hash] attributes Model attributes in the form of hash
39
+ def initialize(attributes = {})
40
+ if (!attributes.is_a?(Hash))
41
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::GetWalletAccountResponse` initialize method"
42
+ end
43
+
44
+ # check to see if the attribute exists and convert string to symbol for hash key
45
+ attributes = attributes.each_with_object({}) { |(k, v), h|
46
+ if (!self.class.attribute_map.key?(k.to_sym))
47
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::GetWalletAccountResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
48
+ end
49
+ h[k.to_sym] = v
50
+ }
51
+
52
+ if attributes.key?(:'account')
53
+ self.account = attributes[:'account']
54
+ end
55
+ end
56
+
57
+ # Show invalid properties with the reasons. Usually used together with valid?
58
+ # @return Array for valid properties with the reasons
59
+ def list_invalid_properties
60
+ invalid_properties = Array.new
61
+ if @account.nil?
62
+ invalid_properties.push('invalid value for "account", account cannot be nil.')
63
+ end
64
+
65
+ invalid_properties
66
+ end
67
+
68
+ # Check to see if the all the properties in the model are valid
69
+ # @return true if the model is valid
70
+ def valid?
71
+ return false if @account.nil?
72
+ true
73
+ end
74
+
75
+ # Checks equality by comparing each attribute.
76
+ # @param [Object] Object to be compared
77
+ def ==(o)
78
+ return true if self.equal?(o)
79
+ self.class == o.class &&
80
+ account == o.account
81
+ end
82
+
83
+ # @see the `==` method
84
+ # @param [Object] Object to be compared
85
+ def eql?(o)
86
+ self == o
87
+ end
88
+
89
+ # Calculates hash code according to all attributes.
90
+ # @return [Integer] Hash code
91
+ def hash
92
+ [account].hash
93
+ end
94
+
95
+ # Builds the object from hash
96
+ # @param [Hash] attributes Model attributes in the form of hash
97
+ # @return [Object] Returns the model itself
98
+ def self.build_from_hash(attributes)
99
+ new.build_from_hash(attributes)
100
+ end
101
+
102
+ # Builds the object from hash
103
+ # @param [Hash] attributes Model attributes in the form of hash
104
+ # @return [Object] Returns the model itself
105
+ def build_from_hash(attributes)
106
+ return nil unless attributes.is_a?(Hash)
107
+ self.class.openapi_types.each_pair do |key, type|
108
+ if type =~ /\AArray<(.*)>/i
109
+ # check to ensure the input is an array given that the attribute
110
+ # is documented as an array but the input is not
111
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
112
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
113
+ end
114
+ elsif !attributes[self.class.attribute_map[key]].nil?
115
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
116
+ elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
117
+ self.send("#{key}=", nil)
118
+ end
119
+ end
120
+
121
+ self
122
+ end
123
+
124
+ # Deserializes the data based on type
125
+ # @param string type Data type
126
+ # @param string value Value to be deserialized
127
+ # @return [Object] Deserialized data
128
+ def _deserialize(type, value)
129
+ case type.to_sym
130
+ when :DateTime
131
+ DateTime.parse(value)
132
+ when :Date
133
+ Date.parse(value)
134
+ when :String
135
+ value.to_s
136
+ when :Integer
137
+ value.to_i
138
+ when :Float
139
+ value.to_f
140
+ when :Boolean
141
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
142
+ true
143
+ else
144
+ false
145
+ end
146
+ when :Object
147
+ # generic object (usually a Hash), return directly
148
+ value
149
+ when /\AArray<(?<inner_type>.+)>\z/
150
+ inner_type = Regexp.last_match[:inner_type]
151
+ value.map { |v| _deserialize(inner_type, v) }
152
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
153
+ k_type = Regexp.last_match[:k_type]
154
+ v_type = Regexp.last_match[:v_type]
155
+ {}.tap do |hash|
156
+ value.each do |k, v|
157
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
158
+ end
159
+ end
160
+ else # model
161
+ TurnkeyClient.const_get(type).build_from_hash(value)
162
+ end
163
+ end
164
+
165
+ # Returns the string representation of the object
166
+ # @return [String] String presentation of the object
167
+ def to_s
168
+ to_hash.to_s
169
+ end
170
+
171
+ # to_body is an alias to to_hash (backward compatibility)
172
+ # @return [Hash] Returns the object in the form of hash
173
+ def to_body
174
+ to_hash
175
+ end
176
+
177
+ # Returns the object in the form of hash
178
+ # @return [Hash] Returns the object in the form of hash
179
+ def to_hash
180
+ hash = {}
181
+ self.class.attribute_map.each_pair do |attr, param|
182
+ value = self.send(attr)
183
+ if value.nil?
184
+ is_nullable = self.class.openapi_nullable.include?(attr)
185
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
186
+ end
187
+
188
+ hash[param] = _to_hash(value)
189
+ end
190
+ hash
191
+ end
192
+
193
+ # Outputs non-array value in the form of hash
194
+ # For object, use to_hash. Otherwise, just return the value
195
+ # @param [Object] value Any valid value
196
+ # @return [Hash] Returns the value in the form of hash
197
+ def _to_hash(value)
198
+ if value.is_a?(Array)
199
+ value.compact.map { |v| _to_hash(v) }
200
+ elsif value.is_a?(Hash)
201
+ {}.tap do |hash|
202
+ value.each { |k, v| hash[k] = _to_hash(v) }
203
+ end
204
+ elsif value.respond_to? :to_hash
205
+ value.to_hash
206
+ else
207
+ value
208
+ end
209
+ end end
210
+ end
@@ -12,7 +12,7 @@ require 'date'
12
12
 
13
13
  module TurnkeyClient
14
14
  class GetWalletAccountsResponse
15
- # A list of Accounts generated from a Wallet that share a common seed
15
+ # A list of Accounts generated from a Wallet that share a common seed.
16
16
  attr_accessor :accounts
17
17
 
18
18
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -0,0 +1,264 @@
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 InitOtpAuthIntent
15
+ # Enum to specifiy whether to send OTP via SMS or email
16
+ attr_accessor :otp_type
17
+
18
+ # Email or phone number to send the OTP code to
19
+ attr_accessor :contact
20
+
21
+ attr_accessor :email_customization
22
+
23
+ attr_accessor :sms_customization
24
+
25
+ # Optional client-generated user identifier to enable per-user rate limiting for SMS auth. We recommend using a hash of the client-side IP address.
26
+ attr_accessor :user_identifier
27
+
28
+ # Optional custom email address from which to send the OTP email
29
+ attr_accessor :send_from_email_address
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ def self.attribute_map
33
+ {
34
+ :'otp_type' => :'otpType',
35
+ :'contact' => :'contact',
36
+ :'email_customization' => :'emailCustomization',
37
+ :'sms_customization' => :'smsCustomization',
38
+ :'user_identifier' => :'userIdentifier',
39
+ :'send_from_email_address' => :'sendFromEmailAddress'
40
+ }
41
+ end
42
+
43
+ # Attribute type mapping.
44
+ def self.openapi_types
45
+ {
46
+ :'otp_type' => :'Object',
47
+ :'contact' => :'Object',
48
+ :'email_customization' => :'Object',
49
+ :'sms_customization' => :'Object',
50
+ :'user_identifier' => :'Object',
51
+ :'send_from_email_address' => :'Object'
52
+ }
53
+ end
54
+
55
+ # List of attributes with nullable: true
56
+ def self.openapi_nullable
57
+ Set.new([
58
+ ])
59
+ end
60
+
61
+ # Initializes the object
62
+ # @param [Hash] attributes Model attributes in the form of hash
63
+ def initialize(attributes = {})
64
+ if (!attributes.is_a?(Hash))
65
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::InitOtpAuthIntent` initialize method"
66
+ end
67
+
68
+ # check to see if the attribute exists and convert string to symbol for hash key
69
+ attributes = attributes.each_with_object({}) { |(k, v), h|
70
+ if (!self.class.attribute_map.key?(k.to_sym))
71
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::InitOtpAuthIntent`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
72
+ end
73
+ h[k.to_sym] = v
74
+ }
75
+
76
+ if attributes.key?(:'otp_type')
77
+ self.otp_type = attributes[:'otp_type']
78
+ end
79
+
80
+ if attributes.key?(:'contact')
81
+ self.contact = attributes[:'contact']
82
+ end
83
+
84
+ if attributes.key?(:'email_customization')
85
+ self.email_customization = attributes[:'email_customization']
86
+ end
87
+
88
+ if attributes.key?(:'sms_customization')
89
+ self.sms_customization = attributes[:'sms_customization']
90
+ end
91
+
92
+ if attributes.key?(:'user_identifier')
93
+ self.user_identifier = attributes[:'user_identifier']
94
+ end
95
+
96
+ if attributes.key?(:'send_from_email_address')
97
+ self.send_from_email_address = attributes[:'send_from_email_address']
98
+ end
99
+ end
100
+
101
+ # Show invalid properties with the reasons. Usually used together with valid?
102
+ # @return Array for valid properties with the reasons
103
+ def list_invalid_properties
104
+ invalid_properties = Array.new
105
+ if @otp_type.nil?
106
+ invalid_properties.push('invalid value for "otp_type", otp_type cannot be nil.')
107
+ end
108
+
109
+ if @contact.nil?
110
+ invalid_properties.push('invalid value for "contact", contact cannot be nil.')
111
+ end
112
+
113
+ invalid_properties
114
+ end
115
+
116
+ # Check to see if the all the properties in the model are valid
117
+ # @return true if the model is valid
118
+ def valid?
119
+ return false if @otp_type.nil?
120
+ return false if @contact.nil?
121
+ true
122
+ end
123
+
124
+ # Checks equality by comparing each attribute.
125
+ # @param [Object] Object to be compared
126
+ def ==(o)
127
+ return true if self.equal?(o)
128
+ self.class == o.class &&
129
+ otp_type == o.otp_type &&
130
+ contact == o.contact &&
131
+ email_customization == o.email_customization &&
132
+ sms_customization == o.sms_customization &&
133
+ user_identifier == o.user_identifier &&
134
+ send_from_email_address == o.send_from_email_address
135
+ end
136
+
137
+ # @see the `==` method
138
+ # @param [Object] Object to be compared
139
+ def eql?(o)
140
+ self == o
141
+ end
142
+
143
+ # Calculates hash code according to all attributes.
144
+ # @return [Integer] Hash code
145
+ def hash
146
+ [otp_type, contact, email_customization, sms_customization, user_identifier, send_from_email_address].hash
147
+ end
148
+
149
+ # Builds the object from hash
150
+ # @param [Hash] attributes Model attributes in the form of hash
151
+ # @return [Object] Returns the model itself
152
+ def self.build_from_hash(attributes)
153
+ new.build_from_hash(attributes)
154
+ end
155
+
156
+ # Builds the object from hash
157
+ # @param [Hash] attributes Model attributes in the form of hash
158
+ # @return [Object] Returns the model itself
159
+ def build_from_hash(attributes)
160
+ return nil unless attributes.is_a?(Hash)
161
+ self.class.openapi_types.each_pair do |key, type|
162
+ if type =~ /\AArray<(.*)>/i
163
+ # check to ensure the input is an array given that the attribute
164
+ # is documented as an array but the input is not
165
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
166
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
167
+ end
168
+ elsif !attributes[self.class.attribute_map[key]].nil?
169
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
170
+ elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
171
+ self.send("#{key}=", nil)
172
+ end
173
+ end
174
+
175
+ self
176
+ end
177
+
178
+ # Deserializes the data based on type
179
+ # @param string type Data type
180
+ # @param string value Value to be deserialized
181
+ # @return [Object] Deserialized data
182
+ def _deserialize(type, value)
183
+ case type.to_sym
184
+ when :DateTime
185
+ DateTime.parse(value)
186
+ when :Date
187
+ Date.parse(value)
188
+ when :String
189
+ value.to_s
190
+ when :Integer
191
+ value.to_i
192
+ when :Float
193
+ value.to_f
194
+ when :Boolean
195
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
196
+ true
197
+ else
198
+ false
199
+ end
200
+ when :Object
201
+ # generic object (usually a Hash), return directly
202
+ value
203
+ when /\AArray<(?<inner_type>.+)>\z/
204
+ inner_type = Regexp.last_match[:inner_type]
205
+ value.map { |v| _deserialize(inner_type, v) }
206
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
207
+ k_type = Regexp.last_match[:k_type]
208
+ v_type = Regexp.last_match[:v_type]
209
+ {}.tap do |hash|
210
+ value.each do |k, v|
211
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
212
+ end
213
+ end
214
+ else # model
215
+ TurnkeyClient.const_get(type).build_from_hash(value)
216
+ end
217
+ end
218
+
219
+ # Returns the string representation of the object
220
+ # @return [String] String presentation of the object
221
+ def to_s
222
+ to_hash.to_s
223
+ end
224
+
225
+ # to_body is an alias to to_hash (backward compatibility)
226
+ # @return [Hash] Returns the object in the form of hash
227
+ def to_body
228
+ to_hash
229
+ end
230
+
231
+ # Returns the object in the form of hash
232
+ # @return [Hash] Returns the object in the form of hash
233
+ def to_hash
234
+ hash = {}
235
+ self.class.attribute_map.each_pair do |attr, param|
236
+ value = self.send(attr)
237
+ if value.nil?
238
+ is_nullable = self.class.openapi_nullable.include?(attr)
239
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
240
+ end
241
+
242
+ hash[param] = _to_hash(value)
243
+ end
244
+ hash
245
+ end
246
+
247
+ # Outputs non-array value in the form of hash
248
+ # For object, use to_hash. Otherwise, just return the value
249
+ # @param [Object] value Any valid value
250
+ # @return [Hash] Returns the value in the form of hash
251
+ def _to_hash(value)
252
+ if value.is_a?(Array)
253
+ value.compact.map { |v| _to_hash(v) }
254
+ elsif value.is_a?(Hash)
255
+ {}.tap do |hash|
256
+ value.each { |k, v| hash[k] = _to_hash(v) }
257
+ end
258
+ elsif value.respond_to? :to_hash
259
+ value.to_hash
260
+ else
261
+ value
262
+ end
263
+ end end
264
+ end