business-applications/src/PSSailpoint.BusinessApplications/Model/MCPServer.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

An MCP (Model Context Protocol) server discovered for the tenant and tracked as a Business Application.

.PARAMETER Id
MCP server ID.
.PARAMETER ServerName
MCP server name.
.PARAMETER SanctionedStatus
Sanctioned status of the MCP server. MCP servers are currently always `UNKNOWN`.
.PARAMETER Description
MCP server description.
.PARAMETER Version
MCP server version.
.PARAMETER Remotes
Remote endpoints the MCP server can be reached at.
.PARAMETER Packages
Packages the MCP server can be installed or launched from.
.PARAMETER ConnectedAgentCount
Number of AI agents connected to the MCP server.
.PARAMETER Created
Date and time the MCP server was created.
.PARAMETER Modified
Date and time the MCP server was last modified.
.OUTPUTS

MCPServer<PSCustomObject>
#>


function Initialize-MCPServer {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Id},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${ServerName},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [ValidateSet("SANCTIONED", "UNSANCTIONED", "UNKNOWN")]
        [PSCustomObject]
        ${SanctionedStatus},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Description},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Version},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String[]]
        ${Remotes},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject[]]
        ${Packages},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int64]]
        ${ConnectedAgentCount},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${Created},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${Modified}
    )

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


        $PSO = [PSCustomObject]@{
            "id" = ${Id}
            "serverName" = ${ServerName}
            "sanctionedStatus" = ${SanctionedStatus}
            "description" = ${Description}
            "version" = ${Version}
            "remotes" = ${Remotes}
            "packages" = ${Packages}
            "connectedAgentCount" = ${ConnectedAgentCount}
            "created" = ${Created}
            "modified" = ${Modified}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to MCPServer<PSCustomObject>

.DESCRIPTION

Convert from JSON to MCPServer<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

MCPServer<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in MCPServer
        $AllProperties = ("id", "serverName", "sanctionedStatus", "description", "version", "remotes", "packages", "connectedAgentCount", "created", "modified")
        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 "id"))) { #optional property not found
            $Id = $null
        } else {
            $Id = $JsonParameters.PSobject.Properties["id"].value
        }

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

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

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

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

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

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

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

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

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

        $PSO = [PSCustomObject]@{
            "id" = ${Id}
            "serverName" = ${ServerName}
            "sanctionedStatus" = ${SanctionedStatus}
            "description" = ${Description}
            "version" = ${Version}
            "remotes" = ${Remotes}
            "packages" = ${Packages}
            "connectedAgentCount" = ${ConnectedAgentCount}
            "created" = ${Created}
            "modified" = ${Modified}
        }

        return $PSO
    }

}