turnkey_client 0.0.8 → 0.0.12

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 (47) hide show
  1. checksums.yaml +4 -4
  2. data/lib/turnkey_client/api/features_api.rb +4 -4
  3. data/lib/turnkey_client/api/organizations_api.rb +118 -2
  4. data/lib/turnkey_client/api/private_keys_api.rb +2 -2
  5. data/lib/turnkey_client/api/user_auth_api.rb +348 -0
  6. data/lib/turnkey_client/api/users_api.rb +0 -232
  7. data/lib/turnkey_client/api/wallets_api.rb +60 -2
  8. data/lib/turnkey_client/models/activity_type.rb +6 -0
  9. data/lib/turnkey_client/models/address_format.rb +29 -0
  10. data/lib/turnkey_client/models/create_read_write_session_intent_v2.rb +241 -0
  11. data/lib/turnkey_client/models/create_read_write_session_request.rb +2 -2
  12. data/lib/turnkey_client/models/create_read_write_session_result_v2.rb +286 -0
  13. data/lib/turnkey_client/models/create_sub_organization_intent_v7.rb +292 -0
  14. data/lib/turnkey_client/models/create_sub_organization_request.rb +2 -2
  15. data/lib/turnkey_client/models/create_sub_organization_result_v7.rb +230 -0
  16. data/lib/turnkey_client/models/credential_type.rb +1 -0
  17. data/lib/turnkey_client/models/delete_sub_organization_intent.rb +206 -0
  18. data/lib/turnkey_client/models/delete_sub_organization_request.rb +288 -0
  19. data/lib/turnkey_client/models/delete_sub_organization_result.rb +211 -0
  20. data/lib/turnkey_client/models/email_auth_intent.rb +14 -4
  21. data/lib/turnkey_client/models/email_auth_intent_v2.rb +14 -4
  22. data/lib/turnkey_client/models/feature_name.rb +2 -0
  23. data/lib/turnkey_client/models/get_sub_org_ids_request.rb +1 -1
  24. data/lib/turnkey_client/models/get_verified_sub_org_ids_request.rb +240 -0
  25. data/lib/turnkey_client/models/get_verified_sub_org_ids_response.rb +213 -0
  26. data/lib/turnkey_client/models/init_otp_auth_intent.rb +264 -0
  27. data/lib/turnkey_client/models/init_otp_auth_request.rb +288 -0
  28. data/lib/turnkey_client/models/init_otp_auth_result.rb +211 -0
  29. data/lib/turnkey_client/models/intent.rb +58 -4
  30. data/lib/turnkey_client/models/otp_auth_intent.rb +266 -0
  31. data/lib/turnkey_client/models/otp_auth_request.rb +288 -0
  32. data/lib/turnkey_client/models/otp_auth_result.rb +231 -0
  33. data/lib/turnkey_client/models/result.rb +58 -4
  34. data/lib/turnkey_client/models/root_user_params_v4.rb +282 -0
  35. data/lib/turnkey_client/models/sms_customization_params.rb +206 -0
  36. data/lib/turnkey_client/models/transaction_type.rb +2 -1
  37. data/lib/turnkey_client/models/update_user_intent.rb +14 -4
  38. data/lib/turnkey_client/models/update_wallet_intent.rb +221 -0
  39. data/lib/turnkey_client/models/update_wallet_request.rb +288 -0
  40. data/lib/turnkey_client/models/update_wallet_result.rb +211 -0
  41. data/lib/turnkey_client/models/user.rb +11 -1
  42. data/lib/turnkey_client/models/wallet_account.rb +16 -1
  43. data/lib/turnkey_client/version.rb +1 -1
  44. data/lib/turnkey_client.rb +20 -0
  45. data/turnkey_client-0.0.8.gem +0 -0
  46. data/turnkey_client-0.0.9.gem +0 -0
  47. metadata +24 -2
