Model/ConnectorDetail1.ps1

#
# Identity Security Cloud V2024 API
# Use these APIs to interact with the Identity Security Cloud 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: v2024
# Generated by OpenAPI Generator: https://openapi-generator.tech
#

<#
.SYNOPSIS

No summary available.

.DESCRIPTION

No description available.

.PARAMETER Name
The connector name
.PARAMETER SourceConfigXml
XML representation of the source config data
.PARAMETER SourceConfig
JSON representation of the source config data
.PARAMETER DirectConnect
true if the source is a direct connect source
.PARAMETER FileUpload
Connector config's file upload attribute, false if not there
.PARAMETER UploadedFiles
List of uploaded file strings for the connector
.PARAMETER ConnectorMetadata
Object containing metadata pertinent to the UI to be used
.OUTPUTS

ConnectorDetail1<PSCustomObject>
#>


function Initialize-V2024ConnectorDetail1 {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Name},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${SourceConfigXml},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${SourceConfig},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${DirectConnect},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${FileUpload},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${UploadedFiles},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${ConnectorMetadata}
    )

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


        $PSO = [PSCustomObject]@{
            "name" = ${Name}
            "sourceConfigXml" = ${SourceConfigXml}
            "sourceConfig" = ${SourceConfig}
            "directConnect" = ${DirectConnect}
            "fileUpload" = ${FileUpload}
            "uploadedFiles" = ${UploadedFiles}
            "connectorMetadata" = ${ConnectorMetadata}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to ConnectorDetail1<PSCustomObject>

.DESCRIPTION

Convert from JSON to ConnectorDetail1<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

ConnectorDetail1<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in V2024ConnectorDetail1
        $AllProperties = ("name", "sourceConfigXml", "sourceConfig", "directConnect", "fileUpload", "uploadedFiles", "connectorMetadata")
        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 "name"))) { #optional property not found
            $Name = $null
        } else {
            $Name = $JsonParameters.PSobject.Properties["name"].value
        }

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

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

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

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

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

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

        $PSO = [PSCustomObject]@{
            "name" = ${Name}
            "sourceConfigXml" = ${SourceConfigXml}
            "sourceConfig" = ${SourceConfig}
            "directConnect" = ${DirectConnect}
            "fileUpload" = ${FileUpload}
            "uploadedFiles" = ${UploadedFiles}
            "connectorMetadata" = ${ConnectorMetadata}
        }

        return $PSO
    }

}