turnkey_client 0.0.15 → 0.0.18

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 (171) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +39 -0
  3. data/.rspec +2 -0
  4. data/.swagger-codegen/VERSION +1 -0
  5. data/.swagger-codegen-ignore +23 -0
  6. data/lib/turnkey_client/api/app_proof_api.rb +4 -4
  7. data/lib/turnkey_client/api/broadcasting_api.rb +251 -0
  8. data/lib/turnkey_client/api/on_ramp_api.rb +290 -0
  9. data/lib/turnkey_client/api/policies_api.rb +58 -0
  10. data/lib/turnkey_client/api/send_transactions_api.rb +77 -0
  11. data/lib/turnkey_client/api/wallets_api.rb +174 -0
  12. data/lib/turnkey_client/models/activity.rb +1 -1
  13. data/lib/turnkey_client/models/activity_type.rb +16 -0
  14. data/lib/turnkey_client/models/approve_activity_request.rb +14 -4
  15. data/lib/turnkey_client/models/asset_balance.rb +255 -0
  16. data/lib/turnkey_client/models/asset_balance_display.rb +216 -0
  17. data/lib/turnkey_client/models/asset_metadata.rb +246 -0
  18. data/lib/turnkey_client/models/client_signature.rb +255 -0
  19. data/lib/turnkey_client/models/client_signature_scheme.rb +26 -0
  20. data/lib/turnkey_client/models/create_api_keys_request.rb +14 -4
  21. data/lib/turnkey_client/models/create_authenticators_request.rb +14 -4
  22. data/lib/turnkey_client/models/create_fiat_on_ramp_credential_intent.rb +272 -0
  23. data/lib/turnkey_client/models/create_fiat_on_ramp_credential_request.rb +298 -0
  24. data/lib/turnkey_client/models/create_fiat_on_ramp_credential_result.rb +211 -0
  25. data/lib/turnkey_client/models/create_invitations_request.rb +14 -4
  26. data/lib/turnkey_client/models/create_oauth2_credential_request.rb +14 -4
  27. data/lib/turnkey_client/models/create_oauth_providers_request.rb +14 -4
  28. data/lib/turnkey_client/models/create_policies_request.rb +14 -4
  29. data/lib/turnkey_client/models/create_policy_intent_v3.rb +6 -0
  30. data/lib/turnkey_client/models/create_policy_request.rb +14 -4
  31. data/lib/turnkey_client/models/create_private_key_tag_request.rb +14 -4
  32. data/lib/turnkey_client/models/create_private_keys_request.rb +14 -4
  33. data/lib/turnkey_client/models/create_read_only_session_request.rb +14 -4
  34. data/lib/turnkey_client/models/create_read_write_session_request.rb +14 -4
  35. data/lib/turnkey_client/models/create_smart_contract_interface_intent.rb +1 -1
  36. data/lib/turnkey_client/models/create_smart_contract_interface_request.rb +14 -4
  37. data/lib/turnkey_client/models/create_sub_organization_intent_v7.rb +14 -5
  38. data/lib/turnkey_client/models/create_sub_organization_request.rb +14 -4
  39. data/lib/turnkey_client/models/create_tvc_app_intent.rb +277 -0
  40. data/lib/turnkey_client/models/create_tvc_app_result.rb +258 -0
  41. data/lib/turnkey_client/models/create_tvc_deployment_intent.rb +368 -0
  42. data/lib/turnkey_client/models/create_tvc_deployment_result.rb +226 -0
  43. data/lib/turnkey_client/models/create_tvc_manifest_approvals_intent.rb +228 -0
  44. data/lib/turnkey_client/models/create_tvc_manifest_approvals_result.rb +213 -0
  45. data/lib/turnkey_client/models/create_user_tag_request.rb +14 -4
  46. data/lib/turnkey_client/models/create_users_request.rb +14 -4
  47. data/lib/turnkey_client/models/create_wallet_accounts_intent.rb +15 -4
  48. data/lib/turnkey_client/models/create_wallet_accounts_request.rb +14 -4
  49. data/lib/turnkey_client/models/create_wallet_request.rb +14 -4
  50. data/lib/turnkey_client/models/curve.rb +1 -0
  51. data/lib/turnkey_client/models/custom_revert_error.rb +218 -0
  52. data/lib/turnkey_client/models/data_v1_signature_scheme.rb +26 -0
  53. data/lib/turnkey_client/models/delete_api_keys_request.rb +14 -4
  54. data/lib/turnkey_client/models/delete_authenticators_request.rb +14 -4
  55. data/lib/turnkey_client/models/delete_fiat_on_ramp_credential_intent.rb +211 -0
  56. data/lib/turnkey_client/models/delete_fiat_on_ramp_credential_request.rb +298 -0
  57. data/lib/turnkey_client/models/delete_fiat_on_ramp_credential_result.rb +211 -0
  58. data/lib/turnkey_client/models/delete_invitation_request.rb +14 -4
  59. data/lib/turnkey_client/models/delete_oauth2_credential_request.rb +14 -4
  60. data/lib/turnkey_client/models/delete_oauth_providers_request.rb +14 -4
  61. data/lib/turnkey_client/models/delete_policies_intent.rb +213 -0
  62. data/lib/turnkey_client/models/delete_policies_request.rb +298 -0
  63. data/lib/turnkey_client/models/delete_policies_result.rb +213 -0
  64. data/lib/turnkey_client/models/delete_policy_request.rb +14 -4
  65. data/lib/turnkey_client/models/delete_private_key_tags_request.rb +14 -4
  66. data/lib/turnkey_client/models/delete_private_keys_request.rb +14 -4
  67. data/lib/turnkey_client/models/delete_smart_contract_interface_request.rb +14 -4
  68. data/lib/turnkey_client/models/delete_sub_organization_request.rb +14 -4
  69. data/lib/turnkey_client/models/delete_user_tags_request.rb +14 -4
  70. data/lib/turnkey_client/models/delete_users_request.rb +14 -4
  71. data/lib/turnkey_client/models/delete_wallet_accounts_intent.rb +224 -0
  72. data/lib/turnkey_client/models/delete_wallet_accounts_request.rb +298 -0
  73. data/lib/turnkey_client/models/delete_wallet_accounts_result.rb +213 -0
  74. data/lib/turnkey_client/models/delete_wallets_request.rb +14 -4
  75. data/lib/turnkey_client/models/email_auth_customization_params.rb +255 -0
  76. data/lib/turnkey_client/models/email_auth_intent_v3.rb +306 -0
  77. data/lib/turnkey_client/models/email_auth_request.rb +16 -6
  78. data/lib/turnkey_client/models/email_customization_params_v2.rb +240 -0
  79. data/lib/turnkey_client/models/eth_send_raw_transaction_intent.rb +260 -0
  80. data/lib/turnkey_client/models/eth_send_raw_transaction_result.rb +211 -0
  81. data/lib/turnkey_client/models/eth_send_transaction_intent.rb +363 -0
  82. data/lib/turnkey_client/models/eth_send_transaction_request.rb +298 -0
  83. data/lib/turnkey_client/models/eth_send_transaction_result.rb +211 -0
  84. data/lib/turnkey_client/models/eth_send_transaction_status.rb +207 -0
  85. data/lib/turnkey_client/models/export_private_key_request.rb +14 -4
  86. data/lib/turnkey_client/models/export_wallet_account_request.rb +14 -4
  87. data/lib/turnkey_client/models/export_wallet_request.rb +14 -4
  88. data/lib/turnkey_client/models/fiat_on_ramp_credential.rb +330 -0
  89. data/lib/turnkey_client/models/get_gas_usage_request.rb +211 -0
  90. data/lib/turnkey_client/models/get_gas_usage_response.rb +241 -0
  91. data/lib/turnkey_client/models/get_nonces_request.rb +295 -0
  92. data/lib/turnkey_client/models/get_nonces_response.rb +218 -0
  93. data/lib/turnkey_client/models/get_on_ramp_transaction_status_request.rb +237 -0
  94. data/lib/turnkey_client/models/get_on_ramp_transaction_status_response.rb +211 -0
  95. data/lib/turnkey_client/models/get_send_transaction_status_request.rb +226 -0
  96. data/lib/turnkey_client/models/get_send_transaction_status_response.rb +240 -0
  97. data/lib/turnkey_client/models/get_wallet_address_balances_request.rb +275 -0
  98. data/lib/turnkey_client/models/get_wallet_address_balances_response.rb +208 -0
  99. data/lib/turnkey_client/models/import_private_key_request.rb +14 -4
  100. data/lib/turnkey_client/models/import_wallet_request.rb +14 -4
  101. data/lib/turnkey_client/models/init_fiat_on_ramp_request.rb +14 -4
  102. data/lib/turnkey_client/models/init_import_private_key_request.rb +14 -4
  103. data/lib/turnkey_client/models/init_import_wallet_request.rb +14 -4
  104. data/lib/turnkey_client/models/init_otp_auth_intent_v3.rb +336 -0
  105. data/lib/turnkey_client/models/init_otp_auth_request.rb +16 -6
  106. data/lib/turnkey_client/models/init_otp_intent_v2.rb +336 -0
  107. data/lib/turnkey_client/models/init_otp_request.rb +16 -6
  108. data/lib/turnkey_client/models/init_user_email_recovery_intent.rb +37 -4
  109. data/lib/turnkey_client/models/init_user_email_recovery_intent_v2.rb +284 -0
  110. data/lib/turnkey_client/models/init_user_email_recovery_request.rb +16 -6
  111. data/lib/turnkey_client/models/intent.rb +148 -4
  112. data/lib/turnkey_client/models/list_fiat_on_ramp_credentials_request.rb +211 -0
  113. data/lib/turnkey_client/models/list_fiat_on_ramp_credentials_response.rb +212 -0
  114. data/lib/turnkey_client/models/list_supported_assets_request.rb +260 -0
  115. data/lib/turnkey_client/models/list_supported_assets_response.rb +208 -0
  116. data/lib/turnkey_client/models/native_revert_error.rb +229 -0
  117. data/lib/turnkey_client/models/oauth2_authenticate_request.rb +14 -4
  118. data/lib/turnkey_client/models/oauth_login_request.rb +14 -4
  119. data/lib/turnkey_client/models/oauth_request.rb +14 -4
  120. data/lib/turnkey_client/models/otp_auth_request.rb +14 -4
  121. data/lib/turnkey_client/models/otp_login_intent.rb +0 -2
  122. data/lib/turnkey_client/models/otp_login_request.rb +14 -4
  123. data/lib/turnkey_client/models/recover_user_request.rb +14 -4
  124. data/lib/turnkey_client/models/reject_activity_request.rb +14 -4
  125. data/lib/turnkey_client/models/remove_organization_feature_request.rb +14 -4
  126. data/lib/turnkey_client/models/result.rb +112 -4
  127. data/lib/turnkey_client/models/revert_chain_entry.rb +253 -0
  128. data/lib/turnkey_client/models/set_organization_feature_request.rb +14 -4
  129. data/lib/turnkey_client/models/sign_raw_payload_request.rb +14 -4
  130. data/lib/turnkey_client/models/sign_raw_payloads_request.rb +14 -4
  131. data/lib/turnkey_client/models/sign_transaction_request.rb +14 -4
  132. data/lib/turnkey_client/models/sol_send_transaction_intent.rb +297 -0
  133. data/lib/turnkey_client/models/sol_send_transaction_request.rb +298 -0
  134. data/lib/turnkey_client/models/sol_send_transaction_result.rb +211 -0
  135. data/lib/turnkey_client/models/stamp_login_request.rb +14 -4
  136. data/lib/turnkey_client/models/transaction_type.rb +2 -0
  137. data/lib/turnkey_client/models/tvc_manifest_approval.rb +226 -0
  138. data/lib/turnkey_client/models/tvc_operator_params.rb +226 -0
  139. data/lib/turnkey_client/models/tvc_operator_set_params.rb +250 -0
  140. data/lib/turnkey_client/models/tx_error.rb +218 -0
  141. data/lib/turnkey_client/models/unknown_revert_error.rb +218 -0
  142. data/lib/turnkey_client/models/update_auth_proxy_config_intent.rb +27 -5
  143. data/lib/turnkey_client/models/update_fiat_on_ramp_credential_intent.rb +277 -0
  144. data/lib/turnkey_client/models/update_fiat_on_ramp_credential_request.rb +298 -0
  145. data/lib/turnkey_client/models/update_fiat_on_ramp_credential_result.rb +211 -0
  146. data/lib/turnkey_client/models/update_oauth2_credential_request.rb +14 -4
  147. data/lib/turnkey_client/models/update_policy_request.rb +14 -4
  148. data/lib/turnkey_client/models/update_private_key_tag_request.rb +14 -4
  149. data/lib/turnkey_client/models/update_root_quorum_request.rb +14 -4
  150. data/lib/turnkey_client/models/update_user_email_request.rb +14 -4
  151. data/lib/turnkey_client/models/update_user_name_request.rb +14 -4
  152. data/lib/turnkey_client/models/update_user_phone_number_request.rb +14 -4
  153. data/lib/turnkey_client/models/update_user_request.rb +14 -4
  154. data/lib/turnkey_client/models/update_user_tag_request.rb +14 -4
  155. data/lib/turnkey_client/models/update_wallet_request.rb +14 -4
  156. data/lib/turnkey_client/models/upsert_gas_usage_config_intent.rb +252 -0
  157. data/lib/turnkey_client/models/upsert_gas_usage_config_result.rb +211 -0
  158. data/lib/turnkey_client/models/verify_otp_request.rb +14 -4
  159. data/lib/turnkey_client/version.rb +1 -1
  160. data/lib/turnkey_client.rb +70 -2
  161. data/turnkey_client.gemspec +1 -1
  162. metadata +76 -12
  163. data/turnkey_client-0.0.12.gem +0 -0
  164. data/turnkey_client-0.0.13.gem +0 -0
  165. data/turnkey_client-0.0.14.gem +0 -0
  166. data/turnkey_client-0.0.2.gem +0 -0
  167. data/turnkey_client-0.0.3.gem +0 -0
  168. data/turnkey_client-0.0.4.gem +0 -0
  169. data/turnkey_client-0.0.7.gem +0 -0
  170. data/turnkey_client-0.0.8.gem +0 -0
  171. data/turnkey_client-0.0.9.gem +0 -0
