Model/SODViolationMitigatedPayload.ps1

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

<#
.SYNOPSIS

No summary available.

.DESCRIPTION

JSON body delivered for the **SODViolationMitigated** webhook.

.PARAMETER AppliedControls
Controls applied to mitigate the violation. For now this lists the currently active application(s).
.PARAMETER Created
When the violation record was created.
.PARAMETER Expiration
Violation-level expiration (may be a sentinel when not set).
.PARAMETER Id
Violation ID.
.PARAMETER LastEvaluatedDate
When the violation was last evaluated.
.PARAMETER Level
Violation severity level.
.PARAMETER Modified
When the violation was last modified.
.PARAMETER Name
Human-readable violation name.
.PARAMETER Owner
No description available.
.PARAMETER Policy
No description available.
.PARAMETER Status
Violation lifecycle status after mitigation.
.PARAMETER Target
No description available.
.OUTPUTS

SODViolationMitigatedPayload<PSCustomObject>
#>


function Initialize-SODViolationMitigatedPayload {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject[]]
        ${AppliedControls},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${Created},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${Expiration},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Id},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${LastEvaluatedDate},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Level},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${Modified},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Name},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Owner},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Policy},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Status},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Target}
    )

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


        $PSO = [PSCustomObject]@{
            "appliedControls" = ${AppliedControls}
            "created" = ${Created}
            "expiration" = ${Expiration}
            "id" = ${Id}
            "lastEvaluatedDate" = ${LastEvaluatedDate}
            "level" = ${Level}
            "modified" = ${Modified}
            "name" = ${Name}
            "owner" = ${Owner}
            "policy" = ${Policy}
            "status" = ${Status}
            "target" = ${Target}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to SODViolationMitigatedPayload<PSCustomObject>

.DESCRIPTION

Convert from JSON to SODViolationMitigatedPayload<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

SODViolationMitigatedPayload<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in SODViolationMitigatedPayload
        $AllProperties = ("appliedControls", "created", "expiration", "id", "lastEvaluatedDate", "level", "modified", "name", "owner", "policy", "status", "target")
        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 "appliedControls"))) { #optional property not found
            $AppliedControls = $null
        } else {
            $AppliedControls = $JsonParameters.PSobject.Properties["appliedControls"].value
        }

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

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

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

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

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

        $PSO = [PSCustomObject]@{
            "appliedControls" = ${AppliedControls}
            "created" = ${Created}
            "expiration" = ${Expiration}
            "id" = ${Id}
            "lastEvaluatedDate" = ${LastEvaluatedDate}
            "level" = ${Level}
            "modified" = ${Modified}
            "name" = ${Name}
            "owner" = ${Owner}
            "policy" = ${Policy}
            "status" = ${Status}
            "target" = ${Target}
        }

        return $PSO
    }

}