akeyless 5.0.13 → 5.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.
- checksums.yaml +4 -4
- data/README.md +12 -1
- data/docs/CreateESM.md +2 -0
- data/docs/CreateRole.md +2 -0
- data/docs/CreateUSC.md +2 -0
- data/docs/DecryptWithClassicKey.md +2 -0
- data/docs/DynamicSecretCreateGcp.md +2 -0
- data/docs/DynamicSecretUpdateGcp.md +2 -0
- data/docs/EncryptWithClassicKey.md +2 -0
- data/docs/FolderCreate.md +34 -0
- data/docs/FolderCreateOutput.md +18 -0
- data/docs/FolderDelete.md +28 -0
- data/docs/FolderGet.md +28 -0
- data/docs/FolderGetOutput.md +18 -0
- data/docs/FolderUpdate.md +36 -0
- data/docs/GatewayCreateProducerGcp.md +2 -0
- data/docs/GatewayUpdateProducerGcp.md +2 -0
- data/docs/GetFolderOutput.md +36 -0
- data/docs/V2Api.md +252 -0
- data/lib/akeyless/api/v2_api.rb +256 -0
- data/lib/akeyless/models/create_esm.rb +11 -1
- data/lib/akeyless/models/create_role.rb +13 -1
- data/lib/akeyless/models/create_usc.rb +11 -1
- data/lib/akeyless/models/decrypt_with_classic_key.rb +13 -1
- data/lib/akeyless/models/dynamic_secret_create_gcp.rb +11 -1
- data/lib/akeyless/models/dynamic_secret_update_gcp.rb +11 -1
- data/lib/akeyless/models/encrypt_with_classic_key.rb +13 -1
- data/lib/akeyless/models/folder_create.rb +308 -0
- data/lib/akeyless/models/folder_create_output.rb +214 -0
- data/lib/akeyless/models/folder_delete.rb +276 -0
- data/lib/akeyless/models/folder_get.rb +276 -0
- data/lib/akeyless/models/folder_get_output.rb +214 -0
- data/lib/akeyless/models/folder_update.rb +320 -0
- data/lib/akeyless/models/gateway_create_producer_gcp.rb +11 -1
- data/lib/akeyless/models/gateway_update_producer_gcp.rb +11 -1
- data/lib/akeyless/models/get_folder_output.rb +298 -0
- data/lib/akeyless/version.rb +1 -1
- data/lib/akeyless.rb +7 -0
- data/spec/models/folder_create_output_spec.rb +36 -0
- data/spec/models/folder_create_spec.rb +84 -0
- data/spec/models/folder_delete_spec.rb +66 -0
- data/spec/models/folder_get_output_spec.rb +36 -0
- data/spec/models/folder_get_spec.rb +66 -0
- data/spec/models/folder_update_spec.rb +90 -0
- data/spec/models/get_folder_output_spec.rb +90 -0
- metadata +29 -1
|
@@ -0,0 +1,214 @@
|
|
|
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: 3.0
|
|
7
|
+
Contact: support@akeyless.io
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.10.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Akeyless
|
|
17
|
+
class FolderGetOutput
|
|
18
|
+
attr_accessor :folder
|
|
19
|
+
|
|
20
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
21
|
+
def self.attribute_map
|
|
22
|
+
{
|
|
23
|
+
:'folder' => :'folder'
|
|
24
|
+
}
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# Returns all the JSON keys this model knows about
|
|
28
|
+
def self.acceptable_attributes
|
|
29
|
+
attribute_map.values
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Attribute type mapping.
|
|
33
|
+
def self.openapi_types
|
|
34
|
+
{
|
|
35
|
+
:'folder' => :'GetFolderOutput'
|
|
36
|
+
}
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# List of attributes with nullable: true
|
|
40
|
+
def self.openapi_nullable
|
|
41
|
+
Set.new([
|
|
42
|
+
])
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# Initializes the object
|
|
46
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
47
|
+
def initialize(attributes = {})
|
|
48
|
+
if (!attributes.is_a?(Hash))
|
|
49
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Akeyless::FolderGetOutput` initialize method"
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
53
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
54
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
55
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Akeyless::FolderGetOutput`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
56
|
+
end
|
|
57
|
+
h[k.to_sym] = v
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if attributes.key?(:'folder')
|
|
61
|
+
self.folder = attributes[:'folder']
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
66
|
+
# @return Array for valid properties with the reasons
|
|
67
|
+
def list_invalid_properties
|
|
68
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
69
|
+
invalid_properties = Array.new
|
|
70
|
+
invalid_properties
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# Check to see if the all the properties in the model are valid
|
|
74
|
+
# @return true if the model is valid
|
|
75
|
+
def valid?
|
|
76
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
77
|
+
true
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# Checks equality by comparing each attribute.
|
|
81
|
+
# @param [Object] Object to be compared
|
|
82
|
+
def ==(o)
|
|
83
|
+
return true if self.equal?(o)
|
|
84
|
+
self.class == o.class &&
|
|
85
|
+
folder == o.folder
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# @see the `==` method
|
|
89
|
+
# @param [Object] Object to be compared
|
|
90
|
+
def eql?(o)
|
|
91
|
+
self == o
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# Calculates hash code according to all attributes.
|
|
95
|
+
# @return [Integer] Hash code
|
|
96
|
+
def hash
|
|
97
|
+
[folder].hash
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
# Builds the object from hash
|
|
101
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
102
|
+
# @return [Object] Returns the model itself
|
|
103
|
+
def self.build_from_hash(attributes)
|
|
104
|
+
return nil unless attributes.is_a?(Hash)
|
|
105
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
106
|
+
transformed_hash = {}
|
|
107
|
+
openapi_types.each_pair do |key, type|
|
|
108
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
109
|
+
transformed_hash["#{key}"] = nil
|
|
110
|
+
elsif 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[attribute_map[key]].is_a?(Array)
|
|
114
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
115
|
+
end
|
|
116
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
117
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
118
|
+
end
|
|
119
|
+
end
|
|
120
|
+
new(transformed_hash)
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
# Deserializes the data based on type
|
|
124
|
+
# @param string type Data type
|
|
125
|
+
# @param string value Value to be deserialized
|
|
126
|
+
# @return [Object] Deserialized data
|
|
127
|
+
def self._deserialize(type, value)
|
|
128
|
+
case type.to_sym
|
|
129
|
+
when :Time
|
|
130
|
+
Time.parse(value)
|
|
131
|
+
when :Date
|
|
132
|
+
Date.parse(value)
|
|
133
|
+
when :String
|
|
134
|
+
value.to_s
|
|
135
|
+
when :Integer
|
|
136
|
+
value.to_i
|
|
137
|
+
when :Float
|
|
138
|
+
value.to_f
|
|
139
|
+
when :Boolean
|
|
140
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
141
|
+
true
|
|
142
|
+
else
|
|
143
|
+
false
|
|
144
|
+
end
|
|
145
|
+
when :Object
|
|
146
|
+
# generic object (usually a Hash), return directly
|
|
147
|
+
value
|
|
148
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
149
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
150
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
151
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
152
|
+
k_type = Regexp.last_match[:k_type]
|
|
153
|
+
v_type = Regexp.last_match[:v_type]
|
|
154
|
+
{}.tap do |hash|
|
|
155
|
+
value.each do |k, v|
|
|
156
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
157
|
+
end
|
|
158
|
+
end
|
|
159
|
+
else # model
|
|
160
|
+
# models (e.g. Pet) or oneOf
|
|
161
|
+
klass = Akeyless.const_get(type)
|
|
162
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
163
|
+
end
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
# Returns the string representation of the object
|
|
167
|
+
# @return [String] String presentation of the object
|
|
168
|
+
def to_s
|
|
169
|
+
to_hash.to_s
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
173
|
+
# @return [Hash] Returns the object in the form of hash
|
|
174
|
+
def to_body
|
|
175
|
+
to_hash
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
# Returns the object in the form of hash
|
|
179
|
+
# @return [Hash] Returns the object in the form of hash
|
|
180
|
+
def to_hash
|
|
181
|
+
hash = {}
|
|
182
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
183
|
+
value = self.send(attr)
|
|
184
|
+
if value.nil?
|
|
185
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
186
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
hash[param] = _to_hash(value)
|
|
190
|
+
end
|
|
191
|
+
hash
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
# Outputs non-array value in the form of hash
|
|
195
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
196
|
+
# @param [Object] value Any valid value
|
|
197
|
+
# @return [Hash] Returns the value in the form of hash
|
|
198
|
+
def _to_hash(value)
|
|
199
|
+
if value.is_a?(Array)
|
|
200
|
+
value.compact.map { |v| _to_hash(v) }
|
|
201
|
+
elsif value.is_a?(Hash)
|
|
202
|
+
{}.tap do |hash|
|
|
203
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
204
|
+
end
|
|
205
|
+
elsif value.respond_to? :to_hash
|
|
206
|
+
value.to_hash
|
|
207
|
+
else
|
|
208
|
+
value
|
|
209
|
+
end
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
end
|
|
@@ -0,0 +1,320 @@
|
|
|
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: 3.0
|
|
7
|
+
Contact: support@akeyless.io
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.10.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Akeyless
|
|
17
|
+
# folderUpdate is a command that updates folder
|
|
18
|
+
class FolderUpdate
|
|
19
|
+
# for personal password manager
|
|
20
|
+
attr_accessor :accessibility
|
|
21
|
+
|
|
22
|
+
# List of the new tags that will be attached to this folder
|
|
23
|
+
attr_accessor :add_tag
|
|
24
|
+
|
|
25
|
+
# Protection from accidental deletion of this object [true/false]
|
|
26
|
+
attr_accessor :delete_protection
|
|
27
|
+
|
|
28
|
+
# Description of the object
|
|
29
|
+
attr_accessor :description
|
|
30
|
+
|
|
31
|
+
# Set output format to JSON
|
|
32
|
+
attr_accessor :json
|
|
33
|
+
|
|
34
|
+
# Folder name
|
|
35
|
+
attr_accessor :name
|
|
36
|
+
|
|
37
|
+
# List of the existent tags that will be removed from this folder
|
|
38
|
+
attr_accessor :rm_tag
|
|
39
|
+
|
|
40
|
+
# Authentication token (see `/auth` and `/configure`)
|
|
41
|
+
attr_accessor :token
|
|
42
|
+
|
|
43
|
+
attr_accessor :type
|
|
44
|
+
|
|
45
|
+
# The universal identity token, Required only for universal_identity authentication
|
|
46
|
+
attr_accessor :uid_token
|
|
47
|
+
|
|
48
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
49
|
+
def self.attribute_map
|
|
50
|
+
{
|
|
51
|
+
:'accessibility' => :'accessibility',
|
|
52
|
+
:'add_tag' => :'add-tag',
|
|
53
|
+
:'delete_protection' => :'delete_protection',
|
|
54
|
+
:'description' => :'description',
|
|
55
|
+
:'json' => :'json',
|
|
56
|
+
:'name' => :'name',
|
|
57
|
+
:'rm_tag' => :'rm-tag',
|
|
58
|
+
:'token' => :'token',
|
|
59
|
+
:'type' => :'type',
|
|
60
|
+
:'uid_token' => :'uid-token'
|
|
61
|
+
}
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# Returns all the JSON keys this model knows about
|
|
65
|
+
def self.acceptable_attributes
|
|
66
|
+
attribute_map.values
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# Attribute type mapping.
|
|
70
|
+
def self.openapi_types
|
|
71
|
+
{
|
|
72
|
+
:'accessibility' => :'String',
|
|
73
|
+
:'add_tag' => :'Array<String>',
|
|
74
|
+
:'delete_protection' => :'String',
|
|
75
|
+
:'description' => :'String',
|
|
76
|
+
:'json' => :'Boolean',
|
|
77
|
+
:'name' => :'String',
|
|
78
|
+
:'rm_tag' => :'Array<String>',
|
|
79
|
+
:'token' => :'String',
|
|
80
|
+
:'type' => :'String',
|
|
81
|
+
:'uid_token' => :'String'
|
|
82
|
+
}
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# List of attributes with nullable: true
|
|
86
|
+
def self.openapi_nullable
|
|
87
|
+
Set.new([
|
|
88
|
+
])
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
# Initializes the object
|
|
92
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
93
|
+
def initialize(attributes = {})
|
|
94
|
+
if (!attributes.is_a?(Hash))
|
|
95
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Akeyless::FolderUpdate` initialize method"
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
99
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
100
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
101
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Akeyless::FolderUpdate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
102
|
+
end
|
|
103
|
+
h[k.to_sym] = v
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
if attributes.key?(:'accessibility')
|
|
107
|
+
self.accessibility = attributes[:'accessibility']
|
|
108
|
+
else
|
|
109
|
+
self.accessibility = 'regular'
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
if attributes.key?(:'add_tag')
|
|
113
|
+
if (value = attributes[:'add_tag']).is_a?(Array)
|
|
114
|
+
self.add_tag = value
|
|
115
|
+
end
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
if attributes.key?(:'delete_protection')
|
|
119
|
+
self.delete_protection = attributes[:'delete_protection']
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
if attributes.key?(:'description')
|
|
123
|
+
self.description = attributes[:'description']
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
if attributes.key?(:'json')
|
|
127
|
+
self.json = attributes[:'json']
|
|
128
|
+
else
|
|
129
|
+
self.json = false
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
if attributes.key?(:'name')
|
|
133
|
+
self.name = attributes[:'name']
|
|
134
|
+
else
|
|
135
|
+
self.name = nil
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
if attributes.key?(:'rm_tag')
|
|
139
|
+
if (value = attributes[:'rm_tag']).is_a?(Array)
|
|
140
|
+
self.rm_tag = value
|
|
141
|
+
end
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
if attributes.key?(:'token')
|
|
145
|
+
self.token = attributes[:'token']
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
if attributes.key?(:'type')
|
|
149
|
+
self.type = attributes[:'type']
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
if attributes.key?(:'uid_token')
|
|
153
|
+
self.uid_token = attributes[:'uid_token']
|
|
154
|
+
end
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
158
|
+
# @return Array for valid properties with the reasons
|
|
159
|
+
def list_invalid_properties
|
|
160
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
161
|
+
invalid_properties = Array.new
|
|
162
|
+
if @name.nil?
|
|
163
|
+
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
invalid_properties
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
# Check to see if the all the properties in the model are valid
|
|
170
|
+
# @return true if the model is valid
|
|
171
|
+
def valid?
|
|
172
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
173
|
+
return false if @name.nil?
|
|
174
|
+
true
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
# Checks equality by comparing each attribute.
|
|
178
|
+
# @param [Object] Object to be compared
|
|
179
|
+
def ==(o)
|
|
180
|
+
return true if self.equal?(o)
|
|
181
|
+
self.class == o.class &&
|
|
182
|
+
accessibility == o.accessibility &&
|
|
183
|
+
add_tag == o.add_tag &&
|
|
184
|
+
delete_protection == o.delete_protection &&
|
|
185
|
+
description == o.description &&
|
|
186
|
+
json == o.json &&
|
|
187
|
+
name == o.name &&
|
|
188
|
+
rm_tag == o.rm_tag &&
|
|
189
|
+
token == o.token &&
|
|
190
|
+
type == o.type &&
|
|
191
|
+
uid_token == o.uid_token
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
# @see the `==` method
|
|
195
|
+
# @param [Object] Object to be compared
|
|
196
|
+
def eql?(o)
|
|
197
|
+
self == o
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
# Calculates hash code according to all attributes.
|
|
201
|
+
# @return [Integer] Hash code
|
|
202
|
+
def hash
|
|
203
|
+
[accessibility, add_tag, delete_protection, description, json, name, rm_tag, token, type, uid_token].hash
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
# Builds the object from hash
|
|
207
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
208
|
+
# @return [Object] Returns the model itself
|
|
209
|
+
def self.build_from_hash(attributes)
|
|
210
|
+
return nil unless attributes.is_a?(Hash)
|
|
211
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
212
|
+
transformed_hash = {}
|
|
213
|
+
openapi_types.each_pair do |key, type|
|
|
214
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
215
|
+
transformed_hash["#{key}"] = nil
|
|
216
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
217
|
+
# check to ensure the input is an array given that the attribute
|
|
218
|
+
# is documented as an array but the input is not
|
|
219
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
220
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
221
|
+
end
|
|
222
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
223
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
224
|
+
end
|
|
225
|
+
end
|
|
226
|
+
new(transformed_hash)
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
# Deserializes the data based on type
|
|
230
|
+
# @param string type Data type
|
|
231
|
+
# @param string value Value to be deserialized
|
|
232
|
+
# @return [Object] Deserialized data
|
|
233
|
+
def self._deserialize(type, value)
|
|
234
|
+
case type.to_sym
|
|
235
|
+
when :Time
|
|
236
|
+
Time.parse(value)
|
|
237
|
+
when :Date
|
|
238
|
+
Date.parse(value)
|
|
239
|
+
when :String
|
|
240
|
+
value.to_s
|
|
241
|
+
when :Integer
|
|
242
|
+
value.to_i
|
|
243
|
+
when :Float
|
|
244
|
+
value.to_f
|
|
245
|
+
when :Boolean
|
|
246
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
247
|
+
true
|
|
248
|
+
else
|
|
249
|
+
false
|
|
250
|
+
end
|
|
251
|
+
when :Object
|
|
252
|
+
# generic object (usually a Hash), return directly
|
|
253
|
+
value
|
|
254
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
255
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
256
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
257
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
258
|
+
k_type = Regexp.last_match[:k_type]
|
|
259
|
+
v_type = Regexp.last_match[:v_type]
|
|
260
|
+
{}.tap do |hash|
|
|
261
|
+
value.each do |k, v|
|
|
262
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
263
|
+
end
|
|
264
|
+
end
|
|
265
|
+
else # model
|
|
266
|
+
# models (e.g. Pet) or oneOf
|
|
267
|
+
klass = Akeyless.const_get(type)
|
|
268
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
269
|
+
end
|
|
270
|
+
end
|
|
271
|
+
|
|
272
|
+
# Returns the string representation of the object
|
|
273
|
+
# @return [String] String presentation of the object
|
|
274
|
+
def to_s
|
|
275
|
+
to_hash.to_s
|
|
276
|
+
end
|
|
277
|
+
|
|
278
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
279
|
+
# @return [Hash] Returns the object in the form of hash
|
|
280
|
+
def to_body
|
|
281
|
+
to_hash
|
|
282
|
+
end
|
|
283
|
+
|
|
284
|
+
# Returns the object in the form of hash
|
|
285
|
+
# @return [Hash] Returns the object in the form of hash
|
|
286
|
+
def to_hash
|
|
287
|
+
hash = {}
|
|
288
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
289
|
+
value = self.send(attr)
|
|
290
|
+
if value.nil?
|
|
291
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
292
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
293
|
+
end
|
|
294
|
+
|
|
295
|
+
hash[param] = _to_hash(value)
|
|
296
|
+
end
|
|
297
|
+
hash
|
|
298
|
+
end
|
|
299
|
+
|
|
300
|
+
# Outputs non-array value in the form of hash
|
|
301
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
302
|
+
# @param [Object] value Any valid value
|
|
303
|
+
# @return [Hash] Returns the value in the form of hash
|
|
304
|
+
def _to_hash(value)
|
|
305
|
+
if value.is_a?(Array)
|
|
306
|
+
value.compact.map { |v| _to_hash(v) }
|
|
307
|
+
elsif value.is_a?(Hash)
|
|
308
|
+
{}.tap do |hash|
|
|
309
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
310
|
+
end
|
|
311
|
+
elsif value.respond_to? :to_hash
|
|
312
|
+
value.to_hash
|
|
313
|
+
else
|
|
314
|
+
value
|
|
315
|
+
end
|
|
316
|
+
end
|
|
317
|
+
|
|
318
|
+
end
|
|
319
|
+
|
|
320
|
+
end
|
|
@@ -30,6 +30,9 @@ module Akeyless
|
|
|
30
30
|
# Service account key algorithm, e.g. KEY_ALG_RSA_1024
|
|
31
31
|
attr_accessor :gcp_key_algo
|
|
32
32
|
|
|
33
|
+
# GCP Project ID override for dynamic secret operations (tmp service accounts)
|
|
34
|
+
attr_accessor :gcp_project_id
|
|
35
|
+
|
|
33
36
|
# The email of the fixed service acocunt to generate keys or tokens for. (revelant for service-account-type=fixed)
|
|
34
37
|
attr_accessor :gcp_sa_email
|
|
35
38
|
|
|
@@ -77,6 +80,7 @@ module Akeyless
|
|
|
77
80
|
:'gcp_cred_type' => :'gcp-cred-type',
|
|
78
81
|
:'gcp_key' => :'gcp-key',
|
|
79
82
|
:'gcp_key_algo' => :'gcp-key-algo',
|
|
83
|
+
:'gcp_project_id' => :'gcp-project-id',
|
|
80
84
|
:'gcp_sa_email' => :'gcp-sa-email',
|
|
81
85
|
:'gcp_token_scopes' => :'gcp-token-scopes',
|
|
82
86
|
:'item_custom_fields' => :'item-custom-fields',
|
|
@@ -106,6 +110,7 @@ module Akeyless
|
|
|
106
110
|
:'gcp_cred_type' => :'String',
|
|
107
111
|
:'gcp_key' => :'String',
|
|
108
112
|
:'gcp_key_algo' => :'String',
|
|
113
|
+
:'gcp_project_id' => :'String',
|
|
109
114
|
:'gcp_sa_email' => :'String',
|
|
110
115
|
:'gcp_token_scopes' => :'String',
|
|
111
116
|
:'item_custom_fields' => :'Hash<String, String>',
|
|
@@ -163,6 +168,10 @@ module Akeyless
|
|
|
163
168
|
self.gcp_key_algo = attributes[:'gcp_key_algo']
|
|
164
169
|
end
|
|
165
170
|
|
|
171
|
+
if attributes.key?(:'gcp_project_id')
|
|
172
|
+
self.gcp_project_id = attributes[:'gcp_project_id']
|
|
173
|
+
end
|
|
174
|
+
|
|
166
175
|
if attributes.key?(:'gcp_sa_email')
|
|
167
176
|
self.gcp_sa_email = attributes[:'gcp_sa_email']
|
|
168
177
|
end
|
|
@@ -263,6 +272,7 @@ module Akeyless
|
|
|
263
272
|
gcp_cred_type == o.gcp_cred_type &&
|
|
264
273
|
gcp_key == o.gcp_key &&
|
|
265
274
|
gcp_key_algo == o.gcp_key_algo &&
|
|
275
|
+
gcp_project_id == o.gcp_project_id &&
|
|
266
276
|
gcp_sa_email == o.gcp_sa_email &&
|
|
267
277
|
gcp_token_scopes == o.gcp_token_scopes &&
|
|
268
278
|
item_custom_fields == o.item_custom_fields &&
|
|
@@ -287,7 +297,7 @@ module Akeyless
|
|
|
287
297
|
# Calculates hash code according to all attributes.
|
|
288
298
|
# @return [Integer] Hash code
|
|
289
299
|
def hash
|
|
290
|
-
[custom_username_template, delete_protection, gcp_cred_type, gcp_key, gcp_key_algo, gcp_sa_email, gcp_token_scopes, item_custom_fields, json, name, producer_encryption_key_name, role_binding, service_account_type, tags, target_name, token, uid_token, user_ttl].hash
|
|
300
|
+
[custom_username_template, delete_protection, gcp_cred_type, gcp_key, gcp_key_algo, gcp_project_id, gcp_sa_email, gcp_token_scopes, item_custom_fields, json, name, producer_encryption_key_name, role_binding, service_account_type, tags, target_name, token, uid_token, user_ttl].hash
|
|
291
301
|
end
|
|
292
302
|
|
|
293
303
|
# Builds the object from hash
|
|
@@ -30,6 +30,9 @@ module Akeyless
|
|
|
30
30
|
# Service account key algorithm, e.g. KEY_ALG_RSA_1024
|
|
31
31
|
attr_accessor :gcp_key_algo
|
|
32
32
|
|
|
33
|
+
# GCP Project ID override for dynamic secret operations (tmp service accounts)
|
|
34
|
+
attr_accessor :gcp_project_id
|
|
35
|
+
|
|
33
36
|
# The email of the fixed service acocunt to generate keys or tokens for. (revelant for service-account-type=fixed)
|
|
34
37
|
attr_accessor :gcp_sa_email
|
|
35
38
|
|
|
@@ -80,6 +83,7 @@ module Akeyless
|
|
|
80
83
|
:'gcp_cred_type' => :'gcp-cred-type',
|
|
81
84
|
:'gcp_key' => :'gcp-key',
|
|
82
85
|
:'gcp_key_algo' => :'gcp-key-algo',
|
|
86
|
+
:'gcp_project_id' => :'gcp-project-id',
|
|
83
87
|
:'gcp_sa_email' => :'gcp-sa-email',
|
|
84
88
|
:'gcp_token_scopes' => :'gcp-token-scopes',
|
|
85
89
|
:'item_custom_fields' => :'item-custom-fields',
|
|
@@ -110,6 +114,7 @@ module Akeyless
|
|
|
110
114
|
:'gcp_cred_type' => :'String',
|
|
111
115
|
:'gcp_key' => :'String',
|
|
112
116
|
:'gcp_key_algo' => :'String',
|
|
117
|
+
:'gcp_project_id' => :'String',
|
|
113
118
|
:'gcp_sa_email' => :'String',
|
|
114
119
|
:'gcp_token_scopes' => :'String',
|
|
115
120
|
:'item_custom_fields' => :'Hash<String, String>',
|
|
@@ -168,6 +173,10 @@ module Akeyless
|
|
|
168
173
|
self.gcp_key_algo = attributes[:'gcp_key_algo']
|
|
169
174
|
end
|
|
170
175
|
|
|
176
|
+
if attributes.key?(:'gcp_project_id')
|
|
177
|
+
self.gcp_project_id = attributes[:'gcp_project_id']
|
|
178
|
+
end
|
|
179
|
+
|
|
171
180
|
if attributes.key?(:'gcp_sa_email')
|
|
172
181
|
self.gcp_sa_email = attributes[:'gcp_sa_email']
|
|
173
182
|
end
|
|
@@ -272,6 +281,7 @@ module Akeyless
|
|
|
272
281
|
gcp_cred_type == o.gcp_cred_type &&
|
|
273
282
|
gcp_key == o.gcp_key &&
|
|
274
283
|
gcp_key_algo == o.gcp_key_algo &&
|
|
284
|
+
gcp_project_id == o.gcp_project_id &&
|
|
275
285
|
gcp_sa_email == o.gcp_sa_email &&
|
|
276
286
|
gcp_token_scopes == o.gcp_token_scopes &&
|
|
277
287
|
item_custom_fields == o.item_custom_fields &&
|
|
@@ -297,7 +307,7 @@ module Akeyless
|
|
|
297
307
|
# Calculates hash code according to all attributes.
|
|
298
308
|
# @return [Integer] Hash code
|
|
299
309
|
def hash
|
|
300
|
-
[custom_username_template, delete_protection, gcp_cred_type, gcp_key, gcp_key_algo, gcp_sa_email, gcp_token_scopes, item_custom_fields, json, name, new_name, producer_encryption_key_name, role_binding, service_account_type, tags, target_name, token, uid_token, user_ttl].hash
|
|
310
|
+
[custom_username_template, delete_protection, gcp_cred_type, gcp_key, gcp_key_algo, gcp_project_id, gcp_sa_email, gcp_token_scopes, item_custom_fields, json, name, new_name, producer_encryption_key_name, role_binding, service_account_type, tags, target_name, token, uid_token, user_ttl].hash
|
|
301
311
|
end
|
|
302
312
|
|
|
303
313
|
# Builds the object from hash
|