# This file was generated by the Julia Swagger Code Generator
# Do not modify this file directly. Modify the swagger specification instead.


@doc raw"""ServicePort contains information on service&#39;s port.

    IoK8sApiCoreV1ServicePort(;
        name=nothing,
        nodePort=nothing,
        port=nothing,
        protocol=nothing,
        targetPort=nothing,
    )

    - name::String : The name of this port within the service. This must be a DNS_LABEL. All ports within a ServiceSpec must have unique names. When considering the endpoints for a Service, this must match the &#39;name&#39; field in the EndpointPort. Optional if only one ServicePort is defined on this service.
    - nodePort::Int32 : The port on each node on which this service is exposed when type&#x3D;NodePort or LoadBalancer. Usually assigned by the system. If specified, it will be allocated to the service if unused or else creation of the service will fail. Default is to auto-allocate a port if the ServiceType of this Service requires one. More info: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport
    - port::Int32 : The port that will be exposed by this service.
    - protocol::String : The IP protocol for this port. Supports \&quot;TCP\&quot;, \&quot;UDP\&quot;, and \&quot;SCTP\&quot;. Default is TCP.
    - targetPort::IoK8sApimachineryPkgUtilIntstrIntOrString : Number or name of the port to access on the pods targeted by the service. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. If this is a string, it will be looked up as a named port in the target Pod&#39;s container ports. If this is not specified, the value of the &#39;port&#39; field is used (an identity map). This field is ignored for services with clusterIP&#x3D;None, and should be omitted or set equal to the &#39;port&#39; field. More info: https://kubernetes.io/docs/concepts/services-networking/service/#defining-a-service
"""
mutable struct IoK8sApiCoreV1ServicePort <: SwaggerModel
    name::Any # spec type: Union{ Nothing, String } # spec name: name
    nodePort::Any # spec type: Union{ Nothing, Int32 } # spec name: nodePort
    port::Any # spec type: Union{ Nothing, Int32 } # spec name: port
    protocol::Any # spec type: Union{ Nothing, String } # spec name: protocol
    targetPort::Any # spec type: Union{ Nothing, IoK8sApimachineryPkgUtilIntstrIntOrString } # spec name: targetPort

    function IoK8sApiCoreV1ServicePort(;name=nothing, nodePort=nothing, port=nothing, protocol=nothing, targetPort=nothing)
        o = new()
        validate_property(IoK8sApiCoreV1ServicePort, Symbol("name"), name)
        setfield!(o, Symbol("name"), name)
        validate_property(IoK8sApiCoreV1ServicePort, Symbol("nodePort"), nodePort)
        setfield!(o, Symbol("nodePort"), nodePort)
        validate_property(IoK8sApiCoreV1ServicePort, Symbol("port"), port)
        setfield!(o, Symbol("port"), port)
        validate_property(IoK8sApiCoreV1ServicePort, Symbol("protocol"), protocol)
        setfield!(o, Symbol("protocol"), protocol)
        validate_property(IoK8sApiCoreV1ServicePort, Symbol("targetPort"), targetPort)
        setfield!(o, Symbol("targetPort"), targetPort)
        o
    end
end # type IoK8sApiCoreV1ServicePort

const _property_map_IoK8sApiCoreV1ServicePort = Dict{Symbol,Symbol}(Symbol("name")=>Symbol("name"), Symbol("nodePort")=>Symbol("nodePort"), Symbol("port")=>Symbol("port"), Symbol("protocol")=>Symbol("protocol"), Symbol("targetPort")=>Symbol("targetPort"))
const _property_types_IoK8sApiCoreV1ServicePort = Dict{Symbol,String}(Symbol("name")=>"String", Symbol("nodePort")=>"Int32", Symbol("port")=>"Int32", Symbol("protocol")=>"String", Symbol("targetPort")=>"IoK8sApimachineryPkgUtilIntstrIntOrString")
Base.propertynames(::Type{ IoK8sApiCoreV1ServicePort }) = collect(keys(_property_map_IoK8sApiCoreV1ServicePort))
Swagger.property_type(::Type{ IoK8sApiCoreV1ServicePort }, name::Symbol) = Union{Nothing,eval(Base.Meta.parse(_property_types_IoK8sApiCoreV1ServicePort[name]))}
Swagger.field_name(::Type{ IoK8sApiCoreV1ServicePort }, property_name::Symbol) =  _property_map_IoK8sApiCoreV1ServicePort[property_name]

function check_required(o::IoK8sApiCoreV1ServicePort)
    (getproperty(o, Symbol("port")) === nothing) && (return false)
    true
end

function validate_property(::Type{ IoK8sApiCoreV1ServicePort }, name::Symbol, val)
end
