Client   A
last analyzed

Complexity

Total Complexity 17

Size/Duplication

Total Lines 272
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 272
rs 10
c 0
b 0
f 0
wmc 17
lcom 1
cbo 1

17 Methods

Rating   Name   Duplication   Size   Complexity  
A uploadImages() 0 8 1
A getImages() 0 4 1
A uploadVideos() 0 4 1
A getVideos() 0 4 1
A getProvinces() 0 4 1
A getCounties() 0 4 1
A getInterests() 0 4 1
A getRecommend() 0 4 1
A getAppCategories() 0 4 1
A getConvertTypes() 0 8 1
A getAdConvert() 0 8 1
A getWordPackages() 0 4 1
A getAndroidApps() 0 4 1
A getIosAppByAppId() 0 8 1
A getIndustries() 0 4 1
A getTargetingPackages() 0 4 1
A getCreativeIndustries() 0 4 1
1
<?php
2
3
namespace CloudyCity\UCMarketingSDK\Material;
4
5
use CloudyCity\UCMarketingSDK\Kernel\BaseClient;
6
7
class Client extends BaseClient
8
{
9
    /**
10
     * 上传图片.
11
     *
12
     * @param array $imageUrls
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 uploadImages(array $imageUrls)
21
    {
22
        $params = [
23
            'imageUrls' => $imageUrls,
24
        ];
25
26
        return $this->httpPostJson('material/uploadImage', $params);
27
    }
28
29
    /**
30
     * 获取图片.
31
     *
32
     * @param array $params
33
     *
34
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\ApiException
35
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\InvalidArgumentException
36
     * @throws \GuzzleHttp\Exception\GuzzleException
37
     *
38
     * @return array|\Doctrine\Common\Collections\ArrayCollection|object|\Psr\Http\Message\ResponseInterface|string
39
     */
40
    public function getImages(array $params)
41
    {
42
        return $this->httpPostJson('material/getImage', $params);
43
    }
44
45
    /**
46
     * 上传视频.
47
     *
48
     * @see http://docs.guzzlephp.org/en/stable/quickstart.html#sending-form-files
49
     *
50
     * @param array $files
51
     *
52
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\ApiException
53
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\InvalidArgumentException
54
     * @throws \GuzzleHttp\Exception\GuzzleException
55
     *
56
     * @return array|\Doctrine\Common\Collections\ArrayCollection|object|\Psr\Http\Message\ResponseInterface|string
57
     */
58
    public function uploadVideos(array $files)
59
    {
60
        return $this->httpPostFile('material/uploadVideo', $files);
61
    }
62
63
    /**
64
     * 获取审核通过的视频.
65
     *
66
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\ApiException
67
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\InvalidArgumentException
68
     * @throws \GuzzleHttp\Exception\GuzzleException
69
     *
70
     * @return array|\Doctrine\Common\Collections\ArrayCollection|object|\Psr\Http\Message\ResponseInterface|string
71
     */
72
    public function getVideos()
73
    {
74
        return $this->httpPostJson('material/getVideo');
75
    }
76
77
    /**
78
     * 获取省市列表.
79
     *
80
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\ApiException
81
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\InvalidArgumentException
82
     * @throws \GuzzleHttp\Exception\GuzzleException
83
     *
84
     * @return array|\Doctrine\Common\Collections\ArrayCollection|object|\Psr\Http\Message\ResponseInterface|string
85
     */
86
    public function getProvinces()
87
    {
88
        return $this->httpPostJson('material/getProvince');
89
    }
90
91
    /**
92
     * 获取区县列表.
93
     *
94
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\ApiException
95
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\InvalidArgumentException
96
     * @throws \GuzzleHttp\Exception\GuzzleException
97
     *
98
     * @return array|\Doctrine\Common\Collections\ArrayCollection|object|\Psr\Http\Message\ResponseInterface|string
99
     */
100
    public function getCounties()
101
    {
102
        return $this->httpPostJson('material/getCounty');
103
    }
104
105
    /**
106
     * 获取兴趣列表.
107
     *
108
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\ApiException
109
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\InvalidArgumentException
110
     * @throws \GuzzleHttp\Exception\GuzzleException
111
     *
112
     * @return array|\Doctrine\Common\Collections\ArrayCollection|object|\Psr\Http\Message\ResponseInterface|string
113
     */
114
    public function getInterests()
115
    {
116
        return $this->httpPostJson('material/getInterest');
117
    }
118
119
    /**
120
     * 获取关键词推荐、站点推荐、 APP推荐结果.
121
     *
122
     * @param array $params
123
     *
124
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\ApiException
125
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\InvalidArgumentException
126
     * @throws \GuzzleHttp\Exception\GuzzleException
127
     *
128
     * @return array|\Doctrine\Common\Collections\ArrayCollection|object|\Psr\Http\Message\ResponseInterface|string
129
     */
130
    public function getRecommend(array $params)
131
    {
132
        return $this->httpPostJson('material/getRecommend', $params);
133
    }
134
135
    /**
136
     * 获取应用分类列表.
137
     *
138
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\ApiException
139
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\InvalidArgumentException
140
     * @throws \GuzzleHttp\Exception\GuzzleException
141
     *
142
     * @return array|\Doctrine\Common\Collections\ArrayCollection|object|\Psr\Http\Message\ResponseInterface|string
143
     */
144
    public function getAppCategories()
145
    {
146
        return $this->httpPostJson('material/getAppCategory');
147
    }
148
149
    /**
150
     * 获取转化类型列表.
151
     *
152
     * @param $objectiveType
153
     *
154
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\ApiException
155
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\InvalidArgumentException
156
     * @throws \GuzzleHttp\Exception\GuzzleException
157
     *
158
     * @return array|\Doctrine\Common\Collections\ArrayCollection|object|\Psr\Http\Message\ResponseInterface|string
159
     */
160
    public function getConvertTypes($objectiveType)
161
    {
162
        $params = [
163
            'objectiveType' => $objectiveType,
164
        ];
165
166
        return $this->httpPostJson('material/getConvertTypes', $params);
167
    }
168
169
    /**
170
     * 根据转化类型获取联调通过的转化列表.
171
     *
172
     * @param $convertMonitorType
173
     *
174
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\ApiException
175
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\InvalidArgumentException
176
     * @throws \GuzzleHttp\Exception\GuzzleException
177
     *
178
     * @return array|\Doctrine\Common\Collections\ArrayCollection|object|\Psr\Http\Message\ResponseInterface|string
179
     */
180
    public function getAdConvert($convertMonitorType)
181
    {
182
        $params = [
183
            'convertMonitorType' => $convertMonitorType,
184
        ];
185
186
        return $this->httpPostJson('material/getAdConvert', $params);
187
    }
188
189
    /**
190
     * 获取词包列表.
191
     *
192
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\ApiException
193
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\InvalidArgumentException
194
     * @throws \GuzzleHttp\Exception\GuzzleException
195
     *
196
     * @return array|\Doctrine\Common\Collections\ArrayCollection|object|\Psr\Http\Message\ResponseInterface|string
197
     */
198
    public function getWordPackages()
199
    {
200
        return $this->httpPostJson('material/getWordPackage');
201
    }
202
203
    /**
204
     * 获取android-app列表.
205
     *
206
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\ApiException
207
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\InvalidArgumentException
208
     * @throws \GuzzleHttp\Exception\GuzzleException
209
     *
210
     * @return array|\Doctrine\Common\Collections\ArrayCollection|object|\Psr\Http\Message\ResponseInterface|string
211
     */
212
    public function getAndroidApps()
213
    {
214
        return $this->httpPostJson('material/getAndroidApp');
215
    }
216
217
    /**
218
     * 获取ios app.
219
     *
220
     * @param string $appId
221
     *
222
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\ApiException
223
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\InvalidArgumentException
224
     * @throws \GuzzleHttp\Exception\GuzzleException
225
     *
226
     * @return array|\Doctrine\Common\Collections\ArrayCollection|object|\Psr\Http\Message\ResponseInterface|string
227
     */
228
    public function getIosAppByAppId($appId)
229
    {
230
        $params = [
231
            'appId' => $appId,
232
        ];
233
234
        return $this->httpPostJson('material/getIosAppByAppId', $params);
235
    }
236
237
    /**
238
     * 获取行业列表.
239
     *
240
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\ApiException
241
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\InvalidArgumentException
242
     * @throws \GuzzleHttp\Exception\GuzzleException
243
     *
244
     * @return array|\Doctrine\Common\Collections\ArrayCollection|object|\Psr\Http\Message\ResponseInterface|string
245
     */
246
    public function getIndustries()
247
    {
248
        return $this->httpPostJson('material/getIndustry');
249
    }
250
251
    /**
252
     * 获取定向包列表.
253
     *
254
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\ApiException
255
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\InvalidArgumentException
256
     * @throws \GuzzleHttp\Exception\GuzzleException
257
     *
258
     * @return array|\Doctrine\Common\Collections\ArrayCollection|object|\Psr\Http\Message\ResponseInterface|string
259
     */
260
    public function getTargetingPackages()
261
    {
262
        return $this->httpPostJson('material/getAllTargetingPackage');
263
    }
264
265
    /**
266
     * 获取创意分类列表.
267
     *
268
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\ApiException
269
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\InvalidArgumentException
270
     * @throws \GuzzleHttp\Exception\GuzzleException
271
     *
272
     * @return array|\Doctrine\Common\Collections\ArrayCollection|object|\Psr\Http\Message\ResponseInterface|string
273
     */
274
    public function getCreativeIndustries()
275
    {
276
        return $this->httpPostJson('material/getCreativeIndustry');
277
    }
278
}
279