Client   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 3
eloc 10
c 2
b 0
f 1
dl 0
loc 40
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getBaseUri() 0 3 1
A get() 0 8 1
A delete() 0 8 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
}