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,297 @@
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 UpdateCertificateValue
18
+ # Content of the certificate PEM in a Base64 format.
19
+ attr_accessor :certificate_data
20
+
21
+ # How many days before the expiration of the certificate would you like to be notified.
22
+ attr_accessor :expiration_event_in
23
+
24
+ # Set output format to JSON
25
+ attr_accessor :json
26
+
27
+ # The name of a key to use to encrypt the certificate's key (if empty, the account default protectionKey key will be used)
28
+ attr_accessor :key
29
+
30
+ # Content of the certificate's private key PEM in a Base64 format.
31
+ attr_accessor :key_data
32
+
33
+ # Certificate name
34
+ attr_accessor :name
35
+
36
+ # Authentication token (see `/auth` and `/configure`)
37
+ attr_accessor :token
38
+
39
+ # The universal identity token, Required only for universal_identity authentication
40
+ attr_accessor :uid_token
41
+
42
+ # Attribute mapping from ruby-style variable name to JSON key.
43
+ def self.attribute_map
44
+ {
45
+ :'certificate_data' => :'certificate-data',
46
+ :'expiration_event_in' => :'expiration-event-in',
47
+ :'json' => :'json',
48
+ :'key' => :'key',
49
+ :'key_data' => :'key-data',
50
+ :'name' => :'name',
51
+ :'token' => :'token',
52
+ :'uid_token' => :'uid-token'
53
+ }
54
+ end
55
+
56
+ # Returns all the JSON keys this model knows about
57
+ def self.acceptable_attributes
58
+ attribute_map.values
59
+ end
60
+
61
+ # Attribute type mapping.
62
+ def self.openapi_types
63
+ {
64
+ :'certificate_data' => :'String',
65
+ :'expiration_event_in' => :'Array<String>',
66
+ :'json' => :'Boolean',
67
+ :'key' => :'String',
68
+ :'key_data' => :'String',
69
+ :'name' => :'String',
70
+ :'token' => :'String',
71
+ :'uid_token' => :'String'
72
+ }
73
+ end
74
+
75
+ # List of attributes with nullable: true
76
+ def self.openapi_nullable
77
+ Set.new([
78
+ ])
79
+ end
80
+
81
+ # Initializes the object
82
+ # @param [Hash] attributes Model attributes in the form of hash
83
+ def initialize(attributes = {})
84
+ if (!attributes.is_a?(Hash))
85
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Akeyless::UpdateCertificateValue` initialize method"
86
+ end
87
+
88
+ # check to see if the attribute exists and convert string to symbol for hash key
89
+ attributes = attributes.each_with_object({}) { |(k, v), h|
90
+ if (!self.class.attribute_map.key?(k.to_sym))
91
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Akeyless::UpdateCertificateValue`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
92
+ end
93
+ h[k.to_sym] = v
94
+ }
95
+
96
+ if attributes.key?(:'certificate_data')
97
+ self.certificate_data = attributes[:'certificate_data']
98
+ end
99
+
100
+ if attributes.key?(:'expiration_event_in')
101
+ if (value = attributes[:'expiration_event_in']).is_a?(Array)
102
+ self.expiration_event_in = value
103
+ end
104
+ end
105
+
106
+ if attributes.key?(:'json')
107
+ self.json = attributes[:'json']
108
+ end
109
+
110
+ if attributes.key?(:'key')
111
+ self.key = attributes[:'key']
112
+ end
113
+
114
+ if attributes.key?(:'key_data')
115
+ self.key_data = attributes[:'key_data']
116
+ end
117
+
118
+ if attributes.key?(:'name')
119
+ self.name = attributes[:'name']
120
+ end
121
+
122
+ if attributes.key?(:'token')
123
+ self.token = attributes[:'token']
124
+ end
125
+
126
+ if attributes.key?(:'uid_token')
127
+ self.uid_token = attributes[:'uid_token']
128
+ end
129
+ end
130
+
131
+ # Show invalid properties with the reasons. Usually used together with valid?
132
+ # @return Array for valid properties with the reasons
133
+ def list_invalid_properties
134
+ invalid_properties = Array.new
135
+ if @name.nil?
136
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
137
+ end
138
+
139
+ invalid_properties
140
+ end
141
+
142
+ # Check to see if the all the properties in the model are valid
143
+ # @return true if the model is valid
144
+ def valid?
145
+ return false if @name.nil?
146
+ true
147
+ end
148
+
149
+ # Checks equality by comparing each attribute.
150
+ # @param [Object] Object to be compared
151
+ def ==(o)
152
+ return true if self.equal?(o)
153
+ self.class == o.class &&
154
+ certificate_data == o.certificate_data &&
155
+ expiration_event_in == o.expiration_event_in &&
156
+ json == o.json &&
157
+ key == o.key &&
158
+ key_data == o.key_data &&
159
+ name == o.name &&
160
+ token == o.token &&
161
+ uid_token == o.uid_token
162
+ end
163
+
164
+ # @see the `==` method
165
+ # @param [Object] Object to be compared
166
+ def eql?(o)
167
+ self == o
168
+ end
169
+
170
+ # Calculates hash code according to all attributes.
171
+ # @return [Integer] Hash code
172
+ def hash
173
+ [certificate_data, expiration_event_in, json, key, key_data, name, token, uid_token].hash
174
+ end
175
+
176
+ # Builds the object from hash
177
+ # @param [Hash] attributes Model attributes in the form of hash
178
+ # @return [Object] Returns the model itself
179
+ def self.build_from_hash(attributes)
180
+ new.build_from_hash(attributes)
181
+ end
182
+
183
+ # Builds the object from hash
184
+ # @param [Hash] attributes Model attributes in the form of hash
185
+ # @return [Object] Returns the model itself
186
+ def build_from_hash(attributes)
187
+ return nil unless attributes.is_a?(Hash)
188
+ attributes = attributes.transform_keys(&:to_sym)
189
+ self.class.openapi_types.each_pair do |key, type|
190
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
191
+ self.send("#{key}=", nil)
192
+ elsif type =~ /\AArray<(.*)>/i
193
+ # check to ensure the input is an array given that the attribute
194
+ # is documented as an array but the input is not
195
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
196
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
197
+ end
198
+ elsif !attributes[self.class.attribute_map[key]].nil?
199
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
200
+ end
201
+ end
202
+
203
+ self
204
+ end
205
+
206
+ # Deserializes the data based on type
207
+ # @param string type Data type
208
+ # @param string value Value to be deserialized
209
+ # @return [Object] Deserialized data
210
+ def _deserialize(type, value)
211
+ case type.to_sym
212
+ when :Time
213
+ Time.parse(value)
214
+ when :Date
215
+ Date.parse(value)
216
+ when :String
217
+ value.to_s
218
+ when :Integer
219
+ value.to_i
220
+ when :Float
221
+ value.to_f
222
+ when :Boolean
223
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
224
+ true
225
+ else
226
+ false
227
+ end
228
+ when :Object
229
+ # generic object (usually a Hash), return directly
230
+ value
231
+ when /\AArray<(?<inner_type>.+)>\z/
232
+ inner_type = Regexp.last_match[:inner_type]
233
+ value.map { |v| _deserialize(inner_type, v) }
234
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
235
+ k_type = Regexp.last_match[:k_type]
236
+ v_type = Regexp.last_match[:v_type]
237
+ {}.tap do |hash|
238
+ value.each do |k, v|
239
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
240
+ end
241
+ end
242
+ else # model
243
+ # models (e.g. Pet) or oneOf
244
+ klass = Akeyless.const_get(type)
245
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
246
+ end
247
+ end
248
+
249
+ # Returns the string representation of the object
250
+ # @return [String] String presentation of the object
251
+ def to_s
252
+ to_hash.to_s
253
+ end
254
+
255
+ # to_body is an alias to to_hash (backward compatibility)
256
+ # @return [Hash] Returns the object in the form of hash
257
+ def to_body
258
+ to_hash
259
+ end
260
+
261
+ # Returns the object in the form of hash
262
+ # @return [Hash] Returns the object in the form of hash
263
+ def to_hash
264
+ hash = {}
265
+ self.class.attribute_map.each_pair do |attr, param|
266
+ value = self.send(attr)
267
+ if value.nil?
268
+ is_nullable = self.class.openapi_nullable.include?(attr)
269
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
270
+ end
271
+
272
+ hash[param] = _to_hash(value)
273
+ end
274
+ hash
275
+ end
276
+
277
+ # Outputs non-array value in the form of hash
278
+ # For object, use to_hash. Otherwise, just return the value
279
+ # @param [Object] value Any valid value
280
+ # @return [Hash] Returns the value in the form of hash
281
+ def _to_hash(value)
282
+ if value.is_a?(Array)
283
+ value.compact.map { |v| _to_hash(v) }
284
+ elsif value.is_a?(Hash)
285
+ {}.tap do |hash|
286
+ value.each { |k, v| hash[k] = _to_hash(v) }
287
+ end
288
+ elsif value.respond_to? :to_hash
289
+ value.to_hash
290
+ else
291
+ value
292
+ end
293
+ end
294
+
295
+ end
296
+
297
+ end
@@ -0,0 +1,341 @@
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 UpdateEventForwarder
18
+ # Workstation Admin Name
19
+ attr_accessor :admin_name
20
+
21
+ # A comma seperated list of email addresses to send event to (relevant only for \\\"email\\\" Event Forwarder)
22
+ attr_accessor :email_to
23
+
24
+ # Enable
25
+ attr_accessor :enable
26
+
27
+ # Event sources
28
+ attr_accessor :event_source_locations
29
+
30
+ # Event types
31
+ attr_accessor :event_types
32
+
33
+ # Workstation Host
34
+ attr_accessor :host
35
+
36
+ # Set output format to JSON
37
+ attr_accessor :json
38
+
39
+ # EventForwarder name
40
+ attr_accessor :name
41
+
42
+ # New comment about the Event Forwarder
43
+ attr_accessor :new_comment
44
+
45
+ # New EventForwarder name
46
+ attr_accessor :new_name
47
+
48
+ # Authentication token (see `/auth` and `/configure`)
49
+ attr_accessor :token
50
+
51
+ # The universal identity token, Required only for universal_identity authentication
52
+ attr_accessor :uid_token
53
+
54
+ # Attribute mapping from ruby-style variable name to JSON key.
55
+ def self.attribute_map
56
+ {
57
+ :'admin_name' => :'admin-name',
58
+ :'email_to' => :'email-to',
59
+ :'enable' => :'enable',
60
+ :'event_source_locations' => :'event-source-locations',
61
+ :'event_types' => :'event-types',
62
+ :'host' => :'host',
63
+ :'json' => :'json',
64
+ :'name' => :'name',
65
+ :'new_comment' => :'new-comment',
66
+ :'new_name' => :'new-name',
67
+ :'token' => :'token',
68
+ :'uid_token' => :'uid-token'
69
+ }
70
+ end
71
+
72
+ # Returns all the JSON keys this model knows about
73
+ def self.acceptable_attributes
74
+ attribute_map.values
75
+ end
76
+
77
+ # Attribute type mapping.
78
+ def self.openapi_types
79
+ {
80
+ :'admin_name' => :'String',
81
+ :'email_to' => :'String',
82
+ :'enable' => :'String',
83
+ :'event_source_locations' => :'Array<String>',
84
+ :'event_types' => :'Array<String>',
85
+ :'host' => :'String',
86
+ :'json' => :'Boolean',
87
+ :'name' => :'String',
88
+ :'new_comment' => :'String',
89
+ :'new_name' => :'String',
90
+ :'token' => :'String',
91
+ :'uid_token' => :'String'
92
+ }
93
+ end
94
+
95
+ # List of attributes with nullable: true
96
+ def self.openapi_nullable
97
+ Set.new([
98
+ ])
99
+ end
100
+
101
+ # Initializes the object
102
+ # @param [Hash] attributes Model attributes in the form of hash
103
+ def initialize(attributes = {})
104
+ if (!attributes.is_a?(Hash))
105
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Akeyless::UpdateEventForwarder` initialize method"
106
+ end
107
+
108
+ # check to see if the attribute exists and convert string to symbol for hash key
109
+ attributes = attributes.each_with_object({}) { |(k, v), h|
110
+ if (!self.class.attribute_map.key?(k.to_sym))
111
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Akeyless::UpdateEventForwarder`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
112
+ end
113
+ h[k.to_sym] = v
114
+ }
115
+
116
+ if attributes.key?(:'admin_name')
117
+ self.admin_name = attributes[:'admin_name']
118
+ end
119
+
120
+ if attributes.key?(:'email_to')
121
+ self.email_to = attributes[:'email_to']
122
+ end
123
+
124
+ if attributes.key?(:'enable')
125
+ self.enable = attributes[:'enable']
126
+ end
127
+
128
+ if attributes.key?(:'event_source_locations')
129
+ if (value = attributes[:'event_source_locations']).is_a?(Array)
130
+ self.event_source_locations = value
131
+ end
132
+ end
133
+
134
+ if attributes.key?(:'event_types')
135
+ if (value = attributes[:'event_types']).is_a?(Array)
136
+ self.event_types = value
137
+ end
138
+ end
139
+
140
+ if attributes.key?(:'host')
141
+ self.host = attributes[:'host']
142
+ end
143
+
144
+ if attributes.key?(:'json')
145
+ self.json = attributes[:'json']
146
+ end
147
+
148
+ if attributes.key?(:'name')
149
+ self.name = attributes[:'name']
150
+ end
151
+
152
+ if attributes.key?(:'new_comment')
153
+ self.new_comment = attributes[:'new_comment']
154
+ else
155
+ self.new_comment = 'default_comment'
156
+ end
157
+
158
+ if attributes.key?(:'new_name')
159
+ self.new_name = attributes[:'new_name']
160
+ end
161
+
162
+ if attributes.key?(:'token')
163
+ self.token = attributes[:'token']
164
+ end
165
+
166
+ if attributes.key?(:'uid_token')
167
+ self.uid_token = attributes[:'uid_token']
168
+ end
169
+ end
170
+
171
+ # Show invalid properties with the reasons. Usually used together with valid?
172
+ # @return Array for valid properties with the reasons
173
+ def list_invalid_properties
174
+ invalid_properties = Array.new
175
+ if @name.nil?
176
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
177
+ end
178
+
179
+ invalid_properties
180
+ end
181
+
182
+ # Check to see if the all the properties in the model are valid
183
+ # @return true if the model is valid
184
+ def valid?
185
+ return false if @name.nil?
186
+ true
187
+ end
188
+
189
+ # Checks equality by comparing each attribute.
190
+ # @param [Object] Object to be compared
191
+ def ==(o)
192
+ return true if self.equal?(o)
193
+ self.class == o.class &&
194
+ admin_name == o.admin_name &&
195
+ email_to == o.email_to &&
196
+ enable == o.enable &&
197
+ event_source_locations == o.event_source_locations &&
198
+ event_types == o.event_types &&
199
+ host == o.host &&
200
+ json == o.json &&
201
+ name == o.name &&
202
+ new_comment == o.new_comment &&
203
+ new_name == o.new_name &&
204
+ token == o.token &&
205
+ uid_token == o.uid_token
206
+ end
207
+
208
+ # @see the `==` method
209
+ # @param [Object] Object to be compared
210
+ def eql?(o)
211
+ self == o
212
+ end
213
+
214
+ # Calculates hash code according to all attributes.
215
+ # @return [Integer] Hash code
216
+ def hash
217
+ [admin_name, email_to, enable, event_source_locations, event_types, host, json, name, new_comment, new_name, token, uid_token].hash
218
+ end
219
+
220
+ # Builds the object from hash
221
+ # @param [Hash] attributes Model attributes in the form of hash
222
+ # @return [Object] Returns the model itself
223
+ def self.build_from_hash(attributes)
224
+ new.build_from_hash(attributes)
225
+ end
226
+
227
+ # Builds the object from hash
228
+ # @param [Hash] attributes Model attributes in the form of hash
229
+ # @return [Object] Returns the model itself
230
+ def build_from_hash(attributes)
231
+ return nil unless attributes.is_a?(Hash)
232
+ attributes = attributes.transform_keys(&:to_sym)
233
+ self.class.openapi_types.each_pair do |key, type|
234
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
235
+ self.send("#{key}=", nil)
236
+ elsif type =~ /\AArray<(.*)>/i
237
+ # check to ensure the input is an array given that the attribute
238
+ # is documented as an array but the input is not
239
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
240
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
241
+ end
242
+ elsif !attributes[self.class.attribute_map[key]].nil?
243
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
244
+ end
245
+ end
246
+
247
+ self
248
+ end
249
+
250
+ # Deserializes the data based on type
251
+ # @param string type Data type
252
+ # @param string value Value to be deserialized
253
+ # @return [Object] Deserialized data
254
+ def _deserialize(type, value)
255
+ case type.to_sym
256
+ when :Time
257
+ Time.parse(value)
258
+ when :Date
259
+ Date.parse(value)
260
+ when :String
261
+ value.to_s
262
+ when :Integer
263
+ value.to_i
264
+ when :Float
265
+ value.to_f
266
+ when :Boolean
267
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
268
+ true
269
+ else
270
+ false
271
+ end
272
+ when :Object
273
+ # generic object (usually a Hash), return directly
274
+ value
275
+ when /\AArray<(?<inner_type>.+)>\z/
276
+ inner_type = Regexp.last_match[:inner_type]
277
+ value.map { |v| _deserialize(inner_type, v) }
278
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
279
+ k_type = Regexp.last_match[:k_type]
280
+ v_type = Regexp.last_match[:v_type]
281
+ {}.tap do |hash|
282
+ value.each do |k, v|
283
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
284
+ end
285
+ end
286
+ else # model
287
+ # models (e.g. Pet) or oneOf
288
+ klass = Akeyless.const_get(type)
289
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
290
+ end
291
+ end
292
+
293
+ # Returns the string representation of the object
294
+ # @return [String] String presentation of the object
295
+ def to_s
296
+ to_hash.to_s
297
+ end
298
+
299
+ # to_body is an alias to to_hash (backward compatibility)
300
+ # @return [Hash] Returns the object in the form of hash
301
+ def to_body
302
+ to_hash
303
+ end
304
+
305
+ # Returns the object in the form of hash
306
+ # @return [Hash] Returns the object in the form of hash
307
+ def to_hash
308
+ hash = {}
309
+ self.class.attribute_map.each_pair do |attr, param|
310
+ value = self.send(attr)
311
+ if value.nil?
312
+ is_nullable = self.class.openapi_nullable.include?(attr)
313
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
314
+ end
315
+
316
+ hash[param] = _to_hash(value)
317
+ end
318
+ hash
319
+ end
320
+
321
+ # Outputs non-array value in the form of hash
322
+ # For object, use to_hash. Otherwise, just return the value
323
+ # @param [Object] value Any valid value
324
+ # @return [Hash] Returns the value in the form of hash
325
+ def _to_hash(value)
326
+ if value.is_a?(Array)
327
+ value.compact.map { |v| _to_hash(v) }
328
+ elsif value.is_a?(Hash)
329
+ {}.tap do |hash|
330
+ value.each { |k, v| hash[k] = _to_hash(v) }
331
+ end
332
+ elsif value.respond_to? :to_hash
333
+ value.to_hash
334
+ else
335
+ value
336
+ end
337
+ end
338
+
339
+ end
340
+
341
+ end
@@ -31,6 +31,9 @@ module Akeyless
31
31
 
