// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for
// license information.
// 
// Code generated by Microsoft (R) AutoRest Code Generator 0.14.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.

namespace Microsoft.Azure.Management.WebSites.Models
{
    using System;
    using System.Linq;
    using System.Collections.Generic;
    using Newtonsoft.Json;
    using Microsoft.Rest;
    using Microsoft.Rest.Serialization;
    using Microsoft.Rest.Azure;

    /// <summary>
    /// Description of a backup which will be performed
    /// </summary>
    public partial class BackupRequest : Resource
    {
        /// <summary>
        /// Initializes a new instance of the BackupRequest class.
        /// </summary>
        public BackupRequest() { }

        /// <summary>
        /// Initializes a new instance of the BackupRequest class.
        /// </summary>
        public BackupRequest(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary<string, string> tags = default(IDictionary<string, 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(location, id, name, type, tags)
        {
            BackupRequestName = backupRequestName;
            Enabled = enabled;
            StorageAccountUrl = storageAccountUrl;
            BackupSchedule = backupSchedule;
            Databases = databases;
            BackupRequestType = backupRequestType;
        }

        /// <summary>
        /// Name of the backup
        /// </summary>
        [JsonProperty(PropertyName = "properties.name")]
        public string BackupRequestName { get; set; }

        /// <summary>
        /// True if the backup schedule is enabled (must be included in that
        /// case), false if the backup schedule should be disabled
        /// </summary>
        [JsonProperty(PropertyName = "properties.enabled")]
        public bool? Enabled { get; set; }

        /// <summary>
        /// SAS URL to the container
        /// </summary>
        [JsonProperty(PropertyName = "properties.storageAccountUrl")]
        public string StorageAccountUrl { get; set; }

        /// <summary>
        /// Schedule for the backup if it is executed periodically
        /// </summary>
        [JsonProperty(PropertyName = "properties.backupSchedule")]
        public BackupSchedule BackupSchedule { get; set; }

        /// <summary>
        /// Databases included in the backup
        /// </summary>
        [JsonProperty(PropertyName = "properties.databases")]
        public IList<DatabaseBackupSetting> Databases { get; set; }

        /// <summary>
        /// Type of the backup. Possible values for this property include:
        /// 'Default', 'Clone', 'Relocation'.
        /// </summary>
        [JsonProperty(PropertyName = "properties.type")]
        public BackupRestoreOperationType? BackupRequestType { get; set; }

        /// <summary>
        /// Validate the object. Throws ValidationException if validation fails.
        /// </summary>
        public override void Validate()
        {
            base.Validate();
            if (this.BackupSchedule != null)
            {
                this.BackupSchedule.Validate();
            }
        }
    }
}
