Model/SearchRequestAuditEvents.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 Offset
How many records to skip before pulling records to return.
.PARAMETER SortBy
A column that we are sorting these records from.
.PARAMETER Limit
The limiting count for the amount of records returned.
.PARAMETER Order
Which direction the list should be sorted by
.PARAMETER Filters
No description available.
.OUTPUTS

SearchRequestAuditEvents<PSCustomObject>
#>


function Initialize-NERMSearchRequestAuditEvents {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int32]]
        ${Offset},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${SortBy},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int32]]
        ${Limit},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [ValidateSet("asc", "desc")]
        [String]
        ${Order},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Filters}
    )

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

        if ($Limit -and $Limit -gt 100) {
          throw "invalid value for 'Limit', must be smaller than or equal to 100."
        }


        $PSO = [PSCustomObject]@{
            "offset" = ${Offset}
            "sort_by" = ${SortBy}
            "limit" = ${Limit}
            "order" = ${Order}
            "filters" = ${Filters}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to SearchRequestAuditEvents<PSCustomObject>

.DESCRIPTION

Convert from JSON to SearchRequestAuditEvents<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

SearchRequestAuditEvents<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in NERMSearchRequestAuditEvents
        $AllProperties = ("offset", "sort_by", "limit", "order", "filters")
        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 "offset"))) { #optional property not found
            $Offset = $null
        } else {
            $Offset = $JsonParameters.PSobject.Properties["offset"].value
        }

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

        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 "order"))) { #optional property not found
            $Order = $null
        } else {
            $Order = $JsonParameters.PSobject.Properties["order"].value
        }

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

        $PSO = [PSCustomObject]@{
            "offset" = ${Offset}
            "sort_by" = ${SortBy}
            "limit" = ${Limit}
            "order" = ${Order}
            "filters" = ${Filters}
        }

        return $PSO
    }

}