// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.

namespace LanBackupAgent.Models
{
    using System;
    using System.Linq;
    using System.Collections.Generic;
    using Newtonsoft.Json;
    using Microsoft.Rest;
    using Microsoft.Rest.Serialization;

    public partial class BackupLog
    {
        /// <summary>
        /// Initializes a new instance of the BackupLog class.
        /// </summary>
        public BackupLog() { }

        /// <summary>
        /// Initializes a new instance of the BackupLog class.
        /// </summary>
        public BackupLog(int? id = default(int?), byte[] rowVersion = default(byte[]), string clientIP = default(string), string configurationID = default(string), string description = default(string), string logError = default(string), string status = default(string), DateTime? dateTime = default(DateTime?))
        {
            Id = id;
            RowVersion = rowVersion;
            ClientIP = clientIP;
            ConfigurationID = configurationID;
            Description = description;
            LogError = logError;
            Status = status;
            DateTime = dateTime;
        }

        /// <summary>
        /// </summary>
        [JsonProperty(PropertyName = "id")]
        public int? Id { get; set; }

        /// <summary>
        /// </summary>
        [JsonProperty(PropertyName = "rowVersion")]
        public byte[] RowVersion { get; set; }

        /// <summary>
        /// </summary>
        [JsonProperty(PropertyName = "clientIP")]
        public string ClientIP { get; set; }

        /// <summary>
        /// </summary>
        [JsonProperty(PropertyName = "configurationID")]
        public string ConfigurationID { get; set; }

        /// <summary>
        /// </summary>
        [JsonProperty(PropertyName = "description")]
        public string Description { get; set; }

        /// <summary>
        /// </summary>
        [JsonProperty(PropertyName = "logError")]
        public string LogError { get; set; }

        /// <summary>
        /// </summary>
        [JsonProperty(PropertyName = "status")]
        public string Status { get; set; }

        /// <summary>
        /// </summary>
        [JsonProperty(PropertyName = "dateTime")]
        public DateTime? DateTime { get; set; }

        /// <summary>
        /// Validate the object. Throws ValidationException if validation fails.
        /// </summary>
        public virtual void Validate()
        {
            if (this.ClientIP != null)
            {
                if (!System.Text.RegularExpressions.Regex.IsMatch(this.ClientIP, "^(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})$"))
                {
                    throw new ValidationException(ValidationRules.Pattern, "ClientIP", "^(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})$");
                }
            }
        }
    }
}
