turnkey_client 0.0.13 → 0.0.14

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 (167) hide show
  1. checksums.yaml +4 -4
  2. data/lib/turnkey_client/api/activities_api.rb +66 -8
  3. data/lib/turnkey_client/api/api_keys_api.rb +14 -14
  4. data/lib/turnkey_client/api/authenticators_api.rb +16 -16
  5. data/lib/turnkey_client/api/consensus_api.rb +8 -8
  6. data/lib/turnkey_client/api/features_api.rb +8 -8
  7. data/lib/turnkey_client/api/invitations_api.rb +8 -8
  8. data/lib/turnkey_client/api/on_ramp_api.rb +77 -0
  9. data/lib/turnkey_client/api/organizations_api.rb +18 -18
  10. data/lib/turnkey_client/api/policies_api.rb +256 -24
  11. data/lib/turnkey_client/api/private_key_tags_api.rb +12 -12
  12. data/lib/turnkey_client/api/private_keys_api.rb +28 -28
  13. data/lib/turnkey_client/api/sessions_api.rb +184 -10
  14. data/lib/turnkey_client/api/signing_api.rb +12 -12
  15. data/lib/turnkey_client/api/user_auth_api.rb +20 -20
  16. data/lib/turnkey_client/api/user_recovery_api.rb +6 -6
  17. data/lib/turnkey_client/api/user_tags_api.rb +12 -12
  18. data/lib/turnkey_client/api/user_verification_api.rb +135 -0
  19. data/lib/turnkey_client/api/users_api.rb +194 -20
  20. data/lib/turnkey_client/api/wallets_api.rb +48 -48
  21. data/lib/turnkey_client/models/activity_type.rb +14 -0
  22. data/lib/turnkey_client/models/activity_v1_policy_evaluation.rb +287 -0
  23. data/lib/turnkey_client/models/address_format.rb +1 -0
  24. data/lib/turnkey_client/models/api_key.rb +1 -0
  25. data/lib/turnkey_client/models/api_key_params.rb +1 -0
  26. data/lib/turnkey_client/models/api_key_params_v2.rb +1 -0
  27. data/lib/turnkey_client/models/api_only_user_params.rb +3 -2
  28. data/lib/turnkey_client/models/create_organization_intent.rb +1 -0
  29. data/lib/turnkey_client/models/create_organization_intent_v2.rb +1 -0
  30. data/lib/turnkey_client/models/create_policy_intent_v3.rb +2 -0
  31. data/lib/turnkey_client/models/create_read_write_session_intent.rb +3 -1
  32. data/lib/turnkey_client/models/create_read_write_session_intent_v2.rb +19 -5
  33. data/lib/turnkey_client/models/create_smart_contract_interface_intent.rb +265 -0
  34. data/lib/turnkey_client/models/create_smart_contract_interface_request.rb +288 -0
  35. data/lib/turnkey_client/models/create_smart_contract_interface_result.rb +211 -0
  36. data/lib/turnkey_client/models/create_sub_organization_intent_v4.rb +2 -0
  37. data/lib/turnkey_client/models/create_sub_organization_intent_v5.rb +2 -0
  38. data/lib/turnkey_client/models/create_sub_organization_intent_v6.rb +2 -0
  39. data/lib/turnkey_client/models/create_sub_organization_intent_v7.rb +4 -0
  40. data/lib/turnkey_client/models/create_users_intent_v3.rb +213 -0
  41. data/lib/turnkey_client/models/create_users_request.rb +2 -2
  42. data/lib/turnkey_client/models/create_wallet_intent.rb +2 -1
  43. data/lib/turnkey_client/models/credential_type.rb +3 -0
  44. data/lib/turnkey_client/models/data_v1_smart_contract_interface.rb +329 -0
  45. data/lib/turnkey_client/models/delete_payment_method_intent.rb +1 -0
  46. data/lib/turnkey_client/models/delete_private_keys_intent.rb +1 -0
  47. data/lib/turnkey_client/models/delete_smart_contract_interface_intent.rb +211 -0
  48. data/lib/turnkey_client/models/delete_smart_contract_interface_request.rb +288 -0
  49. data/lib/turnkey_client/models/delete_smart_contract_interface_result.rb +211 -0
  50. data/lib/turnkey_client/models/delete_sub_organization_intent.rb +1 -0
  51. data/lib/turnkey_client/models/delete_wallets_intent.rb +1 -0
  52. data/lib/turnkey_client/models/email_auth_intent.rb +31 -5
  53. data/lib/turnkey_client/models/email_auth_intent_v2.rb +31 -5
  54. data/lib/turnkey_client/models/email_customization_params.rb +5 -0
  55. data/lib/turnkey_client/models/feature.rb +1 -0
  56. data/lib/turnkey_client/models/fiat_on_ramp_blockchain_network.rb +29 -0
  57. data/lib/turnkey_client/models/fiat_on_ramp_crypto_currency.rb +29 -0
  58. data/lib/turnkey_client/models/fiat_on_ramp_currency.rb +59 -0
  59. data/lib/turnkey_client/models/fiat_on_ramp_payment_method.rb +38 -0
  60. data/lib/turnkey_client/models/fiat_on_ramp_provider.rb +27 -0
  61. data/lib/turnkey_client/models/get_activities_request.rb +3 -3
  62. data/lib/turnkey_client/models/get_activities_response.rb +1 -1
  63. data/lib/turnkey_client/models/get_activity_request.rb +2 -2
  64. data/lib/turnkey_client/models/get_api_key_request.rb +1 -1
  65. data/lib/turnkey_client/models/get_api_keys_request.rb +3 -2
  66. data/lib/turnkey_client/models/get_authenticator_request.rb +2 -2
  67. data/lib/turnkey_client/models/get_authenticators_request.rb +2 -2
  68. data/lib/turnkey_client/models/get_oauth_providers_request.rb +3 -2
  69. data/lib/turnkey_client/models/get_oauth_providers_response.rb +1 -1
  70. data/lib/turnkey_client/models/get_organization_configs_request.rb +1 -1
  71. data/lib/turnkey_client/models/get_policies_request.rb +1 -1
  72. data/lib/turnkey_client/models/get_policies_response.rb +1 -1
  73. data/lib/turnkey_client/models/get_policy_evaluations_request.rb +226 -0
  74. data/lib/turnkey_client/models/get_policy_evaluations_response.rb +212 -0
  75. data/lib/turnkey_client/models/get_policy_request.rb +2 -2
  76. data/lib/turnkey_client/models/get_private_key_request.rb +2 -2
  77. data/lib/turnkey_client/models/get_private_keys_request.rb +1 -1
  78. data/lib/turnkey_client/models/get_private_keys_response.rb +1 -1
  79. data/lib/turnkey_client/models/get_smart_contract_interface_request.rb +226 -0
  80. data/lib/turnkey_client/models/get_smart_contract_interface_response.rb +210 -0
  81. data/lib/turnkey_client/models/get_smart_contract_interfaces_request.rb +211 -0
  82. data/lib/turnkey_client/models/get_smart_contract_interfaces_response.rb +213 -0
  83. data/lib/turnkey_client/models/get_sub_org_ids_request.rb +2 -2
  84. data/lib/turnkey_client/models/get_user_request.rb +2 -2
  85. data/lib/turnkey_client/models/get_users_request.rb +1 -1
  86. data/lib/turnkey_client/models/get_users_response.rb +1 -1
  87. data/lib/turnkey_client/models/get_verified_sub_org_ids_request.rb +2 -2
  88. data/lib/turnkey_client/models/get_wallet_account_request.rb +6 -4
  89. data/lib/turnkey_client/models/get_wallet_accounts_request.rb +3 -7
  90. data/lib/turnkey_client/models/get_wallet_accounts_response.rb +1 -1
  91. data/lib/turnkey_client/models/get_wallet_request.rb +2 -2
  92. data/lib/turnkey_client/models/get_wallets_request.rb +1 -1
  93. data/lib/turnkey_client/models/get_wallets_response.rb +1 -1
  94. data/lib/turnkey_client/models/get_whoami_request.rb +1 -1
  95. data/lib/turnkey_client/models/get_whoami_response.rb +4 -4
  96. data/lib/turnkey_client/models/init_fiat_on_ramp_intent.rb +315 -0
  97. data/lib/turnkey_client/models/init_fiat_on_ramp_request.rb +288 -0
  98. data/lib/turnkey_client/models/init_fiat_on_ramp_result.rb +226 -0
  99. data/lib/turnkey_client/models/init_otp_auth_intent.rb +28 -4
  100. data/lib/turnkey_client/models/init_otp_auth_intent_v2.rb +310 -0
  101. data/lib/turnkey_client/models/init_otp_auth_request.rb +2 -2
  102. data/lib/turnkey_client/models/init_otp_auth_result_v2.rb +211 -0
  103. data/lib/turnkey_client/models/init_otp_intent.rb +321 -0
  104. data/lib/turnkey_client/models/init_otp_request.rb +288 -0
  105. data/lib/turnkey_client/models/init_otp_result.rb +211 -0
  106. data/lib/turnkey_client/models/init_user_email_recovery_intent.rb +2 -1
  107. data/lib/turnkey_client/models/intent.rb +130 -4
  108. data/lib/turnkey_client/models/invitation_params.rb +1 -1
  109. data/lib/turnkey_client/models/list_private_key_tags_request.rb +1 -1
  110. data/lib/turnkey_client/models/list_private_key_tags_response.rb +1 -1
  111. data/lib/turnkey_client/models/list_user_tags_request.rb +1 -1
  112. data/lib/turnkey_client/models/list_user_tags_response.rb +1 -1
  113. data/lib/turnkey_client/models/oauth_intent.rb +18 -5
  114. data/lib/turnkey_client/models/oauth_login_intent.rb +248 -0
  115. data/lib/turnkey_client/models/oauth_login_request.rb +288 -0
  116. data/lib/turnkey_client/models/oauth_login_result.rb +211 -0
  117. data/lib/turnkey_client/models/otp_auth_intent.rb +10 -2
  118. data/lib/turnkey_client/models/otp_login_intent.rb +248 -0
  119. data/lib/turnkey_client/models/otp_login_request.rb +288 -0
  120. data/lib/turnkey_client/models/otp_login_result.rb +211 -0
  121. data/lib/turnkey_client/models/outcome.rb +31 -0
  122. data/lib/turnkey_client/models/payload_encoding.rb +1 -0
  123. data/lib/turnkey_client/models/policy.rb +2 -0
  124. data/lib/turnkey_client/models/private_key_params.rb +1 -1
  125. data/lib/turnkey_client/models/result.rb +121 -4
  126. data/lib/turnkey_client/models/root_user_params.rb +3 -2
  127. data/lib/turnkey_client/models/root_user_params_v2.rb +4 -3
  128. data/lib/turnkey_client/models/root_user_params_v3.rb +4 -3
  129. data/lib/turnkey_client/models/root_user_params_v4.rb +5 -3
  130. data/lib/turnkey_client/models/set_organization_feature_intent.rb +1 -0
  131. data/lib/turnkey_client/models/simple_client_extension_results.rb +2 -0
  132. data/lib/turnkey_client/models/smart_contract_interface_type.rb +27 -0
  133. data/lib/turnkey_client/models/sms_customization_params.rb +1 -0
  134. data/lib/turnkey_client/models/stamp_login_intent.rb +233 -0
  135. data/lib/turnkey_client/models/stamp_login_request.rb +288 -0
  136. data/lib/turnkey_client/models/stamp_login_result.rb +211 -0
  137. data/lib/turnkey_client/models/transaction_type.rb +1 -0
  138. data/lib/turnkey_client/models/ump_v1_policy_evaluation.rb +214 -0
  139. data/lib/turnkey_client/models/update_policy_intent.rb +4 -0
  140. data/lib/turnkey_client/models/update_policy_intent_v2.rb +264 -0
  141. data/lib/turnkey_client/models/update_policy_request.rb +2 -2
  142. data/lib/turnkey_client/models/update_policy_result_v2.rb +211 -0
  143. data/lib/turnkey_client/models/update_private_key_tag_intent.rb +1 -0
  144. data/lib/turnkey_client/models/update_user_email_intent.rb +237 -0
  145. data/lib/turnkey_client/models/update_user_email_request.rb +288 -0
  146. data/lib/turnkey_client/models/update_user_email_result.rb +211 -0
  147. data/lib/turnkey_client/models/update_user_intent.rb +4 -1
  148. data/lib/turnkey_client/models/update_user_name_intent.rb +226 -0
  149. data/lib/turnkey_client/models/update_user_name_request.rb +288 -0
  150. data/lib/turnkey_client/models/update_user_name_result.rb +211 -0
  151. data/lib/turnkey_client/models/update_user_phone_number_intent.rb +237 -0
  152. data/lib/turnkey_client/models/update_user_phone_number_request.rb +288 -0
  153. data/lib/turnkey_client/models/update_user_phone_number_result.rb +211 -0
  154. data/lib/turnkey_client/models/update_user_tag_intent.rb +1 -0
  155. data/lib/turnkey_client/models/user.rb +3 -1
  156. data/lib/turnkey_client/models/user_params.rb +4 -3
  157. data/lib/turnkey_client/models/user_params_v2.rb +4 -3
  158. data/lib/turnkey_client/models/user_params_v3.rb +301 -0
  159. data/lib/turnkey_client/models/verify_otp_intent.rb +237 -0
  160. data/lib/turnkey_client/models/verify_otp_request.rb +288 -0
  161. data/lib/turnkey_client/models/verify_otp_result.rb +211 -0
  162. data/lib/turnkey_client/models/wallet_account.rb +15 -4
  163. data/lib/turnkey_client/models/wallet_params.rb +2 -1
  164. data/lib/turnkey_client/version.rb +1 -1
  165. data/lib/turnkey_client.rb +57 -0
  166. data/turnkey_client-0.0.13.gem +0 -0
  167. metadata +60 -2
