Completed
Push — master ( 6ad9e3...7a68b3 )
by Dmitry
01:36
created

AdGroup   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 9
c 1
b 0
f 0
dl 0
loc 30
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A get() 0 16 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Promopult\TikTokMarketingApi\Service;
6
7
final class AdGroup extends \Promopult\TikTokMarketingApi\AbstractService
8
{
9
    /**
10
     * @param int $advertiserId         Advertiser ID
11
     * @param array|null $fields        Fields to be returned. When not specified, all fields are returned by default.
12
     * @param array|null $filtering     Filter conditions. Set these conditions according to your requirements.
13
     *                                  If not set, all ad groups under the advertiser will be returned.
14
     * @param int|null $page            Current page number. Default value is 1. Range of values: ≥ 1
15
     * @param int|null $pageSize        Page size.Default value is: 10. Range of values: 1-1000
16
     * @return array
17
     * @throws \Throwable
18
     *
19
     * @see https://ads.tiktok.com/marketing_api/docs?id=100529
20
     */
21
    public function get(
22
        int $advertiserId,
23
        ?array $fields = null,
24
        ?array $filtering = null,
25
        ?int $page = null,
26
        ?int $pageSize = null
27
    ): array {
28
        return $this->requestApi(
29
            'GET',
30
            '/open_api/v1.2/adgroup/get/',
31
            [
32
                'advertiser_id' => $advertiserId,
33
                'fields' => $fields,
34
                'filtering' => $filtering,
35
                'page' => $page,
36
                'page_size' => $pageSize
37
            ]
38
        );
39
    }
40
}
41