1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace TelegramBot\Api\Types; |
4
|
|
|
|
5
|
|
|
use TelegramBot\Api\BaseType; |
6
|
|
|
use TelegramBot\Api\TypeInterface; |
7
|
|
|
|
8
|
|
|
class ChatInviteLink extends BaseType implements TypeInterface |
9
|
|
|
{ |
10
|
|
|
/** |
11
|
|
|
* {@inheritdoc} |
12
|
|
|
* |
13
|
|
|
* @var array |
14
|
|
|
*/ |
15
|
|
|
protected static $requiredParams = ['invite_link', 'creator', 'creates_join_request', 'is_primary', 'is_revoked']; |
16
|
|
|
|
17
|
|
|
/** |
18
|
|
|
* {@inheritdoc} |
19
|
|
|
* |
20
|
|
|
* @var array |
21
|
|
|
*/ |
22
|
|
|
protected static $map = [ |
23
|
|
|
'invite_link' => true, |
24
|
|
|
'creator' => User::class, |
25
|
|
|
'creates_join_request' => true, |
26
|
|
|
'is_primary' => true, |
27
|
|
|
'is_revoked' => true, |
28
|
|
|
'name' => true, |
29
|
|
|
'expire_date' => true, |
30
|
|
|
'member_limit' => true, |
31
|
|
|
'pending_join_request_count' => true, |
32
|
|
|
]; |
33
|
|
|
|
34
|
|
|
/** |
35
|
|
|
* The invite link. If the link was created by another chat administrator, then the second part of the link will be replaced with “…”. |
36
|
|
|
* |
37
|
|
|
* @var string |
38
|
|
|
*/ |
39
|
|
|
protected $inviteLink; |
40
|
|
|
|
41
|
|
|
/** |
42
|
|
|
* Creator of the link |
43
|
|
|
* |
44
|
|
|
* @var User |
45
|
|
|
*/ |
46
|
|
|
protected $creator; |
47
|
|
|
|
48
|
|
|
/** |
49
|
|
|
* True, if users joining the chat via the link need to be approved by chat administrators |
50
|
|
|
* |
51
|
|
|
* @var bool |
52
|
|
|
*/ |
53
|
|
|
protected $createsJoinRequest; |
54
|
|
|
|
55
|
|
|
/** |
56
|
|
|
* True, if the link is primary |
57
|
|
|
* |
58
|
|
|
* @var bool |
59
|
|
|
*/ |
60
|
|
|
protected $isPrimary; |
61
|
|
|
|
62
|
|
|
/** |
63
|
|
|
* True, if the link is revoked |
64
|
|
|
* |
65
|
|
|
* @var bool |
66
|
|
|
*/ |
67
|
|
|
protected $isRevoked; |
68
|
|
|
|
69
|
|
|
/** |
70
|
|
|
* Optional. Invite link name |
71
|
|
|
* |
72
|
|
|
* @var string|null |
73
|
|
|
*/ |
74
|
|
|
protected $name; |
75
|
|
|
|
76
|
|
|
/** |
77
|
|
|
* Optional. Point in time (Unix timestamp) when the link will expire or has been expired |
78
|
|
|
* |
79
|
|
|
* @var int|null |
80
|
|
|
*/ |
81
|
|
|
protected $expireDate; |
82
|
|
|
|
83
|
|
|
/** |
84
|
|
|
* Optional. The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999 |
85
|
|
|
* |
86
|
|
|
* @var int|null |
87
|
|
|
*/ |
88
|
|
|
protected $memberLimit; |
89
|
|
|
|
90
|
|
|
/** |
91
|
|
|
* Optional. Number of pending join requests created using this link |
92
|
|
|
* |
93
|
|
|
* @var int|null |
94
|
|
|
*/ |
95
|
|
|
protected $pendingJoinRequestCount; |
96
|
|
|
|
97
|
|
|
/** |
98
|
|
|
* @return string |
99
|
|
|
*/ |
100
|
|
|
public function getInviteLink() |
101
|
|
|
{ |
102
|
|
|
return $this->inviteLink; |
103
|
|
|
} |
104
|
|
|
|
105
|
|
|
/** |
106
|
|
|
* @param string $inviteLink |
107
|
|
|
* @return void |
108
|
|
|
*/ |
109
|
|
|
public function setInviteLink($inviteLink) |
110
|
|
|
{ |
111
|
|
|
$this->inviteLink = $inviteLink; |
112
|
|
|
} |
113
|
|
|
|
114
|
|
|
/** |
115
|
|
|
* @return User |
116
|
|
|
*/ |
117
|
|
|
public function getCreator() |
118
|
|
|
{ |
119
|
|
|
return $this->creator; |
120
|
|
|
} |
121
|
|
|
|
122
|
|
|
/** |
123
|
|
|
* @param User $creator |
124
|
|
|
* @return void |
125
|
|
|
*/ |
126
|
|
|
public function setCreator($creator) |
127
|
|
|
{ |
128
|
|
|
$this->creator = $creator; |
129
|
|
|
} |
130
|
|
|
|
131
|
|
|
/** |
132
|
|
|
* @return bool |
133
|
|
|
*/ |
134
|
|
|
public function getCreatesJoinRequest() |
135
|
|
|
{ |
136
|
|
|
return $this->createsJoinRequest; |
137
|
|
|
} |
138
|
|
|
|
139
|
|
|
/** |
140
|
|
|
* @param bool $createsJoinRequest |
141
|
|
|
* @return void |
142
|
|
|
*/ |
143
|
|
|
public function setCreatesJoinRequest($createsJoinRequest) |
144
|
|
|
{ |
145
|
|
|
$this->createsJoinRequest = $createsJoinRequest; |
146
|
|
|
} |
147
|
|
|
|
148
|
|
|
/** |
149
|
|
|
* @return bool |
150
|
|
|
*/ |
151
|
|
|
public function isPrimary() |
152
|
|
|
{ |
153
|
|
|
return $this->isPrimary; |
154
|
|
|
} |
155
|
|
|
|
156
|
|
|
/** |
157
|
|
|
* @param bool $isPrimary |
158
|
|
|
* @return void |
159
|
|
|
*/ |
160
|
|
|
public function setIsPrimary($isPrimary) |
161
|
|
|
{ |
162
|
|
|
$this->isPrimary = $isPrimary; |
163
|
|
|
} |
164
|
|
|
|
165
|
|
|
/** |
166
|
|
|
* @return bool |
167
|
|
|
*/ |
168
|
|
|
public function isRevoked() |
169
|
|
|
{ |
170
|
|
|
return $this->isRevoked; |
171
|
|
|
} |
172
|
|
|
|
173
|
|
|
/** |
174
|
|
|
* @param bool $isRevoked |
175
|
|
|
* @return void |
176
|
|
|
*/ |
177
|
|
|
public function setIsRevoked($isRevoked) |
178
|
|
|
{ |
179
|
|
|
$this->isRevoked = $isRevoked; |
180
|
|
|
} |
181
|
|
|
|
182
|
|
|
/** |
183
|
|
|
* @return string|null |
184
|
|
|
*/ |
185
|
|
|
public function getName() |
186
|
|
|
{ |
187
|
|
|
return $this->name; |
188
|
|
|
} |
189
|
|
|
|
190
|
|
|
/** |
191
|
|
|
* @param string|null $name |
192
|
|
|
* @return void |
193
|
|
|
*/ |
194
|
|
|
public function setName($name) |
195
|
|
|
{ |
196
|
|
|
$this->name = $name; |
197
|
|
|
} |
198
|
|
|
|
199
|
|
|
/** |
200
|
|
|
* @return int|null |
201
|
|
|
*/ |
202
|
|
|
public function getExpireDate() |
203
|
|
|
{ |
204
|
|
|
return $this->expireDate; |
205
|
|
|
} |
206
|
|
|
|
207
|
|
|
/** |
208
|
|
|
* @param int|null $expireDate |
209
|
|
|
* @return void |
210
|
|
|
*/ |
211
|
|
|
public function setExpireDate($expireDate) |
212
|
|
|
{ |
213
|
|
|
$this->expireDate = $expireDate; |
214
|
|
|
} |
215
|
|
|
|
216
|
|
|
/** |
217
|
|
|
* @return int|null |
218
|
|
|
*/ |
219
|
|
|
public function getMemberLimit() |
220
|
|
|
{ |
221
|
|
|
return $this->memberLimit; |
222
|
|
|
} |
223
|
|
|
|
224
|
|
|
/** |
225
|
|
|
* @param int|null $memberLimit |
226
|
|
|
* @return void |
227
|
|
|
*/ |
228
|
|
|
public function setMemberLimit($memberLimit) |
229
|
|
|
{ |
230
|
|
|
$this->memberLimit = $memberLimit; |
231
|
|
|
} |
232
|
|
|
|
233
|
|
|
/** |
234
|
|
|
* @return int|null |
235
|
|
|
*/ |
236
|
|
|
public function getPendingJoinRequestCount() |
237
|
|
|
{ |
238
|
|
|
return $this->pendingJoinRequestCount; |
239
|
|
|
} |
240
|
|
|
|
241
|
|
|
/** |
242
|
|
|
* @param int|null $pendingJoinRequestCount |
243
|
|
|
* @return void |
244
|
|
|
*/ |
245
|
|
|
public function setPendingJoinRequestCount($pendingJoinRequestCount) |
246
|
|
|
{ |
247
|
|
|
$this->pendingJoinRequestCount = $pendingJoinRequestCount; |
248
|
|
|
} |
249
|
|
|
} |
250
|
|
|
|