Model/MetadataWithAfterId.ps1

#
# NERM API
# The NERM API accesss and modifies resources in your environment.
# Version: 1.0.0
# Generated by OpenAPI Generator: https://openapi-generator.tech
#

<#
.SYNOPSIS

No summary available.

.DESCRIPTION

No description available.

.PARAMETER Limit
The maximum number of records to return in the search
.PARAMETER Offset
The number of records to skip before starting to return results.
.PARAMETER Total
The total number of records available matching the search criteria.
.PARAMETER Next
The ID of the first record in the next set of results
.PARAMETER Previous
The ID of the last record in the previous set of results
.PARAMETER AfterId
The ID from which the search will start, ignoring all records before it.
.OUTPUTS

MetadataWithAfterId<PSCustomObject>
#>


function Initialize-NERMMetadataWithAfterId {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int32]]
        ${Limit},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int32]]
        ${Offset},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int32]]
        ${Total},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Next},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Previous},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${AfterId}
    )

    Process {
        'Creating PSCustomObject: PSSailpoint.NERM => NERMMetadataWithAfterId' | Write-Debug
        $PSBoundParameters | Out-DebugParameter | Write-Debug


        $PSO = [PSCustomObject]@{
            "limit" = ${Limit}
            "offset" = ${Offset}
            "total" = ${Total}
            "next" = ${Next}
            "previous" = ${Previous}
            "after_id" = ${AfterId}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to MetadataWithAfterId<PSCustomObject>

.DESCRIPTION

Convert from JSON to MetadataWithAfterId<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

MetadataWithAfterId<PSCustomObject>
#>

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

    Process {
        'Converting JSON to PSCustomObject: PSSailpoint.NERM => NERMMetadataWithAfterId' | Write-Debug
        $PSBoundParameters | Out-DebugParameter | Write-Debug

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in NERMMetadataWithAfterId
        $AllProperties = ("limit", "offset", "total", "next", "previous", "after_id")
        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 "limit"))) { #optional property not found
            $Limit = $null
        } else {
            $Limit = $JsonParameters.PSobject.Properties["limit"].value
        }

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

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

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

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

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

        $PSO = [PSCustomObject]@{
            "limit" = ${Limit}
            "offset" = ${Offset}
            "total" = ${Total}
            "next" = ${Next}
            "previous" = ${Previous}
            "after_id" = ${AfterId}
        }

        return $PSO
    }

}