Model/GETNodesJournalRB.ps1

#
# Proxmox PowerShell VE
# Generated module to access all Proxmox VE Api Endpoints. This module has been generated from the proxmox api description v. 8.4.0
# Version: 8.4.0
# Contact: mail@timo-wolf.de
# Generated by OpenAPI Generator: https://openapi-generator.tech
#

<#
.SYNOPSIS

No summary available.

.DESCRIPTION

No description available.

.PARAMETER Since
No description available.
.PARAMETER Startcursor
No description available.
.PARAMETER Endcursor
No description available.
.PARAMETER Lastentries
No description available.
.PARAMETER VarUntil
No description available.
.OUTPUTS

GETNodesJournalRB<PSCustomObject>
#>


function Initialize-PVEGETNodesJournalRB {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int32]]
        ${Since},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Startcursor},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Endcursor},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int32]]
        ${Lastentries},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int32]]
        ${VarUntil}
    )

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


         $DisplayNameMapping =@{
            "Since"="since"; "Startcursor"="startcursor"; "Endcursor"="endcursor"; "Lastentries"="lastentries"; "VarUntil"="until"
        }
        
         $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 GETNodesJournalRB<PSCustomObject>

.DESCRIPTION

Convert from JSON to GETNodesJournalRB<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

GETNodesJournalRB<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in PVEGETNodesJournalRB
        $AllProperties = ("since", "startcursor", "endcursor", "lastentries", "until")
        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 "since"))) { #optional property not found
            $Since = $null
        } else {
            $Since = $JsonParameters.PSobject.Properties["since"].value
        }

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

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

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

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

        $PSO = [PSCustomObject]@{
            "since" = ${Since}
            "startcursor" = ${Startcursor}
            "endcursor" = ${Endcursor}
            "lastentries" = ${Lastentries}
            "until" = ${VarUntil}
        }

        return $PSO
    }

}