// <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 Newtonsoft.Json;
    using System.Linq;

    /// <summary>
    /// Event is a report of an event somewhere in the cluster. It generally
    /// denotes some state change in the system. Events have a limited
    /// retention time and triggers and messages may evolve with time.  Event
    /// consumers should not rely on the timing of an event with a given Reason
    /// reflecting a consistent underlying trigger, or the continued existence
    /// of events with that Reason.  Events should be treated as informative,
    /// best-effort, supplemental data.
    /// </summary>
    public partial class V1beta1Event
    {
        /// <summary>
        /// Initializes a new instance of the V1beta1Event class.
        /// </summary>
        public V1beta1Event()
        {
            CustomInit();
        }

        /// <summary>
        /// Initializes a new instance of the V1beta1Event class.
        /// </summary>
        /// <param name="eventTime">eventTime is the time when this Event was
        /// first observed. It is required.</param>
        /// <param name="action">action is what action was taken/failed
        /// regarding to the regarding object. It is machine-readable. This
        /// field can have at most 128 characters.</param>
        /// <param name="apiVersion">APIVersion defines the versioned schema of
        /// this representation of an object. Servers should convert recognized
        /// schemas to the latest internal value, and may reject unrecognized
        /// values. More info:
        /// https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources</param>
        /// <param name="deprecatedCount">deprecatedCount is the deprecated
        /// field assuring backward compatibility with core.v1 Event
        /// type.</param>
        /// <param name="deprecatedFirstTimestamp">deprecatedFirstTimestamp is
        /// the deprecated field assuring backward compatibility with core.v1
        /// Event type.</param>
        /// <param name="deprecatedLastTimestamp">deprecatedLastTimestamp is
        /// the deprecated field assuring backward compatibility with core.v1
        /// Event type.</param>
        /// <param name="deprecatedSource">deprecatedSource is the deprecated
        /// field assuring backward compatibility with core.v1 Event
        /// type.</param>
        /// <param name="kind">Kind is a string value representing the REST
        /// resource this object represents. Servers may infer this from the
        /// endpoint the client submits requests to. Cannot be updated. In
        /// CamelCase. More info:
        /// https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds</param>
        /// <param name="metadata">Standard object's metadata. More info:
        /// https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata</param>
        /// <param name="note">note is a human-readable description of the
        /// status of this operation. Maximal length of the note is 1kB, but
        /// libraries should be prepared to handle values up to 64kB.</param>
        /// <param name="reason">reason is why the action was taken. It is
        /// human-readable. This field can have at most 128 characters.</param>
        /// <param name="regarding">regarding contains the object this Event is
        /// about. In most cases it's an Object reporting controller
        /// implements, e.g. ReplicaSetController implements ReplicaSets and
        /// this event is emitted because it acts on some changes in a
        /// ReplicaSet object.</param>
        /// <param name="related">related is the optional secondary object for
        /// more complex actions. E.g. when regarding object triggers a
        /// creation or deletion of related object.</param>
        /// <param name="reportingController">reportingController is the name
        /// of the controller that emitted this Event, e.g.
        /// `kubernetes.io/kubelet`. This field cannot be empty for new
        /// Events.</param>
        /// <param name="reportingInstance">reportingInstance is the ID of the
        /// controller instance, e.g. `kubelet-xyzf`. This field cannot be
        /// empty for new Events and it can have at most 128
        /// characters.</param>
        /// <param name="series">series is data about the Event series this
        /// event represents or nil if it's a singleton Event.</param>
        /// <param name="type">type is the type of this event (Normal,
        /// Warning), new types could be added in the future. It is
        /// machine-readable.</param>
        public V1beta1Event(System.DateTime eventTime, string action = default(string), string apiVersion = default(string), int? deprecatedCount = default(int?), System.DateTime? deprecatedFirstTimestamp = default(System.DateTime?), System.DateTime? deprecatedLastTimestamp = default(System.DateTime?), V1EventSource deprecatedSource = default(V1EventSource), string kind = default(string), V1ObjectMeta metadata = default(V1ObjectMeta), string note = default(string), string reason = default(string), V1ObjectReference regarding = default(V1ObjectReference), V1ObjectReference related = default(V1ObjectReference), string reportingController = default(string), string reportingInstance = default(string), V1beta1EventSeries series = default(V1beta1EventSeries), string type = default(string))
        {
            Action = action;
            ApiVersion = apiVersion;
            DeprecatedCount = deprecatedCount;
            DeprecatedFirstTimestamp = deprecatedFirstTimestamp;
            DeprecatedLastTimestamp = deprecatedLastTimestamp;
            DeprecatedSource = deprecatedSource;
            EventTime = eventTime;
            Kind = kind;
            Metadata = metadata;
            Note = note;
            Reason = reason;
            Regarding = regarding;
            Related = related;
            ReportingController = reportingController;
            ReportingInstance = reportingInstance;
            Series = series;
            Type = type;
            CustomInit();
        }

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

        /// <summary>
        /// Gets or sets action is what action was taken/failed regarding to
        /// the regarding object. It is machine-readable. This field can have
        /// at most 128 characters.
        /// </summary>
        [JsonProperty(PropertyName = "action")]
        public string Action { get; set; }

        /// <summary>
        /// Gets or sets aPIVersion defines the versioned schema of this
        /// representation of an object. Servers should convert recognized
        /// schemas to the latest internal value, and may reject unrecognized
        /// values. More info:
        /// https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
        /// </summary>
        [JsonProperty(PropertyName = "apiVersion")]
        public string ApiVersion { get; set; }

        /// <summary>
        /// Gets or sets deprecatedCount is the deprecated field assuring
        /// backward compatibility with core.v1 Event type.
        /// </summary>
        [JsonProperty(PropertyName = "deprecatedCount")]
        public int? DeprecatedCount { get; set; }

        /// <summary>
        /// Gets or sets deprecatedFirstTimestamp is the deprecated field
        /// assuring backward compatibility with core.v1 Event type.
        /// </summary>
        [JsonProperty(PropertyName = "deprecatedFirstTimestamp")]
        public System.DateTime? DeprecatedFirstTimestamp { get; set; }

        /// <summary>
        /// Gets or sets deprecatedLastTimestamp is the deprecated field
        /// assuring backward compatibility with core.v1 Event type.
        /// </summary>
        [JsonProperty(PropertyName = "deprecatedLastTimestamp")]
        public System.DateTime? DeprecatedLastTimestamp { get; set; }

        /// <summary>
        /// Gets or sets deprecatedSource is the deprecated field assuring
        /// backward compatibility with core.v1 Event type.
        /// </summary>
        [JsonProperty(PropertyName = "deprecatedSource")]
        public V1EventSource DeprecatedSource { get; set; }

        /// <summary>
        /// Gets or sets eventTime is the time when this Event was first
        /// observed. It is required.
        /// </summary>
        [JsonProperty(PropertyName = "eventTime")]
        public System.DateTime EventTime { get; set; }

        /// <summary>
        /// Gets or sets kind is a string value representing the REST resource
        /// this object represents. Servers may infer this from the endpoint
        /// the client submits requests to. Cannot be updated. In CamelCase.
        /// More info:
        /// https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
        /// </summary>
        [JsonProperty(PropertyName = "kind")]
        public string Kind { get; set; }

        /// <summary>
        /// Gets or sets standard object's metadata. More info:
        /// https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
        /// </summary>
        [JsonProperty(PropertyName = "metadata")]
        public V1ObjectMeta Metadata { get; set; }

        /// <summary>
        /// Gets or sets note is a human-readable description of the status of
        /// this operation. Maximal length of the note is 1kB, but libraries
        /// should be prepared to handle values up to 64kB.
        /// </summary>
        [JsonProperty(PropertyName = "note")]
        public string Note { get; set; }

        /// <summary>
        /// Gets or sets reason is why the action was taken. It is
        /// human-readable. This field can have at most 128 characters.
        /// </summary>
        [JsonProperty(PropertyName = "reason")]
        public string Reason { get; set; }

        /// <summary>
        /// Gets or sets regarding contains the object this Event is about. In
        /// most cases it's an Object reporting controller implements, e.g.
        /// ReplicaSetController implements ReplicaSets and this event is
        /// emitted because it acts on some changes in a ReplicaSet object.
        /// </summary>
        [JsonProperty(PropertyName = "regarding")]
        public V1ObjectReference Regarding { get; set; }

        /// <summary>
        /// Gets or sets related is the optional secondary object for more
        /// complex actions. E.g. when regarding object triggers a creation or
        /// deletion of related object.
        /// </summary>
        [JsonProperty(PropertyName = "related")]
        public V1ObjectReference Related { get; set; }

        /// <summary>
        /// Gets or sets reportingController is the name of the controller that
        /// emitted this Event, e.g. `kubernetes.io/kubelet`. This field cannot
        /// be empty for new Events.
        /// </summary>
        [JsonProperty(PropertyName = "reportingController")]
        public string ReportingController { get; set; }

        /// <summary>
        /// Gets or sets reportingInstance is the ID of the controller
        /// instance, e.g. `kubelet-xyzf`. This field cannot be empty for new
        /// Events and it can have at most 128 characters.
        /// </summary>
        [JsonProperty(PropertyName = "reportingInstance")]
        public string ReportingInstance { get; set; }

        /// <summary>
        /// Gets or sets series is data about the Event series this event
        /// represents or nil if it's a singleton Event.
        /// </summary>
        [JsonProperty(PropertyName = "series")]
        public V1beta1EventSeries Series { get; set; }

        /// <summary>
        /// Gets or sets type is the type of this event (Normal, Warning), new
        /// types could be added in the future. It is machine-readable.
        /// </summary>
        [JsonProperty(PropertyName = "type")]
        public string Type { get; set; }

        /// <summary>
        /// Validate the object.
        /// </summary>
        /// <exception cref="Microsoft.Rest.ValidationException">
        /// Thrown if validation fails
        /// </exception>
        public virtual void Validate()
        {
            if (Series != null)
            {
                Series.Validate();
            }
        }
    }
}
