@@ 7-52 (lines=46) @@ | ||
4 | ||
5 | use PeeHaa\AsyncTwitter\Api\Request\BaseRequest; |
|
6 | ||
7 | class DirectMessages extends BaseRequest |
|
8 | { |
|
9 | const METHOD = 'GET'; |
|
10 | ||
11 | const ENDPOINT = '/direct_messages.json'; |
|
12 | ||
13 | public function __construct() |
|
14 | { |
|
15 | parent::__construct(self::METHOD, self::ENDPOINT); |
|
16 | } |
|
17 | ||
18 | public function minimumId(int $id): DirectMessages |
|
19 | { |
|
20 | $this->parameters['since_id'] = (string) $id; |
|
21 | ||
22 | return $this; |
|
23 | } |
|
24 | ||
25 | public function maximumId(int $id): DirectMessages |
|
26 | { |
|
27 | $this->parameters['max_id'] = (string) $id; |
|
28 | ||
29 | return $this; |
|
30 | } |
|
31 | ||
32 | public function amount(int $amount): DirectMessages |
|
33 | { |
|
34 | $this->parameters['count'] = (string) $amount; |
|
35 | ||
36 | return $this; |
|
37 | } |
|
38 | ||
39 | public function excludeEntities(): DirectMessages |
|
40 | { |
|
41 | $this->parameters['include_entities'] = 'false'; |
|
42 | ||
43 | return $this; |
|
44 | } |
|
45 | ||
46 | public function skipStatus(): DirectMessages |
|
47 | { |
|
48 | $this->parameters['skip_status'] = 'true'; |
|
49 | ||
50 | return $this; |
|
51 | } |
|
52 | } |
|
53 |
@@ 7-52 (lines=46) @@ | ||
4 | ||
5 | use PeeHaa\AsyncTwitter\Api\Request\BaseRequest; |
|
6 | ||
7 | class Sent extends BaseRequest |
|
8 | { |
|
9 | const METHOD = 'GET'; |
|
10 | ||
11 | const ENDPOINT = '/direct_messages/sent.json'; |
|
12 | ||
13 | public function __construct() |
|
14 | { |
|
15 | parent::__construct(self::METHOD, self::ENDPOINT); |
|
16 | } |
|
17 | ||
18 | public function minimumId(int $id): Sent |
|
19 | { |
|
20 | $this->parameters['since_id'] = (string) $id; |
|
21 | ||
22 | return $this; |
|
23 | } |
|
24 | ||
25 | public function maximumId(int $id): Sent |
|
26 | { |
|
27 | $this->parameters['max_id'] = (string) $id; |
|
28 | ||
29 | return $this; |
|
30 | } |
|
31 | ||
32 | public function amount(int $amount): Sent |
|
33 | { |
|
34 | $this->parameters['count'] = (string) $amount; |
|
35 | ||
36 | return $this; |
|
37 | } |
|
38 | ||
39 | public function page(int $page): Sent |
|
40 | { |
|
41 | $this->parameters['page'] = (string) $page; |
|
42 | ||
43 | return $this; |
|
44 | } |
|
45 | ||
46 | public function excludeEntities(): Sent |
|
47 | { |
|
48 | $this->parameters['include_entities'] = 'false'; |
|
49 | ||
50 | return $this; |
|
51 | } |
|
52 | } |
|
53 |