machine-identities/src/PSSailpoint.MachineIdentities/Model/AnomalyBaseline.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

Peer-group baseline for time-series anomaly detections (SIEM source only). Contains the windowed data points and deviation thresholds used to render the anomaly chart.

.PARAMETER UiFeatureName
Name of the feature the baseline describes.
.PARAMETER WindowSize
Number of data points in the window.
.PARAMETER Values
Observed values across the window.
.PARAMETER RawValue
Raw observed values across the window.
.PARAMETER UpperBound
Upper deviation threshold per data point.
.PARAMETER LowerBound
Lower deviation threshold per data point.
.PARAMETER MinimumValue
Minimum value in the window.
.PARAMETER FprValue
False-positive-rate threshold value.
.OUTPUTS

AnomalyBaseline<PSCustomObject>
#>


function Initialize-AnomalyBaseline {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${UiFeatureName},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int32]]
        ${WindowSize},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [Int32[]]
        ${Values},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String[]]
        ${RawValue},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [Double[]]
        ${UpperBound},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [Double[]]
        ${LowerBound},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int32]]
        ${MinimumValue},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Double]]
        ${FprValue}
    )

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


        $PSO = [PSCustomObject]@{
            "uiFeatureName" = ${UiFeatureName}
            "windowSize" = ${WindowSize}
            "values" = ${Values}
            "rawValue" = ${RawValue}
            "upperBound" = ${UpperBound}
            "lowerBound" = ${LowerBound}
            "minimumValue" = ${MinimumValue}
            "fprValue" = ${FprValue}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to AnomalyBaseline<PSCustomObject>

.DESCRIPTION

Convert from JSON to AnomalyBaseline<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

AnomalyBaseline<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in AnomalyBaseline
        $AllProperties = ("uiFeatureName", "windowSize", "values", "rawValue", "upperBound", "lowerBound", "minimumValue", "fprValue")
        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 "uiFeatureName"))) { #optional property not found
            $UiFeatureName = $null
        } else {
            $UiFeatureName = $JsonParameters.PSobject.Properties["uiFeatureName"].value
        }

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

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

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

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

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

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

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

        $PSO = [PSCustomObject]@{
            "uiFeatureName" = ${UiFeatureName}
            "windowSize" = ${WindowSize}
            "values" = ${Values}
            "rawValue" = ${RawValue}
            "upperBound" = ${UpperBound}
            "lowerBound" = ${LowerBound}
            "minimumValue" = ${MinimumValue}
            "fprValue" = ${FprValue}
        }

        return $PSO
    }

}