1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
* This file is part of the Slack API library. |
5
|
|
|
* |
6
|
|
|
* (c) Cas Leentfaar <[email protected]> |
7
|
|
|
* |
8
|
|
|
* For the full copyright and license information, please view the LICENSE |
9
|
|
|
* file that was distributed with this source code. |
10
|
|
|
*/ |
11
|
|
|
|
12
|
|
|
namespace CL\Slack\Payload; |
13
|
|
|
|
14
|
|
|
/** |
15
|
|
|
* @author Cas Leentfaar <[email protected]> |
16
|
|
|
* |
17
|
|
|
* @link Official documentation at https://api.slack.com/methods/groups.history |
18
|
|
|
*/ |
19
|
|
|
class GroupsHistoryPayload extends AbstractPayload |
20
|
|
|
{ |
21
|
|
|
/** |
22
|
|
|
* Slack seems to want to call this option "channel", but I can't agree with that (the format of the value is different), |
23
|
|
|
* and will just pretend to my users it's a "group" (ID). |
24
|
|
|
* |
25
|
|
|
* @var string |
26
|
|
|
*/ |
27
|
|
|
private $channel; |
28
|
|
|
|
29
|
|
|
/** |
30
|
|
|
* @var string |
31
|
|
|
*/ |
32
|
|
|
private $oldest; |
33
|
|
|
|
34
|
|
|
/** |
35
|
|
|
* @var string |
36
|
|
|
*/ |
37
|
|
|
private $latest; |
38
|
|
|
|
39
|
|
|
/** |
40
|
|
|
* @var int |
41
|
|
|
*/ |
42
|
|
|
private $count; |
43
|
|
|
|
44
|
|
|
/** |
45
|
|
|
* @var bool |
46
|
|
|
*/ |
47
|
|
|
private $inclusive; |
48
|
|
|
|
49
|
|
|
/** |
50
|
|
|
* @param string $groupId ID of the group to clone and archive. |
51
|
|
|
*/ |
52
|
1 |
|
public function setGroupId($groupId) |
53
|
|
|
{ |
54
|
1 |
|
$this->channel = $groupId; |
55
|
1 |
|
} |
56
|
|
|
|
57
|
|
|
/** |
58
|
|
|
* @return string ID of the group to clone and archive. |
59
|
|
|
*/ |
60
|
1 |
|
public function getGroupId() |
61
|
|
|
{ |
62
|
1 |
|
return $this->channel; |
63
|
|
|
} |
64
|
|
|
|
65
|
|
|
/** |
66
|
|
|
* @param string|string|null $latest |
67
|
|
|
*/ |
68
|
1 |
|
public function setLatest($latest = null) |
69
|
|
|
{ |
70
|
1 |
|
$this->latest = $latest; |
71
|
1 |
|
} |
72
|
|
|
|
73
|
|
|
/** |
74
|
|
|
* @return string|string|null |
75
|
|
|
*/ |
76
|
1 |
|
public function getLatest() |
77
|
|
|
{ |
78
|
1 |
|
return $this->latest; |
79
|
|
|
} |
80
|
|
|
|
81
|
|
|
/** |
82
|
|
|
* @param string|null $oldest |
83
|
|
|
*/ |
84
|
1 |
|
public function setOldest($oldest = null) |
85
|
|
|
{ |
86
|
1 |
|
$this->oldest = $oldest; |
87
|
1 |
|
} |
88
|
|
|
|
89
|
|
|
/** |
90
|
|
|
* @return string|null |
91
|
|
|
*/ |
92
|
1 |
|
public function getOldest() |
93
|
|
|
{ |
94
|
1 |
|
return $this->oldest; |
95
|
|
|
} |
96
|
|
|
|
97
|
|
|
/** |
98
|
|
|
* @param int|null $count |
99
|
|
|
*/ |
100
|
1 |
|
public function setCount($count = null) |
101
|
|
|
{ |
102
|
1 |
|
$this->count = $count; |
103
|
1 |
|
} |
104
|
|
|
|
105
|
|
|
/** |
106
|
|
|
* @return int|null |
107
|
|
|
*/ |
108
|
1 |
|
public function getCount() |
109
|
|
|
{ |
110
|
1 |
|
return $this->count; |
111
|
|
|
} |
112
|
|
|
|
113
|
|
|
/** |
114
|
|
|
* @param bool $inclusive |
115
|
|
|
*/ |
116
|
|
|
public function setInclusive($inclusive) |
117
|
|
|
{ |
118
|
|
|
$this->inclusive = $inclusive; |
119
|
|
|
} |
120
|
|
|
|
121
|
|
|
/** |
122
|
|
|
* @return bool |
123
|
|
|
*/ |
124
|
|
|
public function getInclusive() |
125
|
|
|
{ |
126
|
|
|
return $this->inclusive; |
127
|
|
|
} |
128
|
|
|
|
129
|
|
|
/** |
130
|
|
|
* @inheritdoc |
131
|
|
|
*/ |
132
|
1 |
|
public function getMethod() |
133
|
|
|
{ |
134
|
1 |
|
return 'groups.history'; |
135
|
|
|
} |
136
|
|
|
} |
137
|
|
|
|