Completed
Push — master ( f7db99...180f32 )
by Dmitry
03:22
created

NegativeKeywordSharedSets::add()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 9
rs 9.9666
c 0
b 0
f 0
1
<?php
2
/**
3
 * @project yandex-direct-client
4
 */
5
6
namespace Yandex\Direct\Service;
7
8
use Yandex\Direct\Service;
9
use function Yandex\Direct\get_param_names;
10
11
/**
12
 * Сервис предназначен для выполнения операций с наборами минус-фраз.
13
 *
14
 * @author Dmitry Gladyshev <[email protected]>
15
 */
16
final class NegativeKeywordSharedSets extends Service
17
{
18
    /**
19
     * Создает наборы минус-фраз.
20
     *
21
     * @param $NegativeKeywordSharedSets
22
     * @return array|\DOMDocument
23
     *
24
     * @throws \Yandex\Direct\Exception\ErrorResponseException
25
     * @throws \Yandex\Direct\Exception\Exception
26
     *
27
     * @see https://yandex.ru/dev/direct/doc/ref-v5/negativekeywordsharedsets/add-docpage/
28
     */
29
    public function add($NegativeKeywordSharedSets)
30
    {
31
        return $this->request([
32
            'method' => 'add',
33
            'params' => [
34
                'NegativeKeywordSharedSets' => $NegativeKeywordSharedSets
35
            ]
36
        ]);
37
    }
38
39
    /**
40
     * Изменяет наборы минус-фраз.
41
     *
42
     * @param $NegativeKeywordSharedSets
43
     * @return array|\DOMDocument
44
     *
45
     * @throws \Yandex\Direct\Exception\ErrorResponseException
46
     * @throws \Yandex\Direct\Exception\Exception
47
     *
48
     * @see https://yandex.ru/dev/direct/doc/ref-v5/negativekeywordsharedsets/update-docpage/
49
     */
50
    public function update($NegativeKeywordSharedSets)
51
    {
52
        return $this->request([
53
            'method' => 'update',
54
            'params' => [
55
                'NegativeKeywordSharedSets' => $NegativeKeywordSharedSets
56
            ]
57
        ]);
58
    }
59
60
    /**
61
     * Возвращает наборы минус-фраз.
62
     *
63
     * @param $SelectionCriteria
64
     * @param $FieldNames
65
     * @param $Page
66
     * @return array|\DOMDocument
67
     *
68
     * @throws \ReflectionException
69
     * @throws \Yandex\Direct\Exception\ErrorResponseException
70
     * @throws \Yandex\Direct\Exception\Exception
71
     *
72
     * @see https://yandex.ru/dev/direct/doc/ref-v5/negativekeywordsharedsets/get-docpage/
73
     */
74
    public function get($SelectionCriteria, $FieldNames, $Page = null)
75
    {
76
        $params = compact(get_param_names(__METHOD__));
77
78
        return $this->request([
79
            'method' => 'get',
80
            'params' => $params
81
        ]);
82
    }
83
84
    /**
85
     * Удаляет наборы минус-фраз.
86
     *
87
     * @param $SelectionCriteria
88
     * @return array|\DOMDocument
89
     *
90
     * @throws \Yandex\Direct\Exception\ErrorResponseException
91
     * @throws \Yandex\Direct\Exception\Exception
92
     *
93
     * @see https://yandex.ru/dev/direct/doc/ref-v5/negativekeywordsharedsets/delete-docpage/
94
     */
95
    public function delete($SelectionCriteria)
96
    {
97
        return $this->request([
98
            'method' => 'delete',
99
            'params' => [
100
                'SelectionCriteria' => $SelectionCriteria
101
            ]
102
        ]);
103
    }
104
}
105