Model/Approvalconfig.ps1
|
# # Identity Security Cloud API - Approvals # 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 Approval config Object .PARAMETER ReminderConfig No description available. .PARAMETER EscalationConfig No description available. .PARAMETER TimeoutConfig No description available. .PARAMETER CronTimezone No description available. .PARAMETER SerialChain If the approval request has an approvalCriteria of SERIAL this chain will be used to determine the assignment order. .PARAMETER RequiresComment Determines whether a comment is required when approving or rejecting the approval request. .PARAMETER FallbackApprover No description available. .PARAMETER MachineIdentityManagerAssignment Specifies how to treat the identity type ""MANAGER_OF"" when the requestee is a machine identity. .PARAMETER CircumventApprovalProcess When true, all approvals will be created with the status ""PASSED"". .PARAMETER AutoApprove OFF will prevent the approval request from being assigned to the requester or requestee by assigning it to their manager instead. DIRECT will cause approval requests to be auto-approved when assigned directly and only to the requester. INDIRECT will auto-approve when the requester appears anywhere in the list of approvers, including in a governance group. This field will only be effective if requestedTarget.reauthRequired is set to false, otherwise the approval will have to be manually approved. .OUTPUTS Approvalconfig<PSCustomObject> #> function Initialize-Approvalconfig { [CmdletBinding()] Param ( [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${ReminderConfig}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${EscalationConfig}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${TimeoutConfig}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${CronTimezone}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject[]] ${SerialChain}, [Parameter(ValueFromPipelineByPropertyName = $true)] [ValidateSet("APPROVAL", "REJECTION", "ALL", "OFF")] [String] ${RequiresComment}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${FallbackApprover}, [Parameter(ValueFromPipelineByPropertyName = $true)] [ValidateSet("MANAGER_OF_REQUESTER", "MACHINE_IDENTITY_OWNER", "MANAGER_OF_MACHINE_IDENTITY_OWNER", "REQUESTED_TARGET_OWNER", "MANAGER_OF_REQUESTED_TARGET_OWNER", "ACCOUNT_OWNER", "MANAGER_OF_ACCOUNT_OWNER")] [String] ${MachineIdentityManagerAssignment} = "MANAGER_OF_REQUESTER", [Parameter(ValueFromPipelineByPropertyName = $true)] [System.Nullable[Boolean]] ${CircumventApprovalProcess} = $false, [Parameter(ValueFromPipelineByPropertyName = $true)] [ValidateSet("OFF", "DIRECT", "INDIRECT")] [String] ${AutoApprove} ) Process { 'Creating PSCustomObject: PSSailpoint.Approvals => Approvalconfig' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $PSO = [PSCustomObject]@{ "reminderConfig" = ${ReminderConfig} "escalationConfig" = ${EscalationConfig} "timeoutConfig" = ${TimeoutConfig} "cronTimezone" = ${CronTimezone} "serialChain" = ${SerialChain} "requiresComment" = ${RequiresComment} "fallbackApprover" = ${FallbackApprover} "machineIdentityManagerAssignment" = ${MachineIdentityManagerAssignment} "circumventApprovalProcess" = ${CircumventApprovalProcess} "autoApprove" = ${AutoApprove} } return $PSO } } <# .SYNOPSIS Convert from JSON to Approvalconfig<PSCustomObject> .DESCRIPTION Convert from JSON to Approvalconfig<PSCustomObject> .PARAMETER Json Json object .OUTPUTS Approvalconfig<PSCustomObject> #> function ConvertFrom-JsonToApprovalconfig { Param( [AllowEmptyString()] [string]$Json ) Process { 'Converting JSON to PSCustomObject: PSSailpoint.Approvals => Approvalconfig' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $JsonParameters = ConvertFrom-Json -InputObject $Json # check if Json contains properties not defined in Approvalconfig $AllProperties = ("reminderConfig", "escalationConfig", "timeoutConfig", "cronTimezone", "serialChain", "requiresComment", "fallbackApprover", "machineIdentityManagerAssignment", "circumventApprovalProcess", "autoApprove") 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 "reminderConfig"))) { #optional property not found $ReminderConfig = $null } else { $ReminderConfig = $JsonParameters.PSobject.Properties["reminderConfig"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "escalationConfig"))) { #optional property not found $EscalationConfig = $null } else { $EscalationConfig = $JsonParameters.PSobject.Properties["escalationConfig"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "timeoutConfig"))) { #optional property not found $TimeoutConfig = $null } else { $TimeoutConfig = $JsonParameters.PSobject.Properties["timeoutConfig"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "cronTimezone"))) { #optional property not found $CronTimezone = $null } else { $CronTimezone = $JsonParameters.PSobject.Properties["cronTimezone"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "serialChain"))) { #optional property not found $SerialChain = $null } else { $SerialChain = $JsonParameters.PSobject.Properties["serialChain"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "requiresComment"))) { #optional property not found $RequiresComment = $null } else { $RequiresComment = $JsonParameters.PSobject.Properties["requiresComment"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "fallbackApprover"))) { #optional property not found $FallbackApprover = $null } else { $FallbackApprover = $JsonParameters.PSobject.Properties["fallbackApprover"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "machineIdentityManagerAssignment"))) { #optional property not found $MachineIdentityManagerAssignment = $null } else { $MachineIdentityManagerAssignment = $JsonParameters.PSobject.Properties["machineIdentityManagerAssignment"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "circumventApprovalProcess"))) { #optional property not found $CircumventApprovalProcess = $null } else { $CircumventApprovalProcess = $JsonParameters.PSobject.Properties["circumventApprovalProcess"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "autoApprove"))) { #optional property not found $AutoApprove = $null } else { $AutoApprove = $JsonParameters.PSobject.Properties["autoApprove"].value } $PSO = [PSCustomObject]@{ "reminderConfig" = ${ReminderConfig} "escalationConfig" = ${EscalationConfig} "timeoutConfig" = ${TimeoutConfig} "cronTimezone" = ${CronTimezone} "serialChain" = ${SerialChain} "requiresComment" = ${RequiresComment} "fallbackApprover" = ${FallbackApprover} "machineIdentityManagerAssignment" = ${MachineIdentityManagerAssignment} "circumventApprovalProcess" = ${CircumventApprovalProcess} "autoApprove" = ${AutoApprove} } return $PSO } } |