akeyless 0.0.2.pre.rc2 → 2.16.0

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 +27 -9
  3. data/akeyless.gemspec +1 -1
  4. data/docs/Auth.md +5 -1
  5. data/docs/AuthMethodAccessInfo.md +2 -0
  6. data/docs/CertAccessRules.md +34 -0
  7. data/docs/ConfigHash.md +2 -0
  8. data/docs/CreateAuthMethodCert.md +48 -0
  9. data/docs/CreateAuthMethodCertOutput.md +18 -0
  10. data/docs/CreateAuthMethodLDAP.md +3 -1
  11. data/docs/CreateAuthMethodOIDC.md +4 -0
  12. data/docs/CreateClassicKey.md +5 -1
  13. data/docs/DSProducerDetails.md +4 -0
  14. data/docs/GatewayCreateProducerCustom.md +4 -0
  15. data/docs/GatewayCreateProducerHanaDb.md +54 -0
  16. data/docs/GatewayCreateProducerHanaDbOutput.md +18 -0
  17. data/docs/GatewayCreateProducerMongo.md +1 -1
  18. data/docs/GatewayCreateProducerOracleDb.md +8 -0
  19. data/docs/GatewayMessageQueueInfo.md +1 -3
  20. data/docs/GatewayUpdateProducerCustom.md +4 -0
  21. data/docs/GatewayUpdateProducerHanaDb.md +56 -0
  22. data/docs/GatewayUpdateProducerHanaDbOutput.md +18 -0
  23. data/docs/GatewayUpdateProducerMongo.md +1 -1
  24. data/docs/GatewayUpdateProducerOracleDb.md +8 -0
  25. data/docs/KMIPClient.md +2 -0
  26. data/docs/KMIPConfigPart.md +5 -1
  27. data/docs/KMIPServer.md +30 -0
  28. data/docs/KmipDeleteServer.md +20 -0
  29. data/docs/KmipDescribeServerOutput.md +4 -0
  30. data/docs/KmipMoveServer.md +22 -0
  31. data/docs/KmipMoveServerOutput.md +20 -0
  32. data/docs/ListAuthMethods.md +4 -0
  33. data/docs/ListRoles.md +2 -0
  34. data/docs/ListTargets.md +2 -0
  35. data/docs/OIDCAccessRules.md +4 -0
  36. data/docs/TargetItemAssociation.md +2 -0
  37. data/docs/UpdateAuthMethodCert.md +50 -0
  38. data/docs/UpdateAuthMethodCertOutput.md +18 -0
  39. data/docs/UpdateAuthMethodLDAP.md +3 -1
  40. data/docs/UpdateAuthMethodOIDC.md +4 -0
  41. data/docs/UpdateDBTarget.md +4 -0
  42. data/docs/UpdateOutput.md +2 -0
  43. data/docs/V2Api.md +319 -0
  44. data/git_push.sh +0 -0
  45. data/lib/akeyless/api/v2_api.rb +312 -0
  46. data/lib/akeyless/api_client.rb +3 -7
  47. data/lib/akeyless/configuration.rb +2 -1
  48. data/lib/akeyless/models/auth.rb +22 -2
  49. data/lib/akeyless/models/auth_method_access_info.rb +10 -1
  50. data/lib/akeyless/models/cert_access_rules.rb +316 -0
  51. data/lib/akeyless/models/config_hash.rb +10 -1
  52. data/lib/akeyless/models/create_auth_method_cert.rb +401 -0
  53. data/lib/akeyless/models/create_auth_method_cert_output.rb +219 -0
  54. data/lib/akeyless/models/create_auth_method_ldap.rb +14 -4
  55. data/lib/akeyless/models/create_auth_method_oidc.rb +23 -1
  56. data/lib/akeyless/models/create_classic_key.rb +26 -4
  57. data/lib/akeyless/models/ds_producer_details.rb +19 -1
  58. data/lib/akeyless/models/gateway_create_producer_custom.rb +23 -1
  59. data/lib/akeyless/models/gateway_create_producer_hana_db.rb +411 -0
  60. data/lib/akeyless/models/gateway_create_producer_hana_db_output.rb +219 -0
  61. data/lib/akeyless/models/gateway_create_producer_mongo.rb +0 -2
  62. data/lib/akeyless/models/gateway_create_producer_oracle_db.rb +39 -1
  63. data/lib/akeyless/models/gateway_message_queue_info.rb +4 -13
  64. data/lib/akeyless/models/gateway_update_producer_custom.rb +23 -1
  65. data/lib/akeyless/models/gateway_update_producer_hana_db.rb +421 -0
  66. data/lib/akeyless/models/gateway_update_producer_hana_db_output.rb +219 -0
  67. data/lib/akeyless/models/gateway_update_producer_mongo.rb +0 -2
  68. data/lib/akeyless/models/gateway_update_producer_oracle_db.rb +39 -1
  69. data/lib/akeyless/models/kmip_client.rb +10 -1
  70. data/lib/akeyless/models/kmip_config_part.rb +23 -1
  71. data/lib/akeyless/models/kmip_delete_server.rb +231 -0
  72. data/lib/akeyless/models/kmip_describe_server_output.rb +19 -1
  73. data/lib/akeyless/models/kmip_move_server.rb +240 -0
  74. data/lib/akeyless/models/kmip_move_server_output.rb +228 -0
  75. data/lib/akeyless/models/kmip_server.rb +277 -0
  76. data/lib/akeyless/models/list_auth_methods.rb +23 -1
  77. data/lib/akeyless/models/list_roles.rb +11 -1
  78. data/lib/akeyless/models/list_targets.rb +11 -1
  79. data/lib/akeyless/models/oidc_access_rules.rb +23 -1
  80. data/lib/akeyless/models/target_item_association.rb +10 -1
  81. data/lib/akeyless/models/update_auth_method_cert.rb +411 -0
  82. data/lib/akeyless/models/update_auth_method_cert_output.rb +219 -0
  83. data/lib/akeyless/models/update_auth_method_ldap.rb +14 -4
  84. data/lib/akeyless/models/update_auth_method_oidc.rb +23 -1
  85. data/lib/akeyless/models/update_db_target.rb +21 -1
  86. data/lib/akeyless/models/update_output.rb +10 -1
  87. data/lib/akeyless/version.rb +1 -1
  88. data/lib/akeyless.rb +13 -0
  89. data/spec/models/cert_access_rules_spec.rb +82 -0
  90. data/spec/models/create_auth_method_cert_output_spec.rb +34 -0
  91. data/spec/models/create_auth_method_cert_spec.rb +124 -0
  92. data/spec/models/gateway_create_producer_hana_db_output_spec.rb +34 -0
  93. data/spec/models/gateway_create_producer_hana_db_spec.rb +142 -0
  94. data/spec/models/gateway_update_producer_hana_db_output_spec.rb +34 -0
  95. data/spec/models/gateway_update_producer_hana_db_spec.rb +148 -0
  96. data/spec/models/kmip_delete_server_spec.rb +40 -0
  97. data/spec/models/kmip_move_server_output_spec.rb +40 -0
  98. data/spec/models/kmip_move_server_spec.rb +46 -0
  99. data/spec/models/kmip_server_spec.rb +58 -0
  100. data/spec/models/update_auth_method_cert_output_spec.rb +34 -0
  101. data/spec/models/update_auth_method_cert_spec.rb +130 -0
  102. metadata +508 -456
