Ejemplo n.º 1
0
        internal static EncryptionProperties DeserializeEncryptionProperties(JsonElement element)
        {
            Optional <EncryptionStatus>   status             = default;
            Optional <KeyVaultProperties> keyVaultProperties = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("status"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    status = new EncryptionStatus(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("keyVaultProperties"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    keyVaultProperties = KeyVaultProperties.DeserializeKeyVaultProperties(property.Value);
                    continue;
                }
            }
            return(new EncryptionProperties(Optional.ToNullable(status), keyVaultProperties.Value));
        }
Ejemplo n.º 2
0
 internal EncryptionProperties(EncryptionStatus?status, KeyVaultProperties keyVaultProperties)
 {
     Status             = status;
     KeyVaultProperties = keyVaultProperties;
 }