beta/src/PSSailpointBeta/Model/ConnectorDetail.ps1

#
# IdentityNow Beta API
# Use these APIs to interact with the IdentityNow platform to achieve repeatable, automated processes with greater scalability. These APIs are in beta and are subject to change. 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: 3.1.0-beta
# 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

ConnectorDetail<PSCustomObject>
#>


function Initialize-BetaConnectorDetail {
    [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: PSSailpointBeta => BetaConnectorDetail' | 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 ConnectorDetail<PSCustomObject>

.DESCRIPTION

Convert from JSON to ConnectorDetail<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

ConnectorDetail<PSCustomObject>
#>

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

    Process {
        'Converting JSON to PSCustomObject: PSSailpointBeta => BetaConnectorDetail' | Write-Debug
        $PSBoundParameters | Out-DebugParameter | Write-Debug

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in BetaConnectorDetail
        $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
    }

}