Model/RunWorkflowActionConfigurationAttributes.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 WorkflowId
the id of the workflow.
.PARAMETER WaitForCompletion
If the parent workflow should wait for the child to complete.
.PARAMETER ProfileToSend
the profile the parent should send to the child workflow.
.PARAMETER ReturnProfile
if the child workflow should return a profile.
.PARAMETER RunWorkflowActionId
the id of the child workflow to run.
.PARAMETER ProfileTypeId
the id of the profile type.
.OUTPUTS

RunWorkflowActionConfigurationAttributes<PSCustomObject>
#>


function Initialize-NERMRunWorkflowActionConfigurationAttributes {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Id},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${WorkflowId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${WaitForCompletion},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [ValidateSet("none", "current", "attribute", "profile_type")]
        [String]
        ${ProfileToSend},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${ReturnProfile},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${RunWorkflowActionId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${ProfileTypeId}
    )

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


        $PSO = [PSCustomObject]@{
            "id" = ${Id}
            "workflow_id" = ${WorkflowId}
            "wait_for_completion" = ${WaitForCompletion}
            "profile_to_send" = ${ProfileToSend}
            "return_profile" = ${ReturnProfile}
            "run_workflow_action_id" = ${RunWorkflowActionId}
            "profile_type_id" = ${ProfileTypeId}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to RunWorkflowActionConfigurationAttributes<PSCustomObject>

.DESCRIPTION

Convert from JSON to RunWorkflowActionConfigurationAttributes<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

RunWorkflowActionConfigurationAttributes<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in NERMRunWorkflowActionConfigurationAttributes
        $AllProperties = ("id", "workflow_id", "wait_for_completion", "profile_to_send", "return_profile", "run_workflow_action_id", "profile_type_id")
        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 "workflow_id"))) { #optional property not found
            $WorkflowId = $null
        } else {
            $WorkflowId = $JsonParameters.PSobject.Properties["workflow_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 "profile_to_send"))) { #optional property not found
            $ProfileToSend = $null
        } else {
            $ProfileToSend = $JsonParameters.PSobject.Properties["profile_to_send"].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 "run_workflow_action_id"))) { #optional property not found
            $RunWorkflowActionId = $null
        } else {
            $RunWorkflowActionId = $JsonParameters.PSobject.Properties["run_workflow_action_id"].value
        }

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

        $PSO = [PSCustomObject]@{
            "id" = ${Id}
            "workflow_id" = ${WorkflowId}
            "wait_for_completion" = ${WaitForCompletion}
            "profile_to_send" = ${ProfileToSend}
            "return_profile" = ${ReturnProfile}
            "run_workflow_action_id" = ${RunWorkflowActionId}
            "profile_type_id" = ${ProfileTypeId}
        }

        return $PSO
    }

}