machine-identities/src/PSSailpoint.MachineIdentities/Model/AnomalyEvidence.ps1

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

Detection evidence associated with an anomaly. SENTINEL detections populate the agent attribute fields; SIEM detections instead include a baseline with windowed time-series data.

.PARAMETER Source
Evidence source system.
.PARAMETER Timestamp
No description available.
.PARAMETER AgentAttributeType
Attribute type captured for SENTINEL detections; null for SIEM detections.
.PARAMETER AgentAttributeValue
Attribute value captured for SENTINEL detections; null for SIEM detections.
.PARAMETER Baseline
Peer-group baseline for SIEM detections; null for SENTINEL detections.
.OUTPUTS

AnomalyEvidence<PSCustomObject>
#>


function Initialize-AnomalyEvidence {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Source},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Timestamp},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${AgentAttributeType},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${AgentAttributeValue},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Baseline}
    )

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


        $PSO = [PSCustomObject]@{
            "source" = ${Source}
            "timestamp" = ${Timestamp}
            "agentAttributeType" = ${AgentAttributeType}
            "agentAttributeValue" = ${AgentAttributeValue}
            "baseline" = ${Baseline}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to AnomalyEvidence<PSCustomObject>

.DESCRIPTION

Convert from JSON to AnomalyEvidence<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

AnomalyEvidence<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in AnomalyEvidence
        $AllProperties = ("source", "timestamp", "agentAttributeType", "agentAttributeValue", "baseline")
        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 "source"))) { #optional property not found
            $Source = $null
        } else {
            $Source = $JsonParameters.PSobject.Properties["source"].value
        }

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

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

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

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

        $PSO = [PSCustomObject]@{
            "source" = ${Source}
            "timestamp" = ${Timestamp}
            "agentAttributeType" = ${AgentAttributeType}
            "agentAttributeValue" = ${AgentAttributeValue}
            "baseline" = ${Baseline}
        }

        return $PSO
    }

}