turnkey_client 0.0.15 → 0.0.17

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 (164) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +39 -0
  3. data/.rspec +2 -0
  4. data/.swagger-codegen/VERSION +1 -0
  5. data/.swagger-codegen-ignore +23 -0
  6. data/lib/turnkey_client/api/app_proof_api.rb +4 -4
  7. data/lib/turnkey_client/api/broadcasting_api.rb +251 -0
  8. data/lib/turnkey_client/api/on_ramp_api.rb +290 -0
  9. data/lib/turnkey_client/api/policies_api.rb +58 -0
  10. data/lib/turnkey_client/api/send_transactions_api.rb +77 -0
  11. data/lib/turnkey_client/api/wallets_api.rb +58 -0
  12. data/lib/turnkey_client/models/activity.rb +1 -1
  13. data/lib/turnkey_client/models/activity_type.rb +16 -0
  14. data/lib/turnkey_client/models/approve_activity_request.rb +14 -4
  15. data/lib/turnkey_client/models/client_signature.rb +255 -0
  16. data/lib/turnkey_client/models/client_signature_scheme.rb +26 -0
  17. data/lib/turnkey_client/models/create_api_keys_request.rb +14 -4
  18. data/lib/turnkey_client/models/create_authenticators_request.rb +14 -4
  19. data/lib/turnkey_client/models/create_fiat_on_ramp_credential_intent.rb +272 -0
  20. data/lib/turnkey_client/models/create_fiat_on_ramp_credential_request.rb +298 -0
  21. data/lib/turnkey_client/models/create_fiat_on_ramp_credential_result.rb +211 -0
  22. data/lib/turnkey_client/models/create_invitations_request.rb +14 -4
  23. data/lib/turnkey_client/models/create_oauth2_credential_request.rb +14 -4
  24. data/lib/turnkey_client/models/create_oauth_providers_request.rb +14 -4
  25. data/lib/turnkey_client/models/create_policies_request.rb +14 -4
  26. data/lib/turnkey_client/models/create_policy_intent_v3.rb +6 -0
  27. data/lib/turnkey_client/models/create_policy_request.rb +14 -4
  28. data/lib/turnkey_client/models/create_private_key_tag_request.rb +14 -4
  29. data/lib/turnkey_client/models/create_private_keys_request.rb +14 -4
  30. data/lib/turnkey_client/models/create_read_only_session_request.rb +14 -4
  31. data/lib/turnkey_client/models/create_read_write_session_request.rb +14 -4
  32. data/lib/turnkey_client/models/create_smart_contract_interface_intent.rb +1 -1
  33. data/lib/turnkey_client/models/create_smart_contract_interface_request.rb +14 -4
  34. data/lib/turnkey_client/models/create_sub_organization_intent_v7.rb +14 -5
  35. data/lib/turnkey_client/models/create_sub_organization_request.rb +14 -4
  36. data/lib/turnkey_client/models/create_tvc_app_intent.rb +277 -0
  37. data/lib/turnkey_client/models/create_tvc_app_result.rb +258 -0
  38. data/lib/turnkey_client/models/create_tvc_deployment_intent.rb +346 -0
  39. data/lib/turnkey_client/models/create_tvc_deployment_result.rb +226 -0
  40. data/lib/turnkey_client/models/create_tvc_manifest_approvals_intent.rb +228 -0
  41. data/lib/turnkey_client/models/create_tvc_manifest_approvals_result.rb +213 -0
  42. data/lib/turnkey_client/models/create_user_tag_request.rb +14 -4
  43. data/lib/turnkey_client/models/create_users_request.rb +14 -4
  44. data/lib/turnkey_client/models/create_wallet_accounts_intent.rb +15 -4
  45. data/lib/turnkey_client/models/create_wallet_accounts_request.rb +14 -4
  46. data/lib/turnkey_client/models/create_wallet_request.rb +14 -4
  47. data/lib/turnkey_client/models/curve.rb +1 -0
  48. data/lib/turnkey_client/models/custom_revert_error.rb +218 -0
  49. data/lib/turnkey_client/models/data_v1_signature_scheme.rb +26 -0
  50. data/lib/turnkey_client/models/delete_api_keys_request.rb +14 -4
  51. data/lib/turnkey_client/models/delete_authenticators_request.rb +14 -4
  52. data/lib/turnkey_client/models/delete_fiat_on_ramp_credential_intent.rb +211 -0
  53. data/lib/turnkey_client/models/delete_fiat_on_ramp_credential_request.rb +298 -0
  54. data/lib/turnkey_client/models/delete_fiat_on_ramp_credential_result.rb +211 -0
  55. data/lib/turnkey_client/models/delete_invitation_request.rb +14 -4
  56. data/lib/turnkey_client/models/delete_oauth2_credential_request.rb +14 -4
  57. data/lib/turnkey_client/models/delete_oauth_providers_request.rb +14 -4
  58. data/lib/turnkey_client/models/delete_policies_intent.rb +213 -0
  59. data/lib/turnkey_client/models/delete_policies_request.rb +298 -0
  60. data/lib/turnkey_client/models/delete_policies_result.rb +213 -0
  61. data/lib/turnkey_client/models/delete_policy_request.rb +14 -4
  62. data/lib/turnkey_client/models/delete_private_key_tags_request.rb +14 -4
  63. data/lib/turnkey_client/models/delete_private_keys_request.rb +14 -4
  64. data/lib/turnkey_client/models/delete_smart_contract_interface_request.rb +14 -4
  65. data/lib/turnkey_client/models/delete_sub_organization_request.rb +14 -4
  66. data/lib/turnkey_client/models/delete_user_tags_request.rb +14 -4
  67. data/lib/turnkey_client/models/delete_users_request.rb +14 -4
  68. data/lib/turnkey_client/models/delete_wallet_accounts_intent.rb +224 -0
  69. data/lib/turnkey_client/models/delete_wallet_accounts_request.rb +298 -0
  70. data/lib/turnkey_client/models/delete_wallet_accounts_result.rb +213 -0
  71. data/lib/turnkey_client/models/delete_wallets_request.rb +14 -4
  72. data/lib/turnkey_client/models/email_auth_customization_params.rb +255 -0
  73. data/lib/turnkey_client/models/email_auth_intent_v3.rb +306 -0
  74. data/lib/turnkey_client/models/email_auth_request.rb +16 -6
  75. data/lib/turnkey_client/models/email_customization_params_v2.rb +240 -0
  76. data/lib/turnkey_client/models/eth_send_raw_transaction_intent.rb +260 -0
  77. data/lib/turnkey_client/models/eth_send_raw_transaction_result.rb +211 -0
  78. data/lib/turnkey_client/models/eth_send_transaction_intent.rb +363 -0
  79. data/lib/turnkey_client/models/eth_send_transaction_request.rb +298 -0
  80. data/lib/turnkey_client/models/eth_send_transaction_result.rb +211 -0
  81. data/lib/turnkey_client/models/eth_send_transaction_status.rb +207 -0
  82. data/lib/turnkey_client/models/export_private_key_request.rb +14 -4
  83. data/lib/turnkey_client/models/export_wallet_account_request.rb +14 -4
  84. data/lib/turnkey_client/models/export_wallet_request.rb +14 -4
  85. data/lib/turnkey_client/models/fiat_on_ramp_credential.rb +330 -0
  86. data/lib/turnkey_client/models/get_gas_usage_request.rb +211 -0
  87. data/lib/turnkey_client/models/get_gas_usage_response.rb +241 -0
  88. data/lib/turnkey_client/models/get_nonces_request.rb +261 -0
  89. data/lib/turnkey_client/models/get_nonces_response.rb +218 -0
  90. data/lib/turnkey_client/models/get_on_ramp_transaction_status_request.rb +237 -0
  91. data/lib/turnkey_client/models/get_on_ramp_transaction_status_response.rb +211 -0
  92. data/lib/turnkey_client/models/get_send_transaction_status_request.rb +226 -0
  93. data/lib/turnkey_client/models/get_send_transaction_status_response.rb +240 -0
  94. data/lib/turnkey_client/models/import_private_key_request.rb +14 -4
  95. data/lib/turnkey_client/models/import_wallet_request.rb +14 -4
  96. data/lib/turnkey_client/models/init_fiat_on_ramp_request.rb +14 -4
  97. data/lib/turnkey_client/models/init_import_private_key_request.rb +14 -4
  98. data/lib/turnkey_client/models/init_import_wallet_request.rb +14 -4
  99. data/lib/turnkey_client/models/init_otp_auth_intent_v3.rb +336 -0
  100. data/lib/turnkey_client/models/init_otp_auth_request.rb +16 -6
  101. data/lib/turnkey_client/models/init_otp_intent_v2.rb +336 -0
  102. data/lib/turnkey_client/models/init_otp_request.rb +16 -6
  103. data/lib/turnkey_client/models/init_user_email_recovery_intent.rb +37 -4
  104. data/lib/turnkey_client/models/init_user_email_recovery_intent_v2.rb +284 -0
  105. data/lib/turnkey_client/models/init_user_email_recovery_request.rb +16 -6
  106. data/lib/turnkey_client/models/intent.rb +148 -4
  107. data/lib/turnkey_client/models/list_fiat_on_ramp_credentials_request.rb +211 -0
  108. data/lib/turnkey_client/models/list_fiat_on_ramp_credentials_response.rb +212 -0
  109. data/lib/turnkey_client/models/native_revert_error.rb +229 -0
  110. data/lib/turnkey_client/models/oauth2_authenticate_request.rb +14 -4
  111. data/lib/turnkey_client/models/oauth_login_request.rb +14 -4
  112. data/lib/turnkey_client/models/oauth_request.rb +14 -4
  113. data/lib/turnkey_client/models/otp_auth_request.rb +14 -4
  114. data/lib/turnkey_client/models/otp_login_intent.rb +0 -2
  115. data/lib/turnkey_client/models/otp_login_request.rb +14 -4
  116. data/lib/turnkey_client/models/recover_user_request.rb +14 -4
  117. data/lib/turnkey_client/models/reject_activity_request.rb +14 -4
  118. data/lib/turnkey_client/models/remove_organization_feature_request.rb +14 -4
  119. data/lib/turnkey_client/models/result.rb +112 -4
  120. data/lib/turnkey_client/models/revert_chain_entry.rb +253 -0
  121. data/lib/turnkey_client/models/set_organization_feature_request.rb +14 -4
  122. data/lib/turnkey_client/models/sign_raw_payload_request.rb +14 -4
  123. data/lib/turnkey_client/models/sign_raw_payloads_request.rb +14 -4
  124. data/lib/turnkey_client/models/sign_transaction_request.rb +14 -4
  125. data/lib/turnkey_client/models/sol_send_transaction_intent.rb +297 -0
  126. data/lib/turnkey_client/models/sol_send_transaction_request.rb +298 -0
  127. data/lib/turnkey_client/models/sol_send_transaction_result.rb +211 -0
  128. data/lib/turnkey_client/models/stamp_login_request.rb +14 -4
  129. data/lib/turnkey_client/models/transaction_type.rb +2 -0
  130. data/lib/turnkey_client/models/tvc_manifest_approval.rb +226 -0
  131. data/lib/turnkey_client/models/tvc_operator_params.rb +226 -0
  132. data/lib/turnkey_client/models/tvc_operator_set_params.rb +250 -0
  133. data/lib/turnkey_client/models/tx_error.rb +218 -0
  134. data/lib/turnkey_client/models/unknown_revert_error.rb +218 -0
  135. data/lib/turnkey_client/models/update_auth_proxy_config_intent.rb +27 -5
  136. data/lib/turnkey_client/models/update_fiat_on_ramp_credential_intent.rb +277 -0
  137. data/lib/turnkey_client/models/update_fiat_on_ramp_credential_request.rb +298 -0
  138. data/lib/turnkey_client/models/update_fiat_on_ramp_credential_result.rb +211 -0
  139. data/lib/turnkey_client/models/update_oauth2_credential_request.rb +14 -4
  140. data/lib/turnkey_client/models/update_policy_request.rb +14 -4
  141. data/lib/turnkey_client/models/update_private_key_tag_request.rb +14 -4
  142. data/lib/turnkey_client/models/update_root_quorum_request.rb +14 -4
  143. data/lib/turnkey_client/models/update_user_email_request.rb +14 -4
  144. data/lib/turnkey_client/models/update_user_name_request.rb +14 -4
  145. data/lib/turnkey_client/models/update_user_phone_number_request.rb +14 -4
  146. data/lib/turnkey_client/models/update_user_request.rb +14 -4
  147. data/lib/turnkey_client/models/update_user_tag_request.rb +14 -4
  148. data/lib/turnkey_client/models/update_wallet_request.rb +14 -4
  149. data/lib/turnkey_client/models/upsert_gas_usage_config_intent.rb +241 -0
  150. data/lib/turnkey_client/models/upsert_gas_usage_config_result.rb +211 -0
  151. data/lib/turnkey_client/models/verify_otp_request.rb +14 -4
  152. data/lib/turnkey_client/version.rb +1 -1
  153. data/lib/turnkey_client.rb +63 -2
  154. data/turnkey_client.gemspec +1 -1
  155. metadata +90 -33
  156. data/turnkey_client-0.0.12.gem +0 -0
  157. data/turnkey_client-0.0.13.gem +0 -0
  158. data/turnkey_client-0.0.14.gem +0 -0
  159. data/turnkey_client-0.0.2.gem +0 -0
  160. data/turnkey_client-0.0.3.gem +0 -0
  161. data/turnkey_client-0.0.4.gem +0 -0
  162. data/turnkey_client-0.0.7.gem +0 -0
  163. data/turnkey_client-0.0.8.gem +0 -0
  164. data/turnkey_client-0.0.9.gem +0 -0
