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