machine-identities-lifecycle-actions/src/PSSailpoint.MachineIdentitiesLifecycleActions/Model/LifecycleProvisioning.ps1

#
# Identity Security Cloud API - Machine Identity Lifecycle Actions
# Use these APIs to submit, list, retrieve, and cancel machine identity lifecycle actions (for example agent activate and deactivate). 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

Provisioning execution window for the lifecycle request.

.PARAMETER Status
No description available.
.PARAMETER Started
Time when provisioning started (ISO-8601).
.PARAMETER Ended
Time when provisioning ended (ISO-8601).
.OUTPUTS

LifecycleProvisioning<PSCustomObject>
#>


function Initialize-LifecycleProvisioning {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [ValidateSet("NOT_STARTED", "IN_PROGRESS", "COMPLETED", "FAILED")]
        [PSCustomObject]
        ${Status},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${Started},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${Ended}
    )

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


        $PSO = [PSCustomObject]@{
            "status" = ${Status}
            "started" = ${Started}
            "ended" = ${Ended}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to LifecycleProvisioning<PSCustomObject>

.DESCRIPTION

Convert from JSON to LifecycleProvisioning<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

LifecycleProvisioning<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in LifecycleProvisioning
        $AllProperties = ("status", "started", "ended")
        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 "status"))) { #optional property not found
            $Status = $null
        } else {
            $Status = $JsonParameters.PSobject.Properties["status"].value
        }

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

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

        $PSO = [PSCustomObject]@{
            "status" = ${Status}
            "started" = ${Started}
            "ended" = ${Ended}
        }

        return $PSO
    }

}