@@ -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.0.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Akeyless
17
+ class GatewayUpdateProducerHanaDbOutput
18
+ attr_accessor :producer_details
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'producer_details' => :'producer_details'
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
+ :'producer_details' => :'DSProducerDetails'
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::GatewayUpdateProducerHanaDbOutput` 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::GatewayUpdateProducerHanaDbOutput`. 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?(:'producer_details')
61
+ self.producer_details = attributes[:'producer_details']
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
+ producer_details == o.producer_details
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
+ [producer_details].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
@@ -184,8 +184,6 @@ module Akeyless
184
184
 
185
185
  if attributes.key?(:'mongodb_custom_data')
186
186
  self.mongodb_custom_data = attributes[:'mongodb_custom_data']
187
- else
188
- self.mongodb_custom_data = '\"\"'
189
187
  end
190
188
 
191
189
  if attributes.key?(:'mongodb_default_auth_db')
@@ -49,6 +49,14 @@ module Akeyless
49
49
  # Dynamic producer encryption key
50
50
  attr_accessor :producer_encryption_key_name
51
51
 
52
+ attr_accessor :secure_access_bastion_issuer
53
+
54
+ attr_accessor :secure_access_enable
55
+
56
+ attr_accessor :secure_access_host
57
+
58
+ attr_accessor :secure_access_web
59
+
52
60
  # List of the tags attached to this secret
