1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
namespace Zanzara\Telegram\Type\File; |
6
|
|
|
|
7
|
|
|
/** |
8
|
|
|
* This object represents a video message (available in Telegram apps as of v.4.0). |
9
|
|
|
* |
10
|
|
|
* More on https://core.telegram.org/bots/api#videonote |
11
|
|
|
*/ |
12
|
|
|
class VideoNote |
13
|
|
|
{ |
14
|
|
|
|
15
|
|
|
/** |
16
|
|
|
* Identifier for this file, which can be used to download or reuse the file |
17
|
|
|
* |
18
|
|
|
* @var string |
19
|
|
|
*/ |
20
|
|
|
private $file_id; |
21
|
|
|
|
22
|
|
|
/** |
23
|
|
|
* Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to |
24
|
|
|
* download or reuse the file. |
25
|
|
|
* |
26
|
|
|
* @var string |
27
|
|
|
*/ |
28
|
|
|
private $file_unique_id; |
29
|
|
|
|
30
|
|
|
/** |
31
|
|
|
* Video width and height (diameter of the video message) as defined by sender |
32
|
|
|
* |
33
|
|
|
* @var int |
34
|
|
|
*/ |
35
|
|
|
private $length; |
36
|
|
|
|
37
|
|
|
/** |
38
|
|
|
* Duration of the video in seconds as defined by sender |
39
|
|
|
* |
40
|
|
|
* @var int |
41
|
|
|
*/ |
42
|
|
|
private $duration; |
43
|
|
|
|
44
|
|
|
/** |
45
|
|
|
* Optional. Video thumbnail |
46
|
|
|
* |
47
|
|
|
* @var PhotoSize|null |
48
|
|
|
*/ |
49
|
|
|
private $thumb; |
50
|
|
|
|
51
|
|
|
/** |
52
|
|
|
* Optional. File size |
53
|
|
|
* |
54
|
|
|
* @var int|null |
55
|
|
|
*/ |
56
|
|
|
private $file_size; |
57
|
|
|
|
58
|
|
|
/** |
59
|
|
|
* @return string |
60
|
|
|
*/ |
61
|
|
|
public function getFileId(): string |
62
|
|
|
{ |
63
|
|
|
return $this->file_id; |
64
|
|
|
} |
65
|
|
|
|
66
|
|
|
/** |
67
|
|
|
* @param string $file_id |
68
|
|
|
*/ |
69
|
|
|
public function setFileId(string $file_id): void |
70
|
|
|
{ |
71
|
|
|
$this->file_id = $file_id; |
72
|
|
|
} |
73
|
|
|
|
74
|
|
|
/** |
75
|
|
|
* @return string |
76
|
|
|
*/ |
77
|
|
|
public function getFileUniqueId(): string |
78
|
|
|
{ |
79
|
|
|
return $this->file_unique_id; |
80
|
|
|
} |
81
|
|
|
|
82
|
|
|
/** |
83
|
|
|
* @param string $file_unique_id |
84
|
|
|
*/ |
85
|
|
|
public function setFileUniqueId(string $file_unique_id): void |
86
|
|
|
{ |
87
|
|
|
$this->file_unique_id = $file_unique_id; |
88
|
|
|
} |
89
|
|
|
|
90
|
|
|
/** |
91
|
|
|
* @return int |
92
|
|
|
*/ |
93
|
|
|
public function getLength(): int |
94
|
|
|
{ |
95
|
|
|
return $this->length; |
96
|
|
|
} |
97
|
|
|
|
98
|
|
|
/** |
99
|
|
|
* @param int $length |
100
|
|
|
*/ |
101
|
|
|
public function setLength(int $length): void |
102
|
|
|
{ |
103
|
|
|
$this->length = $length; |
104
|
|
|
} |
105
|
|
|
|
106
|
|
|
/** |
107
|
|
|
* @return int |
108
|
|
|
*/ |
109
|
|
|
public function getDuration(): int |
110
|
|
|
{ |
111
|
|
|
return $this->duration; |
112
|
|
|
} |
113
|
|
|
|
114
|
|
|
/** |
115
|
|
|
* @param int $duration |
116
|
|
|
*/ |
117
|
|
|
public function setDuration(int $duration): void |
118
|
|
|
{ |
119
|
|
|
$this->duration = $duration; |
120
|
|
|
} |
121
|
|
|
|
122
|
|
|
/** |
123
|
|
|
* @return PhotoSize|null |
124
|
|
|
*/ |
125
|
|
|
public function getThumb(): ?PhotoSize |
126
|
|
|
{ |
127
|
|
|
return $this->thumb; |
128
|
|
|
} |
129
|
|
|
|
130
|
|
|
/** |
131
|
|
|
* @param PhotoSize|null $thumb |
132
|
|
|
*/ |
133
|
|
|
public function setThumb(?PhotoSize $thumb): void |
134
|
|
|
{ |
135
|
|
|
$this->thumb = $thumb; |
136
|
|
|
} |
137
|
|
|
|
138
|
|
|
/** |
139
|
|
|
* @return int|null |
140
|
|
|
*/ |
141
|
|
|
public function getFileSize(): ?int |
142
|
|
|
{ |
143
|
|
|
return $this->file_size; |
144
|
|
|
} |
145
|
|
|
|
146
|
|
|
/** |
147
|
|
|
* @param int|null $file_size |
148
|
|
|
*/ |
149
|
|
|
public function setFileSize(?int $file_size): void |
150
|
|
|
{ |
151
|
|
|
$this->file_size = $file_size; |
152
|
|
|
} |
153
|
|
|
|
154
|
|
|
} |