akeyless 2.16.12 → 2.17.0
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.
- checksums.yaml +4 -4
- data/README.md +5 -5
- data/docs/CreateArtifactoryTarget.md +1 -1
- data/docs/CreateKeyOutput.md +5 -1
- data/docs/CreateLdapTarget.md +2 -0
- data/docs/CreateSalesforceTarget.md +7 -3
- data/docs/Decrypt.md +3 -1
- data/docs/DecryptFile.md +6 -0
- data/docs/DecryptPKCS1.md +5 -1
- data/docs/DescribeItem.md +4 -0
- data/docs/DescribeSubClaims.md +20 -0
- data/docs/DescribeSubClaimsOutput.md +18 -0
- data/docs/Encrypt.md +3 -1
- data/docs/EncryptFile.md +4 -0
- data/docs/EncryptPKCS1.md +5 -1
- data/docs/GatewayCreateK8SAuthConfig.md +7 -1
- data/docs/GatewayCreateProducerDockerhub.md +1 -1
- data/docs/GatewayGetK8SAuthConfigOutput.md +7 -1
- data/docs/GatewayUpdateK8SAuthConfig.md +7 -1
- data/docs/GatewayUpdateProducerDockerhub.md +1 -1
- data/docs/K8SAuth.md +7 -1
- data/docs/SignPKCS1.md +5 -1
- data/docs/TargetTypeDetailsInput.md +3 -1
- data/docs/UpdateLdapTarget.md +2 -0
- data/docs/UpdateSalesforceTarget.md +7 -3
- data/docs/V2Api.md +69 -69
- data/docs/VerifyPKCS1.md +4 -0
- data/lib/akeyless/api/v2_api.rb +65 -65
- data/lib/akeyless/models/create_artifactory_target.rb +1 -1
- data/lib/akeyless/models/create_key_output.rb +22 -4
- data/lib/akeyless/models/create_ldap_target.rb +13 -1
- data/lib/akeyless/models/create_salesforce_target.rb +29 -19
- data/lib/akeyless/models/decrypt.rb +16 -1
- data/lib/akeyless/models/decrypt_file.rb +36 -1
- data/lib/akeyless/models/decrypt_pkcs1.rb +22 -2
- data/lib/akeyless/models/describe_item.rb +21 -1
- data/lib/akeyless/models/describe_sub_claims.rb +231 -0
- data/lib/akeyless/models/describe_sub_claims_output.rb +221 -0
- data/lib/akeyless/models/encrypt.rb +16 -1
- data/lib/akeyless/models/encrypt_file.rb +21 -1
- data/lib/akeyless/models/encrypt_pkcs1.rb +22 -2
- data/lib/akeyless/models/gateway_create_k8_s_auth_config.rb +34 -2
- data/lib/akeyless/models/gateway_create_producer_dockerhub.rb +1 -1
- data/lib/akeyless/models/gateway_get_k8_s_auth_config_output.rb +32 -2
- data/lib/akeyless/models/gateway_update_k8_s_auth_config.rb +34 -2
- data/lib/akeyless/models/gateway_update_producer_dockerhub.rb +1 -1
- data/lib/akeyless/models/k8_s_auth.rb +32 -2
- data/lib/akeyless/models/sign_pkcs1.rb +21 -6
- data/lib/akeyless/models/target_type_details_input.rb +14 -1
- data/lib/akeyless/models/update_ldap_target.rb +11 -1
- data/lib/akeyless/models/update_salesforce_target.rb +29 -19
- data/lib/akeyless/models/verify_pkcs1.rb +21 -1
- data/lib/akeyless/version.rb +1 -1
- data/lib/akeyless.rb +2 -2
- data/spec/models/describe_sub_claims_output_spec.rb +34 -0
- data/spec/models/describe_sub_claims_spec.rb +40 -0
- metadata +10 -2
@@ -25,6 +25,9 @@ module Akeyless
|
|
25
25
|
# The encryption context. If this was specified in the encrypt command, it must be specified here or the decryption operation will fail
|
26
26
|
attr_accessor :encryption_context
|
27
27
|
|
28
|
+
# The item id of the key to use in the decryption process
|
29
|
+
attr_accessor :item_id
|
30
|
+
|
28
31
|
# The name of the key to use in the decryption process
|
29
32
|
attr_accessor :key_name
|
30
33
|
|
@@ -40,6 +43,7 @@ module Akeyless
|
|
40
43
|
:'ciphertext' => :'ciphertext',
|
41
44
|
:'display_id' => :'display-id',
|
42
45
|
:'encryption_context' => :'encryption-context',
|
46
|
+
:'item_id' => :'item-id',
|
43
47
|
:'key_name' => :'key-name',
|
44
48
|
:'token' => :'token',
|
45
49
|
:'uid_token' => :'uid-token'
|
@@ -57,6 +61,7 @@ module Akeyless
|
|
57
61
|
:'ciphertext' => :'String',
|
58
62
|
:'display_id' => :'String',
|
59
63
|
:'encryption_context' => :'Hash<String, String>',
|
64
|
+
:'item_id' => :'Integer',
|
60
65
|
:'key_name' => :'String',
|
61
66
|
:'token' => :'String',
|
62
67
|
:'uid_token' => :'String'
|
@@ -98,6 +103,10 @@ module Akeyless
|
|
98
103
|
end
|
99
104
|
end
|
100
105
|
|
106
|
+
if attributes.key?(:'item_id')
|
107
|
+
self.item_id = attributes[:'item_id']
|
108
|
+
end
|
109
|
+
|
101
110
|
if attributes.key?(:'key_name')
|
102
111
|
self.key_name = attributes[:'key_name']
|
103
112
|
end
|
@@ -115,12 +124,17 @@ module Akeyless
|
|
115
124
|
# @return Array for valid properties with the reasons
|
116
125
|
def list_invalid_properties
|
117
126
|
invalid_properties = Array.new
|
127
|
+
if @key_name.nil?
|
128
|
+
invalid_properties.push('invalid value for "key_name", key_name cannot be nil.')
|
129
|
+
end
|
130
|
+
|
118
131
|
invalid_properties
|
119
132
|
end
|
120
133
|
|
121
134
|
# Check to see if the all the properties in the model are valid
|
122
135
|
# @return true if the model is valid
|
123
136
|
def valid?
|
137
|
+
return false if @key_name.nil?
|
124
138
|
true
|
125
139
|
end
|
126
140
|
|
@@ -132,6 +146,7 @@ module Akeyless
|
|
132
146
|
ciphertext == o.ciphertext &&
|
133
147
|
display_id == o.display_id &&
|
134
148
|
encryption_context == o.encryption_context &&
|
149
|
+
item_id == o.item_id &&
|
135
150
|
key_name == o.key_name &&
|
136
151
|
token == o.token &&
|
137
152
|
uid_token == o.uid_token
|
@@ -146,7 +161,7 @@ module Akeyless
|
|
146
161
|
# Calculates hash code according to all attributes.
|
147
162
|
# @return [Integer] Hash code
|
148
163
|
def hash
|
149
|
-
[ciphertext, display_id, encryption_context, key_name, token, uid_token].hash
|
164
|
+
[ciphertext, display_id, encryption_context, item_id, key_name, token, uid_token].hash
|
150
165
|
end
|
151
166
|
|
152
167
|
# Builds the object from hash
|
@@ -15,6 +15,15 @@ require 'time'
|
|
15
15
|
|
16
16
|
module Akeyless
|
17
17
|
class DecryptFile
|
18
|
+
# The display id of the key to use in the decryption process
|
19
|
+
attr_accessor :display_id
|
20
|
+
|
21
|
+
# The item id of the key to use in the decryption process
|
22
|
+
attr_accessor :item_id
|
23
|
+
|
24
|
+
# The name of the key to use in the decryption process
|
25
|
+
attr_accessor :key_name
|
26
|
+
|
18
27
|
# Authentication token (see `/auth` and `/configure`)
|
19
28
|
attr_accessor :token
|
20
29
|
|
@@ -24,6 +33,9 @@ module Akeyless
|
|
24
33
|
# Attribute mapping from ruby-style variable name to JSON key.
|
25
34
|
def self.attribute_map
|
26
35
|
{
|
36
|
+
:'display_id' => :'display-id',
|
37
|
+
:'item_id' => :'item-id',
|
38
|
+
:'key_name' => :'key-name',
|
27
39
|
:'token' => :'token',
|
28
40
|
:'uid_token' => :'uid-token'
|
29
41
|
}
|
@@ -37,6 +49,9 @@ module Akeyless
|
|
37
49
|
# Attribute type mapping.
|
38
50
|
def self.openapi_types
|
39
51
|
{
|
52
|
+
:'display_id' => :'String',
|
53
|
+
:'item_id' => :'Integer',
|
54
|
+
:'key_name' => :'String',
|
40
55
|
:'token' => :'String',
|
41
56
|
:'uid_token' => :'String'
|
42
57
|
}
|
@@ -63,6 +78,18 @@ module Akeyless
|
|
63
78
|
h[k.to_sym] = v
|
64
79
|
}
|
65
80
|
|
81
|
+
if attributes.key?(:'display_id')
|
82
|
+
self.display_id = attributes[:'display_id']
|
83
|
+
end
|
84
|
+
|
85
|
+
if attributes.key?(:'item_id')
|
86
|
+
self.item_id = attributes[:'item_id']
|
87
|
+
end
|
88
|
+
|
89
|
+
if attributes.key?(:'key_name')
|
90
|
+
self.key_name = attributes[:'key_name']
|
91
|
+
end
|
92
|
+
|
66
93
|
if attributes.key?(:'token')
|
67
94
|
self.token = attributes[:'token']
|
68
95
|
end
|
@@ -76,12 +103,17 @@ module Akeyless
|
|
76
103
|
# @return Array for valid properties with the reasons
|
77
104
|
def list_invalid_properties
|
78
105
|
invalid_properties = Array.new
|
106
|
+
if @key_name.nil?
|
107
|
+
invalid_properties.push('invalid value for "key_name", key_name cannot be nil.')
|
108
|
+
end
|
109
|
+
|
79
110
|
invalid_properties
|
80
111
|
end
|
81
112
|
|
82
113
|
# Check to see if the all the properties in the model are valid
|
83
114
|
# @return true if the model is valid
|
84
115
|
def valid?
|
116
|
+
return false if @key_name.nil?
|
85
117
|
true
|
86
118
|
end
|
87
119
|
|
@@ -90,6 +122,9 @@ module Akeyless
|
|
90
122
|
def ==(o)
|
91
123
|
return true if self.equal?(o)
|
92
124
|
self.class == o.class &&
|
125
|
+
display_id == o.display_id &&
|
126
|
+
item_id == o.item_id &&
|
127
|
+
key_name == o.key_name &&
|
93
128
|
token == o.token &&
|
94
129
|
uid_token == o.uid_token
|
95
130
|
end
|
@@ -103,7 +138,7 @@ module Akeyless
|
|
103
138
|
# Calculates hash code according to all attributes.
|
104
139
|
# @return [Integer] Hash code
|
105
140
|
def hash
|
106
|
-
[token, uid_token].hash
|
141
|
+
[display_id, item_id, key_name, token, uid_token].hash
|
107
142
|
end
|
108
143
|
|
109
144
|
# Builds the object from hash
|
@@ -18,7 +18,13 @@ module Akeyless
|
|
18
18
|
# Ciphertext to be decrypted in base64 encoded format
|
19
19
|
attr_accessor :ciphertext
|
20
20
|
|
21
|
-
# The
|
21
|
+
# The display id of the key to use in the decryption process
|
22
|
+
attr_accessor :display_id
|
23
|
+
|
24
|
+
# The item id of the key to use in the decryption process
|
25
|
+
attr_accessor :item_id
|
26
|
+
|
27
|
+
# The name of the key to use in the decryption process
|
22
28
|
attr_accessor :key_name
|
23
29
|
|
24
30
|
# Authentication token (see `/auth` and `/configure`)
|
@@ -31,6 +37,8 @@ module Akeyless
|
|
31
37
|
def self.attribute_map
|
32
38
|
{
|
33
39
|
:'ciphertext' => :'ciphertext',
|
40
|
+
:'display_id' => :'display-id',
|
41
|
+
:'item_id' => :'item-id',
|
34
42
|
:'key_name' => :'key-name',
|
35
43
|
:'token' => :'token',
|
36
44
|
:'uid_token' => :'uid-token'
|
@@ -46,6 +54,8 @@ module Akeyless
|
|
46
54
|
def self.openapi_types
|
47
55
|
{
|
48
56
|
:'ciphertext' => :'String',
|
57
|
+
:'display_id' => :'String',
|
58
|
+
:'item_id' => :'Integer',
|
49
59
|
:'key_name' => :'String',
|
50
60
|
:'token' => :'String',
|
51
61
|
:'uid_token' => :'String'
|
@@ -77,6 +87,14 @@ module Akeyless
|
|
77
87
|
self.ciphertext = attributes[:'ciphertext']
|
78
88
|
end
|
79
89
|
|
90
|
+
if attributes.key?(:'display_id')
|
91
|
+
self.display_id = attributes[:'display_id']
|
92
|
+
end
|
93
|
+
|
94
|
+
if attributes.key?(:'item_id')
|
95
|
+
self.item_id = attributes[:'item_id']
|
96
|
+
end
|
97
|
+
|
80
98
|
if attributes.key?(:'key_name')
|
81
99
|
self.key_name = attributes[:'key_name']
|
82
100
|
end
|
@@ -119,6 +137,8 @@ module Akeyless
|
|
119
137
|
return true if self.equal?(o)
|
120
138
|
self.class == o.class &&
|
121
139
|
ciphertext == o.ciphertext &&
|
140
|
+
display_id == o.display_id &&
|
141
|
+
item_id == o.item_id &&
|
122
142
|
key_name == o.key_name &&
|
123
143
|
token == o.token &&
|
124
144
|
uid_token == o.uid_token
|
@@ -133,7 +153,7 @@ module Akeyless
|
|
133
153
|
# Calculates hash code according to all attributes.
|
134
154
|
# @return [Integer] Hash code
|
135
155
|
def hash
|
136
|
-
[ciphertext, key_name, token, uid_token].hash
|
156
|
+
[ciphertext, display_id, item_id, key_name, token, uid_token].hash
|
137
157
|
end
|
138
158
|
|
139
159
|
# Builds the object from hash
|
@@ -15,6 +15,12 @@ require 'time'
|
|
15
15
|
|
16
16
|
module Akeyless
|
17
17
|
class DescribeItem
|
18
|
+
# The display id of the item
|
19
|
+
attr_accessor :display_id
|
20
|
+
|
21
|
+
# Item id of the item
|
22
|
+
attr_accessor :item_id
|
23
|
+
|
18
24
|
# Item name
|
19
25
|
attr_accessor :name
|
20
26
|
|
@@ -30,6 +36,8 @@ module Akeyless
|
|
30
36
|
# Attribute mapping from ruby-style variable name to JSON key.
|
31
37
|
def self.attribute_map
|
32
38
|
{
|
39
|
+
:'display_id' => :'display-id',
|
40
|
+
:'item_id' => :'item-id',
|
33
41
|
:'name' => :'name',
|
34
42
|
:'show_versions' => :'show-versions',
|
35
43
|
:'token' => :'token',
|
@@ -45,6 +53,8 @@ module Akeyless
|
|
45
53
|
# Attribute type mapping.
|
46
54
|
def self.openapi_types
|
47
55
|
{
|
56
|
+
:'display_id' => :'String',
|
57
|
+
:'item_id' => :'Integer',
|
48
58
|
:'name' => :'String',
|
49
59
|
:'show_versions' => :'Boolean',
|
50
60
|
:'token' => :'String',
|
@@ -73,6 +83,14 @@ module Akeyless
|
|
73
83
|
h[k.to_sym] = v
|
74
84
|
}
|
75
85
|
|
86
|
+
if attributes.key?(:'display_id')
|
87
|
+
self.display_id = attributes[:'display_id']
|
88
|
+
end
|
89
|
+
|
90
|
+
if attributes.key?(:'item_id')
|
91
|
+
self.item_id = attributes[:'item_id']
|
92
|
+
end
|
93
|
+
|
76
94
|
if attributes.key?(:'name')
|
77
95
|
self.name = attributes[:'name']
|
78
96
|
end
|
@@ -115,6 +133,8 @@ module Akeyless
|
|
115
133
|
def ==(o)
|
116
134
|
return true if self.equal?(o)
|
117
135
|
self.class == o.class &&
|
136
|
+
display_id == o.display_id &&
|
137
|
+
item_id == o.item_id &&
|
118
138
|
name == o.name &&
|
119
139
|
show_versions == o.show_versions &&
|
120
140
|
token == o.token &&
|
@@ -130,7 +150,7 @@ module Akeyless
|
|
130
150
|
# Calculates hash code according to all attributes.
|
131
151
|
# @return [Integer] Hash code
|
132
152
|
def hash
|
133
|
-
[name, show_versions, token, uid_token].hash
|
153
|
+
[display_id, item_id, name, show_versions, token, uid_token].hash
|
134
154
|
end
|
135
155
|
|
136
156
|
# Builds the object from hash
|
@@ -0,0 +1,231 @@
|
|
1
|
+
=begin
|
2
|
+
#Akeyless API
|
3
|
+
|
4
|
+
#The purpose of this application is to provide access to Akeyless API.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 2.0
|
7
|
+
Contact: support@akeyless.io
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 6.1.0-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module Akeyless
|
17
|
+
# describe-sub-claims Get the sub-claims associated with the provided token or authentication profile
|
18
|
+
class DescribeSubClaims
|
19
|
+
# Authentication token (see `/auth` and `/configure`)
|
20
|
+
attr_accessor :token
|
21
|
+
|
22
|
+
# The universal identity token, Required only for universal_identity authentication
|
23
|
+
attr_accessor :uid_token
|
24
|
+
|
25
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
26
|
+
def self.attribute_map
|
27
|
+
{
|
28
|
+
:'token' => :'token',
|
29
|
+
:'uid_token' => :'uid-token'
|
30
|
+
}
|
31
|
+
end
|
32
|
+
|
33
|
+
# Returns all the JSON keys this model knows about
|
34
|
+
def self.acceptable_attributes
|
35
|
+
attribute_map.values
|
36
|
+
end
|
37
|
+
|
38
|
+
# Attribute type mapping.
|
39
|
+
def self.openapi_types
|
40
|
+
{
|
41
|
+
:'token' => :'String',
|
42
|
+
:'uid_token' => :'String'
|
43
|
+
}
|
44
|
+
end
|
45
|
+
|
46
|
+
# List of attributes with nullable: true
|
47
|
+
def self.openapi_nullable
|
48
|
+
Set.new([
|
49
|
+
])
|
50
|
+
end
|
51
|
+
|
52
|
+
# Initializes the object
|
53
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
54
|
+
def initialize(attributes = {})
|
55
|
+
if (!attributes.is_a?(Hash))
|
56
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Akeyless::DescribeSubClaims` initialize method"
|
57
|
+
end
|
58
|
+
|
59
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
60
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
61
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
62
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Akeyless::DescribeSubClaims`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
63
|
+
end
|
64
|
+
h[k.to_sym] = v
|
65
|
+
}
|
66
|
+
|
67
|
+
if attributes.key?(:'token')
|
68
|
+
self.token = attributes[:'token']
|
69
|
+
end
|
70
|
+
|
71
|
+
if attributes.key?(:'uid_token')
|
72
|
+
self.uid_token = attributes[:'uid_token']
|
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
|
+
invalid_properties
|
81
|
+
end
|
82
|
+
|
83
|
+
# Check to see if the all the properties in the model are valid
|
84
|
+
# @return true if the model is valid
|
85
|
+
def valid?
|
86
|
+
true
|
87
|
+
end
|
88
|
+
|
89
|
+
# Checks equality by comparing each attribute.
|
90
|
+
# @param [Object] Object to be compared
|
91
|
+
def ==(o)
|
92
|
+
return true if self.equal?(o)
|
93
|
+
self.class == o.class &&
|
94
|
+
token == o.token &&
|
95
|
+
uid_token == o.uid_token
|
96
|
+
end
|
97
|
+
|
98
|
+
# @see the `==` method
|
99
|
+
# @param [Object] Object to be compared
|
100
|
+
def eql?(o)
|
101
|
+
self == o
|
102
|
+
end
|
103
|
+
|
104
|
+
# Calculates hash code according to all attributes.
|
105
|
+
# @return [Integer] Hash code
|
106
|
+
def hash
|
107
|
+
[token, uid_token].hash
|
108
|
+
end
|
109
|
+
|
110
|
+
# Builds the object from hash
|
111
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
112
|
+
# @return [Object] Returns the model itself
|
113
|
+
def self.build_from_hash(attributes)
|
114
|
+
new.build_from_hash(attributes)
|
115
|
+
end
|
116
|
+
|
117
|
+
# Builds the object from hash
|
118
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
119
|
+
# @return [Object] Returns the model itself
|
120
|
+
def build_from_hash(attributes)
|
121
|
+
return nil unless attributes.is_a?(Hash)
|
122
|
+
attributes = attributes.transform_keys(&:to_sym)
|
123
|
+
self.class.openapi_types.each_pair do |key, type|
|
124
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
125
|
+
self.send("#{key}=", nil)
|
126
|
+
elsif type =~ /\AArray<(.*)>/i
|
127
|
+
# check to ensure the input is an array given that the attribute
|
128
|
+
# is documented as an array but the input is not
|
129
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
130
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
131
|
+
end
|
132
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
133
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
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 :Time
|
147
|
+
Time.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
|
+
# models (e.g. Pet) or oneOf
|
178
|
+
klass = Akeyless.const_get(type)
|
179
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
180
|
+
end
|
181
|
+
end
|
182
|
+
|
183
|
+
# Returns the string representation of the object
|
184
|
+
# @return [String] String presentation of the object
|
185
|
+
def to_s
|
186
|
+
to_hash.to_s
|
187
|
+
end
|
188
|
+
|
189
|
+
# to_body is an alias to to_hash (backward compatibility)
|
190
|
+
# @return [Hash] Returns the object in the form of hash
|
191
|
+
def to_body
|
192
|
+
to_hash
|
193
|
+
end
|
194
|
+
|
195
|
+
# Returns the object in the form of hash
|
196
|
+
# @return [Hash] Returns the object in the form of hash
|
197
|
+
def to_hash
|
198
|
+
hash = {}
|
199
|
+
self.class.attribute_map.each_pair do |attr, param|
|
200
|
+
value = self.send(attr)
|
201
|
+
if value.nil?
|
202
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
203
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
204
|
+
end
|
205
|
+
|
206
|
+
hash[param] = _to_hash(value)
|
207
|
+
end
|
208
|
+
hash
|
209
|
+
end
|
210
|
+
|
211
|
+
# Outputs non-array value in the form of hash
|
212
|
+
# For object, use to_hash. Otherwise, just return the value
|
213
|
+
# @param [Object] value Any valid value
|
214
|
+
# @return [Hash] Returns the value in the form of hash
|
215
|
+
def _to_hash(value)
|
216
|
+
if value.is_a?(Array)
|
217
|
+
value.compact.map { |v| _to_hash(v) }
|
218
|
+
elsif value.is_a?(Hash)
|
219
|
+
{}.tap do |hash|
|
220
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
221
|
+
end
|
222
|
+
elsif value.respond_to? :to_hash
|
223
|
+
value.to_hash
|
224
|
+
else
|
225
|
+
value
|
226
|
+
end
|
227
|
+
end
|
228
|
+
|
229
|
+
end
|
230
|
+
|
231
|
+
end
|