akeyless 5.0.19 → 5.0.21
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.
- checksums.yaml +4 -4
- data/README.md +28 -1
- data/docs/CertificateStore.md +2 -0
- data/docs/CreateUSC.md +2 -0
- data/docs/GCPPayload.md +5 -1
- data/docs/GatewayCreateMigration.md +5 -1
- data/docs/GatewayUpdateMigration.md +5 -1
- data/docs/GatewayUpdateTlsCert.md +2 -0
- data/docs/GeneralConfigPart.md +6 -0
- data/docs/GetKubeExecCreds.md +1 -1
- data/docs/GetPKICertificate.md +1 -1
- data/docs/LetsEncryptTargetDetails.md +38 -0
- data/docs/PoliciesCreateOutput.md +18 -0
- data/docs/PoliciesDelete.md +24 -0
- data/docs/PoliciesGet.md +24 -0
- data/docs/PoliciesGetOutput.md +18 -0
- data/docs/PoliciesList.md +30 -0
- data/docs/PoliciesListOutput.md +18 -0
- data/docs/PolicyCreateKeys.md +34 -0
- data/docs/PolicyOutput.md +34 -0
- data/docs/PolicyUpdateKeys.md +36 -0
- data/docs/RotatedSecretCreateAws.md +4 -2
- data/docs/RotatedSecretCreateAzure.md +4 -2
- data/docs/RotatedSecretCreateCassandra.md +1 -1
- data/docs/RotatedSecretCreateCustom.md +1 -1
- data/docs/RotatedSecretCreateDockerhub.md +1 -1
- data/docs/RotatedSecretCreateGcp.md +4 -2
- data/docs/RotatedSecretCreateHanadb.md +1 -1
- data/docs/RotatedSecretCreateLdap.md +1 -1
- data/docs/RotatedSecretCreateMongodb.md +1 -1
- data/docs/RotatedSecretCreateMssql.md +1 -1
- data/docs/RotatedSecretCreateMysql.md +1 -1
- data/docs/RotatedSecretCreateOpenAI.md +1 -1
- data/docs/RotatedSecretCreateOracledb.md +1 -1
- data/docs/RotatedSecretCreatePostgresql.md +1 -1
- data/docs/RotatedSecretCreateRedis.md +1 -1
- data/docs/RotatedSecretCreateRedshift.md +1 -1
- data/docs/RotatedSecretCreateSnowflake.md +1 -1
- data/docs/RotatedSecretCreateSplunk.md +68 -0
- data/docs/RotatedSecretCreateSsh.md +1 -1
- data/docs/RotatedSecretCreateWindows.md +1 -1
- data/docs/RotatedSecretDetailsInfo.md +2 -0
- data/docs/RotatedSecretUpdateAws.md +3 -1
- data/docs/RotatedSecretUpdateAzure.md +3 -1
- data/docs/RotatedSecretUpdateGcp.md +3 -1
- data/docs/RotatedSecretUpdateSplunk.md +64 -0
- data/docs/SecretInfo.md +2 -0
- data/docs/SplunkPayload.md +30 -0
- data/docs/SplunkTargetDetails.md +34 -0
- data/docs/TargetCreateLetsEncrypt.md +46 -0
- data/docs/TargetCreateSplunk.md +42 -0
- data/docs/TargetTypeDetailsInput.md +4 -0
- data/docs/TargetUpdateLetsEncrypt.md +50 -0
- data/docs/UpdateItem.md +2 -0
- data/docs/UscCreate.md +2 -0
- data/docs/V2Api.md +659 -29
- data/lib/akeyless/api/v2_api.rb +640 -0
- data/lib/akeyless/models/certificate_store.rb +12 -1
- data/lib/akeyless/models/create_usc.rb +11 -1
- data/lib/akeyless/models/gateway_create_migration.rb +24 -4
- data/lib/akeyless/models/gateway_update_migration.rb +24 -4
- data/lib/akeyless/models/gateway_update_tls_cert.rb +13 -1
- data/lib/akeyless/models/gcp_payload.rb +22 -4
- data/lib/akeyless/models/general_config_part.rb +30 -1
- data/lib/akeyless/models/get_kube_exec_creds.rb +1 -1
- data/lib/akeyless/models/get_pki_certificate.rb +1 -1
- data/lib/akeyless/models/lets_encrypt_target_details.rb +315 -0
- data/lib/akeyless/models/policies_create_output.rb +214 -0
- data/lib/akeyless/models/policies_delete.rb +254 -0
- data/lib/akeyless/models/policies_get.rb +254 -0
- data/lib/akeyless/models/policies_get_output.rb +214 -0
- data/lib/akeyless/models/policies_list.rb +283 -0
- data/lib/akeyless/models/policies_list_output.rb +216 -0
- data/lib/akeyless/models/policy_create_keys.rb +312 -0
- data/lib/akeyless/models/policy_output.rb +295 -0
- data/lib/akeyless/models/policy_update_keys.rb +322 -0
- data/lib/akeyless/models/rotated_secret_create_aws.rb +13 -3
- data/lib/akeyless/models/rotated_secret_create_azure.rb +13 -3
- data/lib/akeyless/models/rotated_secret_create_cassandra.rb +1 -1
- data/lib/akeyless/models/rotated_secret_create_custom.rb +1 -1
- data/lib/akeyless/models/rotated_secret_create_dockerhub.rb +1 -1
- data/lib/akeyless/models/rotated_secret_create_gcp.rb +13 -3
- data/lib/akeyless/models/rotated_secret_create_hanadb.rb +1 -1
- data/lib/akeyless/models/rotated_secret_create_ldap.rb +1 -1
- data/lib/akeyless/models/rotated_secret_create_mongodb.rb +1 -1
- data/lib/akeyless/models/rotated_secret_create_mssql.rb +1 -1
- data/lib/akeyless/models/rotated_secret_create_mysql.rb +1 -1
- data/lib/akeyless/models/rotated_secret_create_open_ai.rb +1 -1
- data/lib/akeyless/models/rotated_secret_create_oracledb.rb +1 -1
- data/lib/akeyless/models/rotated_secret_create_postgresql.rb +1 -1
- data/lib/akeyless/models/rotated_secret_create_redis.rb +1 -1
- data/lib/akeyless/models/rotated_secret_create_redshift.rb +1 -1
- data/lib/akeyless/models/rotated_secret_create_snowflake.rb +1 -1
- data/lib/akeyless/models/rotated_secret_create_splunk.rb +497 -0
- data/lib/akeyless/models/rotated_secret_create_ssh.rb +1 -1
- data/lib/akeyless/models/rotated_secret_create_windows.rb +1 -1
- data/lib/akeyless/models/rotated_secret_details_info.rb +10 -1
- data/lib/akeyless/models/rotated_secret_update_aws.rb +12 -2
- data/lib/akeyless/models/rotated_secret_update_azure.rb +12 -2
- data/lib/akeyless/models/rotated_secret_update_gcp.rb +12 -2
- data/lib/akeyless/models/rotated_secret_update_splunk.rb +467 -0
- data/lib/akeyless/models/secret_info.rb +10 -1
- data/lib/akeyless/models/splunk_payload.rb +268 -0
- data/lib/akeyless/models/splunk_target_details.rb +294 -0
- data/lib/akeyless/models/target_create_lets_encrypt.rb +368 -0
- data/lib/akeyless/models/target_create_splunk.rb +354 -0
- data/lib/akeyless/models/target_type_details_input.rb +19 -1
- data/lib/akeyless/models/target_update_lets_encrypt.rb +388 -0
- data/lib/akeyless/models/update_item.rb +11 -1
- data/lib/akeyless/models/usc_create.rb +11 -1
- data/lib/akeyless/version.rb +1 -1
- data/lib/akeyless.rb +17 -0
- data/spec/models/lets_encrypt_target_details_spec.rb +96 -0
- data/spec/models/policies_create_output_spec.rb +36 -0
- data/spec/models/policies_delete_spec.rb +54 -0
- data/spec/models/policies_get_output_spec.rb +36 -0
- data/spec/models/policies_get_spec.rb +54 -0
- data/spec/models/policies_list_output_spec.rb +36 -0
- data/spec/models/policies_list_spec.rb +72 -0
- data/spec/models/policy_create_keys_spec.rb +84 -0
- data/spec/models/policy_output_spec.rb +84 -0
- data/spec/models/policy_update_keys_spec.rb +90 -0
- data/spec/models/rotated_secret_create_splunk_spec.rb +186 -0
- data/spec/models/rotated_secret_update_splunk_spec.rb +174 -0
- data/spec/models/splunk_payload_spec.rb +72 -0
- data/spec/models/splunk_target_details_spec.rb +84 -0
- data/spec/models/target_create_lets_encrypt_spec.rb +120 -0
- data/spec/models/target_create_splunk_spec.rb +108 -0
- data/spec/models/target_update_lets_encrypt_spec.rb +132 -0
- metadata +69 -1
|
@@ -0,0 +1,315 @@
|
|
|
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: 3.0
|
|
7
|
+
Contact: support@akeyless.io
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.10.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Akeyless
|
|
17
|
+
# LetsEncryptTargetDetails defines configuration for Let's Encrypt ACME target
|
|
18
|
+
class LetsEncryptTargetDetails
|
|
19
|
+
# ACME Account Private Key (PEM-encoded) Supports ECDSA (P-256, P-384, P-521), RSA (2048+), and Ed25519 Auto-generated as ECDSA P-256 on first certificate issuance if not provided Stored encrypted, required for certificate operations and revocation
|
|
20
|
+
attr_accessor :account_key_pem
|
|
21
|
+
|
|
22
|
+
# ACME Account URL (returned after registration with Let's Encrypt) Used to retrieve existing account instead of re-registering
|
|
23
|
+
attr_accessor :account_url
|
|
24
|
+
|
|
25
|
+
# ACMEEnvironment defines Let's Encrypt ACME directory environment
|
|
26
|
+
attr_accessor :acme_environment
|
|
27
|
+
|
|
28
|
+
# ACMEChallengeType defines ACME challenge type for Let's Encrypt
|
|
29
|
+
attr_accessor :challenge_type
|
|
30
|
+
|
|
31
|
+
# Name of DNS target (transient field - not stored in DB) Used by CLI to pass DNS target name to SDK for creating target_object_assoc Retrieved from target_object_assoc when reading target Required when ChallengeType is \"dns\"
|
|
32
|
+
attr_accessor :dns_target_name
|
|
33
|
+
|
|
34
|
+
attr_accessor :dns_target_type
|
|
35
|
+
|
|
36
|
+
# Email address for ACME account registration Required
|
|
37
|
+
attr_accessor :email
|
|
38
|
+
|
|
39
|
+
# GCP Cloud DNS: Project ID Optional - can be derived from service account
|
|
40
|
+
attr_accessor :gcp_project
|
|
41
|
+
|
|
42
|
+
# AWS Route53: Hosted zone ID Required when DNSTargetType is AWS
|
|
43
|
+
attr_accessor :hosted_zone
|
|
44
|
+
|
|
45
|
+
# Azure DNS: Resource group name Required when DNSTargetType is Azure
|
|
46
|
+
attr_accessor :resource_group
|
|
47
|
+
|
|
48
|
+
# A Duration represents the elapsed time between two instants as an int64 nanosecond count. The representation limits the largest representable duration to approximately 290 years.
|
|
49
|
+
attr_accessor :timeout
|
|
50
|
+
|
|
51
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
52
|
+
def self.attribute_map
|
|
53
|
+
{
|
|
54
|
+
:'account_key_pem' => :'account_key_pem',
|
|
55
|
+
:'account_url' => :'account_url',
|
|
56
|
+
:'acme_environment' => :'acme_environment',
|
|
57
|
+
:'challenge_type' => :'challenge_type',
|
|
58
|
+
:'dns_target_name' => :'dns_target_name',
|
|
59
|
+
:'dns_target_type' => :'dns_target_type',
|
|
60
|
+
:'email' => :'email',
|
|
61
|
+
:'gcp_project' => :'gcp_project',
|
|
62
|
+
:'hosted_zone' => :'hosted_zone',
|
|
63
|
+
:'resource_group' => :'resource_group',
|
|
64
|
+
:'timeout' => :'timeout'
|
|
65
|
+
}
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# Returns all the JSON keys this model knows about
|
|
69
|
+
def self.acceptable_attributes
|
|
70
|
+
attribute_map.values
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# Attribute type mapping.
|
|
74
|
+
def self.openapi_types
|
|
75
|
+
{
|
|
76
|
+
:'account_key_pem' => :'String',
|
|
77
|
+
:'account_url' => :'String',
|
|
78
|
+
:'acme_environment' => :'String',
|
|
79
|
+
:'challenge_type' => :'String',
|
|
80
|
+
:'dns_target_name' => :'String',
|
|
81
|
+
:'dns_target_type' => :'String',
|
|
82
|
+
:'email' => :'String',
|
|
83
|
+
:'gcp_project' => :'String',
|
|
84
|
+
:'hosted_zone' => :'String',
|
|
85
|
+
:'resource_group' => :'String',
|
|
86
|
+
:'timeout' => :'Integer'
|
|
87
|
+
}
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# List of attributes with nullable: true
|
|
91
|
+
def self.openapi_nullable
|
|
92
|
+
Set.new([
|
|
93
|
+
])
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
# Initializes the object
|
|
97
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
98
|
+
def initialize(attributes = {})
|
|
99
|
+
if (!attributes.is_a?(Hash))
|
|
100
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Akeyless::LetsEncryptTargetDetails` initialize method"
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
104
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
105
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
106
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Akeyless::LetsEncryptTargetDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
107
|
+
end
|
|
108
|
+
h[k.to_sym] = v
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
if attributes.key?(:'account_key_pem')
|
|
112
|
+
self.account_key_pem = attributes[:'account_key_pem']
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
if attributes.key?(:'account_url')
|
|
116
|
+
self.account_url = attributes[:'account_url']
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
if attributes.key?(:'acme_environment')
|
|
120
|
+
self.acme_environment = attributes[:'acme_environment']
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
if attributes.key?(:'challenge_type')
|
|
124
|
+
self.challenge_type = attributes[:'challenge_type']
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
if attributes.key?(:'dns_target_name')
|
|
128
|
+
self.dns_target_name = attributes[:'dns_target_name']
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
if attributes.key?(:'dns_target_type')
|
|
132
|
+
self.dns_target_type = attributes[:'dns_target_type']
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
if attributes.key?(:'email')
|
|
136
|
+
self.email = attributes[:'email']
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
if attributes.key?(:'gcp_project')
|
|
140
|
+
self.gcp_project = attributes[:'gcp_project']
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
if attributes.key?(:'hosted_zone')
|
|
144
|
+
self.hosted_zone = attributes[:'hosted_zone']
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
if attributes.key?(:'resource_group')
|
|
148
|
+
self.resource_group = attributes[:'resource_group']
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
if attributes.key?(:'timeout')
|
|
152
|
+
self.timeout = attributes[:'timeout']
|
|
153
|
+
end
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
157
|
+
# @return Array for valid properties with the reasons
|
|
158
|
+
def list_invalid_properties
|
|
159
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
160
|
+
invalid_properties = Array.new
|
|
161
|
+
invalid_properties
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
# Check to see if the all the properties in the model are valid
|
|
165
|
+
# @return true if the model is valid
|
|
166
|
+
def valid?
|
|
167
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
168
|
+
true
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
# Checks equality by comparing each attribute.
|
|
172
|
+
# @param [Object] Object to be compared
|
|
173
|
+
def ==(o)
|
|
174
|
+
return true if self.equal?(o)
|
|
175
|
+
self.class == o.class &&
|
|
176
|
+
account_key_pem == o.account_key_pem &&
|
|
177
|
+
account_url == o.account_url &&
|
|
178
|
+
acme_environment == o.acme_environment &&
|
|
179
|
+
challenge_type == o.challenge_type &&
|
|
180
|
+
dns_target_name == o.dns_target_name &&
|
|
181
|
+
dns_target_type == o.dns_target_type &&
|
|
182
|
+
email == o.email &&
|
|
183
|
+
gcp_project == o.gcp_project &&
|
|
184
|
+
hosted_zone == o.hosted_zone &&
|
|
185
|
+
resource_group == o.resource_group &&
|
|
186
|
+
timeout == o.timeout
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
# @see the `==` method
|
|
190
|
+
# @param [Object] Object to be compared
|
|
191
|
+
def eql?(o)
|
|
192
|
+
self == o
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
# Calculates hash code according to all attributes.
|
|
196
|
+
# @return [Integer] Hash code
|
|
197
|
+
def hash
|
|
198
|
+
[account_key_pem, account_url, acme_environment, challenge_type, dns_target_name, dns_target_type, email, gcp_project, hosted_zone, resource_group, timeout].hash
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
# Builds the object from hash
|
|
202
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
203
|
+
# @return [Object] Returns the model itself
|
|
204
|
+
def self.build_from_hash(attributes)
|
|
205
|
+
return nil unless attributes.is_a?(Hash)
|
|
206
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
207
|
+
transformed_hash = {}
|
|
208
|
+
openapi_types.each_pair do |key, type|
|
|
209
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
210
|
+
transformed_hash["#{key}"] = nil
|
|
211
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
212
|
+
# check to ensure the input is an array given that the attribute
|
|
213
|
+
# is documented as an array but the input is not
|
|
214
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
215
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
216
|
+
end
|
|
217
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
218
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
219
|
+
end
|
|
220
|
+
end
|
|
221
|
+
new(transformed_hash)
|
|
222
|
+
end
|
|
223
|
+
|
|
224
|
+
# Deserializes the data based on type
|
|
225
|
+
# @param string type Data type
|
|
226
|
+
# @param string value Value to be deserialized
|
|
227
|
+
# @return [Object] Deserialized data
|
|
228
|
+
def self._deserialize(type, value)
|
|
229
|
+
case type.to_sym
|
|
230
|
+
when :Time
|
|
231
|
+
Time.parse(value)
|
|
232
|
+
when :Date
|
|
233
|
+
Date.parse(value)
|
|
234
|
+
when :String
|
|
235
|
+
value.to_s
|
|
236
|
+
when :Integer
|
|
237
|
+
value.to_i
|
|
238
|
+
when :Float
|
|
239
|
+
value.to_f
|
|
240
|
+
when :Boolean
|
|
241
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
242
|
+
true
|
|
243
|
+
else
|
|
244
|
+
false
|
|
245
|
+
end
|
|
246
|
+
when :Object
|
|
247
|
+
# generic object (usually a Hash), return directly
|
|
248
|
+
value
|
|
249
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
250
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
251
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
252
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
253
|
+
k_type = Regexp.last_match[:k_type]
|
|
254
|
+
v_type = Regexp.last_match[:v_type]
|
|
255
|
+
{}.tap do |hash|
|
|
256
|
+
value.each do |k, v|
|
|
257
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
258
|
+
end
|
|
259
|
+
end
|
|
260
|
+
else # model
|
|
261
|
+
# models (e.g. Pet) or oneOf
|
|
262
|
+
klass = Akeyless.const_get(type)
|
|
263
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
264
|
+
end
|
|
265
|
+
end
|
|
266
|
+
|
|
267
|
+
# Returns the string representation of the object
|
|
268
|
+
# @return [String] String presentation of the object
|
|
269
|
+
def to_s
|
|
270
|
+
to_hash.to_s
|
|
271
|
+
end
|
|
272
|
+
|
|
273
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
274
|
+
# @return [Hash] Returns the object in the form of hash
|
|
275
|
+
def to_body
|
|
276
|
+
to_hash
|
|
277
|
+
end
|
|
278
|
+
|
|
279
|
+
# Returns the object in the form of hash
|
|
280
|
+
# @return [Hash] Returns the object in the form of hash
|
|
281
|
+
def to_hash
|
|
282
|
+
hash = {}
|
|
283
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
284
|
+
value = self.send(attr)
|
|
285
|
+
if value.nil?
|
|
286
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
287
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
288
|
+
end
|
|
289
|
+
|
|
290
|
+
hash[param] = _to_hash(value)
|
|
291
|
+
end
|
|
292
|
+
hash
|
|
293
|
+
end
|
|
294
|
+
|
|
295
|
+
# Outputs non-array value in the form of hash
|
|
296
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
297
|
+
# @param [Object] value Any valid value
|
|
298
|
+
# @return [Hash] Returns the value in the form of hash
|
|
299
|
+
def _to_hash(value)
|
|
300
|
+
if value.is_a?(Array)
|
|
301
|
+
value.compact.map { |v| _to_hash(v) }
|
|
302
|
+
elsif value.is_a?(Hash)
|
|
303
|
+
{}.tap do |hash|
|
|
304
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
305
|
+
end
|
|
306
|
+
elsif value.respond_to? :to_hash
|
|
307
|
+
value.to_hash
|
|
308
|
+
else
|
|
309
|
+
value
|
|
310
|
+
end
|
|
311
|
+
end
|
|
312
|
+
|
|
313
|
+
end
|
|
314
|
+
|
|
315
|
+
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: 3.0
|
|
7
|
+
Contact: support@akeyless.io
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.10.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Akeyless
|
|
17
|
+
class PoliciesCreateOutput
|
|
18
|
+
attr_accessor :id
|
|
19
|
+
|
|
20
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
21
|
+
def self.attribute_map
|
|
22
|
+
{
|
|
23
|
+
:'id' => :'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
|
+
:'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::PoliciesCreateOutput` 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::PoliciesCreateOutput`. 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?(:'id')
|
|
61
|
+
self.id = attributes[:'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
|
+
id == o.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
|
+
[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
|