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

namespace k8s.Models
{
    using Microsoft.Rest;
    using Newtonsoft.Json;
    using System.Linq;

    /// <summary>
    /// TokenRequestStatus is the result of a token request.
    /// </summary>
    public partial class V1TokenRequestStatus
    {
        /// <summary>
        /// Initializes a new instance of the V1TokenRequestStatus class.
        /// </summary>
        public V1TokenRequestStatus()
        {
            CustomInit();
        }

        /// <summary>
        /// Initializes a new instance of the V1TokenRequestStatus class.
        /// </summary>
        /// <param name="expirationTimestamp">ExpirationTimestamp is the time
        /// of expiration of the returned token.</param>
        /// <param name="token">Token is the opaque bearer token.</param>
        public V1TokenRequestStatus(System.DateTime expirationTimestamp, string token)
        {
            ExpirationTimestamp = expirationTimestamp;
            Token = token;
            CustomInit();
        }

        /// <summary>
        /// An initialization method that performs custom operations like setting defaults
        /// </summary>
        partial void CustomInit();

        /// <summary>
        /// Gets or sets expirationTimestamp is the time of expiration of the
        /// returned token.
        /// </summary>
        [JsonProperty(PropertyName = "expirationTimestamp")]
        public System.DateTime ExpirationTimestamp { get; set; }

        /// <summary>
        /// Gets or sets token is the opaque bearer token.
        /// </summary>
        [JsonProperty(PropertyName = "token")]
        public string Token { get; set; }

        /// <summary>
        /// Validate the object.
        /// </summary>
        /// <exception cref="ValidationException">
        /// Thrown if validation fails
        /// </exception>
        public virtual void Validate()
        {
            if (Token == null)
            {
                throw new ValidationException(ValidationRules.CannotBeNull, "Token");
            }
        }
    }
}
