nerm/src/PSSailpoint.NERM/Model/IdentityProofingResult.ps1

#
# NERM API
# The NERM API accesss and modifies resources in your environment.
# Version: 1.0.0
# Generated by OpenAPI Generator: https://openapi-generator.tech
#

<#
.SYNOPSIS

No summary available.

.DESCRIPTION

No description available.

.PARAMETER IdentityProofingActionId
No description available.
.PARAMETER WorkflowSessionId
No description available.
.PARAMETER ProfileId
No description available.
.PARAMETER ProofingWorkflow
No description available.
.PARAMETER Result
No description available.
.PARAMETER ProofingAttributes
No description available.
.PARAMETER CreatedAt
No description available.
.PARAMETER UpdatedAt
No description available.
.OUTPUTS

IdentityProofingResult<PSCustomObject>
#>


function Initialize-NERMIdentityProofingResult {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${IdentityProofingActionId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${WorkflowSessionId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${ProfileId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${ProofingWorkflow},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [ValidateSet("pending", "pass", "fail")]
        [String]
        ${Result},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Collections.Hashtable]
        ${ProofingAttributes},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${CreatedAt},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${UpdatedAt}
    )

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


        $PSO = [PSCustomObject]@{
            "identity_proofing_action_id" = ${IdentityProofingActionId}
            "workflow_session_id" = ${WorkflowSessionId}
            "profile_id" = ${ProfileId}
            "proofing_workflow" = ${ProofingWorkflow}
            "result" = ${Result}
            "proofing_attributes" = ${ProofingAttributes}
            "created_at" = ${CreatedAt}
            "updated_at" = ${UpdatedAt}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to IdentityProofingResult<PSCustomObject>

.DESCRIPTION

Convert from JSON to IdentityProofingResult<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

IdentityProofingResult<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in NERMIdentityProofingResult
        $AllProperties = ("id", "identity_proofing_action_id", "workflow_session_id", "profile_id", "proofing_workflow", "result", "proofing_attributes", "created_at", "updated_at")
        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 "identity_proofing_action_id"))) { #optional property not found
            $IdentityProofingActionId = $null
        } else {
            $IdentityProofingActionId = $JsonParameters.PSobject.Properties["identity_proofing_action_id"].value
        }

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

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

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

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

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

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

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

        $PSO = [PSCustomObject]@{
            "id" = ${Id}
            "identity_proofing_action_id" = ${IdentityProofingActionId}
            "workflow_session_id" = ${WorkflowSessionId}
            "profile_id" = ${ProfileId}
            "proofing_workflow" = ${ProofingWorkflow}
            "result" = ${Result}
            "proofing_attributes" = ${ProofingAttributes}
            "created_at" = ${CreatedAt}
            "updated_at" = ${UpdatedAt}
        }

        return $PSO
    }

}