turnkey_client 0.0.14 → 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 (203) 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 +77 -0
  7. data/lib/turnkey_client/api/boot_proof_api.rb +135 -0
  8. data/lib/turnkey_client/api/broadcasting_api.rb +251 -0
  9. data/lib/turnkey_client/api/default_api.rb +77 -0
  10. data/lib/turnkey_client/api/on_ramp_api.rb +290 -0
  11. data/lib/turnkey_client/api/policies_api.rb +58 -0
  12. data/lib/turnkey_client/api/send_transactions_api.rb +77 -0
  13. data/lib/turnkey_client/api/user_auth_api.rb +290 -0
  14. data/lib/turnkey_client/api/wallets_api.rb +58 -0
  15. data/lib/turnkey_client/models/activity.rb +13 -1
  16. data/lib/turnkey_client/models/activity_type.rb +23 -0
  17. data/lib/turnkey_client/models/app_proof.rb +255 -0
  18. data/lib/turnkey_client/models/approve_activity_request.rb +14 -4
  19. data/lib/turnkey_client/models/boot_proof.rb +315 -0
  20. data/lib/turnkey_client/models/boot_proof_response.rb +210 -0
  21. data/lib/turnkey_client/models/client_signature.rb +255 -0
  22. data/lib/turnkey_client/models/client_signature_scheme.rb +26 -0
  23. data/lib/turnkey_client/models/common_v1_policy_evaluation.rb +214 -0
  24. data/lib/turnkey_client/models/create_api_keys_request.rb +14 -4
  25. data/lib/turnkey_client/models/create_authenticators_request.rb +14 -4
  26. data/lib/turnkey_client/models/create_fiat_on_ramp_credential_intent.rb +272 -0
  27. data/lib/turnkey_client/models/create_fiat_on_ramp_credential_request.rb +298 -0
  28. data/lib/turnkey_client/models/create_fiat_on_ramp_credential_result.rb +211 -0
  29. data/lib/turnkey_client/models/create_invitations_request.rb +14 -4
  30. data/lib/turnkey_client/models/create_oauth2_credential_intent.rb +240 -0
  31. data/lib/turnkey_client/models/create_oauth2_credential_request.rb +298 -0
  32. data/lib/turnkey_client/models/create_oauth2_credential_result.rb +211 -0
  33. data/lib/turnkey_client/models/create_oauth_providers_request.rb +14 -4
  34. data/lib/turnkey_client/models/create_policies_request.rb +14 -4
  35. data/lib/turnkey_client/models/create_policy_intent_v3.rb +6 -0
  36. data/lib/turnkey_client/models/create_policy_request.rb +14 -4
  37. data/lib/turnkey_client/models/create_private_key_tag_request.rb +14 -4
  38. data/lib/turnkey_client/models/create_private_keys_request.rb +14 -4
  39. data/lib/turnkey_client/models/create_read_only_session_request.rb +14 -4
  40. data/lib/turnkey_client/models/create_read_write_session_request.rb +14 -4
  41. data/lib/turnkey_client/models/create_smart_contract_interface_intent.rb +1 -1
  42. data/lib/turnkey_client/models/create_smart_contract_interface_request.rb +14 -4
  43. data/lib/turnkey_client/models/create_sub_organization_intent_v7.rb +25 -5
  44. data/lib/turnkey_client/models/create_sub_organization_request.rb +14 -4
  45. data/lib/turnkey_client/models/create_tvc_app_intent.rb +277 -0
  46. data/lib/turnkey_client/models/create_tvc_app_result.rb +258 -0
  47. data/lib/turnkey_client/models/create_tvc_deployment_intent.rb +346 -0
  48. data/lib/turnkey_client/models/create_tvc_deployment_result.rb +226 -0
  49. data/lib/turnkey_client/models/create_tvc_manifest_approvals_intent.rb +228 -0
  50. data/lib/turnkey_client/models/create_tvc_manifest_approvals_result.rb +213 -0
  51. data/lib/turnkey_client/models/create_user_tag_request.rb +14 -4
  52. data/lib/turnkey_client/models/create_users_request.rb +14 -4
  53. data/lib/turnkey_client/models/create_wallet_accounts_intent.rb +15 -4
  54. data/lib/turnkey_client/models/create_wallet_accounts_request.rb +14 -4
  55. data/lib/turnkey_client/models/create_wallet_request.rb +14 -4
  56. data/lib/turnkey_client/models/curve.rb +1 -0
  57. data/lib/turnkey_client/models/custom_revert_error.rb +218 -0
  58. data/lib/turnkey_client/models/data_v1_signature_scheme.rb +26 -0
  59. data/lib/turnkey_client/models/delete_api_keys_request.rb +14 -4
  60. data/lib/turnkey_client/models/delete_authenticators_request.rb +14 -4
  61. data/lib/turnkey_client/models/delete_fiat_on_ramp_credential_intent.rb +211 -0
  62. data/lib/turnkey_client/models/delete_fiat_on_ramp_credential_request.rb +298 -0
  63. data/lib/turnkey_client/models/delete_fiat_on_ramp_credential_result.rb +211 -0
  64. data/lib/turnkey_client/models/delete_invitation_request.rb +14 -4
  65. data/lib/turnkey_client/models/delete_oauth2_credential_intent.rb +211 -0
  66. data/lib/turnkey_client/models/delete_oauth2_credential_request.rb +298 -0
  67. data/lib/turnkey_client/models/delete_oauth2_credential_result.rb +211 -0
  68. data/lib/turnkey_client/models/delete_oauth_providers_request.rb +14 -4
  69. data/lib/turnkey_client/models/delete_policies_intent.rb +213 -0
  70. data/lib/turnkey_client/models/delete_policies_request.rb +298 -0
  71. data/lib/turnkey_client/models/delete_policies_result.rb +213 -0
  72. data/lib/turnkey_client/models/delete_policy_request.rb +14 -4
  73. data/lib/turnkey_client/models/delete_private_key_tags_request.rb +14 -4
  74. data/lib/turnkey_client/models/delete_private_keys_request.rb +14 -4
  75. data/lib/turnkey_client/models/delete_smart_contract_interface_request.rb +14 -4
  76. data/lib/turnkey_client/models/delete_sub_organization_request.rb +14 -4
  77. data/lib/turnkey_client/models/delete_user_tags_request.rb +14 -4
  78. data/lib/turnkey_client/models/delete_users_request.rb +14 -4
  79. data/lib/turnkey_client/models/delete_wallet_accounts_intent.rb +224 -0
  80. data/lib/turnkey_client/models/delete_wallet_accounts_request.rb +298 -0
  81. data/lib/turnkey_client/models/delete_wallet_accounts_result.rb +213 -0
  82. data/lib/turnkey_client/models/delete_wallets_request.rb +14 -4
  83. data/lib/turnkey_client/models/disable_auth_proxy_intent.rb +196 -0
  84. data/lib/turnkey_client/models/disable_auth_proxy_result.rb +196 -0
  85. data/lib/turnkey_client/models/email_auth_customization_params.rb +255 -0
  86. data/lib/turnkey_client/models/email_auth_intent_v3.rb +306 -0
  87. data/lib/turnkey_client/models/email_auth_request.rb +16 -6
  88. data/lib/turnkey_client/models/email_customization_params_v2.rb +240 -0
  89. data/lib/turnkey_client/models/enable_auth_proxy_intent.rb +196 -0
  90. data/lib/turnkey_client/models/enable_auth_proxy_result.rb +211 -0
  91. data/lib/turnkey_client/models/eth_send_raw_transaction_intent.rb +260 -0
  92. data/lib/turnkey_client/models/eth_send_raw_transaction_result.rb +211 -0
  93. data/lib/turnkey_client/models/eth_send_transaction_intent.rb +363 -0
  94. data/lib/turnkey_client/models/eth_send_transaction_request.rb +298 -0
  95. data/lib/turnkey_client/models/eth_send_transaction_result.rb +211 -0
  96. data/lib/turnkey_client/models/eth_send_transaction_status.rb +207 -0
  97. data/lib/turnkey_client/models/export_private_key_request.rb +14 -4
  98. data/lib/turnkey_client/models/export_wallet_account_request.rb +14 -4
  99. data/lib/turnkey_client/models/export_wallet_request.rb +14 -4
  100. data/lib/turnkey_client/models/feature_name.rb +1 -0
  101. data/lib/turnkey_client/models/fiat_on_ramp_credential.rb +330 -0
  102. data/lib/turnkey_client/models/get_app_proofs_request.rb +226 -0
  103. data/lib/turnkey_client/models/get_app_proofs_response.rb +212 -0
  104. data/lib/turnkey_client/models/get_boot_proof_request.rb +226 -0
  105. data/lib/turnkey_client/models/get_gas_usage_request.rb +211 -0
  106. data/lib/turnkey_client/models/get_gas_usage_response.rb +241 -0
  107. data/lib/turnkey_client/models/get_latest_boot_proof_request.rb +226 -0
  108. data/lib/turnkey_client/models/get_nonces_request.rb +261 -0
  109. data/lib/turnkey_client/models/get_nonces_response.rb +218 -0
  110. data/lib/turnkey_client/models/get_oauth2_credential_request.rb +226 -0
  111. data/lib/turnkey_client/models/get_oauth2_credential_response.rb +210 -0
  112. data/lib/turnkey_client/models/get_on_ramp_transaction_status_request.rb +237 -0
  113. data/lib/turnkey_client/models/get_on_ramp_transaction_status_response.rb +211 -0
  114. data/lib/turnkey_client/models/get_send_transaction_status_request.rb +226 -0
  115. data/lib/turnkey_client/models/get_send_transaction_status_response.rb +240 -0
  116. data/lib/turnkey_client/models/get_wallet_accounts_request.rb +12 -1
  117. data/lib/turnkey_client/models/import_private_key_request.rb +14 -4
  118. data/lib/turnkey_client/models/import_wallet_request.rb +14 -4
  119. data/lib/turnkey_client/models/init_fiat_on_ramp_intent.rb +16 -5
  120. data/lib/turnkey_client/models/init_fiat_on_ramp_request.rb +14 -4
  121. data/lib/turnkey_client/models/init_fiat_on_ramp_result.rb +14 -4
  122. data/lib/turnkey_client/models/init_import_private_key_request.rb +14 -4
  123. data/lib/turnkey_client/models/init_import_wallet_request.rb +14 -4
  124. data/lib/turnkey_client/models/init_otp_auth_intent_v3.rb +336 -0
  125. data/lib/turnkey_client/models/init_otp_auth_request.rb +16 -6
  126. data/lib/turnkey_client/models/init_otp_intent_v2.rb +336 -0
  127. data/lib/turnkey_client/models/init_otp_request.rb +16 -6
  128. data/lib/turnkey_client/models/init_user_email_recovery_intent.rb +37 -4
  129. data/lib/turnkey_client/models/init_user_email_recovery_intent_v2.rb +284 -0
  130. data/lib/turnkey_client/models/init_user_email_recovery_request.rb +16 -6
  131. data/lib/turnkey_client/models/intent.rb +211 -4
  132. data/lib/turnkey_client/models/list_fiat_on_ramp_credentials_request.rb +211 -0
  133. data/lib/turnkey_client/models/list_fiat_on_ramp_credentials_response.rb +212 -0
  134. data/lib/turnkey_client/models/list_oauth2_credentials_request.rb +211 -0
  135. data/lib/turnkey_client/models/list_oauth2_credentials_response.rb +212 -0
  136. data/lib/turnkey_client/models/native_revert_error.rb +229 -0
  137. data/lib/turnkey_client/models/oauth2_authenticate_intent.rb +278 -0
  138. data/lib/turnkey_client/models/oauth2_authenticate_request.rb +298 -0
  139. data/lib/turnkey_client/models/oauth2_authenticate_result.rb +211 -0
  140. data/lib/turnkey_client/models/oauth2_credential.rb +298 -0
  141. data/lib/turnkey_client/models/oauth2_provider.rb +27 -0
  142. data/lib/turnkey_client/models/oauth_login_request.rb +14 -4
  143. data/lib/turnkey_client/models/oauth_request.rb +14 -4
  144. data/lib/turnkey_client/models/otp_auth_request.rb +14 -4
  145. data/lib/turnkey_client/models/otp_login_intent.rb +14 -5
  146. data/lib/turnkey_client/models/otp_login_request.rb +14 -4
  147. data/lib/turnkey_client/models/payload_encoding.rb +1 -0
  148. data/lib/turnkey_client/models/recover_user_request.rb +14 -4
  149. data/lib/turnkey_client/models/reject_activity_request.rb +14 -4
  150. data/lib/turnkey_client/models/remove_organization_feature_request.rb +14 -4
  151. data/lib/turnkey_client/models/result.rb +175 -4
  152. data/lib/turnkey_client/models/revert_chain_entry.rb +253 -0
  153. data/lib/turnkey_client/models/set_organization_feature_request.rb +14 -4
  154. data/lib/turnkey_client/models/sign_raw_payload_request.rb +14 -4
  155. data/lib/turnkey_client/models/sign_raw_payloads_request.rb +14 -4
  156. data/lib/turnkey_client/models/sign_transaction_request.rb +14 -4
  157. data/lib/turnkey_client/models/signature_scheme.rb +26 -0
  158. data/lib/turnkey_client/models/smart_contract_interface.rb +329 -0
  159. data/lib/turnkey_client/models/sol_send_transaction_intent.rb +297 -0
  160. data/lib/turnkey_client/models/sol_send_transaction_request.rb +298 -0
  161. data/lib/turnkey_client/models/sol_send_transaction_result.rb +211 -0
  162. data/lib/turnkey_client/models/stamp_login_request.rb +14 -4
  163. data/lib/turnkey_client/models/transaction_type.rb +2 -0
  164. data/lib/turnkey_client/models/tvc_manifest_approval.rb +226 -0
  165. data/lib/turnkey_client/models/tvc_operator_params.rb +226 -0
  166. data/lib/turnkey_client/models/tvc_operator_set_params.rb +250 -0
  167. data/lib/turnkey_client/models/tx_error.rb +218 -0
  168. data/lib/turnkey_client/models/unknown_revert_error.rb +218 -0
  169. data/lib/turnkey_client/models/update_auth_proxy_config_intent.rb +368 -0
  170. data/lib/turnkey_client/models/update_auth_proxy_config_result.rb +206 -0
  171. data/lib/turnkey_client/models/update_fiat_on_ramp_credential_intent.rb +277 -0
  172. data/lib/turnkey_client/models/update_fiat_on_ramp_credential_request.rb +298 -0
  173. data/lib/turnkey_client/models/update_fiat_on_ramp_credential_result.rb +211 -0
  174. data/lib/turnkey_client/models/update_oauth2_credential_intent.rb +255 -0
  175. data/lib/turnkey_client/models/update_oauth2_credential_request.rb +298 -0
  176. data/lib/turnkey_client/models/update_oauth2_credential_result.rb +211 -0
  177. data/lib/turnkey_client/models/update_policy_request.rb +14 -4
  178. data/lib/turnkey_client/models/update_private_key_tag_request.rb +14 -4
  179. data/lib/turnkey_client/models/update_root_quorum_request.rb +14 -4
  180. data/lib/turnkey_client/models/update_user_email_request.rb +14 -4
  181. data/lib/turnkey_client/models/update_user_name_request.rb +14 -4
  182. data/lib/turnkey_client/models/update_user_phone_number_request.rb +14 -4
  183. data/lib/turnkey_client/models/update_user_request.rb +14 -4
  184. data/lib/turnkey_client/models/update_user_tag_request.rb +14 -4
  185. data/lib/turnkey_client/models/update_wallet_request.rb +14 -4
  186. data/lib/turnkey_client/models/upsert_gas_usage_config_intent.rb +241 -0
  187. data/lib/turnkey_client/models/upsert_gas_usage_config_result.rb +211 -0
  188. data/lib/turnkey_client/models/verify_otp_intent.rb +16 -5
  189. data/lib/turnkey_client/models/verify_otp_request.rb +14 -4
  190. data/lib/turnkey_client/models/wallet_account.rb +14 -5
  191. data/lib/turnkey_client/models/wallet_kit_settings_params.rb +230 -0
  192. data/lib/turnkey_client/version.rb +1 -1
  193. data/lib/turnkey_client.rb +98 -1
  194. data/turnkey_client.gemspec +1 -1
  195. metadata +128 -32
  196. data/turnkey_client-0.0.12.gem +0 -0
  197. data/turnkey_client-0.0.13.gem +0 -0
  198. data/turnkey_client-0.0.2.gem +0 -0
  199. data/turnkey_client-0.0.3.gem +0 -0
  200. data/turnkey_client-0.0.4.gem +0 -0
  201. data/turnkey_client-0.0.7.gem +0 -0
  202. data/turnkey_client-0.0.8.gem +0 -0
  203. data/turnkey_client-0.0.9.gem +0 -0
