akeyless 3.0.0 → 3.1.0

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 (74) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +24 -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/CreateEventForwarder.md +48 -0
  9. data/docs/CreateEventForwarderOutput.md +18 -0
  10. data/docs/CreateRotatedSecret.md +2 -0
  11. data/docs/DeleteEventForwarder.md +24 -0
  12. data/docs/EmailEntry.md +20 -0
  13. data/docs/Extension.md +22 -0
  14. data/docs/GatewayUpdateItem.md +2 -0
  15. data/docs/GetEventForwarder.md +24 -0
  16. data/docs/GetEventForwarderOutput.md +18 -0
  17. data/docs/Item.md +4 -0
  18. data/docs/ItemGeneralInfo.md +2 -0
  19. data/docs/ListSharedItems.md +24 -0
  20. data/docs/Name.md +28 -0
  21. data/docs/NotiForwarder.md +56 -0
  22. data/docs/RequestAccess.md +28 -0
  23. data/docs/RequestAccessOutput.md +18 -0
  24. data/docs/Target.md +4 -0
  25. data/docs/UpdateEventForwarder.md +40 -0
  26. data/docs/UpdateRotatedSecret.md +2 -0
  27. data/docs/V2Api.md +377 -63
  28. data/lib/akeyless/api/v2_api.rb +384 -64
  29. data/lib/akeyless/api_error.rb +1 -0
  30. data/lib/akeyless/configuration.rb +11 -0
  31. data/lib/akeyless/models/attribute_type_and_value.rb +231 -0
  32. data/lib/akeyless/models/certificate_chain_info.rb +241 -0
  33. data/lib/akeyless/models/certificate_expiration_event.rb +219 -0
  34. data/lib/akeyless/models/certificate_info.rb +434 -0
  35. data/lib/akeyless/models/connect.rb +11 -1
  36. data/lib/akeyless/models/create_event_forwarder.rb +394 -0
  37. data/lib/akeyless/models/create_event_forwarder_output.rb +219 -0
  38. data/lib/akeyless/models/create_rotated_secret.rb +11 -1
  39. data/lib/akeyless/models/delete_event_forwarder.rb +255 -0
  40. data/lib/akeyless/models/email_entry.rb +228 -0
  41. data/lib/akeyless/models/extension.rb +237 -0
  42. data/lib/akeyless/models/gateway_update_item.rb +11 -1
  43. data/lib/akeyless/models/get_event_forwarder.rb +255 -0
  44. data/lib/akeyless/models/get_event_forwarder_output.rb +219 -0
  45. data/lib/akeyless/models/item.rb +19 -1
  46. data/lib/akeyless/models/item_general_info.rb +10 -1
  47. data/lib/akeyless/models/list_shared_items.rb +253 -0
  48. data/lib/akeyless/models/name.rb +277 -0
  49. data/lib/akeyless/models/noti_forwarder.rb +400 -0
  50. data/lib/akeyless/models/request_access.rb +282 -0
  51. data/lib/akeyless/models/request_access_output.rb +219 -0
  52. data/lib/akeyless/models/target.rb +19 -1
  53. data/lib/akeyless/models/update_event_forwarder.rb +341 -0
  54. data/lib/akeyless/models/update_rotated_secret.rb +11 -1
  55. data/lib/akeyless/version.rb +1 -1
  56. data/lib/akeyless.rb +17 -1
  57. data/spec/models/attribute_type_and_value_spec.rb +40 -0
  58. data/spec/models/certificate_chain_info_spec.rb +46 -0
  59. data/spec/models/certificate_expiration_event_spec.rb +34 -0
  60. data/spec/models/certificate_info_spec.rb +166 -0
  61. data/spec/models/create_event_forwarder_output_spec.rb +34 -0
  62. data/spec/models/create_event_forwarder_spec.rb +124 -0
  63. data/spec/models/delete_event_forwarder_spec.rb +52 -0
  64. data/spec/models/email_entry_spec.rb +40 -0
  65. data/spec/models/extension_spec.rb +46 -0
  66. data/spec/models/get_event_forwarder_output_spec.rb +34 -0
  67. data/spec/models/get_event_forwarder_spec.rb +52 -0
  68. data/spec/models/list_shared_items_spec.rb +52 -0
  69. data/spec/models/name_spec.rb +64 -0
  70. data/spec/models/noti_forwarder_spec.rb +148 -0
  71. data/spec/models/request_access_output_spec.rb +34 -0
  72. data/spec/models/request_access_spec.rb +64 -0
  73. data/spec/models/update_event_forwarder_spec.rb +100 -0
  74. metadata +597 -529
