Model/MachineClassificationConfig.ps1

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

<#
.SYNOPSIS

No summary available.

.DESCRIPTION

No description available.

.PARAMETER Enabled
Indicates if the Classification is enabled for a Source
.PARAMETER ClassificationMethod
Classification Method
.PARAMETER Criteria
A classification criteria object
.PARAMETER Created
Time when the config was created
.PARAMETER Modified
Time when the config was last updated
.OUTPUTS

MachineClassificationConfig<PSCustomObject>
#>


function Initialize-V2024MachineClassificationConfig {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${Enabled} = $false,
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [ValidateSet("SOURCE")]
        [String]
        ${ClassificationMethod},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Criteria},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${Created},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${Modified}
    )

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


        $PSO = [PSCustomObject]@{
            "enabled" = ${Enabled}
            "classificationMethod" = ${ClassificationMethod}
            "criteria" = ${Criteria}
            "created" = ${Created}
            "modified" = ${Modified}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to MachineClassificationConfig<PSCustomObject>

.DESCRIPTION

Convert from JSON to MachineClassificationConfig<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

MachineClassificationConfig<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in V2024MachineClassificationConfig
        $AllProperties = ("enabled", "classificationMethod", "criteria", "created", "modified")
        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 "enabled"))) { #optional property not found
            $Enabled = $null
        } else {
            $Enabled = $JsonParameters.PSobject.Properties["enabled"].value
        }

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

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

        $PSO = [PSCustomObject]@{
            "enabled" = ${Enabled}
            "classificationMethod" = ${ClassificationMethod}
            "criteria" = ${Criteria}
            "created" = ${Created}
            "modified" = ${Modified}
        }

        return $PSO
    }

}