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,210 @@
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 BootProofResponse
15
+ attr_accessor :boot_proof
16
+
17
+ # Attribute mapping from ruby-style variable name to JSON key.
18
+ def self.attribute_map
19
+ {
20
+ :'boot_proof' => :'bootProof'
21
+ }
22
+ end
23
+
24
+ # Attribute type mapping.
25
+ def self.openapi_types
26
+ {
27
+ :'boot_proof' => :'Object'
28
+ }
29
+ end
30
+
31
+ # List of attributes with nullable: true
32
+ def self.openapi_nullable
33
+ Set.new([
34
+ ])
35
+ end
36
+
37
+ # Initializes the object
38
+ # @param [Hash] attributes Model attributes in the form of hash
39
+ def initialize(attributes = {})
40
+ if (!attributes.is_a?(Hash))
41
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::BootProofResponse` initialize method"
42
+ end
43
+
44
+ # check to see if the attribute exists and convert string to symbol for hash key
45
+ attributes = attributes.each_with_object({}) { |(k, v), h|
46
+ if (!self.class.attribute_map.key?(k.to_sym))
47
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::BootProofResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
48
+ end
49
+ h[k.to_sym] = v
50
+ }
51
+
52
+ if attributes.key?(:'boot_proof')
53
+ self.boot_proof = attributes[:'boot_proof']
54
+ end
55
+ end
56
+
57
+ # Show invalid properties with the reasons. Usually used together with valid?
58
+ # @return Array for valid properties with the reasons
59
+ def list_invalid_properties
60
+ invalid_properties = Array.new
61
+ if @boot_proof.nil?
62
+ invalid_properties.push('invalid value for "boot_proof", boot_proof cannot be nil.')
63
+ end
64
+
65
+ invalid_properties
66
+ end
67
+
68
+ # Check to see if the all the properties in the model are valid
69
+ # @return true if the model is valid
70
+ def valid?
71
+ return false if @boot_proof.nil?
72
+ true
73
+ end
74
+
75
+ # Checks equality by comparing each attribute.
76
+ # @param [Object] Object to be compared
77
+ def ==(o)
78
+ return true if self.equal?(o)
79
+ self.class == o.class &&
80
+ boot_proof == o.boot_proof
81
+ end
82
+
83
+ # @see the `==` method
84
+ # @param [Object] Object to be compared
85
+ def eql?(o)
86
+ self == o
87
+ end
88
+
89
+ # Calculates hash code according to all attributes.
90
+ # @return [Integer] Hash code
91
+ def hash
92
+ [boot_proof].hash
93
+ end
94
+
95
+ # Builds the object from hash
96
+ # @param [Hash] attributes Model attributes in the form of hash
97
+ # @return [Object] Returns the model itself
98
+ def self.build_from_hash(attributes)
99
+ new.build_from_hash(attributes)
100
+ end
101
+
102
+ # Builds the object from hash
103
+ # @param [Hash] attributes Model attributes in the form of hash
104
+ # @return [Object] Returns the model itself
105
+ def build_from_hash(attributes)
106
+ return nil unless attributes.is_a?(Hash)
107
+ self.class.openapi_types.each_pair do |key, type|
108
+ if type =~ /\AArray<(.*)>/i
109
+ # check to ensure the input is an array given that the attribute
110
+ # is documented as an array but the input is not
111
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
112
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
113
+ end
114
+ elsif !attributes[self.class.attribute_map[key]].nil?
115
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
116
+ elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
117
+ self.send("#{key}=", nil)
118
+ end
119
+ end
120
+
121
+ self
122
+ end
123
+
124
+ # Deserializes the data based on type
125
+ # @param string type Data type
126
+ # @param string value Value to be deserialized
127
+ # @return [Object] Deserialized data
128
+ def _deserialize(type, value)
129
+ case type.to_sym
130
+ when :DateTime
131
+ DateTime.parse(value)
132
+ when :Date
133
+ Date.parse(value)
134
+ when :String
135
+ value.to_s
136
+ when :Integer
137
+ value.to_i
138
+ when :Float
139
+ value.to_f
140
+ when :Boolean
141
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
142
+ true
143
+ else
144
+ false
145
+ end
146
+ when :Object
147
+ # generic object (usually a Hash), return directly
148
+ value
149
+ when /\AArray<(?<inner_type>.+)>\z/
150
+ inner_type = Regexp.last_match[:inner_type]
151
+ value.map { |v| _deserialize(inner_type, v) }
152
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
153
+ k_type = Regexp.last_match[:k_type]
154
+ v_type = Regexp.last_match[:v_type]
155
+ {}.tap do |hash|
156
+ value.each do |k, v|
157
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
158
+ end
159
+ end
160
+ else # model
161
+ TurnkeyClient.const_get(type).build_from_hash(value)
162
+ end
163
+ end
164
+
165
+ # Returns the string representation of the object
166
+ # @return [String] String presentation of the object
167
+ def to_s
168
+ to_hash.to_s
169
+ end
170
+
171
+ # to_body is an alias to to_hash (backward compatibility)
172
+ # @return [Hash] Returns the object in the form of hash
173
+ def to_body
174
+ to_hash
175
+ end
176
+
177
+ # Returns the object in the form of hash
178
+ # @return [Hash] Returns the object in the form of hash
179
+ def to_hash
180
+ hash = {}
181
+ self.class.attribute_map.each_pair do |attr, param|
182
+ value = self.send(attr)
183
+ if value.nil?
184
+ is_nullable = self.class.openapi_nullable.include?(attr)
185
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
186
+ end
187
+
188
+ hash[param] = _to_hash(value)
189
+ end
190
+ hash
191
+ end
192
+
193
+ # Outputs non-array value in the form of hash
194
+ # For object, use to_hash. Otherwise, just return the value
195
+ # @param [Object] value Any valid value
196
+ # @return [Hash] Returns the value in the form of hash
197
+ def _to_hash(value)
198
+ if value.is_a?(Array)
199
+ value.compact.map { |v| _to_hash(v) }
200
+ elsif value.is_a?(Hash)
201
+ {}.tap do |hash|
202
+ value.each { |k, v| hash[k] = _to_hash(v) }
203
+ end
204
+ elsif value.respond_to? :to_hash
205
+ value.to_hash
206
+ else
207
+ value
208
+ end
209
+ end end
210
+ end
@@ -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 ClientSignature
15
+ # The public component of a cryptographic key pair used to create the signature.
16
+ attr_accessor :public_key
17
+
18
+ attr_accessor :scheme
19
+
20
+ # The message that was signed.
21
+ attr_accessor :message
22
+
23
+ # The cryptographic signature over the message.
24
+ attr_accessor :signature
25
+
26
+ # Attribute mapping from ruby-style variable name to JSON key.
27
+ def self.attribute_map
28
+ {
29
+ :'public_key' => :'publicKey',
30
+ :'scheme' => :'scheme',
31
+ :'message' => :'message',
32
+ :'signature' => :'signature'
33
+ }
34
+ end
35
+
36
+ # Attribute type mapping.
37
+ def self.openapi_types
38
+ {
39
+ :'public_key' => :'Object',
40
+ :'scheme' => :'Object',
41
+ :'message' => :'Object',
42
+ :'signature' => :'Object'
43
+ }
44
+ end
45
+
46
+ # List of attributes with nullable: true
47
+ def self.openapi_nullable
48
+ Set.new([
49
+ ])
50
+ end
51
+
52
+ # Initializes the object
53
+ # @param [Hash] attributes Model attributes in the form of hash
54
+ def initialize(attributes = {})
55
+ if (!attributes.is_a?(Hash))
56
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::ClientSignature` initialize method"
57
+ end
58
+
59
+ # check to see if the attribute exists and convert string to symbol for hash key
60
+ attributes = attributes.each_with_object({}) { |(k, v), h|
61
+ if (!self.class.attribute_map.key?(k.to_sym))
62
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::ClientSignature`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
63
+ end
64
+ h[k.to_sym] = v
65
+ }
66
+
67
+ if attributes.key?(:'public_key')
68
+ self.public_key = attributes[:'public_key']
69
+ end
70
+
71
+ if attributes.key?(:'scheme')
72
+ self.scheme = attributes[:'scheme']
73
+ end
74
+
75
+ if attributes.key?(:'message')
76
+ self.message = attributes[:'message']
77
+ end
78
+
79
+ if attributes.key?(:'signature')
80
+ self.signature = attributes[:'signature']
81
+ end
82
+ end
83
+
84
+ # Show invalid properties with the reasons. Usually used together with valid?
85
+ # @return Array for valid properties with the reasons
86
+ def list_invalid_properties
87
+ invalid_properties = Array.new
88
+ if @public_key.nil?
89
+ invalid_properties.push('invalid value for "public_key", public_key cannot be nil.')
90
+ end
91
+
92
+ if @scheme.nil?
93
+ invalid_properties.push('invalid value for "scheme", scheme cannot be nil.')
94
+ end
95
+
96
+ if @message.nil?
97
+ invalid_properties.push('invalid value for "message", message cannot be nil.')
98
+ end
99
+
100
+ if @signature.nil?
101
+ invalid_properties.push('invalid value for "signature", signature cannot be nil.')
102
+ end
103
+
104
+ invalid_properties
105
+ end
106
+
107
+ # Check to see if the all the properties in the model are valid
108
+ # @return true if the model is valid
109
+ def valid?
110
+ return false if @public_key.nil?
111
+ return false if @scheme.nil?
112
+ return false if @message.nil?
113
+ return false if @signature.nil?
114
+ true
115
+ end
116
+
117
+ # Checks equality by comparing each attribute.
118
+ # @param [Object] Object to be compared
119
+ def ==(o)
120
+ return true if self.equal?(o)
121
+ self.class == o.class &&
122
+ public_key == o.public_key &&
123
+ scheme == o.scheme &&
124
+ message == o.message &&
125
+ signature == o.signature
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
+ [public_key, scheme, message, signature].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,26 @@
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 ClientSignatureScheme
15
+ CLIENT_SIGNATURE_SCHEME_API_P256 = 'CLIENT_SIGNATURE_SCHEME_API_P256'.freeze
16
+
17
+ # Builds the enum from string
18
+ # @param [String] The enum value in the form of the string
19
+ # @return [String] The enum value
20
+ def build_from_hash(value)
21
+ constantValues = ClientSignatureScheme.constants.select { |c| ClientSignatureScheme::const_get(c) == value }
22
+ raise "Invalid ENUM value #{value} for class #ClientSignatureScheme" if constantValues.empty?
23
+ value
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,214 @@
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 CommonV1PolicyEvaluation
15
+ attr_accessor :policy_id
16
+
17
+ attr_accessor :outcome
18
+
19
+ # Attribute mapping from ruby-style variable name to JSON key.
20
+ def self.attribute_map
21
+ {
22
+ :'policy_id' => :'policyId',
23
+ :'outcome' => :'outcome'
24
+ }
25
+ end
26
+
27
+ # Attribute type mapping.
28
+ def self.openapi_types
29
+ {
30
+ :'policy_id' => :'Object',
31
+ :'outcome' => :'Object'
32
+ }
33
+ end
34
+
35
+ # List of attributes with nullable: true
36
+ def self.openapi_nullable
37
+ Set.new([
38
+ ])
39
+ end
40
+
41
+ # Initializes the object
42
+ # @param [Hash] attributes Model attributes in the form of hash
43
+ def initialize(attributes = {})
44
+ if (!attributes.is_a?(Hash))
45
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::CommonV1PolicyEvaluation` initialize method"
46
+ end
47
+
48
+ # check to see if the attribute exists and convert string to symbol for hash key
49
+ attributes = attributes.each_with_object({}) { |(k, v), h|
50
+ if (!self.class.attribute_map.key?(k.to_sym))
51
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::CommonV1PolicyEvaluation`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
52
+ end
53
+ h[k.to_sym] = v
54
+ }
55
+
56
+ if attributes.key?(:'policy_id')
57
+ self.policy_id = attributes[:'policy_id']
58
+ end
59
+
60
+ if attributes.key?(:'outcome')
61
+ self.outcome = attributes[:'outcome']
62
+ end
63
+ end
64
+
65
+ # Show invalid properties with the reasons. Usually used together with valid?
66
+ # @return Array for valid properties with the reasons
67
+ def list_invalid_properties
68
+ invalid_properties = Array.new
69
+ invalid_properties
70
+ end
71
+
72
+ # Check to see if the all the properties in the model are valid
73
+ # @return true if the model is valid
74
+ def valid?
75
+ true
76
+ end
77
+
78
+ # Checks equality by comparing each attribute.
79
+ # @param [Object] Object to be compared
80
+ def ==(o)
81
+ return true if self.equal?(o)
82
+ self.class == o.class &&
83
+ policy_id == o.policy_id &&
84
+ outcome == o.outcome
85
+ end
86
+
87
+ # @see the `==` method
88
+ # @param [Object] Object to be compared
89
+ def eql?(o)
90
+ self == o
91
+ end
92
+
93
+ # Calculates hash code according to all attributes.
94
+ # @return [Integer] Hash code
95
+ def hash
96
+ [policy_id, outcome].hash
97
+ end
98
+
99
+ # Builds the object from hash
100
+ # @param [Hash] attributes Model attributes in the form of hash
101
+ # @return [Object] Returns the model itself
102
+ def self.build_from_hash(attributes)
103
+ new.build_from_hash(attributes)
104
+ end
105
+
106
+ # Builds the object from hash
107
+ # @param [Hash] attributes Model attributes in the form of hash
108
+ # @return [Object] Returns the model itself
109
+ def build_from_hash(attributes)
110
+ return nil unless attributes.is_a?(Hash)
111
+ self.class.openapi_types.each_pair do |key, type|
112
+ if type =~ /\AArray<(.*)>/i
113
+ # check to ensure the input is an array given that the attribute
114
+ # is documented as an array but the input is not
115
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
116
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
117
+ end
118
+ elsif !attributes[self.class.attribute_map[key]].nil?
119
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
120
+ elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
121
+ self.send("#{key}=", nil)
122
+ end
123
+ end
124
+
125
+ self
126
+ end
127
+
128
+ # Deserializes the data based on type
129
+ # @param string type Data type
130
+ # @param string value Value to be deserialized
131
+ # @return [Object] Deserialized data
132
+ def _deserialize(type, value)
133
+ case type.to_sym
134
+ when :DateTime
135
+ DateTime.parse(value)
136
+ when :Date
137
+ Date.parse(value)
138
+ when :String
139
+ value.to_s
140
+ when :Integer
141
+ value.to_i
142
+ when :Float
143
+ value.to_f
144
+ when :Boolean
145
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
146
+ true
147
+ else
148
+ false
149
+ end
150
+ when :Object
151
+ # generic object (usually a Hash), return directly
152
+ value
153
+ when /\AArray<(?<inner_type>.+)>\z/
154
+ inner_type = Regexp.last_match[:inner_type]
155
+ value.map { |v| _deserialize(inner_type, v) }
156
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
157
+ k_type = Regexp.last_match[:k_type]
158
+ v_type = Regexp.last_match[:v_type]
159
+ {}.tap do |hash|
160
+ value.each do |k, v|
161
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
162
+ end
163
+ end
164
+ else # model
165
+ TurnkeyClient.const_get(type).build_from_hash(value)
166
+ end
167
+ end
168
+
169
+ # Returns the string representation of the object
170
+ # @return [String] String presentation of the object
171
+ def to_s
172
+ to_hash.to_s
173
+ end
174
+
175
+ # to_body is an alias to to_hash (backward compatibility)
176
+ # @return [Hash] Returns the object in the form of hash
177
+ def to_body
178
+ to_hash
179
+ end
180
+
181
+ # Returns the object in the form of hash
182
+ # @return [Hash] Returns the object in the form of hash
183
+ def to_hash
184
+ hash = {}
185
+ self.class.attribute_map.each_pair do |attr, param|
186
+ value = self.send(attr)
187
+ if value.nil?
188
+ is_nullable = self.class.openapi_nullable.include?(attr)
189
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
190
+ end
191
+
192
+ hash[param] = _to_hash(value)
193
+ end
194
+ hash
195
+ end
196
+
197
+ # Outputs non-array value in the form of hash
198
+ # For object, use to_hash. Otherwise, just return the value
199
+ # @param [Object] value Any valid value
200
+ # @return [Hash] Returns the value in the form of hash
201
+ def _to_hash(value)
202
+ if value.is_a?(Array)
203
+ value.compact.map { |v| _to_hash(v) }
204
+ elsif value.is_a?(Hash)
205
+ {}.tap do |hash|
206
+ value.each { |k, v| hash[k] = _to_hash(v) }
207
+ end
208
+ elsif value.respond_to? :to_hash
209
+ value.to_hash
210
+ else
211
+ value
212
+ end
213
+ end end
214
+ end