access-requests/src/PSSailpoint.AccessRequests/Model/AccountItemRef.ps1

#
# Identity Security Cloud API - Access Requests
# 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

No description available.

.PARAMETER AccountUuid
The uuid for the account on the source, available under the 'objectguid' attribute * Corresponds to the account's unique identifier as returned by accounts-selection or the accounts APIs. * For machine identity GRANT_ACCESS / MODIFY_ACCESS, provide `accountUuid` and/or `nativeIdentity`. Submitted values must match a real machine account for the requested machine identity on the selected source.
.PARAMETER NativeIdentity
The 'distinguishedName' attribute for the account. * For machine identity GRANT_ACCESS / MODIFY_ACCESS, provide `accountUuid` and/or `nativeIdentity`. Submitted values must match a real machine account for the requested machine identity on the selected source.
.OUTPUTS

AccountItemRef<PSCustomObject>
#>


function Initialize-AccountItemRef {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${AccountUuid},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${NativeIdentity}
    )

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


        $PSO = [PSCustomObject]@{
            "accountUuid" = ${AccountUuid}
            "nativeIdentity" = ${NativeIdentity}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to AccountItemRef<PSCustomObject>

.DESCRIPTION

Convert from JSON to AccountItemRef<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

AccountItemRef<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

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

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

        $PSO = [PSCustomObject]@{
            "accountUuid" = ${AccountUuid}
            "nativeIdentity" = ${NativeIdentity}
        }

        return $PSO
    }

}