|
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
|
|
|
* Represents a user contact. |
|
13
|
|
|
*/ |
|
14
|
|
|
class InputInlineQueryResultContact extends InputInlineQueryResult |
|
15
|
|
|
{ |
|
16
|
|
|
public const TYPE_NAME = 'inputInlineQueryResultContact'; |
|
17
|
|
|
|
|
18
|
|
|
/** |
|
19
|
|
|
* Unique identifier of the query result. |
|
20
|
|
|
*/ |
|
21
|
|
|
protected string $id; |
|
22
|
|
|
|
|
23
|
|
|
/** |
|
24
|
|
|
* User contact. |
|
25
|
|
|
*/ |
|
26
|
|
|
protected Contact $contact; |
|
27
|
|
|
|
|
28
|
|
|
/** |
|
29
|
|
|
* URL of the result thumbnail, if it exists. |
|
30
|
|
|
*/ |
|
31
|
|
|
protected string $thumbnailUrl; |
|
32
|
|
|
|
|
33
|
|
|
/** |
|
34
|
|
|
* Thumbnail width, if known. |
|
35
|
|
|
*/ |
|
36
|
|
|
protected int $thumbnailWidth; |
|
37
|
|
|
|
|
38
|
|
|
/** |
|
39
|
|
|
* Thumbnail height, if known. |
|
40
|
|
|
*/ |
|
41
|
|
|
protected int $thumbnailHeight; |
|
42
|
|
|
|
|
43
|
|
|
/** |
|
44
|
|
|
* The message reply markup. Must be of type replyMarkupInlineKeyboard or null. |
|
45
|
|
|
*/ |
|
46
|
|
|
protected ReplyMarkup $replyMarkup; |
|
47
|
|
|
|
|
48
|
|
|
/** |
|
49
|
|
|
* The content of the message to be sent. Must be one of the following types: InputMessageText, InputMessageLocation, InputMessageVenue or InputMessageContact. |
|
50
|
|
|
*/ |
|
51
|
|
|
protected InputMessageContent $inputMessageContent; |
|
52
|
|
|
|
|
53
|
|
|
public function __construct( |
|
54
|
|
|
string $id, |
|
55
|
|
|
Contact $contact, |
|
56
|
|
|
string $thumbnailUrl, |
|
57
|
|
|
int $thumbnailWidth, |
|
58
|
|
|
int $thumbnailHeight, |
|
59
|
|
|
ReplyMarkup $replyMarkup, |
|
60
|
|
|
InputMessageContent $inputMessageContent |
|
61
|
|
|
) { |
|
62
|
|
|
parent::__construct(); |
|
63
|
|
|
|
|
64
|
|
|
$this->id = $id; |
|
65
|
|
|
$this->contact = $contact; |
|
66
|
|
|
$this->thumbnailUrl = $thumbnailUrl; |
|
67
|
|
|
$this->thumbnailWidth = $thumbnailWidth; |
|
68
|
|
|
$this->thumbnailHeight = $thumbnailHeight; |
|
69
|
|
|
$this->replyMarkup = $replyMarkup; |
|
70
|
|
|
$this->inputMessageContent = $inputMessageContent; |
|
71
|
|
|
} |
|
72
|
|
|
|
|
73
|
|
|
public static function fromArray(array $array): InputInlineQueryResultContact |
|
74
|
|
|
{ |
|
75
|
|
|
return new static( |
|
76
|
|
|
$array['id'], |
|
77
|
|
|
TdSchemaRegistry::fromArray($array['contact']), |
|
78
|
|
|
$array['thumbnail_url'], |
|
79
|
|
|
$array['thumbnail_width'], |
|
80
|
|
|
$array['thumbnail_height'], |
|
81
|
|
|
TdSchemaRegistry::fromArray($array['reply_markup']), |
|
82
|
|
|
TdSchemaRegistry::fromArray($array['input_message_content']), |
|
83
|
|
|
); |
|
84
|
|
|
} |
|
85
|
|
|
|
|
86
|
|
|
public function typeSerialize(): array |
|
87
|
|
|
{ |
|
88
|
|
|
return [ |
|
89
|
|
|
'@type' => static::TYPE_NAME, |
|
90
|
|
|
'id' => $this->id, |
|
91
|
|
|
'contact' => $this->contact->typeSerialize(), |
|
92
|
|
|
'thumbnail_url' => $this->thumbnailUrl, |
|
93
|
|
|
'thumbnail_width' => $this->thumbnailWidth, |
|
94
|
|
|
'thumbnail_height' => $this->thumbnailHeight, |
|
95
|
|
|
'reply_markup' => $this->replyMarkup->typeSerialize(), |
|
96
|
|
|
'input_message_content' => $this->inputMessageContent->typeSerialize(), |
|
97
|
|
|
]; |
|
98
|
|
|
} |
|
99
|
|
|
|
|
100
|
|
|
public function getId(): string |
|
101
|
|
|
{ |
|
102
|
|
|
return $this->id; |
|
103
|
|
|
} |
|
104
|
|
|
|
|
105
|
|
|
public function getContact(): Contact |
|
106
|
|
|
{ |
|
107
|
|
|
return $this->contact; |
|
108
|
|
|
} |
|
109
|
|
|
|
|
110
|
|
|
public function getThumbnailUrl(): string |
|
111
|
|
|
{ |
|
112
|
|
|
return $this->thumbnailUrl; |
|
113
|
|
|
} |
|
114
|
|
|
|
|
115
|
|
|
public function getThumbnailWidth(): int |
|
116
|
|
|
{ |
|
117
|
|
|
return $this->thumbnailWidth; |
|
118
|
|
|
} |
|
119
|
|
|
|
|
120
|
|
|
public function getThumbnailHeight(): int |
|
121
|
|
|
{ |
|
122
|
|
|
return $this->thumbnailHeight; |
|
123
|
|
|
} |
|
124
|
|
|
|
|
125
|
|
|
public function getReplyMarkup(): ReplyMarkup |
|
126
|
|
|
{ |
|
127
|
|
|
return $this->replyMarkup; |
|
128
|
|
|
} |
|
129
|
|
|
|
|
130
|
|
|
public function getInputMessageContent(): InputMessageContent |
|
131
|
|
|
{ |
|
132
|
|
|
return $this->inputMessageContent; |
|
133
|
|
|
} |
|
134
|
|
|
} |
|
135
|
|
|
|