| Total Complexity | 5 |
| Total Lines | 45 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | class GetRemoteFile extends TdFunction |
||
| 15 | { |
||
| 16 | public const TYPE_NAME = 'getRemoteFile'; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * Remote identifier of the file to get. |
||
| 20 | */ |
||
| 21 | protected string $remoteFileId; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * File type, if known. |
||
| 25 | */ |
||
| 26 | protected FileType $fileType; |
||
| 27 | |||
| 28 | public function __construct(string $remoteFileId, FileType $fileType) |
||
| 32 | } |
||
| 33 | |||
| 34 | public static function fromArray(array $array): GetRemoteFile |
||
| 35 | { |
||
| 36 | return new static( |
||
| 37 | $array['remote_file_id'], |
||
| 38 | TdSchemaRegistry::fromArray($array['file_type']), |
||
| 39 | ); |
||
| 40 | } |
||
| 41 | |||
| 42 | public function typeSerialize(): array |
||
| 43 | { |
||
| 44 | return [ |
||
| 45 | '@type' => static::TYPE_NAME, |
||
| 46 | 'remote_file_id' => $this->remoteFileId, |
||
| 47 | 'file_type' => $this->fileType->typeSerialize(), |
||
| 48 | ]; |
||
| 49 | } |
||
| 50 | |||
| 51 | public function getRemoteFileId(): string |
||
| 52 | { |
||
| 53 | return $this->remoteFileId; |
||
| 54 | } |
||
| 55 | |||
| 56 | public function getFileType(): FileType |
||
| 59 | } |
||
| 60 | } |
||
| 61 |