Public/Requests/Remove-SCAAccessRequest.ps1
|
function Remove-SCAAccessRequest { <# .SYNOPSIS Cancels an open access request. .DESCRIPTION Calls POST /workflows/requests/{requestId}/cancel on the Access Requests API. Only the original requester can typically cancel their own open request; the caller must hold the "Access request applicant" role. .PARAMETER RequestId The access request to cancel. .PARAMETER Session A psSCA.Session object or session name. Defaults to the current default session. .EXAMPLE Remove-SCAAccessRequest -RequestId 'a1b2c3d4-request-id' Cancels the specified access request. .INPUTS System.String. RequestId can be piped in by value or by property name. .OUTPUTS psSCA.AccessRequest .LINK https://api-docs.cyberark.com/access-request-api/docs/access-request-api #> [CmdletBinding(SupportsShouldProcess, ConfirmImpact = 'Medium')] [OutputType('psSCA.AccessRequest')] param( [Parameter(Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName)] [Alias('id')] [string]$RequestId, [Parameter()] [object]$Session ) process { if ($PSCmdlet.ShouldProcess($RequestId, 'Cancel Secure Cloud Access request')) { Invoke-SCARequest -Session $Session -Service 'UAR' -Method POST -Path '/workflows/requests/{requestId}/cancel' ` -PathParameters @{ requestId = $RequestId } -Operation 'Remove-SCAAccessRequest' -TypeName 'psSCA.AccessRequest' } } } |