|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/** |
|
4
|
|
|
* This phpFile is auto-generated. |
|
5
|
|
|
*/ |
|
6
|
|
|
|
|
7
|
|
|
declare(strict_types=1); |
|
8
|
|
|
|
|
9
|
|
|
namespace PHPTdGram\Schema; |
|
10
|
|
|
|
|
11
|
|
|
/** |
|
12
|
|
|
* Searches for call messages. Returns the results in reverse chronological order (i. e., in order of decreasing message_id). For optimal performance the number of returned messages is chosen by the library. |
|
13
|
|
|
*/ |
|
14
|
|
|
class SearchCallMessages extends TdFunction |
|
15
|
|
|
{ |
|
16
|
|
|
public const TYPE_NAME = 'searchCallMessages'; |
|
17
|
|
|
|
|
18
|
|
|
/** |
|
19
|
|
|
* Identifier of the message from which to search; use 0 to get results from the last message. |
|
20
|
|
|
*/ |
|
21
|
|
|
protected int $fromMessageId; |
|
22
|
|
|
|
|
23
|
|
|
/** |
|
24
|
|
|
* The maximum number of messages to be returned; up to 100. Fewer messages may be returned than specified by the limit, even if the end of the message history has not been reached. |
|
25
|
|
|
*/ |
|
26
|
|
|
protected int $limit; |
|
27
|
|
|
|
|
28
|
|
|
/** |
|
29
|
|
|
* If true, returns only messages with missed calls. |
|
30
|
|
|
*/ |
|
31
|
|
|
protected bool $onlyMissed; |
|
32
|
|
|
|
|
33
|
|
|
public function __construct(int $fromMessageId, int $limit, bool $onlyMissed) |
|
34
|
|
|
{ |
|
35
|
|
|
$this->fromMessageId = $fromMessageId; |
|
36
|
|
|
$this->limit = $limit; |
|
37
|
|
|
$this->onlyMissed = $onlyMissed; |
|
38
|
|
|
} |
|
39
|
|
|
|
|
40
|
|
|
public static function fromArray(array $array): SearchCallMessages |
|
41
|
|
|
{ |
|
42
|
|
|
return new static( |
|
43
|
|
|
$array['from_message_id'], |
|
44
|
|
|
$array['limit'], |
|
45
|
|
|
$array['only_missed'], |
|
46
|
|
|
); |
|
47
|
|
|
} |
|
48
|
|
|
|
|
49
|
|
|
public function typeSerialize(): array |
|
50
|
|
|
{ |
|
51
|
|
|
return [ |
|
52
|
|
|
'@type' => static::TYPE_NAME, |
|
53
|
|
|
'from_message_id' => $this->fromMessageId, |
|
54
|
|
|
'limit' => $this->limit, |
|
55
|
|
|
'only_missed' => $this->onlyMissed, |
|
56
|
|
|
]; |
|
57
|
|
|
} |
|
58
|
|
|
|
|
59
|
|
|
public function getFromMessageId(): int |
|
60
|
|
|
{ |
|
61
|
|
|
return $this->fromMessageId; |
|
62
|
|
|
} |
|
63
|
|
|
|
|
64
|
|
|
public function getLimit(): int |
|
65
|
|
|
{ |
|
66
|
|
|
return $this->limit; |
|
67
|
|
|
} |
|
68
|
|
|
|
|
69
|
|
|
public function getOnlyMissed(): bool |
|
70
|
|
|
{ |
|
71
|
|
|
return $this->onlyMissed; |
|
72
|
|
|
} |
|
73
|
|
|
} |
|
74
|
|
|
|