Model/SourceApp.ps1

#
# Identity Security Cloud Beta API
# Use these APIs to interact with the Identity Security Cloud 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 Id
The source app id
.PARAMETER CloudAppId
The deprecated source app id
.PARAMETER Name
The source app name
.PARAMETER Created
Time when the source app was created
.PARAMETER Modified
Time when the source app was last modified
.PARAMETER Enabled
True if the source app is enabled
.PARAMETER ProvisionRequestEnabled
True if the source app is provision request enabled
.PARAMETER Description
The description of the source app
.PARAMETER MatchAllAccounts
True if the source app match all accounts
.PARAMETER AppCenterEnabled
True if the source app is shown in the app center
.PARAMETER AccountSource
No description available.
.PARAMETER Owner
No description available.
.OUTPUTS

SourceApp<PSCustomObject>
#>


function Initialize-BetaSourceApp {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Id},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${CloudAppId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Name},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${Created},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${Modified},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${Enabled} = $false,
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${ProvisionRequestEnabled} = $false,
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Description},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${MatchAllAccounts} = $false,
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${AppCenterEnabled} = $true,
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${AccountSource},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Owner}
    )

    Process {
        'Creating PSCustomObject: Tm.Beta => BetaSourceApp' | Write-Debug
        $PSBoundParameters | Out-DebugParameter | Write-Debug


        $PSO = [PSCustomObject]@{
            "id" = ${Id}
            "cloudAppId" = ${CloudAppId}
            "name" = ${Name}
            "created" = ${Created}
            "modified" = ${Modified}
            "enabled" = ${Enabled}
            "provisionRequestEnabled" = ${ProvisionRequestEnabled}
            "description" = ${Description}
            "matchAllAccounts" = ${MatchAllAccounts}
            "appCenterEnabled" = ${AppCenterEnabled}
            "accountSource" = ${AccountSource}
            "owner" = ${Owner}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to SourceApp<PSCustomObject>

.DESCRIPTION

Convert from JSON to SourceApp<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

SourceApp<PSCustomObject>
#>

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

    Process {
        'Converting JSON to PSCustomObject: Tm.Beta => BetaSourceApp' | Write-Debug
        $PSBoundParameters | Out-DebugParameter | Write-Debug

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in BetaSourceApp
        $AllProperties = ("id", "cloudAppId", "name", "created", "modified", "enabled", "provisionRequestEnabled", "description", "matchAllAccounts", "appCenterEnabled", "accountSource", "owner")
        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 "id"))) { #optional property not found
            $Id = $null
        } else {
            $Id = $JsonParameters.PSobject.Properties["id"].value
        }

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

        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 "created"))) { #optional property not found
            $Created = $null
        } else {
            $Created = $JsonParameters.PSobject.Properties["created"].value
        }

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

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

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "provisionRequestEnabled"))) { #optional property not found
            $ProvisionRequestEnabled = $null
        } else {
            $ProvisionRequestEnabled = $JsonParameters.PSobject.Properties["provisionRequestEnabled"].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 "matchAllAccounts"))) { #optional property not found
            $MatchAllAccounts = $null
        } else {
            $MatchAllAccounts = $JsonParameters.PSobject.Properties["matchAllAccounts"].value
        }

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

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

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

        $PSO = [PSCustomObject]@{
            "id" = ${Id}
            "cloudAppId" = ${CloudAppId}
            "name" = ${Name}
            "created" = ${Created}
            "modified" = ${Modified}
            "enabled" = ${Enabled}
            "provisionRequestEnabled" = ${ProvisionRequestEnabled}
            "description" = ${Description}
            "matchAllAccounts" = ${MatchAllAccounts}
            "appCenterEnabled" = ${AppCenterEnabled}
            "accountSource" = ${AccountSource}
            "owner" = ${Owner}
        }

        return $PSO
    }

}