beta/src/PSSailpointBeta/Model/AccountAggregation.ps1

#
# Identity Security Cloud Beta API
# Use these APIs to interact with the Identity Security Cloud platform to achieve repeatable, automated processes with greater scalability. These APIs are in beta and are subject to change. 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.1.0-beta
# Generated by OpenAPI Generator: https://openapi-generator.tech
#

<#
.SYNOPSIS

No summary available.

.DESCRIPTION

No description available.

.PARAMETER Start
When the aggregation started.
.PARAMETER Status
STARTED - Aggregation started, but source account iteration has not completed. ACCOUNTS_COLLECTED - Source account iteration completed, but all accounts have not yet been processed. COMPLETED - Aggregation completed (*possibly with errors*). CANCELLED - Aggregation cancelled by user. RETRIED - Aggregation retried because of connectivity issues with the Virtual Appliance. TERMINATED - Aggregation marked as failed after 3 tries after connectivity issues with the Virtual Appliance.
.PARAMETER TotalAccounts
The total number of *NEW, CHANGED and DELETED* accounts that need to be processed for this aggregation. This does not include accounts that were unchanged since the previous aggregation. This can be zero if there were no new, changed or deleted accounts since the previous aggregation. *Only available when status is ACCOUNTS_COLLECTED or COMPLETED.*
.PARAMETER ProcessedAccounts
The number of *NEW, CHANGED and DELETED* accounts that have been processed so far. This reflects the number of accounts that have been processed at the time of the API call, and may increase on subsequent API calls while the status is ACCOUNTS_COLLECTED. *Only available when status is ACCOUNTS_COLLECTED or COMPLETED.*
.OUTPUTS

AccountAggregation<PSCustomObject>
#>


function Initialize-BetaAccountAggregation {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${Start},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [ValidateSet("STARTED", "ACCOUNTS_COLLECTED", "COMPLETED", "CANCELLED", "RETRIED", "TERMINATED")]
        [String]
        ${Status},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int32]]
        ${TotalAccounts},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int32]]
        ${ProcessedAccounts}
    )

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


        $PSO = [PSCustomObject]@{
            "start" = ${Start}
            "status" = ${Status}
            "totalAccounts" = ${TotalAccounts}
            "processedAccounts" = ${ProcessedAccounts}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to AccountAggregation<PSCustomObject>

.DESCRIPTION

Convert from JSON to AccountAggregation<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

AccountAggregation<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in BetaAccountAggregation
        $AllProperties = ("start", "status", "totalAccounts", "processedAccounts")
        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 "start"))) { #optional property not found
            $Start = $null
        } else {
            $Start = $JsonParameters.PSobject.Properties["start"].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 "totalAccounts"))) { #optional property not found
            $TotalAccounts = $null
        } else {
            $TotalAccounts = $JsonParameters.PSobject.Properties["totalAccounts"].value
        }

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

        $PSO = [PSCustomObject]@{
            "start" = ${Start}
            "status" = ${Status}
            "totalAccounts" = ${TotalAccounts}
            "processedAccounts" = ${ProcessedAccounts}
        }

        return $PSO
    }

}