@@ -0,0 +1,219 @@
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 RequestAccessOutput
18
+ attr_accessor :response
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'response' => :'response'
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
+ :'response' => :'String'
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::RequestAccessOutput` 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::RequestAccessOutput`. 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?(:'response')
61
+ self.response = attributes[:'response']
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
+ invalid_properties = Array.new
69
+ invalid_properties
70
+ end
71
+
72
+ # Check to see if the all the properties in the model are valid
73
+ # @return true if the model is valid
74
+ def valid?
75
+ true
76
+ end
77
+
78
+ # Checks equality by comparing each attribute.
79
+ # @param [Object] Object to be compared
80
+ def ==(o)
81
+ return true if self.equal?(o)
82
+ self.class == o.class &&
83
+ response == o.response
84
+ end
85
+
86
+ # @see the `==` method
87
+ # @param [Object] Object to be compared
88
+ def eql?(o)
89
+ self == o
90
+ end
91
+
92
+ # Calculates hash code according to all attributes.
93
+ # @return [Integer] Hash code
94
+ def hash
95
+ [response].hash
96
+ end
97
+
98
+ # Builds the object from hash
99
+ # @param [Hash] attributes Model attributes in the form of hash
100
+ # @return [Object] Returns the model itself
101
+ def self.build_from_hash(attributes)
102
+ new.build_from_hash(attributes)
103
+ end
104
+
105
+ # Builds the object from hash
106
+ # @param [Hash] attributes Model attributes in the form of hash
107
+ # @return [Object] Returns the model itself
108
+ def build_from_hash(attributes)
109
+ return nil unless attributes.is_a?(Hash)
110
+ attributes = attributes.transform_keys(&:to_sym)
111
+ self.class.openapi_types.each_pair do |key, type|
112
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
113
+ self.send("#{key}=", nil)
114
+ elsif type =~ /\AArray<(.*)>/i
115
+ # check to ensure the input is an array given that the attribute
116
+ # is documented as an array but the input is not
117
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
118
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
119
+ end
120
+ elsif !attributes[self.class.attribute_map[key]].nil?
121
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
122
+ end
123
+ end
124
+
125
+ self
126
+ end
127
+
128
+ # Deserializes the data based on type
129
+ # @param string type Data type
130
+ # @param string value Value to be deserialized
131
+ # @return [Object] Deserialized data
132
+ def _deserialize(type, value)
133
+ case type.to_sym
134
+ when :Time
135
+ Time.parse(value)
136
+ when :Date
137
+ Date.parse(value)
138
+ when :String
139
+ value.to_s
140
+ when :Integer
141
+ value.to_i
142
+ when :Float
143
+ value.to_f
144
+ when :Boolean
145
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
146
+ true
147
+ else
148
+ false
149
+ end
150
+ when :Object
151
+ # generic object (usually a Hash), return directly
152
+ value
153
+ when /\AArray<(?<inner_type>.+)>\z/
154
+ inner_type = Regexp.last_match[:inner_type]
155
+ value.map { |v| _deserialize(inner_type, v) }
156
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
157
+ k_type = Regexp.last_match[:k_type]
158
+ v_type = Regexp.last_match[:v_type]
159
+ {}.tap do |hash|
160
+ value.each do |k, v|
161
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
162
+ end
163
+ end
164
+ else # model
165
+ # models (e.g. Pet) or oneOf
166
+ klass = Akeyless.const_get(type)
167
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
168
+ end
169
+ end
170
+
171
+ # Returns the string representation of the object
172
+ # @return [String] String presentation of the object
173
+ def to_s
174
+ to_hash.to_s
175
+ end
176
+
177
+ # to_body is an alias to to_hash (backward compatibility)
178
+ # @return [Hash] Returns the object in the form of hash
179
+ def to_body
180
+ to_hash
181
+ end
182
+
183
+ # Returns the object in the form of hash
184
+ # @return [Hash] Returns the object in the form of hash
185
+ def to_hash
186
+ hash = {}
187
+ self.class.attribute_map.each_pair do |attr, param|
188
+ value = self.send(attr)
189
+ if value.nil?
190
+ is_nullable = self.class.openapi_nullable.include?(attr)
191
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
192
+ end
193
+
194
+ hash[param] = _to_hash(value)
195
+ end
196
+ hash
197
+ end
198
+
199
+ # Outputs non-array value in the form of hash
200
+ # For object, use to_hash. Otherwise, just return the value
201
+ # @param [Object] value Any valid value
202
+ # @return [Hash] Returns the value in the form of hash
203
+ def _to_hash(value)
204
+ if value.is_a?(Array)
205
+ value.compact.map { |v| _to_hash(v) }
206
+ elsif value.is_a?(Hash)
207
+ {}.tap do |hash|
208
+ value.each { |k, v| hash[k] = _to_hash(v) }
209
+ end
210
+ elsif value.respond_to? :to_hash
211
+ value.to_hash
212
+ else
213
+ value
214
+ end
215
+ end
216
+
217
+ end
218
+
219
+ end
@@ -17,6 +17,8 @@ module Akeyless
17
17
  class Target
