v3/src/PSSailpoint/Model/BaseAccount.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 unique ID of the referenced object.
.PARAMETER Name
The human readable name of the referenced object.
.PARAMETER AccountId
The ID of the account
.PARAMETER Source
No description available.
.PARAMETER Disabled
Indicates if the account is disabled
.PARAMETER Locked
Indicates if the account is locked
.PARAMETER Privileged
No description available.
.PARAMETER ManuallyCorrelated
Indicates if the account has been manually correlated to an identity
.PARAMETER PasswordLastSet
A date-time in ISO-8601 format
.PARAMETER EntitlementAttributes
a map or dictionary of key/value pairs
.PARAMETER Created
A date-time in ISO-8601 format
.OUTPUTS

BaseAccount<PSCustomObject>
#>


function Initialize-BaseAccount {
    [CmdletBinding()]
    Param (
        [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Id},
        [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Name},
        [Parameter(Position = 2, ValueFromPipelineByPropertyName = $true)]
        [String]
        ${AccountId},
        [Parameter(Position = 3, ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Source},
        [Parameter(Position = 4, ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${Disabled},
        [Parameter(Position = 5, ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${Locked},
        [Parameter(Position = 6, ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${Privileged},
        [Parameter(Position = 7, ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${ManuallyCorrelated},
        [Parameter(Position = 8, ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${PasswordLastSet},
        [Parameter(Position = 9, ValueFromPipelineByPropertyName = $true)]
        [System.Collections.Hashtable]
        ${EntitlementAttributes},
        [Parameter(Position = 10, ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${Created}
    )

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


        $PSO = [PSCustomObject]@{
            "id" = ${Id}
            "name" = ${Name}
            "accountId" = ${AccountId}
            "source" = ${Source}
            "disabled" = ${Disabled}
            "locked" = ${Locked}
            "privileged" = ${Privileged}
            "manuallyCorrelated" = ${ManuallyCorrelated}
            "passwordLastSet" = ${PasswordLastSet}
            "entitlementAttributes" = ${EntitlementAttributes}
            "created" = ${Created}
        }


        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to BaseAccount<PSCustomObject>

.DESCRIPTION

Convert from JSON to BaseAccount<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

BaseAccount<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in BaseAccount
        $AllProperties = ("id", "name", "accountId", "source", "disabled", "locked", "privileged", "manuallyCorrelated", "passwordLastSet", "entitlementAttributes", "created")
        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 "accountId"))) { #optional property not found
            $AccountId = $null
        } else {
            $AccountId = $JsonParameters.PSobject.Properties["accountId"].value
        }

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

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

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

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

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

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

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

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

        $PSO = [PSCustomObject]@{
            "id" = ${Id}
            "name" = ${Name}
            "accountId" = ${AccountId}
            "source" = ${Source}
            "disabled" = ${Disabled}
            "locked" = ${Locked}
            "privileged" = ${Privileged}
            "manuallyCorrelated" = ${ManuallyCorrelated}
            "passwordLastSet" = ${PasswordLastSet}
            "entitlementAttributes" = ${EntitlementAttributes}
            "created" = ${Created}
        }

        return $PSO
    }

}