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