Resumes::edit()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
1
<?php
2
3
namespace seregazhuk\HeadHunterApi\EndPoints;
4
5
use seregazhuk\HeadHunterApi\Traits\HasView;
6
use seregazhuk\HeadHunterApi\Traits\HasVisibilityList;
7
use seregazhuk\HeadHunterApi\Traits\HasSimilarVacancies;
8
9
class Resumes extends Endpoint
10
{
11
    const RESOURCE = 'resumes';
12
13
    use HasView, HasSimilarVacancies, HasVisibilityList;
14
15
    /**
16
     * @return array
17
     */
18
    public function mine()
19
    {
20
        return $this->getResource('mine');
21
    }
22
23
    /**
24
     * @param string $id
25
     * @param array $pagination
26
     * @return array
27
     */
28
    public function views($id, array $pagination = [])
29
    {
30
        return $this->getResource($id . '/views', $pagination);
31
    }
32
33
    /**
34
     * Updates resume publish date
35
     *
36
     * @param string $id
37
     * @return array
38
     */
39
    public function publish($id)
40
    {
41
        return $this->postResource($id . '/publish');
42
    }
43
44
    /**
45
     * @param string $id
46
     * @return array
47
     */
48
    public function conditions($id)
49
    {
50
        return $this->getResource($id . '/conditions');
51
    }
52
53
    /**
54
     * @param string $id
55
     */
56
    public function delete($id)
57
    {
58
        $this->deleteResource($id);
59
    }
60
61
    /**
62
     * @param string $id
63
     * @param array $attributes
64
     * @return mixed
65
     */
66
    public function edit($id, $attributes)
67
    {
68
        return $this->putResourceJson($id, $attributes);
69
    }
70
71
    /**
72
     * @param array $attributes
73
     * @return mixed
74
     */
75
    public function create($attributes)
76
    {
77
        return $this->postResourceJson('', $attributes);
78
    }
79
80
    /**
81
     * @param string $id
82
     * @return array
83
     */
84
    public function status($id)
85
    {
86
        return $this->getResource($id . '/status');
87
    }
88
89
    /**
90
     * @param string $id
91
     * @param array $pagination
92
     * @return mixed
93
     */
94
    public function jobs($id, array $pagination = [])
95
    {
96
        return $this->getSimilarVacanciesFor($id, $pagination);
97
    }
98
99
    /**
100
     * @param string $id
101
     * @param array $pagination
102
     * @return array
103
     */
104
    public function negotiations($id, array $pagination = [])
105
    {
106
        return $this->getResource($id . '/negotiations_history', $pagination);
107
    }
108
}