Webhook::delete()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
namespace tbclla\Revolut\Resources;
4
5
class Webhook extends Resource
6
{
7
    /**
8
     * The enpoint for webhook requests
9
     * 
10
     * @var string
11
     */
12
    const ENDPOINT = '/webhook';
13
14
    /**
15
     * Create a webhook
16
     * 
17
     * @see https://revolut-engineering.github.io/api-docs/business-api/#web-hooks-setting-up-a-web-hook Official API documentation
18
     * @param string $url call back url of the client system, https is the supported protocol
19
     * @return array The response body
20
     * @throws \tbclla\Revolut\Exceptions\ApiException if the client responded with a 4xx-5xx response
21
     * @throws \tbclla\Revolut\Exceptions\AppUnauthorizedException if the app needs to be re-authorized
22
     */
23
    public function create(string $url)
24
    {
25
        return $this->client->post(self::ENDPOINT, ['json' => ['url' => $url]]);
26
    }
27
28
    /**
29
     * Delete the webhook
30
     * 
31
     * @see https://revolut-engineering.github.io/api-docs/business-api/#web-hooks-deleting-a-web-hook Official API documentation
32
     * @return void
33
     * @throws \tbclla\Revolut\Exceptions\ApiException if the client responded with a 4xx-5xx response
34
     * @throws \tbclla\Revolut\Exceptions\AppUnauthorizedException if the app needs to be re-authorized
35
     */
36
    public function delete() : void
37
    {
38
        $this->client->delete(self::ENDPOINT);
39
    }
40
}
41