Model/Identitycollectortype.ps1

#
# Identity Security Cloud API - Data Access Security
# 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: v1
# Generated by OpenAPI Generator: https://openapi-generator.tech
#

<#
.SYNOPSIS

No summary available.

.DESCRIPTION

A public identity collector type and the ISC `connectorName` values the UI should use when querying `GET /v3/sources` for sources that can back that type.

.PARAMETER Type
Identity collector type display name. Matches the `type` values returned by list and used by create/update metadata. Base types only (for example `Box`, not `Box SaaS`).
.PARAMETER IscConnectorNames
Exact ISC `connectorName` values to use in `GET /v3/sources` filters (`connectorName eq ""...""`). These are not always equal to `type` (for example Google Drive maps to `G Suite` and `Google Workspace SaaS`).
.OUTPUTS

Identitycollectortype<PSCustomObject>
#>


function Initialize-Identitycollectortype {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Type},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String[]]
        ${IscConnectorNames}
    )

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

        if (!$Type) {
            throw "invalid value for 'Type', 'Type' cannot be null."
        }

        if (!$IscConnectorNames) {
            throw "invalid value for 'IscConnectorNames', 'IscConnectorNames' cannot be null."
        }


        $PSO = [PSCustomObject]@{
            "type" = ${Type}
            "iscConnectorNames" = ${IscConnectorNames}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to Identitycollectortype<PSCustomObject>

.DESCRIPTION

Convert from JSON to Identitycollectortype<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

Identitycollectortype<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in Identitycollectortype
        $AllProperties = ("type", "iscConnectorNames")
        foreach ($name in $JsonParameters.PsObject.Properties.Name) {
            if (!($AllProperties.Contains($name))) {
                throw "Error! JSON key '$name' not found in the properties: $($AllProperties)"
            }
        }

        If ([string]::IsNullOrEmpty($Json) -or $Json -eq "{}") { # empty json
            throw "Error! Empty JSON cannot be serialized due to the required property 'type' missing."
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "type"))) {
            throw "Error! JSON cannot be serialized due to the required property 'type' missing."
        } else {
            $Type = $JsonParameters.PSobject.Properties["type"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "iscConnectorNames"))) {
            throw "Error! JSON cannot be serialized due to the required property 'iscConnectorNames' missing."
        } else {
            $IscConnectorNames = $JsonParameters.PSobject.Properties["iscConnectorNames"].value
        }

        $PSO = [PSCustomObject]@{
            "type" = ${Type}
            "iscConnectorNames" = ${IscConnectorNames}
        }

        return $PSO
    }

}