Client::get()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 8
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
namespace Freyo\ApiGateway\UsagePlan;
4
5
use Freyo\ApiGateway\Kernel\TencentCloudClient;
6
7
class Client extends TencentCloudClient
8
{
9
    /**
10
     * @return string
11
     */
12
    protected function getBaseUri()
13
    {
14
        return 'https://apigateway.api.qcloud.com/v2/';
15
    }
16
17
    /**
18
     * @param $usagePlanId
19
     *
20
     * @return array|\Freyo\ApiGateway\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string
21
     * @throws \Freyo\ApiGateway\Kernel\Exceptions\InvalidConfigException
22
     */
23
    public function get($usagePlanId)
24
    {
25
        $params = [
26
            'Action' => 'DescribeUsagePlan',
27
            'usagePlanId' => $usagePlanId,
28
        ];
29
30
        return $this->httpPost('index.php', $params);
31
    }
32
33
    /**
34
     * @param $usagePlanId
35
     *
36
     * @return array|\Freyo\ApiGateway\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string
37
     * @throws \Freyo\ApiGateway\Kernel\Exceptions\InvalidConfigException
38
     */
39
    public function delete($usagePlanId)
40
    {
41
        $params = [
42
            'Action' => 'DeleteUsagePlan',
43
            'usagePlanId' => $usagePlanId,
44
        ];
45
46
        return $this->httpPost('index.php', $params);
47
    }
48
}