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