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