Client   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 78
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 4
eloc 8
c 2
b 0
f 0
dl 0
loc 78
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A update() 0 3 1
A get() 0 3 1
A create() 0 3 1
A updateStatus() 0 8 1
1
<?php
2
3
namespace CloudyCity\KuaishouMarketingSDK\Advertising\Creative;
4
5
use CloudyCity\KuaishouMarketingSDK\Kernel\BaseClient;
6
7
class Client extends BaseClient
8
{
9
    /**
10
     * 创建广告创意.
11
     *
12
     * @link https://yiqixie.com/d/home/fcACuwYpSB3pFCkgbykniO7_h
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 create(array $params)
23
    {
24
        return $this->httpPostJson('v2/creative/create', $params);
25
    }
26
27
    /**
28
     * 获取广告创意列表.
29
     *
30
     * @link https://yiqixie.com/d/home/fcAB8NFoHn82gbNSTAM4rU2re
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/creative/list', $params);
43
    }
44
45
    /**
46
     * 更新广告创意.
47
     *
48
     * @link https://yiqixie.com/d/home/fcABb12AIZLwBzk5itfCK395N
49
     *
50
     * @param array $params
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 update(array $params)
59
    {
60
        return $this->httpPostJson('v2/creative/update', $params);
61
    }
62
63
    /**
64
     * 更新广告创意状态
65
     *
66
     * @link https://yiqixie.com/d/home/fcABb12AIZLwBzk5itfCK395N
67
     *
68
     * @param $creativeId
69
     * @param $status
70
     *
71
     * @throws \CloudyCity\KuaishouMarketingSDK\Kernel\Exceptions\ApiException
72
     * @throws \CloudyCity\KuaishouMarketingSDK\Kernel\Exceptions\InvalidArgumentException
73
     * @throws \GuzzleHttp\Exception\GuzzleException
74
     *
75
     * @return array|\CloudyCity\KuaishouMarketingSDK\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string
76
     */
77
    public function updateStatus($creativeId, $status)
78
    {
79
        $params = [
80
            'creative_id' => $creativeId,
81
            'put_status'  => $status,
82
        ];
83
84
        return $this->httpPostJson('v1/creative/update/status', $params);
85
    }
86
}
87