// <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>
    /// CustomResourceColumnDefinition specifies a column for server side
    /// printing.
    /// </summary>
    public partial class V1beta1CustomResourceColumnDefinition
    {
        /// <summary>
        /// Initializes a new instance of the
        /// V1beta1CustomResourceColumnDefinition class.
        /// </summary>
        public V1beta1CustomResourceColumnDefinition()
        {
            CustomInit();
        }

        /// <summary>
        /// Initializes a new instance of the
        /// V1beta1CustomResourceColumnDefinition class.
        /// </summary>
        /// <param name="jSONPath">JSONPath is a simple JSON path, i.e. with
        /// array notation.</param>
        /// <param name="name">name is a human readable name for the
        /// column.</param>
        /// <param name="type">type is an OpenAPI type definition for this
        /// column. See
        /// https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types
        /// for more.</param>
        /// <param name="description">description is a human readable
        /// description of this column.</param>
        /// <param name="format">format is an optional OpenAPI type definition
        /// for this column. The 'name' format is applied to the primary
        /// identifier column to assist in clients identifying column is the
        /// resource name. See
        /// https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types
        /// for more.</param>
        /// <param name="priority">priority is an integer defining the relative
        /// importance of this column compared to others. Lower numbers are
        /// considered higher priority. Columns that may be omitted in limited
        /// space scenarios should be given a higher priority.</param>
        public V1beta1CustomResourceColumnDefinition(string jSONPath, string name, string type, string description = default(string), string format = default(string), int? priority = default(int?))
        {
            JSONPath = jSONPath;
            Description = description;
            Format = format;
            Name = name;
            Priority = priority;
            Type = type;
            CustomInit();
        }

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

        /// <summary>
        /// Gets or sets jSONPath is a simple JSON path, i.e. with array
        /// notation.
        /// </summary>
        [JsonProperty(PropertyName = "JSONPath")]
        public string JSONPath { get; set; }

        /// <summary>
        /// Gets or sets description is a human readable description of this
        /// column.
        /// </summary>
        [JsonProperty(PropertyName = "description")]
        public string Description { get; set; }

        /// <summary>
        /// Gets or sets format is an optional OpenAPI type definition for this
        /// column. The 'name' format is applied to the primary identifier
        /// column to assist in clients identifying column is the resource
        /// name. See
        /// https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types
        /// for more.
        /// </summary>
        [JsonProperty(PropertyName = "format")]
        public string Format { get; set; }

        /// <summary>
        /// Gets or sets name is a human readable name for the column.
        /// </summary>
        [JsonProperty(PropertyName = "name")]
        public string Name { get; set; }

        /// <summary>
        /// Gets or sets priority is an integer defining the relative
        /// importance of this column compared to others. Lower numbers are
        /// considered higher priority. Columns that may be omitted in limited
        /// space scenarios should be given a higher priority.
        /// </summary>
        [JsonProperty(PropertyName = "priority")]
        public int? Priority { get; set; }

        /// <summary>
        /// Gets or sets type is an OpenAPI type definition for this column.
        /// See
        /// https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types
        /// for more.
        /// </summary>
        [JsonProperty(PropertyName = "type")]
        public string Type { get; set; }

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