v3/src/PSSailpoint/Model/SodViolationCheckResult.ps1

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

<#
.SYNOPSIS

No summary available.

.DESCRIPTION

The inner object representing the completed SOD Violation check

.PARAMETER Message
No description available.
.PARAMETER ClientMetadata
Arbitrary key-value pairs. They will never be processed by the IdentityNow system but will be returned on completion of the violation check.
.PARAMETER ViolationContexts
No description available.
.PARAMETER ViolatedPolicies
A list of the SOD policies that were violated.
.OUTPUTS

SodViolationCheckResult<PSCustomObject>
#>


function Initialize-SodViolationCheckResult {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Message},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Collections.Hashtable]
        ${ClientMetadata},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject[]]
        ${ViolationContexts},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject[]]
        ${ViolatedPolicies}
    )

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


        $PSO = [PSCustomObject]@{
            "message" = ${Message}
            "clientMetadata" = ${ClientMetadata}
            "violationContexts" = ${ViolationContexts}
            "violatedPolicies" = ${ViolatedPolicies}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to SodViolationCheckResult<PSCustomObject>

.DESCRIPTION

Convert from JSON to SodViolationCheckResult<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

SodViolationCheckResult<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in SodViolationCheckResult
        $AllProperties = ("message", "clientMetadata", "violationContexts", "violatedPolicies")
        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 "message"))) { #optional property not found
            $Message = $null
        } else {
            $Message = $JsonParameters.PSobject.Properties["message"].value
        }

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

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

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

        $PSO = [PSCustomObject]@{
            "message" = ${Message}
            "clientMetadata" = ${ClientMetadata}
            "violationContexts" = ${ViolationContexts}
            "violatedPolicies" = ${ViolatedPolicies}
        }

        return $PSO
    }

}