// <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>
    /// Probe describes a health check to be performed against a container to
    /// determine whether it is alive or ready to receive traffic.
    /// </summary>
    public partial class V1Probe
    {
        /// <summary>
        /// Initializes a new instance of the V1Probe class.
        /// </summary>
        public V1Probe()
        {
            CustomInit();
        }

        /// <summary>
        /// Initializes a new instance of the V1Probe class.
        /// </summary>
        /// <param name="exec">One and only one of the following should be
        /// specified. Exec specifies the action to take.</param>
        /// <param name="failureThreshold">Minimum consecutive failures for the
        /// probe to be considered failed after having succeeded. Defaults to
        /// 3. Minimum value is 1.</param>
        /// <param name="httpGet">HTTPGet specifies the http request to
        /// perform.</param>
        /// <param name="initialDelaySeconds">Number of seconds after the
        /// container has started before liveness probes are initiated. More
        /// info:
        /// https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes</param>
        /// <param name="periodSeconds">How often (in seconds) to perform the
        /// probe. Default to 10 seconds. Minimum value is 1.</param>
        /// <param name="successThreshold">Minimum consecutive successes for
        /// the probe to be considered successful after having failed. Defaults
        /// to 1. Must be 1 for liveness. Minimum value is 1.</param>
        /// <param name="tcpSocket">TCPSocket specifies an action involving a
        /// TCP port. TCP hooks not yet supported</param>
        /// <param name="timeoutSeconds">Number of seconds after which the
        /// probe times out. Defaults to 1 second. Minimum value is 1. More
        /// info:
        /// https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes</param>
        public V1Probe(V1ExecAction exec = default(V1ExecAction), int? failureThreshold = default(int?), V1HTTPGetAction httpGet = default(V1HTTPGetAction), int? initialDelaySeconds = default(int?), int? periodSeconds = default(int?), int? successThreshold = default(int?), V1TCPSocketAction tcpSocket = default(V1TCPSocketAction), int? timeoutSeconds = default(int?))
        {
            Exec = exec;
            FailureThreshold = failureThreshold;
            HttpGet = httpGet;
            InitialDelaySeconds = initialDelaySeconds;
            PeriodSeconds = periodSeconds;
            SuccessThreshold = successThreshold;
            TcpSocket = tcpSocket;
            TimeoutSeconds = timeoutSeconds;
            CustomInit();
        }

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

        /// <summary>
        /// Gets or sets one and only one of the following should be specified.
        /// Exec specifies the action to take.
        /// </summary>
        [JsonProperty(PropertyName = "exec")]
        public V1ExecAction Exec { get; set; }

        /// <summary>
        /// Gets or sets minimum consecutive failures for the probe to be
        /// considered failed after having succeeded. Defaults to 3. Minimum
        /// value is 1.
        /// </summary>
        [JsonProperty(PropertyName = "failureThreshold")]
        public int? FailureThreshold { get; set; }

        /// <summary>
        /// Gets or sets hTTPGet specifies the http request to perform.
        /// </summary>
        [JsonProperty(PropertyName = "httpGet")]
        public V1HTTPGetAction HttpGet { get; set; }

        /// <summary>
        /// Gets or sets number of seconds after the container has started
        /// before liveness probes are initiated. More info:
        /// https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
        /// </summary>
        [JsonProperty(PropertyName = "initialDelaySeconds")]
        public int? InitialDelaySeconds { get; set; }

        /// <summary>
        /// Gets or sets how often (in seconds) to perform the probe. Default
        /// to 10 seconds. Minimum value is 1.
        /// </summary>
        [JsonProperty(PropertyName = "periodSeconds")]
        public int? PeriodSeconds { get; set; }

        /// <summary>
        /// Gets or sets minimum consecutive successes for the probe to be
        /// considered successful after having failed. Defaults to 1. Must be 1
        /// for liveness. Minimum value is 1.
        /// </summary>
        [JsonProperty(PropertyName = "successThreshold")]
        public int? SuccessThreshold { get; set; }

        /// <summary>
        /// Gets or sets tCPSocket specifies an action involving a TCP port.
        /// TCP hooks not yet supported
        /// </summary>
        [JsonProperty(PropertyName = "tcpSocket")]
        public V1TCPSocketAction TcpSocket { get; set; }

        /// <summary>
        /// Gets or sets number of seconds after which the probe times out.
        /// Defaults to 1 second. Minimum value is 1. More info:
        /// https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
        /// </summary>
        [JsonProperty(PropertyName = "timeoutSeconds")]
        public int? TimeoutSeconds { get; set; }

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