Model/BaseCreateApplicationRequest.ps1

#
# Identity Security Cloud V2025 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: v2025
# Generated by OpenAPI Generator: https://openapi-generator.tech
#

<#
.SYNOPSIS

No summary available.

.DESCRIPTION

No description available.

.PARAMETER ApplicationType
No description available.
.PARAMETER Name
The display name of the application.
.PARAMETER Description
A brief description of the application and its purpose.
.PARAMETER Tags
A list of tags to categorize or identify the application.
.PARAMETER IdentityCollectorId
The unique identifier for the identity collector associated with this application.
.PARAMETER AdIdentityCollectorId
The unique identifier for the AD identity collector.
.PARAMETER NisIdentityCollectorId
The unique identifier for the NIS identity collector.
.PARAMETER ApplicationCrawlerSettings
No description available.
.PARAMETER PermissionCollectorSettings
No description available.
.PARAMETER DataClassificationSettings
No description available.
.PARAMETER ActivityConfigurationSettings
No description available.
.PARAMETER ExecuteNow
If true, the application setup will be executed immediately after creation.
.OUTPUTS

BaseCreateApplicationRequest<PSCustomObject>
#>


function Initialize-V2025BaseCreateApplicationRequest {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [ValidateSet("1", "8", "9", "11", "15", "20", "21", "24", "25", "27", "28", "29", "33", "35", "37")]
        [PSCustomObject]
        ${ApplicationType},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Name},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Description},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject[]]
        ${Tags},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int64]]
        ${IdentityCollectorId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int64]]
        ${AdIdentityCollectorId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int64]]
        ${NisIdentityCollectorId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${ApplicationCrawlerSettings},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${PermissionCollectorSettings},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${DataClassificationSettings},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${ActivityConfigurationSettings},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${ExecuteNow} = $false
    )

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

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

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


        $PSO = [PSCustomObject]@{
            "applicationType" = ${ApplicationType}
            "name" = ${Name}
            "description" = ${Description}
            "tags" = ${Tags}
            "identityCollectorId" = ${IdentityCollectorId}
            "adIdentityCollectorId" = ${AdIdentityCollectorId}
            "nisIdentityCollectorId" = ${NisIdentityCollectorId}
            "applicationCrawlerSettings" = ${ApplicationCrawlerSettings}
            "permissionCollectorSettings" = ${PermissionCollectorSettings}
            "dataClassificationSettings" = ${DataClassificationSettings}
            "activityConfigurationSettings" = ${ActivityConfigurationSettings}
            "executeNow" = ${ExecuteNow}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to BaseCreateApplicationRequest<PSCustomObject>

.DESCRIPTION

Convert from JSON to BaseCreateApplicationRequest<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

BaseCreateApplicationRequest<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in V2025BaseCreateApplicationRequest
        $AllProperties = ("applicationType", "name", "description", "tags", "identityCollectorId", "adIdentityCollectorId", "nisIdentityCollectorId", "applicationCrawlerSettings", "permissionCollectorSettings", "dataClassificationSettings", "activityConfigurationSettings", "executeNow")
        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 'applicationType' missing."
        }

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

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

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

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

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

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

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

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

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

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

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

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

        $PSO = [PSCustomObject]@{
            "applicationType" = ${ApplicationType}
            "name" = ${Name}
            "description" = ${Description}
            "tags" = ${Tags}
            "identityCollectorId" = ${IdentityCollectorId}
            "adIdentityCollectorId" = ${AdIdentityCollectorId}
            "nisIdentityCollectorId" = ${NisIdentityCollectorId}
            "applicationCrawlerSettings" = ${ApplicationCrawlerSettings}
            "permissionCollectorSettings" = ${PermissionCollectorSettings}
            "dataClassificationSettings" = ${DataClassificationSettings}
            "activityConfigurationSettings" = ${ActivityConfigurationSettings}
            "executeNow" = ${ExecuteNow}
        }

        return $PSO
    }

}