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

BrandModel::deleteCurrentBrandImage()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
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 BrandModel
19
 *
20
 * @package Gnello\MattermostRestApi\Models
21
 */
22
class BrandModel extends AbstractModel
23
{
24
    /**
25
     * @var string
26
     */
27
    private static $endpoint = '/brand';
28
29
    /**
30
     * @return ResponseInterface
31
     */
32
    public function getBrandImage()
33
    {
34
        return $this->client->get(self::$endpoint . '/image');
35
    }
36
37
    /**
38
     * @param array $requestOptions
39
     * @return ResponseInterface
40
     */
41
    public function uploadBrandImage(array $requestOptions)
42
    {
43
        $internalRequestOptions = self::buildMultipartDataOptions($requestOptions, ['image']);
44
45
        return $this->client->post(self::$endpoint . '/image', $internalRequestOptions, RequestOptions::MULTIPART);
46
    }
47
48
    /**
49
     * @return ResponseInterface
50
     */
51
    public function deleteCurrentBrandImage()
52
    {
53
        return $this->client->delete(self::$endpoint . '/image');
54
    }
55
}
56