Model/AuditEventData.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 ProfileId
The profile id associated with the event
.PARAMETER WorkflowId
The workflow id associated with the event
.PARAMETER WorkflowName
The workflow name associated with the event
.PARAMETER WorkflowUid
The workflow uid associated with the event
.PARAMETER ProfileTypeId
The profile type associated with the event
.OUTPUTS

AuditEventData<PSCustomObject>
#>


function Initialize-NERMAuditEventData {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${ProfileId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${WorkflowId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${WorkflowName},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${WorkflowUid},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${ProfileTypeId}
    )

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


        $PSO = [PSCustomObject]@{
            "profile_id" = ${ProfileId}
            "workflow_id" = ${WorkflowId}
            "workflow_name" = ${WorkflowName}
            "workflow_uid" = ${WorkflowUid}
            "profile_type_id" = ${ProfileTypeId}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to AuditEventData<PSCustomObject>

.DESCRIPTION

Convert from JSON to AuditEventData<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

AuditEventData<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in NERMAuditEventData
        $AllProperties = ("profile_id", "workflow_id", "workflow_name", "workflow_uid", "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 "profile_id"))) { #optional property not found
            $ProfileId = $null
        } else {
            $ProfileId = $JsonParameters.PSobject.Properties["profile_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 "workflow_name"))) { #optional property not found
            $WorkflowName = $null
        } else {
            $WorkflowName = $JsonParameters.PSobject.Properties["workflow_name"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "workflow_uid"))) { #optional property not found
            $WorkflowUid = $null
        } else {
            $WorkflowUid = $JsonParameters.PSobject.Properties["workflow_uid"].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]@{
            "profile_id" = ${ProfileId}
            "workflow_id" = ${WorkflowId}
            "workflow_name" = ${WorkflowName}
            "workflow_uid" = ${WorkflowUid}
            "profile_type_id" = ${ProfileTypeId}
        }

        return $PSO
    }

}