turnkey_client 0.0.2 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (269) hide show
  1. checksums.yaml +4 -4
  2. data/lib/turnkey_client/api/activities_api.rb +0 -1
  3. data/lib/turnkey_client/api/api_keys_api.rb +0 -1
  4. data/lib/turnkey_client/api/authenticators_api.rb +0 -1
  5. data/lib/turnkey_client/api/consensus_api.rb +0 -1
  6. data/lib/turnkey_client/api/features_api.rb +0 -1
  7. data/lib/turnkey_client/api/invitations_api.rb +0 -1
  8. data/lib/turnkey_client/api/organizations_api.rb +58 -1
  9. data/lib/turnkey_client/api/policies_api.rb +0 -1
  10. data/lib/turnkey_client/api/private_key_tags_api.rb +0 -1
  11. data/lib/turnkey_client/api/private_keys_api.rb +116 -1
  12. data/lib/turnkey_client/api/sessions_api.rb +2 -3
  13. data/lib/turnkey_client/api/signing_api.rb +0 -1
  14. data/lib/turnkey_client/api/user_auth_api.rb +0 -1
  15. data/lib/turnkey_client/api/user_recovery_api.rb +0 -1
  16. data/lib/turnkey_client/api/user_tags_api.rb +0 -1
  17. data/lib/turnkey_client/api/users_api.rb +0 -1
  18. data/lib/turnkey_client/api/wallets_api.rb +0 -1
  19. data/lib/turnkey_client/api_client.rb +0 -1
  20. data/lib/turnkey_client/api_error.rb +0 -1
  21. data/lib/turnkey_client/configuration.rb +0 -1
  22. data/lib/turnkey_client/models/accept_invitation_intent.rb +0 -1
  23. data/lib/turnkey_client/models/accept_invitation_intent_v2.rb +0 -1
  24. data/lib/turnkey_client/models/accept_invitation_result.rb +0 -1
  25. data/lib/turnkey_client/models/access_type.rb +0 -1
  26. data/lib/turnkey_client/models/activate_billing_tier_intent.rb +0 -1
  27. data/lib/turnkey_client/models/activate_billing_tier_result.rb +0 -1
  28. data/lib/turnkey_client/models/activity.rb +0 -1
  29. data/lib/turnkey_client/models/activity_response.rb +0 -1
  30. data/lib/turnkey_client/models/activity_status.rb +0 -1
  31. data/lib/turnkey_client/models/activity_type.rb +2 -1
  32. data/lib/turnkey_client/models/activity_v1_address.rb +0 -1
  33. data/lib/turnkey_client/models/address_format.rb +0 -1
  34. data/lib/turnkey_client/models/api_key.rb +0 -1
  35. data/lib/turnkey_client/models/api_key_params.rb +0 -1
  36. data/lib/turnkey_client/models/api_only_user_params.rb +0 -1
  37. data/lib/turnkey_client/models/approve_activity_intent.rb +0 -1
  38. data/lib/turnkey_client/models/approve_activity_request.rb +0 -1
  39. data/lib/turnkey_client/models/attestation.rb +0 -1
  40. data/lib/turnkey_client/models/authenticator.rb +0 -1
  41. data/lib/turnkey_client/models/authenticator_attestation_response.rb +0 -1
  42. data/lib/turnkey_client/models/authenticator_params.rb +0 -1
  43. data/lib/turnkey_client/models/authenticator_params_v2.rb +0 -1
  44. data/lib/turnkey_client/models/authenticator_transport.rb +0 -1
  45. data/lib/turnkey_client/models/create_api_keys_intent.rb +0 -1
  46. data/lib/turnkey_client/models/create_api_keys_request.rb +0 -1
  47. data/lib/turnkey_client/models/create_api_keys_result.rb +0 -1
  48. data/lib/turnkey_client/models/create_api_only_users_intent.rb +0 -1
  49. data/lib/turnkey_client/models/create_api_only_users_result.rb +0 -1
  50. data/lib/turnkey_client/models/create_authenticators_intent.rb +0 -1
  51. data/lib/turnkey_client/models/create_authenticators_intent_v2.rb +0 -1
  52. data/lib/turnkey_client/models/create_authenticators_request.rb +0 -1
  53. data/lib/turnkey_client/models/create_authenticators_result.rb +0 -1
  54. data/lib/turnkey_client/models/create_invitations_intent.rb +0 -1
  55. data/lib/turnkey_client/models/create_invitations_request.rb +0 -1
  56. data/lib/turnkey_client/models/create_invitations_result.rb +0 -1
  57. data/lib/turnkey_client/models/create_organization_intent.rb +0 -1
  58. data/lib/turnkey_client/models/create_organization_intent_v2.rb +0 -1
  59. data/lib/turnkey_client/models/create_organization_result.rb +0 -1
  60. data/lib/turnkey_client/models/create_policy_intent.rb +0 -1
  61. data/lib/turnkey_client/models/create_policy_intent_v2.rb +0 -1
  62. data/lib/turnkey_client/models/create_policy_intent_v3.rb +0 -1
  63. data/lib/turnkey_client/models/create_policy_request.rb +0 -1
  64. data/lib/turnkey_client/models/create_policy_result.rb +0 -1
  65. data/lib/turnkey_client/models/create_private_key_tag_intent.rb +0 -1
  66. data/lib/turnkey_client/models/create_private_key_tag_request.rb +0 -1
  67. data/lib/turnkey_client/models/create_private_key_tag_result.rb +0 -1
  68. data/lib/turnkey_client/models/create_private_keys_intent.rb +0 -1
  69. data/lib/turnkey_client/models/create_private_keys_intent_v2.rb +0 -1
  70. data/lib/turnkey_client/models/create_private_keys_request.rb +0 -1
  71. data/lib/turnkey_client/models/create_private_keys_result.rb +0 -1
  72. data/lib/turnkey_client/models/create_private_keys_result_v2.rb +0 -1
  73. data/lib/turnkey_client/models/create_sub_organization_intent.rb +0 -1
  74. data/lib/turnkey_client/models/create_sub_organization_intent_v2.rb +0 -1
  75. data/lib/turnkey_client/models/create_sub_organization_intent_v3.rb +0 -1
  76. data/lib/turnkey_client/models/create_sub_organization_intent_v4.rb +0 -1
  77. data/lib/turnkey_client/models/create_sub_organization_request.rb +0 -1
  78. data/lib/turnkey_client/models/create_sub_organization_result.rb +15 -5
  79. data/lib/turnkey_client/models/create_sub_organization_result_v3.rb +15 -5
  80. data/lib/turnkey_client/models/create_sub_organization_result_v4.rb +15 -5
  81. data/lib/turnkey_client/models/create_user_tag_intent.rb +0 -1
  82. data/lib/turnkey_client/models/create_user_tag_request.rb +0 -1
  83. data/lib/turnkey_client/models/create_user_tag_result.rb +0 -1
  84. data/lib/turnkey_client/models/create_users_intent.rb +0 -1
  85. data/lib/turnkey_client/models/create_users_intent_v2.rb +0 -1
  86. data/lib/turnkey_client/models/create_users_request.rb +0 -1
  87. data/lib/turnkey_client/models/create_users_result.rb +0 -1
  88. data/lib/turnkey_client/models/create_wallet_accounts_intent.rb +0 -1
  89. data/lib/turnkey_client/models/create_wallet_accounts_request.rb +0 -1
  90. data/lib/turnkey_client/models/create_wallet_accounts_result.rb +0 -1
  91. data/lib/turnkey_client/models/create_wallet_intent.rb +0 -1
  92. data/lib/turnkey_client/models/create_wallet_request.rb +0 -1
  93. data/lib/turnkey_client/models/create_wallet_result.rb +0 -1
  94. data/lib/turnkey_client/models/cred_props_authentication_extensions_client_outputs.rb +0 -1
  95. data/lib/turnkey_client/models/credential_type.rb +0 -1
  96. data/lib/turnkey_client/models/curve.rb +0 -1
  97. data/lib/turnkey_client/models/data_v1_address.rb +0 -1
  98. data/lib/turnkey_client/models/delete_api_keys_intent.rb +0 -1
  99. data/lib/turnkey_client/models/delete_api_keys_request.rb +0 -1
  100. data/lib/turnkey_client/models/delete_api_keys_result.rb +0 -1
  101. data/lib/turnkey_client/models/delete_authenticators_intent.rb +0 -1
  102. data/lib/turnkey_client/models/delete_authenticators_request.rb +0 -1
  103. data/lib/turnkey_client/models/delete_authenticators_result.rb +0 -1
  104. data/lib/turnkey_client/models/delete_invitation_intent.rb +0 -1
  105. data/lib/turnkey_client/models/delete_invitation_request.rb +0 -1
  106. data/lib/turnkey_client/models/delete_invitation_result.rb +0 -1
  107. data/lib/turnkey_client/models/delete_organization_intent.rb +0 -1
  108. data/lib/turnkey_client/models/delete_organization_result.rb +0 -1
  109. data/lib/turnkey_client/models/delete_payment_method_intent.rb +0 -1
  110. data/lib/turnkey_client/models/delete_payment_method_result.rb +0 -1
  111. data/lib/turnkey_client/models/delete_policy_intent.rb +0 -1
  112. data/lib/turnkey_client/models/delete_policy_request.rb +0 -1
  113. data/lib/turnkey_client/models/delete_policy_result.rb +0 -1
  114. data/lib/turnkey_client/models/delete_private_key_tags_intent.rb +0 -1
  115. data/lib/turnkey_client/models/delete_private_key_tags_request.rb +0 -1
  116. data/lib/turnkey_client/models/delete_private_key_tags_result.rb +0 -1
  117. data/lib/turnkey_client/models/delete_user_tags_intent.rb +0 -1
  118. data/lib/turnkey_client/models/delete_user_tags_request.rb +0 -1
  119. data/lib/turnkey_client/models/delete_user_tags_result.rb +0 -1
  120. data/lib/turnkey_client/models/delete_users_intent.rb +0 -1
  121. data/lib/turnkey_client/models/delete_users_request.rb +0 -1
  122. data/lib/turnkey_client/models/delete_users_result.rb +0 -1
  123. data/lib/turnkey_client/models/disable_private_key_intent.rb +0 -1
  124. data/lib/turnkey_client/models/disable_private_key_result.rb +0 -1
  125. data/lib/turnkey_client/models/effect.rb +0 -1
  126. data/lib/turnkey_client/models/email_auth_intent.rb +0 -1
  127. data/lib/turnkey_client/models/email_auth_request.rb +0 -1
  128. data/lib/turnkey_client/models/email_auth_result.rb +0 -1
  129. data/lib/turnkey_client/models/email_customization_params.rb +0 -1
  130. data/lib/turnkey_client/models/export_private_key_intent.rb +0 -1
  131. data/lib/turnkey_client/models/export_private_key_request.rb +0 -1
  132. data/lib/turnkey_client/models/export_private_key_result.rb +0 -1
  133. data/lib/turnkey_client/models/export_wallet_account_intent.rb +0 -1
  134. data/lib/turnkey_client/models/export_wallet_account_request.rb +0 -1
  135. data/lib/turnkey_client/models/export_wallet_account_result.rb +0 -1
  136. data/lib/turnkey_client/models/export_wallet_intent.rb +0 -1
  137. data/lib/turnkey_client/models/export_wallet_request.rb +0 -1
  138. data/lib/turnkey_client/models/export_wallet_result.rb +0 -1
  139. data/lib/turnkey_client/models/external_data_v1_credential.rb +0 -1
  140. data/lib/turnkey_client/models/external_data_v1_timestamp.rb +0 -1
  141. data/lib/turnkey_client/models/feature.rb +0 -1
  142. data/lib/turnkey_client/models/feature_name.rb +1 -1
  143. data/lib/turnkey_client/models/get_activities_request.rb +0 -1
  144. data/lib/turnkey_client/models/get_activities_response.rb +0 -1
  145. data/lib/turnkey_client/models/get_activity_request.rb +0 -1
  146. data/lib/turnkey_client/models/get_api_key_request.rb +0 -1
  147. data/lib/turnkey_client/models/get_api_key_response.rb +0 -1
  148. data/lib/turnkey_client/models/get_api_keys_request.rb +0 -1
  149. data/lib/turnkey_client/models/get_api_keys_response.rb +0 -1
  150. data/lib/turnkey_client/models/get_authenticator_request.rb +0 -1
  151. data/lib/turnkey_client/models/get_authenticator_response.rb +0 -1
  152. data/lib/turnkey_client/models/get_authenticators_request.rb +0 -1
  153. data/lib/turnkey_client/models/get_authenticators_response.rb +0 -1
  154. data/lib/turnkey_client/models/get_policies_request.rb +0 -1
  155. data/lib/turnkey_client/models/get_policies_response.rb +0 -1
  156. data/lib/turnkey_client/models/get_policy_request.rb +0 -1
  157. data/lib/turnkey_client/models/get_policy_response.rb +0 -1
  158. data/lib/turnkey_client/models/get_private_key_request.rb +0 -1
  159. data/lib/turnkey_client/models/get_private_key_response.rb +0 -1
  160. data/lib/turnkey_client/models/get_private_keys_request.rb +0 -1
  161. data/lib/turnkey_client/models/get_private_keys_response.rb +0 -1
  162. data/lib/turnkey_client/models/get_sub_org_ids_request.rb +240 -0
  163. data/lib/turnkey_client/models/get_sub_org_ids_response.rb +213 -0
  164. data/lib/turnkey_client/models/get_user_request.rb +0 -1
  165. data/lib/turnkey_client/models/get_user_response.rb +0 -1
  166. data/lib/turnkey_client/models/get_users_request.rb +0 -1
  167. data/lib/turnkey_client/models/get_users_response.rb +0 -1
  168. data/lib/turnkey_client/models/get_wallet_accounts_request.rb +13 -5
  169. data/lib/turnkey_client/models/get_wallet_accounts_response.rb +0 -1
  170. data/lib/turnkey_client/models/get_wallet_request.rb +0 -1
  171. data/lib/turnkey_client/models/get_wallet_response.rb +0 -1
  172. data/lib/turnkey_client/models/get_wallets_request.rb +0 -1
  173. data/lib/turnkey_client/models/get_wallets_response.rb +0 -1
  174. data/lib/turnkey_client/models/get_whoami_request.rb +0 -1
  175. data/lib/turnkey_client/models/get_whoami_response.rb +0 -1
  176. data/lib/turnkey_client/models/hash_function.rb +0 -1
  177. data/lib/turnkey_client/models/import_private_key_intent.rb +272 -0
  178. data/lib/turnkey_client/models/import_private_key_request.rb +288 -0
  179. data/lib/turnkey_client/models/import_private_key_result.rb +228 -0
  180. data/lib/turnkey_client/models/import_wallet_intent.rb +0 -1
  181. data/lib/turnkey_client/models/import_wallet_request.rb +0 -1
  182. data/lib/turnkey_client/models/import_wallet_result.rb +0 -1
  183. data/lib/turnkey_client/models/init_import_private_key_intent.rb +211 -0
  184. data/lib/turnkey_client/models/init_import_private_key_request.rb +288 -0
  185. data/lib/turnkey_client/models/init_import_private_key_result.rb +211 -0
  186. data/lib/turnkey_client/models/init_import_wallet_intent.rb +0 -1
  187. data/lib/turnkey_client/models/init_import_wallet_request.rb +0 -1
  188. data/lib/turnkey_client/models/init_import_wallet_result.rb +0 -1
  189. data/lib/turnkey_client/models/init_user_email_recovery_intent.rb +13 -5
  190. data/lib/turnkey_client/models/init_user_email_recovery_request.rb +0 -1
  191. data/lib/turnkey_client/models/init_user_email_recovery_result.rb +0 -1
  192. data/lib/turnkey_client/models/intent.rb +22 -5
  193. data/lib/turnkey_client/models/invitation_params.rb +0 -1
  194. data/lib/turnkey_client/models/list_private_key_tags_request.rb +0 -1
  195. data/lib/turnkey_client/models/list_private_key_tags_response.rb +0 -1
  196. data/lib/turnkey_client/models/list_user_tags_request.rb +0 -1
  197. data/lib/turnkey_client/models/list_user_tags_response.rb +0 -1
  198. data/lib/turnkey_client/models/mnemonic_language.rb +0 -1
  199. data/lib/turnkey_client/models/operator.rb +0 -1
  200. data/lib/turnkey_client/models/pagination.rb +0 -1
  201. data/lib/turnkey_client/models/path_format.rb +0 -1
  202. data/lib/turnkey_client/models/payload_encoding.rb +0 -1
  203. data/lib/turnkey_client/models/policy.rb +0 -1
  204. data/lib/turnkey_client/models/private_key.rb +19 -5
  205. data/lib/turnkey_client/models/private_key_params.rb +0 -1
  206. data/lib/turnkey_client/models/private_key_result.rb +0 -1
  207. data/lib/turnkey_client/models/public_key_credential_with_attestation.rb +0 -1
  208. data/lib/turnkey_client/models/recover_user_intent.rb +0 -1
  209. data/lib/turnkey_client/models/recover_user_request.rb +0 -1
  210. data/lib/turnkey_client/models/recover_user_result.rb +0 -1
  211. data/lib/turnkey_client/models/reject_activity_intent.rb +0 -1
  212. data/lib/turnkey_client/models/reject_activity_request.rb +0 -1
  213. data/lib/turnkey_client/models/remove_organization_feature_intent.rb +0 -1
  214. data/lib/turnkey_client/models/remove_organization_feature_request.rb +0 -1
  215. data/lib/turnkey_client/models/remove_organization_feature_result.rb +0 -1
  216. data/lib/turnkey_client/models/result.rb +22 -5
  217. data/lib/turnkey_client/models/root_user_params.rb +0 -1
  218. data/lib/turnkey_client/models/selector.rb +0 -1
  219. data/lib/turnkey_client/models/selector_v2.rb +0 -1
  220. data/lib/turnkey_client/models/set_organization_feature_intent.rb +0 -1
  221. data/lib/turnkey_client/models/set_organization_feature_request.rb +0 -1
  222. data/lib/turnkey_client/models/set_organization_feature_result.rb +0 -1
  223. data/lib/turnkey_client/models/set_payment_method_intent.rb +0 -1
  224. data/lib/turnkey_client/models/set_payment_method_intent_v2.rb +0 -1
  225. data/lib/turnkey_client/models/set_payment_method_result.rb +0 -1
  226. data/lib/turnkey_client/models/sign_raw_payload_intent.rb +0 -1
  227. data/lib/turnkey_client/models/sign_raw_payload_intent_v2.rb +0 -1
  228. data/lib/turnkey_client/models/sign_raw_payload_request.rb +0 -1
  229. data/lib/turnkey_client/models/sign_raw_payload_result.rb +0 -1
  230. data/lib/turnkey_client/models/sign_transaction_intent.rb +0 -1
  231. data/lib/turnkey_client/models/sign_transaction_intent_v2.rb +0 -1
  232. data/lib/turnkey_client/models/sign_transaction_request.rb +0 -1
  233. data/lib/turnkey_client/models/sign_transaction_result.rb +0 -1
  234. data/lib/turnkey_client/models/simple_client_extension_results.rb +0 -1
  235. data/lib/turnkey_client/models/tag_type.rb +0 -1
  236. data/lib/turnkey_client/models/transaction_type.rb +0 -1
  237. data/lib/turnkey_client/models/update_allowed_origins_intent.rb +0 -1
  238. data/lib/turnkey_client/models/update_allowed_origins_result.rb +0 -1
  239. data/lib/turnkey_client/models/update_policy_intent.rb +0 -1
  240. data/lib/turnkey_client/models/update_policy_request.rb +0 -1
  241. data/lib/turnkey_client/models/update_policy_result.rb +0 -1
  242. data/lib/turnkey_client/models/update_private_key_tag_intent.rb +0 -1
  243. data/lib/turnkey_client/models/update_private_key_tag_request.rb +0 -1
  244. data/lib/turnkey_client/models/update_private_key_tag_result.rb +0 -1
  245. data/lib/turnkey_client/models/update_root_quorum_intent.rb +0 -1
  246. data/lib/turnkey_client/models/update_root_quorum_request.rb +0 -1
  247. data/lib/turnkey_client/models/update_root_quorum_result.rb +0 -1
  248. data/lib/turnkey_client/models/update_user_intent.rb +0 -1
  249. data/lib/turnkey_client/models/update_user_request.rb +0 -1
  250. data/lib/turnkey_client/models/update_user_result.rb +0 -1
  251. data/lib/turnkey_client/models/update_user_tag_intent.rb +0 -1
  252. data/lib/turnkey_client/models/update_user_tag_request.rb +0 -1
  253. data/lib/turnkey_client/models/update_user_tag_result.rb +0 -1
  254. data/lib/turnkey_client/models/user.rb +0 -1
  255. data/lib/turnkey_client/models/user_params.rb +0 -1
  256. data/lib/turnkey_client/models/user_params_v2.rb +0 -1
  257. data/lib/turnkey_client/models/v1_tag.rb +0 -1
  258. data/lib/turnkey_client/models/vote.rb +0 -1
  259. data/lib/turnkey_client/models/wallet.rb +0 -1
  260. data/lib/turnkey_client/models/wallet_account.rb +0 -1
  261. data/lib/turnkey_client/models/wallet_account_params.rb +0 -1
  262. data/lib/turnkey_client/models/wallet_params.rb +0 -1
  263. data/lib/turnkey_client/models/wallet_result.rb +0 -1
  264. data/lib/turnkey_client/version.rb +1 -2
  265. data/lib/turnkey_client.rb +8 -1
  266. data/turnkey_client-0.0.2.gem +0 -0
  267. data/turnkey_client-0.0.3.gem +0 -0
  268. data/turnkey_client.gemspec +0 -1
  269. metadata +12 -2
