Model/SpConfigObject.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

Response model for get object configuration.

.PARAMETER ObjectType
The object type this configuration is for.
.PARAMETER ReferenceExtractors
List of json paths within an exported object of this type that represent references that need to be resolved.
.PARAMETER SignatureRequired
If true, this type of object will be JWS signed and cannot be modified before import.
.PARAMETER LegacyObject
Whether this is a legacy object
.PARAMETER OnePerTenant
Whether there is only one object of this type
.PARAMETER Exportable
Whether this object can be exported or it is just a reference object
.PARAMETER Rules
No description available.
.OUTPUTS

SpConfigObject<PSCustomObject>
#>


function Initialize-BetaSpConfigObject {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${ObjectType},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String[]]
        ${ReferenceExtractors},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${SignatureRequired} = $false,
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${LegacyObject} = $false,
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${OnePerTenant} = $false,
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${Exportable} = $false,
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Rules}
    )

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


        $PSO = [PSCustomObject]@{
            "objectType" = ${ObjectType}
            "referenceExtractors" = ${ReferenceExtractors}
            "signatureRequired" = ${SignatureRequired}
            "legacyObject" = ${LegacyObject}
            "onePerTenant" = ${OnePerTenant}
            "exportable" = ${Exportable}
            "rules" = ${Rules}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to SpConfigObject<PSCustomObject>

.DESCRIPTION

Convert from JSON to SpConfigObject<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

SpConfigObject<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in BetaSpConfigObject
        $AllProperties = ("objectType", "referenceExtractors", "signatureRequired", "legacyObject", "onePerTenant", "exportable", "rules")
        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 "objectType"))) { #optional property not found
            $ObjectType = $null
        } else {
            $ObjectType = $JsonParameters.PSobject.Properties["objectType"].value
        }

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

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

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

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

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

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

        $PSO = [PSCustomObject]@{
            "objectType" = ${ObjectType}
            "referenceExtractors" = ${ReferenceExtractors}
            "signatureRequired" = ${SignatureRequired}
            "legacyObject" = ${LegacyObject}
            "onePerTenant" = ${OnePerTenant}
            "exportable" = ${Exportable}
            "rules" = ${Rules}
        }

        return $PSO
    }

}