machine-account-subtypes/src/PSSailpoint.MachineAccountSubtypes/Model/MachineAccountSubtypeListConfigMachineAccountCreate.ps1

#
# SailPoint Identity Security API - Machine 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

Stored create flag for this subtype. Omitted when no create config exists.

.PARAMETER AccountCreateEnabled
Whether machine account creation is enabled for this subtype.
.OUTPUTS

MachineAccountSubtypeListConfigMachineAccountCreate<PSCustomObject>
#>


function Initialize-MachineAccountSubtypeListConfigMachineAccountCreate {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${AccountCreateEnabled} = $false
    )

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


        $PSO = [PSCustomObject]@{
            "accountCreateEnabled" = ${AccountCreateEnabled}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to MachineAccountSubtypeListConfigMachineAccountCreate<PSCustomObject>

.DESCRIPTION

Convert from JSON to MachineAccountSubtypeListConfigMachineAccountCreate<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

MachineAccountSubtypeListConfigMachineAccountCreate<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in MachineAccountSubtypeListConfigMachineAccountCreate
        $AllProperties = ("accountCreateEnabled")
        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
        }

        $PSO = [PSCustomObject]@{
            "accountCreateEnabled" = ${AccountCreateEnabled}
        }

        return $PSO
    }

}