akeyless 3.0.1 → 3.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +36 -3
  3. data/docs/AttributeTypeAndValue.md +20 -0
  4. data/docs/CertificateChainInfo.md +22 -0
  5. data/docs/CertificateExpirationEvent.md +18 -0
  6. data/docs/CertificateInfo.md +62 -0
  7. data/docs/Connect.md +2 -0
  8. data/docs/CreateCertificate.md +38 -0
  9. data/docs/CreateCertificateOutput.md +18 -0
  10. data/docs/CreateEventForwarder.md +48 -0
  11. data/docs/CreateEventForwarderOutput.md +18 -0
  12. data/docs/CreateRotatedSecret.md +2 -0
  13. data/docs/DeleteEventForwarder.md +24 -0
  14. data/docs/EmailEntry.md +20 -0
  15. data/docs/Extension.md +22 -0
  16. data/docs/GatewayUpdateItem.md +2 -0
  17. data/docs/GatewayUpdateTlsCert.md +26 -0
  18. data/docs/GatewayUpdateTlsCertOutput.md +18 -0
  19. data/docs/GetCertificateValue.md +26 -0
  20. data/docs/GetCertificateValueOutput.md +20 -0
  21. data/docs/GetEventForwarder.md +24 -0
  22. data/docs/GetEventForwarderOutput.md +18 -0
  23. data/docs/Item.md +4 -0
  24. data/docs/ItemGeneralInfo.md +2 -0
  25. data/docs/ListSRABastions.md +2 -0
  26. data/docs/ListSharedItems.md +24 -0
  27. data/docs/Name.md +28 -0
  28. data/docs/NotiForwarder.md +56 -0
  29. data/docs/RequestAccess.md +28 -0
  30. data/docs/RequestAccessOutput.md +18 -0
  31. data/docs/RotateKey.md +2 -0
  32. data/docs/Target.md +4 -0
  33. data/docs/UpdateCertificateOutput.md +18 -0
  34. data/docs/UpdateCertificateValue.md +32 -0
  35. data/docs/UpdateEventForwarder.md +40 -0
  36. data/docs/UpdateRotatedSecret.md +2 -0
  37. data/docs/V2Api.md +631 -65
  38. data/lib/akeyless/api/v2_api.rb +664 -88
  39. data/lib/akeyless/api_error.rb +1 -0
  40. data/lib/akeyless/configuration.rb +11 -0
  41. data/lib/akeyless/models/attribute_type_and_value.rb +231 -0
  42. data/lib/akeyless/models/certificate_chain_info.rb +241 -0
  43. data/lib/akeyless/models/certificate_expiration_event.rb +219 -0
  44. data/lib/akeyless/models/certificate_info.rb +434 -0
  45. data/lib/akeyless/models/connect.rb +11 -1
  46. data/lib/akeyless/models/create_certificate.rb +329 -0
  47. data/lib/akeyless/models/create_certificate_output.rb +219 -0
  48. data/lib/akeyless/models/create_event_forwarder.rb +394 -0
  49. data/lib/akeyless/models/create_event_forwarder_output.rb +219 -0
  50. data/lib/akeyless/models/create_rotated_secret.rb +11 -1
  51. data/lib/akeyless/models/delete_event_forwarder.rb +255 -0
  52. data/lib/akeyless/models/email_entry.rb +228 -0
  53. data/lib/akeyless/models/extension.rb +237 -0
  54. data/lib/akeyless/models/gateway_update_item.rb +11 -1
  55. data/lib/akeyless/models/gateway_update_tls_cert.rb +261 -0
  56. data/lib/akeyless/models/gateway_update_tls_cert_output.rb +219 -0
  57. data/lib/akeyless/models/get_certificate_value.rb +265 -0
  58. data/lib/akeyless/models/get_certificate_value_output.rb +228 -0
  59. data/lib/akeyless/models/get_event_forwarder.rb +255 -0
  60. data/lib/akeyless/models/get_event_forwarder_output.rb +219 -0
  61. data/lib/akeyless/models/item.rb +19 -1
  62. data/lib/akeyless/models/item_general_info.rb +10 -1
  63. data/lib/akeyless/models/list_shared_items.rb +253 -0
  64. data/lib/akeyless/models/list_sra_bastions.rb +10 -1
  65. data/lib/akeyless/models/name.rb +277 -0
  66. data/lib/akeyless/models/noti_forwarder.rb +400 -0
  67. data/lib/akeyless/models/request_access.rb +282 -0
  68. data/lib/akeyless/models/request_access_output.rb +219 -0
  69. data/lib/akeyless/models/rotate_key.rb +11 -1
  70. data/lib/akeyless/models/target.rb +19 -1
  71. data/lib/akeyless/models/update_certificate_output.rb +219 -0
  72. data/lib/akeyless/models/update_certificate_value.rb +297 -0
  73. data/lib/akeyless/models/update_event_forwarder.rb +341 -0
  74. data/lib/akeyless/models/update_rotated_secret.rb +11 -1
  75. data/lib/akeyless/version.rb +1 -1
  76. data/lib/akeyless.rb +25 -1
  77. data/spec/models/attribute_type_and_value_spec.rb +40 -0
  78. data/spec/models/certificate_chain_info_spec.rb +46 -0
  79. data/spec/models/certificate_expiration_event_spec.rb +34 -0
  80. data/spec/models/certificate_info_spec.rb +166 -0
  81. data/spec/models/create_certificate_output_spec.rb +34 -0
  82. data/spec/models/create_certificate_spec.rb +94 -0
  83. data/spec/models/create_event_forwarder_output_spec.rb +34 -0
  84. data/spec/models/create_event_forwarder_spec.rb +124 -0
  85. data/spec/models/delete_event_forwarder_spec.rb +52 -0
  86. data/spec/models/email_entry_spec.rb +40 -0
  87. data/spec/models/extension_spec.rb +46 -0
  88. data/spec/models/gateway_update_tls_cert_output_spec.rb +34 -0
  89. data/spec/models/gateway_update_tls_cert_spec.rb +58 -0
  90. data/spec/models/get_certificate_value_output_spec.rb +40 -0
  91. data/spec/models/get_certificate_value_spec.rb +58 -0
  92. data/spec/models/get_event_forwarder_output_spec.rb +34 -0
  93. data/spec/models/get_event_forwarder_spec.rb +52 -0
  94. data/spec/models/list_shared_items_spec.rb +52 -0
  95. data/spec/models/name_spec.rb +64 -0
  96. data/spec/models/noti_forwarder_spec.rb +148 -0
  97. data/spec/models/request_access_output_spec.rb +34 -0
  98. data/spec/models/request_access_spec.rb +64 -0
  99. data/spec/models/update_certificate_output_spec.rb +34 -0
  100. data/spec/models/update_certificate_value_spec.rb +76 -0
  101. data/spec/models/update_event_forwarder_spec.rb +100 -0
  102. metadata +630 -530