@@ -0,0 +1,211 @@
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 UpdatePolicyResultV2
15
+ # Unique identifier for a given Policy.
16
+ attr_accessor :policy_id
17
+
18
+ # Attribute mapping from ruby-style variable name to JSON key.
19
+ def self.attribute_map
20
+ {
21
+ :'policy_id' => :'policyId'
22
+ }
23
+ end
24
+
25
+ # Attribute type mapping.
26
+ def self.openapi_types
27
+ {
28
+ :'policy_id' => :'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::UpdatePolicyResultV2` 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::UpdatePolicyResultV2`. 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?(:'policy_id')
54
+ self.policy_id = attributes[:'policy_id']
55
+ end
56
+ end
57
+
58
+ # Show invalid properties with the reasons. Usually used together with valid?
59
+ # @return Array for valid properties with the reasons
60
+ def list_invalid_properties
61
+ invalid_properties = Array.new
62
+ if @policy_id.nil?
63
+ invalid_properties.push('invalid value for "policy_id", policy_id cannot be nil.')
64
+ end
65
+
66
+ invalid_properties
67
+ end
68
+
69
+ # Check to see if the all the properties in the model are valid
70
+ # @return true if the model is valid
71
+ def valid?
72
+ return false if @policy_id.nil?
73
+ true
74
+ end
75
+
76
+ # Checks equality by comparing each attribute.
77
+ # @param [Object] Object to be compared
78
+ def ==(o)
79
+ return true if self.equal?(o)
80
+ self.class == o.class &&
81
+ policy_id == o.policy_id
82
+ end
83
+
84
+ # @see the `==` method
85
+ # @param [Object] Object to be compared
86
+ def eql?(o)
87
+ self == o
88
+ end
89
+
90
+ # Calculates hash code according to all attributes.
91
+ # @return [Integer] Hash code
92
+ def hash
93
+ [policy_id].hash
94
+ end
95
+
96
+ # Builds the object from hash
97
+ # @param [Hash] attributes Model attributes in the form of hash
98
+ # @return [Object] Returns the model itself
99
+ def self.build_from_hash(attributes)
100
+ new.build_from_hash(attributes)
101
+ end
102
+
103
+ # Builds the object from hash
104
+ # @param [Hash] attributes Model attributes in the form of hash
105
+ # @return [Object] Returns the model itself
106
+ def build_from_hash(attributes)
107
+ return nil unless attributes.is_a?(Hash)
108
+ self.class.openapi_types.each_pair do |key, type|
109
+ if type =~ /\AArray<(.*)>/i
110
+ # check to ensure the input is an array given that the attribute
111
+ # is documented as an array but the input is not
112
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
113
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
114
+ end
115
+ elsif !attributes[self.class.attribute_map[key]].nil?
116
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
117
+ elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
118
+ self.send("#{key}=", nil)
119
+ end
120
+ end
121
+
122
+ self
123
+ end
124
+
125
+ # Deserializes the data based on type
126
+ # @param string type Data type
127
+ # @param string value Value to be deserialized
128
+ # @return [Object] Deserialized data
129
+ def _deserialize(type, value)
130
+ case type.to_sym
131
+ when :DateTime
132
+ DateTime.parse(value)
133
+ when :Date
134
+ Date.parse(value)
135
+ when :String
136
+ value.to_s
137
+ when :Integer
138
+ value.to_i
139
+ when :Float
140
+ value.to_f
141
+ when :Boolean
142
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
143
+ true
144
+ else
145
+ false
146
+ end
147
+ when :Object
148
+ # generic object (usually a Hash), return directly
149
+ value
150
+ when /\AArray<(?<inner_type>.+)>\z/
151
+ inner_type = Regexp.last_match[:inner_type]
152
+ value.map { |v| _deserialize(inner_type, v) }
153
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
154
+ k_type = Regexp.last_match[:k_type]
155
+ v_type = Regexp.last_match[:v_type]
156
+ {}.tap do |hash|
157
+ value.each do |k, v|
158
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
159
+ end
160
+ end
161
+ else # model
162
+ TurnkeyClient.const_get(type).build_from_hash(value)
163
+ end
164
+ end
165
+
166
+ # Returns the string representation of the object
167
+ # @return [String] String presentation of the object
168
+ def to_s
169
+ to_hash.to_s
170
+ end
171
+
172
+ # to_body is an alias to to_hash (backward compatibility)
173
+ # @return [Hash] Returns the object in the form of hash
174
+ def to_body
175
+ to_hash
176
+ end
177
+
178
+ # Returns the object in the form of hash
179
+ # @return [Hash] Returns the object in the form of hash
180
+ def to_hash
181
+ hash = {}
182
+ self.class.attribute_map.each_pair do |attr, param|
183
+ value = self.send(attr)
184
+ if value.nil?
185
+ is_nullable = self.class.openapi_nullable.include?(attr)
186
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
187
+ end
188
+
189
+ hash[param] = _to_hash(value)
190
+ end
191
+ hash
192
+ end
193
+
194
+ # Outputs non-array value in the form of hash
195
+ # For object, use to_hash. Otherwise, just return the value
196
+ # @param [Object] value Any valid value
197
+ # @return [Hash] Returns the value in the form of hash
198
+ def _to_hash(value)
199
+ if value.is_a?(Array)
200
+ value.compact.map { |v| _to_hash(v) }
201
+ elsif value.is_a?(Hash)
202
+ {}.tap do |hash|
203
+ value.each { |k, v| hash[k] = _to_hash(v) }
204
+ end
205
+ elsif value.respond_to? :to_hash
206
+ value.to_hash
207
+ else
208
+ value
209
+ end
210
+ end end
211
+ end
@@ -47,6 +47,7 @@ module TurnkeyClient
47
47
  # List of attributes with nullable: true
48
48
  def self.openapi_nullable
49
49
  Set.new([
50
+ :'new_private_key_tag_name',
50
51
  ])
51
52
  end
52
53
 
@@ -0,0 +1,237 @@
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 UpdateUserEmailIntent
15
+ # Unique identifier for a given User.
16
+ attr_accessor :user_id
17
+
18
+ # The user's email address. Setting this to an empty string will remove the user's email.
19
+ attr_accessor :user_email
20
+
21
+ # Signed JWT containing a unique id, expiry, verification type, contact
22
+ attr_accessor :verification_token
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'user_id' => :'userId',
28
+ :'user_email' => :'userEmail',
29
+ :'verification_token' => :'verificationToken'
30
+ }
31
+ end
32
+
33
+ # Attribute type mapping.
34
+ def self.openapi_types
35
+ {
36
+ :'user_id' => :'Object',
37
+ :'user_email' => :'Object',
38
+ :'verification_token' => :'Object'
39
+ }
40
+ end
41
+
42
+ # List of attributes with nullable: true
43
+ def self.openapi_nullable
44
+ Set.new([
45
+ :'verification_token'
46
+ ])
47
+ end
48
+
49
+ # Initializes the object
50
+ # @param [Hash] attributes Model attributes in the form of hash
51
+ def initialize(attributes = {})
52
+ if (!attributes.is_a?(Hash))
53
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::UpdateUserEmailIntent` initialize method"
54
+ end
55
+
56
+ # check to see if the attribute exists and convert string to symbol for hash key
57
+ attributes = attributes.each_with_object({}) { |(k, v), h|
58
+ if (!self.class.attribute_map.key?(k.to_sym))
59
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::UpdateUserEmailIntent`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
60
+ end
61
+ h[k.to_sym] = v
62
+ }
63
+
64
+ if attributes.key?(:'user_id')
65
+ self.user_id = attributes[:'user_id']
66
+ end
67
+
68
+ if attributes.key?(:'user_email')
69
+ self.user_email = attributes[:'user_email']
70
+ end
71
+
72
+ if attributes.key?(:'verification_token')
73
+ self.verification_token = attributes[:'verification_token']
74
+ end
75
+ end
76
+
77
+ # Show invalid properties with the reasons. Usually used together with valid?
78
+ # @return Array for valid properties with the reasons
79
+ def list_invalid_properties
80
+ invalid_properties = Array.new
81
+ if @user_id.nil?
82
+ invalid_properties.push('invalid value for "user_id", user_id cannot be nil.')
83
+ end
84
+
85
+ if @user_email.nil?
86
+ invalid_properties.push('invalid value for "user_email", user_email cannot be nil.')
87
+ end
88
+
89
+ invalid_properties
90
+ end
91
+
92
+ # Check to see if the all the properties in the model are valid
93
+ # @return true if the model is valid
94
+ def valid?
95
+ return false if @user_id.nil?
96
+ return false if @user_email.nil?
97
+ true
98
+ end
99
+
100
+ # Checks equality by comparing each attribute.
101
+ # @param [Object] Object to be compared
102
+ def ==(o)
103
+ return true if self.equal?(o)
104
+ self.class == o.class &&
105
+ user_id == o.user_id &&
106
+ user_email == o.user_email &&
107
+ verification_token == o.verification_token
108
+ end
109
+
110
+ # @see the `==` method
111
+ # @param [Object] Object to be compared
112
+ def eql?(o)
113
+ self == o
114
+ end
115
+
116
+ # Calculates hash code according to all attributes.
117
+ # @return [Integer] Hash code
118
+ def hash
119
+ [user_id, user_email, verification_token].hash
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 self.build_from_hash(attributes)
126
+ new.build_from_hash(attributes)
127
+ end
128
+
129
+ # Builds the object from hash
130
+ # @param [Hash] attributes Model attributes in the form of hash
131
+ # @return [Object] Returns the model itself
132
+ def build_from_hash(attributes)
133
+ return nil unless attributes.is_a?(Hash)
134
+ self.class.openapi_types.each_pair do |key, type|
135
+ if type =~ /\AArray<(.*)>/i
136
+ # check to ensure the input is an array given that the attribute
137
+ # is documented as an array but the input is not
138
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
139
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
140
+ end
141
+ elsif !attributes[self.class.attribute_map[key]].nil?
142
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
143
+ elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
144
+ self.send("#{key}=", nil)
145
+ end
146
+ end
147
+
148
+ self
149
+ end
150
+
151
+ # Deserializes the data based on type
152
+ # @param string type Data type
153
+ # @param string value Value to be deserialized
154
+ # @return [Object] Deserialized data
155
+ def _deserialize(type, value)
156
+ case type.to_sym
157
+ when :DateTime
158
+ DateTime.parse(value)
159
+ when :Date
160
+ Date.parse(value)
161
+ when :String
162
+ value.to_s
163
+ when :Integer
164
+ value.to_i
165
+ when :Float
166
+ value.to_f
167
+ when :Boolean
168
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
169
+ true
170
+ else
171
+ false
172
+ end
173
+ when :Object
174
+ # generic object (usually a Hash), return directly
175
+ value
176
+ when /\AArray<(?<inner_type>.+)>\z/
177
+ inner_type = Regexp.last_match[:inner_type]
178
+ value.map { |v| _deserialize(inner_type, v) }
179
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
180
+ k_type = Regexp.last_match[:k_type]
181
+ v_type = Regexp.last_match[:v_type]
182
+ {}.tap do |hash|
183
+ value.each do |k, v|
184
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
185
+ end
186
+ end
187
+ else # model
188
+ TurnkeyClient.const_get(type).build_from_hash(value)
189
+ end
190
+ end
191
+
192
+ # Returns the string representation of the object
193
+ # @return [String] String presentation of the object
194
+ def to_s
195
+ to_hash.to_s
196
+ end
197
+
198
+ # to_body is an alias to to_hash (backward compatibility)
199
+ # @return [Hash] Returns the object in the form of hash
200
+ def to_body
201
+ to_hash
202
+ end
203
+
204
+ # Returns the object in the form of hash
205
+ # @return [Hash] Returns the object in the form of hash
206
+ def to_hash
207
+ hash = {}
208
+ self.class.attribute_map.each_pair do |attr, param|
209
+ value = self.send(attr)
210
+ if value.nil?
211
+ is_nullable = self.class.openapi_nullable.include?(attr)
212
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
213
+ end
214
+
215
+ hash[param] = _to_hash(value)
216
+ end
217
+ hash
218
+ end
219
+
220
+ # Outputs non-array value in the form of hash
221
+ # For object, use to_hash. Otherwise, just return the value
222
+ # @param [Object] value Any valid value
223
+ # @return [Hash] Returns the value in the form of hash
224
+ def _to_hash(value)
225
+ if value.is_a?(Array)
226
+ value.compact.map { |v| _to_hash(v) }
227
+ elsif value.is_a?(Hash)
228
+ {}.tap do |hash|
229
+ value.each { |k, v| hash[k] = _to_hash(v) }
230
+ end
231
+ elsif value.respond_to? :to_hash
232
+ value.to_hash
233
+ else
234
+ value
235
+ end
236
+ end end
237
+ end