Client::updateGender()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 2
dl 0
loc 9
rs 9.9666
c 0
b 0
f 0
1
<?php
2
3
namespace CloudyCity\UCMarketingSDK\Campaign;
4
5
use CloudyCity\UCMarketingSDK\Kernel\BaseClient;
6
7
class Client extends BaseClient
8
{
9
    /**
10
     * 创建推广计划.
11
     *
12
     * @param array $params
13
     *
14
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\ApiException
15
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\InvalidArgumentException
16
     * @throws \GuzzleHttp\Exception\GuzzleException
17
     *
18
     * @return array|\Doctrine\Common\Collections\ArrayCollection|object|\Psr\Http\Message\ResponseInterface|string
19
     */
20
    public function add(array $params)
21
    {
22
        return $this->httpPostJson('campaign/add', $params);
23
    }
24
25
    /**
26
     * 更新推广计划.
27
     *
28
     * @param array $params
29
     *
30
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\ApiException
31
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\InvalidArgumentException
32
     * @throws \GuzzleHttp\Exception\GuzzleException
33
     *
34
     * @return array|\Doctrine\Common\Collections\ArrayCollection|object|\Psr\Http\Message\ResponseInterface|string
35
     */
36
    public function update(array $params)
37
    {
38
        return $this->httpPostJson('campaign/update', $params);
39
    }
40
41
    /**
42
     * 更新推广计划的出价.
43
     *
44
     * @param array $params
45
     *
46
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\ApiException
47
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\InvalidArgumentException
48
     * @throws \GuzzleHttp\Exception\GuzzleException
49
     *
50
     * @return array|\Doctrine\Common\Collections\ArrayCollection|object|\Psr\Http\Message\ResponseInterface|string
51
     */
52
    public function updateBid(array $params)
53
    {
54
        return $this->httpPostJson('campaign/bid/update', $params);
55
    }
56
57
    /**
58
     * 更新推广计划的出价(按百分比).
59
     *
60
     * @param array $params
61
     *
62
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\ApiException
63
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\InvalidArgumentException
64
     * @throws \GuzzleHttp\Exception\GuzzleException
65
     *
66
     * @return array|\Doctrine\Common\Collections\ArrayCollection|object|\Psr\Http\Message\ResponseInterface|string
67
     */
68
    public function updateBidPercentage(array $params)
69
    {
70
        return $this->httpPostJson('campaign/bid/percentage/update', $params);
71
    }
72
73
    /**
74
     * 更新推广计划的状态.
75
     *
76
     * @param array $campaignIds
77
     * @param bool  $paused
78
     *
79
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\ApiException
80
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\InvalidArgumentException
81
     * @throws \GuzzleHttp\Exception\GuzzleException
82
     *
83
     * @return array|\Doctrine\Common\Collections\ArrayCollection|object|\Psr\Http\Message\ResponseInterface|string
84
     */
85
    public function updatePaused(array $campaignIds, $paused)
86
    {
87
        $params = [
88
            'campaignIds' => $campaignIds,
89
            'paused'      => $paused,
90
        ];
91
92
        return $this->httpPostJson('campaign/paused/update', $params);
93
    }
94
95
    /**
96
     * 更新推广计划的地域.
97
     *
98
     * @param array $campaignIds
99
     * @param int   $allRegion
100
     * @param int[] $region
101
     *
102
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\ApiException
103
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\InvalidArgumentException
104
     * @throws \GuzzleHttp\Exception\GuzzleException
105
     *
106
     * @return array|\Doctrine\Common\Collections\ArrayCollection|object|\Psr\Http\Message\ResponseInterface|string
107
     */
108
    public function updateRegion(array $campaignIds, $allRegion, array $region = [])
109
    {
110
        $params = [
111
            'campaignIds' => $campaignIds,
112
            'allRegion'   => $allRegion,
113
            'region'      => $region,
114
        ];
115
116
        return $this->httpPostJson('campaign/region/update', $params);
117
    }
118
119
    /**
120
     * 更新推广计划网络环境.
121
     *
122
     * @param array  $campaignIds
123
     * @param string $target
124
     *
125
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\ApiException
126
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\InvalidArgumentException
127
     * @throws \GuzzleHttp\Exception\GuzzleException
128
     *
129
     * @return array|\Doctrine\Common\Collections\ArrayCollection|object|\Psr\Http\Message\ResponseInterface|string
130
     */
131
    public function updateNetworkEnv(array $campaignIds, $target)
132
    {
133
        $params = [
134
            'campaignIds' => $campaignIds,
135
            'target'      => $target,
136
        ];
137
138
        return $this->httpPostJson('campaign/network/update', $params);
139
    }
140
141
    /**
142
     * 更新推广计划的年龄.
143
     *
144
     * @param array  $campaignIds
145
     * @param number $target
146
     *
147
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\ApiException
148
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\InvalidArgumentException
149
     * @throws \GuzzleHttp\Exception\GuzzleException
150
     *
151
     * @return array|\Doctrine\Common\Collections\ArrayCollection|object|\Psr\Http\Message\ResponseInterface|string
152
     */
153
    public function updateAge(array $campaignIds, $target)
154
    {
155
        $params = [
156
            'campaignIds' => $campaignIds,
157
            'target'      => $target,
158
        ];
159
160
        return $this->httpPostJson('campaign/age/update', $params);
161
    }
162
163
    /**
164
     * 更新推广计划的性别.
165
     *
166
     * @param array  $campaignIds
167
     * @param number $target
168
     *
169
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\ApiException
170
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\InvalidArgumentException
171
     * @throws \GuzzleHttp\Exception\GuzzleException
172
     *
173
     * @return array|\Doctrine\Common\Collections\ArrayCollection|object|\Psr\Http\Message\ResponseInterface|string
174
     */
175
    public function updateGender(array $campaignIds, $target)
176
    {
177
        $params = [
178
            'campaignIds' => $campaignIds,
179
            'target'      => $target,
180
        ];
181
182
        return $this->httpPostJson('campaign/gender/update', $params);
183
    }
184
185
    /**
186
     * 更新推广计划的投放平台.
187
     *
188
     * @param array  $campaignIds
189
     * @param number $target
190
     *
191
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\ApiException
192
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\InvalidArgumentException
193
     * @throws \GuzzleHttp\Exception\GuzzleException
194
     *
195
     * @return array|\Doctrine\Common\Collections\ArrayCollection|object|\Psr\Http\Message\ResponseInterface|string
196
     */
197
    public function updatePlatform(array $campaignIds, $target)
198
    {
199
        $params = [
200
            'campaignIds' => $campaignIds,
201
            'target'      => $target,
202
        ];
203
204
        return $this->httpPostJson('campaign/platform/update', $params);
205
    }
206
207
    /**
208
     * 更新推广计划的转化过滤.
209
     *
210
     * @param array  $campaignIds
211
     * @param number $target
212
     *
213
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\ApiException
214
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\InvalidArgumentException
215
     * @throws \GuzzleHttp\Exception\GuzzleException
216
     *
217
     * @return array|\Doctrine\Common\Collections\ArrayCollection|object|\Psr\Http\Message\ResponseInterface|string
218
     */
219
    public function updateConvertFilter(array $campaignIds, $target)
220
    {
221
        $params = [
222
            'campaignIds' => $campaignIds,
223
            'target'      => $target,
224
        ];
225
226
        return $this->httpPostJson('campaign/convertfilter/update', $params);
227
    }
228
229
    /**
230
     * 更新推广计划的转化过滤.
231
     *
232
     * @param array  $campaignIds
233
     * @param number $target
234
     *
235
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\ApiException
236
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\InvalidArgumentException
237
     * @throws \GuzzleHttp\Exception\GuzzleException
238
     *
239
     * @return array|\Doctrine\Common\Collections\ArrayCollection|object|\Psr\Http\Message\ResponseInterface|string
240
     */
241
    public function updateIntelli(array $campaignIds, $target)
242
    {
243
        $params = [
244
            'campaignIds' => $campaignIds,
245
            'target'      => $target,
246
        ];
247
248
        return $this->httpPostJson('campaign/intelli/update', $params);
249
    }
250
251
    /**
252
     * 更新推广计划的人群包.
253
     *
254
     * @param array $params
255
     *
256
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\ApiException
257
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\InvalidArgumentException
258
     * @throws \GuzzleHttp\Exception\GuzzleException
259
     *
260
     * @return array|\Doctrine\Common\Collections\ArrayCollection|object|\Psr\Http\Message\ResponseInterface|string
261
     */
262
    public function updateAudience(array $params)
263
    {
264
        return $this->httpPostJson('campaign/audience/update', $params);
265
    }
266
267
    /**
268
     * 更新推广计划的预算.
269
     *
270
     * @param array  $campaignIds
271
     * @param number $budget
272
     * @param bool   $forceBudget
273
     *
274
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\ApiException
275
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\InvalidArgumentException
276
     * @throws \GuzzleHttp\Exception\GuzzleException
277
     *
278
     * @return array|\Doctrine\Common\Collections\ArrayCollection|object|\Psr\Http\Message\ResponseInterface|string
279
     */
280
    public function updateBudget(array $campaignIds, $budget, $forceBudget)
281
    {
282
        $params = [
283
            'campaignIds' => $campaignIds,
284
            'budget'      => $budget,
285
            'forceBudget' => $forceBudget,
286
        ];
287
288
        return $this->httpPostJson('campaign/budget/update', $params);
289
    }
290
291
    /**
292
     * 更新推广计划的投放排期和投放时段.
293
     *
294
     * @param array $params
295
     *
296
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\ApiException
297
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\InvalidArgumentException
298
     * @throws \GuzzleHttp\Exception\GuzzleException
299
     *
300
     * @return array|\Doctrine\Common\Collections\ArrayCollection|object|\Psr\Http\Message\ResponseInterface|string
301
     */
302
    public function updateDataAndPeriod(array $params)
303
    {
304
        return $this->httpPostJson('campaign/budget/update', $params);
305
    }
306
307
    /**
308
     * 删除推广计划.
309
     *
310
     * @param array $campaignIds
311
     *
312
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\ApiException
313
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\InvalidArgumentException
314
     * @throws \GuzzleHttp\Exception\GuzzleException
315
     *
316
     * @return array|\Doctrine\Common\Collections\ArrayCollection|object|\Psr\Http\Message\ResponseInterface|string
317
     */
318
    public function delete(array $campaignIds)
319
    {
320
        $params = [
321
            'campaignIds' => $campaignIds,
322
        ];
323
324
        return $this->httpPostJson('campaign/delete', $params);
325
    }
326
327
    /**
328
     * 根据推广组id获取推广计划.
329
     *
330
     * @param $adGroupIds
331
     *
332
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\ApiException
333
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\InvalidArgumentException
334
     * @throws \GuzzleHttp\Exception\GuzzleException
335
     *
336
     * @return array|\Doctrine\Common\Collections\ArrayCollection|object|\Psr\Http\Message\ResponseInterface|string
337
     */
338
    public function getByAdGroupIds(array $adGroupIds)
339
    {
340
        $params = [
341
            'adGroupIds' => $adGroupIds,
342
        ];
343
344
        return $this->httpPostJson('campaign/getCampaignByAdGroupId', $params);
345
    }
346
347
    /**
348
     * 根据推广组id获取推广计划id.
349
     *
350
     * @param array $adGroupIds
351
     *
352
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\ApiException
353
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\InvalidArgumentException
354
     * @throws \GuzzleHttp\Exception\GuzzleException
355
     *
356
     * @return array|\Doctrine\Common\Collections\ArrayCollection|object|\Psr\Http\Message\ResponseInterface|string
357
     */
358
    public function getIdsByAdGroupIds(array $adGroupIds)
359
    {
360
        $params = [
361
            'adGroupIds' => $adGroupIds,
362
        ];
363
364
        return $this->httpPostJson('campaign/getCampaignIdByAdGroupId', $params);
365
    }
366
367
    /**
368
     * 根据推广计划id获取推广计划.
369
     *
370
     * @param array $campaignIds
371
     *
372
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\ApiException
373
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\InvalidArgumentException
374
     * @throws \GuzzleHttp\Exception\GuzzleException
375
     *
376
     * @return array|\Doctrine\Common\Collections\ArrayCollection|object|\Psr\Http\Message\ResponseInterface|string
377
     */
378
    public function getByIds(array $campaignIds)
379
    {
380
        $params = [
381
            'campaignIds' => $campaignIds,
382
        ];
383
384
        return $this->httpPostJson('campaign/getCampaignByCampaignId', $params);
385
    }
386
}
387