turnkey_client 0.0.18 → 0.0.19

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