Completed
Pull Request — master (#32)
by Sergey
02:26
created

Negotiations::messages()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace seregazhuk\HeadHunterApi\EndPoints;
4
5
use seregazhuk\HeadHunterApi\Traits\HasAll;
6
use seregazhuk\HeadHunterApi\Traits\HasView;
7
use seregazhuk\HeadHunterApi\Traits\InvitedNegotiations;
8
9
class Negotiations extends Endpoint
10
{
11
    const RESOURCE = 'negotiations';
12
13
    use HasView, HasAll, InvitedNegotiations;
14
15
    public function active()
16
    {
17
        return $this->getResource('active');
18
    }
19
20
    /**
21
     * @param string $id
22
     * @return array
23
     */
24
    public function messages($id)
25
    {
26
        return $this->getResource($id . '/messages');
27
    }
28
29
30
    public function view($negotiationId)
31
    {
32
        return $this->getResource($negotiationId);
33
    }
34
35
    /**
36
     * @param int $id
37
     * @param string $message
38
     * @return mixed
39
     */
40
    public function message($id, $message)
41
    {
42
        return $this->postResource($id, ['message' => $message]);
43
    }
44
}