@@ -0,0 +1,196 @@
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 EnableAuthProxyIntent
15
+ # Attribute mapping from ruby-style variable name to JSON key.
16
+ def self.attribute_map
17
+ {
18
+ }
19
+ end
20
+
21
+ # Attribute type mapping.
22
+ def self.openapi_types
23
+ {
24
+ }
25
+ end
26
+
27
+ # List of attributes with nullable: true
28
+ def self.openapi_nullable
29
+ Set.new([
30
+ ])
31
+ end
32
+
33
+ # Initializes the object
34
+ # @param [Hash] attributes Model attributes in the form of hash
35
+ def initialize(attributes = {})
36
+ if (!attributes.is_a?(Hash))
37
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::EnableAuthProxyIntent` initialize method"
38
+ end
39
+
40
+ # check to see if the attribute exists and convert string to symbol for hash key
41
+ attributes = attributes.each_with_object({}) { |(k, v), h|
42
+ if (!self.class.attribute_map.key?(k.to_sym))
43
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::EnableAuthProxyIntent`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
44
+ end
45
+ h[k.to_sym] = v
46
+ }
47
+ end
48
+
49
+ # Show invalid properties with the reasons. Usually used together with valid?
50
+ # @return Array for valid properties with the reasons
51
+ def list_invalid_properties
52
+ invalid_properties = Array.new
53
+ invalid_properties
54
+ end
55
+
56
+ # Check to see if the all the properties in the model are valid
57
+ # @return true if the model is valid
58
+ def valid?
59
+ true
60
+ end
61
+
62
+ # Checks equality by comparing each attribute.
63
+ # @param [Object] Object to be compared
64
+ def ==(o)
65
+ return true if self.equal?(o)
66
+ self.class == o.class
67
+ end
68
+
69
+ # @see the `==` method
70
+ # @param [Object] Object to be compared
71
+ def eql?(o)
72
+ self == o
73
+ end
74
+
75
+ # Calculates hash code according to all attributes.
76
+ # @return [Integer] Hash code
77
+ def hash
78
+ [].hash
79
+ end
80
+
81
+ # Builds the object from hash
82
+ # @param [Hash] attributes Model attributes in the form of hash
83
+ # @return [Object] Returns the model itself
84
+ def self.build_from_hash(attributes)
85
+ new.build_from_hash(attributes)
86
+ end
87
+
88
+ # Builds the object from hash
89
+ # @param [Hash] attributes Model attributes in the form of hash
90
+ # @return [Object] Returns the model itself
91
+ def build_from_hash(attributes)
92
+ return nil unless attributes.is_a?(Hash)
93
+ self.class.openapi_types.each_pair do |key, type|
94
+ if type =~ /\AArray<(.*)>/i
95
+ # check to ensure the input is an array given that the attribute
96
+ # is documented as an array but the input is not
97
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
98
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
99
+ end
100
+ elsif !attributes[self.class.attribute_map[key]].nil?
101
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
102
+ elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
103
+ self.send("#{key}=", nil)
104
+ end
105
+ end
106
+
107
+ self
108
+ end
109
+
110
+ # Deserializes the data based on type
111
+ # @param string type Data type
112
+ # @param string value Value to be deserialized
113
+ # @return [Object] Deserialized data
114
+ def _deserialize(type, value)
115
+ case type.to_sym
116
+ when :DateTime
117
+ DateTime.parse(value)
118
+ when :Date
119
+ Date.parse(value)
120
+ when :String
121
+ value.to_s
122
+ when :Integer
123
+ value.to_i
124
+ when :Float
125
+ value.to_f
126
+ when :Boolean
127
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
128
+ true
129
+ else
130
+ false
131
+ end
132
+ when :Object
133
+ # generic object (usually a Hash), return directly
134
+ value
135
+ when /\AArray<(?<inner_type>.+)>\z/
136
+ inner_type = Regexp.last_match[:inner_type]
137
+ value.map { |v| _deserialize(inner_type, v) }
138
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
139
+ k_type = Regexp.last_match[:k_type]
140
+ v_type = Regexp.last_match[:v_type]
141
+ {}.tap do |hash|
142
+ value.each do |k, v|
143
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
144
+ end
145
+ end
146
+ else # model
147
+ TurnkeyClient.const_get(type).build_from_hash(value)
148
+ end
149
+ end
150
+
151
+ # Returns the string representation of the object
152
+ # @return [String] String presentation of the object
153
+ def to_s
154
+ to_hash.to_s
155
+ end
156
+
157
+ # to_body is an alias to to_hash (backward compatibility)
158
+ # @return [Hash] Returns the object in the form of hash
159
+ def to_body
160
+ to_hash
161
+ end
162
+
163
+ # Returns the object in the form of hash
164
+ # @return [Hash] Returns the object in the form of hash
165
+ def to_hash
166
+ hash = {}
167
+ self.class.attribute_map.each_pair do |attr, param|
168
+ value = self.send(attr)
169
+ if value.nil?
170
+ is_nullable = self.class.openapi_nullable.include?(attr)
171
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
172
+ end
173
+
174
+ hash[param] = _to_hash(value)
175
+ end
176
+ hash
177
+ end
178
+
179
+ # Outputs non-array value in the form of hash
180
+ # For object, use to_hash. Otherwise, just return the value
181
+ # @param [Object] value Any valid value
182
+ # @return [Hash] Returns the value in the form of hash
183
+ def _to_hash(value)
184
+ if value.is_a?(Array)
185
+ value.compact.map { |v| _to_hash(v) }
186
+ elsif value.is_a?(Hash)
187
+ {}.tap do |hash|
188
+ value.each { |k, v| hash[k] = _to_hash(v) }
189
+ end
190
+ elsif value.respond_to? :to_hash
191
+ value.to_hash
192
+ else
193
+ value
194
+ end
195
+ end end
196
+ end
@@ -0,0 +1,211 @@
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 EnableAuthProxyResult
15
+ # A User ID with permission to initiate authentication.
16
+ attr_accessor :user_id
17
+
18
+ # Attribute mapping from ruby-style variable name to JSON key.
19
+ def self.attribute_map
20
+ {
21
+ :'user_id' => :'userId'
22
+ }
23
+ end
24
+
25
+ # Attribute type mapping.
26
+ def self.openapi_types
27
+ {
28
+ :'user_id' => :'Object'
29
+ }
30
+ end
31
+
32
+ # List of attributes with nullable: true
33
+ def self.openapi_nullable
34
+ Set.new([
35
+ ])
36
+ end
37
+
38
+ # Initializes the object
39
+ # @param [Hash] attributes Model attributes in the form of hash
40
+ def initialize(attributes = {})
41
+ if (!attributes.is_a?(Hash))
42
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::EnableAuthProxyResult` initialize method"
43
+ end
44
+
45
+ # check to see if the attribute exists and convert string to symbol for hash key
46
+ attributes = attributes.each_with_object({}) { |(k, v), h|
47
+ if (!self.class.attribute_map.key?(k.to_sym))
48
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::EnableAuthProxyResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
49
+ end
50
+ h[k.to_sym] = v
51
+ }
52
+
53
+ if attributes.key?(:'user_id')
54
+ self.user_id = attributes[:'user_id']
55
+ end
56
+ end
57
+
58
+ # Show invalid properties with the reasons. Usually used together with valid?
59
+ # @return Array for valid properties with the reasons
60
+ def list_invalid_properties
61
+ invalid_properties = Array.new
62
+ if @user_id.nil?
63
+ invalid_properties.push('invalid value for "user_id", user_id cannot be nil.')
64
+ end
65
+
66
+ invalid_properties
67
+ end
68
+
69
+ # Check to see if the all the properties in the model are valid
70
+ # @return true if the model is valid
71
+ def valid?
72
+ return false if @user_id.nil?
73
+ true
74
+ end
75
+
76
+ # Checks equality by comparing each attribute.
77
+ # @param [Object] Object to be compared
78
+ def ==(o)
79
+ return true if self.equal?(o)
80
+ self.class == o.class &&
81
+ user_id == o.user_id
82
+ end
83
+
84
+ # @see the `==` method
85
+ # @param [Object] Object to be compared
86
+ def eql?(o)
87
+ self == o
88
+ end
89
+
90
+ # Calculates hash code according to all attributes.
91
+ # @return [Integer] Hash code
92
+ def hash
93
+ [user_id].hash
94
+ end
95
+
96
+ # Builds the object from hash
97
+ # @param [Hash] attributes Model attributes in the form of hash
98
+ # @return [Object] Returns the model itself
99
+ def self.build_from_hash(attributes)
100
+ new.build_from_hash(attributes)
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 build_from_hash(attributes)
107
+ return nil unless attributes.is_a?(Hash)
108
+ self.class.openapi_types.each_pair do |key, type|
109
+ if type =~ /\AArray<(.*)>/i
110
+ # check to ensure the input is an array given that the attribute
111
+ # is documented as an array but the input is not
112
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
113
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
114
+ end
115
+ elsif !attributes[self.class.attribute_map[key]].nil?
116
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
117
+ elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
118
+ self.send("#{key}=", nil)
119
+ end
120
+ end
121
+
122
+ self
123
+ end
124
+
125
+ # Deserializes the data based on type
126
+ # @param string type Data type
127
+ # @param string value Value to be deserialized
128
+ # @return [Object] Deserialized data
129
+ def _deserialize(type, value)
130
+ case type.to_sym
131
+ when :DateTime
132
+ DateTime.parse(value)
133
+ when :Date
134
+ Date.parse(value)
135
+ when :String
136
+ value.to_s
137
+ when :Integer
138
+ value.to_i
139
+ when :Float
140
+ value.to_f
141
+ when :Boolean
142
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
143
+ true
144
+ else
145
+ false
146
+ end
147
+ when :Object
148
+ # generic object (usually a Hash), return directly
149
+ value
150
+ when /\AArray<(?<inner_type>.+)>\z/
151
+ inner_type = Regexp.last_match[:inner_type]
152
+ value.map { |v| _deserialize(inner_type, v) }
153
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
154
+ k_type = Regexp.last_match[:k_type]
155
+ v_type = Regexp.last_match[:v_type]
156
+ {}.tap do |hash|
157
+ value.each do |k, v|
158
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
159
+ end
160
+ end
161
+ else # model
162
+ TurnkeyClient.const_get(type).build_from_hash(value)
163
+ end
164
+ end
165
+
166
+ # Returns the string representation of the object
167
+ # @return [String] String presentation of the object
168
+ def to_s
169
+ to_hash.to_s
170
+ end
171
+
172
+ # to_body is an alias to to_hash (backward compatibility)
173
+ # @return [Hash] Returns the object in the form of hash
174
+ def to_body
175
+ to_hash
176
+ end
177
+
178
+ # Returns the object in the form of hash
179
+ # @return [Hash] Returns the object in the form of hash
180
+ def to_hash
181
+ hash = {}
182
+ self.class.attribute_map.each_pair do |attr, param|
183
+ value = self.send(attr)
184
+ if value.nil?
185
+ is_nullable = self.class.openapi_nullable.include?(attr)
186
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
187
+ end
188
+
189
+ hash[param] = _to_hash(value)
190
+ end
191
+ hash
192
+ end
193
+
194
+ # Outputs non-array value in the form of hash
195
+ # For object, use to_hash. Otherwise, just return the value
196
+ # @param [Object] value Any valid value
197
+ # @return [Hash] Returns the value in the form of hash
198
+ def _to_hash(value)
199
+ if value.is_a?(Array)
200
+ value.compact.map { |v| _to_hash(v) }
201
+ elsif value.is_a?(Hash)
202
+ {}.tap do |hash|
203
+ value.each { |k, v| hash[k] = _to_hash(v) }
204
+ end
205
+ elsif value.respond_to? :to_hash
206
+ value.to_hash
207
+ else
208
+ value
209
+ end
210
+ end end
211
+ end
@@ -0,0 +1,260 @@
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 EthSendRawTransactionIntent
15
+ # The raw, signed transaction to be sent.
16
+ attr_accessor :signed_transaction
17
+
18
+ # CAIP-2 chain ID (e.g., 'eip155:1' for Ethereum mainnet).
19
+ attr_accessor :caip2
20
+
21
+ class EnumAttributeValidator
22
+ attr_reader :datatype
23
+ attr_reader :allowable_values
24
+
25
+ def initialize(datatype, allowable_values)
26
+ @allowable_values = allowable_values.map do |value|
27
+ case datatype.to_s
28
+ when /Integer/i
29
+ value.to_i
30
+ when /Float/i
31
+ value.to_f
32
+ else
33
+ value
34
+ end
35
+ end
36
+ end
37
+
38
+ def valid?(value)
39
+ !value || allowable_values.include?(value)
40
+ end
41
+ end
42
+
43
+ # Attribute mapping from ruby-style variable name to JSON key.
44
+ def self.attribute_map
45
+ {
46
+ :'signed_transaction' => :'signedTransaction',
47
+ :'caip2' => :'caip2'
48
+ }
49
+ end
50
+
51
+ # Attribute type mapping.
52
+ def self.openapi_types
53
+ {
54
+ :'signed_transaction' => :'Object',
55
+ :'caip2' => :'Object'
56
+ }
57
+ end
58
+
59
+ # List of attributes with nullable: true
60
+ def self.openapi_nullable
61
+ Set.new([
62
+ ])
63
+ end
64
+
65
+ # Initializes the object
66
+ # @param [Hash] attributes Model attributes in the form of hash
67
+ def initialize(attributes = {})
68
+ if (!attributes.is_a?(Hash))
69
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::EthSendRawTransactionIntent` initialize method"
70
+ end
71
+
72
+ # check to see if the attribute exists and convert string to symbol for hash key
73
+ attributes = attributes.each_with_object({}) { |(k, v), h|
74
+ if (!self.class.attribute_map.key?(k.to_sym))
75
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::EthSendRawTransactionIntent`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
76
+ end
77
+ h[k.to_sym] = v
78
+ }
79
+
80
+ if attributes.key?(:'signed_transaction')
81
+ self.signed_transaction = attributes[:'signed_transaction']
82
+ end
83
+
84
+ if attributes.key?(:'caip2')
85
+ self.caip2 = attributes[:'caip2']
86
+ end
87
+ end
88
+
89
+ # Show invalid properties with the reasons. Usually used together with valid?
90
+ # @return Array for valid properties with the reasons
91
+ def list_invalid_properties
92
+ invalid_properties = Array.new
93
+ if @signed_transaction.nil?
94
+ invalid_properties.push('invalid value for "signed_transaction", signed_transaction cannot be nil.')
95
+ end
96
+
97
+ if @caip2.nil?
98
+ invalid_properties.push('invalid value for "caip2", caip2 cannot be nil.')
99
+ end
100
+
101
+ invalid_properties
102
+ end
103
+
104
+ # Check to see if the all the properties in the model are valid
105
+ # @return true if the model is valid
106
+ def valid?
107
+ return false if @signed_transaction.nil?
108
+ return false if @caip2.nil?
109
+ caip2_validator = EnumAttributeValidator.new('Object', ['eip155:1', 'eip155:11155111', 'eip155:8453', 'eip155:84532'])
110
+ return false unless caip2_validator.valid?(@caip2)
111
+ true
112
+ end
113
+
114
+ # Custom attribute writer method checking allowed values (enum).
115
+ # @param [Object] caip2 Object to be assigned
116
+ def caip2=(caip2)
117
+ validator = EnumAttributeValidator.new('Object', ['eip155:1', 'eip155:11155111', 'eip155:8453', 'eip155:84532'])
118
+ unless validator.valid?(caip2)
119
+ fail ArgumentError, "invalid value for \"caip2\", must be one of #{validator.allowable_values}."
120
+ end
121
+ @caip2 = caip2
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
+ signed_transaction == o.signed_transaction &&
130
+ caip2 == o.caip2
131
+ end
132
+
133
+ # @see the `==` method
134
+ # @param [Object] Object to be compared
135
+ def eql?(o)
136
+ self == o
137
+ end
138
+
139
+ # Calculates hash code according to all attributes.
140
+ # @return [Integer] Hash code
141
+ def hash
142
+ [signed_transaction, caip2].hash
143
+ end
144
+
145
+ # Builds the object from hash
146
+ # @param [Hash] attributes Model attributes in the form of hash
147
+ # @return [Object] Returns the model itself
148
+ def self.build_from_hash(attributes)
149
+ new.build_from_hash(attributes)
150
+ end
151
+
152
+ # Builds the object from hash
153
+ # @param [Hash] attributes Model attributes in the form of hash
154
+ # @return [Object] Returns the model itself
155
+ def build_from_hash(attributes)
156
+ return nil unless attributes.is_a?(Hash)
157
+ self.class.openapi_types.each_pair do |key, type|
158
+ if type =~ /\AArray<(.*)>/i
159
+ # check to ensure the input is an array given that the attribute
160
+ # is documented as an array but the input is not
161
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
162
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
163
+ end
164
+ elsif !attributes[self.class.attribute_map[key]].nil?
165
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
166
+ elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
167
+ self.send("#{key}=", nil)
168
+ end
169
+ end
170
+
171
+ self
172
+ end
173
+
174
+ # Deserializes the data based on type
175
+ # @param string type Data type
176
+ # @param string value Value to be deserialized
177
+ # @return [Object] Deserialized data
178
+ def _deserialize(type, value)
179
+ case type.to_sym
180
+ when :DateTime
181
+ DateTime.parse(value)
182
+ when :Date
183
+ Date.parse(value)
184
+ when :String
185
+ value.to_s
186
+ when :Integer
187
+ value.to_i
188
+ when :Float
189
+ value.to_f
190
+ when :Boolean
191
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
192
+ true
193
+ else
194
+ false
195
+ end
196
+ when :Object
197
+ # generic object (usually a Hash), return directly
198
+ value
199
+ when /\AArray<(?<inner_type>.+)>\z/
200
+ inner_type = Regexp.last_match[:inner_type]
201
+ value.map { |v| _deserialize(inner_type, v) }
202
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
203
+ k_type = Regexp.last_match[:k_type]
204
+ v_type = Regexp.last_match[:v_type]
205
+ {}.tap do |hash|
206
+ value.each do |k, v|
207
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
208
+ end
209
+ end
210
+ else # model
211
+ TurnkeyClient.const_get(type).build_from_hash(value)
212
+ end
213
+ end
214
+
215
+ # Returns the string representation of the object
216
+ # @return [String] String presentation of the object
217
+ def to_s
218
+ to_hash.to_s
219
+ end
220
+
221
+ # to_body is an alias to to_hash (backward compatibility)
222
+ # @return [Hash] Returns the object in the form of hash
223
+ def to_body
224
+ to_hash
225
+ end
226
+
227
+ # Returns the object in the form of hash
228
+ # @return [Hash] Returns the object in the form of hash
229
+ def to_hash
230
+ hash = {}
231
+ self.class.attribute_map.each_pair do |attr, param|
232
+ value = self.send(attr)
233
+ if value.nil?
234
+ is_nullable = self.class.openapi_nullable.include?(attr)
235
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
236
+ end
237
+
238
+ hash[param] = _to_hash(value)
239
+ end
240
+ hash
241
+ end
242
+
243
+ # Outputs non-array value in the form of hash
244
+ # For object, use to_hash. Otherwise, just return the value
245
+ # @param [Object] value Any valid value
246
+ # @return [Hash] Returns the value in the form of hash
247
+ def _to_hash(value)
248
+ if value.is_a?(Array)
249
+ value.compact.map { |v| _to_hash(v) }
250
+ elsif value.is_a?(Hash)
251
+ {}.tap do |hash|
252
+ value.each { |k, v| hash[k] = _to_hash(v) }
253
+ end
254
+ elsif value.respond_to? :to_hash
255
+ value.to_hash
256
+ else
257
+ value
258
+ end
259
+ end end
260
+ end