notifications/src/PSSailpoint.Notifications/Model/TemplateslackAutoApprovalData.ps1

#
# Identity Security Cloud API - Notifications
# 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 IsAutoApproved
Whether the request was auto-approved
.PARAMETER ItemId
The item ID
.PARAMETER ItemType
The item type
.PARAMETER AutoApprovalMessageJSON
JSON message for auto-approval
.PARAMETER AutoApprovalTitle
Title for auto-approval
.OUTPUTS

TemplateslackAutoApprovalData<PSCustomObject>
#>


function Initialize-TemplateslackAutoApprovalData {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${IsAutoApproved},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${ItemId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${ItemType},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${AutoApprovalMessageJSON},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${AutoApprovalTitle}
    )

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


        $PSO = [PSCustomObject]@{
            "isAutoApproved" = ${IsAutoApproved}
            "itemId" = ${ItemId}
            "itemType" = ${ItemType}
            "autoApprovalMessageJSON" = ${AutoApprovalMessageJSON}
            "autoApprovalTitle" = ${AutoApprovalTitle}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to TemplateslackAutoApprovalData<PSCustomObject>

.DESCRIPTION

Convert from JSON to TemplateslackAutoApprovalData<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

TemplateslackAutoApprovalData<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in TemplateslackAutoApprovalData
        $AllProperties = ("isAutoApproved", "itemId", "itemType", "autoApprovalMessageJSON", "autoApprovalTitle")
        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 "isAutoApproved"))) { #optional property not found
            $IsAutoApproved = $null
        } else {
            $IsAutoApproved = $JsonParameters.PSobject.Properties["isAutoApproved"].value
        }

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

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

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

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

        $PSO = [PSCustomObject]@{
            "isAutoApproved" = ${IsAutoApproved}
            "itemId" = ${ItemId}
            "itemType" = ${ItemType}
            "autoApprovalMessageJSON" = ${AutoApprovalMessageJSON}
            "autoApprovalTitle" = ${AutoApprovalTitle}
        }

        return $PSO
    }

}