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


@doc raw"""ExternalMetricSource indicates how to scale on a metric not associated with any Kubernetes object (for example length of queue in cloud messaging service, or QPS from loadbalancer running outside of cluster). Exactly one \&quot;target\&quot; type should be set.

    IoK8sApiAutoscalingV2beta1ExternalMetricSource(;
        metricName=nothing,
        metricSelector=nothing,
        targetAverageValue=nothing,
        targetValue=nothing,
    )

    - metricName::String : metricName is the name of the metric in question.
    - metricSelector::IoK8sApimachineryPkgApisMetaV1LabelSelector : metricSelector is used to identify a specific time series within a given metric.
    - targetAverageValue::IoK8sApimachineryPkgApiResourceQuantity : targetAverageValue is the target per-pod value of global metric (as a quantity). Mutually exclusive with TargetValue.
    - targetValue::IoK8sApimachineryPkgApiResourceQuantity : targetValue is the target value of the metric (as a quantity). Mutually exclusive with TargetAverageValue.
"""
mutable struct IoK8sApiAutoscalingV2beta1ExternalMetricSource <: SwaggerModel
    metricName::Any # spec type: Union{ Nothing, String } # spec name: metricName
    metricSelector::Any # spec type: Union{ Nothing, IoK8sApimachineryPkgApisMetaV1LabelSelector } # spec name: metricSelector
    targetAverageValue::Any # spec type: Union{ Nothing, IoK8sApimachineryPkgApiResourceQuantity } # spec name: targetAverageValue
    targetValue::Any # spec type: Union{ Nothing, IoK8sApimachineryPkgApiResourceQuantity } # spec name: targetValue

    function IoK8sApiAutoscalingV2beta1ExternalMetricSource(;metricName=nothing, metricSelector=nothing, targetAverageValue=nothing, targetValue=nothing)
        o = new()
        validate_property(IoK8sApiAutoscalingV2beta1ExternalMetricSource, Symbol("metricName"), metricName)
        setfield!(o, Symbol("metricName"), metricName)
        validate_property(IoK8sApiAutoscalingV2beta1ExternalMetricSource, Symbol("metricSelector"), metricSelector)
        setfield!(o, Symbol("metricSelector"), metricSelector)
        validate_property(IoK8sApiAutoscalingV2beta1ExternalMetricSource, Symbol("targetAverageValue"), targetAverageValue)
        setfield!(o, Symbol("targetAverageValue"), targetAverageValue)
        validate_property(IoK8sApiAutoscalingV2beta1ExternalMetricSource, Symbol("targetValue"), targetValue)
        setfield!(o, Symbol("targetValue"), targetValue)
        o
    end
end # type IoK8sApiAutoscalingV2beta1ExternalMetricSource

const _property_map_IoK8sApiAutoscalingV2beta1ExternalMetricSource = Dict{Symbol,Symbol}(Symbol("metricName")=>Symbol("metricName"), Symbol("metricSelector")=>Symbol("metricSelector"), Symbol("targetAverageValue")=>Symbol("targetAverageValue"), Symbol("targetValue")=>Symbol("targetValue"))
const _property_types_IoK8sApiAutoscalingV2beta1ExternalMetricSource = Dict{Symbol,String}(Symbol("metricName")=>"String", Symbol("metricSelector")=>"IoK8sApimachineryPkgApisMetaV1LabelSelector", Symbol("targetAverageValue")=>"IoK8sApimachineryPkgApiResourceQuantity", Symbol("targetValue")=>"IoK8sApimachineryPkgApiResourceQuantity")
Base.propertynames(::Type{ IoK8sApiAutoscalingV2beta1ExternalMetricSource }) = collect(keys(_property_map_IoK8sApiAutoscalingV2beta1ExternalMetricSource))
Swagger.property_type(::Type{ IoK8sApiAutoscalingV2beta1ExternalMetricSource }, name::Symbol) = Union{Nothing,eval(Base.Meta.parse(_property_types_IoK8sApiAutoscalingV2beta1ExternalMetricSource[name]))}
Swagger.field_name(::Type{ IoK8sApiAutoscalingV2beta1ExternalMetricSource }, property_name::Symbol) =  _property_map_IoK8sApiAutoscalingV2beta1ExternalMetricSource[property_name]

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

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