Completed
Push — master ( e39ede...a396d2 )
by Luca
01:29
created

IntegrationActionsModel   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 2
dl 0
loc 33
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A openDialog() 0 4 1
A submitDialog() 0 4 1
A deleteCurrentBrandImage() 0 4 1
1
<?php
2
/**
3
 * This Driver is based entirely on official documentation of the Mattermost Web
4
 * Services API and you can extend it by following the directives of the documentation.
5
 *
6
 * God bless this mess.
7
 *
8
 * @author Luca Agnello <[email protected]>
9
 * @link https://api.mattermost.com/
10
 */
11
12
namespace Gnello\Mattermost\Models;
13
14
use GuzzleHttp\RequestOptions;
15
use Psr\Http\Message\ResponseInterface;
16
17
/**
18
 * Class IntegrationActionsModel
19
 *
20
 * @package Gnello\Mattermost\Models
21
 */
22
class IntegrationActionsModel extends AbstractModel
23
{
24
    /**
25
     * @var string
26
     */
27
    private static $endpoint = '/actions';
28
29
    /**
30
     * @param array $requestOptions
31
     * @return ResponseInterface
32
     */
33
    public function openDialog(array $requestOptions)
34
    {
35
        return $this->client->post(self::$endpoint . '/dialogs/open', $requestOptions);
36
    }
37
38
    /**
39
     * @param array $requestOptions
40
     * @return ResponseInterface
41
     */
42
    public function submitDialog(array $requestOptions)
43
    {
44
        return $this->client->post(self::$endpoint . '/dialogs/submit', $requestOptions);
45
    }
46
47
    /**
48
     * @return ResponseInterface
49
     */
50
    public function deleteCurrentBrandImage()
51
    {
52
        return $this->client->delete(self::$endpoint . '/image');
53
    }
54
}
55