@@ -0,0 +1,218 @@
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 UnknownRevertError
15
+ # The 4-byte error selector, if available.
16
+ attr_accessor :selector
17
+
18
+ # The raw error data, hex-encoded.
19
+ attr_accessor :data
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'selector' => :'selector',
25
+ :'data' => :'data'
26
+ }
27
+ end
28
+
29
+ # Attribute type mapping.
30
+ def self.openapi_types
31
+ {
32
+ :'selector' => :'Object',
33
+ :'data' => :'Object'
34
+ }
35
+ end
36
+
37
+ # List of attributes with nullable: true
38
+ def self.openapi_nullable
39
+ Set.new([
40
+ :'selector',
41
+ :'data'
42
+ ])
43
+ end
44
+
45
+ # Initializes the object
46
+ # @param [Hash] attributes Model attributes in the form of hash
47
+ def initialize(attributes = {})
48
+ if (!attributes.is_a?(Hash))
49
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::UnknownRevertError` initialize method"
50
+ end
51
+
52
+ # check to see if the attribute exists and convert string to symbol for hash key
53
+ attributes = attributes.each_with_object({}) { |(k, v), h|
54
+ if (!self.class.attribute_map.key?(k.to_sym))
55
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::UnknownRevertError`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
56
+ end
57
+ h[k.to_sym] = v
58
+ }
59
+
60
+ if attributes.key?(:'selector')
61
+ self.selector = attributes[:'selector']
62
+ end
63
+
64
+ if attributes.key?(:'data')
65
+ self.data = attributes[:'data']
66
+ end
67
+ end
68
+
69
+ # Show invalid properties with the reasons. Usually used together with valid?
70
+ # @return Array for valid properties with the reasons
71
+ def list_invalid_properties
72
+ invalid_properties = Array.new
73
+ invalid_properties
74
+ end
75
+
76
+ # Check to see if the all the properties in the model are valid
77
+ # @return true if the model is valid
78
+ def valid?
79
+ true
80
+ end
81
+
82
+ # Checks equality by comparing each attribute.
83
+ # @param [Object] Object to be compared
84
+ def ==(o)
85
+ return true if self.equal?(o)
86
+ self.class == o.class &&
87
+ selector == o.selector &&
88
+ data == o.data
89
+ end
90
+
91
+ # @see the `==` method
92
+ # @param [Object] Object to be compared
93
+ def eql?(o)
94
+ self == o
95
+ end
96
+
97
+ # Calculates hash code according to all attributes.
98
+ # @return [Integer] Hash code
99
+ def hash
100
+ [selector, data].hash
101
+ end
102
+
103
+ # Builds the object from hash
104
+ # @param [Hash] attributes Model attributes in the form of hash
105
+ # @return [Object] Returns the model itself
106
+ def self.build_from_hash(attributes)
107
+ new.build_from_hash(attributes)
108
+ end
109
+
110
+ # Builds the object from hash
111
+ # @param [Hash] attributes Model attributes in the form of hash
112
+ # @return [Object] Returns the model itself
113
+ def build_from_hash(attributes)
114
+ return nil unless attributes.is_a?(Hash)
115
+ self.class.openapi_types.each_pair do |key, type|
116
+ if type =~ /\AArray<(.*)>/i
117
+ # check to ensure the input is an array given that the attribute
118
+ # is documented as an array but the input is not
119
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
120
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
121
+ end
122
+ elsif !attributes[self.class.attribute_map[key]].nil?
123
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
124
+ elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
125
+ self.send("#{key}=", nil)
126
+ end
127
+ end
128
+
129
+ self
130
+ end
131
+
132
+ # Deserializes the data based on type
133
+ # @param string type Data type
134
+ # @param string value Value to be deserialized
135
+ # @return [Object] Deserialized data
136
+ def _deserialize(type, value)
137
+ case type.to_sym
138
+ when :DateTime
139
+ DateTime.parse(value)
140
+ when :Date
141
+ Date.parse(value)
142
+ when :String
143
+ value.to_s
144
+ when :Integer
145
+ value.to_i
146
+ when :Float
147
+ value.to_f
148
+ when :Boolean
149
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
150
+ true
151
+ else
152
+ false
153
+ end
154
+ when :Object
155
+ # generic object (usually a Hash), return directly
156
+ value
157
+ when /\AArray<(?<inner_type>.+)>\z/
158
+ inner_type = Regexp.last_match[:inner_type]
159
+ value.map { |v| _deserialize(inner_type, v) }
160
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
161
+ k_type = Regexp.last_match[:k_type]
162
+ v_type = Regexp.last_match[:v_type]
163
+ {}.tap do |hash|
164
+ value.each do |k, v|
165
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
166
+ end
167
+ end
168
+ else # model
169
+ TurnkeyClient.const_get(type).build_from_hash(value)
170
+ end
171
+ end
172
+
173
+ # Returns the string representation of the object
174
+ # @return [String] String presentation of the object
175
+ def to_s
176
+ to_hash.to_s
177
+ end
178
+
179
+ # to_body is an alias to to_hash (backward compatibility)
180
+ # @return [Hash] Returns the object in the form of hash
181
+ def to_body
182
+ to_hash
183
+ end
184
+
185
+ # Returns the object in the form of hash
186
+ # @return [Hash] Returns the object in the form of hash
187
+ def to_hash
188
+ hash = {}
189
+ self.class.attribute_map.each_pair do |attr, param|
190
+ value = self.send(attr)
191
+ if value.nil?
192
+ is_nullable = self.class.openapi_nullable.include?(attr)
193
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
194
+ end
195
+
196
+ hash[param] = _to_hash(value)
197
+ end
198
+ hash
199
+ end
200
+
201
+ # Outputs non-array value in the form of hash
202
+ # For object, use to_hash. Otherwise, just return the value
203
+ # @param [Object] value Any valid value
204
+ # @return [Hash] Returns the value in the form of hash
205
+ def _to_hash(value)
206
+ if value.is_a?(Array)
207
+ value.compact.map { |v| _to_hash(v) }
208
+ elsif value.is_a?(Hash)
209
+ {}.tap do |hash|
210
+ value.each { |k, v| hash[k] = _to_hash(v) }
211
+ end
212
+ elsif value.respond_to? :to_hash
213
+ value.to_hash
214
+ else
215
+ value
216
+ end
217
+ end end
218
+ end
@@ -51,6 +51,12 @@ module TurnkeyClient
51
51
  # Desired OTP code length (6–9).
