akeyless 0.0.2.pre.rc1 → 2.15.32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +15 -9
- data/akeyless.gemspec +1 -1
- data/docs/Auth.md +1 -1
- data/docs/ConfigHash.md +2 -0
- data/docs/DSProducerDetails.md +4 -0
- data/docs/GatewayCreateProducerHanaDb.md +54 -0
- data/docs/GatewayCreateProducerHanaDbOutput.md +18 -0
- data/docs/GatewayCreateProducerMongo.md +1 -1
- data/docs/GatewayUpdateProducerHanaDb.md +56 -0
- data/docs/GatewayUpdateProducerHanaDbOutput.md +18 -0
- data/docs/GatewayUpdateProducerMongo.md +1 -1
- data/docs/KMIPConfigPart.md +5 -1
- data/docs/KMIPServer.md +26 -0
- data/docs/ListAuthMethods.md +2 -0
- data/docs/TargetItemAssociation.md +2 -0
- data/docs/UpdateDBTarget.md +4 -0
- data/docs/V2Api.md +63 -0
- data/git_push.sh +0 -0
- data/lib/akeyless/api/v2_api.rb +64 -0
- data/lib/akeyless/api_client.rb +0 -6
- data/lib/akeyless/configuration.rb +2 -1
- data/lib/akeyless/models/auth.rb +1 -1
- data/lib/akeyless/models/config_hash.rb +10 -1
- data/lib/akeyless/models/ds_producer_details.rb +19 -1
- data/lib/akeyless/models/gateway_create_producer_hana_db.rb +411 -0
- data/lib/akeyless/models/gateway_create_producer_hana_db_output.rb +219 -0
- data/lib/akeyless/models/gateway_create_producer_mongo.rb +0 -2
- data/lib/akeyless/models/gateway_update_producer_hana_db.rb +421 -0
- data/lib/akeyless/models/gateway_update_producer_hana_db_output.rb +219 -0
- data/lib/akeyless/models/gateway_update_producer_mongo.rb +0 -2
- data/lib/akeyless/models/kmip_config_part.rb +23 -1
- data/lib/akeyless/models/kmip_server.rb +259 -0
- data/lib/akeyless/models/list_auth_methods.rb +13 -1
- data/lib/akeyless/models/target_item_association.rb +10 -1
- data/lib/akeyless/models/update_db_target.rb +21 -1
- data/lib/akeyless/version.rb +1 -1
- data/lib/akeyless.rb +5 -0
- data/spec/models/gateway_create_producer_hana_db_output_spec.rb +34 -0
- data/spec/models/gateway_create_producer_hana_db_spec.rb +142 -0
- data/spec/models/gateway_update_producer_hana_db_output_spec.rb +34 -0
- data/spec/models/gateway_update_producer_hana_db_spec.rb +148 -0
- data/spec/models/kmip_server_spec.rb +58 -0
- metadata +473 -453
@@ -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 GatewayCreateProducerHanaDbOutput
|
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::GatewayCreateProducerHanaDbOutput` 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::GatewayCreateProducerHanaDbOutput`. 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
|
@@ -0,0 +1,421 @@
|
|
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
|
+
# gatewayUpdateProducerHanaDb is a command that updates mssql producer
|
18
|
+
class GatewayUpdateProducerHanaDb
|
19
|
+
# HanaDb Name
|
20
|
+
attr_accessor :hana_dbname
|
21
|
+
|
22
|
+
# HanaDb Creation statements
|
23
|
+
attr_accessor :hanadb_create_statements
|
24
|
+
|
25
|
+
# HanaDb Host
|
26
|
+
attr_accessor :hanadb_host
|
27
|
+
|
28
|
+
# HanaDb Password
|
29
|
+
attr_accessor :hanadb_password
|
30
|
+
|
31
|
+
# HanaDb Port
|
32
|
+
attr_accessor :hanadb_port
|
33
|
+
|
34
|
+
# HanaDb Revocation statements
|
35
|
+
attr_accessor :hanadb_revocation_statements
|
36
|
+
|
37
|
+
# HanaDb Username
|
38
|
+
attr_accessor :hanadb_username
|
39
|
+
|
40
|
+
# Producer name
|
41
|
+
attr_accessor :name
|
42
|
+
|
43
|
+
# Producer name
|
44
|
+
attr_accessor :new_name
|
45
|
+
|
46
|
+
# Dynamic producer encryption key
|
47
|
+
attr_accessor :producer_encryption_key_name
|
48
|
+
|
49
|
+
attr_accessor :secure_access_bastion_issuer
|
50
|
+
|
51
|
+
attr_accessor :secure_access_db_schema
|
52
|
+
|
53
|
+
attr_accessor :secure_access_enable
|
54
|
+
|
55
|
+
attr_accessor :secure_access_host
|
56
|
+
|
57
|
+
attr_accessor :secure_access_web
|
58
|
+
|
59
|
+
# List of the tags attached to this secret
|
60
|
+
attr_accessor :tags
|
61
|
+
|
62
|
+
# Target name
|
63
|
+
attr_accessor :target_name
|
64
|
+
|
65
|
+
# Authentication token (see `/auth` and `/configure`)
|
66
|
+
attr_accessor :token
|
67
|
+
|
68
|
+
# The universal identity token, Required only for universal_identity authentication
|
69
|
+
attr_accessor :uid_token
|
70
|
+
|
71
|
+
# User TTL
|
72
|
+
attr_accessor :user_ttl
|
73
|
+
|
74
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
75
|
+
def self.attribute_map
|
76
|
+
{
|
77
|
+
:'hana_dbname' => :'hana-dbname',
|
78
|
+
:'hanadb_create_statements' => :'hanadb-create-statements',
|
79
|
+
:'hanadb_host' => :'hanadb-host',
|
80
|
+
:'hanadb_password' => :'hanadb-password',
|
81
|
+
:'hanadb_port' => :'hanadb-port',
|
82
|
+
:'hanadb_revocation_statements' => :'hanadb-revocation-statements',
|
83
|
+
:'hanadb_username' => :'hanadb-username',
|
84
|
+
:'name' => :'name',
|
85
|
+
:'new_name' => :'new-name',
|
86
|
+
:'producer_encryption_key_name' => :'producer-encryption-key-name',
|
87
|
+
:'secure_access_bastion_issuer' => :'secure-access-bastion-issuer',
|
88
|
+
:'secure_access_db_schema' => :'secure-access-db-schema',
|
89
|
+
:'secure_access_enable' => :'secure-access-enable',
|
90
|
+
:'secure_access_host' => :'secure-access-host',
|
91
|
+
:'secure_access_web' => :'secure-access-web',
|
92
|
+
:'tags' => :'tags',
|
93
|
+
:'target_name' => :'target-name',
|
94
|
+
:'token' => :'token',
|
95
|
+
:'uid_token' => :'uid-token',
|
96
|
+
:'user_ttl' => :'user-ttl'
|
97
|
+
}
|
98
|
+
end
|
99
|
+
|
100
|
+
# Returns all the JSON keys this model knows about
|
101
|
+
def self.acceptable_attributes
|
102
|
+
attribute_map.values
|
103
|
+
end
|
104
|
+
|
105
|
+
# Attribute type mapping.
|
106
|
+
def self.openapi_types
|
107
|
+
{
|
108
|
+
:'hana_dbname' => :'String',
|
109
|
+
:'hanadb_create_statements' => :'String',
|
110
|
+
:'hanadb_host' => :'String',
|
111
|
+
:'hanadb_password' => :'String',
|
112
|
+
:'hanadb_port' => :'String',
|
113
|
+
:'hanadb_revocation_statements' => :'String',
|
114
|
+
:'hanadb_username' => :'String',
|
115
|
+
:'name' => :'String',
|
116
|
+
:'new_name' => :'String',
|
117
|
+
:'producer_encryption_key_name' => :'String',
|
118
|
+
:'secure_access_bastion_issuer' => :'String',
|
119
|
+
:'secure_access_db_schema' => :'String',
|
120
|
+
:'secure_access_enable' => :'String',
|
121
|
+
:'secure_access_host' => :'Array<String>',
|
122
|
+
:'secure_access_web' => :'Boolean',
|
123
|
+
:'tags' => :'Array<String>',
|
124
|
+
:'target_name' => :'String',
|
125
|
+
:'token' => :'String',
|
126
|
+
:'uid_token' => :'String',
|
127
|
+
:'user_ttl' => :'String'
|
128
|
+
}
|
129
|
+
end
|
130
|
+
|
131
|
+
# List of attributes with nullable: true
|
132
|
+
def self.openapi_nullable
|
133
|
+
Set.new([
|
134
|
+
])
|
135
|
+
end
|
136
|
+
|
137
|
+
# Initializes the object
|
138
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
139
|
+
def initialize(attributes = {})
|
140
|
+
if (!attributes.is_a?(Hash))
|
141
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Akeyless::GatewayUpdateProducerHanaDb` initialize method"
|
142
|
+
end
|
143
|
+
|
144
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
145
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
146
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
147
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Akeyless::GatewayUpdateProducerHanaDb`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
148
|
+
end
|
149
|
+
h[k.to_sym] = v
|
150
|
+
}
|
151
|
+
|
152
|
+
if attributes.key?(:'hana_dbname')
|
153
|
+
self.hana_dbname = attributes[:'hana_dbname']
|
154
|
+
end
|
155
|
+
|
156
|
+
if attributes.key?(:'hanadb_create_statements')
|
157
|
+
self.hanadb_create_statements = attributes[:'hanadb_create_statements']
|
158
|
+
end
|
159
|
+
|
160
|
+
if attributes.key?(:'hanadb_host')
|
161
|
+
self.hanadb_host = attributes[:'hanadb_host']
|
162
|
+
else
|
163
|
+
self.hanadb_host = '127.0.0.1'
|
164
|
+
end
|
165
|
+
|
166
|
+
if attributes.key?(:'hanadb_password')
|
167
|
+
self.hanadb_password = attributes[:'hanadb_password']
|
168
|
+
end
|
169
|
+
|
170
|
+
if attributes.key?(:'hanadb_port')
|
171
|
+
self.hanadb_port = attributes[:'hanadb_port']
|
172
|
+
else
|
173
|
+
self.hanadb_port = '443'
|
174
|
+
end
|
175
|
+
|
176
|
+
if attributes.key?(:'hanadb_revocation_statements')
|
177
|
+
self.hanadb_revocation_statements = attributes[:'hanadb_revocation_statements']
|
178
|
+
end
|
179
|
+
|
180
|
+
if attributes.key?(:'hanadb_username')
|
181
|
+
self.hanadb_username = attributes[:'hanadb_username']
|
182
|
+
end
|
183
|
+
|
184
|
+
if attributes.key?(:'name')
|
185
|
+
self.name = attributes[:'name']
|
186
|
+
end
|
187
|
+
|
188
|
+
if attributes.key?(:'new_name')
|
189
|
+
self.new_name = attributes[:'new_name']
|
190
|
+
end
|
191
|
+
|
192
|
+
if attributes.key?(:'producer_encryption_key_name')
|
193
|
+
self.producer_encryption_key_name = attributes[:'producer_encryption_key_name']
|
194
|
+
end
|
195
|
+
|
196
|
+
if attributes.key?(:'secure_access_bastion_issuer')
|
197
|
+
self.secure_access_bastion_issuer = attributes[:'secure_access_bastion_issuer']
|
198
|
+
end
|
199
|
+
|
200
|
+
if attributes.key?(:'secure_access_db_schema')
|
201
|
+
self.secure_access_db_schema = attributes[:'secure_access_db_schema']
|
202
|
+
end
|
203
|
+
|
204
|
+
if attributes.key?(:'secure_access_enable')
|
205
|
+
self.secure_access_enable = attributes[:'secure_access_enable']
|
206
|
+
end
|
207
|
+
|
208
|
+
if attributes.key?(:'secure_access_host')
|
209
|
+
if (value = attributes[:'secure_access_host']).is_a?(Array)
|
210
|
+
self.secure_access_host = value
|
211
|
+
end
|
212
|
+
end
|
213
|
+
|
214
|
+
if attributes.key?(:'secure_access_web')
|
215
|
+
self.secure_access_web = attributes[:'secure_access_web']
|
216
|
+
end
|
217
|
+
|
218
|
+
if attributes.key?(:'tags')
|
219
|
+
if (value = attributes[:'tags']).is_a?(Array)
|
220
|
+
self.tags = value
|
221
|
+
end
|
222
|
+
end
|
223
|
+
|
224
|
+
if attributes.key?(:'target_name')
|
225
|
+
self.target_name = attributes[:'target_name']
|
226
|
+
end
|
227
|
+
|
228
|
+
if attributes.key?(:'token')
|
229
|
+
self.token = attributes[:'token']
|
230
|
+
end
|
231
|
+
|
232
|
+
if attributes.key?(:'uid_token')
|
233
|
+
self.uid_token = attributes[:'uid_token']
|
234
|
+
end
|
235
|
+
|
236
|
+
if attributes.key?(:'user_ttl')
|
237
|
+
self.user_ttl = attributes[:'user_ttl']
|
238
|
+
else
|
239
|
+
self.user_ttl = '60m'
|
240
|
+
end
|
241
|
+
end
|
242
|
+
|
243
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
244
|
+
# @return Array for valid properties with the reasons
|
245
|
+
def list_invalid_properties
|
246
|
+
invalid_properties = Array.new
|
247
|
+
if @name.nil?
|
248
|
+
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
249
|
+
end
|
250
|
+
|
251
|
+
invalid_properties
|
252
|
+
end
|
253
|
+
|
254
|
+
# Check to see if the all the properties in the model are valid
|
255
|
+
# @return true if the model is valid
|
256
|
+
def valid?
|
257
|
+
return false if @name.nil?
|
258
|
+
true
|
259
|
+
end
|
260
|
+
|
261
|
+
# Checks equality by comparing each attribute.
|
262
|
+
# @param [Object] Object to be compared
|
263
|
+
def ==(o)
|
264
|
+
return true if self.equal?(o)
|
265
|
+
self.class == o.class &&
|
266
|
+
hana_dbname == o.hana_dbname &&
|
267
|
+
hanadb_create_statements == o.hanadb_create_statements &&
|
268
|
+
hanadb_host == o.hanadb_host &&
|
269
|
+
hanadb_password == o.hanadb_password &&
|
270
|
+
hanadb_port == o.hanadb_port &&
|
271
|
+
hanadb_revocation_statements == o.hanadb_revocation_statements &&
|
272
|
+
hanadb_username == o.hanadb_username &&
|
273
|
+
name == o.name &&
|
274
|
+
new_name == o.new_name &&
|
275
|
+
producer_encryption_key_name == o.producer_encryption_key_name &&
|
276
|
+
secure_access_bastion_issuer == o.secure_access_bastion_issuer &&
|
277
|
+
secure_access_db_schema == o.secure_access_db_schema &&
|
278
|
+
secure_access_enable == o.secure_access_enable &&
|
279
|
+
secure_access_host == o.secure_access_host &&
|
280
|
+
secure_access_web == o.secure_access_web &&
|
281
|
+
tags == o.tags &&
|
282
|
+
target_name == o.target_name &&
|
283
|
+
token == o.token &&
|
284
|
+
uid_token == o.uid_token &&
|
285
|
+
user_ttl == o.user_ttl
|
286
|
+
end
|
287
|
+
|
288
|
+
# @see the `==` method
|
289
|
+
# @param [Object] Object to be compared
|
290
|
+
def eql?(o)
|
291
|
+
self == o
|
292
|
+
end
|
293
|
+
|
294
|
+
# Calculates hash code according to all attributes.
|
295
|
+
# @return [Integer] Hash code
|
296
|
+
def hash
|
297
|
+
[hana_dbname, hanadb_create_statements, hanadb_host, hanadb_password, hanadb_port, hanadb_revocation_statements, hanadb_username, name, new_name, producer_encryption_key_name, secure_access_bastion_issuer, secure_access_db_schema, secure_access_enable, secure_access_host, secure_access_web, tags, target_name, token, uid_token, user_ttl].hash
|
298
|
+
end
|
299
|
+
|
300
|
+
# Builds the object from hash
|
301
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
302
|
+
# @return [Object] Returns the model itself
|
303
|
+
def self.build_from_hash(attributes)
|
304
|
+
new.build_from_hash(attributes)
|
305
|
+
end
|
306
|
+
|
307
|
+
# Builds the object from hash
|
308
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
309
|
+
# @return [Object] Returns the model itself
|
310
|
+
def build_from_hash(attributes)
|
311
|
+
return nil unless attributes.is_a?(Hash)
|
312
|
+
attributes = attributes.transform_keys(&:to_sym)
|
313
|
+
self.class.openapi_types.each_pair do |key, type|
|
314
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
315
|
+
self.send("#{key}=", nil)
|
316
|
+
elsif type =~ /\AArray<(.*)>/i
|
317
|
+
# check to ensure the input is an array given that the attribute
|
318
|
+
# is documented as an array but the input is not
|
319
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
320
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
321
|
+
end
|
322
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
323
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
324
|
+
end
|
325
|
+
end
|
326
|
+
|
327
|
+
self
|
328
|
+
end
|
329
|
+
|
330
|
+
# Deserializes the data based on type
|
331
|
+
# @param string type Data type
|
332
|
+
# @param string value Value to be deserialized
|
333
|
+
# @return [Object] Deserialized data
|
334
|
+
def _deserialize(type, value)
|
335
|
+
case type.to_sym
|
336
|
+
when :Time
|
337
|
+
Time.parse(value)
|
338
|
+
when :Date
|
339
|
+
Date.parse(value)
|
340
|
+
when :String
|
341
|
+
value.to_s
|
342
|
+
when :Integer
|
343
|
+
value.to_i
|
344
|
+
when :Float
|
345
|
+
value.to_f
|
346
|
+
when :Boolean
|
347
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
348
|
+
true
|
349
|
+
else
|
350
|
+
false
|
351
|
+
end
|
352
|
+
when :Object
|
353
|
+
# generic object (usually a Hash), return directly
|
354
|
+
value
|
355
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
356
|
+
inner_type = Regexp.last_match[:inner_type]
|
357
|
+
value.map { |v| _deserialize(inner_type, v) }
|
358
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
359
|
+
k_type = Regexp.last_match[:k_type]
|
360
|
+
v_type = Regexp.last_match[:v_type]
|
361
|
+
{}.tap do |hash|
|
362
|
+
value.each do |k, v|
|
363
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
364
|
+
end
|
365
|
+
end
|
366
|
+
else # model
|
367
|
+
# models (e.g. Pet) or oneOf
|
368
|
+
klass = Akeyless.const_get(type)
|
369
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
370
|
+
end
|
371
|
+
end
|
372
|
+
|
373
|
+
# Returns the string representation of the object
|
374
|
+
# @return [String] String presentation of the object
|
375
|
+
def to_s
|
376
|
+
to_hash.to_s
|
377
|
+
end
|
378
|
+
|
379
|
+
# to_body is an alias to to_hash (backward compatibility)
|
380
|
+
# @return [Hash] Returns the object in the form of hash
|
381
|
+
def to_body
|
382
|
+
to_hash
|
383
|
+
end
|
384
|
+
|
385
|
+
# Returns the object in the form of hash
|
386
|
+
# @return [Hash] Returns the object in the form of hash
|
387
|
+
def to_hash
|
388
|
+
hash = {}
|
389
|
+
self.class.attribute_map.each_pair do |attr, param|
|
390
|
+
value = self.send(attr)
|
391
|
+
if value.nil?
|
392
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
393
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
394
|
+
end
|
395
|
+
|
396
|
+
hash[param] = _to_hash(value)
|
397
|
+
end
|
398
|
+
hash
|
399
|
+
end
|
400
|
+
|
401
|
+
# Outputs non-array value in the form of hash
|
402
|
+
# For object, use to_hash. Otherwise, just return the value
|
403
|
+
# @param [Object] value Any valid value
|
404
|
+
# @return [Hash] Returns the value in the form of hash
|
405
|
+
def _to_hash(value)
|
406
|
+
if value.is_a?(Array)
|
407
|
+
value.compact.map { |v| _to_hash(v) }
|
408
|
+
elsif value.is_a?(Hash)
|
409
|
+
{}.tap do |hash|
|
410
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
411
|
+
end
|
412
|
+
elsif value.respond_to? :to_hash
|
413
|
+
value.to_hash
|
414
|
+
else
|
415
|
+
value
|
416
|
+
end
|
417
|
+
end
|
418
|
+
|
419
|
+
end
|
420
|
+
|
421
|
+
end
|