turnkey_client 0.0.14 → 0.0.15

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 (57) hide show
  1. checksums.yaml +4 -4
  2. data/lib/turnkey_client/api/app_proof_api.rb +77 -0
  3. data/lib/turnkey_client/api/boot_proof_api.rb +135 -0
  4. data/lib/turnkey_client/api/default_api.rb +77 -0
  5. data/lib/turnkey_client/api/user_auth_api.rb +290 -0
  6. data/lib/turnkey_client/models/activity.rb +13 -1
  7. data/lib/turnkey_client/models/activity_type.rb +7 -0
  8. data/lib/turnkey_client/models/app_proof.rb +255 -0
  9. data/lib/turnkey_client/models/boot_proof.rb +315 -0
  10. data/lib/turnkey_client/models/boot_proof_response.rb +210 -0
  11. data/lib/turnkey_client/models/common_v1_policy_evaluation.rb +214 -0
  12. data/lib/turnkey_client/models/create_oauth2_credential_intent.rb +240 -0
  13. data/lib/turnkey_client/models/create_oauth2_credential_request.rb +288 -0
  14. data/lib/turnkey_client/models/create_oauth2_credential_result.rb +211 -0
  15. data/lib/turnkey_client/models/create_sub_organization_intent_v7.rb +16 -5
  16. data/lib/turnkey_client/models/delete_oauth2_credential_intent.rb +211 -0
  17. data/lib/turnkey_client/models/delete_oauth2_credential_request.rb +288 -0
  18. data/lib/turnkey_client/models/delete_oauth2_credential_result.rb +211 -0
  19. data/lib/turnkey_client/models/disable_auth_proxy_intent.rb +196 -0
  20. data/lib/turnkey_client/models/disable_auth_proxy_result.rb +196 -0
  21. data/lib/turnkey_client/models/enable_auth_proxy_intent.rb +196 -0
  22. data/lib/turnkey_client/models/enable_auth_proxy_result.rb +211 -0
  23. data/lib/turnkey_client/models/feature_name.rb +1 -0
  24. data/lib/turnkey_client/models/get_app_proofs_request.rb +226 -0
  25. data/lib/turnkey_client/models/get_app_proofs_response.rb +212 -0
  26. data/lib/turnkey_client/models/get_boot_proof_request.rb +226 -0
  27. data/lib/turnkey_client/models/get_latest_boot_proof_request.rb +226 -0
  28. data/lib/turnkey_client/models/get_oauth2_credential_request.rb +226 -0
  29. data/lib/turnkey_client/models/get_oauth2_credential_response.rb +210 -0
  30. data/lib/turnkey_client/models/get_wallet_accounts_request.rb +12 -1
  31. data/lib/turnkey_client/models/init_fiat_on_ramp_intent.rb +16 -5
  32. data/lib/turnkey_client/models/init_fiat_on_ramp_result.rb +14 -4
  33. data/lib/turnkey_client/models/intent.rb +67 -4
  34. data/lib/turnkey_client/models/list_oauth2_credentials_request.rb +211 -0
  35. data/lib/turnkey_client/models/list_oauth2_credentials_response.rb +212 -0
  36. data/lib/turnkey_client/models/oauth2_authenticate_intent.rb +278 -0
  37. data/lib/turnkey_client/models/oauth2_authenticate_request.rb +288 -0
  38. data/lib/turnkey_client/models/oauth2_authenticate_result.rb +211 -0
  39. data/lib/turnkey_client/models/oauth2_credential.rb +298 -0
  40. data/lib/turnkey_client/models/oauth2_provider.rb +27 -0
  41. data/lib/turnkey_client/models/otp_login_intent.rb +16 -5
  42. data/lib/turnkey_client/models/payload_encoding.rb +1 -0
  43. data/lib/turnkey_client/models/result.rb +67 -4
  44. data/lib/turnkey_client/models/signature_scheme.rb +26 -0
  45. data/lib/turnkey_client/models/smart_contract_interface.rb +329 -0
  46. data/lib/turnkey_client/models/update_auth_proxy_config_intent.rb +346 -0
  47. data/lib/turnkey_client/models/update_auth_proxy_config_result.rb +206 -0
  48. data/lib/turnkey_client/models/update_oauth2_credential_intent.rb +255 -0
  49. data/lib/turnkey_client/models/update_oauth2_credential_request.rb +288 -0
  50. data/lib/turnkey_client/models/update_oauth2_credential_result.rb +211 -0
  51. data/lib/turnkey_client/models/verify_otp_intent.rb +16 -5
  52. data/lib/turnkey_client/models/wallet_account.rb +14 -5
  53. data/lib/turnkey_client/models/wallet_kit_settings_params.rb +230 -0
  54. data/lib/turnkey_client/version.rb +1 -1
  55. data/lib/turnkey_client.rb +38 -2
  56. data/turnkey_client-0.0.14.gem +0 -0
  57. metadata +41 -2
