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 object configuration.

.PARAMETER ObjectType
Object type the configuration is for.
.PARAMETER ReferenceExtractors
List of JSON paths within an exported object of this type, representing references that must be resolved.
.PARAMETER SignatureRequired
Indicates whether this type of object will be JWS signed and cannot be modified before import.
.PARAMETER AlwaysResolveById
Indicates whether this object type must be always be resolved by ID.
.PARAMETER LegacyObject
Indicates whether this is a legacy object.
.PARAMETER OnePerTenant
Indicates whether there is only one object of this type.
.PARAMETER Exportable
Indicates whether the object can be exported or 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]]
        ${AlwaysResolveById} = $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}
            "alwaysResolveById" = ${AlwaysResolveById}
            "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", "alwaysResolveById", "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 "alwaysResolveById"))) { #optional property not found
            $AlwaysResolveById = $null
        } else {
            $AlwaysResolveById = $JsonParameters.PSobject.Properties["alwaysResolveById"].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}
            "alwaysResolveById" = ${AlwaysResolveById}
            "legacyObject" = ${LegacyObject}
            "onePerTenant" = ${OnePerTenant}
            "exportable" = ${Exportable}
            "rules" = ${Rules}
        }

        return $PSO
    }

}