Beispiel #1
0
        internal static BackupProfile DeserializeBackupProfile(JsonElement element)
        {
            EnableBackup backupEnabled = default;
            Optional <ResourceIdentifier> vaultResourceId = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("backupEnabled"))
                {
                    backupEnabled = new EnableBackup(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("vaultResourceId"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    vaultResourceId = new ResourceIdentifier(property.Value.GetString());
                    continue;
                }
            }
            return(new BackupProfile(backupEnabled, vaultResourceId.Value));
        }
Beispiel #2
0
 internal BackupProfile(EnableBackup backupEnabled, ResourceIdentifier vaultResourceId)
 {
     BackupEnabled   = backupEnabled;
     VaultResourceId = vaultResourceId;
 }
Beispiel #3
0
 public BackupProfile(EnableBackup backupEnabled)
 {
     BackupEnabled = backupEnabled;
 }