32
32
  attr_accessor :custom_payload
33
33
 
34
+ # Base64-encoded service account private key text
35
+ attr_accessor :gcp_key
36
+
34
37
  # Set output format to JSON
35
38
  attr_accessor :json
36
39
 
@@ -130,6 +133,7 @@ module Akeyless
130
133
  :'auto_rotate' => :'auto-rotate',
131
134
  :'aws_region' => :'aws-region',
132
135
  :'custom_payload' => :'custom-payload',
136
+ :'gcp_key' => :'gcp-key',
133
137
  :'json' => :'json',
134
138
  :'keep_prev_version' => :'keep-prev-version',
135
139
  :'key' => :'key',
@@ -179,6 +183,7 @@ module Akeyless
179
183
  :'auto_rotate' => :'String',
180
184
  :'aws_region' => :'String',
181
185
  :'custom_payload' => :'String',
186
+ :'gcp_key' => :'String',
182
187
  :'json' => :'Boolean',
183
188
  :'keep_prev_version' => :'String',
184
189
  :'key' => :'String',
@@ -263,6 +268,10 @@ module Akeyless
263
268
  self.custom_payload = attributes[:'custom_payload']
264
269
  end
265
270
 
271
+ if attributes.key?(:'gcp_key')
272
+ self.gcp_key = attributes[:'gcp_key']
273
+ end
274
+
266
275
  if attributes.key?(:'json')
