machine-accounts/src/PSSailpoint.MachineAccounts/Model/MachineAccountLinkedMachineIdentityAllOfOwners.ps1

#
# SailPoint Identity Security API - Machine Accounts
# Use these APIs to interact with the SailPoint Identity Security 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

The owners of the machine identity.

.PARAMETER PrimaryIdentity
The identity selected as the primary owner.
.PARAMETER SecondaryIdentities
The identities selected as secondary owners.
.OUTPUTS

MachineAccountLinkedMachineIdentityAllOfOwners<PSCustomObject>
#>


function Initialize-MachineAccountLinkedMachineIdentityAllOfOwners {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${PrimaryIdentity},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject[]]
        ${SecondaryIdentities}
    )

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


        $PSO = [PSCustomObject]@{
            "primaryIdentity" = ${PrimaryIdentity}
            "secondaryIdentities" = ${SecondaryIdentities}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to MachineAccountLinkedMachineIdentityAllOfOwners<PSCustomObject>

.DESCRIPTION

Convert from JSON to MachineAccountLinkedMachineIdentityAllOfOwners<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

MachineAccountLinkedMachineIdentityAllOfOwners<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

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

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

        $PSO = [PSCustomObject]@{
            "primaryIdentity" = ${PrimaryIdentity}
            "secondaryIdentities" = ${SecondaryIdentities}
        }

        return $PSO
    }

}