Model/InvitationActionConfigurationAttributes.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 Id
the id.
.PARAMETER WaitForCompletion
If the invitation action should pause the parent workflow to wait for completion.
.PARAMETER ReturnProfile
If the invitation action should return a profile.
.PARAMETER PortalId
the id of the portal.
.PARAMETER RegistrationWorkflowId
the id of the registration workflow.
.PARAMETER EmailAttributeId
the id of the email attribute.
.PARAMETER ValidateCompletedRegistration
If the action should validate against completed registrations by email address.
.PARAMETER ValidateOpenRegistration
If the action should validate against open registrations by email address.
.OUTPUTS

InvitationActionConfigurationAttributes<PSCustomObject>
#>


function Initialize-NERMInvitationActionConfigurationAttributes {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Id},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${WaitForCompletion},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${ReturnProfile},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${PortalId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${RegistrationWorkflowId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${EmailAttributeId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${ValidateCompletedRegistration},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${ValidateOpenRegistration}
    )

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


        $PSO = [PSCustomObject]@{
            "id" = ${Id}
            "wait_for_completion" = ${WaitForCompletion}
            "return_profile" = ${ReturnProfile}
            "portal_id" = ${PortalId}
            "registration_workflow_id" = ${RegistrationWorkflowId}
            "email_attribute_id" = ${EmailAttributeId}
            "validate_completed_registration" = ${ValidateCompletedRegistration}
            "validate_open_registration" = ${ValidateOpenRegistration}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to InvitationActionConfigurationAttributes<PSCustomObject>

.DESCRIPTION

Convert from JSON to InvitationActionConfigurationAttributes<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

InvitationActionConfigurationAttributes<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in NERMInvitationActionConfigurationAttributes
        $AllProperties = ("id", "wait_for_completion", "return_profile", "portal_id", "registration_workflow_id", "email_attribute_id", "validate_completed_registration", "validate_open_registration")
        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 "wait_for_completion"))) { #optional property not found
            $WaitForCompletion = $null
        } else {
            $WaitForCompletion = $JsonParameters.PSobject.Properties["wait_for_completion"].value
        }

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

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

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

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

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

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

        $PSO = [PSCustomObject]@{
            "id" = ${Id}
            "wait_for_completion" = ${WaitForCompletion}
            "return_profile" = ${ReturnProfile}
            "portal_id" = ${PortalId}
            "registration_workflow_id" = ${RegistrationWorkflowId}
            "email_attribute_id" = ${EmailAttributeId}
            "validate_completed_registration" = ${ValidateCompletedRegistration}
            "validate_open_registration" = ${ValidateOpenRegistration}
        }

        return $PSO
    }

}