Model/Accessrequestconfigv2.ps1

#
# Identity Security Cloud API - Access Requests
# 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 ApprovalsMustBeExternal
If this is true, approvals must be processed by an external system. Also, if this is true, it blocks Request Center access requests and returns an error for any user who isn't an org admin.
.PARAMETER ReauthorizationEnabled
If this is true, reauthorization will be enforced for appropriately configured access items. Enablement of this feature is currently in a limited state.
.PARAMETER RequestOnBehalfOfConfig
No description available.
.PARAMETER EntitlementRequestConfig
No description available.
.PARAMETER GovGroupVisibilityEnabled
If this is true, requesters and requested-for users will be able to see the names of governance group members when a request is awaiting the group's approval. Up to the first 10 members of the group will be listed.
.OUTPUTS

Accessrequestconfigv2<PSCustomObject>
#>


function Initialize-Accessrequestconfigv2 {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${ApprovalsMustBeExternal} = $false,
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${ReauthorizationEnabled} = $false,
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${RequestOnBehalfOfConfig},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${EntitlementRequestConfig},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${GovGroupVisibilityEnabled} = $false
    )

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


        $PSO = [PSCustomObject]@{
            "approvalsMustBeExternal" = ${ApprovalsMustBeExternal}
            "reauthorizationEnabled" = ${ReauthorizationEnabled}
            "requestOnBehalfOfConfig" = ${RequestOnBehalfOfConfig}
            "entitlementRequestConfig" = ${EntitlementRequestConfig}
            "govGroupVisibilityEnabled" = ${GovGroupVisibilityEnabled}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to Accessrequestconfigv2<PSCustomObject>

.DESCRIPTION

Convert from JSON to Accessrequestconfigv2<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

Accessrequestconfigv2<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in Accessrequestconfigv2
        $AllProperties = ("approvalsMustBeExternal", "reauthorizationEnabled", "requestOnBehalfOfConfig", "entitlementRequestConfig", "govGroupVisibilityEnabled")
        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 "approvalsMustBeExternal"))) { #optional property not found
            $ApprovalsMustBeExternal = $null
        } else {
            $ApprovalsMustBeExternal = $JsonParameters.PSobject.Properties["approvalsMustBeExternal"].value
        }

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

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

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

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

        $PSO = [PSCustomObject]@{
            "approvalsMustBeExternal" = ${ApprovalsMustBeExternal}
            "reauthorizationEnabled" = ${ReauthorizationEnabled}
            "requestOnBehalfOfConfig" = ${RequestOnBehalfOfConfig}
            "entitlementRequestConfig" = ${EntitlementRequestConfig}
            "govGroupVisibilityEnabled" = ${GovGroupVisibilityEnabled}
        }

        return $PSO
    }

}