v3/src/PSSailpoint/Model/AccountActivitySearchedItemAllOf.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 Action
The type of action that this activity performed
.PARAMETER Created
A date-time in ISO-8601 format
.PARAMETER Modified
A date-time in ISO-8601 format
.PARAMETER Stage
The current stage of the activity
.PARAMETER Origin
No description available.
.PARAMETER Status
the current status of the activity
.PARAMETER Requester
No description available.
.PARAMETER Recipient
No description available.
.PARAMETER TrackingNumber
No description available.
.PARAMETER Errors
No description available.
.PARAMETER Warnings
No description available.
.PARAMETER Approvals
No description available.
.PARAMETER OriginalRequests
No description available.
.PARAMETER ExpansionItems
No description available.
.PARAMETER AccountRequests
No description available.
.PARAMETER Sources
No description available.
.OUTPUTS

AccountActivitySearchedItemAllOf<PSCustomObject>
#>


function Initialize-AccountActivitySearchedItemAllOf {
    [CmdletBinding()]
    Param (
        [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Action},
        [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${Created},
        [Parameter(Position = 2, ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${Modified},
        [Parameter(Position = 3, ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Stage},
        [Parameter(Position = 4, ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Origin},
        [Parameter(Position = 5, ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Status},
        [Parameter(Position = 6, ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Requester},
        [Parameter(Position = 7, ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Recipient},
        [Parameter(Position = 8, ValueFromPipelineByPropertyName = $true)]
        [String]
        ${TrackingNumber},
        [Parameter(Position = 9, ValueFromPipelineByPropertyName = $true)]
        [String[]]
        ${Errors},
        [Parameter(Position = 10, ValueFromPipelineByPropertyName = $true)]
        [String[]]
        ${Warnings},
        [Parameter(Position = 11, ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject[]]
        ${Approvals},
        [Parameter(Position = 12, ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject[]]
        ${OriginalRequests},
        [Parameter(Position = 13, ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject[]]
        ${ExpansionItems},
        [Parameter(Position = 14, ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject[]]
        ${AccountRequests},
        [Parameter(Position = 15, ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Sources}
    )

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


        $PSO = [PSCustomObject]@{
            "action" = ${Action}
            "created" = ${Created}
            "modified" = ${Modified}
            "stage" = ${Stage}
            "origin" = ${Origin}
            "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 AccountActivitySearchedItemAllOf<PSCustomObject>

.DESCRIPTION

Convert from JSON to AccountActivitySearchedItemAllOf<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

AccountActivitySearchedItemAllOf<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in AccountActivitySearchedItemAllOf
        $AllProperties = ("action", "created", "modified", "stage", "origin", "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 "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 "stage"))) { #optional property not found
            $Stage = $null
        } else {
            $Stage = $JsonParameters.PSobject.Properties["stage"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "origin"))) { #optional property not found
            $Origin = $null
        } else {
            $Origin = $JsonParameters.PSobject.Properties["origin"].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]@{
            "action" = ${Action}
            "created" = ${Created}
            "modified" = ${Modified}
            "stage" = ${Stage}
            "origin" = ${Origin}
            "status" = ${Status}
            "requester" = ${Requester}
            "recipient" = ${Recipient}
            "trackingNumber" = ${TrackingNumber}
            "errors" = ${Errors}
            "warnings" = ${Warnings}
            "approvals" = ${Approvals}
            "originalRequests" = ${OriginalRequests}
            "expansionItems" = ${ExpansionItems}
            "accountRequests" = ${AccountRequests}
            "sources" = ${Sources}
        }

        return $PSO
    }

}