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(Position = 0, ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Name},
        [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true)]
        [String]
        ${SourceConfigXml},
        [Parameter(Position = 2, ValueFromPipelineByPropertyName = $true)]
        [String]
        ${SourceConfig},
        [Parameter(Position = 3, ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${DirectConnect},
        [Parameter(Position = 4, ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${FileUpload},
        [Parameter(Position = 5, ValueFromPipelineByPropertyName = $true)]
        [String]
        ${UploadedFiles},
        [Parameter(Position = 6, 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
    }

}