53
61
  attr_accessor :tags
54
62
 
@@ -78,6 +86,10 @@ module Akeyless
78
86
  :'oracle_service_name' => :'oracle-service-name',
79
87
  :'oracle_username' => :'oracle-username',
80
88
  :'producer_encryption_key_name' => :'producer-encryption-key-name',
89
+ :'secure_access_bastion_issuer' => :'secure-access-bastion-issuer',
90
+ :'secure_access_enable' => :'secure-access-enable',
91
+ :'secure_access_host' => :'secure-access-host',
92
+ :'secure_access_web' => :'secure-access-web',
81
93
  :'tags' => :'tags',
82
94
  :'target_name' => :'target-name',
83
95
  :'token' => :'token',
@@ -105,6 +117,10 @@ module Akeyless
105
117
  :'oracle_service_name' => :'String',
106
118
  :'oracle_username' => :'String',
107
119
  :'producer_encryption_key_name' => :'String',
120
+ :'secure_access_bastion_issuer' => :'String',
121
+ :'secure_access_enable' => :'String',
122
+ :'secure_access_host' => :'Array<String>',
123
+ :'secure_access_web' => :'Boolean',
108
124
  :'tags' => :'Array<String>',
109
125
  :'target_name' => :'String',
110
126
  :'token' => :'String',
@@ -182,6 +198,24 @@ module Akeyless
182
198
  self.producer_encryption_key_name = attributes[:'producer_encryption_key_name']
183
199
  end
184
200
 
201
+ if attributes.key?(:'secure_access_bastion_issuer')
202
+ self.secure_access_bastion_issuer = attributes[:'secure_access_bastion_issuer']
203
+ end
204
+
205
+ if attributes.key?(:'secure_access_enable')
206
+ self.secure_access_enable = attributes[:'secure_access_enable']
207
+ end
208
+
209
+ if attributes.key?(:'secure_access_host')
210
+ if (value = attributes[:'secure_access_host']).is_a?(Array)
211
+ self.secure_access_host = value
212
+ end
213
+ end
214
+
215
+ if attributes.key?(:'secure_access_web')
216
+ self.secure_access_web = attributes[:'secure_access_web']
217
+ end
218
+
185
219
  if attributes.key?(:'tags')
186
220
  if (value = attributes[:'tags']).is_a?(Array)
187
221
  self.tags = value
@@ -241,6 +275,10 @@ module Akeyless
241
275
  oracle_service_name == o.oracle_service_name &&
242
276
  oracle_username == o.oracle_username &&
243
277
  producer_encryption_key_name == o.producer_encryption_key_name &&
278
+ secure_access_bastion_issuer == o.secure_access_bastion_issuer &&
279
+ secure_access_enable == o.secure_access_enable &&
280
+ secure_access_host == o.secure_access_host &&
281
+ secure_access_web == o.secure_access_web &&
244
282
  tags == o.tags &&
245
283
  target_name == o.target_name &&
246
284
  token == o.token &&
@@ -257,7 +295,7 @@ module Akeyless
257
295
  # Calculates hash code according to all attributes.
258
296
  # @return [Integer] Hash code
259
297
  def hash
