/// <summary>
 /// Validate the object.
 /// </summary>
 /// <exception cref="ValidationException">
 /// Thrown if validation fails
 /// </exception>
 public virtual void Validate()
 {
     if (BackupRequestName == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "BackupRequestName");
     }
     if (StorageAccountUrl == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "StorageAccountUrl");
     }
     if (BackupSchedule != null)
     {
         BackupSchedule.Validate();
     }
     if (Databases != null)
     {
         foreach (var element in Databases)
         {
             if (element != null)
             {
                 element.Validate();
             }
         }
     }
 }
Beispiel #2
0
 /// <summary>
 /// Initializes a new instance of the BackupRequestInner class.
 /// </summary>
 /// <param name="storageAccountUrl">SAS URL to the container.</param>
 /// <param name="kind">Kind of resource.</param>
 /// <param name="enabled">True if the backup schedule is enabled (must
 /// be included in that case), false if the backup schedule should be
 /// disabled.</param>
 /// <param name="backupSchedule">Schedule for the backup if it is
 /// executed periodically.</param>
 /// <param name="databases">Databases included in the backup.</param>
 public BackupRequestInner(string storageAccountUrl, string id = default(string), string name = default(string), string type = default(string), string kind = default(string), bool?enabled = default(bool?), BackupSchedule backupSchedule = default(BackupSchedule), IList <DatabaseBackupSetting> databases = default(IList <DatabaseBackupSetting>))
     : base(id, name, type, kind)
 {
     Enabled           = enabled;
     StorageAccountUrl = storageAccountUrl;
     BackupSchedule    = backupSchedule;
     Databases         = databases;
     CustomInit();
 }
 /// <summary>
 /// Initializes a new instance of the BackupRequestInner class.
 /// </summary>
 /// <param name="id">Resource Id.</param>
 /// <param name="name">Resource Name.</param>
 /// <param name="kind">Kind of resource.</param>
 /// <param name="type">Resource type.</param>
 /// <param name="backupRequestName">Name of the backup.</param>
 /// <param name="enabled">True if the backup schedule is enabled (must
 /// be included in that case), false if the backup schedule should be
 /// disabled.</param>
 /// <param name="storageAccountUrl">SAS URL to the container.</param>
 /// <param name="backupSchedule">Schedule for the backup if it is
 /// executed periodically.</param>
 /// <param name="databases">Databases included in the backup.</param>
 /// <param name="backupRequestType">Type of the backup. Possible values
 /// include: 'Default', 'Clone', 'Relocation', 'Snapshot'</param>
 public BackupRequestInner(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string backupRequestName = default(string), bool?enabled = default(bool?), string storageAccountUrl = default(string), BackupSchedule backupSchedule = default(BackupSchedule), IList <DatabaseBackupSetting> databases = default(IList <DatabaseBackupSetting>), BackupRestoreOperationType?backupRequestType = default(BackupRestoreOperationType?))
     : base(id, name, kind, type)
 {
     BackupRequestName = backupRequestName;
     Enabled           = enabled;
     StorageAccountUrl = storageAccountUrl;
     BackupSchedule    = backupSchedule;
     Databases         = databases;
     BackupRequestType = backupRequestType;
     CustomInit();
 }
 /// <summary>
 /// Validate the object.
 /// </summary>
 /// <exception cref="ValidationException">
 /// Thrown if validation fails
 /// </exception>
 public virtual void Validate()
 {
     if (BackupSchedule != null)
     {
         BackupSchedule.Validate();
     }
     if (Databases != null)
     {
         foreach (var element in Databases)
         {
             if (element != null)
             {
                 element.Validate();
             }
         }
     }
 }