akeyless 5.0.21 → 5.0.23
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 +35 -1
- data/docs/AccountGeneralSettings.md +6 -0
- data/docs/ActiveDirectoryPayload.md +6 -0
- data/docs/Auth.md +2 -0
- data/docs/AuthMethodCreateCert.md +2 -0
- data/docs/AuthMethodCreateUniversalIdentity.md +4 -0
- data/docs/AuthMethodUpdateCert.md +2 -0
- data/docs/AuthMethodUpdateUniversalIdentity.md +4 -0
- data/docs/AwsStorage.md +2 -0
- data/docs/AzureADAccessRules.md +2 -0
- data/docs/AzureTargetDetails.md +2 -0
- data/docs/CertAccessRules.md +2 -0
- data/docs/CertificateChainInfo.md +2 -0
- data/docs/Configure.md +2 -0
- data/docs/ConjurMigration.md +20 -0
- data/docs/ConjurPayload.md +24 -0
- data/docs/CreateAuthMethodCert.md +2 -0
- data/docs/CreateAuthMethodUniversalIdentity.md +4 -0
- data/docs/CreateAzureTarget.md +2 -0
- data/docs/CreateRotatedSecret.md +3 -1
- data/docs/CreateSecret.md +2 -0
- data/docs/CreateUSC.md +10 -0
- data/docs/DSProducerDetails.md +2 -0
- data/docs/DefaultAuthMethodSettings.md +20 -0
- data/docs/DeleteRoleRule.md +1 -1
- data/docs/DescribePermissions.md +1 -1
- data/docs/DigiCertTargetDetails.md +42 -0
- data/docs/EsmListSecretsOutput.md +3 -1
- data/docs/GatewayCreateMigration.md +19 -1
- data/docs/GatewayUpdateMigration.md +18 -0
- data/docs/GatewayUpdateRemoteAccessRdpRecordings.md +2 -0
- data/docs/GeneralConfigPart.md +4 -0
- data/docs/GetPKICertificateOutput.md +2 -0
- data/docs/GithubMetadata.md +28 -0
- data/docs/GoogleTrustTargetDetails.md +42 -0
- data/docs/HTTPChallengeInfo.md +26 -0
- data/docs/HashiPayload.md +5 -1
- data/docs/IssuerOverviewInfo.md +22 -0
- data/docs/Item.md +2 -0
- data/docs/ItemGeneralInfo.md +2 -0
- data/docs/ItemLockingSetting.md +20 -0
- data/docs/LockItem.md +28 -0
- data/docs/LockTarget.md +28 -0
- data/docs/LockingInfo.md +24 -0
- data/docs/MigrationStatusReplyObj.md +4 -0
- data/docs/MigrationsConfigPart.md +2 -0
- data/docs/NetappStorage.md +30 -0
- data/docs/ReverseRBAC.md +1 -1
- data/docs/RotatedSecretCreateAws.md +3 -1
- data/docs/RotatedSecretCreateAzure.md +3 -1
- data/docs/RotatedSecretCreateCustom.md +3 -1
- data/docs/RotatedSecretCreateLdap.md +3 -1
- data/docs/RotatedSecretCreateMongodb.md +3 -1
- data/docs/RotatedSecretCreateMssql.md +3 -1
- data/docs/RotatedSecretCreateMysql.md +3 -1
- data/docs/RotatedSecretCreateOracledb.md +3 -1
- data/docs/RotatedSecretCreatePostgresql.md +3 -1
- data/docs/RotatedSecretCreateRedshift.md +3 -1
- data/docs/RotatedSecretCreateSsh.md +3 -1
- data/docs/RotatedSecretCreateWindows.md +3 -1
- data/docs/RotatedSecretUpdateAws.md +3 -1
- data/docs/RotatedSecretUpdateAzure.md +3 -1
- data/docs/RotatedSecretUpdateCustom.md +3 -1
- data/docs/RotatedSecretUpdateLdap.md +3 -1
- data/docs/RotatedSecretUpdateMongodb.md +3 -1
- data/docs/RotatedSecretUpdateMssql.md +3 -1
- data/docs/RotatedSecretUpdateMysql.md +3 -1
- data/docs/RotatedSecretUpdateOracledb.md +3 -1
- data/docs/RotatedSecretUpdatePostgresql.md +3 -1
- data/docs/RotatedSecretUpdateRedshift.md +3 -1
- data/docs/RotatedSecretUpdateSsh.md +3 -1
- data/docs/RotatedSecretUpdateWindows.md +3 -1
- data/docs/SecretInfo.md +4 -0
- data/docs/SecureRemoteAccess.md +4 -0
- data/docs/SetRoleRule.md +1 -1
- data/docs/SyncCounters.md +22 -0
- data/docs/Target.md +2 -0
- data/docs/TargetCreateAzure.md +2 -0
- data/docs/TargetCreateDigiCert.md +50 -0
- data/docs/TargetCreateGoogleTrust.md +50 -0
- data/docs/TargetCreateLetsEncrypt.md +1 -1
- data/docs/TargetCreateSplunk.md +3 -1
- data/docs/TargetTypeDetailsInput.md +4 -0
- data/docs/TargetUpdateAzure.md +2 -0
- data/docs/TargetUpdateDigiCert.md +54 -0
- data/docs/TargetUpdateGoogleTrust.md +54 -0
- data/docs/TargetUpdateLetsEncrypt.md +1 -1
- data/docs/UniversalIdentityAccessRules.md +4 -0
- data/docs/UnlockItem.md +24 -0
- data/docs/UnlockTarget.md +24 -0
- data/docs/UpdateAccountSettings.md +4 -0
- data/docs/UpdateAuthMethodCert.md +2 -0
- data/docs/UpdateAuthMethodUniversalIdentity.md +4 -0
- data/docs/UpdateAzureTarget.md +2 -0
- data/docs/UpdateItem.md +3 -1
- data/docs/UpdateRotatedSecret.md +3 -1
- data/docs/UscCreate.md +2 -0
- data/docs/UscDelete.md +4 -0
- data/docs/UscGet.md +4 -0
- data/docs/UscListSecretsOutput.md +3 -1
- data/docs/UscUpdate.md +4 -0
- data/docs/V2Api.md +632 -2
- data/docs/ValidateCertificateChallenge.md +30 -0
- data/docs/ValidateCertificateChallengeOutput.md +24 -0
- data/docs/VaultAddress.md +20 -0
- data/docs/VaultAddressOutput.md +20 -0
- data/docs/WebBastionRdpRecord.md +2 -0
- data/lib/akeyless/api/v2_api.rb +640 -0
- data/lib/akeyless/models/account_general_settings.rb +28 -1
- data/lib/akeyless/models/active_directory_payload.rb +30 -1
- data/lib/akeyless/models/auth.rb +13 -1
- data/lib/akeyless/models/auth_method_create_cert.rb +11 -1
- data/lib/akeyless/models/auth_method_create_universal_identity.rb +25 -1
- data/lib/akeyless/models/auth_method_update_cert.rb +11 -1
- data/lib/akeyless/models/auth_method_update_universal_identity.rb +25 -1
- data/lib/akeyless/models/aws_storage.rb +10 -1
- data/lib/akeyless/models/azure_ad_access_rules.rb +11 -1
- data/lib/akeyless/models/azure_target_details.rb +10 -1
- data/lib/akeyless/models/cert_access_rules.rb +11 -1
- data/lib/akeyless/models/certificate_chain_info.rb +11 -1
- data/lib/akeyless/models/configure.rb +13 -1
- data/lib/akeyless/models/conjur_migration.rb +223 -0
- data/lib/akeyless/models/conjur_payload.rb +241 -0
- data/lib/akeyless/models/create_auth_method_cert.rb +11 -1
- data/lib/akeyless/models/create_auth_method_universal_identity.rb +25 -1
- data/lib/akeyless/models/create_azure_target.rb +13 -1
- data/lib/akeyless/models/create_rotated_secret.rb +12 -4
- data/lib/akeyless/models/create_secret.rb +11 -1
- data/lib/akeyless/models/create_usc.rb +54 -1
- data/lib/akeyless/models/default_auth_method_settings.rb +223 -0
- data/lib/akeyless/models/delete_role_rule.rb +1 -1
- data/lib/akeyless/models/describe_permissions.rb +1 -1
- data/lib/akeyless/models/digi_cert_target_details.rb +333 -0
- data/lib/akeyless/models/ds_producer_details.rb +10 -1
- data/lib/akeyless/models/esm_list_secrets_output.rb +15 -4
- data/lib/akeyless/models/gateway_create_migration.rb +94 -2
- data/lib/akeyless/models/gateway_update_migration.rb +93 -1
- data/lib/akeyless/models/gateway_update_remote_access_rdp_recordings.rb +11 -1
- data/lib/akeyless/models/general_config_part.rb +19 -1
- data/lib/akeyless/models/get_pki_certificate_output.rb +10 -1
- data/lib/akeyless/models/github_metadata.rb +259 -0
- data/lib/akeyless/models/google_trust_target_details.rb +335 -0
- data/lib/akeyless/models/hashi_payload.rb +22 -4
- data/lib/akeyless/models/http_challenge_info.rb +251 -0
- data/lib/akeyless/models/issuer_overview_info.rb +232 -0
- data/lib/akeyless/models/item.rb +10 -1
- data/lib/akeyless/models/item_general_info.rb +10 -1
- data/lib/akeyless/models/item_locking_setting.rb +223 -0
- data/lib/akeyless/models/lock_item.rb +274 -0
- data/lib/akeyless/models/lock_target.rb +274 -0
- data/lib/akeyless/models/locking_info.rb +243 -0
- data/lib/akeyless/models/migration_status_reply_obj.rb +19 -1
- data/lib/akeyless/models/migrations_config_part.rb +12 -1
- data/lib/akeyless/models/netapp_storage.rb +268 -0
- data/lib/akeyless/models/reverse_rbac.rb +1 -1
- data/lib/akeyless/models/rotated_secret_create_aws.rb +12 -4
- data/lib/akeyless/models/rotated_secret_create_azure.rb +12 -4
- data/lib/akeyless/models/rotated_secret_create_custom.rb +12 -4
- data/lib/akeyless/models/rotated_secret_create_ldap.rb +12 -4
- data/lib/akeyless/models/rotated_secret_create_mongodb.rb +12 -4
- data/lib/akeyless/models/rotated_secret_create_mssql.rb +12 -4
- data/lib/akeyless/models/rotated_secret_create_mysql.rb +12 -4
- data/lib/akeyless/models/rotated_secret_create_oracledb.rb +12 -4
- data/lib/akeyless/models/rotated_secret_create_postgresql.rb +12 -4
- data/lib/akeyless/models/rotated_secret_create_redshift.rb +12 -4
- data/lib/akeyless/models/rotated_secret_create_ssh.rb +12 -4
- data/lib/akeyless/models/rotated_secret_create_windows.rb +12 -4
- data/lib/akeyless/models/rotated_secret_update_aws.rb +12 -4
- data/lib/akeyless/models/rotated_secret_update_azure.rb +12 -4
- data/lib/akeyless/models/rotated_secret_update_custom.rb +12 -4
- data/lib/akeyless/models/rotated_secret_update_ldap.rb +12 -4
- data/lib/akeyless/models/rotated_secret_update_mongodb.rb +12 -4
- data/lib/akeyless/models/rotated_secret_update_mssql.rb +12 -4
- data/lib/akeyless/models/rotated_secret_update_mysql.rb +12 -4
- data/lib/akeyless/models/rotated_secret_update_oracledb.rb +12 -4
- data/lib/akeyless/models/rotated_secret_update_postgresql.rb +12 -4
- data/lib/akeyless/models/rotated_secret_update_redshift.rb +12 -4
- data/lib/akeyless/models/rotated_secret_update_ssh.rb +12 -4
- data/lib/akeyless/models/rotated_secret_update_windows.rb +12 -4
- data/lib/akeyless/models/secret_info.rb +19 -1
- data/lib/akeyless/models/secure_remote_access.rb +19 -1
- data/lib/akeyless/models/set_role_rule.rb +1 -1
- data/lib/akeyless/models/sync_counters.rb +233 -0
- data/lib/akeyless/models/target.rb +10 -1
- data/lib/akeyless/models/target_create_azure.rb +13 -1
- data/lib/akeyless/models/target_create_digi_cert.rb +398 -0
- data/lib/akeyless/models/target_create_google_trust.rb +398 -0
- data/lib/akeyless/models/target_create_lets_encrypt.rb +7 -0
- data/lib/akeyless/models/target_create_splunk.rb +11 -1
- data/lib/akeyless/models/target_type_details_input.rb +19 -1
- data/lib/akeyless/models/target_update_azure.rb +13 -1
- data/lib/akeyless/models/target_update_digi_cert.rb +418 -0
- data/lib/akeyless/models/target_update_google_trust.rb +418 -0
- data/lib/akeyless/models/target_update_lets_encrypt.rb +7 -0
- data/lib/akeyless/models/universal_identity_access_rules.rb +19 -1
- data/lib/akeyless/models/unlock_item.rb +254 -0
- data/lib/akeyless/models/unlock_target.rb +254 -0
- data/lib/akeyless/models/update_account_settings.rb +21 -1
- data/lib/akeyless/models/update_auth_method_cert.rb +11 -1
- data/lib/akeyless/models/update_auth_method_universal_identity.rb +25 -1
- data/lib/akeyless/models/update_azure_target.rb +13 -1
- data/lib/akeyless/models/update_item.rb +12 -4
- data/lib/akeyless/models/update_rotated_secret.rb +12 -4
- data/lib/akeyless/models/usc_create.rb +10 -1
- data/lib/akeyless/models/usc_delete.rb +20 -1
- data/lib/akeyless/models/usc_get.rb +20 -1
- data/lib/akeyless/models/usc_list_secrets_output.rb +15 -4
- data/lib/akeyless/models/usc_update.rb +20 -1
- data/lib/akeyless/models/validate_certificate_challenge.rb +279 -0
- data/lib/akeyless/models/validate_certificate_challenge_output.rb +242 -0
- data/lib/akeyless/models/vault_address.rb +227 -0
- data/lib/akeyless/models/vault_address_output.rb +223 -0
- data/lib/akeyless/models/web_bastion_rdp_record.rb +10 -1
- data/lib/akeyless/version.rb +1 -1
- data/lib/akeyless.rb +24 -0
- data/spec/models/conjur_migration_spec.rb +42 -0
- data/spec/models/conjur_payload_spec.rb +54 -0
- data/spec/models/default_auth_method_settings_spec.rb +42 -0
- data/spec/models/digi_cert_target_details_spec.rb +108 -0
- data/spec/models/github_metadata_spec.rb +66 -0
- data/spec/models/google_trust_target_details_spec.rb +108 -0
- data/spec/models/http_challenge_info_spec.rb +60 -0
- data/spec/models/issuer_overview_info_spec.rb +48 -0
- data/spec/models/item_locking_setting_spec.rb +42 -0
- data/spec/models/lock_item_spec.rb +66 -0
- data/spec/models/lock_target_spec.rb +66 -0
- data/spec/models/locking_info_spec.rb +54 -0
- data/spec/models/netapp_storage_spec.rb +72 -0
- data/spec/models/sync_counters_spec.rb +48 -0
- data/spec/models/target_create_digi_cert_spec.rb +132 -0
- data/spec/models/target_create_google_trust_spec.rb +132 -0
- data/spec/models/target_update_digi_cert_spec.rb +144 -0
- data/spec/models/target_update_google_trust_spec.rb +144 -0
- data/spec/models/unlock_item_spec.rb +54 -0
- data/spec/models/unlock_target_spec.rb +54 -0
- data/spec/models/validate_certificate_challenge_output_spec.rb +54 -0
- data/spec/models/validate_certificate_challenge_spec.rb +72 -0
- data/spec/models/vault_address_output_spec.rb +42 -0
- data/spec/models/vault_address_spec.rb +42 -0
- metadata +1233 -1134
|
@@ -19,6 +19,8 @@ module Akeyless
|
|
|
19
19
|
|
|
20
20
|
attr_accessor :azure_client_secret
|
|
21
21
|
|
|
22
|
+
attr_accessor :azure_cloud
|
|
23
|
+
|
|
22
24
|
attr_accessor :azure_resource_group_name
|
|
23
25
|
|
|
24
26
|
attr_accessor :azure_resource_name
|
|
@@ -42,6 +44,7 @@ module Akeyless
|
|
|
42
44
|
{
|
|
43
45
|
:'azure_client_id' => :'azure_client_id',
|
|
44
46
|
:'azure_client_secret' => :'azure_client_secret',
|
|
47
|
+
:'azure_cloud' => :'azure_cloud',
|
|
45
48
|
:'azure_resource_group_name' => :'azure_resource_group_name',
|
|
46
49
|
:'azure_resource_name' => :'azure_resource_name',
|
|
47
50
|
:'azure_subscription_id' => :'azure_subscription_id',
|
|
@@ -64,6 +67,7 @@ module Akeyless
|
|
|
64
67
|
{
|
|
65
68
|
:'azure_client_id' => :'String',
|
|
66
69
|
:'azure_client_secret' => :'String',
|
|
70
|
+
:'azure_cloud' => :'String',
|
|
67
71
|
:'azure_resource_group_name' => :'String',
|
|
68
72
|
:'azure_resource_name' => :'String',
|
|
69
73
|
:'azure_subscription_id' => :'String',
|
|
@@ -105,6 +109,10 @@ module Akeyless
|
|
|
105
109
|
self.azure_client_secret = attributes[:'azure_client_secret']
|
|
106
110
|
end
|
|
107
111
|
|
|
112
|
+
if attributes.key?(:'azure_cloud')
|
|
113
|
+
self.azure_cloud = attributes[:'azure_cloud']
|
|
114
|
+
end
|
|
115
|
+
|
|
108
116
|
if attributes.key?(:'azure_resource_group_name')
|
|
109
117
|
self.azure_resource_group_name = attributes[:'azure_resource_group_name']
|
|
110
118
|
end
|
|
@@ -164,6 +172,7 @@ module Akeyless
|
|
|
164
172
|
self.class == o.class &&
|
|
165
173
|
azure_client_id == o.azure_client_id &&
|
|
166
174
|
azure_client_secret == o.azure_client_secret &&
|
|
175
|
+
azure_cloud == o.azure_cloud &&
|
|
167
176
|
azure_resource_group_name == o.azure_resource_group_name &&
|
|
168
177
|
azure_resource_name == o.azure_resource_name &&
|
|
169
178
|
azure_subscription_id == o.azure_subscription_id &&
|
|
@@ -184,7 +193,7 @@ module Akeyless
|
|
|
184
193
|
# Calculates hash code according to all attributes.
|
|
185
194
|
# @return [Integer] Hash code
|
|
186
195
|
def hash
|
|
187
|
-
[azure_client_id, azure_client_secret, azure_resource_group_name, azure_resource_name, azure_subscription_id, azure_tenant_id, azure_username, connection_type, expiration_date, grace_rotated_secret_key, use_gw_cloud_identity].hash
|
|
196
|
+
[azure_client_id, azure_client_secret, azure_cloud, azure_resource_group_name, azure_resource_name, azure_subscription_id, azure_tenant_id, azure_username, connection_type, expiration_date, grace_rotated_secret_key, use_gw_cloud_identity].hash
|
|
188
197
|
end
|
|
189
198
|
|
|
190
199
|
# Builds the object from hash
|
|
@@ -39,6 +39,9 @@ module Akeyless
|
|
|
39
39
|
# Base64 encdoed PEM certificate
|
|
40
40
|
attr_accessor :certificate
|
|
41
41
|
|
|
42
|
+
# RequireCrlDp indicates whether CRL distribution points are required on the leaf client certificate, and whether CRL validation must be enforced during authentication.
|
|
43
|
+
attr_accessor :require_crl_dp
|
|
44
|
+
|
|
42
45
|
# A list of revoked cert ids
|
|
43
46
|
attr_accessor :revoked_cert_ids
|
|
44
47
|
|
|
@@ -56,6 +59,7 @@ module Akeyless
|
|
|
56
59
|
:'bound_organizational_units' => :'bound_organizational_units',
|
|
57
60
|
:'bound_uri_sans' => :'bound_uri_sans',
|
|
58
61
|
:'certificate' => :'certificate',
|
|
62
|
+
:'require_crl_dp' => :'require_crl_dp',
|
|
59
63
|
:'revoked_cert_ids' => :'revoked_cert_ids',
|
|
60
64
|
:'unique_identifier' => :'unique_identifier'
|
|
61
65
|
}
|
|
@@ -77,6 +81,7 @@ module Akeyless
|
|
|
77
81
|
:'bound_organizational_units' => :'Array<String>',
|
|
78
82
|
:'bound_uri_sans' => :'Array<String>',
|
|
79
83
|
:'certificate' => :'String',
|
|
84
|
+
:'require_crl_dp' => :'Boolean',
|
|
80
85
|
:'revoked_cert_ids' => :'Array<String>',
|
|
81
86
|
:'unique_identifier' => :'String'
|
|
82
87
|
}
|
|
@@ -149,6 +154,10 @@ module Akeyless
|
|
|
149
154
|
self.certificate = attributes[:'certificate']
|
|
150
155
|
end
|
|
151
156
|
|
|
157
|
+
if attributes.key?(:'require_crl_dp')
|
|
158
|
+
self.require_crl_dp = attributes[:'require_crl_dp']
|
|
159
|
+
end
|
|
160
|
+
|
|
152
161
|
if attributes.key?(:'revoked_cert_ids')
|
|
153
162
|
if (value = attributes[:'revoked_cert_ids']).is_a?(Array)
|
|
154
163
|
self.revoked_cert_ids = value
|
|
@@ -188,6 +197,7 @@ module Akeyless
|
|
|
188
197
|
bound_organizational_units == o.bound_organizational_units &&
|
|
189
198
|
bound_uri_sans == o.bound_uri_sans &&
|
|
190
199
|
certificate == o.certificate &&
|
|
200
|
+
require_crl_dp == o.require_crl_dp &&
|
|
191
201
|
revoked_cert_ids == o.revoked_cert_ids &&
|
|
192
202
|
unique_identifier == o.unique_identifier
|
|
193
203
|
end
|
|
@@ -201,7 +211,7 @@ module Akeyless
|
|
|
201
211
|
# Calculates hash code according to all attributes.
|
|
202
212
|
# @return [Integer] Hash code
|
|
203
213
|
def hash
|
|
204
|
-
[allowed_cors, bound_common_names, bound_dns_sans, bound_email_sans, bound_extensions, bound_organizational_units, bound_uri_sans, certificate, revoked_cert_ids, unique_identifier].hash
|
|
214
|
+
[allowed_cors, bound_common_names, bound_dns_sans, bound_email_sans, bound_extensions, bound_organizational_units, bound_uri_sans, certificate, require_crl_dp, revoked_cert_ids, unique_identifier].hash
|
|
205
215
|
end
|
|
206
216
|
|
|
207
217
|
# Builds the object from hash
|
|
@@ -37,6 +37,9 @@ module Akeyless
|
|
|
37
37
|
|
|
38
38
|
attr_accessor :common_name
|
|
39
39
|
|
|
40
|
+
# CSRPEM contains the PEM-encoded CSR for pending certificates (HTTP-01 challenge)
|
|
41
|
+
attr_accessor :csr_pem
|
|
42
|
+
|
|
40
43
|
attr_accessor :error_message
|
|
41
44
|
|
|
42
45
|
attr_accessor :expiration_date
|
|
@@ -65,6 +68,7 @@ module Akeyless
|
|
|
65
68
|
:'certificate_pem' => :'certificate_pem',
|
|
66
69
|
:'certificate_status' => :'certificate_status',
|
|
67
70
|
:'common_name' => :'common_name',
|
|
71
|
+
:'csr_pem' => :'csr_pem',
|
|
68
72
|
:'error_message' => :'error_message',
|
|
69
73
|
:'expiration_date' => :'expiration_date',
|
|
70
74
|
:'expiration_events' => :'expiration_events',
|
|
@@ -94,6 +98,7 @@ module Akeyless
|
|
|
94
98
|
:'certificate_pem' => :'String',
|
|
95
99
|
:'certificate_status' => :'String',
|
|
96
100
|
:'common_name' => :'String',
|
|
101
|
+
:'csr_pem' => :'String',
|
|
97
102
|
:'error_message' => :'String',
|
|
98
103
|
:'expiration_date' => :'Time',
|
|
99
104
|
:'expiration_events' => :'Array<CertificateExpirationEvent>',
|
|
@@ -171,6 +176,10 @@ module Akeyless
|
|
|
171
176
|
self.common_name = attributes[:'common_name']
|
|
172
177
|
end
|
|
173
178
|
|
|
179
|
+
if attributes.key?(:'csr_pem')
|
|
180
|
+
self.csr_pem = attributes[:'csr_pem']
|
|
181
|
+
end
|
|
182
|
+
|
|
174
183
|
if attributes.key?(:'error_message')
|
|
175
184
|
self.error_message = attributes[:'error_message']
|
|
176
185
|
end
|
|
@@ -233,6 +242,7 @@ module Akeyless
|
|
|
233
242
|
certificate_pem == o.certificate_pem &&
|
|
234
243
|
certificate_status == o.certificate_status &&
|
|
235
244
|
common_name == o.common_name &&
|
|
245
|
+
csr_pem == o.csr_pem &&
|
|
236
246
|
error_message == o.error_message &&
|
|
237
247
|
expiration_date == o.expiration_date &&
|
|
238
248
|
expiration_events == o.expiration_events &&
|
|
@@ -251,7 +261,7 @@ module Akeyless
|
|
|
251
261
|
# Calculates hash code according to all attributes.
|
|
252
262
|
# @return [Integer] Hash code
|
|
253
263
|
def hash
|
|
254
|
-
[auto_renew_certificate, certificate_chain, certificate_format, certificate_has_private_key, certificate_issuer_gw_cluster_id, certificate_issuer_gw_cluster_url, certificate_issuer_item_id, certificate_issuer_name, certificate_pem, certificate_status, common_name, error_message, expiration_date, expiration_events, external_ca_id, issuance_status, not_before, renew_before_expiration_in_days].hash
|
|
264
|
+
[auto_renew_certificate, certificate_chain, certificate_format, certificate_has_private_key, certificate_issuer_gw_cluster_id, certificate_issuer_gw_cluster_url, certificate_issuer_item_id, certificate_issuer_name, certificate_pem, certificate_status, common_name, csr_pem, error_message, expiration_date, expiration_events, external_ca_id, issuance_status, not_before, renew_before_expiration_in_days].hash
|
|
255
265
|
end
|
|
256
266
|
|
|
257
267
|
# Builds the object from hash
|
|
@@ -36,6 +36,9 @@ module Akeyless
|
|
|
36
36
|
# Azure Active Directory ObjectId (relevant only for access-type=azure_ad)
|
|
37
37
|
attr_accessor :azure_ad_object_id
|
|
38
38
|
|
|
39
|
+
# Azure cloud environment to use. Values: AzureCloud (default), AzureUSGovernment, AzureChinaCloud.
|
|
40
|
+
attr_accessor :azure_cloud
|
|
41
|
+
|
|
39
42
|
# Certificate data encoded in base64. Used if file was not provided. (relevant only for access-type=cert in Curl Context)
|
|
40
43
|
attr_accessor :cert_data
|
|
41
44
|
|
|
@@ -97,6 +100,7 @@ module Akeyless
|
|
|
97
100
|
:'admin_email' => :'admin-email',
|
|
98
101
|
:'admin_password' => :'admin-password',
|
|
99
102
|
:'azure_ad_object_id' => :'azure-ad-object-id',
|
|
103
|
+
:'azure_cloud' => :'azure-cloud',
|
|
100
104
|
:'cert_data' => :'cert-data',
|
|
101
105
|
:'cert_issuer_name' => :'cert-issuer-name',
|
|
102
106
|
:'cert_username' => :'cert-username',
|
|
@@ -132,6 +136,7 @@ module Akeyless
|
|
|
132
136
|
:'admin_email' => :'String',
|
|
133
137
|
:'admin_password' => :'String',
|
|
134
138
|
:'azure_ad_object_id' => :'String',
|
|
139
|
+
:'azure_cloud' => :'String',
|
|
135
140
|
:'cert_data' => :'String',
|
|
136
141
|
:'cert_issuer_name' => :'String',
|
|
137
142
|
:'cert_username' => :'String',
|
|
@@ -203,6 +208,12 @@ module Akeyless
|
|
|
203
208
|
self.azure_ad_object_id = attributes[:'azure_ad_object_id']
|
|
204
209
|
end
|
|
205
210
|
|
|
211
|
+
if attributes.key?(:'azure_cloud')
|
|
212
|
+
self.azure_cloud = attributes[:'azure_cloud']
|
|
213
|
+
else
|
|
214
|
+
self.azure_cloud = 'AzureCloud'
|
|
215
|
+
end
|
|
216
|
+
|
|
206
217
|
if attributes.key?(:'cert_data')
|
|
207
218
|
self.cert_data = attributes[:'cert_data']
|
|
208
219
|
end
|
|
@@ -307,6 +318,7 @@ module Akeyless
|
|
|
307
318
|
admin_email == o.admin_email &&
|
|
308
319
|
admin_password == o.admin_password &&
|
|
309
320
|
azure_ad_object_id == o.azure_ad_object_id &&
|
|
321
|
+
azure_cloud == o.azure_cloud &&
|
|
310
322
|
cert_data == o.cert_data &&
|
|
311
323
|
cert_issuer_name == o.cert_issuer_name &&
|
|
312
324
|
cert_username == o.cert_username &&
|
|
@@ -335,7 +347,7 @@ module Akeyless
|
|
|
335
347
|
# Calculates hash code according to all attributes.
|
|
336
348
|
# @return [Integer] Hash code
|
|
337
349
|
def hash
|
|
338
|
-
[access_id, access_key, access_type, account_id, admin_email, admin_password, azure_ad_object_id, cert_data, cert_issuer_name, cert_username, default_location_prefix, disable_pafxfast, gateway_spn, gcp_audience, json, k8s_auth_config_name, kerberos_token, kerberos_username, key_data, keytab_data, krb5_conf_data, legacy_signing_alg_name, oci_auth_type, oci_group_ocid].hash
|
|
350
|
+
[access_id, access_key, access_type, account_id, admin_email, admin_password, azure_ad_object_id, azure_cloud, cert_data, cert_issuer_name, cert_username, default_location_prefix, disable_pafxfast, gateway_spn, gcp_audience, json, k8s_auth_config_name, kerberos_token, kerberos_username, key_data, keytab_data, krb5_conf_data, legacy_signing_alg_name, oci_auth_type, oci_group_ocid].hash
|
|
339
351
|
end
|
|
340
352
|
|
|
341
353
|
# Builds the object from hash
|
|
@@ -0,0 +1,223 @@
|
|
|
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 ConjurMigration
|
|
18
|
+
attr_accessor :general
|
|
19
|
+
|
|
20
|
+
attr_accessor :payload
|
|
21
|
+
|
|
22
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
23
|
+
def self.attribute_map
|
|
24
|
+
{
|
|
25
|
+
:'general' => :'general',
|
|
26
|
+
:'payload' => :'payload'
|
|
27
|
+
}
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# Returns all the JSON keys this model knows about
|
|
31
|
+
def self.acceptable_attributes
|
|
32
|
+
attribute_map.values
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# Attribute type mapping.
|
|
36
|
+
def self.openapi_types
|
|
37
|
+
{
|
|
38
|
+
:'general' => :'MigrationGeneral',
|
|
39
|
+
:'payload' => :'ConjurPayload'
|
|
40
|
+
}
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# List of attributes with nullable: true
|
|
44
|
+
def self.openapi_nullable
|
|
45
|
+
Set.new([
|
|
46
|
+
])
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# Initializes the object
|
|
50
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
51
|
+
def initialize(attributes = {})
|
|
52
|
+
if (!attributes.is_a?(Hash))
|
|
53
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Akeyless::ConjurMigration` initialize method"
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
57
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
58
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
59
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Akeyless::ConjurMigration`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
60
|
+
end
|
|
61
|
+
h[k.to_sym] = v
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if attributes.key?(:'general')
|
|
65
|
+
self.general = attributes[:'general']
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
if attributes.key?(:'payload')
|
|
69
|
+
self.payload = attributes[:'payload']
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
74
|
+
# @return Array for valid properties with the reasons
|
|
75
|
+
def list_invalid_properties
|
|
76
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
77
|
+
invalid_properties = Array.new
|
|
78
|
+
invalid_properties
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
# Check to see if the all the properties in the model are valid
|
|
82
|
+
# @return true if the model is valid
|
|
83
|
+
def valid?
|
|
84
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
85
|
+
true
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# Checks equality by comparing each attribute.
|
|
89
|
+
# @param [Object] Object to be compared
|
|
90
|
+
def ==(o)
|
|
91
|
+
return true if self.equal?(o)
|
|
92
|
+
self.class == o.class &&
|
|
93
|
+
general == o.general &&
|
|
94
|
+
payload == o.payload
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
# @see the `==` method
|
|
98
|
+
# @param [Object] Object to be compared
|
|
99
|
+
def eql?(o)
|
|
100
|
+
self == o
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
# Calculates hash code according to all attributes.
|
|
104
|
+
# @return [Integer] Hash code
|
|
105
|
+
def hash
|
|
106
|
+
[general, payload].hash
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# Builds the object from hash
|
|
110
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
111
|
+
# @return [Object] Returns the model itself
|
|
112
|
+
def self.build_from_hash(attributes)
|
|
113
|
+
return nil unless attributes.is_a?(Hash)
|
|
114
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
115
|
+
transformed_hash = {}
|
|
116
|
+
openapi_types.each_pair do |key, type|
|
|
117
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
118
|
+
transformed_hash["#{key}"] = nil
|
|
119
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
120
|
+
# check to ensure the input is an array given that the attribute
|
|
121
|
+
# is documented as an array but the input is not
|
|
122
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
123
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
124
|
+
end
|
|
125
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
126
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
127
|
+
end
|
|
128
|
+
end
|
|
129
|
+
new(transformed_hash)
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
# Deserializes the data based on type
|
|
133
|
+
# @param string type Data type
|
|
134
|
+
# @param string value Value to be deserialized
|
|
135
|
+
# @return [Object] Deserialized data
|
|
136
|
+
def self._deserialize(type, value)
|
|
137
|
+
case type.to_sym
|
|
138
|
+
when :Time
|
|
139
|
+
Time.parse(value)
|
|
140
|
+
when :Date
|
|
141
|
+
Date.parse(value)
|
|
142
|
+
when :String
|
|
143
|
+
value.to_s
|
|
144
|
+
when :Integer
|
|
145
|
+
value.to_i
|
|
146
|
+
when :Float
|
|
147
|
+
value.to_f
|
|
148
|
+
when :Boolean
|
|
149
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
150
|
+
true
|
|
151
|
+
else
|
|
152
|
+
false
|
|
153
|
+
end
|
|
154
|
+
when :Object
|
|
155
|
+
# generic object (usually a Hash), return directly
|
|
156
|
+
value
|
|
157
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
158
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
159
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
160
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
161
|
+
k_type = Regexp.last_match[:k_type]
|
|
162
|
+
v_type = Regexp.last_match[:v_type]
|
|
163
|
+
{}.tap do |hash|
|
|
164
|
+
value.each do |k, v|
|
|
165
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
166
|
+
end
|
|
167
|
+
end
|
|
168
|
+
else # model
|
|
169
|
+
# models (e.g. Pet) or oneOf
|
|
170
|
+
klass = Akeyless.const_get(type)
|
|
171
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
172
|
+
end
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
# Returns the string representation of the object
|
|
176
|
+
# @return [String] String presentation of the object
|
|
177
|
+
def to_s
|
|
178
|
+
to_hash.to_s
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
182
|
+
# @return [Hash] Returns the object in the form of hash
|
|
183
|
+
def to_body
|
|
184
|
+
to_hash
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
# Returns the object in the form of hash
|
|
188
|
+
# @return [Hash] Returns the object in the form of hash
|
|
189
|
+
def to_hash
|
|
190
|
+
hash = {}
|
|
191
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
192
|
+
value = self.send(attr)
|
|
193
|
+
if value.nil?
|
|
194
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
195
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
hash[param] = _to_hash(value)
|
|
199
|
+
end
|
|
200
|
+
hash
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
# Outputs non-array value in the form of hash
|
|
204
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
205
|
+
# @param [Object] value Any valid value
|
|
206
|
+
# @return [Hash] Returns the value in the form of hash
|
|
207
|
+
def _to_hash(value)
|
|
208
|
+
if value.is_a?(Array)
|
|
209
|
+
value.compact.map { |v| _to_hash(v) }
|
|
210
|
+
elsif value.is_a?(Hash)
|
|
211
|
+
{}.tap do |hash|
|
|
212
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
213
|
+
end
|
|
214
|
+
elsif value.respond_to? :to_hash
|
|
215
|
+
value.to_hash
|
|
216
|
+
else
|
|
217
|
+
value
|
|
218
|
+
end
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
end
|
|
222
|
+
|
|
223
|
+
end
|
|
@@ -0,0 +1,241 @@
|
|
|
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 ConjurPayload
|
|
18
|
+
attr_accessor :conjur_account
|
|
19
|
+
|
|
20
|
+
attr_accessor :conjur_api_key
|
|
21
|
+
|
|
22
|
+
attr_accessor :conjur_url
|
|
23
|
+
|
|
24
|
+
attr_accessor :conjur_username
|
|
25
|
+
|
|
26
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
27
|
+
def self.attribute_map
|
|
28
|
+
{
|
|
29
|
+
:'conjur_account' => :'conjur_account',
|
|
30
|
+
:'conjur_api_key' => :'conjur_api_key',
|
|
31
|
+
:'conjur_url' => :'conjur_url',
|
|
32
|
+
:'conjur_username' => :'conjur_username'
|
|
33
|
+
}
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Returns all the JSON keys this model knows about
|
|
37
|
+
def self.acceptable_attributes
|
|
38
|
+
attribute_map.values
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Attribute type mapping.
|
|
42
|
+
def self.openapi_types
|
|
43
|
+
{
|
|
44
|
+
:'conjur_account' => :'String',
|
|
45
|
+
:'conjur_api_key' => :'String',
|
|
46
|
+
:'conjur_url' => :'String',
|
|
47
|
+
:'conjur_username' => :'String'
|
|
48
|
+
}
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# List of attributes with nullable: true
|
|
52
|
+
def self.openapi_nullable
|
|
53
|
+
Set.new([
|
|
54
|
+
])
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# Initializes the object
|
|
58
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
59
|
+
def initialize(attributes = {})
|
|
60
|
+
if (!attributes.is_a?(Hash))
|
|
61
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Akeyless::ConjurPayload` initialize method"
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
65
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
66
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
67
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Akeyless::ConjurPayload`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
68
|
+
end
|
|
69
|
+
h[k.to_sym] = v
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if attributes.key?(:'conjur_account')
|
|
73
|
+
self.conjur_account = attributes[:'conjur_account']
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
if attributes.key?(:'conjur_api_key')
|
|
77
|
+
self.conjur_api_key = attributes[:'conjur_api_key']
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
if attributes.key?(:'conjur_url')
|
|
81
|
+
self.conjur_url = attributes[:'conjur_url']
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
if attributes.key?(:'conjur_username')
|
|
85
|
+
self.conjur_username = attributes[:'conjur_username']
|
|
86
|
+
end
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
90
|
+
# @return Array for valid properties with the reasons
|
|
91
|
+
def list_invalid_properties
|
|
92
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
93
|
+
invalid_properties = Array.new
|
|
94
|
+
invalid_properties
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
# Check to see if the all the properties in the model are valid
|
|
98
|
+
# @return true if the model is valid
|
|
99
|
+
def valid?
|
|
100
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
101
|
+
true
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
# Checks equality by comparing each attribute.
|
|
105
|
+
# @param [Object] Object to be compared
|
|
106
|
+
def ==(o)
|
|
107
|
+
return true if self.equal?(o)
|
|
108
|
+
self.class == o.class &&
|
|
109
|
+
conjur_account == o.conjur_account &&
|
|
110
|
+
conjur_api_key == o.conjur_api_key &&
|
|
111
|
+
conjur_url == o.conjur_url &&
|
|
112
|
+
conjur_username == o.conjur_username
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
# @see the `==` method
|
|
116
|
+
# @param [Object] Object to be compared
|
|
117
|
+
def eql?(o)
|
|
118
|
+
self == o
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
# Calculates hash code according to all attributes.
|
|
122
|
+
# @return [Integer] Hash code
|
|
123
|
+
def hash
|
|
124
|
+
[conjur_account, conjur_api_key, conjur_url, conjur_username].hash
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
# Builds the object from hash
|
|
128
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
129
|
+
# @return [Object] Returns the model itself
|
|
130
|
+
def self.build_from_hash(attributes)
|
|
131
|
+
return nil unless attributes.is_a?(Hash)
|
|
132
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
133
|
+
transformed_hash = {}
|
|
134
|
+
openapi_types.each_pair do |key, type|
|
|
135
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
136
|
+
transformed_hash["#{key}"] = nil
|
|
137
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
138
|
+
# check to ensure the input is an array given that the attribute
|
|
139
|
+
# is documented as an array but the input is not
|
|
140
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
141
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
142
|
+
end
|
|
143
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
144
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
145
|
+
end
|
|
146
|
+
end
|
|
147
|
+
new(transformed_hash)
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
# Deserializes the data based on type
|
|
151
|
+
# @param string type Data type
|
|
152
|
+
# @param string value Value to be deserialized
|
|
153
|
+
# @return [Object] Deserialized data
|
|
154
|
+
def self._deserialize(type, value)
|
|
155
|
+
case type.to_sym
|
|
156
|
+
when :Time
|
|
157
|
+
Time.parse(value)
|
|
158
|
+
when :Date
|
|
159
|
+
Date.parse(value)
|
|
160
|
+
when :String
|
|
161
|
+
value.to_s
|
|
162
|
+
when :Integer
|
|
163
|
+
value.to_i
|
|
164
|
+
when :Float
|
|
165
|
+
value.to_f
|
|
166
|
+
when :Boolean
|
|
167
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
168
|
+
true
|
|
169
|
+
else
|
|
170
|
+
false
|
|
171
|
+
end
|
|
172
|
+
when :Object
|
|
173
|
+
# generic object (usually a Hash), return directly
|
|
174
|
+
value
|
|
175
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
176
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
177
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
178
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
179
|
+
k_type = Regexp.last_match[:k_type]
|
|
180
|
+
v_type = Regexp.last_match[:v_type]
|
|
181
|
+
{}.tap do |hash|
|
|
182
|
+
value.each do |k, v|
|
|
183
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
184
|
+
end
|
|
185
|
+
end
|
|
186
|
+
else # model
|
|
187
|
+
# models (e.g. Pet) or oneOf
|
|
188
|
+
klass = Akeyless.const_get(type)
|
|
189
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
190
|
+
end
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
# Returns the string representation of the object
|
|
194
|
+
# @return [String] String presentation of the object
|
|
195
|
+
def to_s
|
|
196
|
+
to_hash.to_s
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
200
|
+
# @return [Hash] Returns the object in the form of hash
|
|
201
|
+
def to_body
|
|
202
|
+
to_hash
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
# Returns the object in the form of hash
|
|
206
|
+
# @return [Hash] Returns the object in the form of hash
|
|
207
|
+
def to_hash
|
|
208
|
+
hash = {}
|
|
209
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
210
|
+
value = self.send(attr)
|
|
211
|
+
if value.nil?
|
|
212
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
213
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
hash[param] = _to_hash(value)
|
|
217
|
+
end
|
|
218
|
+
hash
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
# Outputs non-array value in the form of hash
|
|
222
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
223
|
+
# @param [Object] value Any valid value
|
|
224
|
+
# @return [Hash] Returns the value in the form of hash
|
|
225
|
+
def _to_hash(value)
|
|
226
|
+
if value.is_a?(Array)
|
|
227
|
+
value.compact.map { |v| _to_hash(v) }
|
|
228
|
+
elsif value.is_a?(Hash)
|
|
229
|
+
{}.tap do |hash|
|
|
230
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
231
|
+
end
|
|
232
|
+
elsif value.respond_to? :to_hash
|
|
233
|
+
value.to_hash
|
|
234
|
+
else
|
|
235
|
+
value
|
|
236
|
+
end
|
|
237
|
+
end
|
|
238
|
+
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
end
|