@@ -0,0 +1,286 @@
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 CreateReadWriteSessionResultV2
15
+ # Unique identifier for a given Organization. If the request is being made by a user and their Sub-Organization ID is unknown, this can be the Parent Organization ID. However, using the Sub-Organization ID is preferred due to performance reasons.
16
+ attr_accessor :organization_id
17
+
18
+ # Human-readable name for an Organization.
19
+ attr_accessor :organization_name
20
+
21
+ # Unique identifier for a given User.
22
+ attr_accessor :user_id
23
+
24
+ # Human-readable name for a User.
25
+ attr_accessor :username
26
+
27
+ # Unique identifier for the created API key.
28
+ attr_accessor :api_key_id
29
+
30
+ # HPKE encrypted credential bundle
31
+ attr_accessor :credential_bundle
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ def self.attribute_map
35
+ {
36
+ :'organization_id' => :'organizationId',
37
+ :'organization_name' => :'organizationName',
38
+ :'user_id' => :'userId',
39
+ :'username' => :'username',
40
+ :'api_key_id' => :'apiKeyId',
41
+ :'credential_bundle' => :'credentialBundle'
42
+ }
43
+ end
44
+
45
+ # Attribute type mapping.
46
+ def self.openapi_types
47
+ {
48
+ :'organization_id' => :'Object',
49
+ :'organization_name' => :'Object',
50
+ :'user_id' => :'Object',
51
+ :'username' => :'Object',
52
+ :'api_key_id' => :'Object',
53
+ :'credential_bundle' => :'Object'
54
+ }
55
+ end
56
+
57
+ # List of attributes with nullable: true
58
+ def self.openapi_nullable
59
+ Set.new([
60
+ ])
61
+ end
62
+
63
+ # Initializes the object
64
+ # @param [Hash] attributes Model attributes in the form of hash
65
+ def initialize(attributes = {})
66
+ if (!attributes.is_a?(Hash))
67
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::CreateReadWriteSessionResultV2` initialize method"
68
+ end
69
+
70
+ # check to see if the attribute exists and convert string to symbol for hash key
71
+ attributes = attributes.each_with_object({}) { |(k, v), h|
72
+ if (!self.class.attribute_map.key?(k.to_sym))
73
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::CreateReadWriteSessionResultV2`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
74
+ end
75
+ h[k.to_sym] = v
76
+ }
77
+
78
+ if attributes.key?(:'organization_id')
79
+ self.organization_id = attributes[:'organization_id']
80
+ end
81
+
82
+ if attributes.key?(:'organization_name')
83
+ self.organization_name = attributes[:'organization_name']
84
+ end
85
+
86
+ if attributes.key?(:'user_id')
87
+ self.user_id = attributes[:'user_id']
88
+ end
89
+
90
+ if attributes.key?(:'username')
91
+ self.username = attributes[:'username']
92
+ end
93
+
94
+ if attributes.key?(:'api_key_id')
95
+ self.api_key_id = attributes[:'api_key_id']
96
+ end
97
+
98
+ if attributes.key?(:'credential_bundle')
99
+ self.credential_bundle = attributes[:'credential_bundle']
100
+ end
101
+ end
102
+
103
+ # Show invalid properties with the reasons. Usually used together with valid?
104
+ # @return Array for valid properties with the reasons
105
+ def list_invalid_properties
106
+ invalid_properties = Array.new
107
+ if @organization_id.nil?
108
+ invalid_properties.push('invalid value for "organization_id", organization_id cannot be nil.')
109
+ end
110
+
111
+ if @organization_name.nil?
112
+ invalid_properties.push('invalid value for "organization_name", organization_name cannot be nil.')
113
+ end
114
+
115
+ if @user_id.nil?
116
+ invalid_properties.push('invalid value for "user_id", user_id cannot be nil.')
117
+ end
118
+
119
+ if @username.nil?
120
+ invalid_properties.push('invalid value for "username", username cannot be nil.')
121
+ end
122
+
123
+ if @api_key_id.nil?
124
+ invalid_properties.push('invalid value for "api_key_id", api_key_id cannot be nil.')
125
+ end
126
+
127
+ if @credential_bundle.nil?
128
+ invalid_properties.push('invalid value for "credential_bundle", credential_bundle cannot be nil.')
129
+ end
130
+
131
+ invalid_properties
132
+ end
133
+
134
+ # Check to see if the all the properties in the model are valid
135
+ # @return true if the model is valid
136
+ def valid?
137
+ return false if @organization_id.nil?
138
+ return false if @organization_name.nil?
139
+ return false if @user_id.nil?
140
+ return false if @username.nil?
141
+ return false if @api_key_id.nil?
142
+ return false if @credential_bundle.nil?
143
+ true
144
+ end
145
+
146
+ # Checks equality by comparing each attribute.
147
+ # @param [Object] Object to be compared
148
+ def ==(o)
149
+ return true if self.equal?(o)
150
+ self.class == o.class &&
151
+ organization_id == o.organization_id &&
152
+ organization_name == o.organization_name &&
153
+ user_id == o.user_id &&
154
+ username == o.username &&
155
+ api_key_id == o.api_key_id &&
156
+ credential_bundle == o.credential_bundle
157
+ end
158
+
159
+ # @see the `==` method
160
+ # @param [Object] Object to be compared
161
+ def eql?(o)
162
+ self == o
163
+ end
164
+
165
+ # Calculates hash code according to all attributes.
166
+ # @return [Integer] Hash code
167
+ def hash
168
+ [organization_id, organization_name, user_id, username, api_key_id, credential_bundle].hash
169
+ end
170
+
171
+ # Builds the object from hash
172
+ # @param [Hash] attributes Model attributes in the form of hash
173
+ # @return [Object] Returns the model itself
174
+ def self.build_from_hash(attributes)
175
+ new.build_from_hash(attributes)
176
+ end
177
+
178
+ # Builds the object from hash
179
+ # @param [Hash] attributes Model attributes in the form of hash
180
+ # @return [Object] Returns the model itself
181
+ def build_from_hash(attributes)
182
+ return nil unless attributes.is_a?(Hash)
183
+ self.class.openapi_types.each_pair do |key, type|
184
+ if type =~ /\AArray<(.*)>/i
185
+ # check to ensure the input is an array given that the attribute
186
+ # is documented as an array but the input is not
187
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
188
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
189
+ end
190
+ elsif !attributes[self.class.attribute_map[key]].nil?
191
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
192
+ elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
193
+ self.send("#{key}=", nil)
194
+ end
195
+ end
196
+
197
+ self
198
+ end
199
+
200
+ # Deserializes the data based on type
201
+ # @param string type Data type
202
+ # @param string value Value to be deserialized
203
+ # @return [Object] Deserialized data
204
+ def _deserialize(type, value)
205
+ case type.to_sym
206
+ when :DateTime
207
+ DateTime.parse(value)
208
+ when :Date
209
+ Date.parse(value)
210
+ when :String
211
+ value.to_s
212
+ when :Integer
213
+ value.to_i
214
+ when :Float
215
+ value.to_f
216
+ when :Boolean
217
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
218
+ true
219
+ else
220
+ false
221
+ end
222
+ when :Object
223
+ # generic object (usually a Hash), return directly
224
+ value
225
+ when /\AArray<(?<inner_type>.+)>\z/
226
+ inner_type = Regexp.last_match[:inner_type]
227
+ value.map { |v| _deserialize(inner_type, v) }
228
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
229
+ k_type = Regexp.last_match[:k_type]
230
+ v_type = Regexp.last_match[:v_type]
231
+ {}.tap do |hash|
232
+ value.each do |k, v|
233
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
234
+ end
235
+ end
236
+ else # model
237
+ TurnkeyClient.const_get(type).build_from_hash(value)
238
+ end
239
+ end
240
+
241
+ # Returns the string representation of the object
242
+ # @return [String] String presentation of the object
243
+ def to_s
244
+ to_hash.to_s
245
+ end
246
+
247
+ # to_body is an alias to to_hash (backward compatibility)
248
+ # @return [Hash] Returns the object in the form of hash
249
+ def to_body
250
+ to_hash
251
+ end
252
+
253
+ # Returns the object in the form of hash
254
+ # @return [Hash] Returns the object in the form of hash
255
+ def to_hash
256
+ hash = {}
257
+ self.class.attribute_map.each_pair do |attr, param|
258
+ value = self.send(attr)
259
+ if value.nil?
260
+ is_nullable = self.class.openapi_nullable.include?(attr)
261
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
262
+ end
263
+
264
+ hash[param] = _to_hash(value)
265
+ end
266
+ hash
267
+ end
268
+
269
+ # Outputs non-array value in the form of hash
270
+ # For object, use to_hash. Otherwise, just return the value
271
+ # @param [Object] value Any valid value
272
+ # @return [Hash] Returns the value in the form of hash
273
+ def _to_hash(value)
274
+ if value.is_a?(Array)
275
+ value.compact.map { |v| _to_hash(v) }
276
+ elsif value.is_a?(Hash)
277
+ {}.tap do |hash|
278
+ value.each { |k, v| hash[k] = _to_hash(v) }
279
+ end
280
+ elsif value.respond_to? :to_hash
281
+ value.to_hash
282
+ else
283
+ value
284
+ end
285
+ end end
286
+ end
@@ -0,0 +1,292 @@
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 CreateSubOrganizationIntentV7
15
+ # Name for this sub-organization
16
+ attr_accessor :sub_organization_name
17
+
18
+ # Root users to create within this sub-organization
19
+ attr_accessor :root_users
20
+
21
+ # The threshold of unique approvals to reach root quorum. This value must be less than or equal to the number of root users
22
+ attr_accessor :root_quorum_threshold
23
+
24
+ attr_accessor :wallet
25
+
26
+ # Disable email recovery for the sub-organization
27
+ attr_accessor :disable_email_recovery
28
+
29
+ # Disable email auth for the sub-organization
30
+ attr_accessor :disable_email_auth
31
+
32
+ # Disable OTP SMS auth for the sub-organization
33
+ attr_accessor :disable_sms_auth
34
+
35
+ # Disable OTP email auth for the sub-organization
36
+ attr_accessor :disable_otp_email_auth
37
+
38
+ # Attribute mapping from ruby-style variable name to JSON key.
39
+ def self.attribute_map
40
+ {
41
+ :'sub_organization_name' => :'subOrganizationName',
42
+ :'root_users' => :'rootUsers',
43
+ :'root_quorum_threshold' => :'rootQuorumThreshold',
44
+ :'wallet' => :'wallet',
45
+ :'disable_email_recovery' => :'disableEmailRecovery',
46
+ :'disable_email_auth' => :'disableEmailAuth',
47
+ :'disable_sms_auth' => :'disableSmsAuth',
48
+ :'disable_otp_email_auth' => :'disableOtpEmailAuth'
49
+ }
50
+ end
51
+
52
+ # Attribute type mapping.
53
+ def self.openapi_types
54
+ {
55
+ :'sub_organization_name' => :'Object',
56
+ :'root_users' => :'Object',
57
+ :'root_quorum_threshold' => :'Object',
58
+ :'wallet' => :'Object',
59
+ :'disable_email_recovery' => :'Object',
60
+ :'disable_email_auth' => :'Object',
61
+ :'disable_sms_auth' => :'Object',
62
+ :'disable_otp_email_auth' => :'Object'
63
+ }
64
+ end
65
+
66
+ # List of attributes with nullable: true
67
+ def self.openapi_nullable
68
+ Set.new([
69
+ ])
70
+ end
71
+
72
+ # Initializes the object
73
+ # @param [Hash] attributes Model attributes in the form of hash
74
+ def initialize(attributes = {})
75
+ if (!attributes.is_a?(Hash))
76
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::CreateSubOrganizationIntentV7` initialize method"
77
+ end
78
+
79
+ # check to see if the attribute exists and convert string to symbol for hash key
80
+ attributes = attributes.each_with_object({}) { |(k, v), h|
81
+ if (!self.class.attribute_map.key?(k.to_sym))
82
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::CreateSubOrganizationIntentV7`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
83
+ end
84
+ h[k.to_sym] = v
85
+ }
86
+
87
+ if attributes.key?(:'sub_organization_name')
88
+ self.sub_organization_name = attributes[:'sub_organization_name']
89
+ end
90
+
91
+ if attributes.key?(:'root_users')
92
+ if (value = attributes[:'root_users']).is_a?(Array)
93
+ self.root_users = value
94
+ end
95
+ end
96
+
97
+ if attributes.key?(:'root_quorum_threshold')
98
+ self.root_quorum_threshold = attributes[:'root_quorum_threshold']
99
+ end
100
+
101
+ if attributes.key?(:'wallet')
102
+ self.wallet = attributes[:'wallet']
103
+ end
104
+
105
+ if attributes.key?(:'disable_email_recovery')
106
+ self.disable_email_recovery = attributes[:'disable_email_recovery']
107
+ end
108
+
109
+ if attributes.key?(:'disable_email_auth')
110
+ self.disable_email_auth = attributes[:'disable_email_auth']
111
+ end
112
+
113
+ if attributes.key?(:'disable_sms_auth')
114
+ self.disable_sms_auth = attributes[:'disable_sms_auth']
115
+ end
116
+
117
+ if attributes.key?(:'disable_otp_email_auth')
118
+ self.disable_otp_email_auth = attributes[:'disable_otp_email_auth']
119
+ end
120
+ end
121
+
122
+ # Show invalid properties with the reasons. Usually used together with valid?
123
+ # @return Array for valid properties with the reasons
124
+ def list_invalid_properties
125
+ invalid_properties = Array.new
126
+ if @sub_organization_name.nil?
127
+ invalid_properties.push('invalid value for "sub_organization_name", sub_organization_name cannot be nil.')
128
+ end
129
+
130
+ if @root_users.nil?
131
+ invalid_properties.push('invalid value for "root_users", root_users cannot be nil.')
132
+ end
133
+
134
+ if @root_quorum_threshold.nil?
135
+ invalid_properties.push('invalid value for "root_quorum_threshold", root_quorum_threshold cannot be nil.')
136
+ end
137
+
138
+ invalid_properties
139
+ end
140
+
141
+ # Check to see if the all the properties in the model are valid
142
+ # @return true if the model is valid
143
+ def valid?
144
+ return false if @sub_organization_name.nil?
145
+ return false if @root_users.nil?
146
+ return false if @root_quorum_threshold.nil?
147
+ true
148
+ end
149
+
150
+ # Checks equality by comparing each attribute.
151
+ # @param [Object] Object to be compared
152
+ def ==(o)
153
+ return true if self.equal?(o)
154
+ self.class == o.class &&
155
+ sub_organization_name == o.sub_organization_name &&
156
+ root_users == o.root_users &&
157
+ root_quorum_threshold == o.root_quorum_threshold &&
158
+ wallet == o.wallet &&
159
+ disable_email_recovery == o.disable_email_recovery &&
160
+ disable_email_auth == o.disable_email_auth &&
161
+ disable_sms_auth == o.disable_sms_auth &&
162
+ disable_otp_email_auth == o.disable_otp_email_auth
163
+ end
164
+
165
+ # @see the `==` method
166
+ # @param [Object] Object to be compared
167
+ def eql?(o)
168
+ self == o
169
+ end
170
+
171
+ # Calculates hash code according to all attributes.
172
+ # @return [Integer] Hash code
173
+ def hash
174
+ [sub_organization_name, root_users, root_quorum_threshold, wallet, disable_email_recovery, disable_email_auth, disable_sms_auth, disable_otp_email_auth].hash
175
+ end
176
+
177
+ # Builds the object from hash
178
+ # @param [Hash] attributes Model attributes in the form of hash
179
+ # @return [Object] Returns the model itself
180
+ def self.build_from_hash(attributes)
181
+ new.build_from_hash(attributes)
182
+ end
183
+
184
+ # Builds the object from hash
185
+ # @param [Hash] attributes Model attributes in the form of hash
186
+ # @return [Object] Returns the model itself
187
+ def build_from_hash(attributes)
188
+ return nil unless attributes.is_a?(Hash)
189
+ self.class.openapi_types.each_pair do |key, type|
190
+ if type =~ /\AArray<(.*)>/i
191
+ # check to ensure the input is an array given that the attribute
192
+ # is documented as an array but the input is not
193
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
194
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
195
+ end
196
+ elsif !attributes[self.class.attribute_map[key]].nil?
197
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
198
+ elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
199
+ self.send("#{key}=", nil)
200
+ end
201
+ end
202
+
203
+ self
204
+ end
205
+
206
+ # Deserializes the data based on type
207
+ # @param string type Data type
208
+ # @param string value Value to be deserialized
209
+ # @return [Object] Deserialized data
210
+ def _deserialize(type, value)
211
+ case type.to_sym
212
+ when :DateTime
213
+ DateTime.parse(value)
214
+ when :Date
215
+ Date.parse(value)
216
+ when :String
217
+ value.to_s
218
+ when :Integer
219
+ value.to_i
220
+ when :Float
221
+ value.to_f
222
+ when :Boolean
223
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
224
+ true
225
+ else
226
+ false
227
+ end
228
+ when :Object
229
+ # generic object (usually a Hash), return directly
230
+ value
231
+ when /\AArray<(?<inner_type>.+)>\z/
232
+ inner_type = Regexp.last_match[:inner_type]
233
+ value.map { |v| _deserialize(inner_type, v) }
234
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
235
+ k_type = Regexp.last_match[:k_type]
236
+ v_type = Regexp.last_match[:v_type]
237
+ {}.tap do |hash|
238
+ value.each do |k, v|
239
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
240
+ end
241
+ end
242
+ else # model
243
+ TurnkeyClient.const_get(type).build_from_hash(value)
244
+ end
245
+ end
246
+
247
+ # Returns the string representation of the object
248
+ # @return [String] String presentation of the object
249
+ def to_s
250
+ to_hash.to_s
251
+ end
252
+
253
+ # to_body is an alias to to_hash (backward compatibility)
254
+ # @return [Hash] Returns the object in the form of hash
255
+ def to_body
256
+ to_hash
257
+ end
258
+
259
+ # Returns the object in the form of hash
260
+ # @return [Hash] Returns the object in the form of hash
261
+ def to_hash
262
+ hash = {}
263
+ self.class.attribute_map.each_pair do |attr, param|
264
+ value = self.send(attr)
265
+ if value.nil?
266
+ is_nullable = self.class.openapi_nullable.include?(attr)
267
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
268
+ end
269
+
270
+ hash[param] = _to_hash(value)
271
+ end
272
+ hash
273
+ end
274
+
275
+ # Outputs non-array value in the form of hash
276
+ # For object, use to_hash. Otherwise, just return the value
277
+ # @param [Object] value Any valid value
278
+ # @return [Hash] Returns the value in the form of hash
279
+ def _to_hash(value)
280
+ if value.is_a?(Array)
281
+ value.compact.map { |v| _to_hash(v) }
282
+ elsif value.is_a?(Hash)
283
+ {}.tap do |hash|
284
+ value.each { |k, v| hash[k] = _to_hash(v) }
285
+ end
286
+ elsif value.respond_to? :to_hash
287
+ value.to_hash
288
+ else
289
+ value
290
+ end
291
+ end end
292
+ end
@@ -129,7 +129,7 @@ module TurnkeyClient
129
129
  # @return true if the model is valid
130
130
  def valid?
131
131
  return false if @type.nil?
132
- type_validator = EnumAttributeValidator.new('Object', ['ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V6'])
132
+ type_validator = EnumAttributeValidator.new('Object', ['ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V7'])
133
133
  return false unless type_validator.valid?(@type)
134
134
  return false if @timestamp_ms.nil?
135
135
  return false if @organization_id.nil?
@@ -140,7 +140,7 @@ module TurnkeyClient
140
140
  # Custom attribute writer method checking allowed values (enum).
141
141
  # @param [Object] type Object to be assigned
142
142
  def type=(type)
143
- validator = EnumAttributeValidator.new('Object', ['ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V6'])
143
+ validator = EnumAttributeValidator.new('Object', ['ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V7'])
144
144
  unless validator.valid?(type)
145
145
  fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
146
146
  end