akeyless 5.0.18 → 5.0.19

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 (40) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +9 -1
  3. data/docs/CertificateDiscovery.md +34 -0
  4. data/docs/CertificateDiscoveryOutput.md +18 -0
  5. data/docs/CertificateMigration.md +20 -0
  6. data/docs/CertificatePayload.md +30 -0
  7. data/docs/CertificateScanTarget.md +20 -0
  8. data/docs/CreateRole.md +5 -5
  9. data/docs/GatewayCreateMigration.md +7 -1
  10. data/docs/GatewayUpdateMigration.md +6 -0
  11. data/docs/MigrationsConfigPart.md +2 -0
  12. data/docs/ScanResults.md +32 -0
  13. data/docs/TargetError.md +22 -0
  14. data/docs/UpdateRole.md +5 -5
  15. data/docs/UscDelete.md +2 -0
  16. data/docs/V2Api.md +65 -2
  17. data/lib/akeyless/api/v2_api.rb +64 -0
  18. data/lib/akeyless/models/certificate_discovery.rb +318 -0
  19. data/lib/akeyless/models/certificate_discovery_output.rb +214 -0
  20. data/lib/akeyless/models/certificate_migration.rb +223 -0
  21. data/lib/akeyless/models/certificate_payload.rb +272 -0
  22. data/lib/akeyless/models/certificate_scan_target.rb +223 -0
  23. data/lib/akeyless/models/create_role.rb +5 -5
  24. data/lib/akeyless/models/gateway_create_migration.rb +43 -2
  25. data/lib/akeyless/models/gateway_update_migration.rb +42 -1
  26. data/lib/akeyless/models/migrations_config_part.rb +12 -1
  27. data/lib/akeyless/models/scan_results.rb +282 -0
  28. data/lib/akeyless/models/target_error.rb +233 -0
  29. data/lib/akeyless/models/update_role.rb +5 -5
  30. data/lib/akeyless/models/usc_delete.rb +11 -1
  31. data/lib/akeyless/version.rb +1 -1
  32. data/lib/akeyless.rb +7 -0
  33. data/spec/models/certificate_discovery_output_spec.rb +36 -0
  34. data/spec/models/certificate_discovery_spec.rb +84 -0
  35. data/spec/models/certificate_migration_spec.rb +42 -0
  36. data/spec/models/certificate_payload_spec.rb +72 -0
  37. data/spec/models/certificate_scan_target_spec.rb +42 -0
  38. data/spec/models/scan_results_spec.rb +78 -0
  39. data/spec/models/target_error_spec.rb +48 -0
  40. metadata +30 -2
