Client::getConversionInfo()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace CloudyCity\KuaishouMarketingSDK\Advertising\Unit;
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/ad_unit/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/ad_unit/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/ad_unit/update', $params);
61
    }
62
63
    /**
64
     * 更新广告组出价.
65
     *
66
     * @link https://yiqixie.com/d/home/fcABb12AIZLwBzk5itfCK395N
67
     *
68
     * @param $unitId
69
     * @param $bid
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 updateBid($unitId, $bid)
78
    {
79
        $params = [
80
            'unit_id' => $unitId,
81
            'bid'     => $bid,
82
        ];
83
84
        return $this->httpPostJson('v1/ad_unit/update/bid', $params);
85
    }
86
87
    /**
88
     * 更新广告组预算.
89
     *
90
     * @link https://yiqixie.com/d/home/fcABb12AIZLwBzk5itfCK395N
91
     *
92
     * @param $unitId
93
     * @param $budget
94
     *
95
     * @throws \CloudyCity\KuaishouMarketingSDK\Kernel\Exceptions\ApiException
96
     * @throws \CloudyCity\KuaishouMarketingSDK\Kernel\Exceptions\InvalidArgumentException
97
     * @throws \GuzzleHttp\Exception\GuzzleException
98
     *
99
     * @return array|\CloudyCity\KuaishouMarketingSDK\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string
100
     */
101
    public function updateBudget($unitId, $budget)
102
    {
103
        $params = [
104
            'unit_id'    => $unitId,
105
            'day_budget' => $budget,
106
        ];
107
108
        return $this->httpPostJson('v1/ad_unit/update/day_budget', $params);
109
    }
110
111
    /**
112
     * 更新广告组状态
113
     *
114
     * @link https://yiqixie.com/d/home/fcABb12AIZLwBzk5itfCK395N
115
     *
116
     * @param $unitId
117
     * @param $status
118
     *
119
     * @throws \CloudyCity\KuaishouMarketingSDK\Kernel\Exceptions\ApiException
120
     * @throws \CloudyCity\KuaishouMarketingSDK\Kernel\Exceptions\InvalidArgumentException
121
     * @throws \GuzzleHttp\Exception\GuzzleException
122
     *
123
     * @return array|\CloudyCity\KuaishouMarketingSDK\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string
124
     */
125
    public function updateStatus($unitId, $status)
126
    {
127
        $params = [
128
            'unit_id'    => $unitId,
129
            'put_status' => $status,
130
        ];
131
132
        return $this->httpPostJson('v1/ad_unit/update/status', $params);
133
    }
134
135
    /**
136
     * 获取深度转化类型.
137
     *
138
     * @link https://yiqixie.com/d/home/fcACuwYpSB3pFCkgbykniO7_h#
139
     *
140
     * @throws \CloudyCity\KuaishouMarketingSDK\Kernel\Exceptions\ApiException
141
     * @throws \CloudyCity\KuaishouMarketingSDK\Kernel\Exceptions\InvalidArgumentException
142
     * @throws \GuzzleHttp\Exception\GuzzleException
143
     *
144
     * @return array|\CloudyCity\KuaishouMarketingSDK\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string
145
     */
146
    public function getConversionInfo()
147
    {
148
        return $this->httpGetJson('v1/ad_unit/ocpc/conversion_infos');
149
    }
150
}
151