Client   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 80
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
eloc 9
c 1
b 0
f 0
dl 0
loc 80
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A upload() 0 3 1
A delete() 0 7 1
A get() 0 3 1
A push() 0 7 1
1
<?php
2
3
namespace CloudyCity\KuaishouMarketingSDK\Dmp\Population;
4
5
use CloudyCity\KuaishouMarketingSDK\Kernel\BaseClient;
6
7
class Client extends BaseClient
8
{
9
    /**
10
     * 上传人群包.
11
     *
12
     * @link https://yiqixie.com/d/home/fcAAfm9OQj5OeEBd9TB2gtxvD
13
     *
14
     * @param array $params
15
     *
16
     * @throws \CloudyCity\KuaishouMarketingSDK\Kernel\Exceptions\ApiException
17
     * @throws \CloudyCity\KuaishouMarketingSDK\Kernel\Exceptions\InvalidArgumentException
18
     * @throws \GuzzleHttp\Exception\GuzzleException
19
     *
20
     * @return array|\CloudyCity\KuaishouMarketingSDK\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string
21
     */
22
    public function upload(array $params)
23
    {
24
        return $this->httpPostJson('v1/dmp/population/upload', $params);
25
    }
26
27
    /**
28
     * 获取人群包列表.
29
     *
30
     * @link https://yiqixie.com/d/home/fcAAfm9OQj5OeEBd9TB2gtxvD
31
     *
32
     * @param array $params
33
     *
34
     * @throws \CloudyCity\KuaishouMarketingSDK\Kernel\Exceptions\ApiException
35
     * @throws \CloudyCity\KuaishouMarketingSDK\Kernel\Exceptions\InvalidArgumentException
36
     * @throws \GuzzleHttp\Exception\GuzzleException
37
     *
38
     * @return array|\CloudyCity\KuaishouMarketingSDK\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string
39
     */
40
    public function get(array $params)
41
    {
42
        return $this->httpPostJson('v1/dmp/population/list', $params);
43
    }
44
45
    /**
46
     * 删除人群包.
47
     *
48
     * @link https://yiqixie.com/d/home/fcAAfm9OQj5OeEBd9TB2gtxvD
49
     *
50
     * @param $id
51
     *
52
     * @throws \CloudyCity\KuaishouMarketingSDK\Kernel\Exceptions\ApiException
53
     * @throws \CloudyCity\KuaishouMarketingSDK\Kernel\Exceptions\InvalidArgumentException
54
     * @throws \GuzzleHttp\Exception\GuzzleException
55
     *
56
     * @return array|\CloudyCity\KuaishouMarketingSDK\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string
57
     */
58
    public function delete($id)
59
    {
60
        $params = [
61
            'orientation_id' => $id,
62
        ];
63
64
        return $this->httpPostJson('v1/dmp/population/delete', $params);
65
    }
66
67
    /**
68
     * 推送人群包.
69
     *
70
     * @link https://yiqixie.com/d/home/fcAAfm9OQj5OeEBd9TB2gtxvD
71
     *
72
     * @param $id
73
     *
74
     * @throws \CloudyCity\KuaishouMarketingSDK\Kernel\Exceptions\ApiException
75
     * @throws \CloudyCity\KuaishouMarketingSDK\Kernel\Exceptions\InvalidArgumentException
76
     * @throws \GuzzleHttp\Exception\GuzzleException
77
     *
78
     * @return array|\CloudyCity\KuaishouMarketingSDK\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string
79
     */
80
    public function push($id)
81
    {
82
        $params = [
83
            'orientation_id' => $id,
84
        ];
85
86
        return $this->httpPostJson('v1/dmp/population/push', $params);
87
    }
88
}
89