GetArchivedStickerSets::typeSerialize()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 0
dl 0
loc 7
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
 * Returns a list of archived sticker sets.
13
 */
14
class GetArchivedStickerSets extends TdFunction
15
{
16
    public const TYPE_NAME = 'getArchivedStickerSets';
17
18
    /**
19
     * Pass true to return mask stickers sets; pass false to return ordinary sticker sets.
20
     *
21
     * @var bool
22
     */
23
    protected bool $isMasks;
24
25
    /**
26
     * Identifier of the sticker set from which to return the result.
27
     *
28
     * @var string
29
     */
30
    protected string $offsetStickerSetId;
31
32
    /**
33
     * The maximum number of sticker sets to return.
34
     *
35
     * @var int
36
     */
37
    protected int $limit;
38
39
    public function __construct(bool $isMasks, string $offsetStickerSetId, int $limit)
40
    {
41
        $this->isMasks            = $isMasks;
42
        $this->offsetStickerSetId = $offsetStickerSetId;
43
        $this->limit              = $limit;
44
    }
45
46
    public static function fromArray(array $array): GetArchivedStickerSets
47
    {
48
        return new static(
49
            $array['is_masks'],
50
            $array['offset_sticker_set_id'],
51
            $array['limit'],
52
        );
53
    }
54
55
    public function typeSerialize(): array
56
    {
57
        return [
58
            '@type'                 => static::TYPE_NAME,
59
            'is_masks'              => $this->isMasks,
60
            'offset_sticker_set_id' => $this->offsetStickerSetId,
61
            'limit'                 => $this->limit,
62
        ];
63
    }
64
65
    public function getIsMasks(): bool
66
    {
67
        return $this->isMasks;
68
    }
69
70
    public function getOffsetStickerSetId(): string
71
    {
72
        return $this->offsetStickerSetId;
73
    }
74
75
    public function getLimit(): int
76
    {
77
        return $this->limit;
78
    }
79
}
80