Model/AccountActivityDocument.ps1

#
# Identity Security Cloud V2024 API
# 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: v2024
# Generated by OpenAPI Generator: https://openapi-generator.tech
#

<#
.SYNOPSIS

No summary available.

.DESCRIPTION

AccountActivity

.PARAMETER Id
ID of account activity.
.PARAMETER Action
Type of action performed in the activity.
.PARAMETER Created
ISO-8601 date-time referring to the time when the object was created.
.PARAMETER Modified
ISO-8601 date-time referring to the time when the object was last modified.
.PARAMETER Synced
ISO-8601 date-time referring to the date-time when object was queued to be synced into search database for use in the search API. This date-time changes anytime there is an update to the object, which triggers a synchronization event being sent to the search database. There may be some delay between the `synced` time and the time when the updated data is actually available in the search API.
.PARAMETER Stage
Activity's current stage.
.PARAMETER Status
Activity's current status.
.PARAMETER Requester
No description available.
.PARAMETER Recipient
No description available.
.PARAMETER TrackingNumber
Account activity's tracking number.
.PARAMETER Errors
Errors provided by the source while completing account actions.
.PARAMETER Warnings
Warnings provided by the source while completing account actions.
.PARAMETER Approvals
Approvals performed on an item during activity.
.PARAMETER OriginalRequests
Original actions that triggered all individual source actions related to the account action.
.PARAMETER ExpansionItems
Controls that translated the attribute requests into actual provisioning actions on the source.
.PARAMETER AccountRequests
Account data for each individual source action triggered by the original requests.
.PARAMETER Sources
Sources involved in the account activity.
.OUTPUTS

AccountActivityDocument<PSCustomObject>
#>


function Initialize-V2024AccountActivityDocument {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Id},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Action},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${Created},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${Modified},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Synced},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Stage},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Status},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Requester},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Recipient},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${TrackingNumber},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String[]]
        ${Errors},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String[]]
        ${Warnings},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject[]]
        ${Approvals},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject[]]
        ${OriginalRequests},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject[]]
        ${ExpansionItems},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject[]]
        ${AccountRequests},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Sources}
    )

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


        $PSO = [PSCustomObject]@{
            "id" = ${Id}
            "action" = ${Action}
            "created" = ${Created}
            "modified" = ${Modified}
            "synced" = ${Synced}
            "stage" = ${Stage}
            "status" = ${Status}
            "requester" = ${Requester}
            "recipient" = ${Recipient}
            "trackingNumber" = ${TrackingNumber}
            "errors" = ${Errors}
            "warnings" = ${Warnings}
            "approvals" = ${Approvals}
            "originalRequests" = ${OriginalRequests}
            "expansionItems" = ${ExpansionItems}
            "accountRequests" = ${AccountRequests}
            "sources" = ${Sources}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to AccountActivityDocument<PSCustomObject>

.DESCRIPTION

Convert from JSON to AccountActivityDocument<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

AccountActivityDocument<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in V2024AccountActivityDocument
        $AllProperties = ("id", "action", "created", "modified", "synced", "stage", "status", "requester", "recipient", "trackingNumber", "errors", "warnings", "approvals", "originalRequests", "expansionItems", "accountRequests", "sources")
        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 "id"))) { #optional property not found
            $Id = $null
        } else {
            $Id = $JsonParameters.PSobject.Properties["id"].value
        }

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

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

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

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

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

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

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

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

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

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

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

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

        $PSO = [PSCustomObject]@{
            "id" = ${Id}
            "action" = ${Action}
            "created" = ${Created}
            "modified" = ${Modified}
            "synced" = ${Synced}
            "stage" = ${Stage}
            "status" = ${Status}
            "requester" = ${Requester}
            "recipient" = ${Recipient}
            "trackingNumber" = ${TrackingNumber}
            "errors" = ${Errors}
            "warnings" = ${Warnings}
            "approvals" = ${Approvals}
            "originalRequests" = ${OriginalRequests}
            "expansionItems" = ${ExpansionItems}
            "accountRequests" = ${AccountRequests}
            "sources" = ${Sources}
        }

        return $PSO
    }

}