v3/src/PSSailpoint/Model/ReportResults.ps1

#
# IdentityNow V3 API
# Use these APIs to interact with the IdentityNow 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: 3.0.0
# Generated by OpenAPI Generator: https://openapi-generator.tech
#

<#
.SYNOPSIS

No summary available.

.DESCRIPTION

Details about report result or current state.

.PARAMETER ReportType
Use this property to define what report should be processed in the RDE service.
.PARAMETER TaskDefName
Name of the task definition which is started to process requesting report. Usually the same as report name
.PARAMETER Id
Unique task definition identifier.
.PARAMETER Created
Report processing start date
.PARAMETER Status
Report current state or result status.
.PARAMETER Duration
Report processing time in ms.
.PARAMETER Rows
Report size in rows.
.PARAMETER AvailableFormats
Output report file formats. This are formats for calling get endpoint as a query parameter 'fileFormat'. In case report won't have this argument there will be ['CSV', 'PDF'] as default.
.OUTPUTS

ReportResults<PSCustomObject>
#>


function Initialize-ReportResults {
    [CmdletBinding()]
    Param (
        [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)]
        [ValidateSet("ACCOUNTS", "IDENTITIES_DETAILS", "IDENTITIES", "IDENTITY_PROFILE_IDENTITY_ERROR", "ORPHAN_IDENTITIES", "SEARCH_EXPORT", "UNCORRELATED_ACCOUNTS")]
        [String]
        ${ReportType},
        [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true)]
        [String]
        ${TaskDefName},
        [Parameter(Position = 2, ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Id},
        [Parameter(Position = 3, ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${Created},
        [Parameter(Position = 4, ValueFromPipelineByPropertyName = $true)]
        [ValidateSet("SUCCESS", "FAILURE", "WARNING", "TERMINATED")]
        [String]
        ${Status},
        [Parameter(Position = 5, ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int64]]
        ${Duration},
        [Parameter(Position = 6, ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int64]]
        ${Rows},
        [Parameter(Position = 7, ValueFromPipelineByPropertyName = $true)]
        [ValidateSet("CSV", "PDF")]
        [String[]]
        ${AvailableFormats}
    )

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


        $PSO = [PSCustomObject]@{
            "reportType" = ${ReportType}
            "taskDefName" = ${TaskDefName}
            "id" = ${Id}
            "created" = ${Created}
            "status" = ${Status}
            "duration" = ${Duration}
            "rows" = ${Rows}
            "availableFormats" = ${AvailableFormats}
        }


        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to ReportResults<PSCustomObject>

.DESCRIPTION

Convert from JSON to ReportResults<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

ReportResults<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in ReportResults
        $AllProperties = ("reportType", "taskDefName", "id", "created", "status", "duration", "rows", "availableFormats")
        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 "reportType"))) { #optional property not found
            $ReportType = $null
        } else {
            $ReportType = $JsonParameters.PSobject.Properties["reportType"].value
        }

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

        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 "created"))) { #optional property not found
            $Created = $null
        } else {
            $Created = $JsonParameters.PSobject.Properties["created"].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 "duration"))) { #optional property not found
            $Duration = $null
        } else {
            $Duration = $JsonParameters.PSobject.Properties["duration"].value
        }

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

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

        $PSO = [PSCustomObject]@{
            "reportType" = ${ReportType}
            "taskDefName" = ${TaskDefName}
            "id" = ${Id}
            "created" = ${Created}
            "status" = ${Status}
            "duration" = ${Duration}
            "rows" = ${Rows}
            "availableFormats" = ${AvailableFormats}
        }

        return $PSO
    }

}