Model/Jitactivationdeactivateresponse.ps1

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

<#
.SYNOPSIS

No summary available.

.DESCRIPTION

No description available.

.PARAMETER Id
Workflow or business identifier for this activation.
.PARAMETER ActivationId
Persistent activation record identifier for this JIT activation.
.PARAMETER ConnectionId
Entitlement connection identifier for the activation.
.PARAMETER Status
No description available.
.PARAMETER StartTime
Time associated with this deactivation request (ISO-8601).
.OUTPUTS

Jitactivationdeactivateresponse<PSCustomObject>
#>


function Initialize-Jitactivationdeactivateresponse {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Id},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${ActivationId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${ConnectionId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [ValidateSet("CREATING", "ACTIVATING", "INVALID", "ERROR", "PROVISIONED", "DEPROVISIONING", "COMPLETED", "REVOKED")]
        [PSCustomObject]
        ${Status},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.DateTime]
        ${StartTime}
    )

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

        if (!$Id) {
            throw "invalid value for 'Id', 'Id' cannot be null."
        }

        if (!$ActivationId) {
            throw "invalid value for 'ActivationId', 'ActivationId' cannot be null."
        }

        if (!$ConnectionId) {
            throw "invalid value for 'ConnectionId', 'ConnectionId' cannot be null."
        }

        if (!$Status) {
            throw "invalid value for 'Status', 'Status' cannot be null."
        }

        if (!$StartTime) {
            throw "invalid value for 'StartTime', 'StartTime' cannot be null."
        }


        $PSO = [PSCustomObject]@{
            "id" = ${Id}
            "activationId" = ${ActivationId}
            "connectionId" = ${ConnectionId}
            "status" = ${Status}
            "startTime" = ${StartTime}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to Jitactivationdeactivateresponse<PSCustomObject>

.DESCRIPTION

Convert from JSON to Jitactivationdeactivateresponse<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

Jitactivationdeactivateresponse<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in Jitactivationdeactivateresponse
        $AllProperties = ("id", "activationId", "connectionId", "status", "startTime")
        foreach ($name in $JsonParameters.PsObject.Properties.Name) {
            if (!($AllProperties.Contains($name))) {
                throw "Error! JSON key '$name' not found in the properties: $($AllProperties)"
            }
        }

        If ([string]::IsNullOrEmpty($Json) -or $Json -eq "{}") { # empty json
            throw "Error! Empty JSON cannot be serialized due to the required property 'id' missing."
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "id"))) {
            throw "Error! JSON cannot be serialized due to the required property 'id' missing."
        } else {
            $Id = $JsonParameters.PSobject.Properties["id"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "activationId"))) {
            throw "Error! JSON cannot be serialized due to the required property 'activationId' missing."
        } else {
            $ActivationId = $JsonParameters.PSobject.Properties["activationId"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "connectionId"))) {
            throw "Error! JSON cannot be serialized due to the required property 'connectionId' missing."
        } else {
            $ConnectionId = $JsonParameters.PSobject.Properties["connectionId"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "status"))) {
            throw "Error! JSON cannot be serialized due to the required property 'status' missing."
        } else {
            $Status = $JsonParameters.PSobject.Properties["status"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "startTime"))) {
            throw "Error! JSON cannot be serialized due to the required property 'startTime' missing."
        } else {
            $StartTime = $JsonParameters.PSobject.Properties["startTime"].value
        }

        $PSO = [PSCustomObject]@{
            "id" = ${Id}
            "activationId" = ${ActivationId}
            "connectionId" = ${ConnectionId}
            "status" = ${Status}
            "startTime" = ${StartTime}
        }

        return $PSO
    }

}