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

No description available.

.PARAMETER VarEvent
No description available.
.PARAMETER Source
No description available.
.PARAMETER Account
No description available.
.PARAMETER Identity
No description available.
.OUTPUTS

AccountDeleted<PSCustomObject>
#>


function Initialize-V2025AccountDeleted {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${VarEvent},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Source},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Account},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Identity}
    )

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

        if (!$VarEvent) {
            throw "invalid value for 'VarEvent', 'VarEvent' cannot be null."
        }

        if (!$Source) {
            throw "invalid value for 'Source', 'Source' cannot be null."
        }

        if (!$Account) {
            throw "invalid value for 'Account', 'Account' cannot be null."
        }

        if (!$Identity) {
            throw "invalid value for 'Identity', 'Identity' cannot be null."
        }


        $PSO = [PSCustomObject]@{
            "event" = ${VarEvent}
            "source" = ${Source}
            "account" = ${Account}
            "identity" = ${Identity}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to AccountDeleted<PSCustomObject>

.DESCRIPTION

Convert from JSON to AccountDeleted<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

AccountDeleted<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in V2025AccountDeleted
        $AllProperties = ("event", "source", "account", "identity")
        foreach ($name in $JsonParameters.PsObject.Properties.Name) {
            if (!($AllProperties.Contains($name))) {
                throw "Error! JSON key '$name' not found in the properties: $($AllProperties)"
            }
        }

        If ([string]::IsNullOrEmpty($Json) -or $Json -eq "{}") { # empty json
            throw "Error! Empty JSON cannot be serialized due to the required property 'event' missing."
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "event"))) {
            throw "Error! JSON cannot be serialized due to the required property 'event' missing."
        } else {
            $VarEvent = $JsonParameters.PSobject.Properties["event"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "source"))) {
            throw "Error! JSON cannot be serialized due to the required property 'source' missing."
        } else {
            $Source = $JsonParameters.PSobject.Properties["source"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "account"))) {
            throw "Error! JSON cannot be serialized due to the required property 'account' missing."
        } else {
            $Account = $JsonParameters.PSobject.Properties["account"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "identity"))) {
            throw "Error! JSON cannot be serialized due to the required property 'identity' missing."
        } else {
            $Identity = $JsonParameters.PSobject.Properties["identity"].value
        }

        $PSO = [PSCustomObject]@{
            "event" = ${VarEvent}
            "source" = ${Source}
            "account" = ${Account}
            "identity" = ${Identity}
        }

        return $PSO
    }

}