@@ -0,0 +1,329 @@
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 SmartContractInterface
15
+ # The Organization the Smart Contract Interface belongs to.
16
+ attr_accessor :organization_id
17
+
18
+ # Unique identifier for a given Smart Contract Interface (ABI or IDL).
19
+ attr_accessor :smart_contract_interface_id
20
+
21
+ # The address corresponding to the Smart Contract or Program.
22
+ attr_accessor :smart_contract_address
23
+
24
+ # The JSON corresponding to the Smart Contract Interface (ABI or IDL).
25
+ attr_accessor :smart_contract_interface
26
+
27
+ # The type corresponding to the Smart Contract Interface (either ETHEREUM or SOLANA).
28
+ attr_accessor :type
29
+
30
+ # The label corresponding to the Smart Contract Interface (either ETHEREUM or SOLANA).
31
+ attr_accessor :label
32
+
33
+ # The notes corresponding to the Smart Contract Interface (either ETHEREUM or SOLANA).
34
+ attr_accessor :notes
35
+
36
+ attr_accessor :created_at
37
+
38
+ attr_accessor :updated_at
39
+
40
+ # Attribute mapping from ruby-style variable name to JSON key.
41
+ def self.attribute_map
42
+ {
43
+ :'organization_id' => :'organizationId',
44
+ :'smart_contract_interface_id' => :'smartContractInterfaceId',
45
+ :'smart_contract_address' => :'smartContractAddress',
46
+ :'smart_contract_interface' => :'smartContractInterface',
47
+ :'type' => :'type',
48
+ :'label' => :'label',
49
+ :'notes' => :'notes',
50
+ :'created_at' => :'createdAt',
51
+ :'updated_at' => :'updatedAt'
52
+ }
53
+ end
54
+
55
+ # Attribute type mapping.
56
+ def self.openapi_types
57
+ {
58
+ :'organization_id' => :'Object',
59
+ :'smart_contract_interface_id' => :'Object',
60
+ :'smart_contract_address' => :'Object',
61
+ :'smart_contract_interface' => :'Object',
62
+ :'type' => :'Object',
63
+ :'label' => :'Object',
64
+ :'notes' => :'Object',
65
+ :'created_at' => :'Object',
66
+ :'updated_at' => :'Object'
67
+ }
68
+ end
69
+
70
+ # List of attributes with nullable: true
71
+ def self.openapi_nullable
72
+ Set.new([
73
+ ])
74
+ end
75
+
76
+ # Initializes the object
77
+ # @param [Hash] attributes Model attributes in the form of hash
78
+ def initialize(attributes = {})
79
+ if (!attributes.is_a?(Hash))
80
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::SmartContractInterface` initialize method"
81
+ end
82
+
83
+ # check to see if the attribute exists and convert string to symbol for hash key
84
+ attributes = attributes.each_with_object({}) { |(k, v), h|
85
+ if (!self.class.attribute_map.key?(k.to_sym))
86
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::SmartContractInterface`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
87
+ end
88
+ h[k.to_sym] = v
89
+ }
90
+
91
+ if attributes.key?(:'organization_id')
92
+ self.organization_id = attributes[:'organization_id']
93
+ end
94
+
95
+ if attributes.key?(:'smart_contract_interface_id')
96
+ self.smart_contract_interface_id = attributes[:'smart_contract_interface_id']
97
+ end
98
+
99
+ if attributes.key?(:'smart_contract_address')
100
+ self.smart_contract_address = attributes[:'smart_contract_address']
101
+ end
102
+
103
+ if attributes.key?(:'smart_contract_interface')
104
+ self.smart_contract_interface = attributes[:'smart_contract_interface']
105
+ end
106
+
107
+ if attributes.key?(:'type')
108
+ self.type = attributes[:'type']
109
+ end
110
+
111
+ if attributes.key?(:'label')
112
+ self.label = attributes[:'label']
113
+ end
114
+
115
+ if attributes.key?(:'notes')
116
+ self.notes = attributes[:'notes']
117
+ end
118
+
119
+ if attributes.key?(:'created_at')
120
+ self.created_at = attributes[:'created_at']
121
+ end
122
+
123
+ if attributes.key?(:'updated_at')
124
+ self.updated_at = attributes[:'updated_at']
125
+ end
126
+ end
127
+
128
+ # Show invalid properties with the reasons. Usually used together with valid?
129
+ # @return Array for valid properties with the reasons
130
+ def list_invalid_properties
131
+ invalid_properties = Array.new
132
+ if @organization_id.nil?
133
+ invalid_properties.push('invalid value for "organization_id", organization_id cannot be nil.')
134
+ end
135
+
136
+ if @smart_contract_interface_id.nil?
137
+ invalid_properties.push('invalid value for "smart_contract_interface_id", smart_contract_interface_id cannot be nil.')
138
+ end
139
+
140
+ if @smart_contract_address.nil?
141
+ invalid_properties.push('invalid value for "smart_contract_address", smart_contract_address cannot be nil.')
142
+ end
143
+
144
+ if @smart_contract_interface.nil?
145
+ invalid_properties.push('invalid value for "smart_contract_interface", smart_contract_interface cannot be nil.')
146
+ end
147
+
148
+ if @type.nil?
149
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
150
+ end
151
+
152
+ if @label.nil?
153
+ invalid_properties.push('invalid value for "label", label cannot be nil.')
154
+ end
155
+
156
+ if @notes.nil?
157
+ invalid_properties.push('invalid value for "notes", notes cannot be nil.')
158
+ end
159
+
160
+ if @created_at.nil?
161
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
162
+ end
163
+
164
+ if @updated_at.nil?
165
+ invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
166
+ end
167
+
168
+ invalid_properties
169
+ end
170
+
171
+ # Check to see if the all the properties in the model are valid
172
+ # @return true if the model is valid
173
+ def valid?
174
+ return false if @organization_id.nil?
175
+ return false if @smart_contract_interface_id.nil?
176
+ return false if @smart_contract_address.nil?
177
+ return false if @smart_contract_interface.nil?
178
+ return false if @type.nil?
179
+ return false if @label.nil?
180
+ return false if @notes.nil?
181
+ return false if @created_at.nil?
182
+ return false if @updated_at.nil?
183
+ true
184
+ end
185
+
186
+ # Checks equality by comparing each attribute.
187
+ # @param [Object] Object to be compared
188
+ def ==(o)
189
+ return true if self.equal?(o)
190
+ self.class == o.class &&
191
+ organization_id == o.organization_id &&
192
+ smart_contract_interface_id == o.smart_contract_interface_id &&
193
+ smart_contract_address == o.smart_contract_address &&
194
+ smart_contract_interface == o.smart_contract_interface &&
195
+ type == o.type &&
196
+ label == o.label &&
197
+ notes == o.notes &&
198
+ created_at == o.created_at &&
199
+ updated_at == o.updated_at
200
+ end
201
+
202
+ # @see the `==` method
203
+ # @param [Object] Object to be compared
204
+ def eql?(o)
205
+ self == o
206
+ end
207
+
208
+ # Calculates hash code according to all attributes.
209
+ # @return [Integer] Hash code
210
+ def hash
211
+ [organization_id, smart_contract_interface_id, smart_contract_address, smart_contract_interface, type, label, notes, created_at, updated_at].hash
212
+ end
213
+
214
+ # Builds the object from hash
215
+ # @param [Hash] attributes Model attributes in the form of hash
216
+ # @return [Object] Returns the model itself
217
+ def self.build_from_hash(attributes)
218
+ new.build_from_hash(attributes)
219
+ end
220
+
221
+ # Builds the object from hash
222
+ # @param [Hash] attributes Model attributes in the form of hash
223
+ # @return [Object] Returns the model itself
224
+ def build_from_hash(attributes)
225
+ return nil unless attributes.is_a?(Hash)
226
+ self.class.openapi_types.each_pair do |key, type|
227
+ if type =~ /\AArray<(.*)>/i
228
+ # check to ensure the input is an array given that the attribute
229
+ # is documented as an array but the input is not
230
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
231
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
232
+ end
233
+ elsif !attributes[self.class.attribute_map[key]].nil?
234
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
235
+ elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
236
+ self.send("#{key}=", nil)
237
+ end
238
+ end
239
+
240
+ self
241
+ end
242
+
243
+ # Deserializes the data based on type
244
+ # @param string type Data type
245
+ # @param string value Value to be deserialized
246
+ # @return [Object] Deserialized data
247
+ def _deserialize(type, value)
248
+ case type.to_sym
249
+ when :DateTime
250
+ DateTime.parse(value)
251
+ when :Date
252
+ Date.parse(value)
253
+ when :String
254
+ value.to_s
255
+ when :Integer
256
+ value.to_i
257
+ when :Float
258
+ value.to_f
259
+ when :Boolean
260
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
261
+ true
262
+ else
263
+ false
264
+ end
265
+ when :Object
266
+ # generic object (usually a Hash), return directly
267
+ value
268
+ when /\AArray<(?<inner_type>.+)>\z/
269
+ inner_type = Regexp.last_match[:inner_type]
270
+ value.map { |v| _deserialize(inner_type, v) }
271
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
272
+ k_type = Regexp.last_match[:k_type]
273
+ v_type = Regexp.last_match[:v_type]
274
+ {}.tap do |hash|
275
+ value.each do |k, v|
276
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
277
+ end
278
+ end
279
+ else # model
280
+ TurnkeyClient.const_get(type).build_from_hash(value)
281
+ end
282
+ end
283
+
284
+ # Returns the string representation of the object
285
+ # @return [String] String presentation of the object
286
+ def to_s
287
+ to_hash.to_s
288
+ end
289
+
290
+ # to_body is an alias to to_hash (backward compatibility)
291
+ # @return [Hash] Returns the object in the form of hash
292
+ def to_body
293
+ to_hash
294
+ end
295
+
296
+ # Returns the object in the form of hash
297
+ # @return [Hash] Returns the object in the form of hash
298
+ def to_hash
299
+ hash = {}
300
+ self.class.attribute_map.each_pair do |attr, param|
301
+ value = self.send(attr)
302
+ if value.nil?
303
+ is_nullable = self.class.openapi_nullable.include?(attr)
304
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
305
+ end
306
+
307
+ hash[param] = _to_hash(value)
308
+ end
309
+ hash
310
+ end
311
+
312
+ # Outputs non-array value in the form of hash
313
+ # For object, use to_hash. Otherwise, just return the value
314
+ # @param [Object] value Any valid value
315
+ # @return [Hash] Returns the value in the form of hash
316
+ def _to_hash(value)
317
+ if value.is_a?(Array)
318
+ value.compact.map { |v| _to_hash(v) }
319
+ elsif value.is_a?(Hash)
320
+ {}.tap do |hash|
321
+ value.each { |k, v| hash[k] = _to_hash(v) }
322
+ end
323
+ elsif value.respond_to? :to_hash
324
+ value.to_hash
325
+ else
326
+ value
327
+ end
328
+ end end
329
+ end
@@ -0,0 +1,346 @@
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 UpdateAuthProxyConfigIntent
15
+ # Updated list of allowed origins for CORS.
16
+ attr_accessor :allowed_origins
17
+
18
+ # Updated list of allowed proxy authentication methods.
19
+ attr_accessor :allowed_auth_methods
20
+
21
+ # Custom 'from' address for auth-related emails.
22
+ attr_accessor :send_from_email_address
23
+
24
+ # Custom reply-to address for auth-related emails.
25
+ attr_accessor :reply_to_email_address
26
+
27
+ # Template ID for email-auth messages.
28
+ attr_accessor :email_auth_template_id
29
+
30
+ # Template ID for OTP SMS messages.
31
+ attr_accessor :otp_template_id
32
+
33
+ attr_accessor :email_customization_params
34
+
35
+ attr_accessor :sms_customization_params
36
+
37
+ attr_accessor :wallet_kit_settings
38
+
39
+ # OTP code lifetime in seconds.
40
+ attr_accessor :otp_expiration_seconds
41
+
42
+ # Verification-token lifetime in seconds.
43
+ attr_accessor :verification_token_expiration_seconds
44
+
45
+ # Session lifetime in seconds.
46
+ attr_accessor :session_expiration_seconds
47
+
48
+ # Enable alphanumeric OTP codes.
49
+ attr_accessor :otp_alphanumeric
50
+
51
+ # Desired OTP code length (6–9).
52
+ attr_accessor :otp_length
53
+
54
+ # Attribute mapping from ruby-style variable name to JSON key.
55
+ def self.attribute_map
56
+ {
57
+ :'allowed_origins' => :'allowedOrigins',
58
+ :'allowed_auth_methods' => :'allowedAuthMethods',
59
+ :'send_from_email_address' => :'sendFromEmailAddress',
60
+ :'reply_to_email_address' => :'replyToEmailAddress',
61
+ :'email_auth_template_id' => :'emailAuthTemplateId',
62
+ :'otp_template_id' => :'otpTemplateId',
63
+ :'email_customization_params' => :'emailCustomizationParams',
64
+ :'sms_customization_params' => :'smsCustomizationParams',
65
+ :'wallet_kit_settings' => :'walletKitSettings',
66
+ :'otp_expiration_seconds' => :'otpExpirationSeconds',
67
+ :'verification_token_expiration_seconds' => :'verificationTokenExpirationSeconds',
68
+ :'session_expiration_seconds' => :'sessionExpirationSeconds',
69
+ :'otp_alphanumeric' => :'otpAlphanumeric',
70
+ :'otp_length' => :'otpLength'
71
+ }
72
+ end
73
+
74
+ # Attribute type mapping.
75
+ def self.openapi_types
76
+ {
77
+ :'allowed_origins' => :'Object',
78
+ :'allowed_auth_methods' => :'Object',
79
+ :'send_from_email_address' => :'Object',
80
+ :'reply_to_email_address' => :'Object',
81
+ :'email_auth_template_id' => :'Object',
82
+ :'otp_template_id' => :'Object',
83
+ :'email_customization_params' => :'Object',
84
+ :'sms_customization_params' => :'Object',
85
+ :'wallet_kit_settings' => :'Object',
86
+ :'otp_expiration_seconds' => :'Object',
87
+ :'verification_token_expiration_seconds' => :'Object',
88
+ :'session_expiration_seconds' => :'Object',
89
+ :'otp_alphanumeric' => :'Object',
90
+ :'otp_length' => :'Object'
91
+ }
92
+ end
93
+
94
+ # List of attributes with nullable: true
95
+ def self.openapi_nullable
96
+ Set.new([
97
+ :'send_from_email_address',
98
+ :'reply_to_email_address',
99
+ :'email_auth_template_id',
100
+ :'otp_template_id',
101
+ :'otp_expiration_seconds',
102
+ :'verification_token_expiration_seconds',
103
+ :'session_expiration_seconds',
104
+ :'otp_alphanumeric',
105
+ :'otp_length'
106
+ ])
107
+ end
108
+
109
+ # Initializes the object
110
+ # @param [Hash] attributes Model attributes in the form of hash
111
+ def initialize(attributes = {})
112
+ if (!attributes.is_a?(Hash))
113
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::UpdateAuthProxyConfigIntent` initialize method"
114
+ end
115
+
116
+ # check to see if the attribute exists and convert string to symbol for hash key
117
+ attributes = attributes.each_with_object({}) { |(k, v), h|
118
+ if (!self.class.attribute_map.key?(k.to_sym))
119
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::UpdateAuthProxyConfigIntent`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
120
+ end
121
+ h[k.to_sym] = v
122
+ }
123
+
124
+ if attributes.key?(:'allowed_origins')
125
+ if (value = attributes[:'allowed_origins']).is_a?(Array)
126
+ self.allowed_origins = value
127
+ end
128
+ end
129
+
130
+ if attributes.key?(:'allowed_auth_methods')
131
+ if (value = attributes[:'allowed_auth_methods']).is_a?(Array)
132
+ self.allowed_auth_methods = value
133
+ end
134
+ end
135
+
136
+ if attributes.key?(:'send_from_email_address')
137
+ self.send_from_email_address = attributes[:'send_from_email_address']
138
+ end
139
+
140
+ if attributes.key?(:'reply_to_email_address')
141
+ self.reply_to_email_address = attributes[:'reply_to_email_address']
142
+ end
143
+
144
+ if attributes.key?(:'email_auth_template_id')
145
+ self.email_auth_template_id = attributes[:'email_auth_template_id']
146
+ end
147
+
148
+ if attributes.key?(:'otp_template_id')
149
+ self.otp_template_id = attributes[:'otp_template_id']
150
+ end
151
+
152
+ if attributes.key?(:'email_customization_params')
153
+ self.email_customization_params = attributes[:'email_customization_params']
154
+ end
155
+
156
+ if attributes.key?(:'sms_customization_params')
157
+ self.sms_customization_params = attributes[:'sms_customization_params']
158
+ end
159
+
160
+ if attributes.key?(:'wallet_kit_settings')
161
+ self.wallet_kit_settings = attributes[:'wallet_kit_settings']
162
+ end
163
+
164
+ if attributes.key?(:'otp_expiration_seconds')
165
+ self.otp_expiration_seconds = attributes[:'otp_expiration_seconds']
166
+ end
167
+
168
+ if attributes.key?(:'verification_token_expiration_seconds')
169
+ self.verification_token_expiration_seconds = attributes[:'verification_token_expiration_seconds']
170
+ end
171
+
172
+ if attributes.key?(:'session_expiration_seconds')
173
+ self.session_expiration_seconds = attributes[:'session_expiration_seconds']
174
+ end
175
+
176
+ if attributes.key?(:'otp_alphanumeric')
177
+ self.otp_alphanumeric = attributes[:'otp_alphanumeric']
178
+ end
179
+
180
+ if attributes.key?(:'otp_length')
181
+ self.otp_length = attributes[:'otp_length']
182
+ end
183
+ end
184
+
185
+ # Show invalid properties with the reasons. Usually used together with valid?
186
+ # @return Array for valid properties with the reasons
187
+ def list_invalid_properties
188
+ invalid_properties = Array.new
189
+ invalid_properties
190
+ end
191
+
192
+ # Check to see if the all the properties in the model are valid
193
+ # @return true if the model is valid
194
+ def valid?
195
+ true
196
+ end
197
+
198
+ # Checks equality by comparing each attribute.
199
+ # @param [Object] Object to be compared
200
+ def ==(o)
201
+ return true if self.equal?(o)
202
+ self.class == o.class &&
203
+ allowed_origins == o.allowed_origins &&
204
+ allowed_auth_methods == o.allowed_auth_methods &&
205
+ send_from_email_address == o.send_from_email_address &&
206
+ reply_to_email_address == o.reply_to_email_address &&
207
+ email_auth_template_id == o.email_auth_template_id &&
208
+ otp_template_id == o.otp_template_id &&
209
+ email_customization_params == o.email_customization_params &&
210
+ sms_customization_params == o.sms_customization_params &&
211
+ wallet_kit_settings == o.wallet_kit_settings &&
212
+ otp_expiration_seconds == o.otp_expiration_seconds &&
213
+ verification_token_expiration_seconds == o.verification_token_expiration_seconds &&
214
+ session_expiration_seconds == o.session_expiration_seconds &&
215
+ otp_alphanumeric == o.otp_alphanumeric &&
216
+ otp_length == o.otp_length
217
+ end
218
+
219
+ # @see the `==` method
220
+ # @param [Object] Object to be compared
221
+ def eql?(o)
222
+ self == o
223
+ end
224
+
225
+ # Calculates hash code according to all attributes.
226
+ # @return [Integer] Hash code
227
+ def hash
228
+ [allowed_origins, allowed_auth_methods, send_from_email_address, reply_to_email_address, email_auth_template_id, otp_template_id, email_customization_params, sms_customization_params, wallet_kit_settings, otp_expiration_seconds, verification_token_expiration_seconds, session_expiration_seconds, otp_alphanumeric, otp_length].hash
229
+ end
230
+
231
+ # Builds the object from hash
232
+ # @param [Hash] attributes Model attributes in the form of hash
233
+ # @return [Object] Returns the model itself
234
+ def self.build_from_hash(attributes)
235
+ new.build_from_hash(attributes)
236
+ end
237
+
238
+ # Builds the object from hash
239
+ # @param [Hash] attributes Model attributes in the form of hash
240
+ # @return [Object] Returns the model itself
241
+ def build_from_hash(attributes)
242
+ return nil unless attributes.is_a?(Hash)
243
+ self.class.openapi_types.each_pair do |key, type|
244
+ if type =~ /\AArray<(.*)>/i
245
+ # check to ensure the input is an array given that the attribute
246
+ # is documented as an array but the input is not
247
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
248
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
249
+ end
250
+ elsif !attributes[self.class.attribute_map[key]].nil?
251
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
252
+ elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
253
+ self.send("#{key}=", nil)
254
+ end
255
+ end
256
+
257
+ self
258
+ end
259
+
260
+ # Deserializes the data based on type
261
+ # @param string type Data type
262
+ # @param string value Value to be deserialized
263
+ # @return [Object] Deserialized data
264
+ def _deserialize(type, value)
265
+ case type.to_sym
266
+ when :DateTime
267
+ DateTime.parse(value)
268
+ when :Date
269
+ Date.parse(value)
270
+ when :String
271
+ value.to_s
272
+ when :Integer
273
+ value.to_i
274
+ when :Float
275
+ value.to_f
276
+ when :Boolean
277
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
278
+ true
279
+ else
280
+ false
281
+ end
282
+ when :Object
283
+ # generic object (usually a Hash), return directly
284
+ value
285
+ when /\AArray<(?<inner_type>.+)>\z/
286
+ inner_type = Regexp.last_match[:inner_type]
287
+ value.map { |v| _deserialize(inner_type, v) }
288
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
289
+ k_type = Regexp.last_match[:k_type]
290
+ v_type = Regexp.last_match[:v_type]
291
+ {}.tap do |hash|
292
+ value.each do |k, v|
293
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
294
+ end
295
+ end
296
+ else # model
297
+ TurnkeyClient.const_get(type).build_from_hash(value)
298
+ end
299
+ end
300
+
301
+ # Returns the string representation of the object
302
+ # @return [String] String presentation of the object
303
+ def to_s
304
+ to_hash.to_s
305
+ end
306
+
307
+ # to_body is an alias to to_hash (backward compatibility)
308
+ # @return [Hash] Returns the object in the form of hash
309
+ def to_body
310
+ to_hash
311
+ end
312
+
313
+ # Returns the object in the form of hash
314
+ # @return [Hash] Returns the object in the form of hash
315
+ def to_hash
316
+ hash = {}
317
+ self.class.attribute_map.each_pair do |attr, param|
318
+ value = self.send(attr)
319
+ if value.nil?
320
+ is_nullable = self.class.openapi_nullable.include?(attr)
321
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
322
+ end
323
+
324
+ hash[param] = _to_hash(value)
325
+ end
326
+ hash
327
+ end
328
+
329
+ # Outputs non-array value in the form of hash
330
+ # For object, use to_hash. Otherwise, just return the value
331
+ # @param [Object] value Any valid value
332
+ # @return [Hash] Returns the value in the form of hash
333
+ def _to_hash(value)
334
+ if value.is_a?(Array)
335
+ value.compact.map { |v| _to_hash(v) }
336
+ elsif value.is_a?(Hash)
337
+ {}.tap do |hash|
338
+ value.each { |k, v| hash[k] = _to_hash(v) }
339
+ end
340
+ elsif value.respond_to? :to_hash
341
+ value.to_hash
342
+ else
343
+ value
344
+ end
345
+ end end
346
+ end