Model/NodesStorageImportmetadataWarningsInner.ps1

#
# Proxmox VE
# Generated module to access all Proxmox VE Api Endpoints
# Version: 0.3
# Contact: amna.wolf@gmail.com
# Generated by OpenAPI Generator: https://openapi-generator.tech
#

<#
.SYNOPSIS

No summary available.

.DESCRIPTION

No description available.

.PARAMETER Key
Related subject (config) key of warning.
.PARAMETER Type
What this warning is about.
.PARAMETER Value
Related subject (config) value of warning.
.OUTPUTS

NodesStorageImportmetadataWarningsInner<PSCustomObject>
#>


function Initialize-PVENodesStorageImportmetadataWarningsInner {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Key},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [ValidateSet("cdrom-image-ignored", "efi-state-lost", "guest-is-running", "nvme-unsupported", "ova-needs-extracting", "ovmf-with-lsi-unsupported", "serial-port-socket-only")]
        [String]
        ${Type},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Value}
    )

    Process {
        'Creating PSCustomObject: ProxmoxPVE => PVENodesStorageImportmetadataWarningsInner' | Write-Debug
        $PSBoundParameters | Out-DebugParameter | Write-Debug


         $DisplayNameMapping =@{
            "Key"="key"; "Type"="type"; "Value"="value"
        }
        
         $OBJ = @{}
        foreach($parameter in   $PSBoundParameters.Keys){
            #If Specifield map the Display name back
            $OBJ.($DisplayNameMapping.($parameter)) = "$PSBoundParameters.$parameter"
        }

        $PSO = [PSCustomObject]$OBJ


        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to NodesStorageImportmetadataWarningsInner<PSCustomObject>

.DESCRIPTION

Convert from JSON to NodesStorageImportmetadataWarningsInner<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

NodesStorageImportmetadataWarningsInner<PSCustomObject>
#>

function ConvertFrom-PVEJsonToNodesStorageImportmetadataWarningsInner {
    Param(
        [AllowEmptyString()]
        [string]$Json
    )

    Process {
        'Converting JSON to PSCustomObject: ProxmoxPVE => PVENodesStorageImportmetadataWarningsInner' | Write-Debug
        $PSBoundParameters | Out-DebugParameter | Write-Debug

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in PVENodesStorageImportmetadataWarningsInner
        $AllProperties = ("key", "type", "value")
        foreach ($name in $JsonParameters.PsObject.Properties.Name) {
            if (!($AllProperties.Contains($name))) {
                throw "Error! JSON key '$name' not found in the properties: $($AllProperties)"
            }
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "key"))) { #optional property not found
            $Key = $null
        } else {
            $Key = $JsonParameters.PSobject.Properties["key"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "type"))) { #optional property not found
            $Type = $null
        } else {
            $Type = $JsonParameters.PSobject.Properties["type"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "value"))) { #optional property not found
            $Value = $null
        } else {
            $Value = $JsonParameters.PSobject.Properties["value"].value
        }

        $PSO = [PSCustomObject]@{
            "key" = ${Key}
            "type" = ${Type}
            "value" = ${Value}
        }

        return $PSO
    }

}