beta/src/PSSailpointBeta/Model/CancelableAccountActivity.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 Id
ID of the account activity itself
.PARAMETER Name
No description available.
.PARAMETER Created
No description available.
.PARAMETER Modified
No description available.
.PARAMETER Completed
No description available.
.PARAMETER CompletionStatus
No description available.
.PARAMETER Type
No description available.
.PARAMETER RequesterIdentitySummary
No description available.
.PARAMETER TargetIdentitySummary
No description available.
.PARAMETER Errors
No description available.
.PARAMETER Warnings
No description available.
.PARAMETER Items
No description available.
.PARAMETER ExecutionStatus
No description available.
.PARAMETER ClientMetadata
Arbitrary key-value pairs, if any were included in the corresponding access request
.PARAMETER Cancelable
Whether the account activity can be canceled before completion
.PARAMETER CancelComment
No description available.
.OUTPUTS

CancelableAccountActivity<PSCustomObject>
#>


function Initialize-BetaCancelableAccountActivity {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Id},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Name},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${Created},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${Modified},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${Completed},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [ValidateSet("SUCCESS", "FAILURE", "INCOMPLETE", "PENDING", "")]
        [PSCustomObject]
        ${CompletionStatus},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Type},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${RequesterIdentitySummary},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${TargetIdentitySummary},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String[]]
        ${Errors},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String[]]
        ${Warnings},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject[]]
        ${Items},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [ValidateSet("EXECUTING", "VERIFYING", "TERMINATED", "COMPLETED")]
        [PSCustomObject]
        ${ExecutionStatus},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Collections.Hashtable]
        ${ClientMetadata},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${Cancelable},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${CancelComment}
    )

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


        $PSO = [PSCustomObject]@{
            "id" = ${Id}
            "name" = ${Name}
            "created" = ${Created}
            "modified" = ${Modified}
            "completed" = ${Completed}
            "completionStatus" = ${CompletionStatus}
            "type" = ${Type}
            "requesterIdentitySummary" = ${RequesterIdentitySummary}
            "targetIdentitySummary" = ${TargetIdentitySummary}
            "errors" = ${Errors}
            "warnings" = ${Warnings}
            "items" = ${Items}
            "executionStatus" = ${ExecutionStatus}
            "clientMetadata" = ${ClientMetadata}
            "cancelable" = ${Cancelable}
            "cancelComment" = ${CancelComment}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to CancelableAccountActivity<PSCustomObject>

.DESCRIPTION

Convert from JSON to CancelableAccountActivity<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

CancelableAccountActivity<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in BetaCancelableAccountActivity
        $AllProperties = ("id", "name", "created", "modified", "completed", "completionStatus", "type", "requesterIdentitySummary", "targetIdentitySummary", "errors", "warnings", "items", "executionStatus", "clientMetadata", "cancelable", "cancelComment")
        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 "name"))) { #optional property not found
            $Name = $null
        } else {
            $Name = $JsonParameters.PSobject.Properties["name"].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 "completed"))) { #optional property not found
            $Completed = $null
        } else {
            $Completed = $JsonParameters.PSobject.Properties["completed"].value
        }

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

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

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

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

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

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

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

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

        $PSO = [PSCustomObject]@{
            "id" = ${Id}
            "name" = ${Name}
            "created" = ${Created}
            "modified" = ${Modified}
            "completed" = ${Completed}
            "completionStatus" = ${CompletionStatus}
            "type" = ${Type}
            "requesterIdentitySummary" = ${RequesterIdentitySummary}
            "targetIdentitySummary" = ${TargetIdentitySummary}
            "errors" = ${Errors}
            "warnings" = ${Warnings}
            "items" = ${Items}
            "executionStatus" = ${ExecutionStatus}
            "clientMetadata" = ${ClientMetadata}
            "cancelable" = ${Cancelable}
            "cancelComment" = ${CancelComment}
        }

        return $PSO
    }

}