v2024/src/PSSailpoint.V2024/Model/UserApp.ps1

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

<#
.SYNOPSIS

No summary available.

.DESCRIPTION

No description available.

.PARAMETER Id
The user app id
.PARAMETER Created
Time when the user app was created
.PARAMETER Modified
Time when the user app was last modified
.PARAMETER HasMultipleAccounts
True if the owner has multiple accounts for the source
.PARAMETER UseForPasswordManagement
True if the source has password feature
.PARAMETER ProvisionRequestEnabled
True if the source app related to the user app is provision request enabled
.PARAMETER AppCenterEnabled
True if the source app related to the user app is shown in the app center
.PARAMETER SourceApp
No description available.
.PARAMETER Source
No description available.
.PARAMETER Account
No description available.
.PARAMETER Owner
No description available.
.OUTPUTS

UserApp<PSCustomObject>
#>


function Initialize-V2024UserApp {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Id},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${Created},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${Modified},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${HasMultipleAccounts} = $false,
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${UseForPasswordManagement} = $false,
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${ProvisionRequestEnabled} = $false,
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${AppCenterEnabled} = $true,
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${SourceApp},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Source},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Account},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Owner}
    )

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


        $PSO = [PSCustomObject]@{
            "id" = ${Id}
            "created" = ${Created}
            "modified" = ${Modified}
            "hasMultipleAccounts" = ${HasMultipleAccounts}
            "useForPasswordManagement" = ${UseForPasswordManagement}
            "provisionRequestEnabled" = ${ProvisionRequestEnabled}
            "appCenterEnabled" = ${AppCenterEnabled}
            "sourceApp" = ${SourceApp}
            "source" = ${Source}
            "account" = ${Account}
            "owner" = ${Owner}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to UserApp<PSCustomObject>

.DESCRIPTION

Convert from JSON to UserApp<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

UserApp<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in V2024UserApp
        $AllProperties = ("id", "created", "modified", "hasMultipleAccounts", "useForPasswordManagement", "provisionRequestEnabled", "appCenterEnabled", "sourceApp", "source", "account", "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 "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 "hasMultipleAccounts"))) { #optional property not found
            $HasMultipleAccounts = $null
        } else {
            $HasMultipleAccounts = $JsonParameters.PSobject.Properties["hasMultipleAccounts"].value
        }

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

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

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

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "account"))) { #optional property not found
            $Account = $null
        } else {
            $Account = $JsonParameters.PSobject.Properties["account"].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}
            "created" = ${Created}
            "modified" = ${Modified}
            "hasMultipleAccounts" = ${HasMultipleAccounts}
            "useForPasswordManagement" = ${UseForPasswordManagement}
            "provisionRequestEnabled" = ${ProvisionRequestEnabled}
            "appCenterEnabled" = ${AppCenterEnabled}
            "sourceApp" = ${SourceApp}
            "source" = ${Source}
            "account" = ${Account}
            "owner" = ${Owner}
        }

        return $PSO
    }

}