turnkey_client 0.0.17 → 0.0.19

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 (166) hide show
  1. checksums.yaml +4 -4
  2. data/lib/turnkey_client/api/broadcasting_api.rb +12 -12
  3. data/lib/turnkey_client/api/default_api.rb +46 -0
  4. data/lib/turnkey_client/api/ip_allowlist_api.rb +193 -0
  5. data/lib/turnkey_client/api/organizations_api.rb +290 -0
  6. data/lib/turnkey_client/api/signing_api.rb +232 -0
  7. data/lib/turnkey_client/api/tvc_api.rb +773 -0
  8. data/lib/turnkey_client/api/wallets_api.rb +116 -0
  9. data/lib/turnkey_client/configuration.rb +7 -0
  10. data/lib/turnkey_client/models/activate_billing_tier_intent.rb +14 -4
  11. data/lib/turnkey_client/models/activity_type.rb +21 -0
  12. data/lib/turnkey_client/models/address_format.rb +2 -0
  13. data/lib/turnkey_client/models/app_status.rb +243 -0
  14. data/lib/turnkey_client/models/asset_balance.rb +255 -0
  15. data/lib/turnkey_client/models/asset_balance_display.rb +216 -0
  16. data/lib/turnkey_client/models/asset_metadata.rb +246 -0
  17. data/lib/turnkey_client/models/boot_proof.rb +17 -6
  18. data/lib/turnkey_client/models/create_oauth_providers_intent_v2.rb +228 -0
  19. data/lib/turnkey_client/models/create_oauth_providers_request.rb +2 -2
  20. data/lib/turnkey_client/models/create_oauth_providers_result_v2.rb +213 -0
  21. data/lib/turnkey_client/models/create_read_write_session_intent_v2.rb +1 -1
  22. data/lib/turnkey_client/models/create_sub_organization_intent_v8.rb +316 -0
  23. data/lib/turnkey_client/models/create_sub_organization_request.rb +2 -2
  24. data/lib/turnkey_client/models/create_sub_organization_result_v8.rb +230 -0
  25. data/lib/turnkey_client/models/create_tvc_app_intent.rb +9 -9
  26. data/lib/turnkey_client/models/create_tvc_app_request.rb +288 -0
  27. data/lib/turnkey_client/models/create_tvc_deployment_intent.rb +60 -41
  28. data/lib/turnkey_client/models/create_tvc_deployment_request.rb +288 -0
  29. data/lib/turnkey_client/models/create_tvc_manifest_approvals_request.rb +288 -0
  30. data/lib/turnkey_client/models/create_users_intent_v4.rb +213 -0
  31. data/lib/turnkey_client/models/create_users_request.rb +2 -2
  32. data/lib/turnkey_client/models/create_webhook_endpoint_intent.rb +238 -0
  33. data/lib/turnkey_client/models/create_webhook_endpoint_request.rb +298 -0
  34. data/lib/turnkey_client/models/create_webhook_endpoint_result.rb +225 -0
  35. data/lib/turnkey_client/models/delete_tvc_app_and_deployments_intent.rb +211 -0
  36. data/lib/turnkey_client/models/delete_tvc_app_and_deployments_request.rb +298 -0
  37. data/lib/turnkey_client/models/delete_tvc_app_and_deployments_result.rb +211 -0
  38. data/lib/turnkey_client/models/delete_tvc_deployment_intent.rb +211 -0
  39. data/lib/turnkey_client/models/delete_tvc_deployment_request.rb +298 -0
  40. data/lib/turnkey_client/models/delete_tvc_deployment_result.rb +211 -0
  41. data/lib/turnkey_client/models/delete_webhook_endpoint_intent.rb +211 -0
  42. data/lib/turnkey_client/models/delete_webhook_endpoint_request.rb +298 -0
  43. data/lib/turnkey_client/models/delete_webhook_endpoint_result.rb +211 -0
  44. data/lib/turnkey_client/models/deployment_status.rb +255 -0
  45. data/lib/turnkey_client/models/eth_failure_details.rb +208 -0
  46. data/lib/turnkey_client/models/eth_send_raw_transaction_intent.rb +2 -2
  47. data/lib/turnkey_client/models/eth_send_transaction_intent.rb +12 -1
  48. data/lib/turnkey_client/models/feature_name.rb +1 -0
  49. data/lib/turnkey_client/models/get_app_status_request.rb +226 -0
  50. data/lib/turnkey_client/models/get_app_status_response.rb +210 -0
  51. data/lib/turnkey_client/models/get_ip_allowlist_request.rb +222 -0
  52. data/lib/turnkey_client/models/get_ip_allowlist_response.rb +210 -0
  53. data/lib/turnkey_client/models/get_nonces_request.rb +35 -1
  54. data/lib/turnkey_client/models/get_send_transaction_status_response.rb +10 -1
  55. data/lib/turnkey_client/models/get_tvc_app_deployments_request.rb +226 -0
  56. data/lib/turnkey_client/models/get_tvc_app_deployments_response.rb +213 -0
  57. data/lib/turnkey_client/models/get_tvc_app_request.rb +226 -0
  58. data/lib/turnkey_client/models/get_tvc_app_response.rb +210 -0
  59. data/lib/turnkey_client/models/get_tvc_apps_request.rb +211 -0
  60. data/lib/turnkey_client/models/get_tvc_apps_response.rb +213 -0
  61. data/lib/turnkey_client/models/get_tvc_deployment_request.rb +226 -0
  62. data/lib/turnkey_client/models/get_tvc_deployment_response.rb +210 -0
  63. data/lib/turnkey_client/models/get_wallet_address_balances_request.rb +275 -0
  64. data/lib/turnkey_client/models/get_wallet_address_balances_response.rb +208 -0
  65. data/lib/turnkey_client/models/init_otp_auth_intent.rb +1 -1
  66. data/lib/turnkey_client/models/init_otp_auth_intent_v2.rb +1 -1
  67. data/lib/turnkey_client/models/init_otp_intent_v3.rb +336 -0
  68. data/lib/turnkey_client/models/init_otp_request.rb +2 -2
  69. data/lib/turnkey_client/models/init_otp_result_v2.rb +226 -0
  70. data/lib/turnkey_client/models/intent.rb +193 -4
  71. data/lib/turnkey_client/models/ip_allowlist.rb +261 -0
  72. data/lib/turnkey_client/models/ip_allowlist_intent_rule.rb +222 -0
  73. data/lib/turnkey_client/models/ip_allowlist_rule.rb +232 -0
  74. data/lib/turnkey_client/models/list_supported_assets_request.rb +260 -0
  75. data/lib/turnkey_client/models/list_supported_assets_response.rb +208 -0
  76. data/lib/turnkey_client/models/list_webhook_endpoints_request.rb +211 -0
  77. data/lib/turnkey_client/models/list_webhook_endpoints_response.rb +212 -0
  78. data/lib/turnkey_client/models/login_usage.rb +211 -0
  79. data/lib/turnkey_client/models/noop_codegen_anchor_response.rb +219 -0
  80. data/lib/turnkey_client/models/oauth2_authenticate_intent.rb +6 -2
  81. data/lib/turnkey_client/models/oauth_provider_params_v2.rb +230 -0
  82. data/lib/turnkey_client/models/oidc_claims.rb +241 -0
  83. data/lib/turnkey_client/models/otp_login_intent_v2.rb +262 -0
  84. data/lib/turnkey_client/models/otp_login_request.rb +2 -2
  85. data/lib/turnkey_client/models/post_tvc_quorum_key_share_intent.rb +240 -0
  86. data/lib/turnkey_client/models/post_tvc_quorum_key_share_result.rb +211 -0
  87. data/lib/turnkey_client/models/quorum_key_share_approval_bundle.rb +241 -0
  88. data/lib/turnkey_client/models/remove_ip_allowlist_intent.rb +207 -0
  89. data/lib/turnkey_client/models/remove_ip_allowlist_request.rb +298 -0
  90. data/lib/turnkey_client/models/remove_ip_allowlist_result.rb +196 -0
  91. data/lib/turnkey_client/models/restore_tvc_deployment_intent.rb +211 -0
  92. data/lib/turnkey_client/models/restore_tvc_deployment_request.rb +298 -0
  93. data/lib/turnkey_client/models/restore_tvc_deployment_result.rb +211 -0
  94. data/lib/turnkey_client/models/result.rb +166 -4
  95. data/lib/turnkey_client/models/root_user_params_v5.rb +284 -0
  96. data/lib/turnkey_client/models/set_ip_allowlist_intent.rb +241 -0
  97. data/lib/turnkey_client/models/set_ip_allowlist_request.rb +298 -0
  98. data/lib/turnkey_client/models/set_ip_allowlist_result.rb +196 -0
  99. data/lib/turnkey_client/models/signup_usage.rb +249 -0
  100. data/lib/turnkey_client/models/signup_usage_v2.rb +249 -0
  101. data/lib/turnkey_client/models/sol_send_transaction_intent.rb +3 -3
  102. data/lib/turnkey_client/models/solana_config.rb +207 -0
  103. data/lib/turnkey_client/models/solana_failure_details.rb +273 -0
  104. data/lib/turnkey_client/models/solana_send_transaction_status.rb +207 -0
  105. data/lib/turnkey_client/models/spark_claim_leaf.rb +241 -0
  106. data/lib/turnkey_client/models/spark_claim_package.rb +275 -0
  107. data/lib/turnkey_client/models/spark_claim_transfer_intent.rb +225 -0
  108. data/lib/turnkey_client/models/spark_claim_transfer_request.rb +288 -0
  109. data/lib/turnkey_client/models/spark_claim_transfer_result.rb +230 -0
  110. data/lib/turnkey_client/models/spark_deposit_derivation.rb +196 -0
  111. data/lib/turnkey_client/models/spark_encrypted_operator_package.rb +226 -0
  112. data/lib/turnkey_client/models/spark_frost_commitment.rb +241 -0
  113. data/lib/turnkey_client/models/spark_htlc_preimage_derivation.rb +196 -0
  114. data/lib/turnkey_client/models/spark_identity_derivation.rb +196 -0
  115. data/lib/turnkey_client/models/spark_key_derivation.rb +241 -0
  116. data/lib/turnkey_client/models/spark_leaf_public_key.rb +226 -0
  117. data/lib/turnkey_client/models/spark_lightning_receive_package.rb +228 -0
  118. data/lib/turnkey_client/models/spark_operator_recipient.rb +226 -0
  119. data/lib/turnkey_client/models/spark_partial_signature.rb +241 -0
  120. data/lib/turnkey_client/models/spark_prepare_lightning_receive_intent.rb +225 -0
  121. data/lib/turnkey_client/models/spark_prepare_lightning_receive_request.rb +288 -0
  122. data/lib/turnkey_client/models/spark_prepare_lightning_receive_result.rb +228 -0
  123. data/lib/turnkey_client/models/spark_prepare_transfer_intent.rb +225 -0
  124. data/lib/turnkey_client/models/spark_prepare_transfer_request.rb +288 -0
  125. data/lib/turnkey_client/models/spark_prepare_transfer_result.rb +245 -0
  126. data/lib/turnkey_client/models/spark_sign_frost_intent.rb +228 -0
  127. data/lib/turnkey_client/models/spark_sign_frost_request.rb +288 -0
  128. data/lib/turnkey_client/models/spark_sign_frost_result.rb +213 -0
  129. data/lib/turnkey_client/models/spark_signature_request.rb +268 -0
  130. data/lib/turnkey_client/models/spark_signing_leaf_derivation.rb +211 -0
  131. data/lib/turnkey_client/models/spark_static_deposit_derivation.rb +211 -0
  132. data/lib/turnkey_client/models/spark_transfer_leaf.rb +272 -0
  133. data/lib/turnkey_client/models/spark_transfer_package.rb +275 -0
  134. data/lib/turnkey_client/models/token_usage.rb +252 -0
  135. data/lib/turnkey_client/models/tvc_app.rb +353 -0
  136. data/lib/turnkey_client/models/tvc_container_spec.rb +302 -0
  137. data/lib/turnkey_client/models/tvc_deployment.rb +372 -0
  138. data/lib/turnkey_client/models/tvc_health_check_type.rb +27 -0
  139. data/lib/turnkey_client/models/tvc_manifest.rb +254 -0
  140. data/lib/turnkey_client/models/tvc_operator.rb +269 -0
  141. data/lib/turnkey_client/models/tvc_operator_approval.rb +283 -0
  142. data/lib/turnkey_client/models/tvc_operator_set.rb +301 -0
  143. data/lib/turnkey_client/models/tx_error.rb +22 -4
  144. data/lib/turnkey_client/models/update_auth_proxy_config_intent.rb +17 -5
  145. data/lib/turnkey_client/models/update_organization_name_intent.rb +211 -0
  146. data/lib/turnkey_client/models/update_organization_name_request.rb +298 -0
  147. data/lib/turnkey_client/models/update_organization_name_result.rb +226 -0
  148. data/lib/turnkey_client/models/update_tvc_app_live_deployment_intent.rb +211 -0
  149. data/lib/turnkey_client/models/update_tvc_app_live_deployment_request.rb +298 -0
  150. data/lib/turnkey_client/models/update_tvc_app_live_deployment_result.rb +196 -0
  151. data/lib/turnkey_client/models/update_webhook_endpoint_intent.rb +244 -0
  152. data/lib/turnkey_client/models/update_webhook_endpoint_request.rb +298 -0
  153. data/lib/turnkey_client/models/update_webhook_endpoint_result.rb +225 -0
  154. data/lib/turnkey_client/models/upsert_gas_usage_config_intent.rb +25 -5
  155. data/lib/turnkey_client/models/usage_type.rb +27 -0
  156. data/lib/turnkey_client/models/user_params_v4.rb +301 -0
  157. data/lib/turnkey_client/models/validate_tvc_image_request.rb +237 -0
  158. data/lib/turnkey_client/models/validate_tvc_image_response.rb +205 -0
  159. data/lib/turnkey_client/models/verify_otp_intent_v2.rb +237 -0
  160. data/lib/turnkey_client/models/verify_otp_request.rb +2 -2
  161. data/lib/turnkey_client/models/web_authn_stamp.rb +256 -0
  162. data/lib/turnkey_client/models/webhook_endpoint_data.rb +283 -0
  163. data/lib/turnkey_client/models/webhook_subscription_params.rb +233 -0
  164. data/lib/turnkey_client/version.rb +1 -1
  165. data/lib/turnkey_client.rb +129 -0
  166. metadata +153 -24