52
52
  attr_accessor :otp_length
53
53
 
54
+ # Custom 'from' email sender for auth-related emails.
55
+ attr_accessor :send_from_email_sender_name
56
+
57
+ # Verification token required for get account with PII (email/phone number). Default false.
58
+ attr_accessor :verification_token_required_for_get_account_pii
59
+
54
60
  # Attribute mapping from ruby-style variable name to JSON key.
55
61
  def self.attribute_map
56
62
  {
@@ -67,7 +73,9 @@ module TurnkeyClient
67
73
  :'verification_token_expiration_seconds' => :'verificationTokenExpirationSeconds',
68
74
  :'session_expiration_seconds' => :'sessionExpirationSeconds',
69
75
  :'otp_alphanumeric' => :'otpAlphanumeric',
70
- :'otp_length' => :'otpLength'
76
+ :'otp_length' => :'otpLength',
77
+ :'send_from_email_sender_name' => :'sendFromEmailSenderName',
78
+ :'verification_token_required_for_get_account_pii' => :'verificationTokenRequiredForGetAccountPii'
71
79
  }
72
80
  end
73
81
 
@@ -87,7 +95,9 @@ module TurnkeyClient
87
95
  :'verification_token_expiration_seconds' => :'Object',
88
96
  :'session_expiration_seconds' => :'Object',
