beta/src/PSSailpointBeta/Model/FieldAllOf.ps1

#
# IdentityNow Beta API
# Use these APIs to interact with the IdentityNow 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 DisplayName
Display name of the field
.PARAMETER DisplayType
Type of the field to display
.PARAMETER Required
True if the field is required
.PARAMETER AllowedValuesList
List of allowed values for the field
.PARAMETER Value
Value of the field
.OUTPUTS

FieldAllOf<PSCustomObject>
#>


function Initialize-BetaFieldAllOf {
    [CmdletBinding()]
    Param (
        [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)]
        [String]
        ${DisplayName},
        [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true)]
        [String]
        ${DisplayType},
        [Parameter(Position = 2, ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${Required},
        [Parameter(Position = 3, ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject[]]
        ${AllowedValuesList},
        [Parameter(Position = 4, ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Value}
    )

    Process {
        'Creating PSCustomObject: PSSailpointBeta => BetaFieldAllOf' | Write-Debug
        $PSBoundParameters | Out-DebugParameter | Write-Debug


        $PSO = [PSCustomObject]@{
            "displayName" = ${DisplayName}
            "displayType" = ${DisplayType}
            "required" = ${Required}
            "allowedValuesList" = ${AllowedValuesList}
            "value" = ${Value}
        }


        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to FieldAllOf<PSCustomObject>

.DESCRIPTION

Convert from JSON to FieldAllOf<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

FieldAllOf<PSCustomObject>
#>

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

    Process {
        'Converting JSON to PSCustomObject: PSSailpointBeta => BetaFieldAllOf' | Write-Debug
        $PSBoundParameters | Out-DebugParameter | Write-Debug

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in BetaFieldAllOf
        $AllProperties = ("displayName", "displayType", "required", "allowedValuesList", "value")
        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 "displayName"))) { #optional property not found
            $DisplayName = $null
        } else {
            $DisplayName = $JsonParameters.PSobject.Properties["displayName"].value
        }

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

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

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

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

        $PSO = [PSCustomObject]@{
            "displayName" = ${DisplayName}
            "displayType" = ${DisplayType}
            "required" = ${Required}
            "allowedValuesList" = ${AllowedValuesList}
            "value" = ${Value}
        }

        return $PSO
    }

}