@@ -0,0 +1,272 @@
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 ImportPrivateKeyIntent
15
+ # The ID of the User importing a Private Key.
16
+ attr_accessor :user_id
17
+
18
+ # Human-readable name for a Private Key.
19
+ attr_accessor :private_key_name
20
+
21
+ # Bundle containing a raw private key encrypted to the enclave's target public key.
22
+ attr_accessor :encrypted_bundle
23
+
24
+ attr_accessor :curve
25
+
26
+ # Cryptocurrency-specific formats for a derived address (e.g., Ethereum).
27
+ attr_accessor :address_formats
28
+
29
+ # Attribute mapping from ruby-style variable name to JSON key.
30
+ def self.attribute_map
31
+ {
32
+ :'user_id' => :'userId',
33
+ :'private_key_name' => :'privateKeyName',
34
+ :'encrypted_bundle' => :'encryptedBundle',
35
+ :'curve' => :'curve',
36
+ :'address_formats' => :'addressFormats'
37
+ }
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.openapi_types
42
+ {
43
+ :'user_id' => :'Object',
44
+ :'private_key_name' => :'Object',
45
+ :'encrypted_bundle' => :'Object',
46
+ :'curve' => :'Object',
47
+ :'address_formats' => :'Object'
48
+ }
49
+ end
50
+
51
+ # List of attributes with nullable: true
52
+ def self.openapi_nullable
53
+ Set.new([
54
+ ])
55
+ end
56
+
57
+ # Initializes the object
58
+ # @param [Hash] attributes Model attributes in the form of hash
59
+ def initialize(attributes = {})
60
+ if (!attributes.is_a?(Hash))
61
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::ImportPrivateKeyIntent` initialize method"
62
+ end
63
+
64
+ # check to see if the attribute exists and convert string to symbol for hash key
65
+ attributes = attributes.each_with_object({}) { |(k, v), h|
66
+ if (!self.class.attribute_map.key?(k.to_sym))
67
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::ImportPrivateKeyIntent`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
68
+ end
69
+ h[k.to_sym] = v
70
+ }
71
+
72
+ if attributes.key?(:'user_id')
73
+ self.user_id = attributes[:'user_id']
74
+ end
75
+
76
+ if attributes.key?(:'private_key_name')
77
+ self.private_key_name = attributes[:'private_key_name']
78
+ end
79
+
80
+ if attributes.key?(:'encrypted_bundle')
81
+ self.encrypted_bundle = attributes[:'encrypted_bundle']
82
+ end
83
+
84
+ if attributes.key?(:'curve')
85
+ self.curve = attributes[:'curve']
86
+ end
87
+
88
+ if attributes.key?(:'address_formats')
89
+ if (value = attributes[:'address_formats']).is_a?(Array)
90
+ self.address_formats = value
91
+ end
92
+ end
93
+ end
94
+
95
+ # Show invalid properties with the reasons. Usually used together with valid?
96
+ # @return Array for valid properties with the reasons
97
+ def list_invalid_properties
98
+ invalid_properties = Array.new
99
+ if @user_id.nil?
100
+ invalid_properties.push('invalid value for "user_id", user_id cannot be nil.')
101
+ end
102
+
103
+ if @private_key_name.nil?
104
+ invalid_properties.push('invalid value for "private_key_name", private_key_name cannot be nil.')
105
+ end
106
+
107
+ if @encrypted_bundle.nil?
108
+ invalid_properties.push('invalid value for "encrypted_bundle", encrypted_bundle cannot be nil.')
109
+ end
110
+
111
+ if @curve.nil?
112
+ invalid_properties.push('invalid value for "curve", curve cannot be nil.')
113
+ end
114
+
115
+ if @address_formats.nil?
116
+ invalid_properties.push('invalid value for "address_formats", address_formats cannot be nil.')
117
+ end
118
+
119
+ invalid_properties
120
+ end
121
+
122
+ # Check to see if the all the properties in the model are valid
123
+ # @return true if the model is valid
124
+ def valid?
125
+ return false if @user_id.nil?
126
+ return false if @private_key_name.nil?
127
+ return false if @encrypted_bundle.nil?
128
+ return false if @curve.nil?
129
+ return false if @address_formats.nil?
130
+ true
131
+ end
132
+
133
+ # Checks equality by comparing each attribute.
134
+ # @param [Object] Object to be compared
135
+ def ==(o)
136
+ return true if self.equal?(o)
137
+ self.class == o.class &&
138
+ user_id == o.user_id &&
139
+ private_key_name == o.private_key_name &&
140
+ encrypted_bundle == o.encrypted_bundle &&
141
+ curve == o.curve &&
142
+ address_formats == o.address_formats
143
+ end
144
+
145
+ # @see the `==` method
146
+ # @param [Object] Object to be compared
147
+ def eql?(o)
148
+ self == o
149
+ end
150
+
151
+ # Calculates hash code according to all attributes.
152
+ # @return [Integer] Hash code
153
+ def hash
154
+ [user_id, private_key_name, encrypted_bundle, curve, address_formats].hash
155
+ end
156
+
157
+ # Builds the object from hash
158
+ # @param [Hash] attributes Model attributes in the form of hash
159
+ # @return [Object] Returns the model itself
160
+ def self.build_from_hash(attributes)
161
+ new.build_from_hash(attributes)
162
+ end
163
+
164
+ # Builds the object from hash
165
+ # @param [Hash] attributes Model attributes in the form of hash
166
+ # @return [Object] Returns the model itself
167
+ def build_from_hash(attributes)
168
+ return nil unless attributes.is_a?(Hash)
169
+ self.class.openapi_types.each_pair do |key, type|
170
+ if type =~ /\AArray<(.*)>/i
171
+ # check to ensure the input is an array given that the attribute
172
+ # is documented as an array but the input is not
173
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
174
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
175
+ end
176
+ elsif !attributes[self.class.attribute_map[key]].nil?
177
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
178
+ elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
179
+ self.send("#{key}=", nil)
180
+ end
181
+ end
182
+
183
+ self
184
+ end
185
+
186
+ # Deserializes the data based on type
187
+ # @param string type Data type
188
+ # @param string value Value to be deserialized
189
+ # @return [Object] Deserialized data
190
+ def _deserialize(type, value)
191
+ case type.to_sym
192
+ when :DateTime
193
+ DateTime.parse(value)
194
+ when :Date
195
+ Date.parse(value)
196
+ when :String
197
+ value.to_s
198
+ when :Integer
199
+ value.to_i
200
+ when :Float
201
+ value.to_f
202
+ when :Boolean
203
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
204
+ true
205
+ else
206
+ false
207
+ end
208
+ when :Object
209
+ # generic object (usually a Hash), return directly
210
+ value
211
+ when /\AArray<(?<inner_type>.+)>\z/
212
+ inner_type = Regexp.last_match[:inner_type]
213
+ value.map { |v| _deserialize(inner_type, v) }
214
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
215
+ k_type = Regexp.last_match[:k_type]
216
+ v_type = Regexp.last_match[:v_type]
217
+ {}.tap do |hash|
218
+ value.each do |k, v|
219
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
220
+ end
221
+ end
222
+ else # model
223
+ TurnkeyClient.const_get(type).build_from_hash(value)
224
+ end
225
+ end
226
+
227
+ # Returns the string representation of the object
228
+ # @return [String] String presentation of the object
229
+ def to_s
230
+ to_hash.to_s
231
+ end
232
+
233
+ # to_body is an alias to to_hash (backward compatibility)
234
+ # @return [Hash] Returns the object in the form of hash
235
+ def to_body
236
+ to_hash
237
+ end
238
+
239
+ # Returns the object in the form of hash
240
+ # @return [Hash] Returns the object in the form of hash
241
+ def to_hash
242
+ hash = {}
243
+ self.class.attribute_map.each_pair do |attr, param|
244
+ value = self.send(attr)
245
+ if value.nil?
246
+ is_nullable = self.class.openapi_nullable.include?(attr)
247
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
248
+ end
249
+
250
+ hash[param] = _to_hash(value)
251
+ end
252
+ hash
253
+ end
254
+
255
+ # Outputs non-array value in the form of hash
256
+ # For object, use to_hash. Otherwise, just return the value
257
+ # @param [Object] value Any valid value
258
+ # @return [Hash] Returns the value in the form of hash
259
+ def _to_hash(value)
260
+ if value.is_a?(Array)
261
+ value.compact.map { |v| _to_hash(v) }
262
+ elsif value.is_a?(Hash)
263
+ {}.tap do |hash|
264
+ value.each { |k, v| hash[k] = _to_hash(v) }
265
+ end
266
+ elsif value.respond_to? :to_hash
267
+ value.to_hash
268
+ else
269
+ value
270
+ end
271
+ end end
272
+ end
@@ -0,0 +1,288 @@
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 ImportPrivateKeyRequest
15
+ attr_accessor :type
16
+
17
+ # Timestamp (in milliseconds) of the request, used to verify liveness of user requests.
18
+ attr_accessor :timestamp_ms
19
+
20
+ # Unique identifier for a given Organization.
21
+ attr_accessor :organization_id
22
+
23
+ attr_accessor :parameters
24
+
25
+ class EnumAttributeValidator
26
+ attr_reader :datatype
27
+ attr_reader :allowable_values
28
+
29
+ def initialize(datatype, allowable_values)
30
+ @allowable_values = allowable_values.map do |value|
31
+ case datatype.to_s
32
+ when /Integer/i
33
+ value.to_i
34
+ when /Float/i
35
+ value.to_f
36
+ else
37
+ value
38
+ end
39
+ end
40
+ end
41
+
42
+ def valid?(value)
43
+ !value || allowable_values.include?(value)
44
+ end
45
+ end
46
+
47
+ # Attribute mapping from ruby-style variable name to JSON key.
48
+ def self.attribute_map
49
+ {
50
+ :'type' => :'type',
51
+ :'timestamp_ms' => :'timestampMs',
52
+ :'organization_id' => :'organizationId',
53
+ :'parameters' => :'parameters'
54
+ }
55
+ end
56
+
57
+ # Attribute type mapping.
58
+ def self.openapi_types
59
+ {
60
+ :'type' => :'Object',
61
+ :'timestamp_ms' => :'Object',
62
+ :'organization_id' => :'Object',
63
+ :'parameters' => :'Object'
64
+ }
65
+ end
66
+
67
+ # List of attributes with nullable: true
68
+ def self.openapi_nullable
69
+ Set.new([
70
+ ])
71
+ end
72
+
73
+ # Initializes the object
74
+ # @param [Hash] attributes Model attributes in the form of hash
75
+ def initialize(attributes = {})
76
+ if (!attributes.is_a?(Hash))
77
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::ImportPrivateKeyRequest` initialize method"
78
+ end
79
+
80
+ # check to see if the attribute exists and convert string to symbol for hash key
81
+ attributes = attributes.each_with_object({}) { |(k, v), h|
82
+ if (!self.class.attribute_map.key?(k.to_sym))
83
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::ImportPrivateKeyRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
84
+ end
85
+ h[k.to_sym] = v
86
+ }
87
+
88
+ if attributes.key?(:'type')
89
+ self.type = attributes[:'type']
90
+ end
91
+
92
+ if attributes.key?(:'timestamp_ms')
93
+ self.timestamp_ms = attributes[:'timestamp_ms']
94
+ end
95
+
96
+ if attributes.key?(:'organization_id')
97
+ self.organization_id = attributes[:'organization_id']
98
+ end
99
+
100
+ if attributes.key?(:'parameters')
101
+ self.parameters = attributes[:'parameters']
102
+ end
103
+ end
104
+
105
+ # Show invalid properties with the reasons. Usually used together with valid?
106
+ # @return Array for valid properties with the reasons
107
+ def list_invalid_properties
108
+ invalid_properties = Array.new
109
+ if @type.nil?
110
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
111
+ end
112
+
113
+ if @timestamp_ms.nil?
114
+ invalid_properties.push('invalid value for "timestamp_ms", timestamp_ms cannot be nil.')
115
+ end
116
+
117
+ if @organization_id.nil?
118
+ invalid_properties.push('invalid value for "organization_id", organization_id cannot be nil.')
119
+ end
120
+
121
+ if @parameters.nil?
122
+ invalid_properties.push('invalid value for "parameters", parameters cannot be nil.')
123
+ end
124
+
125
+ invalid_properties
126
+ end
127
+
128
+ # Check to see if the all the properties in the model are valid
129
+ # @return true if the model is valid
130
+ def valid?
131
+ return false if @type.nil?
132
+ type_validator = EnumAttributeValidator.new('Object', ['ACTIVITY_TYPE_IMPORT_PRIVATE_KEY'])
133
+ return false unless type_validator.valid?(@type)
134
+ return false if @timestamp_ms.nil?
135
+ return false if @organization_id.nil?
136
+ return false if @parameters.nil?
137
+ true
138
+ end
139
+
140
+ # Custom attribute writer method checking allowed values (enum).
141
+ # @param [Object] type Object to be assigned
142
+ def type=(type)
143
+ validator = EnumAttributeValidator.new('Object', ['ACTIVITY_TYPE_IMPORT_PRIVATE_KEY'])
144
+ unless validator.valid?(type)
145
+ fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
146
+ end
147
+ @type = type
148
+ end
149
+
150
+ # Checks equality by comparing each attribute.
151
+ # @param [Object] Object to be compared
152
+ def ==(o)
153
+ return true if self.equal?(o)
154
+ self.class == o.class &&
155
+ type == o.type &&
156
+ timestamp_ms == o.timestamp_ms &&
157
+ organization_id == o.organization_id &&
158
+ parameters == o.parameters
159
+ end
160
+
161
+ # @see the `==` method
162
+ # @param [Object] Object to be compared
163
+ def eql?(o)
164
+ self == o
165
+ end
166
+
167
+ # Calculates hash code according to all attributes.
168
+ # @return [Integer] Hash code
169
+ def hash
170
+ [type, timestamp_ms, organization_id, parameters].hash
171
+ end
172
+
173
+ # Builds the object from hash
174
+ # @param [Hash] attributes Model attributes in the form of hash
175
+ # @return [Object] Returns the model itself
176
+ def self.build_from_hash(attributes)
177
+ new.build_from_hash(attributes)
178
+ end
179
+
180
+ # Builds the object from hash
181
+ # @param [Hash] attributes Model attributes in the form of hash
182
+ # @return [Object] Returns the model itself
183
+ def build_from_hash(attributes)
184
+ return nil unless attributes.is_a?(Hash)
185
+ self.class.openapi_types.each_pair do |key, type|
186
+ if type =~ /\AArray<(.*)>/i
187
+ # check to ensure the input is an array given that the attribute
188
+ # is documented as an array but the input is not
189
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
190
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
191
+ end
192
+ elsif !attributes[self.class.attribute_map[key]].nil?
193
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
194
+ elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
195
+ self.send("#{key}=", nil)
196
+ end
197
+ end
198
+
199
+ self
200
+ end
201
+
202
+ # Deserializes the data based on type
203
+ # @param string type Data type
204
+ # @param string value Value to be deserialized
205
+ # @return [Object] Deserialized data
206
+ def _deserialize(type, value)
207
+ case type.to_sym
208
+ when :DateTime
209
+ DateTime.parse(value)
210
+ when :Date
211
+ Date.parse(value)
212
+ when :String
213
+ value.to_s
214
+ when :Integer
215
+ value.to_i
216
+ when :Float
217
+ value.to_f
218
+ when :Boolean
219
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
220
+ true
221
+ else
222
+ false
223
+ end
224
+ when :Object
225
+ # generic object (usually a Hash), return directly
226
+ value
227
+ when /\AArray<(?<inner_type>.+)>\z/
228
+ inner_type = Regexp.last_match[:inner_type]
229
+ value.map { |v| _deserialize(inner_type, v) }
230
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
231
+ k_type = Regexp.last_match[:k_type]
232
+ v_type = Regexp.last_match[:v_type]
233
+ {}.tap do |hash|
234
+ value.each do |k, v|
235
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
236
+ end
237
+ end
238
+ else # model
239
+ TurnkeyClient.const_get(type).build_from_hash(value)
240
+ end
241
+ end
242
+
243
+ # Returns the string representation of the object
244
+ # @return [String] String presentation of the object
245
+ def to_s
246
+ to_hash.to_s
247
+ end
248
+
249
+ # to_body is an alias to to_hash (backward compatibility)
250
+ # @return [Hash] Returns the object in the form of hash
251
+ def to_body
252
+ to_hash
253
+ end
254
+
255
+ # Returns the object in the form of hash
256
+ # @return [Hash] Returns the object in the form of hash
257
+ def to_hash
258
+ hash = {}
259
+ self.class.attribute_map.each_pair do |attr, param|
260
+ value = self.send(attr)
261
+ if value.nil?
262
+ is_nullable = self.class.openapi_nullable.include?(attr)
263
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
264
+ end
265
+
266
+ hash[param] = _to_hash(value)
267
+ end
268
+ hash
269
+ end
270
+
271
+ # Outputs non-array value in the form of hash
272
+ # For object, use to_hash. Otherwise, just return the value
273
+ # @param [Object] value Any valid value
274
+ # @return [Hash] Returns the value in the form of hash
275
+ def _to_hash(value)
276
+ if value.is_a?(Array)
277
+ value.compact.map { |v| _to_hash(v) }
278
+ elsif value.is_a?(Hash)
279
+ {}.tap do |hash|
280
+ value.each { |k, v| hash[k] = _to_hash(v) }
281
+ end
282
+ elsif value.respond_to? :to_hash
283
+ value.to_hash
284
+ else
285
+ value
286
+ end
287
+ end end
288
+ end