Model/Jitactivationextendresponse.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 ActivationPeriodExtensionMins
Extension applied to the activation period, in minutes.
.PARAMETER Status
No description available.
.PARAMETER StartTime
Time associated with this extend request (ISO-8601).
.OUTPUTS

Jitactivationextendresponse<PSCustomObject>
#>


function Initialize-Jitactivationextendresponse {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Id},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${ActivationId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${ConnectionId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [Int32]
        ${ActivationPeriodExtensionMins},
        [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 => Jitactivationextendresponse' | 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 (!$ActivationPeriodExtensionMins) {
            throw "invalid value for 'ActivationPeriodExtensionMins', 'ActivationPeriodExtensionMins' 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}
            "activationPeriodExtensionMins" = ${ActivationPeriodExtensionMins}
            "status" = ${Status}
            "startTime" = ${StartTime}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to Jitactivationextendresponse<PSCustomObject>

.DESCRIPTION

Convert from JSON to Jitactivationextendresponse<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

Jitactivationextendresponse<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in Jitactivationextendresponse
        $AllProperties = ("id", "activationId", "connectionId", "activationPeriodExtensionMins", "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 "activationPeriodExtensionMins"))) {
            throw "Error! JSON cannot be serialized due to the required property 'activationPeriodExtensionMins' missing."
        } else {
            $ActivationPeriodExtensionMins = $JsonParameters.PSobject.Properties["activationPeriodExtensionMins"].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}
            "activationPeriodExtensionMins" = ${ActivationPeriodExtensionMins}
            "status" = ${Status}
            "startTime" = ${StartTime}
        }

        return $PSO
    }

}