260
- [db_server_certificates, db_server_name, name, new_name, oracle_host, oracle_password, oracle_port, oracle_screation_statements, oracle_service_name, oracle_username, producer_encryption_key_name, tags, target_name, token, uid_token, user_ttl].hash
298
+ [db_server_certificates, db_server_name, name, new_name, oracle_host, oracle_password, oracle_port, oracle_screation_statements, oracle_service_name, oracle_username, producer_encryption_key_name, secure_access_bastion_issuer, secure_access_enable, secure_access_host, secure_access_web, tags, target_name, token, uid_token, user_ttl].hash
261
299
  end
262
300
 
263
301
  # Builds the object from hash
@@ -17,6 +17,8 @@ module Akeyless
17
17
  class KMIPClient
18
18
  attr_accessor :certificate_issue_date
19
19
 
20
+ attr_accessor :certificate_ttl_in_seconds
21
+
20
22
  attr_accessor :id
21
23
 
22
24
  attr_accessor :name
@@ -27,6 +29,7 @@ module Akeyless
27
29
  def self.attribute_map
28
30
  {
29
31
  :'certificate_issue_date' => :'certificate_issue_date',
32
+ :'certificate_ttl_in_seconds' => :'certificate_ttl_in_seconds',
30
33
  :'id' => :'id',
31
34
  :'name' => :'name',
32
35
  :'rules' => :'rules'
@@ -42,6 +45,7 @@ module Akeyless
42
45
  def self.openapi_types
43
46
  {
44
47
  :'certificate_issue_date' => :'Time',
48
+ :'certificate_ttl_in_seconds' => :'Integer',
45
49
  :'id' => :'String',
46
50
  :'name' => :'String',
47
51
  :'rules' => :'Array<PathRule>'
@@ -73,6 +77,10 @@ module Akeyless
73
77
  self.certificate_issue_date = attributes[:'certificate_issue_date']
74
78
  end
75
79
 
80
+ if attributes.key?(:'certificate_ttl_in_seconds')
81
+ self.certificate_ttl_in_seconds = attributes[:'certificate_ttl_in_seconds']
82
+ end
83
+
76
84
  if attributes.key?(:'id')
77
85
  self.id = attributes[:'id']
78
86
  end
@@ -107,6 +115,7 @@ module Akeyless
107
115
  return true if self.equal?(o)
108
116
  self.class == o.class &&
109
117
  certificate_issue_date == o.certificate_issue_date &&
118
+ certificate_ttl_in_seconds == o.certificate_ttl_in_seconds &&
110
119
  id == o.id &&
111
120
  name == o.name &&
112
121
  rules == o.rules
@@ -121,7 +130,7 @@ module Akeyless
121
130
  # Calculates hash code according to all attributes.
122
131
  # @return [Integer] Hash code
123
132
  def hash
124
- [certificate_issue_date, id, name, rules].hash
133
+ [certificate_issue_date, certificate_ttl_in_seconds, id, name, rules].hash
125
134
  end
126
135
 
127
136
  # Builds the object from hash
@@ -17,12 +17,20 @@ module Akeyless
17
17
  class KMIPConfigPart
18
18
  attr_accessor :clients
19
19
 
20
+ # Saves the private key of the cert issuer in encypted form
21
+ attr_accessor :key_enc
22
+
23
+ attr_accessor :server
24
+
25
+ # Saved for backward compatibility TODO: remove this after all clients upgrade
20
26
  attr_accessor :server_enc
21
27
 
22
28
  # Attribute mapping from ruby-style variable name to JSON key.
23
29
  def self.attribute_map
24
30
  {
25
31
  :'clients' => :'clients',
32
+ :'key_enc' => :'key_enc',
33
+ :'server' => :'server',
26
34
  :'server_enc' => :'server_enc'
27
35
  }
28
36
  end
@@ -36,6 +44,8 @@ module Akeyless
36
44
  def self.openapi_types
37
45
  {
38
46
  :'clients' => :'Hash<String, KMIPClient>',
47
+ :'key_enc' => :'Array<Integer>',
48
+ :'server' => :'KMIPServer',
39
49
  :'server_enc' => :'Array<Integer>'
40
50
  }
41
51
  end
@@ -67,6 +77,16 @@ module Akeyless
67
77
  end
68
78
  end
69
79
 
80
+ if attributes.key?(:'key_enc')
81
+ if (value = attributes[:'key_enc']).is_a?(Array)
82
+ self.key_enc = value
83
+ end
84
+ end
85
+
86
+ if attributes.key?(:'server')
87
+ self.server = attributes[:'server']
88
+ end
89
+
70
90
  if attributes.key?(:'server_enc')
71
91
  if (value = attributes[:'server_enc']).is_a?(Array)
72
92
  self.server_enc = value
@@ -93,6 +113,8 @@ module Akeyless
93
113
  return true if self.equal?(o)
94
114
  self.class == o.class &&
95
115
  clients == o.clients &&
116
+ key_enc == o.key_enc &&
117
+ server == o.server &&
96
118
  server_enc == o.server_enc
97
119
  end
98
120
 
@@ -105,7 +127,7 @@ module Akeyless
105
127
  # Calculates hash code according to all attributes.
106
128
  # @return [Integer] Hash code
107
129
  def hash
108
- [clients, server_enc].hash
130
+ [clients, key_enc, server, server_enc].hash
109
131
  end
110
132
 
111
133
  # Builds the object from hash
@@ -0,0 +1,231 @@
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.0.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Akeyless
17
+ # kmipDeleteServer is a command that the kmip server (allowed only if it has no clients nor associated items)
18
+ class KmipDeleteServer
19
+ # Authentication token (see `/auth` and `/configure`)
20
+ attr_accessor :token
21
+
22
+ # The universal identity token, Required only for universal_identity authentication
23
+ attr_accessor :uid_token
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'token' => :'token',
29
+ :'uid_token' => :'uid-token'
30
+ }
31
+ end
32
+
33
+ # Returns all the JSON keys this model knows about
34
+ def self.acceptable_attributes
35
+ attribute_map.values
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.openapi_types
40
+ {
41
+ :'token' => :'String',
42
+ :'uid_token' => :'String'
43
+ }
44
+ end
45
+
46
+ # List of attributes with nullable: true
47
+ def self.openapi_nullable
48
+ Set.new([
49
+ ])
50
+ end
51
+
52
+ # Initializes the object
53
+ # @param [Hash] attributes Model attributes in the form of hash
54
+ def initialize(attributes = {})
55
+ if (!attributes.is_a?(Hash))
56
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Akeyless::KmipDeleteServer` initialize method"
57
+ end
58
+
59
+ # check to see if the attribute exists and convert string to symbol for hash key
60
+ attributes = attributes.each_with_object({}) { |(k, v), h|
61
+ if (!self.class.attribute_map.key?(k.to_sym))
62
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Akeyless::KmipDeleteServer`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
63
+ end
64
+ h[k.to_sym] = v
65
+ }
66
+
67
+ if attributes.key?(:'token')
68
+ self.token = attributes[:'token']
69
+ end
70
+
71
+ if attributes.key?(:'uid_token')
72
+ self.uid_token = attributes[:'uid_token']
73
+ end
74
+ end
75
+
76
+ # Show invalid properties with the reasons. Usually used together with valid?
77
+ # @return Array for valid properties with the reasons
78
+ def list_invalid_properties
79
+ invalid_properties = Array.new
80
+ invalid_properties
81
+ end
82
+
83
+ # Check to see if the all the properties in the model are valid
84
+ # @return true if the model is valid
85
+ def valid?
86
+ true
87
+ end
88
+
89
+ # Checks equality by comparing each attribute.
90
+ # @param [Object] Object to be compared
91
+ def ==(o)
92
+ return true if self.equal?(o)
93
+ self.class == o.class &&
94
+ token == o.token &&
95
+ uid_token == o.uid_token
96
+ end
97
+
98
+ # @see the `==` method
99
+ # @param [Object] Object to be compared
100
+ def eql?(o)
101
+ self == o
102
+ end
103
+
104
+ # Calculates hash code according to all attributes.
105
+ # @return [Integer] Hash code
106
+ def hash
107
+ [token, uid_token].hash
108
+ end
109
+
110
+ # Builds the object from hash
111
+ # @param [Hash] attributes Model attributes in the form of hash
112
+ # @return [Object] Returns the model itself
113
+ def self.build_from_hash(attributes)
114
+ new.build_from_hash(attributes)
115
+ end
116
+
117
+ # Builds the object from hash
118
+ # @param [Hash] attributes Model attributes in the form of hash
119
+ # @return [Object] Returns the model itself
120
+ def build_from_hash(attributes)
121
+ return nil unless attributes.is_a?(Hash)
122
+ attributes = attributes.transform_keys(&:to_sym)
123
+ self.class.openapi_types.each_pair do |key, type|
124
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
125
+ self.send("#{key}=", nil)
126
+ elsif type =~ /\AArray<(.*)>/i
127
+ # check to ensure the input is an array given that the attribute
128
+ # is documented as an array but the input is not
129
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
130
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
131
+ end
132
+ elsif !attributes[self.class.attribute_map[key]].nil?
133
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
134
+ end
135
+ end
136
+
137
+ self
138
+ end
139
+
140
+ # Deserializes the data based on type
141
+ # @param string type Data type
142
+ # @param string value Value to be deserialized
143
+ # @return [Object] Deserialized data
144
+ def _deserialize(type, value)
145
+ case type.to_sym
146
+ when :Time
147
+ Time.parse(value)
148
+ when :Date
149
+ Date.parse(value)
150
+ when :String
151
+ value.to_s
152
+ when :Integer
153
+ value.to_i
154
+ when :Float
155
+ value.to_f
156
+ when :Boolean
157
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
158
+ true
159
+ else
160
+ false
161
+ end
162
+ when :Object
163
+ # generic object (usually a Hash), return directly
164
+ value
165
+ when /\AArray<(?<inner_type>.+)>\z/
166
+ inner_type = Regexp.last_match[:inner_type]
167
+ value.map { |v| _deserialize(inner_type, v) }
168
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
169
+ k_type = Regexp.last_match[:k_type]
170
+ v_type = Regexp.last_match[:v_type]
171
+ {}.tap do |hash|
172
+ value.each do |k, v|
173
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
174
+ end
175
+ end
176
+ else # model
177
+ # models (e.g. Pet) or oneOf
178
+ klass = Akeyless.const_get(type)
179
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
180
+ end
181
+ end
182
+
183
+ # Returns the string representation of the object
184
+ # @return [String] String presentation of the object
185
+ def to_s
186
+ to_hash.to_s
187
+ end
188
+
189
+ # to_body is an alias to to_hash (backward compatibility)
190
+ # @return [Hash] Returns the object in the form of hash
191
+ def to_body
192
+ to_hash
193
+ end
194
+
195
+ # Returns the object in the form of hash
196
+ # @return [Hash] Returns the object in the form of hash
197
+ def to_hash
198
+ hash = {}
199
+ self.class.attribute_map.each_pair do |attr, param|
200
+ value = self.send(attr)
201
+ if value.nil?
202
+ is_nullable = self.class.openapi_nullable.include?(attr)
203
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
204
+ end
205
+
206
+ hash[param] = _to_hash(value)
207
+ end
208
+ hash
209
+ end
210
+
211
+ # Outputs non-array value in the form of hash
212
+ # For object, use to_hash. Otherwise, just return the value
213
+ # @param [Object] value Any valid value
214
+ # @return [Hash] Returns the value in the form of hash
215
+ def _to_hash(value)
216
+ if value.is_a?(Array)
217
+ value.compact.map { |v| _to_hash(v) }
218
+ elsif value.is_a?(Hash)
219
+ {}.tap do |hash|
220
+ value.each { |k, v| hash[k] = _to_hash(v) }
221
+ end
222
+ elsif value.respond_to? :to_hash
223
+ value.to_hash
224
+ else
225
+ value
226
+ end
227
+ end
228
+
229
+ end
230
+
231
+ end