Model/TaskInfo.ps1

#
# Identity Security Cloud V2025 API
# 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: v2025
# Generated by OpenAPI Generator: https://openapi-generator.tech
#

<#
.SYNOPSIS

No summary available.

.DESCRIPTION

No description available.

.PARAMETER TaskId
The unique identifier for the task.
.PARAMETER TaskTypeName
The type or category of the task.
.PARAMETER StartTime
The start time of the task, represented as epoch seconds.
.PARAMETER EndTime
The end time of the task, represented as epoch seconds.
.PARAMETER TaskName
The display name of the task.
.PARAMETER CreatedByDisplayName
The display name of the user who created the task.
.PARAMETER Progress
The progress of the task, typically represented as a percentage (0-100).
.PARAMETER Status
The current status of the task (e.g., ""Running"", ""Completed"", ""Failed"").
.PARAMETER Details
Additional details or information about the task.
.PARAMETER ScheduleTaskId
The unique identifier of the associated scheduled task, if applicable.
.OUTPUTS

TaskInfo<PSCustomObject>
#>


function Initialize-V2025TaskInfo {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int64]]
        ${TaskId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${TaskTypeName},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int64]]
        ${StartTime},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int64]]
        ${EndTime},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${TaskName},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${CreatedByDisplayName},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int32]]
        ${Progress},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Status},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Details},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int64]]
        ${ScheduleTaskId}
    )

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


        $PSO = [PSCustomObject]@{
            "taskId" = ${TaskId}
            "taskTypeName" = ${TaskTypeName}
            "startTime" = ${StartTime}
            "endTime" = ${EndTime}
            "taskName" = ${TaskName}
            "createdByDisplayName" = ${CreatedByDisplayName}
            "progress" = ${Progress}
            "status" = ${Status}
            "details" = ${Details}
            "scheduleTaskId" = ${ScheduleTaskId}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to TaskInfo<PSCustomObject>

.DESCRIPTION

Convert from JSON to TaskInfo<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

TaskInfo<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in V2025TaskInfo
        $AllProperties = ("taskId", "taskTypeName", "startTime", "endTime", "taskName", "createdByDisplayName", "progress", "status", "details", "scheduleTaskId")
        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 "taskId"))) { #optional property not found
            $TaskId = $null
        } else {
            $TaskId = $JsonParameters.PSobject.Properties["taskId"].value
        }

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

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

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

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

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

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "progress"))) { #optional property not found
            $Progress = $null
        } else {
            $Progress = $JsonParameters.PSobject.Properties["progress"].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 "details"))) { #optional property not found
            $Details = $null
        } else {
            $Details = $JsonParameters.PSobject.Properties["details"].value
        }

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

        $PSO = [PSCustomObject]@{
            "taskId" = ${TaskId}
            "taskTypeName" = ${TaskTypeName}
            "startTime" = ${StartTime}
            "endTime" = ${EndTime}
            "taskName" = ${TaskName}
            "createdByDisplayName" = ${CreatedByDisplayName}
            "progress" = ${Progress}
            "status" = ${Status}
            "details" = ${Details}
            "scheduleTaskId" = ${ScheduleTaskId}
        }

        return $PSO
    }

}