beta/src/PSSailpointBeta/Model/AccountAggregationStatus.ps1

#
# IdentityNow Beta API
# Use these APIs to interact with the IdentityNow 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

AccountAggregationStatus<PSCustomObject>
#>


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

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


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


        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to AccountAggregationStatus<PSCustomObject>

.DESCRIPTION

Convert from JSON to AccountAggregationStatus<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

AccountAggregationStatus<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in BetaAccountAggregationStatus
        $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
    }

}