Model/MCPServerCounts.ps1

#
# SailPoint Identity Security API - Business Applications
# 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

Tenant-wide MCP server totals. All values are `0` when the tenant has no MCP servers.

.PARAMETER RegistryEntries
Total number of MCP servers in the tenant.
.PARAMETER Remote
Number of MCP servers that have at least one remote endpoint.
.PARAMETER ConnectedAgentCount
Number of distinct AI agents connected to at least one MCP server. An agent connected to several MCP servers is counted once, so this can be less than the sum of each server's `connectedAgentCount`.
.OUTPUTS

MCPServerCounts<PSCustomObject>
#>


function Initialize-MCPServerCounts {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int64]]
        ${RegistryEntries},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int64]]
        ${Remote},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int64]]
        ${ConnectedAgentCount}
    )

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


        $PSO = [PSCustomObject]@{
            "registryEntries" = ${RegistryEntries}
            "remote" = ${Remote}
            "connectedAgentCount" = ${ConnectedAgentCount}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to MCPServerCounts<PSCustomObject>

.DESCRIPTION

Convert from JSON to MCPServerCounts<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

MCPServerCounts<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

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

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

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

        $PSO = [PSCustomObject]@{
            "registryEntries" = ${RegistryEntries}
            "remote" = ${Remote}
            "connectedAgentCount" = ${ConnectedAgentCount}
        }

        return $PSO
    }

}