18
18
  attr_accessor :access_date
19
19
 
20
+ attr_accessor :access_request_status
21
+
20
22
  # this is not \"omitempty\" since an empty value causes no update while an empty map will clear the attributes
21
23
  attr_accessor :attributes
22
24
 
@@ -28,6 +30,8 @@ module Akeyless
28
30
 
29
31
  attr_accessor :credentials_less
30
32
 
33
+ attr_accessor :is_access_request_enabled
34
+
31
35
  attr_accessor :last_version
32
36
 
33
37
  attr_accessor :modification_date
@@ -50,11 +54,13 @@ module Akeyless
50
54
  def self.attribute_map
51
55
  {
52
56
  :'access_date' => :'access_date',
57
+ :'access_request_status' => :'access_request_status',
53
58
  :'attributes' => :'attributes',
54
59
  :'client_permissions' => :'client_permissions',
55
60
  :'comment' => :'comment',
56
61
  :'creation_date' => :'creation_date',
57
62
  :'credentials_less' => :'credentials_less',
63
+ :'is_access_request_enabled' => :'is_access_request_enabled',
58
64
  :'last_version' => :'last_version',
59
65
  :'modification_date' => :'modification_date',
60
66
  :'protection_key_name' => :'protection_key_name',
@@ -76,11 +82,13 @@ module Akeyless
76
82
  def self.openapi_types
77
83
  {
78
84
  :'access_date' => :'Time',
85
+ :'access_request_status' => :'String',
79
86
  :'attributes' => :'Hash<String, Object>',
80
87
  :'client_permissions' => :'Array<String>',
81
88
  :'comment' => :'String',
82
89
  :'creation_date' => :'Time',
83
90
  :'credentials_less' => :'Boolean',
91
+ :'is_access_request_enabled' => :'Boolean',
84
92
  :'last_version' => :'Integer',
85
93
  :'modification_date' => :'Time',
86
94
  :'protection_key_name' => :'String',
@@ -118,6 +126,10 @@ module Akeyless
118
126
  self.access_date = attributes[:'access_date']
119
127
  end
120
128
 
129
+ if attributes.key?(:'access_request_status')
130
+ self.access_request_status = attributes[:'access_request_status']
131
+ end
132
+
121
133
  if attributes.key?(:'attributes')
122
134
  if (value = attributes[:'attributes']).is_a?(Hash)
123
135
  self.attributes = value
@@ -142,6 +154,10 @@ module Akeyless
142
154
  self.credentials_less = attributes[:'credentials_less']
143
155
  end
144
156
 
157
+ if attributes.key?(:'is_access_request_enabled')
158
+ self.is_access_request_enabled = attributes[:'is_access_request_enabled']
159
+ end
160
+
145
161
  if attributes.key?(:'last_version')
146
162
  self.last_version = attributes[:'last_version']
147
163
  end
@@ -202,11 +218,13 @@ module Akeyless
202
218
  return true if self.equal?(o)
203
219
  self.class == o.class &&
204
220
  access_date == o.access_date &&
221
+ access_request_status == o.access_request_status &&
205
222
  attributes == o.attributes &&
206
223
  client_permissions == o.client_permissions &&
207
224
  comment == o.comment &&
208
225
  creation_date == o.creation_date &&
209
226
  credentials_less == o.credentials_less &&
227
+ is_access_request_enabled == o.is_access_request_enabled &&
210
228
  last_version == o.last_version &&
211
229
  modification_date == o.modification_date &&
212
230
  protection_key_name == o.protection_key_name &&
@@ -227,7 +245,7 @@ module Akeyless
227
245
  # Calculates hash code according to all attributes.
228
246
  # @return [Integer] Hash code
229
247
  def hash
230
- [access_date, attributes, client_permissions, comment, creation_date, credentials_less, last_version, modification_date, protection_key_name, target_id, target_items_assoc, target_name, target_type, target_versions, with_customer_fragment].hash
248
+ [access_date, access_request_status, attributes, client_permissions, comment, creation_date, credentials_less, is_access_request_enabled, last_version, modification_date, protection_key_name, target_id, target_items_assoc, target_name, target_type, target_versions, with_customer_fragment].hash
231
249
  end
232
250
 
233
251
  # Builds the object from hash
@@ -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