Model/VAClusterStatusChangeEvent.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 Created
The date and time the status change occurred.
.PARAMETER Type
The type of the object that initiated this event.
.PARAMETER Application
No description available.
.PARAMETER HealthCheckResult
No description available.
.PARAMETER PreviousHealthCheckResult
No description available.
.OUTPUTS

VAClusterStatusChangeEvent<PSCustomObject>
#>


function Initialize-BetaVAClusterStatusChangeEvent {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.DateTime]
        ${Created},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [ValidateSet("SOURCE", "CLUSTER")]
        [PSCustomObject]
        ${Type},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Application},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${HealthCheckResult},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${PreviousHealthCheckResult}
    )

    Process {
        'Creating PSCustomObject: Tm.Beta => BetaVAClusterStatusChangeEvent' | Write-Debug
        $PSBoundParameters | Out-DebugParameter | Write-Debug

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

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

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

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

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


        $PSO = [PSCustomObject]@{
            "created" = ${Created}
            "type" = ${Type}
            "application" = ${Application}
            "healthCheckResult" = ${HealthCheckResult}
            "previousHealthCheckResult" = ${PreviousHealthCheckResult}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to VAClusterStatusChangeEvent<PSCustomObject>

.DESCRIPTION

Convert from JSON to VAClusterStatusChangeEvent<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

VAClusterStatusChangeEvent<PSCustomObject>
#>

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

    Process {
        'Converting JSON to PSCustomObject: Tm.Beta => BetaVAClusterStatusChangeEvent' | Write-Debug
        $PSBoundParameters | Out-DebugParameter | Write-Debug

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in BetaVAClusterStatusChangeEvent
        $AllProperties = ("created", "type", "application", "healthCheckResult", "previousHealthCheckResult")
        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 'created' missing."
        }

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

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

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

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

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

        $PSO = [PSCustomObject]@{
            "created" = ${Created}
            "type" = ${Type}
            "application" = ${Application}
            "healthCheckResult" = ${HealthCheckResult}
            "previousHealthCheckResult" = ${PreviousHealthCheckResult}
        }

        return $PSO
    }

}