// <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.Collections;
    using System.Collections.Generic;
    using System.Linq;

    /// <summary>
    /// Endpoints is a collection of endpoints that implement the actual
    /// service. Example:
    /// Name: "mysvc",
    /// Subsets: [
    /// {
    /// Addresses: [{"ip": "10.10.1.1"}, {"ip": "10.10.2.2"}],
    /// Ports: [{"name": "a", "port": 8675}, {"name": "b", "port": 309}]
    /// },
    /// {
    /// Addresses: [{"ip": "10.10.3.3"}],
    /// Ports: [{"name": "a", "port": 93}, {"name": "b", "port": 76}]
    /// },
    /// ]
    /// </summary>
    public partial class V1Endpoints
    {
        /// <summary>
        /// Initializes a new instance of the V1Endpoints class.
        /// </summary>
        public V1Endpoints()
        {
            CustomInit();
        }

        /// <summary>
        /// Initializes a new instance of the V1Endpoints class.
        /// </summary>
        /// <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/api-conventions.md#resources</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/api-conventions.md#types-kinds</param>
        /// <param name="metadata">Standard object's metadata. More info:
        /// https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata</param>
        /// <param name="subsets">The set of all endpoints is the union of all
        /// subsets. Addresses are placed into subsets according to the IPs
        /// they share. A single address with multiple ports, some of which are
        /// ready and some of which are not (because they come from different
        /// containers) will result in the address being displayed in different
        /// subsets for the different ports. No address will appear in both
        /// Addresses and NotReadyAddresses in the same subset. Sets of
        /// addresses and ports that comprise a service.</param>
        public V1Endpoints(string apiVersion = default(string), string kind = default(string), V1ObjectMeta metadata = default(V1ObjectMeta), IList<V1EndpointSubset> subsets = default(IList<V1EndpointSubset>))
        {
            ApiVersion = apiVersion;
            Kind = kind;
            Metadata = metadata;
            Subsets = subsets;
            CustomInit();
        }

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

        /// <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/api-conventions.md#resources
        /// </summary>
        [JsonProperty(PropertyName = "apiVersion")]
        public string ApiVersion { 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/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/api-conventions.md#metadata
        /// </summary>
        [JsonProperty(PropertyName = "metadata")]
        public V1ObjectMeta Metadata { get; set; }

        /// <summary>
        /// Gets or sets the set of all endpoints is the union of all subsets.
        /// Addresses are placed into subsets according to the IPs they share.
        /// A single address with multiple ports, some of which are ready and
        /// some of which are not (because they come from different containers)
        /// will result in the address being displayed in different subsets for
        /// the different ports. No address will appear in both Addresses and
        /// NotReadyAddresses in the same subset. Sets of addresses and ports
        /// that comprise a service.
        /// </summary>
        [JsonProperty(PropertyName = "subsets")]
        public IList<V1EndpointSubset> Subsets { get; set; }

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