Completed
Push — master ( 34fbaa...0f4aaf )
by Dmitry
01:31
created

AgencyClients   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 49
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 49
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A get() 0 16 2
A add() 0 7 1
1
<?php
2
/**
3
 * @author Dmitry Gladyshev <[email protected]>
4
 * @date 30.03.17 11:39
5
 */
6
7
namespace Yandex\Direct\Service;
8
9
use Yandex\Direct\Exception\Exception;
10
use Yandex\Direct\Service;
11
12
final class AgencyClients extends Service
13
{
14
    /**
15
     * Возвращает список рекламодателей — клиентов агентства,
16
     * их параметры и настройки главных представителей рекламодателя.
17
     *
18
     * @param $SelectionCriteria
19
     * @param $FieldNames
20
     * @param $Page
21
     * @return array
22
     * @throws Exception
23
     *
24
     * @see https://tech.yandex.ru/direct/doc/ref-v5/agencyclients/get-docpage
25
     */
26
    public function get($SelectionCriteria, $FieldNames, $Page = null)
27
    {
28
        $params = [
29
            'SelectionCriteria' => $SelectionCriteria,
30
            'FieldNames' => $FieldNames
31
        ];
32
33
        if ($Page) {
34
            $params['Page'] = $Page;
35
        }
36
37
        return $this->request([
38
            'method' => 'get',
39
            'params' => $params
40
        ]);
41
    }
42
43
    /**
44
     * Регистрирует новых рекламодателей — клиентов агентства,
45
     * а также пользователей — главных представителей рекламодателя.
46
     *
47
     * @param $AgencyClient
48
     * @return array
49
     * @throws Exception
50
     *
51
     * @see https://tech.yandex.ru/direct/doc/ref-v5/agencyclients/add-docpage/
52
     */
53
    public function add($AgencyClient)
54
    {
55
        return $this->request([
56
            'method' => 'add',
57
            'params' => $AgencyClient
58
        ]);
59
    }
60
}
61