intelligence/src/PSSailpoint.Intelligence/Model/Intelmachinederived.ps1

#
# Identity Security Cloud API - Intelligence
# 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

Derived SOC triage signals for non-human identity risk assessment.

.PARAMETER IsOrphaned
Flags NHIs without a valid active owner for prioritization.
.PARAMETER AuthorizedHumanIdentities
Humans who can invoke or access this NHI agent.
.PARAMETER BlastRadiusSummary
No description available.
.OUTPUTS

Intelmachinederived<PSCustomObject>
#>


function Initialize-Intelmachinederived {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [Boolean]
        ${IsOrphaned},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject[]]
        ${AuthorizedHumanIdentities},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${BlastRadiusSummary}
    )

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

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

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

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


        $PSO = [PSCustomObject]@{
            "isOrphaned" = ${IsOrphaned}
            "authorizedHumanIdentities" = ${AuthorizedHumanIdentities}
            "blastRadiusSummary" = ${BlastRadiusSummary}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to Intelmachinederived<PSCustomObject>

.DESCRIPTION

Convert from JSON to Intelmachinederived<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

Intelmachinederived<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in Intelmachinederived
        $AllProperties = ("isOrphaned", "authorizedHumanIdentities", "blastRadiusSummary")
        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 'isOrphaned' missing."
        }

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

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

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

        $PSO = [PSCustomObject]@{
            "isOrphaned" = ${IsOrphaned}
            "authorizedHumanIdentities" = ${AuthorizedHumanIdentities}
            "blastRadiusSummary" = ${BlastRadiusSummary}
        }

        return $PSO
    }

}