human-account-subtypes/src/PSSailpoint.HumanAccountSubtypes/Model/HumanAccountSubtypeConfigHumanAccountCreate.ps1

#
# SailPoint Identity Security API - Human Account Subtypes
# Use these APIs to interact with the SailPoint Identity Security 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

Account-create settings for the human account subtype.

.PARAMETER AccountCreateEnabled
Specifies if creation of human accounts is allowed for this subtype.
.PARAMETER ApprovalRequired
Specifies if approval is required for human account creation requests for this subtype.
.PARAMETER ApprovalConfig
No description available.
.PARAMETER FormId
ID of the form linked to the subtype.
.OUTPUTS

HumanAccountSubtypeConfigHumanAccountCreate<PSCustomObject>
#>


function Initialize-HumanAccountSubtypeConfigHumanAccountCreate {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${AccountCreateEnabled} = $false,
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${ApprovalRequired} = $false,
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${ApprovalConfig},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${FormId}
    )

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


        $PSO = [PSCustomObject]@{
            "accountCreateEnabled" = ${AccountCreateEnabled}
            "approvalRequired" = ${ApprovalRequired}
            "approvalConfig" = ${ApprovalConfig}
            "formId" = ${FormId}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to HumanAccountSubtypeConfigHumanAccountCreate<PSCustomObject>

.DESCRIPTION

Convert from JSON to HumanAccountSubtypeConfigHumanAccountCreate<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

HumanAccountSubtypeConfigHumanAccountCreate<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in HumanAccountSubtypeConfigHumanAccountCreate
        $AllProperties = ("accountCreateEnabled", "approvalRequired", "approvalConfig", "formId")
        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 "accountCreateEnabled"))) { #optional property not found
            $AccountCreateEnabled = $null
        } else {
            $AccountCreateEnabled = $JsonParameters.PSobject.Properties["accountCreateEnabled"].value
        }

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

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

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

        $PSO = [PSCustomObject]@{
            "accountCreateEnabled" = ${AccountCreateEnabled}
            "approvalRequired" = ${ApprovalRequired}
            "approvalConfig" = ${ApprovalConfig}
            "formId" = ${FormId}
        }

        return $PSO
    }

}