v3/src/PSSailpoint/Model/Schema.ps1

#
# IdentityNow V3 API
# Use these APIs to interact with the IdentityNow 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: 3.0.0
# Generated by OpenAPI Generator: https://openapi-generator.tech
#

<#
.SYNOPSIS

No summary available.

.DESCRIPTION

No description available.

.PARAMETER Id
The id of the Schema.
.PARAMETER Name
The name of the Schema.
.PARAMETER NativeObjectType
The name of the object type on the native system that the schema represents.
.PARAMETER IdentityAttribute
The name of the attribute used to calculate the unique identifier for an object in the schema.
.PARAMETER DisplayAttribute
The name of the attribute used to calculate the display value for an object in the schema.
.PARAMETER HierarchyAttribute
The name of the attribute whose values represent other objects in a hierarchy. Only relevant to group schemas.
.PARAMETER IncludePermissions
Flag indicating whether or not the include permissions with the object data when aggregating the schema.
.PARAMETER Features
The features that the schema supports.
.PARAMETER Configuration
Holds any extra configuration data that the schema may require.
.PARAMETER Attributes
The attribute definitions which form the schema.
.PARAMETER Created
The date the Schema was created.
.PARAMETER Modified
The date the Schema was last modified.
.OUTPUTS

Schema<PSCustomObject>
#>


function Initialize-Schema {
    [CmdletBinding()]
    Param (
        [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Id},
        [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Name},
        [Parameter(Position = 2, ValueFromPipelineByPropertyName = $true)]
        [String]
        ${NativeObjectType},
        [Parameter(Position = 3, ValueFromPipelineByPropertyName = $true)]
        [String]
        ${IdentityAttribute},
        [Parameter(Position = 4, ValueFromPipelineByPropertyName = $true)]
        [String]
        ${DisplayAttribute},
        [Parameter(Position = 5, ValueFromPipelineByPropertyName = $true)]
        [String]
        ${HierarchyAttribute},
        [Parameter(Position = 6, ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${IncludePermissions},
        [Parameter(Position = 7, ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject[]]
        ${Features},
        [Parameter(Position = 8, ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Configuration},
        [Parameter(Position = 9, ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject[]]
        ${Attributes},
        [Parameter(Position = 10, ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${Created},
        [Parameter(Position = 11, ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${Modified}
    )

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


        $PSO = [PSCustomObject]@{
            "id" = ${Id}
            "name" = ${Name}
            "nativeObjectType" = ${NativeObjectType}
            "identityAttribute" = ${IdentityAttribute}
            "displayAttribute" = ${DisplayAttribute}
            "hierarchyAttribute" = ${HierarchyAttribute}
            "includePermissions" = ${IncludePermissions}
            "features" = ${Features}
            "configuration" = ${Configuration}
            "attributes" = ${Attributes}
            "created" = ${Created}
            "modified" = ${Modified}
        }


        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to Schema<PSCustomObject>

.DESCRIPTION

Convert from JSON to Schema<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

Schema<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in Schema
        $AllProperties = ("id", "name", "nativeObjectType", "identityAttribute", "displayAttribute", "hierarchyAttribute", "includePermissions", "features", "configuration", "attributes", "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 "id"))) { #optional property not found
            $Id = $null
        } else {
            $Id = $JsonParameters.PSobject.Properties["id"].value
        }

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

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

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

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

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

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

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

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

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "attributes"))) { #optional property not found
            $Attributes = $null
        } else {
            $Attributes = $JsonParameters.PSobject.Properties["attributes"].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]@{
            "id" = ${Id}
            "name" = ${Name}
            "nativeObjectType" = ${NativeObjectType}
            "identityAttribute" = ${IdentityAttribute}
            "displayAttribute" = ${DisplayAttribute}
            "hierarchyAttribute" = ${HierarchyAttribute}
            "includePermissions" = ${IncludePermissions}
            "features" = ${Features}
            "configuration" = ${Configuration}
            "attributes" = ${Attributes}
            "created" = ${Created}
            "modified" = ${Modified}
        }

        return $PSO
    }

}