@@ -0,0 +1,265 @@
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.3.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Akeyless
17
+ class GetCertificateValue
18
+ # Set output format to JSON
19
+ attr_accessor :json
20
+
21
+ # Certificate name
22
+ attr_accessor :name
23
+
24
+ # Authentication token (see `/auth` and `/configure`)
25
+ attr_accessor :token
26
+
27
+ # The universal identity token, Required only for universal_identity authentication
28
+ attr_accessor :uid_token
29
+
30
+ # Certificate version
31
+ attr_accessor :version
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ def self.attribute_map
35
+ {
36
+ :'json' => :'json',
37
+ :'name' => :'name',
38
+ :'token' => :'token',
39
+ :'uid_token' => :'uid-token',
40
+ :'version' => :'version'
41
+ }
42
+ end
43
+
44
+ # Returns all the JSON keys this model knows about
45
+ def self.acceptable_attributes
46
+ attribute_map.values
47
+ end
48
+
49
+ # Attribute type mapping.
50
+ def self.openapi_types
51
+ {
52
+ :'json' => :'Boolean',
53
+ :'name' => :'String',
54
+ :'token' => :'String',
55
+ :'uid_token' => :'String',
56
+ :'version' => :'Integer'
57
+ }
58
+ end
59
+
60
+ # List of attributes with nullable: true
61
+ def self.openapi_nullable
62
+ Set.new([
63
+ ])
64
+ end
65
+
66
+ # Initializes the object
67
+ # @param [Hash] attributes Model attributes in the form of hash
68
+ def initialize(attributes = {})
69
+ if (!attributes.is_a?(Hash))
70
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Akeyless::GetCertificateValue` initialize method"
71
+ end
72
+
73
+ # check to see if the attribute exists and convert string to symbol for hash key
74
+ attributes = attributes.each_with_object({}) { |(k, v), h|
75
+ if (!self.class.attribute_map.key?(k.to_sym))
76
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Akeyless::GetCertificateValue`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
77
+ end
78
+ h[k.to_sym] = v
79
+ }
80
+
81
+ if attributes.key?(:'json')
82
+ self.json = attributes[:'json']
83
+ end
84
+
85
+ if attributes.key?(:'name')
86
+ self.name = attributes[:'name']
87
+ end
88
+
89
+ if attributes.key?(:'token')
90
+ self.token = attributes[:'token']
91
+ end
92
+
93
+ if attributes.key?(:'uid_token')
94
+ self.uid_token = attributes[:'uid_token']
95
+ end
96
+
97
+ if attributes.key?(:'version')
98
+ self.version = attributes[:'version']
99
+ end
100
+ end
101
+
102
+ # Show invalid properties with the reasons. Usually used together with valid?
103
+ # @return Array for valid properties with the reasons
104
+ def list_invalid_properties
105
+ invalid_properties = Array.new
106
+ if @name.nil?
107
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
108
+ end
109
+
110
+ invalid_properties
111
+ end
112
+
113
+ # Check to see if the all the properties in the model are valid
114
+ # @return true if the model is valid
115
+ def valid?
116
+ return false if @name.nil?
117
+ true
118
+ end
119
+
120
+ # Checks equality by comparing each attribute.
121
+ # @param [Object] Object to be compared
122
+ def ==(o)
123
+ return true if self.equal?(o)
124
+ self.class == o.class &&
125
+ json == o.json &&
126
+ name == o.name &&
127
+ token == o.token &&
128
+ uid_token == o.uid_token &&
129
+ version == o.version
130
+ end
131
+
132
+ # @see the `==` method
133
+ # @param [Object] Object to be compared
134
+ def eql?(o)
135
+ self == o
136
+ end
137
+
138
+ # Calculates hash code according to all attributes.
139
+ # @return [Integer] Hash code
140
+ def hash
141
+ [json, name, token, uid_token, version].hash
142
+ end
143
+
144
+ # Builds the object from hash
145
+ # @param [Hash] attributes Model attributes in the form of hash
146
+ # @return [Object] Returns the model itself
147
+ def self.build_from_hash(attributes)
148
+ new.build_from_hash(attributes)
149
+ end
150
+
151
+ # Builds the object from hash
152
+ # @param [Hash] attributes Model attributes in the form of hash
153
+ # @return [Object] Returns the model itself
154
+ def build_from_hash(attributes)
155
+ return nil unless attributes.is_a?(Hash)
156
+ attributes = attributes.transform_keys(&:to_sym)
157
+ self.class.openapi_types.each_pair do |key, type|
158
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
159
+ self.send("#{key}=", nil)
160
+ elsif type =~ /\AArray<(.*)>/i
161
+ # check to ensure the input is an array given that the attribute
162
+ # is documented as an array but the input is not
163
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
164
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
165
+ end
166
+ elsif !attributes[self.class.attribute_map[key]].nil?
167
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
168
+ end
169
+ end
170
+
171
+ self
172
+ end
173
+
174
+ # Deserializes the data based on type
175
+ # @param string type Data type
176
+ # @param string value Value to be deserialized
177
+ # @return [Object] Deserialized data
178
+ def _deserialize(type, value)
179
+ case type.to_sym
180
+ when :Time
181
+ Time.parse(value)
182
+ when :Date
183
+ Date.parse(value)
184
+ when :String
185
+ value.to_s
186
+ when :Integer
187
+ value.to_i
188
+ when :Float
189
+ value.to_f
190
+ when :Boolean
191
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
192
+ true
193
+ else
194
+ false
195
+ end
196
+ when :Object
197
+ # generic object (usually a Hash), return directly
198
+ value
199
+ when /\AArray<(?<inner_type>.+)>\z/
200
+ inner_type = Regexp.last_match[:inner_type]
201
+ value.map { |v| _deserialize(inner_type, v) }
202
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
203
+ k_type = Regexp.last_match[:k_type]
204
+ v_type = Regexp.last_match[:v_type]
205
+ {}.tap do |hash|
206
+ value.each do |k, v|
207
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
208
+ end
209
+ end
210
+ else # model
211
+ # models (e.g. Pet) or oneOf
212
+ klass = Akeyless.const_get(type)
213
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
214
+ end
215
+ end
216
+
217
+ # Returns the string representation of the object
218
+ # @return [String] String presentation of the object
219
+ def to_s
220
+ to_hash.to_s
221
+ end
222
+
223
+ # to_body is an alias to to_hash (backward compatibility)
224
+ # @return [Hash] Returns the object in the form of hash
225
+ def to_body
226
+ to_hash
227
+ end
228
+
229
+ # Returns the object in the form of hash
230
+ # @return [Hash] Returns the object in the form of hash
231
+ def to_hash
232
+ hash = {}
233
+ self.class.attribute_map.each_pair do |attr, param|
234
+ value = self.send(attr)
235
+ if value.nil?
236
+ is_nullable = self.class.openapi_nullable.include?(attr)
237
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
238
+ end
239
+
240
+ hash[param] = _to_hash(value)
241
+ end
242
+ hash
243
+ end
244
+
245
+ # Outputs non-array value in the form of hash
246
+ # For object, use to_hash. Otherwise, just return the value
247
+ # @param [Object] value Any valid value
248
+ # @return [Hash] Returns the value in the form of hash
249
+ def _to_hash(value)
250
+ if value.is_a?(Array)
251
+ value.compact.map { |v| _to_hash(v) }
252
+ elsif value.is_a?(Hash)
253
+ {}.tap do |hash|
254
+ value.each { |k, v| hash[k] = _to_hash(v) }
255
+ end
256
+ elsif value.respond_to? :to_hash
257
+ value.to_hash
258
+ else
259
+ value
260
+ end
261
+ end
262
+
263
+ end
264
+
265
+ end
@@ -0,0 +1,228 @@
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.3.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Akeyless
17
+ class GetCertificateValueOutput
18
+ attr_accessor :certificate_pem
19
+
20
+ attr_accessor :private_key_pem
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'certificate_pem' => :'certificate_pem',
26
+ :'private_key_pem' => :'private_key_pem'
27
+ }
28
+ end
29
+
30
+ # Returns all the JSON keys this model knows about
31
+ def self.acceptable_attributes
32
+ attribute_map.values
33
+ end
34
+
35
+ # Attribute type mapping.
36
+ def self.openapi_types
37
+ {
38
+ :'certificate_pem' => :'String',
39
+ :'private_key_pem' => :'String'
40
+ }
41
+ end
42
+
43
+ # List of attributes with nullable: true
44
+ def self.openapi_nullable
45
+ Set.new([
46
+ ])
47
+ end
48
+
49
+ # Initializes the object
50
+ # @param [Hash] attributes Model attributes in the form of hash
51
+ def initialize(attributes = {})
52
+ if (!attributes.is_a?(Hash))
53
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Akeyless::GetCertificateValueOutput` initialize method"
54
+ end
55
+
56
+ # check to see if the attribute exists and convert string to symbol for hash key
57
+ attributes = attributes.each_with_object({}) { |(k, v), h|
58
+ if (!self.class.attribute_map.key?(k.to_sym))
59
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Akeyless::GetCertificateValueOutput`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
60
+ end
61
+ h[k.to_sym] = v
62
+ }
63
+
64
+ if attributes.key?(:'certificate_pem')
65
+ self.certificate_pem = attributes[:'certificate_pem']
66
+ end
67
+
68
+ if attributes.key?(:'private_key_pem')
69
+ self.private_key_pem = attributes[:'private_key_pem']
70
+ end
71
+ end
72
+
73
+ # Show invalid properties with the reasons. Usually used together with valid?
74
+ # @return Array for valid properties with the reasons
75
+ def list_invalid_properties
76
+ invalid_properties = Array.new
77
+ invalid_properties
78
+ end
79
+
80
+ # Check to see if the all the properties in the model are valid
81
+ # @return true if the model is valid
82
+ def valid?
83
+ true
84
+ end
85
+
86
+ # Checks equality by comparing each attribute.
87
+ # @param [Object] Object to be compared
88
+ def ==(o)
89
+ return true if self.equal?(o)
90
+ self.class == o.class &&
91
+ certificate_pem == o.certificate_pem &&
92
+ private_key_pem == o.private_key_pem
93
+ end
94
+
95
+ # @see the `==` method
96
+ # @param [Object] Object to be compared
97
+ def eql?(o)
98
+ self == o
99
+ end
100
+
101
+ # Calculates hash code according to all attributes.
102
+ # @return [Integer] Hash code
103
+ def hash
104
+ [certificate_pem, private_key_pem].hash
105
+ end
106
+
107
+ # Builds the object from hash
108
+ # @param [Hash] attributes Model attributes in the form of hash
109
+ # @return [Object] Returns the model itself
110
+ def self.build_from_hash(attributes)
111
+ new.build_from_hash(attributes)
112
+ end
113
+
114
+ # Builds the object from hash
115
+ # @param [Hash] attributes Model attributes in the form of hash
116
+ # @return [Object] Returns the model itself
117
+ def build_from_hash(attributes)
118
+ return nil unless attributes.is_a?(Hash)
119
+ attributes = attributes.transform_keys(&:to_sym)
120
+ self.class.openapi_types.each_pair do |key, type|
121
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
122
+ self.send("#{key}=", nil)
123
+ elsif type =~ /\AArray<(.*)>/i
124
+ # check to ensure the input is an array given that the attribute
125
+ # is documented as an array but the input is not
126
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
127
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
128
+ end
129
+ elsif !attributes[self.class.attribute_map[key]].nil?
130
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
131
+ end
132
+ end
133
+
134
+ self
135
+ end
136
+
137
+ # Deserializes the data based on type
138
+ # @param string type Data type
139
+ # @param string value Value to be deserialized
140
+ # @return [Object] Deserialized data
141
+ def _deserialize(type, value)
142
+ case type.to_sym
143
+ when :Time
144
+ Time.parse(value)
145
+ when :Date
146
+ Date.parse(value)
147
+ when :String
148
+ value.to_s
149
+ when :Integer
150
+ value.to_i
151
+ when :Float
152
+ value.to_f
153
+ when :Boolean
154
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
155
+ true
156
+ else
157
+ false
158
+ end
159
+ when :Object
160
+ # generic object (usually a Hash), return directly
161
+ value
162
+ when /\AArray<(?<inner_type>.+)>\z/
163
+ inner_type = Regexp.last_match[:inner_type]
164
+ value.map { |v| _deserialize(inner_type, v) }
165
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
166
+ k_type = Regexp.last_match[:k_type]
167
+ v_type = Regexp.last_match[:v_type]
168
+ {}.tap do |hash|
169
+ value.each do |k, v|
170
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
171
+ end
172
+ end
173
+ else # model
174
+ # models (e.g. Pet) or oneOf
175
+ klass = Akeyless.const_get(type)
176
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
177
+ end
178
+ end
179
+
180
+ # Returns the string representation of the object
181
+ # @return [String] String presentation of the object
182
+ def to_s
183
+ to_hash.to_s
184
+ end
185
+
186
+ # to_body is an alias to to_hash (backward compatibility)
187
+ # @return [Hash] Returns the object in the form of hash
188
+ def to_body
189
+ to_hash
190
+ end
191
+
192
+ # Returns the object in the form of hash
193
+ # @return [Hash] Returns the object in the form of hash
194
+ def to_hash
195
+ hash = {}
196
+ self.class.attribute_map.each_pair do |attr, param|
197
+ value = self.send(attr)
198
+ if value.nil?
199
+ is_nullable = self.class.openapi_nullable.include?(attr)
200
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
201
+ end
202
+
203
+ hash[param] = _to_hash(value)
204
+ end
205
+ hash
206
+ end
207
+
208
+ # Outputs non-array value in the form of hash
209
+ # For object, use to_hash. Otherwise, just return the value
210
+ # @param [Object] value Any valid value
211
+ # @return [Hash] Returns the value in the form of hash
212
+ def _to_hash(value)
213
+ if value.is_a?(Array)
214
+ value.compact.map { |v| _to_hash(v) }
215
+ elsif value.is_a?(Hash)
216
+ {}.tap do |hash|
217
+ value.each { |k, v| hash[k] = _to_hash(v) }
218
+ end
219
+ elsif value.respond_to? :to_hash
220
+ value.to_hash
221
+ else
222
+ value
223
+ end
224
+ end
225
+
226
+ end
227
+
228
+ end