89
97
  :'otp_alphanumeric' => :'Object',
90
- :'otp_length' => :'Object'
98
+ :'otp_length' => :'Object',
99
+ :'send_from_email_sender_name' => :'Object',
100
+ :'verification_token_required_for_get_account_pii' => :'Object'
91
101
  }
92
102
  end
93
103
 
@@ -102,7 +112,9 @@ module TurnkeyClient
102
112
  :'verification_token_expiration_seconds',
103
113
  :'session_expiration_seconds',
104
114
  :'otp_alphanumeric',
105
- :'otp_length'
115
+ :'otp_length',
116
+ :'send_from_email_sender_name',
117
+ :'verification_token_required_for_get_account_pii'
106
118
  ])
107
119
  end
108
120
 
@@ -180,6 +192,14 @@ module TurnkeyClient
180
192
  if attributes.key?(:'otp_length')
181
193
  self.otp_length = attributes[:'otp_length']
182
194
  end
195
+
196
+ if attributes.key?(:'send_from_email_sender_name')
197
+ self.send_from_email_sender_name = attributes[:'send_from_email_sender_name']
198
+ end
199
+
200
+ if attributes.key?(:'verification_token_required_for_get_account_pii')
201
+ self.verification_token_required_for_get_account_pii = attributes[:'verification_token_required_for_get_account_pii']
202
+ end
183
203
  end
