access-request-approvals/src/PSSailpoint.AccessRequestApprovals/Model/AccessRequestItemForm.ps1

#
# Identity Security Cloud API - Access Request Approvals
# 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: v1
# Generated by OpenAPI Generator: https://openapi-generator.tech
#

<#
.SYNOPSIS

No summary available.

.DESCRIPTION

Completed form instance associated with an access request item. Omitted when the item has no associated form or no form answers were captured. All listed properties may be present when form answers exist. Optional structural keys (`formElements`, `formConditions`, `formInstanceInputs`) may also be present; their shape follows the form instance payload.

.PARAMETER FormDefinitionId
ID of the form definition that was completed for this item.
.PARAMETER FormInstanceId
ID of the completed form instance.
.PARAMETER FormData
Key-value pairs (form field technical name to value) from the completed form instance.
.PARAMETER FormElements
Optional form element definitions when present. Shape follows the form instance payload.
.PARAMETER FormConditions
Optional conditional display rules when present. Shape follows the form instance payload; do not depend on a fixed condition schema in this API.
.PARAMETER FormInstanceInputs
Optional inputs passed into the form instance when present. Copied from the form instance payload as-is.
.OUTPUTS

AccessRequestItemForm<PSCustomObject>
#>


function Initialize-AccessRequestItemForm {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${FormDefinitionId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${FormInstanceId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Collections.Hashtable]
        ${FormData},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Collections.Hashtable[]]
        ${FormElements},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Collections.Hashtable[]]
        ${FormConditions},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Collections.Hashtable]
        ${FormInstanceInputs}
    )

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


        $PSO = [PSCustomObject]@{
            "formDefinitionId" = ${FormDefinitionId}
            "formInstanceId" = ${FormInstanceId}
            "formData" = ${FormData}
            "formElements" = ${FormElements}
            "formConditions" = ${FormConditions}
            "formInstanceInputs" = ${FormInstanceInputs}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to AccessRequestItemForm<PSCustomObject>

.DESCRIPTION

Convert from JSON to AccessRequestItemForm<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

AccessRequestItemForm<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json
        $AccessRequestItemFormAdditionalProperties = @{}

        # check if Json contains properties not defined in AccessRequestItemForm
        $AllProperties = ("formDefinitionId", "formInstanceId", "formData", "formElements", "formConditions", "formInstanceInputs")
        foreach ($name in $JsonParameters.PsObject.Properties.Name) {
            # store undefined properties in additionalProperties
            if (!($AllProperties.Contains($name))) {
                $AccessRequestItemFormAdditionalProperties[$name] = $JsonParameters.PSobject.Properties[$name].value
            }
        }

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

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

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

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

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

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

        $PSO = [PSCustomObject]@{
            "formDefinitionId" = ${FormDefinitionId}
            "formInstanceId" = ${FormInstanceId}
            "formData" = ${FormData}
            "formElements" = ${FormElements}
            "formConditions" = ${FormConditions}
            "formInstanceInputs" = ${FormInstanceInputs}
            "AdditionalProperties" = $AccessRequestItemFormAdditionalProperties
        }

        return $PSO
    }

}