Client::getVideos()   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 1
1
<?php
2
3
namespace CloudyCity\KuaishouMarketingSDK\Tool\File;
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 uploadVideo(array $params)
23
    {
24
        return $this->httpPost('v2/file/ad/video/upload', $params);
25
    }
26
27
    /**
28
     * 获取视频列表.
29
     *
30
     * @link https://yiqixie.com/d/home/fcACuwYpSB3pFCkgbykniO7_h#
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 getVideos(array $params)
41
    {
42
        return $this->httpPostJson('v1/file/ad/video/list', $params);
43
    }
44
45
    /**
46
     * 上传图片.
47
     *
48
     * @link https://yiqixie.com/d/home/fcACuwYpSB3pFCkgbykniO7_h#
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 uploadImage(array $params)
59
    {
60
        return $this->httpPost('v2/file/ad/image/upload', $params);
61
    }
62
63
    /**
64
     * 获取图片信息.
65
     *
66
     * @link https://yiqixie.com/d/home/fcACuwYpSB3pFCkgbykniO7_h#
67
     *
68
     * @param array $params
69
     *
70
     * @throws \CloudyCity\KuaishouMarketingSDK\Kernel\Exceptions\ApiException
71
     * @throws \CloudyCity\KuaishouMarketingSDK\Kernel\Exceptions\InvalidArgumentException
72
     * @throws \GuzzleHttp\Exception\GuzzleException
73
     *
74
     * @return array|\CloudyCity\KuaishouMarketingSDK\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string
75
     */
76
    public function getImage(array $params)
77
    {
78
        return $this->httpGetJson('v1/file/ad/image/get', $params);
79
    }
80
81
    /**
82
     * 获取图片列表.
83
     *
84
     * @link https://yiqixie.com/d/home/fcACuwYpSB3pFCkgbykniO7_h#
85
     *
86
     * @param array $params
87
     *
88
     * @throws \CloudyCity\KuaishouMarketingSDK\Kernel\Exceptions\ApiException
89
     * @throws \CloudyCity\KuaishouMarketingSDK\Kernel\Exceptions\InvalidArgumentException
90
     * @throws \GuzzleHttp\Exception\GuzzleException
91
     *
92
     * @return array|\CloudyCity\KuaishouMarketingSDK\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string
93
     */
94
    public function getImages(array $params)
95
    {
96
        return $this->httpGetJson('v1/file/ad/image/list', $params);
97
    }
98
}
99