v2025/src/PSSailpoint.V2025/Model/SourceItemRef.ps1

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

<#
.SYNOPSIS

No summary available.

.DESCRIPTION

No description available.

.PARAMETER SourceId
The id for the source on which account selections are made
.PARAMETER Accounts
A list of account selections on the source. Currently, only one selection per source is supported.
.OUTPUTS

SourceItemRef<PSCustomObject>
#>


function Initialize-V2025SourceItemRef {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${SourceId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject[]]
        ${Accounts}
    )

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


        $PSO = [PSCustomObject]@{
            "sourceId" = ${SourceId}
            "accounts" = ${Accounts}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to SourceItemRef<PSCustomObject>

.DESCRIPTION

Convert from JSON to SourceItemRef<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

SourceItemRef<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in V2025SourceItemRef
        $AllProperties = ("sourceId", "accounts")
        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 "sourceId"))) { #optional property not found
            $SourceId = $null
        } else {
            $SourceId = $JsonParameters.PSobject.Properties["sourceId"].value
        }

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

        $PSO = [PSCustomObject]@{
            "sourceId" = ${SourceId}
            "accounts" = ${Accounts}
        }

        return $PSO
    }

}