beta/src/PSSailpointBeta/Model/CorrelatedGovernanceEvent.ps1

#
# IdentityNow Beta API
# Use these APIs to interact with the IdentityNow 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 Name
The name of the governance event, such as the certification name or access request ID.
.PARAMETER Dt
The date that the certification or access request was completed.
.PARAMETER Type
The type of governance event.
.PARAMETER GovernanceId
The ID of the instance that caused the event - either the certification ID or access request ID.
.PARAMETER Owners
The owners of the governance event (the certifiers or approvers)
.PARAMETER Reviewers
The owners of the governance event (the certifiers or approvers), this field should be preferred over owners
.PARAMETER DecisionMaker
No description available.
.OUTPUTS

CorrelatedGovernanceEvent<PSCustomObject>
#>


function Initialize-BetaCorrelatedGovernanceEvent {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Name},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Dt},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [ValidateSet("certification", "accessRequest")]
        [String]
        ${Type},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${GovernanceId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject[]]
        ${Owners},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject[]]
        ${Reviewers},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${DecisionMaker}
    )

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


        $PSO = [PSCustomObject]@{
            "name" = ${Name}
            "dt" = ${Dt}
            "type" = ${Type}
            "governanceId" = ${GovernanceId}
            "owners" = ${Owners}
            "reviewers" = ${Reviewers}
            "decisionMaker" = ${DecisionMaker}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to CorrelatedGovernanceEvent<PSCustomObject>

.DESCRIPTION

Convert from JSON to CorrelatedGovernanceEvent<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

CorrelatedGovernanceEvent<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in BetaCorrelatedGovernanceEvent
        $AllProperties = ("name", "dt", "type", "governanceId", "owners", "reviewers", "decisionMaker")
        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 "name"))) { #optional property not found
            $Name = $null
        } else {
            $Name = $JsonParameters.PSobject.Properties["name"].value
        }

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

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

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

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

        $PSO = [PSCustomObject]@{
            "name" = ${Name}
            "dt" = ${Dt}
            "type" = ${Type}
            "governanceId" = ${GovernanceId}
            "owners" = ${Owners}
            "reviewers" = ${Reviewers}
            "decisionMaker" = ${DecisionMaker}
        }

        return $PSO
    }

}