184
204
 
185
205
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -213,7 +233,9 @@ module TurnkeyClient
213
233
  verification_token_expiration_seconds == o.verification_token_expiration_seconds &&
214
234
  session_expiration_seconds == o.session_expiration_seconds &&
215
235
  otp_alphanumeric == o.otp_alphanumeric &&
216
- otp_length == o.otp_length
236
+ otp_length == o.otp_length &&
237
+ send_from_email_sender_name == o.send_from_email_sender_name &&
238
+ verification_token_required_for_get_account_pii == o.verification_token_required_for_get_account_pii
217
239
  end
218
240
 
219
241
  # @see the `==` method
@@ -225,7 +247,7 @@ module TurnkeyClient
225
247
  # Calculates hash code according to all attributes.
226
248
  # @return [Integer] Hash code
227
249
  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
250
+ [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, send_from_email_sender_name, verification_token_required_for_get_account_pii].hash
229
251
  end
230
252
 
231
253
  # Builds the object from hash
@@ -0,0 +1,277 @@
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 UpdateFiatOnRampCredentialIntent
15
+ # The ID of the fiat on-ramp credential to update
16
+ attr_accessor :fiat_onramp_credential_id
17
+
18
+ attr_accessor :onramp_provider
19
+
20
+ # Project ID for the on-ramp provider. Some providers, like Coinbase, require this additional identifier.
21
+ attr_accessor :project_id
22
+
23
+ # Publishable API key for the on-ramp provider
24
+ attr_accessor :publishable_api_key
25
+
26
+ # Secret API key for the on-ramp provider encrypted to our on-ramp encryption public key
27
+ attr_accessor :encrypted_secret_api_key
28
+
29
+ # Private API key for the on-ramp provider encrypted to our on-ramp encryption public key. Some providers, like Coinbase, require this additional key.
30
+ attr_accessor :encrypted_private_api_key
31
+
32
+ # Attribute mapping from ruby-style variable name to JSON key.
33
+ def self.attribute_map
34
+ {
35
+ :'fiat_onramp_credential_id' => :'fiatOnrampCredentialId',
36
+ :'onramp_provider' => :'onrampProvider',
37
+ :'project_id' => :'projectId',
38
+ :'publishable_api_key' => :'publishableApiKey',
39
+ :'encrypted_secret_api_key' => :'encryptedSecretApiKey',
40
+ :'encrypted_private_api_key' => :'encryptedPrivateApiKey'
41
+ }
42
+ end
43
+
44
+ # Attribute type mapping.
45
+ def self.openapi_types
46
+ {
47
+ :'fiat_onramp_credential_id' => :'Object',
48
+ :'onramp_provider' => :'Object',
49
+ :'project_id' => :'Object',
50
+ :'publishable_api_key' => :'Object',
51
+ :'encrypted_secret_api_key' => :'Object',
52
+ :'encrypted_private_api_key' => :'Object'
53
+ }
54
+ end
55
+
56
+ # List of attributes with nullable: true
57
+ def self.openapi_nullable
58
+ Set.new([
59
+ :'project_id',
60
+ :'encrypted_private_api_key'
61
+ ])
62
+ end
63
+
64
+ # Initializes the object
65
+ # @param [Hash] attributes Model attributes in the form of hash
66
+ def initialize(attributes = {})
67
+ if (!attributes.is_a?(Hash))
68
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::UpdateFiatOnRampCredentialIntent` initialize method"
69
+ end
70
+
71
+ # check to see if the attribute exists and convert string to symbol for hash key
72
+ attributes = attributes.each_with_object({}) { |(k, v), h|
73
+ if (!self.class.attribute_map.key?(k.to_sym))
74
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::UpdateFiatOnRampCredentialIntent`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
75
+ end
76
+ h[k.to_sym] = v
77
+ }
78
+
79
+ if attributes.key?(:'fiat_onramp_credential_id')
80
+ self.fiat_onramp_credential_id = attributes[:'fiat_onramp_credential_id']
81
+ end
82
+
83
+ if attributes.key?(:'onramp_provider')
84
+ self.onramp_provider = attributes[:'onramp_provider']
85
+ end
86
+
87
+ if attributes.key?(:'project_id')
88
+ self.project_id = attributes[:'project_id']
89
+ end
90
+
91
+ if attributes.key?(:'publishable_api_key')
92
+ self.publishable_api_key = attributes[:'publishable_api_key']
93
+ end
94
+
95
+ if attributes.key?(:'encrypted_secret_api_key')
96
+ self.encrypted_secret_api_key = attributes[:'encrypted_secret_api_key']
97
+ end
98
+
99
+ if attributes.key?(:'encrypted_private_api_key')
100
+ self.encrypted_private_api_key = attributes[:'encrypted_private_api_key']
101
+ end
102
+ end
103
+
104
+ # Show invalid properties with the reasons. Usually used together with valid?
105
+ # @return Array for valid properties with the reasons
106
+ def list_invalid_properties
107
+ invalid_properties = Array.new
108
+ if @fiat_onramp_credential_id.nil?
109
+ invalid_properties.push('invalid value for "fiat_onramp_credential_id", fiat_onramp_credential_id cannot be nil.')
110
+ end
111
+
112
+ if @onramp_provider.nil?
113
+ invalid_properties.push('invalid value for "onramp_provider", onramp_provider cannot be nil.')
114
+ end
115
+
116
+ if @publishable_api_key.nil?
117
+ invalid_properties.push('invalid value for "publishable_api_key", publishable_api_key cannot be nil.')
118
+ end
119
+
120
+ if @encrypted_secret_api_key.nil?
121
+ invalid_properties.push('invalid value for "encrypted_secret_api_key", encrypted_secret_api_key cannot be nil.')
122
+ end
123
+
124
+ invalid_properties
125
+ end
126
+
127
+ # Check to see if the all the properties in the model are valid
128
+ # @return true if the model is valid
129
+ def valid?
130
+ return false if @fiat_onramp_credential_id.nil?
131
+ return false if @onramp_provider.nil?
132
+ return false if @publishable_api_key.nil?
133
+ return false if @encrypted_secret_api_key.nil?
134
+ true
135
+ end
136
+
137
+ # Checks equality by comparing each attribute.
138
+ # @param [Object] Object to be compared
139
+ def ==(o)
140
+ return true if self.equal?(o)
141
+ self.class == o.class &&
142
+ fiat_onramp_credential_id == o.fiat_onramp_credential_id &&
143
+ onramp_provider == o.onramp_provider &&
144
+ project_id == o.project_id &&
145
+ publishable_api_key == o.publishable_api_key &&
146
+ encrypted_secret_api_key == o.encrypted_secret_api_key &&
147
+ encrypted_private_api_key == o.encrypted_private_api_key
148
+ end
149
+
150
+ # @see the `==` method
151
+ # @param [Object] Object to be compared
152
+ def eql?(o)
153
+ self == o
154
+ end
155
+
156
+ # Calculates hash code according to all attributes.
157
+ # @return [Integer] Hash code
158
+ def hash
159
+ [fiat_onramp_credential_id, onramp_provider, project_id, publishable_api_key, encrypted_secret_api_key, encrypted_private_api_key].hash
160
+ end
161
+
162
+ # Builds the object from hash
163
+ # @param [Hash] attributes Model attributes in the form of hash
164
+ # @return [Object] Returns the model itself
165
+ def self.build_from_hash(attributes)
166
+ new.build_from_hash(attributes)
167
+ end
168
+
169
+ # Builds the object from hash
170
+ # @param [Hash] attributes Model attributes in the form of hash
171
+ # @return [Object] Returns the model itself
172
+ def build_from_hash(attributes)
173
+ return nil unless attributes.is_a?(Hash)
174
+ self.class.openapi_types.each_pair do |key, type|
175
+ if type =~ /\AArray<(.*)>/i
176
+ # check to ensure the input is an array given that the attribute
177
+ # is documented as an array but the input is not
178
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
179
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
180
+ end
181
+ elsif !attributes[self.class.attribute_map[key]].nil?
182
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
183
+ elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
184
+ self.send("#{key}=", nil)
185
+ end
186
+ end
187
+
188
+ self
189
+ end
190
+
191
+ # Deserializes the data based on type
192
+ # @param string type Data type
193
+ # @param string value Value to be deserialized
194
+ # @return [Object] Deserialized data
195
+ def _deserialize(type, value)
196
+ case type.to_sym
197
+ when :DateTime
198
+ DateTime.parse(value)
199
+ when :Date
200
+ Date.parse(value)
201
+ when :String
202
+ value.to_s
203
+ when :Integer
204
+ value.to_i
205
+ when :Float
206
+ value.to_f
207
+ when :Boolean
208
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
209
+ true
210
+ else
211
+ false
212
+ end
213
+ when :Object
214
+ # generic object (usually a Hash), return directly
215
+ value
216
+ when /\AArray<(?<inner_type>.+)>\z/
217
+ inner_type = Regexp.last_match[:inner_type]
218
+ value.map { |v| _deserialize(inner_type, v) }
219
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
220
+ k_type = Regexp.last_match[:k_type]
221
+ v_type = Regexp.last_match[:v_type]
222
+ {}.tap do |hash|
223
+ value.each do |k, v|
224
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
225
+ end
226
+ end
227
+ else # model
228
+ TurnkeyClient.const_get(type).build_from_hash(value)
229
+ end
230
+ end
231
+
232
+ # Returns the string representation of the object
233
+ # @return [String] String presentation of the object
234
+ def to_s
235
+ to_hash.to_s
236
+ end
237
+
238
+ # to_body is an alias to to_hash (backward compatibility)
239
+ # @return [Hash] Returns the object in the form of hash
240
+ def to_body
241
+ to_hash
242
+ end
243
+
244
+ # Returns the object in the form of hash
245
+ # @return [Hash] Returns the object in the form of hash
246
+ def to_hash
247
+ hash = {}
248
+ self.class.attribute_map.each_pair do |attr, param|
249
+ value = self.send(attr)
250
+ if value.nil?
251
+ is_nullable = self.class.openapi_nullable.include?(attr)
252
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
253
+ end
254
+
255
+ hash[param] = _to_hash(value)
256
+ end
257
+ hash
258
+ end
259
+
260
+ # Outputs non-array value in the form of hash
261
+ # For object, use to_hash. Otherwise, just return the value
262
+ # @param [Object] value Any valid value
263
+ # @return [Hash] Returns the value in the form of hash
264
+ def _to_hash(value)
265
+ if value.is_a?(Array)
266
+ value.compact.map { |v| _to_hash(v) }
267
+ elsif value.is_a?(Hash)
268
+ {}.tap do |hash|
269
+ value.each { |k, v| hash[k] = _to_hash(v) }
270
+ end
271
+ elsif value.respond_to? :to_hash
272
+ value.to_hash
273
+ else
274
+ value
275
+ end
276
+ end end
277
+ end