@@ -0,0 +1,255 @@
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 AssetBalance
15
+ # The caip-19 asset identifier
16
+ attr_accessor :caip19
17
+
18
+ # The asset symbol
19
+ attr_accessor :symbol
20
+
21
+ # The balance in atomic units
22
+ attr_accessor :balance
23
+
24
+ # The number of decimals this asset uses
25
+ attr_accessor :decimals
26
+
27
+ attr_accessor :display
28
+
29
+ # The asset name
30
+ attr_accessor :name
31
+
32
+ # Attribute mapping from ruby-style variable name to JSON key.
33
+ def self.attribute_map
34
+ {
35
+ :'caip19' => :'caip19',
36
+ :'symbol' => :'symbol',
37
+ :'balance' => :'balance',
38
+ :'decimals' => :'decimals',
39
+ :'display' => :'display',
40
+ :'name' => :'name'
41
+ }
42
+ end
43
+
44
+ # Attribute type mapping.
45
+ def self.openapi_types
46
+ {
47
+ :'caip19' => :'Object',
48
+ :'symbol' => :'Object',
49
+ :'balance' => :'Object',
50
+ :'decimals' => :'Object',
51
+ :'display' => :'Object',
52
+ :'name' => :'Object'
53
+ }
54
+ end
55
+
56
+ # List of attributes with nullable: true
57
+ def self.openapi_nullable
58
+ Set.new([
59
+ ])
60
+ end
61
+
62
+ # Initializes the object
63
+ # @param [Hash] attributes Model attributes in the form of hash
64
+ def initialize(attributes = {})
65
+ if (!attributes.is_a?(Hash))
66
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::AssetBalance` initialize method"
67
+ end
68
+
69
+ # check to see if the attribute exists and convert string to symbol for hash key
70
+ attributes = attributes.each_with_object({}) { |(k, v), h|
71
+ if (!self.class.attribute_map.key?(k.to_sym))
72
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::AssetBalance`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
73
+ end
74
+ h[k.to_sym] = v
75
+ }
76
+
77
+ if attributes.key?(:'caip19')
78
+ self.caip19 = attributes[:'caip19']
79
+ end
80
+
81
+ if attributes.key?(:'symbol')
82
+ self.symbol = attributes[:'symbol']
83
+ end
84
+
85
+ if attributes.key?(:'balance')
86
+ self.balance = attributes[:'balance']
87
+ end
88
+
89
+ if attributes.key?(:'decimals')
90
+ self.decimals = attributes[:'decimals']
91
+ end
92
+
93
+ if attributes.key?(:'display')
94
+ self.display = attributes[:'display']
95
+ end
96
+
97
+ if attributes.key?(:'name')
98
+ self.name = attributes[:'name']
99
+ end
100
+ end
101
+
102
+ # Show invalid properties with the reasons. Usually used together with valid?
103
+ # @return Array for valid properties with the reasons
104
+ def list_invalid_properties
105
+ invalid_properties = Array.new
106
+ invalid_properties
107
+ end
108
+
109
+ # Check to see if the all the properties in the model are valid
110
+ # @return true if the model is valid
111
+ def valid?
112
+ true
113
+ end
114
+
115
+ # Checks equality by comparing each attribute.
116
+ # @param [Object] Object to be compared
117
+ def ==(o)
118
+ return true if self.equal?(o)
119
+ self.class == o.class &&
120
+ caip19 == o.caip19 &&
121
+ symbol == o.symbol &&
122
+ balance == o.balance &&
123
+ decimals == o.decimals &&
124
+ display == o.display &&
125
+ name == o.name
126
+ end
127
+
128
+ # @see the `==` method
129
+ # @param [Object] Object to be compared
130
+ def eql?(o)
131
+ self == o
132
+ end
133
+
134
+ # Calculates hash code according to all attributes.
135
+ # @return [Integer] Hash code
136
+ def hash
137
+ [caip19, symbol, balance, decimals, display, name].hash
138
+ end
139
+
140
+ # Builds the object from hash
141
+ # @param [Hash] attributes Model attributes in the form of hash
142
+ # @return [Object] Returns the model itself
143
+ def self.build_from_hash(attributes)
144
+ new.build_from_hash(attributes)
145
+ end
146
+
147
+ # Builds the object from hash
148
+ # @param [Hash] attributes Model attributes in the form of hash
149
+ # @return [Object] Returns the model itself
150
+ def build_from_hash(attributes)
151
+ return nil unless attributes.is_a?(Hash)
152
+ self.class.openapi_types.each_pair do |key, type|
153
+ if type =~ /\AArray<(.*)>/i
154
+ # check to ensure the input is an array given that the attribute
155
+ # is documented as an array but the input is not
156
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
157
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
158
+ end
159
+ elsif !attributes[self.class.attribute_map[key]].nil?
160
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
161
+ elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
162
+ self.send("#{key}=", nil)
163
+ end
164
+ end
165
+
166
+ self
167
+ end
168
+
169
+ # Deserializes the data based on type
170
+ # @param string type Data type
171
+ # @param string value Value to be deserialized
172
+ # @return [Object] Deserialized data
173
+ def _deserialize(type, value)
174
+ case type.to_sym
175
+ when :DateTime
176
+ DateTime.parse(value)
177
+ when :Date
178
+ Date.parse(value)
179
+ when :String
180
+ value.to_s
181
+ when :Integer
182
+ value.to_i
183
+ when :Float
184
+ value.to_f
185
+ when :Boolean
186
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
187
+ true
188
+ else
189
+ false
190
+ end
191
+ when :Object
192
+ # generic object (usually a Hash), return directly
193
+ value
194
+ when /\AArray<(?<inner_type>.+)>\z/
195
+ inner_type = Regexp.last_match[:inner_type]
196
+ value.map { |v| _deserialize(inner_type, v) }
197
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
198
+ k_type = Regexp.last_match[:k_type]
199
+ v_type = Regexp.last_match[:v_type]
200
+ {}.tap do |hash|
201
+ value.each do |k, v|
202
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
203
+ end
204
+ end
205
+ else # model
206
+ TurnkeyClient.const_get(type).build_from_hash(value)
207
+ end
208
+ end
209
+
210
+ # Returns the string representation of the object
211
+ # @return [String] String presentation of the object
212
+ def to_s
213
+ to_hash.to_s
214
+ end
215
+
216
+ # to_body is an alias to to_hash (backward compatibility)
217
+ # @return [Hash] Returns the object in the form of hash
218
+ def to_body
219
+ to_hash
220
+ end
221
+
222
+ # Returns the object in the form of hash
223
+ # @return [Hash] Returns the object in the form of hash
224
+ def to_hash
225
+ hash = {}
226
+ self.class.attribute_map.each_pair do |attr, param|
227
+ value = self.send(attr)
228
+ if value.nil?
229
+ is_nullable = self.class.openapi_nullable.include?(attr)
230
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
231
+ end
232
+
233
+ hash[param] = _to_hash(value)
234
+ end
235
+ hash
236
+ end
237
+
238
+ # Outputs non-array value in the form of hash
239
+ # For object, use to_hash. Otherwise, just return the value
240
+ # @param [Object] value Any valid value
241
+ # @return [Hash] Returns the value in the form of hash
242
+ def _to_hash(value)
243
+ if value.is_a?(Array)
244
+ value.compact.map { |v| _to_hash(v) }
245
+ elsif value.is_a?(Hash)
246
+ {}.tap do |hash|
247
+ value.each { |k, v| hash[k] = _to_hash(v) }
248
+ end
249
+ elsif value.respond_to? :to_hash
250
+ value.to_hash
251
+ else
252
+ value
253
+ end
254
+ end end
255
+ end
@@ -0,0 +1,216 @@
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 AssetBalanceDisplay
15
+ # USD value for display purposes only. Do not do any arithmetic or calculations with these, as the results could be imprecise.
16
+ attr_accessor :usd
17
+
18
+ # Normalized crypto value for display purposes only. Do not do any arithmetic or calculations with these, as the results could be imprecise.
19
+ attr_accessor :crypto
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'usd' => :'usd',
25
+ :'crypto' => :'crypto'
26
+ }
27
+ end
28
+
29
+ # Attribute type mapping.
30
+ def self.openapi_types
31
+ {
32
+ :'usd' => :'Object',
33
+ :'crypto' => :'Object'
34
+ }
35
+ end
36
+
37
+ # List of attributes with nullable: true
38
+ def self.openapi_nullable
39
+ Set.new([
40
+ ])
41
+ end
42
+
43
+ # Initializes the object
44
+ # @param [Hash] attributes Model attributes in the form of hash
45
+ def initialize(attributes = {})
46
+ if (!attributes.is_a?(Hash))
47
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::AssetBalanceDisplay` initialize method"
48
+ end
49
+
50
+ # check to see if the attribute exists and convert string to symbol for hash key
51
+ attributes = attributes.each_with_object({}) { |(k, v), h|
52
+ if (!self.class.attribute_map.key?(k.to_sym))
53
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::AssetBalanceDisplay`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
54
+ end
55
+ h[k.to_sym] = v
56
+ }
57
+
58
+ if attributes.key?(:'usd')
59
+ self.usd = attributes[:'usd']
60
+ end
61
+
62
+ if attributes.key?(:'crypto')
63
+ self.crypto = attributes[:'crypto']
64
+ end
65
+ end
66
+
67
+ # Show invalid properties with the reasons. Usually used together with valid?
68
+ # @return Array for valid properties with the reasons
69
+ def list_invalid_properties
70
+ invalid_properties = Array.new
71
+ invalid_properties
72
+ end
73
+
74
+ # Check to see if the all the properties in the model are valid
75
+ # @return true if the model is valid
76
+ def valid?
77
+ true
78
+ end
79
+
80
+ # Checks equality by comparing each attribute.
81
+ # @param [Object] Object to be compared
82
+ def ==(o)
83
+ return true if self.equal?(o)
84
+ self.class == o.class &&
85
+ usd == o.usd &&
86
+ crypto == o.crypto
87
+ end
88
+
89
+ # @see the `==` method
90
+ # @param [Object] Object to be compared
91
+ def eql?(o)
92
+ self == o
93
+ end
94
+
95
+ # Calculates hash code according to all attributes.
96
+ # @return [Integer] Hash code
97
+ def hash
98
+ [usd, crypto].hash
99
+ end
100
+
101
+ # Builds the object from hash
102
+ # @param [Hash] attributes Model attributes in the form of hash
103
+ # @return [Object] Returns the model itself
104
+ def self.build_from_hash(attributes)
105
+ new.build_from_hash(attributes)
106
+ end
107
+
108
+ # Builds the object from hash
109
+ # @param [Hash] attributes Model attributes in the form of hash
110
+ # @return [Object] Returns the model itself
111
+ def build_from_hash(attributes)
112
+ return nil unless attributes.is_a?(Hash)
113
+ self.class.openapi_types.each_pair do |key, type|
114
+ if type =~ /\AArray<(.*)>/i
115
+ # check to ensure the input is an array given that the attribute
116
+ # is documented as an array but the input is not
117
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
118
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
119
+ end
120
+ elsif !attributes[self.class.attribute_map[key]].nil?
121
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
122
+ elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
123
+ self.send("#{key}=", nil)
124
+ end
125
+ end
126
+
127
+ self
128
+ end
129
+
130
+ # Deserializes the data based on type
131
+ # @param string type Data type
132
+ # @param string value Value to be deserialized
133
+ # @return [Object] Deserialized data
134
+ def _deserialize(type, value)
135
+ case type.to_sym
136
+ when :DateTime
137
+ DateTime.parse(value)
138
+ when :Date
139
+ Date.parse(value)
140
+ when :String
141
+ value.to_s
142
+ when :Integer
143
+ value.to_i
144
+ when :Float
145
+ value.to_f
146
+ when :Boolean
147
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
148
+ true
149
+ else
150
+ false
151
+ end
152
+ when :Object
153
+ # generic object (usually a Hash), return directly
154
+ value
155
+ when /\AArray<(?<inner_type>.+)>\z/
156
+ inner_type = Regexp.last_match[:inner_type]
157
+ value.map { |v| _deserialize(inner_type, v) }
158
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
159
+ k_type = Regexp.last_match[:k_type]
160
+ v_type = Regexp.last_match[:v_type]
161
+ {}.tap do |hash|
162
+ value.each do |k, v|
163
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
164
+ end
165
+ end
166
+ else # model
167
+ TurnkeyClient.const_get(type).build_from_hash(value)
168
+ end
169
+ end
170
+
171
+ # Returns the string representation of the object
172
+ # @return [String] String presentation of the object
173
+ def to_s
174
+ to_hash.to_s
175
+ end
176
+
177
+ # to_body is an alias to to_hash (backward compatibility)
178
+ # @return [Hash] Returns the object in the form of hash
179
+ def to_body
180
+ to_hash
181
+ end
182
+
183
+ # Returns the object in the form of hash
184
+ # @return [Hash] Returns the object in the form of hash
185
+ def to_hash
186
+ hash = {}
187
+ self.class.attribute_map.each_pair do |attr, param|
188
+ value = self.send(attr)
189
+ if value.nil?
190
+ is_nullable = self.class.openapi_nullable.include?(attr)
191
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
192
+ end
193
+
194
+ hash[param] = _to_hash(value)
195
+ end
196
+ hash
197
+ end
198
+
199
+ # Outputs non-array value in the form of hash
200
+ # For object, use to_hash. Otherwise, just return the value
201
+ # @param [Object] value Any valid value
202
+ # @return [Hash] Returns the value in the form of hash
203
+ def _to_hash(value)
204
+ if value.is_a?(Array)
205
+ value.compact.map { |v| _to_hash(v) }
206
+ elsif value.is_a?(Hash)
207
+ {}.tap do |hash|
208
+ value.each { |k, v| hash[k] = _to_hash(v) }
209
+ end
210
+ elsif value.respond_to? :to_hash
211
+ value.to_hash
212
+ else
213
+ value
214
+ end
215
+ end end
216
+ end
@@ -0,0 +1,246 @@
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 AssetMetadata
15
+ # The caip-19 asset identifier
16
+ attr_accessor :caip19
17
+
18
+ # The asset symbol
19
+ attr_accessor :symbol
20
+
21
+ # The number of decimals this asset uses
22
+ attr_accessor :decimals
23
+
24
+ # The url of the asset logo
25
+ attr_accessor :logo_url
26
+
27
+ # The asset name
28
+ attr_accessor :name
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+ :'caip19' => :'caip19',
34
+ :'symbol' => :'symbol',
35
+ :'decimals' => :'decimals',
36
+ :'logo_url' => :'logoUrl',
37
+ :'name' => :'name'
38
+ }
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.openapi_types
43
+ {
44
+ :'caip19' => :'Object',
45
+ :'symbol' => :'Object',
46
+ :'decimals' => :'Object',
47
+ :'logo_url' => :'Object',
48
+ :'name' => :'Object'
49
+ }
50
+ end
51
+
52
+ # List of attributes with nullable: true
53
+ def self.openapi_nullable
54
+ Set.new([
55
+ ])
56
+ end
57
+
58
+ # Initializes the object
59
+ # @param [Hash] attributes Model attributes in the form of hash
60
+ def initialize(attributes = {})
61
+ if (!attributes.is_a?(Hash))
62
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::AssetMetadata` initialize method"
63
+ end
64
+
65
+ # check to see if the attribute exists and convert string to symbol for hash key
66
+ attributes = attributes.each_with_object({}) { |(k, v), h|
67
+ if (!self.class.attribute_map.key?(k.to_sym))
68
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::AssetMetadata`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
69
+ end
70
+ h[k.to_sym] = v
71
+ }
72
+
73
+ if attributes.key?(:'caip19')
74
+ self.caip19 = attributes[:'caip19']
75
+ end
76
+
77
+ if attributes.key?(:'symbol')
78
+ self.symbol = attributes[:'symbol']
79
+ end
80
+
81
+ if attributes.key?(:'decimals')
82
+ self.decimals = attributes[:'decimals']
83
+ end
84
+
85
+ if attributes.key?(:'logo_url')
86
+ self.logo_url = attributes[:'logo_url']
87
+ end
88
+
89
+ if attributes.key?(:'name')
90
+ self.name = attributes[:'name']
91
+ end
92
+ end
93
+
94
+ # Show invalid properties with the reasons. Usually used together with valid?
95
+ # @return Array for valid properties with the reasons
96
+ def list_invalid_properties
97
+ invalid_properties = Array.new
98
+ invalid_properties
99
+ end
100
+
101
+ # Check to see if the all the properties in the model are valid
102
+ # @return true if the model is valid
103
+ def valid?
104
+ true
105
+ end
106
+
107
+ # Checks equality by comparing each attribute.
108
+ # @param [Object] Object to be compared
109
+ def ==(o)
110
+ return true if self.equal?(o)
111
+ self.class == o.class &&
112
+ caip19 == o.caip19 &&
113
+ symbol == o.symbol &&
114
+ decimals == o.decimals &&
115
+ logo_url == o.logo_url &&
116
+ name == o.name
117
+ end
118
+
119
+ # @see the `==` method
120
+ # @param [Object] Object to be compared
121
+ def eql?(o)
122
+ self == o
123
+ end
124
+
125
+ # Calculates hash code according to all attributes.
126
+ # @return [Integer] Hash code
127
+ def hash
128
+ [caip19, symbol, decimals, logo_url, name].hash
129
+ end
130
+
131
+ # Builds the object from hash
132
+ # @param [Hash] attributes Model attributes in the form of hash
133
+ # @return [Object] Returns the model itself
134
+ def self.build_from_hash(attributes)
135
+ new.build_from_hash(attributes)
136
+ end
137
+
138
+ # Builds the object from hash
139
+ # @param [Hash] attributes Model attributes in the form of hash
140
+ # @return [Object] Returns the model itself
141
+ def build_from_hash(attributes)
142
+ return nil unless attributes.is_a?(Hash)
143
+ self.class.openapi_types.each_pair do |key, type|
144
+ if type =~ /\AArray<(.*)>/i
145
+ # check to ensure the input is an array given that the attribute
146
+ # is documented as an array but the input is not
147
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
148
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
149
+ end
150
+ elsif !attributes[self.class.attribute_map[key]].nil?
151
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
152
+ elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
153
+ self.send("#{key}=", nil)
154
+ end
155
+ end
156
+
157
+ self
158
+ end
159
+
160
+ # Deserializes the data based on type
161
+ # @param string type Data type
162
+ # @param string value Value to be deserialized
163
+ # @return [Object] Deserialized data
164
+ def _deserialize(type, value)
165
+ case type.to_sym
166
+ when :DateTime
167
+ DateTime.parse(value)
168
+ when :Date
169
+ Date.parse(value)
170
+ when :String
171
+ value.to_s
172
+ when :Integer
173
+ value.to_i
174
+ when :Float
175
+ value.to_f
176
+ when :Boolean
177
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
178
+ true
179
+ else
180
+ false
181
+ end
182
+ when :Object
183
+ # generic object (usually a Hash), return directly
184
+ value
185
+ when /\AArray<(?<inner_type>.+)>\z/
186
+ inner_type = Regexp.last_match[:inner_type]
187
+ value.map { |v| _deserialize(inner_type, v) }
188
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
189
+ k_type = Regexp.last_match[:k_type]
190
+ v_type = Regexp.last_match[:v_type]
191
+ {}.tap do |hash|
192
+ value.each do |k, v|
193
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
194
+ end
195
+ end
196
+ else # model
197
+ TurnkeyClient.const_get(type).build_from_hash(value)
198
+ end
199
+ end
200
+
201
+ # Returns the string representation of the object
202
+ # @return [String] String presentation of the object
203
+ def to_s
204
+ to_hash.to_s
205
+ end
206
+
207
+ # to_body is an alias to to_hash (backward compatibility)
208
+ # @return [Hash] Returns the object in the form of hash
209
+ def to_body
210
+ to_hash
211
+ end
212
+
213
+ # Returns the object in the form of hash
214
+ # @return [Hash] Returns the object in the form of hash
215
+ def to_hash
216
+ hash = {}
217
+ self.class.attribute_map.each_pair do |attr, param|
218
+ value = self.send(attr)
219
+ if value.nil?
220
+ is_nullable = self.class.openapi_nullable.include?(attr)
221
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
222
+ end
223
+
224
+ hash[param] = _to_hash(value)
225
+ end
226
+ hash
227
+ end
228
+
229
+ # Outputs non-array value in the form of hash
230
+ # For object, use to_hash. Otherwise, just return the value
231
+ # @param [Object] value Any valid value
232
+ # @return [Hash] Returns the value in the form of hash
233
+ def _to_hash(value)
234
+ if value.is_a?(Array)
235
+ value.compact.map { |v| _to_hash(v) }
236
+ elsif value.is_a?(Hash)
237
+ {}.tap do |hash|
238
+ value.each { |k, v| hash[k] = _to_hash(v) }
239
+ end
240
+ elsif value.respond_to? :to_hash
241
+ value.to_hash
242
+ else
243
+ value
244
+ end
245
+ end end
246
+ end