Model/MachineIdentityAllCounts.ps1

#
# SailPoint Identity Security API - Machine Identities
# 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

Number of machine identities and machine accounts owned by an identity.

.PARAMETER ApplicationIdentityCount
Number of application machine identities where the identity is a primary or secondary owner.
.PARAMETER AiAgentCount
Number of AI agent machine identities where the identity is a primary or secondary owner.
.PARAMETER MachineAccountsCount
Number of machine accounts owned by the identity.
.PARAMETER TotalCount
Sum of the application, AI agent, and machine account counts.
.OUTPUTS

MachineIdentityAllCounts<PSCustomObject>
#>


function Initialize-MachineIdentityAllCounts {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int64]]
        ${ApplicationIdentityCount},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int64]]
        ${AiAgentCount},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int64]]
        ${MachineAccountsCount},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int64]]
        ${TotalCount}
    )

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


        $PSO = [PSCustomObject]@{
            "applicationIdentityCount" = ${ApplicationIdentityCount}
            "aiAgentCount" = ${AiAgentCount}
            "machineAccountsCount" = ${MachineAccountsCount}
            "totalCount" = ${TotalCount}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to MachineIdentityAllCounts<PSCustomObject>

.DESCRIPTION

Convert from JSON to MachineIdentityAllCounts<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

MachineIdentityAllCounts<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in MachineIdentityAllCounts
        $AllProperties = ("applicationIdentityCount", "aiAgentCount", "machineAccountsCount", "totalCount")
        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 "applicationIdentityCount"))) { #optional property not found
            $ApplicationIdentityCount = $null
        } else {
            $ApplicationIdentityCount = $JsonParameters.PSobject.Properties["applicationIdentityCount"].value
        }

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

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

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

        $PSO = [PSCustomObject]@{
            "applicationIdentityCount" = ${ApplicationIdentityCount}
            "aiAgentCount" = ${AiAgentCount}
            "machineAccountsCount" = ${MachineAccountsCount}
            "totalCount" = ${TotalCount}
        }

        return $PSO
    }

}