Model/AuditEventCreatedAt.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

Search for record based on the created_at date

.PARAMETER Gt
Greater Than - search for events with a date greater than the value
.PARAMETER Lt
Less Than - search for events with a date less than the value
.PARAMETER Eq
Equal - search for events with a date equal to the value
.OUTPUTS

AuditEventCreatedAt<PSCustomObject>
#>


function Initialize-NERMAuditEventCreatedAt {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${Gt},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${Lt},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${Eq}
    )

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


        $PSO = [PSCustomObject]@{
            "gt" = ${Gt}
            "lt" = ${Lt}
            "eq" = ${Eq}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to AuditEventCreatedAt<PSCustomObject>

.DESCRIPTION

Convert from JSON to AuditEventCreatedAt<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

AuditEventCreatedAt<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in NERMAuditEventCreatedAt
        $AllProperties = ("gt", "lt", "eq")
        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 "gt"))) { #optional property not found
            $Gt = $null
        } else {
            $Gt = $JsonParameters.PSobject.Properties["gt"].value
        }

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

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

        $PSO = [PSCustomObject]@{
            "gt" = ${Gt}
            "lt" = ${Lt}
            "eq" = ${Eq}
        }

        return $PSO
    }

}