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

A package an MCP server can be installed or launched from. Every property is always present in the response and is `null` when the registry does not supply it.

.PARAMETER RegistryType
Package registry that hosts the package.
.PARAMETER Identifier
Package identifier within the registry.
.PARAMETER Command
Command used to launch the package.
.PARAMETER VarArgs
Arguments passed to the launch command, in the order they are applied.
.OUTPUTS

MCPPackage<PSCustomObject>
#>


function Initialize-MCPPackage {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${RegistryType},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Identifier},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Command},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String[]]
        ${VarArgs}
    )

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


        $PSO = [PSCustomObject]@{
            "registryType" = ${RegistryType}
            "identifier" = ${Identifier}
            "command" = ${Command}
            "args" = ${VarArgs}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to MCPPackage<PSCustomObject>

.DESCRIPTION

Convert from JSON to MCPPackage<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

MCPPackage<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in MCPPackage
        $AllProperties = ("registryType", "identifier", "command", "args")
        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 "registryType"))) { #optional property not found
            $RegistryType = $null
        } else {
            $RegistryType = $JsonParameters.PSobject.Properties["registryType"].value
        }

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

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

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

        $PSO = [PSCustomObject]@{
            "registryType" = ${RegistryType}
            "identifier" = ${Identifier}
            "command" = ${Command}
            "args" = ${VarArgs}
        }

        return $PSO
    }

}