turnkey_client 0.0.4 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/turnkey_client/api/organizations_api.rb +58 -0
- data/lib/turnkey_client/api/policies_api.rb +58 -0
- data/lib/turnkey_client/api/private_keys_api.rb +58 -0
- data/lib/turnkey_client/api/sessions_api.rb +116 -0
- data/lib/turnkey_client/api/signing_api.rb +58 -0
- data/lib/turnkey_client/api/users_api.rb +232 -0
- data/lib/turnkey_client/api/wallets_api.rb +58 -0
- data/lib/turnkey_client/models/activity.rb +13 -4
- data/lib/turnkey_client/models/activity_type.rb +13 -0
- data/lib/turnkey_client/models/any.rb +200 -0
- data/lib/turnkey_client/models/api_key_curve.rb +28 -0
- data/lib/turnkey_client/models/api_key_params_v2.rb +250 -0
- data/lib/turnkey_client/models/config.rb +216 -0
- data/lib/turnkey_client/models/create_api_keys_intent_v2.rb +228 -0
- data/lib/turnkey_client/models/create_api_keys_request.rb +2 -2
- data/lib/turnkey_client/models/create_oauth_providers_intent.rb +228 -0
- data/lib/turnkey_client/models/create_oauth_providers_request.rb +288 -0
- data/lib/turnkey_client/models/create_oauth_providers_result.rb +213 -0
- data/lib/turnkey_client/models/create_policies_intent.rb +213 -0
- data/lib/turnkey_client/models/create_policies_request.rb +288 -0
- data/lib/turnkey_client/models/create_policies_result.rb +213 -0
- data/lib/turnkey_client/models/create_read_only_session_intent.rb +196 -0
- data/lib/turnkey_client/models/create_read_only_session_request.rb +288 -0
- data/lib/turnkey_client/models/create_read_only_session_result.rb +286 -0
- data/lib/turnkey_client/models/create_read_write_session_intent.rb +246 -0
- data/lib/turnkey_client/models/create_read_write_session_request.rb +288 -0
- data/lib/turnkey_client/models/create_read_write_session_result.rb +286 -0
- data/lib/turnkey_client/models/create_sub_organization_intent_v5.rb +272 -0
- data/lib/turnkey_client/models/create_sub_organization_intent_v6.rb +272 -0
- data/lib/turnkey_client/models/create_sub_organization_request.rb +2 -2
- data/lib/turnkey_client/models/create_sub_organization_result_v5.rb +230 -0
- data/lib/turnkey_client/models/create_sub_organization_result_v6.rb +230 -0
- data/lib/turnkey_client/models/credential_type.rb +3 -0
- data/lib/turnkey_client/models/delete_oauth_providers_intent.rb +228 -0
- data/lib/turnkey_client/models/delete_oauth_providers_request.rb +288 -0
- data/lib/turnkey_client/models/delete_oauth_providers_result.rb +213 -0
- data/lib/turnkey_client/models/delete_private_keys_intent.rb +223 -0
- data/lib/turnkey_client/models/delete_private_keys_request.rb +288 -0
- data/lib/turnkey_client/models/delete_private_keys_result.rb +213 -0
- data/lib/turnkey_client/models/delete_wallets_intent.rb +223 -0
- data/lib/turnkey_client/models/delete_wallets_request.rb +288 -0
- data/lib/turnkey_client/models/delete_wallets_result.rb +213 -0
- data/lib/turnkey_client/models/email_auth_intent.rb +14 -4
- data/lib/turnkey_client/models/email_auth_intent_v2.rb +265 -0
- data/lib/turnkey_client/models/email_auth_request.rb +2 -2
- data/lib/turnkey_client/models/email_customization_params.rb +1 -1
- data/lib/turnkey_client/models/external_data_v1_quorum.rb +228 -0
- data/lib/turnkey_client/models/get_oauth_providers_request.rb +221 -0
- data/lib/turnkey_client/models/get_oauth_providers_response.rb +213 -0
- data/lib/turnkey_client/models/get_organization_configs_request.rb +211 -0
- data/lib/turnkey_client/models/get_organization_configs_response.rb +210 -0
- data/lib/turnkey_client/models/get_sub_org_ids_request.rb +1 -1
- data/lib/turnkey_client/models/intent.rb +121 -9
- data/lib/turnkey_client/models/oauth_intent.rb +246 -0
- data/lib/turnkey_client/models/oauth_provider.rb +299 -0
- data/lib/turnkey_client/models/oauth_provider_params.rb +226 -0
- data/lib/turnkey_client/models/oauth_request.rb +288 -0
- data/lib/turnkey_client/models/oauth_result.rb +241 -0
- data/lib/turnkey_client/models/result.rb +103 -4
- data/lib/turnkey_client/models/root_user_params_v2.rb +272 -0
- data/lib/turnkey_client/models/root_user_params_v3.rb +272 -0
- data/lib/turnkey_client/models/sign_raw_payloads_intent.rb +256 -0
- data/lib/turnkey_client/models/sign_raw_payloads_request.rb +288 -0
- data/lib/turnkey_client/models/sign_raw_payloads_result.rb +207 -0
- data/lib/turnkey_client/models/status.rb +225 -0
- data/lib/turnkey_client/models/user.rb +18 -1
- data/lib/turnkey_client/models/wallet_account.rb +4 -19
- data/lib/turnkey_client/version.rb +1 -1
- data/lib/turnkey_client.rb +47 -0
- data/turnkey_client-0.0.4.gem +0 -0
- data/turnkey_client-0.0.7.gem +0 -0
- metadata +51 -2
@@ -0,0 +1,288 @@
|
|
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 OauthRequest
|
15
|
+
attr_accessor :type
|
16
|
+
|
17
|
+
# Timestamp (in milliseconds) of the request, used to verify liveness of user requests.
|
18
|
+
attr_accessor :timestamp_ms
|
19
|
+
|
20
|
+
# Unique identifier for a given Organization.
|
21
|
+
attr_accessor :organization_id
|
22
|
+
|
23
|
+
attr_accessor :parameters
|
24
|
+
|
25
|
+
class EnumAttributeValidator
|
26
|
+
attr_reader :datatype
|
27
|
+
attr_reader :allowable_values
|
28
|
+
|
29
|
+
def initialize(datatype, allowable_values)
|
30
|
+
@allowable_values = allowable_values.map do |value|
|
31
|
+
case datatype.to_s
|
32
|
+
when /Integer/i
|
33
|
+
value.to_i
|
34
|
+
when /Float/i
|
35
|
+
value.to_f
|
36
|
+
else
|
37
|
+
value
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
def valid?(value)
|
43
|
+
!value || allowable_values.include?(value)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
48
|
+
def self.attribute_map
|
49
|
+
{
|
50
|
+
:'type' => :'type',
|
51
|
+
:'timestamp_ms' => :'timestampMs',
|
52
|
+
:'organization_id' => :'organizationId',
|
53
|
+
:'parameters' => :'parameters'
|
54
|
+
}
|
55
|
+
end
|
56
|
+
|
57
|
+
# Attribute type mapping.
|
58
|
+
def self.openapi_types
|
59
|
+
{
|
60
|
+
:'type' => :'Object',
|
61
|
+
:'timestamp_ms' => :'Object',
|
62
|
+
:'organization_id' => :'Object',
|
63
|
+
:'parameters' => :'Object'
|
64
|
+
}
|
65
|
+
end
|
66
|
+
|
67
|
+
# List of attributes with nullable: true
|
68
|
+
def self.openapi_nullable
|
69
|
+
Set.new([
|
70
|
+
])
|
71
|
+
end
|
72
|
+
|
73
|
+
# Initializes the object
|
74
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
75
|
+
def initialize(attributes = {})
|
76
|
+
if (!attributes.is_a?(Hash))
|
77
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::OauthRequest` initialize method"
|
78
|
+
end
|
79
|
+
|
80
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
81
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
82
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
83
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::OauthRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
84
|
+
end
|
85
|
+
h[k.to_sym] = v
|
86
|
+
}
|
87
|
+
|
88
|
+
if attributes.key?(:'type')
|
89
|
+
self.type = attributes[:'type']
|
90
|
+
end
|
91
|
+
|
92
|
+
if attributes.key?(:'timestamp_ms')
|
93
|
+
self.timestamp_ms = attributes[:'timestamp_ms']
|
94
|
+
end
|
95
|
+
|
96
|
+
if attributes.key?(:'organization_id')
|
97
|
+
self.organization_id = attributes[:'organization_id']
|
98
|
+
end
|
99
|
+
|
100
|
+
if attributes.key?(:'parameters')
|
101
|
+
self.parameters = attributes[:'parameters']
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
106
|
+
# @return Array for valid properties with the reasons
|
107
|
+
def list_invalid_properties
|
108
|
+
invalid_properties = Array.new
|
109
|
+
if @type.nil?
|
110
|
+
invalid_properties.push('invalid value for "type", type cannot be nil.')
|
111
|
+
end
|
112
|
+
|
113
|
+
if @timestamp_ms.nil?
|
114
|
+
invalid_properties.push('invalid value for "timestamp_ms", timestamp_ms cannot be nil.')
|
115
|
+
end
|
116
|
+
|
117
|
+
if @organization_id.nil?
|
118
|
+
invalid_properties.push('invalid value for "organization_id", organization_id cannot be nil.')
|
119
|
+
end
|
120
|
+
|
121
|
+
if @parameters.nil?
|
122
|
+
invalid_properties.push('invalid value for "parameters", parameters cannot be nil.')
|
123
|
+
end
|
124
|
+
|
125
|
+
invalid_properties
|
126
|
+
end
|
127
|
+
|
128
|
+
# Check to see if the all the properties in the model are valid
|
129
|
+
# @return true if the model is valid
|
130
|
+
def valid?
|
131
|
+
return false if @type.nil?
|
132
|
+
type_validator = EnumAttributeValidator.new('Object', ['ACTIVITY_TYPE_OAUTH'])
|
133
|
+
return false unless type_validator.valid?(@type)
|
134
|
+
return false if @timestamp_ms.nil?
|
135
|
+
return false if @organization_id.nil?
|
136
|
+
return false if @parameters.nil?
|
137
|
+
true
|
138
|
+
end
|
139
|
+
|
140
|
+
# Custom attribute writer method checking allowed values (enum).
|
141
|
+
# @param [Object] type Object to be assigned
|
142
|
+
def type=(type)
|
143
|
+
validator = EnumAttributeValidator.new('Object', ['ACTIVITY_TYPE_OAUTH'])
|
144
|
+
unless validator.valid?(type)
|
145
|
+
fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
|
146
|
+
end
|
147
|
+
@type = type
|
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
|
+
type == o.type &&
|
156
|
+
timestamp_ms == o.timestamp_ms &&
|
157
|
+
organization_id == o.organization_id &&
|
158
|
+
parameters == o.parameters
|
159
|
+
end
|
160
|
+
|
161
|
+
# @see the `==` method
|
162
|
+
# @param [Object] Object to be compared
|
163
|
+
def eql?(o)
|
164
|
+
self == o
|
165
|
+
end
|
166
|
+
|
167
|
+
# Calculates hash code according to all attributes.
|
168
|
+
# @return [Integer] Hash code
|
169
|
+
def hash
|
170
|
+
[type, timestamp_ms, organization_id, parameters].hash
|
171
|
+
end
|
172
|
+
|
173
|
+
# Builds the object from hash
|
174
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
175
|
+
# @return [Object] Returns the model itself
|
176
|
+
def self.build_from_hash(attributes)
|
177
|
+
new.build_from_hash(attributes)
|
178
|
+
end
|
179
|
+
|
180
|
+
# Builds the object from hash
|
181
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
182
|
+
# @return [Object] Returns the model itself
|
183
|
+
def build_from_hash(attributes)
|
184
|
+
return nil unless attributes.is_a?(Hash)
|
185
|
+
self.class.openapi_types.each_pair do |key, type|
|
186
|
+
if type =~ /\AArray<(.*)>/i
|
187
|
+
# check to ensure the input is an array given that the attribute
|
188
|
+
# is documented as an array but the input is not
|
189
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
190
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
191
|
+
end
|
192
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
193
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
194
|
+
elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
195
|
+
self.send("#{key}=", nil)
|
196
|
+
end
|
197
|
+
end
|
198
|
+
|
199
|
+
self
|
200
|
+
end
|
201
|
+
|
202
|
+
# Deserializes the data based on type
|
203
|
+
# @param string type Data type
|
204
|
+
# @param string value Value to be deserialized
|
205
|
+
# @return [Object] Deserialized data
|
206
|
+
def _deserialize(type, value)
|
207
|
+
case type.to_sym
|
208
|
+
when :DateTime
|
209
|
+
DateTime.parse(value)
|
210
|
+
when :Date
|
211
|
+
Date.parse(value)
|
212
|
+
when :String
|
213
|
+
value.to_s
|
214
|
+
when :Integer
|
215
|
+
value.to_i
|
216
|
+
when :Float
|
217
|
+
value.to_f
|
218
|
+
when :Boolean
|
219
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
220
|
+
true
|
221
|
+
else
|
222
|
+
false
|
223
|
+
end
|
224
|
+
when :Object
|
225
|
+
# generic object (usually a Hash), return directly
|
226
|
+
value
|
227
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
228
|
+
inner_type = Regexp.last_match[:inner_type]
|
229
|
+
value.map { |v| _deserialize(inner_type, v) }
|
230
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
231
|
+
k_type = Regexp.last_match[:k_type]
|
232
|
+
v_type = Regexp.last_match[:v_type]
|
233
|
+
{}.tap do |hash|
|
234
|
+
value.each do |k, v|
|
235
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
236
|
+
end
|
237
|
+
end
|
238
|
+
else # model
|
239
|
+
TurnkeyClient.const_get(type).build_from_hash(value)
|
240
|
+
end
|
241
|
+
end
|
242
|
+
|
243
|
+
# Returns the string representation of the object
|
244
|
+
# @return [String] String presentation of the object
|
245
|
+
def to_s
|
246
|
+
to_hash.to_s
|
247
|
+
end
|
248
|
+
|
249
|
+
# to_body is an alias to to_hash (backward compatibility)
|
250
|
+
# @return [Hash] Returns the object in the form of hash
|
251
|
+
def to_body
|
252
|
+
to_hash
|
253
|
+
end
|
254
|
+
|
255
|
+
# Returns the object in the form of hash
|
256
|
+
# @return [Hash] Returns the object in the form of hash
|
257
|
+
def to_hash
|
258
|
+
hash = {}
|
259
|
+
self.class.attribute_map.each_pair do |attr, param|
|
260
|
+
value = self.send(attr)
|
261
|
+
if value.nil?
|
262
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
263
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
264
|
+
end
|
265
|
+
|
266
|
+
hash[param] = _to_hash(value)
|
267
|
+
end
|
268
|
+
hash
|
269
|
+
end
|
270
|
+
|
271
|
+
# Outputs non-array value in the form of hash
|
272
|
+
# For object, use to_hash. Otherwise, just return the value
|
273
|
+
# @param [Object] value Any valid value
|
274
|
+
# @return [Hash] Returns the value in the form of hash
|
275
|
+
def _to_hash(value)
|
276
|
+
if value.is_a?(Array)
|
277
|
+
value.compact.map { |v| _to_hash(v) }
|
278
|
+
elsif value.is_a?(Hash)
|
279
|
+
{}.tap do |hash|
|
280
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
281
|
+
end
|
282
|
+
elsif value.respond_to? :to_hash
|
283
|
+
value.to_hash
|
284
|
+
else
|
285
|
+
value
|
286
|
+
end
|
287
|
+
end end
|
288
|
+
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 OauthResult
|
15
|
+
# Unique identifier for the authenticating User.
|
16
|
+
attr_accessor :user_id
|
17
|
+
|
18
|
+
# Unique identifier for the created API key.
|
19
|
+
attr_accessor :api_key_id
|
20
|
+
|
21
|
+
# HPKE encrypted credential bundle
|
22
|
+
attr_accessor :credential_bundle
|
23
|
+
|
24
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
25
|
+
def self.attribute_map
|
26
|
+
{
|
27
|
+
:'user_id' => :'userId',
|
28
|
+
:'api_key_id' => :'apiKeyId',
|
29
|
+
:'credential_bundle' => :'credentialBundle'
|
30
|
+
}
|
31
|
+
end
|
32
|
+
|
33
|
+
# Attribute type mapping.
|
34
|
+
def self.openapi_types
|
35
|
+
{
|
36
|
+
:'user_id' => :'Object',
|
37
|
+
:'api_key_id' => :'Object',
|
38
|
+
:'credential_bundle' => :'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::OauthResult` 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::OauthResult`. 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?(:'user_id')
|
64
|
+
self.user_id = attributes[:'user_id']
|
65
|
+
end
|
66
|
+
|
67
|
+
if attributes.key?(:'api_key_id')
|
68
|
+
self.api_key_id = attributes[:'api_key_id']
|
69
|
+
end
|
70
|
+
|
71
|
+
if attributes.key?(:'credential_bundle')
|
72
|
+
self.credential_bundle = attributes[:'credential_bundle']
|
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 @user_id.nil?
|
81
|
+
invalid_properties.push('invalid value for "user_id", user_id cannot be nil.')
|
82
|
+
end
|
83
|
+
|
84
|
+
if @api_key_id.nil?
|
85
|
+
invalid_properties.push('invalid value for "api_key_id", api_key_id cannot be nil.')
|
86
|
+
end
|
87
|
+
|
88
|
+
if @credential_bundle.nil?
|
89
|
+
invalid_properties.push('invalid value for "credential_bundle", credential_bundle 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 @user_id.nil?
|
99
|
+
return false if @api_key_id.nil?
|
100
|
+
return false if @credential_bundle.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
|
+
user_id == o.user_id &&
|
110
|
+
api_key_id == o.api_key_id &&
|
111
|
+
credential_bundle == o.credential_bundle
|
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
|
+
[user_id, api_key_id, credential_bundle].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
|
@@ -110,6 +110,28 @@ module TurnkeyClient
|
|
110
110
|
|
111
111
|
attr_accessor :import_private_key_result
|
112
112
|
|
113
|
+
attr_accessor :create_policies_result
|
114
|
+
|
115
|
+
attr_accessor :sign_raw_payloads_result
|
116
|
+
|
117
|
+
attr_accessor :create_read_only_session_result
|
118
|
+
|
119
|
+
attr_accessor :create_oauth_providers_result
|
120
|
+
|
121
|
+
attr_accessor :delete_oauth_providers_result
|
122
|
+
|
123
|
+
attr_accessor :create_sub_organization_result_v5
|
124
|
+
|
125
|
+
attr_accessor :oauth_result
|
126
|
+
|
127
|
+
attr_accessor :create_read_write_session_result
|
128
|
+
|
129
|
+
attr_accessor :create_sub_organization_result_v6
|
130
|
+
|
131
|
+
attr_accessor :delete_private_keys_result
|
132
|
+
|
133
|
+
attr_accessor :delete_wallets_result
|
134
|
+
|
113
135
|
# Attribute mapping from ruby-style variable name to JSON key.
|
114
136
|
def self.attribute_map
|
115
137
|
{
|
@@ -161,7 +183,18 @@ module TurnkeyClient
|
|
161
183
|
:'init_import_wallet_result' => :'initImportWalletResult',
|
162
184
|
:'import_wallet_result' => :'importWalletResult',
|
163
185
|
:'init_import_private_key_result' => :'initImportPrivateKeyResult',
|
164
|
-
:'import_private_key_result' => :'importPrivateKeyResult'
|
186
|
+
:'import_private_key_result' => :'importPrivateKeyResult',
|
187
|
+
:'create_policies_result' => :'createPoliciesResult',
|
188
|
+
:'sign_raw_payloads_result' => :'signRawPayloadsResult',
|
189
|
+
:'create_read_only_session_result' => :'createReadOnlySessionResult',
|
190
|
+
:'create_oauth_providers_result' => :'createOauthProvidersResult',
|
191
|
+
:'delete_oauth_providers_result' => :'deleteOauthProvidersResult',
|
192
|
+
:'create_sub_organization_result_v5' => :'createSubOrganizationResultV5',
|
193
|
+
:'oauth_result' => :'oauthResult',
|
194
|
+
:'create_read_write_session_result' => :'createReadWriteSessionResult',
|
195
|
+
:'create_sub_organization_result_v6' => :'createSubOrganizationResultV6',
|
196
|
+
:'delete_private_keys_result' => :'deletePrivateKeysResult',
|
197
|
+
:'delete_wallets_result' => :'deleteWalletsResult'
|
165
198
|
}
|
166
199
|
end
|
167
200
|
|
@@ -216,7 +249,18 @@ module TurnkeyClient
|
|
216
249
|
:'init_import_wallet_result' => :'Object',
|
217
250
|
:'import_wallet_result' => :'Object',
|
218
251
|
:'init_import_private_key_result' => :'Object',
|
219
|
-
:'import_private_key_result' => :'Object'
|
252
|
+
:'import_private_key_result' => :'Object',
|
253
|
+
:'create_policies_result' => :'Object',
|
254
|
+
:'sign_raw_payloads_result' => :'Object',
|
255
|
+
:'create_read_only_session_result' => :'Object',
|
256
|
+
:'create_oauth_providers_result' => :'Object',
|
257
|
+
:'delete_oauth_providers_result' => :'Object',
|
258
|
+
:'create_sub_organization_result_v5' => :'Object',
|
259
|
+
:'oauth_result' => :'Object',
|
260
|
+
:'create_read_write_session_result' => :'Object',
|
261
|
+
:'create_sub_organization_result_v6' => :'Object',
|
262
|
+
:'delete_private_keys_result' => :'Object',
|
263
|
+
:'delete_wallets_result' => :'Object'
|
220
264
|
}
|
221
265
|
end
|
222
266
|
|
@@ -436,6 +480,50 @@ module TurnkeyClient
|
|
436
480
|
if attributes.key?(:'import_private_key_result')
|
437
481
|
self.import_private_key_result = attributes[:'import_private_key_result']
|
438
482
|
end
|
483
|
+
|
484
|
+
if attributes.key?(:'create_policies_result')
|
485
|
+
self.create_policies_result = attributes[:'create_policies_result']
|
486
|
+
end
|
487
|
+
|
488
|
+
if attributes.key?(:'sign_raw_payloads_result')
|
489
|
+
self.sign_raw_payloads_result = attributes[:'sign_raw_payloads_result']
|
490
|
+
end
|
491
|
+
|
492
|
+
if attributes.key?(:'create_read_only_session_result')
|
493
|
+
self.create_read_only_session_result = attributes[:'create_read_only_session_result']
|
494
|
+
end
|
495
|
+
|
496
|
+
if attributes.key?(:'create_oauth_providers_result')
|
497
|
+
self.create_oauth_providers_result = attributes[:'create_oauth_providers_result']
|
498
|
+
end
|
499
|
+
|
500
|
+
if attributes.key?(:'delete_oauth_providers_result')
|
501
|
+
self.delete_oauth_providers_result = attributes[:'delete_oauth_providers_result']
|
502
|
+
end
|
503
|
+
|
504
|
+
if attributes.key?(:'create_sub_organization_result_v5')
|
505
|
+
self.create_sub_organization_result_v5 = attributes[:'create_sub_organization_result_v5']
|
506
|
+
end
|
507
|
+
|
508
|
+
if attributes.key?(:'oauth_result')
|
509
|
+
self.oauth_result = attributes[:'oauth_result']
|
510
|
+
end
|
511
|
+
|
512
|
+
if attributes.key?(:'create_read_write_session_result')
|
513
|
+
self.create_read_write_session_result = attributes[:'create_read_write_session_result']
|
514
|
+
end
|
515
|
+
|
516
|
+
if attributes.key?(:'create_sub_organization_result_v6')
|
517
|
+
self.create_sub_organization_result_v6 = attributes[:'create_sub_organization_result_v6']
|
518
|
+
end
|
519
|
+
|
520
|
+
if attributes.key?(:'delete_private_keys_result')
|
521
|
+
self.delete_private_keys_result = attributes[:'delete_private_keys_result']
|
522
|
+
end
|
523
|
+
|
524
|
+
if attributes.key?(:'delete_wallets_result')
|
525
|
+
self.delete_wallets_result = attributes[:'delete_wallets_result']
|
526
|
+
end
|
439
527
|
end
|
440
528
|
|
441
529
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -504,7 +592,18 @@ module TurnkeyClient
|
|
504
592
|
init_import_wallet_result == o.init_import_wallet_result &&
|
505
593
|
import_wallet_result == o.import_wallet_result &&
|
506
594
|
init_import_private_key_result == o.init_import_private_key_result &&
|
507
|
-
import_private_key_result == o.import_private_key_result
|
595
|
+
import_private_key_result == o.import_private_key_result &&
|
596
|
+
create_policies_result == o.create_policies_result &&
|
597
|
+
sign_raw_payloads_result == o.sign_raw_payloads_result &&
|
598
|
+
create_read_only_session_result == o.create_read_only_session_result &&
|
599
|
+
create_oauth_providers_result == o.create_oauth_providers_result &&
|
600
|
+
delete_oauth_providers_result == o.delete_oauth_providers_result &&
|
601
|
+
create_sub_organization_result_v5 == o.create_sub_organization_result_v5 &&
|
602
|
+
oauth_result == o.oauth_result &&
|
603
|
+
create_read_write_session_result == o.create_read_write_session_result &&
|
604
|
+
create_sub_organization_result_v6 == o.create_sub_organization_result_v6 &&
|
605
|
+
delete_private_keys_result == o.delete_private_keys_result &&
|
606
|
+
delete_wallets_result == o.delete_wallets_result
|
508
607
|
end
|
509
608
|
|
510
609
|
# @see the `==` method
|
@@ -516,7 +615,7 @@ module TurnkeyClient
|
|
516
615
|
# Calculates hash code according to all attributes.
|
517
616
|
# @return [Integer] Hash code
|
518
617
|
def hash
|
519
|
-
[create_organization_result, create_authenticators_result, create_users_result, create_private_keys_result, create_invitations_result, accept_invitation_result, sign_raw_payload_result, create_policy_result, disable_private_key_result, delete_users_result, delete_authenticators_result, delete_invitation_result, delete_organization_result, delete_policy_result, create_user_tag_result, delete_user_tags_result, sign_transaction_result, delete_api_keys_result, create_api_keys_result, create_private_key_tag_result, delete_private_key_tags_result, set_payment_method_result, activate_billing_tier_result, delete_payment_method_result, create_api_only_users_result, update_root_quorum_result, update_user_tag_result, update_private_key_tag_result, create_sub_organization_result, update_allowed_origins_result, create_private_keys_result_v2, update_user_result, update_policy_result, create_sub_organization_result_v3, create_wallet_result, create_wallet_accounts_result, init_user_email_recovery_result, recover_user_result, set_organization_feature_result, remove_organization_feature_result, export_private_key_result, export_wallet_result, create_sub_organization_result_v4, email_auth_result, export_wallet_account_result, init_import_wallet_result, import_wallet_result, init_import_private_key_result, import_private_key_result].hash
|
618
|
+
[create_organization_result, create_authenticators_result, create_users_result, create_private_keys_result, create_invitations_result, accept_invitation_result, sign_raw_payload_result, create_policy_result, disable_private_key_result, delete_users_result, delete_authenticators_result, delete_invitation_result, delete_organization_result, delete_policy_result, create_user_tag_result, delete_user_tags_result, sign_transaction_result, delete_api_keys_result, create_api_keys_result, create_private_key_tag_result, delete_private_key_tags_result, set_payment_method_result, activate_billing_tier_result, delete_payment_method_result, create_api_only_users_result, update_root_quorum_result, update_user_tag_result, update_private_key_tag_result, create_sub_organization_result, update_allowed_origins_result, create_private_keys_result_v2, update_user_result, update_policy_result, create_sub_organization_result_v3, create_wallet_result, create_wallet_accounts_result, init_user_email_recovery_result, recover_user_result, set_organization_feature_result, remove_organization_feature_result, export_private_key_result, export_wallet_result, create_sub_organization_result_v4, email_auth_result, export_wallet_account_result, init_import_wallet_result, import_wallet_result, init_import_private_key_result, import_private_key_result, create_policies_result, sign_raw_payloads_result, create_read_only_session_result, create_oauth_providers_result, delete_oauth_providers_result, create_sub_organization_result_v5, oauth_result, create_read_write_session_result, create_sub_organization_result_v6, delete_private_keys_result, delete_wallets_result].hash
|
520
619
|
end
|
521
620
|
|
522
621
|
# Builds the object from hash
|