@@ -0,0 +1,318 @@
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
+ # CertificateDiscovery is a command that discovery certificates
18
+ class CertificateDiscovery
19
+ # Debug mode
20
+ attr_accessor :debug
21
+
22
+ # How many days before the expiration of the certificate would you like to be notified.
23
+ attr_accessor :expiration_event_in
24
+
25
+ # A comma separated list of IPs, CIDR ranges, or DNS names to discovery
26
+ attr_accessor :hosts
27
+
28
+ # Set output format to JSON
29
+ attr_accessor :json
30
+
31
+ # A comma separated list of port ranges Examples: \"80,443\" or \"80,443,8080-8090\" or \"443\"
32
+ attr_accessor :port_ranges
33
+
34
+ # The name of the key that protects the certificate value
35
+ attr_accessor :protection_key
36
+
37
+ # The folder where the results will be saved
38
+ attr_accessor :target_location
39
+
40
+ # Authentication token (see `/auth` and `/configure`)
41
+ attr_accessor :token
42
+
43
+ # The universal identity token, Required only for universal_identity authentication
44
+ attr_accessor :uid_token
45
+
46
+ # Attribute mapping from ruby-style variable name to JSON key.
47
+ def self.attribute_map
48
+ {
49
+ :'debug' => :'debug',
50
+ :'expiration_event_in' => :'expiration-event-in',
51
+ :'hosts' => :'hosts',
52
+ :'json' => :'json',
53
+ :'port_ranges' => :'port-ranges',
54
+ :'protection_key' => :'protection-key',
55
+ :'target_location' => :'target-location',
56
+ :'token' => :'token',
57
+ :'uid_token' => :'uid-token'
58
+ }
59
+ end
60
+
61
+ # Returns all the JSON keys this model knows about
62
+ def self.acceptable_attributes
63
+ attribute_map.values
64
+ end
65
+
66
+ # Attribute type mapping.
67
+ def self.openapi_types
68
+ {
69
+ :'debug' => :'Boolean',
70
+ :'expiration_event_in' => :'Array<String>',
71
+ :'hosts' => :'String',
72
+ :'json' => :'Boolean',
73
+ :'port_ranges' => :'String',
74
+ :'protection_key' => :'String',
75
+ :'target_location' => :'String',
76
+ :'token' => :'String',
77
+ :'uid_token' => :'String'
78
+ }
79
+ end
80
+
81
+ # List of attributes with nullable: true
82
+ def self.openapi_nullable
83
+ Set.new([
84
+ ])
85
+ end
86
+
87
+ # Initializes the object
88
+ # @param [Hash] attributes Model attributes in the form of hash
89
+ def initialize(attributes = {})
90
+ if (!attributes.is_a?(Hash))
91
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Akeyless::CertificateDiscovery` initialize method"
92
+ end
93
+
94
+ # check to see if the attribute exists and convert string to symbol for hash key
95
+ attributes = attributes.each_with_object({}) { |(k, v), h|
96
+ if (!self.class.attribute_map.key?(k.to_sym))
97
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Akeyless::CertificateDiscovery`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
98
+ end
99
+ h[k.to_sym] = v
100
+ }
101
+
102
+ if attributes.key?(:'debug')
103
+ self.debug = attributes[:'debug']
104
+ else
105
+ self.debug = false
106
+ end
107
+
108
+ if attributes.key?(:'expiration_event_in')
109
+ if (value = attributes[:'expiration_event_in']).is_a?(Array)
110
+ self.expiration_event_in = value
111
+ end
112
+ end
113
+
114
+ if attributes.key?(:'hosts')
115
+ self.hosts = attributes[:'hosts']
116
+ else
117
+ self.hosts = nil
118
+ end
119
+
120
+ if attributes.key?(:'json')
121
+ self.json = attributes[:'json']
122
+ else
123
+ self.json = false
124
+ end
125
+
126
+ if attributes.key?(:'port_ranges')
127
+ self.port_ranges = attributes[:'port_ranges']
128
+ else
129
+ self.port_ranges = '443'
130
+ end
131
+
132
+ if attributes.key?(:'protection_key')
133
+ self.protection_key = attributes[:'protection_key']
134
+ end
135
+
136
+ if attributes.key?(:'target_location')
137
+ self.target_location = attributes[:'target_location']
138
+ else
139
+ self.target_location = nil
140
+ end
141
+
142
+ if attributes.key?(:'token')
143
+ self.token = attributes[:'token']
144
+ end
145
+
146
+ if attributes.key?(:'uid_token')
147
+ self.uid_token = attributes[:'uid_token']
148
+ end
149
+ end
150
+
151
+ # Show invalid properties with the reasons. Usually used together with valid?
152
+ # @return Array for valid properties with the reasons
153
+ def list_invalid_properties
154
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
155
+ invalid_properties = Array.new
156
+ if @hosts.nil?
157
+ invalid_properties.push('invalid value for "hosts", hosts cannot be nil.')
158
+ end
159
+
160
+ if @target_location.nil?
161
+ invalid_properties.push('invalid value for "target_location", target_location cannot be nil.')
162
+ end
163
+
164
+ invalid_properties
165
+ end
166
+
167
+ # Check to see if the all the properties in the model are valid
168
+ # @return true if the model is valid
169
+ def valid?
170
+ warn '[DEPRECATED] the `valid?` method is obsolete'
171
+ return false if @hosts.nil?
172
+ return false if @target_location.nil?
173
+ true
174
+ end
175
+
176
+ # Checks equality by comparing each attribute.
177
+ # @param [Object] Object to be compared
178
+ def ==(o)
179
+ return true if self.equal?(o)
180
+ self.class == o.class &&
181
+ debug == o.debug &&
182
+ expiration_event_in == o.expiration_event_in &&
183
+ hosts == o.hosts &&
184
+ json == o.json &&
185
+ port_ranges == o.port_ranges &&
186
+ protection_key == o.protection_key &&
187
+ target_location == o.target_location &&
188
+ token == o.token &&
189
+ uid_token == o.uid_token
190
+ end
191
+
192
+ # @see the `==` method
193
+ # @param [Object] Object to be compared
194
+ def eql?(o)
195
+ self == o
196
+ end
197
+
198
+ # Calculates hash code according to all attributes.
199
+ # @return [Integer] Hash code
200
+ def hash
201
+ [debug, expiration_event_in, hosts, json, port_ranges, protection_key, target_location, token, uid_token].hash
202
+ end
203
+
204
+ # Builds the object from hash
205
+ # @param [Hash] attributes Model attributes in the form of hash
206
+ # @return [Object] Returns the model itself
207
+ def self.build_from_hash(attributes)
208
+ return nil unless attributes.is_a?(Hash)
209
+ attributes = attributes.transform_keys(&:to_sym)
210
+ transformed_hash = {}
211
+ openapi_types.each_pair do |key, type|
212
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
213
+ transformed_hash["#{key}"] = nil
214
+ elsif type =~ /\AArray<(.*)>/i
215
+ # check to ensure the input is an array given that the attribute
216
+ # is documented as an array but the input is not
217
+ if attributes[attribute_map[key]].is_a?(Array)
218
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
219
+ end
220
+ elsif !attributes[attribute_map[key]].nil?
221
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
222
+ end
223
+ end
224
+ new(transformed_hash)
225
+ end
226
+
227
+ # Deserializes the data based on type
228
+ # @param string type Data type
229
+ # @param string value Value to be deserialized
230
+ # @return [Object] Deserialized data
231
+ def self._deserialize(type, value)
232
+ case type.to_sym
233
+ when :Time
234
+ Time.parse(value)
235
+ when :Date
236
+ Date.parse(value)
237
+ when :String
238
+ value.to_s
239
+ when :Integer
240
+ value.to_i
241
+ when :Float
242
+ value.to_f
243
+ when :Boolean
244
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
245
+ true
246
+ else
247
+ false
248
+ end
249
+ when :Object
250
+ # generic object (usually a Hash), return directly
251
+ value
252
+ when /\AArray<(?<inner_type>.+)>\z/
253
+ inner_type = Regexp.last_match[:inner_type]
254
+ value.map { |v| _deserialize(inner_type, v) }
255
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
256
+ k_type = Regexp.last_match[:k_type]
257
+ v_type = Regexp.last_match[:v_type]
258
+ {}.tap do |hash|
259
+ value.each do |k, v|
260
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
261
+ end
262
+ end
263
+ else # model
264
+ # models (e.g. Pet) or oneOf
265
+ klass = Akeyless.const_get(type)
266
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
267
+ end
268
+ end
269
+
270
+ # Returns the string representation of the object
271
+ # @return [String] String presentation of the object
272
+ def to_s
273
+ to_hash.to_s
274
+ end
275
+
276
+ # to_body is an alias to to_hash (backward compatibility)
277
+ # @return [Hash] Returns the object in the form of hash
278
+ def to_body
279
+ to_hash
280
+ end
281
+
282
+ # Returns the object in the form of hash
283
+ # @return [Hash] Returns the object in the form of hash
284
+ def to_hash
285
+ hash = {}
286
+ self.class.attribute_map.each_pair do |attr, param|
287
+ value = self.send(attr)
288
+ if value.nil?
289
+ is_nullable = self.class.openapi_nullable.include?(attr)
290
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
291
+ end
292
+
293
+ hash[param] = _to_hash(value)
294
+ end
295
+ hash
296
+ end
297
+
298
+ # Outputs non-array value in the form of hash
299
+ # For object, use to_hash. Otherwise, just return the value
300
+ # @param [Object] value Any valid value
301
+ # @return [Hash] Returns the value in the form of hash
302
+ def _to_hash(value)
303
+ if value.is_a?(Array)
304
+ value.compact.map { |v| _to_hash(v) }
305
+ elsif value.is_a?(Hash)
306
+ {}.tap do |hash|
307
+ value.each { |k, v| hash[k] = _to_hash(v) }
308
+ end
309
+ elsif value.respond_to? :to_hash
310
+ value.to_hash
311
+ else
312
+ value
313
+ end
314
+ end
315
+
316
+ end
317
+
318
+ 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 CertificateDiscoveryOutput
18
+ attr_accessor :results
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'results' => :'results'
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
+ :'results' => :'ScanResults'
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::CertificateDiscoveryOutput` 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::CertificateDiscoveryOutput`. 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?(:'results')
61
+ self.results = attributes[:'results']
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
+ results == o.results
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
+ [results].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