v3/src/PSSailpoint/Model/AggregationAllOf.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

No description available.

.PARAMETER Status
No description available.
.PARAMETER Duration
No description available.
.PARAMETER AvgDuration
No description available.
.PARAMETER ChangedAccounts
No description available.
.PARAMETER NextScheduled
A date-time in ISO-8601 format
.PARAMETER StartTime
A date-time in ISO-8601 format
.PARAMETER SourceOwner
John Doe
.OUTPUTS

AggregationAllOf<PSCustomObject>
#>


function Initialize-AggregationAllOf {
    [CmdletBinding()]
    Param (
        [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Status},
        [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int32]]
        ${Duration},
        [Parameter(Position = 2, ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int32]]
        ${AvgDuration},
        [Parameter(Position = 3, ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int32]]
        ${ChangedAccounts},
        [Parameter(Position = 4, ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${NextScheduled},
        [Parameter(Position = 5, ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${StartTime},
        [Parameter(Position = 6, ValueFromPipelineByPropertyName = $true)]
        [String]
        ${SourceOwner}
    )

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


        $PSO = [PSCustomObject]@{
            "status" = ${Status}
            "duration" = ${Duration}
            "avgDuration" = ${AvgDuration}
            "changedAccounts" = ${ChangedAccounts}
            "nextScheduled" = ${NextScheduled}
            "startTime" = ${StartTime}
            "sourceOwner" = ${SourceOwner}
        }


        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to AggregationAllOf<PSCustomObject>

.DESCRIPTION

Convert from JSON to AggregationAllOf<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

AggregationAllOf<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in AggregationAllOf
        $AllProperties = ("status", "duration", "avgDuration", "changedAccounts", "nextScheduled", "startTime", "sourceOwner")
        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 "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 "avgDuration"))) { #optional property not found
            $AvgDuration = $null
        } else {
            $AvgDuration = $JsonParameters.PSobject.Properties["avgDuration"].value
        }

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

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

        $PSO = [PSCustomObject]@{
            "status" = ${Status}
            "duration" = ${Duration}
            "avgDuration" = ${AvgDuration}
            "changedAccounts" = ${ChangedAccounts}
            "nextScheduled" = ${NextScheduled}
            "startTime" = ${StartTime}
            "sourceOwner" = ${SourceOwner}
        }

        return $PSO
    }

}