267
276
  self.json = attributes[:'json']
268
277
  end
@@ -435,6 +444,7 @@ module Akeyless
435
444
  auto_rotate == o.auto_rotate &&
436
445
  aws_region == o.aws_region &&
437
446
  custom_payload == o.custom_payload &&
447
+ gcp_key == o.gcp_key &&
438
448
  json == o.json &&
439
449
  keep_prev_version == o.keep_prev_version &&
440
450
  key == o.key &&
@@ -478,7 +488,7 @@ module Akeyless
478
488
  # Calculates hash code according to all attributes.
479
489
  # @return [Integer] Hash code
480
490
  def hash
481
- [add_tag, api_id, api_key, auto_rotate, aws_region, custom_payload, json, keep_prev_version, key, name, new_metadata, new_name, new_version, rm_tag, rotated_password, rotated_username, rotation_hour, rotation_interval, rotator_creds_type, rotator_custom_cmd, secure_access_allow_external_user, secure_access_aws_account_id, secure_access_aws_native_cli, secure_access_bastion_issuer, secure_access_db_name, secure_access_db_schema, secure_access_enable, secure_access_host, secure_access_rdp_domain, secure_access_rdp_user, secure_access_web, secure_access_web_browsing, secure_access_web_proxy, ssh_password, ssh_username, storage_account_key_name, token, uid_token].hash
491
+ [add_tag, api_id, api_key, auto_rotate, aws_region, custom_payload, gcp_key, json, keep_prev_version, key, name, new_metadata, new_name, new_version, rm_tag, rotated_password, rotated_username, rotation_hour, rotation_interval, rotator_creds_type, rotator_custom_cmd, secure_access_allow_external_user, secure_access_aws_account_id, secure_access_aws_native_cli, secure_access_bastion_issuer, secure_access_db_name, secure_access_db_schema, secure_access_enable, secure_access_host, secure_access_rdp_domain, secure_access_rdp_user, secure_access_web, secure_access_web_browsing, secure_access_web_proxy, ssh_password, ssh_username, storage_account_key_name, token, uid_token].hash
482
492
  end
483
493
 
484
494
  # Builds the object from hash
@@ -11,5 +11,5 @@ OpenAPI Generator version: 6.3.0-SNAPSHOT
11
11
  =end
12
12
 
13
13
  module Akeyless
14
- VERSION = '3.0.1'
14
+ VERSION = '3.1.1'
15
15
  end