public static VolumePropertiesDataProtection ConvertDataProtectionFromPs(PSNetAppFilesVolumeDataProtection psDataProtection) { var dataProtection = new VolumePropertiesDataProtection(); if (psDataProtection.Replication != null) { var replication = new ReplicationObject(); // replication.ReplicationId = psDataProtection.Replication.ReplicationId; replication.EndpointType = psDataProtection.Replication.EndpointType; replication.ReplicationSchedule = psDataProtection.Replication.ReplicationSchedule; replication.RemoteVolumeResourceId = psDataProtection.Replication.RemoteVolumeResourceId; // replication.RemoteVolumeRegion = psDataProtection.Replication.RemoteVolumeRegion; dataProtection.Replication = replication; } if (psDataProtection.Snapshot != null) { var snapshot = new VolumeSnapshotProperties(); snapshot.SnapshotPolicyId = psDataProtection.Snapshot.SnapshotPolicyId; dataProtection.Snapshot = snapshot; } if (psDataProtection.Backup != null) { var backup = new VolumeBackupProperties(); backup.BackupEnabled = psDataProtection.Backup.BackupEnabled; backup.BackupPolicyId = psDataProtection.Backup.BackupPolicyId; backup.PolicyEnforced = psDataProtection.Backup.PolicyEnforced; dataProtection.Backup = backup; } return(dataProtection); }
public static VolumePatchPropertiesDataProtection ConvertToPatchFromPs(this PSNetAppFilesVolumeDataProtection psDataProtection) { var dataProtection = new VolumePatchPropertiesDataProtection(); if (psDataProtection.Backup != null) { var backup = new VolumeBackupProperties(); backup.BackupEnabled = psDataProtection.Backup.BackupEnabled; backup.BackupPolicyId = psDataProtection.Backup.BackupPolicyId; backup.PolicyEnforced = psDataProtection.Backup.PolicyEnforced; backup.VaultId = psDataProtection.Backup.VaultId; dataProtection.Backup = backup; } return(dataProtection); }