reminder-escalations/src/PSSailpoint.ReminderEscalations/Model/Reminderescalationescalation.ps1

#
# SailPoint Identity Security API - Reminder Escalations
# Use these APIs to interact with the SailPoint Identity Security 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: v1
# Generated by OpenAPI Generator: https://openapi-generator.tech
#

<#
.SYNOPSIS

No summary available.

.DESCRIPTION

One escalation. Escalations in a ruleset are independent of each other.

.PARAMETER Trigger
No description available.
.PARAMETER Targets
No description available.
.PARAMETER Template
Notification template key.
.OUTPUTS

Reminderescalationescalation<PSCustomObject>
#>


function Initialize-Reminderescalationescalation {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Trigger},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject[]]
        ${Targets},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Template}
    )

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

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

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

        if ($Targets.length -lt 1) {
            throw "invalid value for 'Targets', number of items must be greater than or equal to 1."
        }

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


        $PSO = [PSCustomObject]@{
            "trigger" = ${Trigger}
            "targets" = ${Targets}
            "template" = ${Template}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to Reminderescalationescalation<PSCustomObject>

.DESCRIPTION

Convert from JSON to Reminderescalationescalation<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

Reminderescalationescalation<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in Reminderescalationescalation
        $AllProperties = ("trigger", "targets", "template")
        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 'trigger' missing."
        }

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

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

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

        $PSO = [PSCustomObject]@{
            "trigger" = ${Trigger}
            "targets" = ${Targets}
            "template" = ${Template}
        }

        return $PSO
    }

}