Model/DelegatorUser.ps1

#
# NERM API v2025
# The NERM API v2025 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 Id
The id of the delegator user
.PARAMETER Uid
The uid of the delegator user
.PARAMETER Type
The type of the delegator user
.PARAMETER Name
The name of the delegator user
.PARAMETER Email
The email of the delegator user
.PARAMETER Status
The status of the delegator user
.PARAMETER Login
The login of the delegator user
.PARAMETER LastLogin
The last login timestamp of the delegator user
.OUTPUTS

DelegatorUser<PSCustomObject>
#>


function Initialize-NERMV2025DelegatorUser {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Id},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Uid},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Type},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Name},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Email},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Status},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Login},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${LastLogin}
    )

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


        $PSO = [PSCustomObject]@{
            "id" = ${Id}
            "uid" = ${Uid}
            "type" = ${Type}
            "name" = ${Name}
            "email" = ${Email}
            "status" = ${Status}
            "login" = ${Login}
            "last_login" = ${LastLogin}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to DelegatorUser<PSCustomObject>

.DESCRIPTION

Convert from JSON to DelegatorUser<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

DelegatorUser<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in NERMV2025DelegatorUser
        $AllProperties = ("id", "uid", "type", "name", "email", "status", "login", "last_login", "created_at", "updated_at")
        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 "id"))) { #optional property not found
            $Id = $null
        } else {
            $Id = $JsonParameters.PSobject.Properties["id"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "uid"))) { #optional property not found
            $Uid = $null
        } else {
            $Uid = $JsonParameters.PSobject.Properties["uid"].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 "name"))) { #optional property not found
            $Name = $null
        } else {
            $Name = $JsonParameters.PSobject.Properties["name"].value
        }

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

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

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

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

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

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

        $PSO = [PSCustomObject]@{
            "id" = ${Id}
            "uid" = ${Uid}
            "type" = ${Type}
            "name" = ${Name}
            "email" = ${Email}
            "status" = ${Status}
            "login" = ${Login}
            "last_login" = ${LastLogin}
            "created_at" = ${CreatedAt}
            "updated_at" = ${UpdatedAt}
        }

        return $PSO
    }

}