InputMessageForwarded::getFromChatId()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
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
 * A forwarded message.
13
 */
14
class InputMessageForwarded extends InputMessageContent
15
{
16
    public const TYPE_NAME = 'inputMessageForwarded';
17
18
    /**
19
     * Identifier for the chat this forwarded message came from.
20
     *
21
     * @var int
22
     */
23
    protected int $fromChatId;
24
25
    /**
26
     * Identifier of the message to forward.
27
     *
28
     * @var int
29
     */
30
    protected int $messageId;
31
32
    /**
33
     * True, if a game message should be shared within a launched game; applies only to game messages.
34
     *
35
     * @var bool
36
     */
37
    protected bool $inGameShare;
38
39
    /**
40
     * True, if content of the message needs to be copied without a link to the original message. Always true if the message is forwarded to a secret chat.
41
     *
42
     * @var bool
43
     */
44
    protected bool $sendCopy;
45
46
    /**
47
     * True, if media caption of the message copy needs to be removed. Ignored if send_copy is false.
48
     *
49
     * @var bool
50
     */
51
    protected bool $removeCaption;
52
53
    public function __construct(int $fromChatId, int $messageId, bool $inGameShare, bool $sendCopy, bool $removeCaption)
54
    {
55
        parent::__construct();
56
57
        $this->fromChatId    = $fromChatId;
58
        $this->messageId     = $messageId;
59
        $this->inGameShare   = $inGameShare;
60
        $this->sendCopy      = $sendCopy;
61
        $this->removeCaption = $removeCaption;
62
    }
63
64
    public static function fromArray(array $array): InputMessageForwarded
65
    {
66
        return new static(
67
            $array['from_chat_id'],
68
            $array['message_id'],
69
            $array['in_game_share'],
70
            $array['send_copy'],
71
            $array['remove_caption'],
72
        );
73
    }
74
75
    public function typeSerialize(): array
76
    {
77
        return [
78
            '@type'          => static::TYPE_NAME,
79
            'from_chat_id'   => $this->fromChatId,
80
            'message_id'     => $this->messageId,
81
            'in_game_share'  => $this->inGameShare,
82
            'send_copy'      => $this->sendCopy,
83
            'remove_caption' => $this->removeCaption,
84
        ];
85
    }
86
87
    public function getFromChatId(): int
88
    {
89
        return $this->fromChatId;
90
    }
91
92
    public function getMessageId(): int
93
    {
94
        return $this->messageId;
95
    }
96
97
    public function getInGameShare(): bool
98
    {
99
        return $this->inGameShare;
100
    }
101
102
    public function getSendCopy(): bool
103
    {
104
        return $this->sendCopy;
105
    }
106
107
    public function getRemoveCaption(): bool
108
    {
109
        return $this->removeCaption;
110
    }
111
}
112