v2025/src/PSSailpoint.V2025/Model/ApprovalRequestedTarget.ps1

#
# Identity Security Cloud V2025 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: v2025
# Generated by OpenAPI Generator: https://openapi-generator.tech
#

<#
.SYNOPSIS

No summary available.

.DESCRIPTION

Represents a requested target in an approval process, including details such as ID, name, reauthentication requirements, and removal date.

.PARAMETER ForcedAuthSignature
Signature required for forced authentication.
.PARAMETER Id
ID of the requested target.
.PARAMETER Name
Name of the requested target.
.PARAMETER ReauthRequired
Indicates if reauthentication is required.
.PARAMETER RemovalDate
Date when the target will be removed.
.PARAMETER RequestType
Type of the request.
.PARAMETER TargetType
Type of the target.
.OUTPUTS

ApprovalRequestedTarget<PSCustomObject>
#>


function Initialize-V2025ApprovalRequestedTarget {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${ForcedAuthSignature},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Id},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Name},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${ReauthRequired} = $false,
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${RemovalDate},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${RequestType},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${TargetType}
    )

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


        $PSO = [PSCustomObject]@{
            "forcedAuthSignature" = ${ForcedAuthSignature}
            "id" = ${Id}
            "name" = ${Name}
            "reauthRequired" = ${ReauthRequired}
            "removalDate" = ${RemovalDate}
            "requestType" = ${RequestType}
            "targetType" = ${TargetType}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to ApprovalRequestedTarget<PSCustomObject>

.DESCRIPTION

Convert from JSON to ApprovalRequestedTarget<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

ApprovalRequestedTarget<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in V2025ApprovalRequestedTarget
        $AllProperties = ("forcedAuthSignature", "id", "name", "reauthRequired", "removalDate", "requestType", "targetType")
        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 "forcedAuthSignature"))) { #optional property not found
            $ForcedAuthSignature = $null
        } else {
            $ForcedAuthSignature = $JsonParameters.PSobject.Properties["forcedAuthSignature"].value
        }

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

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

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

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

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

        $PSO = [PSCustomObject]@{
            "forcedAuthSignature" = ${ForcedAuthSignature}
            "id" = ${Id}
            "name" = ${Name}
            "reauthRequired" = ${ReauthRequired}
            "removalDate" = ${RemovalDate}
            "requestType" = ${RequestType}
            "targetType" = ${TargetType}
        }

        return $PSO
    }

}