Model/AccountRequestPhase.ps1

#
# Identity Security Cloud v2026 API
# Use these APIs to interact with the Identity Security Cloud platform to achieve repeatable, automated processes with greater scalability. We encourage you to join the SailPoint Developer Community forum at https://developer.sailpoint.com/discuss to connect with other developers using our APIs.
# Version: v2026
# Generated by OpenAPI Generator: https://openapi-generator.tech
#

<#
.SYNOPSIS

No summary available.

.DESCRIPTION

Contains detailed information about each phase in the account request process, including its type, current state, and relevant timestamps.

.PARAMETER Name
Enum of account request phase type
.PARAMETER State
No description available.
.OUTPUTS

AccountRequestPhase<PSCustomObject>
#>


function Initialize-V2026AccountRequestPhase {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [ValidateSet("APPROVAL_PHASE", "PROVISIONING_PHASE")]
        [String]
        ${Name},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [ValidateSet("PENDING", "CANCELLED", "APPROVED", "REJECTED", "PASSED", "FAILED")]
        [PSCustomObject]
        ${State}
    )

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


        $PSO = [PSCustomObject]@{
            "name" = ${Name}
            "state" = ${State}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to AccountRequestPhase<PSCustomObject>

.DESCRIPTION

Convert from JSON to AccountRequestPhase<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

AccountRequestPhase<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in V2026AccountRequestPhase
        $AllProperties = ("name", "state", "started", "finished")
        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 "name"))) { #optional property not found
            $Name = $null
        } else {
            $Name = $JsonParameters.PSobject.Properties["name"].value
        }

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

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

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

        $PSO = [PSCustomObject]@{
            "name" = ${Name}
            "state" = ${State}
            "started" = ${Started}
            "finished" = ${Finished}
        }

        return $PSO
    }

}