Model/WorkflowSummaryDocument.ps1

#
# Identity Security Cloud API - Search
# 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

Workflow summary. Each workflow summary document represents one event in the execution history of a workflow.

.PARAMETER Id
ID of the workflow summary. The ID is the workflow execution ID, followed by a hyphen and the event ID.
.PARAMETER WorkflowExecutionId
ID of the workflow execution that the event belongs to.
.PARAMETER EventId
Position of the event in the execution history of the workflow execution.
.PARAMETER WorkflowName
Name of the workflow.
.PARAMETER WorkflowId
ID of the workflow.
.PARAMETER Status
Status of the workflow execution at the time of the event. Possible values include `Completed`, `Failed`, `Canceled`, `Running`, and `Queued`.
.PARAMETER WorkflowTest
Indicates whether the workflow execution was a test execution.
.PARAMETER Owner
No description available.
.PARAMETER RequestId
Backend ID that tracks a workflow request in the system. Provide this ID in a customer support ticket for debugging purposes.
.PARAMETER Created
ISO-8601 date-time referring to the time when the event occurred.
.PARAMETER Synced
ISO-8601 date-time referring to the date-time when object was queued to be synced into search database for use in the search API. This date-time changes anytime there is an update to the object, which triggers a synchronization event being sent to the search database. There may be some delay between the `synced` time and the time when the updated data is actually available in the search API.
.PARAMETER Type
Type of the execution history event. Examples include `WorkflowExecutionStarted`, `WorkflowExecutionCompleted`, `WorkflowExecutionFailed`, `ActivityTaskScheduled`, `ActivityTaskCompleted`, and `ActivityTaskFailed`.
.PARAMETER Attributes
Attributes of the event. The available attributes depend on the event type. For example, an `ActivityTaskCompleted` event can include `task`, `stepName`, `displayName`, `technicalName`, and `result`. Values that are not strings or integers are serialized as JSON strings.
.OUTPUTS

WorkflowSummaryDocument<PSCustomObject>
#>


function Initialize-WorkflowSummaryDocument {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Id},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${WorkflowExecutionId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int64]]
        ${EventId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${WorkflowName},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${WorkflowId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Status},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${WorkflowTest} = $false,
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Owner},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${RequestId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${Created},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Synced},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Type},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Collections.Hashtable]
        ${Attributes}
    )

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


        $PSO = [PSCustomObject]@{
            "id" = ${Id}
            "workflowExecutionId" = ${WorkflowExecutionId}
            "eventId" = ${EventId}
            "workflowName" = ${WorkflowName}
            "workflowId" = ${WorkflowId}
            "status" = ${Status}
            "workflowTest" = ${WorkflowTest}
            "owner" = ${Owner}
            "requestId" = ${RequestId}
            "created" = ${Created}
            "synced" = ${Synced}
            "type" = ${Type}
            "attributes" = ${Attributes}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to WorkflowSummaryDocument<PSCustomObject>

.DESCRIPTION

Convert from JSON to WorkflowSummaryDocument<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

WorkflowSummaryDocument<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in WorkflowSummaryDocument
        $AllProperties = ("id", "workflowExecutionId", "eventId", "workflowName", "workflowId", "status", "workflowTest", "owner", "requestId", "created", "synced", "type", "attributes")
        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 "workflowExecutionId"))) { #optional property not found
            $WorkflowExecutionId = $null
        } else {
            $WorkflowExecutionId = $JsonParameters.PSobject.Properties["workflowExecutionId"].value
        }

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

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

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

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

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

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

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

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

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

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

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

        $PSO = [PSCustomObject]@{
            "id" = ${Id}
            "workflowExecutionId" = ${WorkflowExecutionId}
            "eventId" = ${EventId}
            "workflowName" = ${WorkflowName}
            "workflowId" = ${WorkflowId}
            "status" = ${Status}
            "workflowTest" = ${WorkflowTest}
            "owner" = ${Owner}
            "requestId" = ${RequestId}
            "created" = ${Created}
            "synced" = ${Synced}
            "type" = ${Type}
            "attributes" = ${Attributes}
        }

        return $PSO
    }

}