|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/** |
|
4
|
|
|
* This phpFile is auto-generated. |
|
5
|
|
|
*/ |
|
6
|
|
|
|
|
7
|
|
|
declare(strict_types=1); |
|
8
|
|
|
|
|
9
|
|
|
namespace AurimasNiekis\TdLibSchema; |
|
10
|
|
|
|
|
11
|
|
|
/** |
|
12
|
|
|
* Telegram Passport data has been received; for bots only. |
|
13
|
|
|
*/ |
|
14
|
|
|
class MessagePassportDataReceived extends MessageContent |
|
15
|
|
|
{ |
|
16
|
|
|
public const TYPE_NAME = 'messagePassportDataReceived'; |
|
17
|
|
|
|
|
18
|
|
|
/** |
|
19
|
|
|
* List of received Telegram Passport elements. |
|
20
|
|
|
* |
|
21
|
|
|
* @var EncryptedPassportElement[] |
|
22
|
|
|
*/ |
|
23
|
|
|
protected array $elements; |
|
24
|
|
|
|
|
25
|
|
|
/** |
|
26
|
|
|
* Encrypted data credentials. |
|
27
|
|
|
* |
|
28
|
|
|
* @var EncryptedCredentials |
|
29
|
|
|
*/ |
|
30
|
|
|
protected EncryptedCredentials $credentials; |
|
31
|
|
|
|
|
32
|
|
|
public function __construct(array $elements, EncryptedCredentials $credentials) |
|
33
|
|
|
{ |
|
34
|
|
|
parent::__construct(); |
|
35
|
|
|
|
|
36
|
|
|
$this->elements = $elements; |
|
37
|
|
|
$this->credentials = $credentials; |
|
38
|
|
|
} |
|
39
|
|
|
|
|
40
|
|
|
public static function fromArray(array $array): MessagePassportDataReceived |
|
41
|
|
|
{ |
|
42
|
|
|
return new static( |
|
43
|
|
|
array_map(fn ($x) => TdSchemaRegistry::fromArray($x), $array['elements']), |
|
44
|
|
|
TdSchemaRegistry::fromArray($array['credentials']), |
|
45
|
|
|
); |
|
46
|
|
|
} |
|
47
|
|
|
|
|
48
|
|
|
public function typeSerialize(): array |
|
49
|
|
|
{ |
|
50
|
|
|
return [ |
|
51
|
|
|
'@type' => static::TYPE_NAME, |
|
52
|
|
|
array_map(fn ($x) => $x->typeSerialize(), $this->elements), |
|
53
|
|
|
'credentials' => $this->credentials->typeSerialize(), |
|
54
|
|
|
]; |
|
55
|
|
|
} |
|
56
|
|
|
|
|
57
|
|
|
public function getElements(): array |
|
58
|
|
|
{ |
|
59
|
|
|
return $this->elements; |
|
60
|
|
|
} |
|
61
|
|
|
|
|
62
|
|
|
public function getCredentials(): EncryptedCredentials |
|
63
|
|
|
{ |
|
64
|
|
|
return $this->credentials; |
|
65
|
|
|
} |
|
66
|
|
|
} |
|
67
|
|
|
|