Updated ChosenInlineResult
This commit is contained in:
parent
aaacd8851e
commit
ad1094de38
1 changed files with 9 additions and 33 deletions
|
@ -10,30 +10,11 @@
|
||||||
|
|
||||||
class ChosenInlineResult implements ObjectTypeInterface
|
class ChosenInlineResult implements ObjectTypeInterface
|
||||||
{
|
{
|
||||||
/**
|
private string $result_id;
|
||||||
* @var string
|
private User $from;
|
||||||
*/
|
private ?Location $location;
|
||||||
private $result_id;
|
private ?string $inline_message_id;
|
||||||
|
private string $query;
|
||||||
/**
|
|
||||||
* @var User
|
|
||||||
*/
|
|
||||||
private $from;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var Location|null
|
|
||||||
*/
|
|
||||||
private $location;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var string|null
|
|
||||||
*/
|
|
||||||
private $inline_message_id;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
private $query;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The unique identifier for the result that was chosen
|
* The unique identifier for the result that was chosen
|
||||||
|
@ -90,26 +71,21 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns an array representation of the object
|
* @inheritDoc
|
||||||
*
|
|
||||||
* @return array
|
|
||||||
*/
|
*/
|
||||||
public function toArray(): array
|
public function toArray(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'result_id' => $this->result_id,
|
'result_id' => $this->result_id,
|
||||||
'from' => ($this->from instanceof ObjectTypeInterface) ? $this->from->toArray() : $this->from,
|
'from' => $this->from?->toArray(),
|
||||||
'location' => ($this->location instanceof ObjectTypeInterface) ? $this->location->toArray() : $this->location,
|
'location' => $this->location?->toArray(),
|
||||||
'inline_message_id' => $this->inline_message_id,
|
'inline_message_id' => $this->inline_message_id,
|
||||||
'query' => $this->query,
|
'query' => $this->query,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs object from an array representation
|
* @inheritDoc
|
||||||
*
|
|
||||||
* @param array|null $data
|
|
||||||
* @return ChosenInlineResult|null
|
|
||||||
*/
|
*/
|
||||||
public static function fromArray(?array $data): ?ChosenInlineResult
|
public static function fromArray(?array $data): ?ChosenInlineResult
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue