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


@doc raw"""CustomResourceConversion describes how to convert different versions of a CR.

    IoK8sApiextensionsApiserverPkgApisApiextensionsV1beta1CustomResourceConversion(;
        conversionReviewVersions=nothing,
        strategy=nothing,
        webhookClientConfig=nothing,
    )

    - conversionReviewVersions::Vector{String} : conversionReviewVersions is an ordered list of preferred &#x60;ConversionReview&#x60; versions the Webhook expects. The API server will use the first version in the list which it supports. If none of the versions specified in this list are supported by API server, conversion will fail for the custom resource. If a persisted Webhook configuration specifies allowed versions and does not include any versions known to the API Server, calls to the webhook will fail. Defaults to &#x60;[\&quot;v1beta1\&quot;]&#x60;.
    - strategy::String : strategy specifies how custom resources are converted between versions. Allowed values are: - &#x60;None&#x60;: The converter only change the apiVersion and would not touch any other field in the custom resource. - &#x60;Webhook&#x60;: API Server will call to an external webhook to do the conversion. Additional information   is needed for this option. This requires spec.preserveUnknownFields to be false, and spec.conversion.webhookClientConfig to be set.
    - webhookClientConfig::IoK8sApiextensionsApiserverPkgApisApiextensionsV1beta1WebhookClientConfig : webhookClientConfig is the instructions for how to call the webhook if strategy is &#x60;Webhook&#x60;. Required when &#x60;strategy&#x60; is set to &#x60;Webhook&#x60;.
"""
mutable struct IoK8sApiextensionsApiserverPkgApisApiextensionsV1beta1CustomResourceConversion <: SwaggerModel
    conversionReviewVersions::Any # spec type: Union{ Nothing, Vector{String} } # spec name: conversionReviewVersions
    strategy::Any # spec type: Union{ Nothing, String } # spec name: strategy
    webhookClientConfig::Any # spec type: Union{ Nothing, IoK8sApiextensionsApiserverPkgApisApiextensionsV1beta1WebhookClientConfig } # spec name: webhookClientConfig

    function IoK8sApiextensionsApiserverPkgApisApiextensionsV1beta1CustomResourceConversion(;conversionReviewVersions=nothing, strategy=nothing, webhookClientConfig=nothing)
        o = new()
        validate_property(IoK8sApiextensionsApiserverPkgApisApiextensionsV1beta1CustomResourceConversion, Symbol("conversionReviewVersions"), conversionReviewVersions)
        setfield!(o, Symbol("conversionReviewVersions"), conversionReviewVersions)
        validate_property(IoK8sApiextensionsApiserverPkgApisApiextensionsV1beta1CustomResourceConversion, Symbol("strategy"), strategy)
        setfield!(o, Symbol("strategy"), strategy)
        validate_property(IoK8sApiextensionsApiserverPkgApisApiextensionsV1beta1CustomResourceConversion, Symbol("webhookClientConfig"), webhookClientConfig)
        setfield!(o, Symbol("webhookClientConfig"), webhookClientConfig)
        o
    end
end # type IoK8sApiextensionsApiserverPkgApisApiextensionsV1beta1CustomResourceConversion

const _property_map_IoK8sApiextensionsApiserverPkgApisApiextensionsV1beta1CustomResourceConversion = Dict{Symbol,Symbol}(Symbol("conversionReviewVersions")=>Symbol("conversionReviewVersions"), Symbol("strategy")=>Symbol("strategy"), Symbol("webhookClientConfig")=>Symbol("webhookClientConfig"))
const _property_types_IoK8sApiextensionsApiserverPkgApisApiextensionsV1beta1CustomResourceConversion = Dict{Symbol,String}(Symbol("conversionReviewVersions")=>"Vector{String}", Symbol("strategy")=>"String", Symbol("webhookClientConfig")=>"IoK8sApiextensionsApiserverPkgApisApiextensionsV1beta1WebhookClientConfig")
Base.propertynames(::Type{ IoK8sApiextensionsApiserverPkgApisApiextensionsV1beta1CustomResourceConversion }) = collect(keys(_property_map_IoK8sApiextensionsApiserverPkgApisApiextensionsV1beta1CustomResourceConversion))
Swagger.property_type(::Type{ IoK8sApiextensionsApiserverPkgApisApiextensionsV1beta1CustomResourceConversion }, name::Symbol) = Union{Nothing,eval(Base.Meta.parse(_property_types_IoK8sApiextensionsApiserverPkgApisApiextensionsV1beta1CustomResourceConversion[name]))}
Swagger.field_name(::Type{ IoK8sApiextensionsApiserverPkgApisApiextensionsV1beta1CustomResourceConversion }, property_name::Symbol) =  _property_map_IoK8sApiextensionsApiserverPkgApisApiextensionsV1beta1CustomResourceConversion[property_name]

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

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