akeyless 3.6.0 → 3.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -1
- data/docs/Auth.md +4 -0
- data/docs/AuthMethodAccessInfo.md +2 -0
- data/docs/Configure.md +5 -1
- data/docs/CreateAuthMethodOCI.md +40 -0
- data/docs/CreateAuthMethodOCIOutput.md +18 -0
- data/docs/OCIAccessRules.md +20 -0
- data/docs/UpdateAuthMethodOCI.md +42 -0
- data/docs/UpdateAuthMethodOCIOutput.md +18 -0
- data/docs/V2Api.md +126 -0
- data/lib/akeyless/api/v2_api.rb +128 -0
- data/lib/akeyless/models/auth.rb +25 -1
- data/lib/akeyless/models/auth_method_access_info.rb +10 -1
- data/lib/akeyless/models/configure.rb +28 -4
- data/lib/akeyless/models/create_auth_method_oci.rb +359 -0
- data/lib/akeyless/models/create_auth_method_oci_output.rb +214 -0
- data/lib/akeyless/models/oci_access_rules.rb +226 -0
- data/lib/akeyless/models/update_auth_method_oci.rb +369 -0
- data/lib/akeyless/models/update_auth_method_oci_output.rb +214 -0
- data/lib/akeyless/version.rb +1 -1
- data/lib/akeyless.rb +5 -0
- data/spec/models/create_auth_method_oci_output_spec.rb +36 -0
- data/spec/models/create_auth_method_oci_spec.rb +102 -0
- data/spec/models/oci_access_rules_spec.rb +42 -0
- data/spec/models/update_auth_method_oci_output_spec.rb +36 -0
- data/spec/models/update_auth_method_oci_spec.rb +108 -0
- metadata +21 -1
@@ -51,6 +51,12 @@ module Akeyless
|
|
51
51
|
# Private key data encoded in base64. Used if file was not provided.(relevant only for access-type=cert in Curl Context)
|
52
52
|
attr_accessor :key_data
|
53
53
|
|
54
|
+
# The type of the OCI configuration to use [instance/apikey/resource] (relevant only for access-type=oci)
|
55
|
+
attr_accessor :oci_auth_type
|
56
|
+
|
57
|
+
# A list of Oracle Cloud IDs groups (relevant only for access-type=oci)
|
58
|
+
attr_accessor :oci_group_ocid
|
59
|
+
|
54
60
|
# Attribute mapping from ruby-style variable name to JSON key.
|
55
61
|
def self.attribute_map
|
56
62
|
{
|
@@ -65,7 +71,9 @@ module Akeyless
|
|
65
71
|
:'gcp_audience' => :'gcp-audience',
|
66
72
|
:'json' => :'json',
|
67
73
|
:'k8s_auth_config_name' => :'k8s-auth-config-name',
|
68
|
-
:'key_data' => :'key-data'
|
74
|
+
:'key_data' => :'key-data',
|
75
|
+
:'oci_auth_type' => :'oci-auth-type',
|
76
|
+
:'oci_group_ocid' => :'oci-group-ocid'
|
69
77
|
}
|
70
78
|
end
|
71
79
|
|
@@ -88,7 +96,9 @@ module Akeyless
|
|
88
96
|
:'gcp_audience' => :'String',
|
89
97
|
:'json' => :'Boolean',
|
90
98
|
:'k8s_auth_config_name' => :'String',
|
91
|
-
:'key_data' => :'String'
|
99
|
+
:'key_data' => :'String',
|
100
|
+
:'oci_auth_type' => :'String',
|
101
|
+
:'oci_group_ocid' => :'Array<String>'
|
92
102
|
}
|
93
103
|
end
|
94
104
|
|
@@ -166,6 +176,18 @@ module Akeyless
|
|
166
176
|
if attributes.key?(:'key_data')
|
167
177
|
self.key_data = attributes[:'key_data']
|
168
178
|
end
|
179
|
+
|
180
|
+
if attributes.key?(:'oci_auth_type')
|
181
|
+
self.oci_auth_type = attributes[:'oci_auth_type']
|
182
|
+
else
|
183
|
+
self.oci_auth_type = 'apikey'
|
184
|
+
end
|
185
|
+
|
186
|
+
if attributes.key?(:'oci_group_ocid')
|
187
|
+
if (value = attributes[:'oci_group_ocid']).is_a?(Array)
|
188
|
+
self.oci_group_ocid = value
|
189
|
+
end
|
190
|
+
end
|
169
191
|
end
|
170
192
|
|
171
193
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -199,7 +221,9 @@ module Akeyless
|
|
199
221
|
gcp_audience == o.gcp_audience &&
|
200
222
|
json == o.json &&
|
201
223
|
k8s_auth_config_name == o.k8s_auth_config_name &&
|
202
|
-
key_data == o.key_data
|
224
|
+
key_data == o.key_data &&
|
225
|
+
oci_auth_type == o.oci_auth_type &&
|
226
|
+
oci_group_ocid == o.oci_group_ocid
|
203
227
|
end
|
204
228
|
|
205
229
|
# @see the `==` method
|
@@ -211,7 +235,7 @@ module Akeyless
|
|
211
235
|
# Calculates hash code according to all attributes.
|
212
236
|
# @return [Integer] Hash code
|
213
237
|
def hash
|
214
|
-
[access_id, access_key, access_type, account_id, admin_email, admin_password, azure_ad_object_id, cert_data, gcp_audience, json, k8s_auth_config_name, key_data].hash
|
238
|
+
[access_id, access_key, access_type, account_id, admin_email, admin_password, azure_ad_object_id, cert_data, gcp_audience, json, k8s_auth_config_name, key_data, oci_auth_type, oci_group_ocid].hash
|
215
239
|
end
|
216
240
|
|
217
241
|
# Builds the object from hash
|
@@ -0,0 +1,359 @@
|
|
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: 7.3.0-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module Akeyless
|
17
|
+
# createAuthMethodOCI is a command that Creates a new Oracle Auth Method that will be used in the account using OCI principle and groups.
|
18
|
+
class CreateAuthMethodOCI
|
19
|
+
# Access expiration date in Unix timestamp (select 0 for access without expiry date)
|
20
|
+
attr_accessor :access_expires
|
21
|
+
|
22
|
+
# A CIDR whitelist with the IPs that the access is restricted to
|
23
|
+
attr_accessor :bound_ips
|
24
|
+
|
25
|
+
# Auth Method description
|
26
|
+
attr_accessor :description
|
27
|
+
|
28
|
+
# if true: enforce role-association must include sub claims
|
29
|
+
attr_accessor :force_sub_claims
|
30
|
+
|
31
|
+
# A list of required groups ocids
|
32
|
+
attr_accessor :group_ocid
|
33
|
+
|
34
|
+
# A CIDR whitelist with the GW IPs that the access is restricted to
|
35
|
+
attr_accessor :gw_bound_ips
|
36
|
+
|
37
|
+
# Set output format to JSON
|
38
|
+
attr_accessor :json
|
39
|
+
|
40
|
+
# Jwt TTL
|
41
|
+
attr_accessor :jwt_ttl
|
42
|
+
|
43
|
+
# Auth Method name
|
44
|
+
attr_accessor :name
|
45
|
+
|
46
|
+
# The Oracle Cloud tenant ID
|
47
|
+
attr_accessor :tenant_ocid
|
48
|
+
|
49
|
+
# Authentication token (see `/auth` and `/configure`)
|
50
|
+
attr_accessor :token
|
51
|
+
|
52
|
+
# The universal identity token, Required only for universal_identity authentication
|
53
|
+
attr_accessor :uid_token
|
54
|
+
|
55
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
56
|
+
def self.attribute_map
|
57
|
+
{
|
58
|
+
:'access_expires' => :'access-expires',
|
59
|
+
:'bound_ips' => :'bound-ips',
|
60
|
+
:'description' => :'description',
|
61
|
+
:'force_sub_claims' => :'force-sub-claims',
|
62
|
+
:'group_ocid' => :'group-ocid',
|
63
|
+
:'gw_bound_ips' => :'gw-bound-ips',
|
64
|
+
:'json' => :'json',
|
65
|
+
:'jwt_ttl' => :'jwt-ttl',
|
66
|
+
:'name' => :'name',
|
67
|
+
:'tenant_ocid' => :'tenant-ocid',
|
68
|
+
:'token' => :'token',
|
69
|
+
:'uid_token' => :'uid-token'
|
70
|
+
}
|
71
|
+
end
|
72
|
+
|
73
|
+
# Returns all the JSON keys this model knows about
|
74
|
+
def self.acceptable_attributes
|
75
|
+
attribute_map.values
|
76
|
+
end
|
77
|
+
|
78
|
+
# Attribute type mapping.
|
79
|
+
def self.openapi_types
|
80
|
+
{
|
81
|
+
:'access_expires' => :'Integer',
|
82
|
+
:'bound_ips' => :'Array<String>',
|
83
|
+
:'description' => :'String',
|
84
|
+
:'force_sub_claims' => :'Boolean',
|
85
|
+
:'group_ocid' => :'Array<String>',
|
86
|
+
:'gw_bound_ips' => :'Array<String>',
|
87
|
+
:'json' => :'Boolean',
|
88
|
+
:'jwt_ttl' => :'Integer',
|
89
|
+
:'name' => :'String',
|
90
|
+
:'tenant_ocid' => :'String',
|
91
|
+
:'token' => :'String',
|
92
|
+
:'uid_token' => :'String'
|
93
|
+
}
|
94
|
+
end
|
95
|
+
|
96
|
+
# List of attributes with nullable: true
|
97
|
+
def self.openapi_nullable
|
98
|
+
Set.new([
|
99
|
+
])
|
100
|
+
end
|
101
|
+
|
102
|
+
# Initializes the object
|
103
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
104
|
+
def initialize(attributes = {})
|
105
|
+
if (!attributes.is_a?(Hash))
|
106
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Akeyless::CreateAuthMethodOCI` initialize method"
|
107
|
+
end
|
108
|
+
|
109
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
110
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
111
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
112
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Akeyless::CreateAuthMethodOCI`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
113
|
+
end
|
114
|
+
h[k.to_sym] = v
|
115
|
+
}
|
116
|
+
|
117
|
+
if attributes.key?(:'access_expires')
|
118
|
+
self.access_expires = attributes[:'access_expires']
|
119
|
+
else
|
120
|
+
self.access_expires = 0
|
121
|
+
end
|
122
|
+
|
123
|
+
if attributes.key?(:'bound_ips')
|
124
|
+
if (value = attributes[:'bound_ips']).is_a?(Array)
|
125
|
+
self.bound_ips = value
|
126
|
+
end
|
127
|
+
end
|
128
|
+
|
129
|
+
if attributes.key?(:'description')
|
130
|
+
self.description = attributes[:'description']
|
131
|
+
end
|
132
|
+
|
133
|
+
if attributes.key?(:'force_sub_claims')
|
134
|
+
self.force_sub_claims = attributes[:'force_sub_claims']
|
135
|
+
end
|
136
|
+
|
137
|
+
if attributes.key?(:'group_ocid')
|
138
|
+
if (value = attributes[:'group_ocid']).is_a?(Array)
|
139
|
+
self.group_ocid = value
|
140
|
+
end
|
141
|
+
else
|
142
|
+
self.group_ocid = nil
|
143
|
+
end
|
144
|
+
|
145
|
+
if attributes.key?(:'gw_bound_ips')
|
146
|
+
if (value = attributes[:'gw_bound_ips']).is_a?(Array)
|
147
|
+
self.gw_bound_ips = value
|
148
|
+
end
|
149
|
+
end
|
150
|
+
|
151
|
+
if attributes.key?(:'json')
|
152
|
+
self.json = attributes[:'json']
|
153
|
+
else
|
154
|
+
self.json = false
|
155
|
+
end
|
156
|
+
|
157
|
+
if attributes.key?(:'jwt_ttl')
|
158
|
+
self.jwt_ttl = attributes[:'jwt_ttl']
|
159
|
+
else
|
160
|
+
self.jwt_ttl = 0
|
161
|
+
end
|
162
|
+
|
163
|
+
if attributes.key?(:'name')
|
164
|
+
self.name = attributes[:'name']
|
165
|
+
else
|
166
|
+
self.name = nil
|
167
|
+
end
|
168
|
+
|
169
|
+
if attributes.key?(:'tenant_ocid')
|
170
|
+
self.tenant_ocid = attributes[:'tenant_ocid']
|
171
|
+
else
|
172
|
+
self.tenant_ocid = nil
|
173
|
+
end
|
174
|
+
|
175
|
+
if attributes.key?(:'token')
|
176
|
+
self.token = attributes[:'token']
|
177
|
+
end
|
178
|
+
|
179
|
+
if attributes.key?(:'uid_token')
|
180
|
+
self.uid_token = attributes[:'uid_token']
|
181
|
+
end
|
182
|
+
end
|
183
|
+
|
184
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
185
|
+
# @return Array for valid properties with the reasons
|
186
|
+
def list_invalid_properties
|
187
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
188
|
+
invalid_properties = Array.new
|
189
|
+
if @group_ocid.nil?
|
190
|
+
invalid_properties.push('invalid value for "group_ocid", group_ocid cannot be nil.')
|
191
|
+
end
|
192
|
+
|
193
|
+
if @name.nil?
|
194
|
+
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
195
|
+
end
|
196
|
+
|
197
|
+
if @tenant_ocid.nil?
|
198
|
+
invalid_properties.push('invalid value for "tenant_ocid", tenant_ocid cannot be nil.')
|
199
|
+
end
|
200
|
+
|
201
|
+
invalid_properties
|
202
|
+
end
|
203
|
+
|
204
|
+
# Check to see if the all the properties in the model are valid
|
205
|
+
# @return true if the model is valid
|
206
|
+
def valid?
|
207
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
208
|
+
return false if @group_ocid.nil?
|
209
|
+
return false if @name.nil?
|
210
|
+
return false if @tenant_ocid.nil?
|
211
|
+
true
|
212
|
+
end
|
213
|
+
|
214
|
+
# Checks equality by comparing each attribute.
|
215
|
+
# @param [Object] Object to be compared
|
216
|
+
def ==(o)
|
217
|
+
return true if self.equal?(o)
|
218
|
+
self.class == o.class &&
|
219
|
+
access_expires == o.access_expires &&
|
220
|
+
bound_ips == o.bound_ips &&
|
221
|
+
description == o.description &&
|
222
|
+
force_sub_claims == o.force_sub_claims &&
|
223
|
+
group_ocid == o.group_ocid &&
|
224
|
+
gw_bound_ips == o.gw_bound_ips &&
|
225
|
+
json == o.json &&
|
226
|
+
jwt_ttl == o.jwt_ttl &&
|
227
|
+
name == o.name &&
|
228
|
+
tenant_ocid == o.tenant_ocid &&
|
229
|
+
token == o.token &&
|
230
|
+
uid_token == o.uid_token
|
231
|
+
end
|
232
|
+
|
233
|
+
# @see the `==` method
|
234
|
+
# @param [Object] Object to be compared
|
235
|
+
def eql?(o)
|
236
|
+
self == o
|
237
|
+
end
|
238
|
+
|
239
|
+
# Calculates hash code according to all attributes.
|
240
|
+
# @return [Integer] Hash code
|
241
|
+
def hash
|
242
|
+
[access_expires, bound_ips, description, force_sub_claims, group_ocid, gw_bound_ips, json, jwt_ttl, name, tenant_ocid, token, uid_token].hash
|
243
|
+
end
|
244
|
+
|
245
|
+
# Builds the object from hash
|
246
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
247
|
+
# @return [Object] Returns the model itself
|
248
|
+
def self.build_from_hash(attributes)
|
249
|
+
return nil unless attributes.is_a?(Hash)
|
250
|
+
attributes = attributes.transform_keys(&:to_sym)
|
251
|
+
transformed_hash = {}
|
252
|
+
openapi_types.each_pair do |key, type|
|
253
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
254
|
+
transformed_hash["#{key}"] = nil
|
255
|
+
elsif type =~ /\AArray<(.*)>/i
|
256
|
+
# check to ensure the input is an array given that the attribute
|
257
|
+
# is documented as an array but the input is not
|
258
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
259
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
260
|
+
end
|
261
|
+
elsif !attributes[attribute_map[key]].nil?
|
262
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
263
|
+
end
|
264
|
+
end
|
265
|
+
new(transformed_hash)
|
266
|
+
end
|
267
|
+
|
268
|
+
# Deserializes the data based on type
|
269
|
+
# @param string type Data type
|
270
|
+
# @param string value Value to be deserialized
|
271
|
+
# @return [Object] Deserialized data
|
272
|
+
def self._deserialize(type, value)
|
273
|
+
case type.to_sym
|
274
|
+
when :Time
|
275
|
+
Time.parse(value)
|
276
|
+
when :Date
|
277
|
+
Date.parse(value)
|
278
|
+
when :String
|
279
|
+
value.to_s
|
280
|
+
when :Integer
|
281
|
+
value.to_i
|
282
|
+
when :Float
|
283
|
+
value.to_f
|
284
|
+
when :Boolean
|
285
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
286
|
+
true
|
287
|
+
else
|
288
|
+
false
|
289
|
+
end
|
290
|
+
when :Object
|
291
|
+
# generic object (usually a Hash), return directly
|
292
|
+
value
|
293
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
294
|
+
inner_type = Regexp.last_match[:inner_type]
|
295
|
+
value.map { |v| _deserialize(inner_type, v) }
|
296
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
297
|
+
k_type = Regexp.last_match[:k_type]
|
298
|
+
v_type = Regexp.last_match[:v_type]
|
299
|
+
{}.tap do |hash|
|
300
|
+
value.each do |k, v|
|
301
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
302
|
+
end
|
303
|
+
end
|
304
|
+
else # model
|
305
|
+
# models (e.g. Pet) or oneOf
|
306
|
+
klass = Akeyless.const_get(type)
|
307
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
308
|
+
end
|
309
|
+
end
|
310
|
+
|
311
|
+
# Returns the string representation of the object
|
312
|
+
# @return [String] String presentation of the object
|
313
|
+
def to_s
|
314
|
+
to_hash.to_s
|
315
|
+
end
|
316
|
+
|
317
|
+
# to_body is an alias to to_hash (backward compatibility)
|
318
|
+
# @return [Hash] Returns the object in the form of hash
|
319
|
+
def to_body
|
320
|
+
to_hash
|
321
|
+
end
|
322
|
+
|
323
|
+
# Returns the object in the form of hash
|
324
|
+
# @return [Hash] Returns the object in the form of hash
|
325
|
+
def to_hash
|
326
|
+
hash = {}
|
327
|
+
self.class.attribute_map.each_pair do |attr, param|
|
328
|
+
value = self.send(attr)
|
329
|
+
if value.nil?
|
330
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
331
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
332
|
+
end
|
333
|
+
|
334
|
+
hash[param] = _to_hash(value)
|
335
|
+
end
|
336
|
+
hash
|
337
|
+
end
|
338
|
+
|
339
|
+
# Outputs non-array value in the form of hash
|
340
|
+
# For object, use to_hash. Otherwise, just return the value
|
341
|
+
# @param [Object] value Any valid value
|
342
|
+
# @return [Hash] Returns the value in the form of hash
|
343
|
+
def _to_hash(value)
|
344
|
+
if value.is_a?(Array)
|
345
|
+
value.compact.map { |v| _to_hash(v) }
|
346
|
+
elsif value.is_a?(Hash)
|
347
|
+
{}.tap do |hash|
|
348
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
349
|
+
end
|
350
|
+
elsif value.respond_to? :to_hash
|
351
|
+
value.to_hash
|
352
|
+
else
|
353
|
+
value
|
354
|
+
end
|
355
|
+
end
|
356
|
+
|
357
|
+
end
|
358
|
+
|
359
|
+
end
|
@@ -0,0 +1,214 @@
|
|
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: 7.3.0-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module Akeyless
|
17
|
+
class CreateAuthMethodOCIOutput
|
18
|
+
attr_accessor :access_id
|
19
|
+
|
20
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
21
|
+
def self.attribute_map
|
22
|
+
{
|
23
|
+
:'access_id' => :'access_id'
|
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
|
+
:'access_id' => :'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::CreateAuthMethodOCIOutput` 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::CreateAuthMethodOCIOutput`. 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?(:'access_id')
|
61
|
+
self.access_id = attributes[:'access_id']
|
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
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
69
|
+
invalid_properties = Array.new
|
70
|
+
invalid_properties
|
71
|
+
end
|
72
|
+
|
73
|
+
# Check to see if the all the properties in the model are valid
|
74
|
+
# @return true if the model is valid
|
75
|
+
def valid?
|
76
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
77
|
+
true
|
78
|
+
end
|
79
|
+
|
80
|
+
# Checks equality by comparing each attribute.
|
81
|
+
# @param [Object] Object to be compared
|
82
|
+
def ==(o)
|
83
|
+
return true if self.equal?(o)
|
84
|
+
self.class == o.class &&
|
85
|
+
access_id == o.access_id
|
86
|
+
end
|
87
|
+
|
88
|
+
# @see the `==` method
|
89
|
+
# @param [Object] Object to be compared
|
90
|
+
def eql?(o)
|
91
|
+
self == o
|
92
|
+
end
|
93
|
+
|
94
|
+
# Calculates hash code according to all attributes.
|
95
|
+
# @return [Integer] Hash code
|
96
|
+
def hash
|
97
|
+
[access_id].hash
|
98
|
+
end
|
99
|
+
|
100
|
+
# Builds the object from hash
|
101
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
102
|
+
# @return [Object] Returns the model itself
|
103
|
+
def self.build_from_hash(attributes)
|
104
|
+
return nil unless attributes.is_a?(Hash)
|
105
|
+
attributes = attributes.transform_keys(&:to_sym)
|
106
|
+
transformed_hash = {}
|
107
|
+
openapi_types.each_pair do |key, type|
|
108
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
109
|
+
transformed_hash["#{key}"] = nil
|
110
|
+
elsif type =~ /\AArray<(.*)>/i
|
111
|
+
# check to ensure the input is an array given that the attribute
|
112
|
+
# is documented as an array but the input is not
|
113
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
114
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
115
|
+
end
|
116
|
+
elsif !attributes[attribute_map[key]].nil?
|
117
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
118
|
+
end
|
119
|
+
end
|
120
|
+
new(transformed_hash)
|
121
|
+
end
|
122
|
+
|
123
|
+
# Deserializes the data based on type
|
124
|
+
# @param string type Data type
|
125
|
+
# @param string value Value to be deserialized
|
126
|
+
# @return [Object] Deserialized data
|
127
|
+
def self._deserialize(type, value)
|
128
|
+
case type.to_sym
|
129
|
+
when :Time
|
130
|
+
Time.parse(value)
|
131
|
+
when :Date
|
132
|
+
Date.parse(value)
|
133
|
+
when :String
|
134
|
+
value.to_s
|
135
|
+
when :Integer
|
136
|
+
value.to_i
|
137
|
+
when :Float
|
138
|
+
value.to_f
|
139
|
+
when :Boolean
|
140
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
141
|
+
true
|
142
|
+
else
|
143
|
+
false
|
144
|
+
end
|
145
|
+
when :Object
|
146
|
+
# generic object (usually a Hash), return directly
|
147
|
+
value
|
148
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
149
|
+
inner_type = Regexp.last_match[:inner_type]
|
150
|
+
value.map { |v| _deserialize(inner_type, v) }
|
151
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
152
|
+
k_type = Regexp.last_match[:k_type]
|
153
|
+
v_type = Regexp.last_match[:v_type]
|
154
|
+
{}.tap do |hash|
|
155
|
+
value.each do |k, v|
|
156
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
157
|
+
end
|
158
|
+
end
|
159
|
+
else # model
|
160
|
+
# models (e.g. Pet) or oneOf
|
161
|
+
klass = Akeyless.const_get(type)
|
162
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
163
|
+
end
|
164
|
+
end
|
165
|
+
|
166
|
+
# Returns the string representation of the object
|
167
|
+
# @return [String] String presentation of the object
|
168
|
+
def to_s
|
169
|
+
to_hash.to_s
|
170
|
+
end
|
171
|
+
|
172
|
+
# to_body is an alias to to_hash (backward compatibility)
|
173
|
+
# @return [Hash] Returns the object in the form of hash
|
174
|
+
def to_body
|
175
|
+
to_hash
|
176
|
+
end
|
177
|
+
|
178
|
+
# Returns the object in the form of hash
|
179
|
+
# @return [Hash] Returns the object in the form of hash
|
180
|
+
def to_hash
|
181
|
+
hash = {}
|
182
|
+
self.class.attribute_map.each_pair do |attr, param|
|
183
|
+
value = self.send(attr)
|
184
|
+
if value.nil?
|
185
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
186
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
187
|
+
end
|
188
|
+
|
189
|
+
hash[param] = _to_hash(value)
|
190
|
+
end
|
191
|
+
hash
|
192
|
+
end
|
193
|
+
|
194
|
+
# Outputs non-array value in the form of hash
|
195
|
+
# For object, use to_hash. Otherwise, just return the value
|
196
|
+
# @param [Object] value Any valid value
|
197
|
+
# @return [Hash] Returns the value in the form of hash
|
198
|
+
def _to_hash(value)
|
199
|
+
if value.is_a?(Array)
|
200
|
+
value.compact.map { |v| _to_hash(v) }
|
201
|
+
elsif value.is_a?(Hash)
|
202
|
+
{}.tap do |hash|
|
203
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
204
|
+
end
|
205
|
+
elsif value.respond_to? :to_hash
|
206
|
+
value.to_hash
|
207
|
+
else
|
208
|
+
value
|
209
|
+
end
|
210
|
+
end
|
211
|
+
|
212
|
+
end
|
213
|
+
|
214
|
+
end
|