InputInlineQueryResultContact   A
last analyzed

Complexity

Total Complexity 10

Size/Duplication

Total Lines 133
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 41
dl 0
loc 133
rs 10
c 0
b 0
f 0
wmc 10

10 Methods

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