Model/CertificationStatusSummary.ps1

#
# Identity Security Cloud API - Next Generation Certification Campaigns
# 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

Status summary of active certifications

.PARAMETER ActiveCertifications
The number of active certifications
.PARAMETER OverdueCertifications
The number of certifications passed the due date
.PARAMETER MaximumDaysOverdue
The maximum number of days past due the most overdue certification is
.PARAMETER MinimumDaysLeftToComplete
The closest number of days to completion
.PARAMETER CompletedDecisionsForActiveCerts
The number of of decisions that have been made
.PARAMETER PendingDecisionsForActiveCerts
The number of decisions that are pending
.OUTPUTS

CertificationStatusSummary<PSCustomObject>
#>


function Initialize-CertificationStatusSummary {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int32]]
        ${ActiveCertifications},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int32]]
        ${OverdueCertifications},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int32]]
        ${MaximumDaysOverdue},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int32]]
        ${MinimumDaysLeftToComplete},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int32]]
        ${CompletedDecisionsForActiveCerts},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int32]]
        ${PendingDecisionsForActiveCerts}
    )

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


        $PSO = [PSCustomObject]@{
            "activeCertifications" = ${ActiveCertifications}
            "overdueCertifications" = ${OverdueCertifications}
            "maximumDaysOverdue" = ${MaximumDaysOverdue}
            "minimumDaysLeftToComplete" = ${MinimumDaysLeftToComplete}
            "completedDecisionsForActiveCerts" = ${CompletedDecisionsForActiveCerts}
            "pendingDecisionsForActiveCerts" = ${PendingDecisionsForActiveCerts}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to CertificationStatusSummary<PSCustomObject>

.DESCRIPTION

Convert from JSON to CertificationStatusSummary<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

CertificationStatusSummary<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in CertificationStatusSummary
        $AllProperties = ("activeCertifications", "overdueCertifications", "maximumDaysOverdue", "minimumDaysLeftToComplete", "completedDecisionsForActiveCerts", "pendingDecisionsForActiveCerts")
        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 "activeCertifications"))) { #optional property not found
            $ActiveCertifications = $null
        } else {
            $ActiveCertifications = $JsonParameters.PSobject.Properties["activeCertifications"].value
        }

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

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

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

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

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

        $PSO = [PSCustomObject]@{
            "activeCertifications" = ${ActiveCertifications}
            "overdueCertifications" = ${OverdueCertifications}
            "maximumDaysOverdue" = ${MaximumDaysOverdue}
            "minimumDaysLeftToComplete" = ${MinimumDaysLeftToComplete}
            "completedDecisionsForActiveCerts" = ${CompletedDecisionsForActiveCerts}
            "pendingDecisionsForActiveCerts" = ${PendingDecisionsForActiveCerts}
        }

        return $PSO
    }

}