Model/PublicIdentityVisibleAttributes.ps1

#
# Identity Security Cloud API - Public Identities
# 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: v1
# Generated by OpenAPI Generator: https://openapi-generator.tech
#

<#
.SYNOPSIS

No summary available.

.DESCRIPTION

Default and configured identity attribute keys with display names exposed by the public identities API.

.PARAMETER DefaultAttributes
Always-available public-identity field keys for search and sort. Fixed platform list. `key` is the search field name; `name` is the display label.
.PARAMETER ConfiguredAttributes
Tenant-configured public attributes from public-identities config (same source as public-identities-config). These keys are also allowed in search/sort and appear under `attributes` on search results.
.OUTPUTS

PublicIdentityVisibleAttributes<PSCustomObject>
#>


function Initialize-PublicIdentityVisibleAttributes {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject[]]
        ${DefaultAttributes},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject[]]
        ${ConfiguredAttributes}
    )

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

        if (!$DefaultAttributes) {
            throw "invalid value for 'DefaultAttributes', 'DefaultAttributes' cannot be null."
        }

        if (!$ConfiguredAttributes) {
            throw "invalid value for 'ConfiguredAttributes', 'ConfiguredAttributes' cannot be null."
        }


        $PSO = [PSCustomObject]@{
            "defaultAttributes" = ${DefaultAttributes}
            "configuredAttributes" = ${ConfiguredAttributes}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to PublicIdentityVisibleAttributes<PSCustomObject>

.DESCRIPTION

Convert from JSON to PublicIdentityVisibleAttributes<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

PublicIdentityVisibleAttributes<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in PublicIdentityVisibleAttributes
        $AllProperties = ("defaultAttributes", "configuredAttributes")
        foreach ($name in $JsonParameters.PsObject.Properties.Name) {
            if (!($AllProperties.Contains($name))) {
                throw "Error! JSON key '$name' not found in the properties: $($AllProperties)"
            }
        }

        If ([string]::IsNullOrEmpty($Json) -or $Json -eq "{}") { # empty json
            throw "Error! Empty JSON cannot be serialized due to the required property 'defaultAttributes' missing."
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "defaultAttributes"))) {
            throw "Error! JSON cannot be serialized due to the required property 'defaultAttributes' missing."
        } else {
            $DefaultAttributes = $JsonParameters.PSobject.Properties["defaultAttributes"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "configuredAttributes"))) {
            throw "Error! JSON cannot be serialized due to the required property 'configuredAttributes' missing."
        } else {
            $ConfiguredAttributes = $JsonParameters.PSobject.Properties["configuredAttributes"].value
        }

        $PSO = [PSCustomObject]@{
            "defaultAttributes" = ${DefaultAttributes}
            "configuredAttributes" = ${ConfiguredAttributes}
        }

        return $PSO
    }

}