Model/SpConfigRules.ps1

#
# Identity Security Cloud Beta API
# Use these APIs to interact with the Identity Security Cloud platform to achieve repeatable, automated processes with greater scalability. These APIs are in beta and are subject to change. 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.1.0-beta
# Generated by OpenAPI Generator: https://openapi-generator.tech
#

<#
.SYNOPSIS

No summary available.

.DESCRIPTION

Rules to be applied to the config object during draft process

.PARAMETER TakeFromTargetRules
No description available.
.PARAMETER DefaultRules
No description available.
.PARAMETER Editable
Whether this object can be edited
.OUTPUTS

SpConfigRules<PSCustomObject>
#>


function Initialize-BetaSpConfigRules {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject[]]
        ${TakeFromTargetRules},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject[]]
        ${DefaultRules},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${Editable} = $false
    )

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


        $PSO = [PSCustomObject]@{
            "takeFromTargetRules" = ${TakeFromTargetRules}
            "defaultRules" = ${DefaultRules}
            "editable" = ${Editable}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to SpConfigRules<PSCustomObject>

.DESCRIPTION

Convert from JSON to SpConfigRules<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

SpConfigRules<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in BetaSpConfigRules
        $AllProperties = ("takeFromTargetRules", "defaultRules", "editable")
        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 "takeFromTargetRules"))) { #optional property not found
            $TakeFromTargetRules = $null
        } else {
            $TakeFromTargetRules = $JsonParameters.PSobject.Properties["takeFromTargetRules"].value
        }

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

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

        $PSO = [PSCustomObject]@{
            "takeFromTargetRules" = ${TakeFromTargetRules}
            "defaultRules" = ${DefaultRules}
            "editable" = ${Editable}
        }

        return $PSO
    }

}