@@ -0,0 +1,368 @@
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 CreateTvcDeploymentIntent
15
+ # The unique identifier of the to-be-deployed TVC application
16
+ attr_accessor :app_id
17
+
18
+ # The QuorumOS version to use to deploy this application
19
+ attr_accessor :qos_version
20
+
21
+ # URL of the container containing the pivot binary
22
+ attr_accessor :pivot_container_image_url
23
+
24
+ # Location of the binary in the pivot container
25
+ attr_accessor :pivot_path
26
+
27
+ # Arguments to pass to the pivot binary at startup. Encoded as a list of strings, for example [\"--foo\", \"bar\"]
28
+ attr_accessor :pivot_args
29
+
30
+ # Digest of the pivot binary in the pivot container. This value will be inserted in the QOS manifest to ensure application integrity.
31
+ attr_accessor :expected_pivot_digest
32
+
33
+ # URL of the container containing the host binary
34
+ attr_accessor :host_container_image_url
35
+
36
+ # Location of the binary inside the host container
37
+ attr_accessor :host_path
38
+
39
+ # Arguments to pass to the host binary at startup. Encoded as a list of strings, for example [\"--foo\", \"bar\"]
40
+ attr_accessor :host_args
41
+
42
+ # Optional nonce to ensure uniqueness of the deployment manifest. If not provided, it defaults to the current Unix timestamp in seconds.
43
+ attr_accessor :nonce
44
+
45
+ # Optional encrypted pull secret to authorize Turnkey to pull the pivot container image. If your image is public, leave this empty.
46
+ attr_accessor :pivot_container_encrypted_pull_secret
47
+
48
+ # Optional encrypted pull secret to authorize Turnkey to pull the host container image. If your image is public, leave this empty.
49
+ attr_accessor :host_container_encrypted_pull_secret
50
+
51
+ # Attribute mapping from ruby-style variable name to JSON key.
52
+ def self.attribute_map
53
+ {
54
+ :'app_id' => :'appId',
55
+ :'qos_version' => :'qosVersion',
56
+ :'pivot_container_image_url' => :'pivotContainerImageUrl',
57
+ :'pivot_path' => :'pivotPath',
58
+ :'pivot_args' => :'pivotArgs',
59
+ :'expected_pivot_digest' => :'expectedPivotDigest',
60
+ :'host_container_image_url' => :'hostContainerImageUrl',
61
+ :'host_path' => :'hostPath',
62
+ :'host_args' => :'hostArgs',
63
+ :'nonce' => :'nonce',
64
+ :'pivot_container_encrypted_pull_secret' => :'pivotContainerEncryptedPullSecret',
65
+ :'host_container_encrypted_pull_secret' => :'hostContainerEncryptedPullSecret'
66
+ }
67
+ end
68
+
69
+ # Attribute type mapping.
70
+ def self.openapi_types
71
+ {
72
+ :'app_id' => :'Object',
73
+ :'qos_version' => :'Object',
74
+ :'pivot_container_image_url' => :'Object',
75
+ :'pivot_path' => :'Object',
76
+ :'pivot_args' => :'Object',
77
+ :'expected_pivot_digest' => :'Object',
78
+ :'host_container_image_url' => :'Object',
79
+ :'host_path' => :'Object',
80
+ :'host_args' => :'Object',
81
+ :'nonce' => :'Object',
82
+ :'pivot_container_encrypted_pull_secret' => :'Object',
83
+ :'host_container_encrypted_pull_secret' => :'Object'
84
+ }
85
+ end
86
+
87
+ # List of attributes with nullable: true
88
+ def self.openapi_nullable
89
+ Set.new([
90
+ :'nonce',
91
+ :'pivot_container_encrypted_pull_secret',
92
+ :'host_container_encrypted_pull_secret'
93
+ ])
94
+ end
95
+
96
+ # Initializes the object
97
+ # @param [Hash] attributes Model attributes in the form of hash
98
+ def initialize(attributes = {})
99
+ if (!attributes.is_a?(Hash))
100
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::CreateTvcDeploymentIntent` initialize method"
101
+ end
102
+
103
+ # check to see if the attribute exists and convert string to symbol for hash key
104
+ attributes = attributes.each_with_object({}) { |(k, v), h|
105
+ if (!self.class.attribute_map.key?(k.to_sym))
106
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::CreateTvcDeploymentIntent`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
107
+ end
108
+ h[k.to_sym] = v
109
+ }
110
+
111
+ if attributes.key?(:'app_id')
112
+ self.app_id = attributes[:'app_id']
113
+ end
114
+
115
+ if attributes.key?(:'qos_version')
116
+ self.qos_version = attributes[:'qos_version']
117
+ end
118
+
119
+ if attributes.key?(:'pivot_container_image_url')
120
+ self.pivot_container_image_url = attributes[:'pivot_container_image_url']
121
+ end
122
+
123
+ if attributes.key?(:'pivot_path')
124
+ self.pivot_path = attributes[:'pivot_path']
125
+ end
126
+
127
+ if attributes.key?(:'pivot_args')
128
+ if (value = attributes[:'pivot_args']).is_a?(Array)
129
+ self.pivot_args = value
130
+ end
131
+ end
132
+
133
+ if attributes.key?(:'expected_pivot_digest')
134
+ self.expected_pivot_digest = attributes[:'expected_pivot_digest']
135
+ end
136
+
137
+ if attributes.key?(:'host_container_image_url')
138
+ self.host_container_image_url = attributes[:'host_container_image_url']
139
+ end
140
+
141
+ if attributes.key?(:'host_path')
142
+ self.host_path = attributes[:'host_path']
143
+ end
144
+
145
+ if attributes.key?(:'host_args')
146
+ if (value = attributes[:'host_args']).is_a?(Array)
147
+ self.host_args = value
148
+ end
149
+ end
150
+
151
+ if attributes.key?(:'nonce')
152
+ self.nonce = attributes[:'nonce']
153
+ end
154
+
155
+ if attributes.key?(:'pivot_container_encrypted_pull_secret')
156
+ self.pivot_container_encrypted_pull_secret = attributes[:'pivot_container_encrypted_pull_secret']
157
+ end
158
+
159
+ if attributes.key?(:'host_container_encrypted_pull_secret')
160
+ self.host_container_encrypted_pull_secret = attributes[:'host_container_encrypted_pull_secret']
161
+ end
162
+ end
163
+
164
+ # Show invalid properties with the reasons. Usually used together with valid?
165
+ # @return Array for valid properties with the reasons
166
+ def list_invalid_properties
167
+ invalid_properties = Array.new
168
+ if @app_id.nil?
169
+ invalid_properties.push('invalid value for "app_id", app_id cannot be nil.')
170
+ end
171
+
172
+ if @qos_version.nil?
173
+ invalid_properties.push('invalid value for "qos_version", qos_version cannot be nil.')
174
+ end
175
+
176
+ if @pivot_container_image_url.nil?
177
+ invalid_properties.push('invalid value for "pivot_container_image_url", pivot_container_image_url cannot be nil.')
178
+ end
179
+
180
+ if @pivot_path.nil?
181
+ invalid_properties.push('invalid value for "pivot_path", pivot_path cannot be nil.')
182
+ end
183
+
184
+ if @pivot_args.nil?
185
+ invalid_properties.push('invalid value for "pivot_args", pivot_args cannot be nil.')
186
+ end
187
+
188
+ if @expected_pivot_digest.nil?
189
+ invalid_properties.push('invalid value for "expected_pivot_digest", expected_pivot_digest cannot be nil.')
190
+ end
191
+
192
+ if @host_container_image_url.nil?
193
+ invalid_properties.push('invalid value for "host_container_image_url", host_container_image_url cannot be nil.')
194
+ end
195
+
196
+ if @host_path.nil?
197
+ invalid_properties.push('invalid value for "host_path", host_path cannot be nil.')
198
+ end
199
+
200
+ if @host_args.nil?
201
+ invalid_properties.push('invalid value for "host_args", host_args cannot be nil.')
202
+ end
203
+
204
+ invalid_properties
205
+ end
206
+
207
+ # Check to see if the all the properties in the model are valid
208
+ # @return true if the model is valid
209
+ def valid?
210
+ return false if @app_id.nil?
211
+ return false if @qos_version.nil?
212
+ return false if @pivot_container_image_url.nil?
213
+ return false if @pivot_path.nil?
214
+ return false if @pivot_args.nil?
215
+ return false if @expected_pivot_digest.nil?
216
+ return false if @host_container_image_url.nil?
217
+ return false if @host_path.nil?
218
+ return false if @host_args.nil?
219
+ true
220
+ end
221
+
222
+ # Checks equality by comparing each attribute.
223
+ # @param [Object] Object to be compared
224
+ def ==(o)
225
+ return true if self.equal?(o)
226
+ self.class == o.class &&
227
+ app_id == o.app_id &&
228
+ qos_version == o.qos_version &&
229
+ pivot_container_image_url == o.pivot_container_image_url &&
230
+ pivot_path == o.pivot_path &&
231
+ pivot_args == o.pivot_args &&
232
+ expected_pivot_digest == o.expected_pivot_digest &&
233
+ host_container_image_url == o.host_container_image_url &&
234
+ host_path == o.host_path &&
235
+ host_args == o.host_args &&
236
+ nonce == o.nonce &&
237
+ pivot_container_encrypted_pull_secret == o.pivot_container_encrypted_pull_secret &&
238
+ host_container_encrypted_pull_secret == o.host_container_encrypted_pull_secret
239
+ end
240
+
241
+ # @see the `==` method
242
+ # @param [Object] Object to be compared
243
+ def eql?(o)
244
+ self == o
245
+ end
246
+
247
+ # Calculates hash code according to all attributes.
248
+ # @return [Integer] Hash code
249
+ def hash
250
+ [app_id, qos_version, pivot_container_image_url, pivot_path, pivot_args, expected_pivot_digest, host_container_image_url, host_path, host_args, nonce, pivot_container_encrypted_pull_secret, host_container_encrypted_pull_secret].hash
251
+ end
252
+
253
+ # Builds the object from hash
254
+ # @param [Hash] attributes Model attributes in the form of hash
255
+ # @return [Object] Returns the model itself
256
+ def self.build_from_hash(attributes)
257
+ new.build_from_hash(attributes)
258
+ end
259
+
260
+ # Builds the object from hash
261
+ # @param [Hash] attributes Model attributes in the form of hash
262
+ # @return [Object] Returns the model itself
263
+ def build_from_hash(attributes)
264
+ return nil unless attributes.is_a?(Hash)
265
+ self.class.openapi_types.each_pair do |key, type|
266
+ if type =~ /\AArray<(.*)>/i
267
+ # check to ensure the input is an array given that the attribute
268
+ # is documented as an array but the input is not
269
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
270
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
271
+ end
272
+ elsif !attributes[self.class.attribute_map[key]].nil?
273
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
274
+ elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
275
+ self.send("#{key}=", nil)
276
+ end
277
+ end
278
+
279
+ self
280
+ end
281
+
282
+ # Deserializes the data based on type
283
+ # @param string type Data type
284
+ # @param string value Value to be deserialized
285
+ # @return [Object] Deserialized data
286
+ def _deserialize(type, value)
287
+ case type.to_sym
288
+ when :DateTime
289
+ DateTime.parse(value)
290
+ when :Date
291
+ Date.parse(value)
292
+ when :String
293
+ value.to_s
294
+ when :Integer
295
+ value.to_i
296
+ when :Float
297
+ value.to_f
298
+ when :Boolean
299
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
300
+ true
301
+ else
302
+ false
303
+ end
304
+ when :Object
305
+ # generic object (usually a Hash), return directly
306
+ value
307
+ when /\AArray<(?<inner_type>.+)>\z/
308
+ inner_type = Regexp.last_match[:inner_type]
309
+ value.map { |v| _deserialize(inner_type, v) }
310
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
311
+ k_type = Regexp.last_match[:k_type]
312
+ v_type = Regexp.last_match[:v_type]
313
+ {}.tap do |hash|
314
+ value.each do |k, v|
315
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
316
+ end
317
+ end
318
+ else # model
319
+ TurnkeyClient.const_get(type).build_from_hash(value)
320
+ end
321
+ end
322
+
323
+ # Returns the string representation of the object
324
+ # @return [String] String presentation of the object
325
+ def to_s
326
+ to_hash.to_s
327
+ end
328
+
329
+ # to_body is an alias to to_hash (backward compatibility)
330
+ # @return [Hash] Returns the object in the form of hash
331
+ def to_body
332
+ to_hash
333
+ end
334
+
335
+ # Returns the object in the form of hash
336
+ # @return [Hash] Returns the object in the form of hash
337
+ def to_hash
338
+ hash = {}
339
+ self.class.attribute_map.each_pair do |attr, param|
340
+ value = self.send(attr)
341
+ if value.nil?
342
+ is_nullable = self.class.openapi_nullable.include?(attr)
343
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
344
+ end
345
+
346
+ hash[param] = _to_hash(value)
347
+ end
348
+ hash
349
+ end
350
+
351
+ # Outputs non-array value in the form of hash
352
+ # For object, use to_hash. Otherwise, just return the value
353
+ # @param [Object] value Any valid value
354
+ # @return [Hash] Returns the value in the form of hash
355
+ def _to_hash(value)
356
+ if value.is_a?(Array)
357
+ value.compact.map { |v| _to_hash(v) }
358
+ elsif value.is_a?(Hash)
359
+ {}.tap do |hash|
360
+ value.each { |k, v| hash[k] = _to_hash(v) }
361
+ end
362
+ elsif value.respond_to? :to_hash
363
+ value.to_hash
364
+ else
365
+ value
366
+ end
367
+ end end
368
+ end
@@ -0,0 +1,226 @@
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 CreateTvcDeploymentResult
15
+ # The unique identifier for the TVC deployment
16
+ attr_accessor :deployment_id
17
+
18
+ # The unique identifier for the TVC manifest
19
+ attr_accessor :manifest_id
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'deployment_id' => :'deploymentId',
25
+ :'manifest_id' => :'manifestId'
26
+ }
27
+ end
28
+
29
+ # Attribute type mapping.
30
+ def self.openapi_types
31
+ {
32
+ :'deployment_id' => :'Object',
33
+ :'manifest_id' => :'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::CreateTvcDeploymentResult` 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::CreateTvcDeploymentResult`. 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?(:'deployment_id')
59
+ self.deployment_id = attributes[:'deployment_id']
60
+ end
61
+
62
+ if attributes.key?(:'manifest_id')
63
+ self.manifest_id = attributes[:'manifest_id']
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
+ if @deployment_id.nil?
72
+ invalid_properties.push('invalid value for "deployment_id", deployment_id cannot be nil.')
73
+ end
74
+
75
+ if @manifest_id.nil?
76
+ invalid_properties.push('invalid value for "manifest_id", manifest_id cannot be nil.')
77
+ end
78
+
79
+ invalid_properties
80
+ end
81
+
82
+ # Check to see if the all the properties in the model are valid
83
+ # @return true if the model is valid
84
+ def valid?
85
+ return false if @deployment_id.nil?
86
+ return false if @manifest_id.nil?
87
+ true
88
+ end
89
+
90
+ # Checks equality by comparing each attribute.
91
+ # @param [Object] Object to be compared
92
+ def ==(o)
93
+ return true if self.equal?(o)
94
+ self.class == o.class &&
95
+ deployment_id == o.deployment_id &&
96
+ manifest_id == o.manifest_id
97
+ end
98
+
99
+ # @see the `==` method
100
+ # @param [Object] Object to be compared
101
+ def eql?(o)
102
+ self == o
103
+ end
104
+
105
+ # Calculates hash code according to all attributes.
106
+ # @return [Integer] Hash code
107
+ def hash
108
+ [deployment_id, manifest_id].hash
109
+ end
110
+
111
+ # Builds the object from hash
112
+ # @param [Hash] attributes Model attributes in the form of hash
113
+ # @return [Object] Returns the model itself
114
+ def self.build_from_hash(attributes)
115
+ new.build_from_hash(attributes)
116
+ end
117
+
118
+ # Builds the object from hash
119
+ # @param [Hash] attributes Model attributes in the form of hash
120
+ # @return [Object] Returns the model itself
121
+ def build_from_hash(attributes)
122
+ return nil unless attributes.is_a?(Hash)
123
+ self.class.openapi_types.each_pair do |key, type|
124
+ if type =~ /\AArray<(.*)>/i
125
+ # check to ensure the input is an array given that the attribute
126
+ # is documented as an array but the input is not
127
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
128
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
129
+ end
130
+ elsif !attributes[self.class.attribute_map[key]].nil?
131
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
132
+ elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
133
+ self.send("#{key}=", nil)
134
+ end
135
+ end
136
+
137
+ self
138
+ end
139
+
140
+ # Deserializes the data based on type
141
+ # @param string type Data type
142
+ # @param string value Value to be deserialized
143
+ # @return [Object] Deserialized data
144
+ def _deserialize(type, value)
145
+ case type.to_sym
146
+ when :DateTime
147
+ DateTime.parse(value)
148
+ when :Date
149
+ Date.parse(value)
150
+ when :String
151
+ value.to_s
152
+ when :Integer
153
+ value.to_i
154
+ when :Float
155
+ value.to_f
156
+ when :Boolean
157
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
158
+ true
159
+ else
160
+ false
161
+ end
162
+ when :Object
163
+ # generic object (usually a Hash), return directly
164
+ value
165
+ when /\AArray<(?<inner_type>.+)>\z/
166
+ inner_type = Regexp.last_match[:inner_type]
167
+ value.map { |v| _deserialize(inner_type, v) }
168
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
169
+ k_type = Regexp.last_match[:k_type]
170
+ v_type = Regexp.last_match[:v_type]
171
+ {}.tap do |hash|
172
+ value.each do |k, v|
173
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
174
+ end
175
+ end
176
+ else # model
177
+ TurnkeyClient.const_get(type).build_from_hash(value)
178
+ end
179
+ end
180
+
181
+ # Returns the string representation of the object
182
+ # @return [String] String presentation of the object
183
+ def to_s
184
+ to_hash.to_s
185
+ end
186
+
187
+ # to_body is an alias to to_hash (backward compatibility)
188
+ # @return [Hash] Returns the object in the form of hash
189
+ def to_body
190
+ to_hash
191
+ end
192
+
193
+ # Returns the object in the form of hash
194
+ # @return [Hash] Returns the object in the form of hash
195
+ def to_hash
196
+ hash = {}
197
+ self.class.attribute_map.each_pair do |attr, param|
198
+ value = self.send(attr)
199
+ if value.nil?
200
+ is_nullable = self.class.openapi_nullable.include?(attr)
201
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
202
+ end
203
+
204
+ hash[param] = _to_hash(value)
205
+ end
206
+ hash
207
+ end
208
+
209
+ # Outputs non-array value in the form of hash
210
+ # For object, use to_hash. Otherwise, just return the value
211
+ # @param [Object] value Any valid value
212
+ # @return [Hash] Returns the value in the form of hash
213
+ def _to_hash(value)
214
+ if value.is_a?(Array)
215
+ value.compact.map { |v| _to_hash(v) }
216
+ elsif value.is_a?(Hash)
217
+ {}.tap do |hash|
218
+ value.each { |k, v| hash[k] = _to_hash(v) }
219
+ end
220
+ elsif value.respond_to? :to_hash
221
+ value.to_hash
222
+ else
223
+ value
224
+ end
225
+ end end
226
+ end