Public/Remove-SignRequestRecipient.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
function Remove-SignRequestRecipient {
    [CmdletBinding(SupportsShouldProcess)]
    param (
        # Id of request
        [Parameter(Mandatory=$true, ValueFromPipelineByPropertyName)]
        [String]
        $id,

        # Recipient user id, get ids with Get-SignRequestRecipient
        [Parameter(Mandatory=$true)]
        [string]
        $recipient_id,

        # Phase number
        [Parameter(Mandatory=$false)]
        [int]
        $phaseNumber=0


    )

    begin {
        $api = "/request/$id/remove/$recipient_id/phase/$phaseNumber"
    }

    process {
        if ($PSCmdlet.ShouldProcess("ShouldProcess?")) {
            foreach ($reqid in $id) {
                $result = Invoke-SignApi -method PATCH -api $api
                if ($result) {
                    $result
                }
            }
        }
    }

    end {

    }
}