Updated ChatPermissions
This commit is contained in:
parent
7fdfce0cc6
commit
108f64d924
1 changed files with 22 additions and 79 deletions
|
@ -7,75 +7,20 @@
|
||||||
|
|
||||||
class ChatPermissions implements ObjectTypeInterface
|
class ChatPermissions implements ObjectTypeInterface
|
||||||
{
|
{
|
||||||
/**
|
private bool $can_send_messages;
|
||||||
* @var bool
|
private bool $can_send_audios;
|
||||||
*/
|
private bool $can_send_documents;
|
||||||
private $can_send_messages;
|
private bool $can_send_photos;
|
||||||
|
private bool $can_send_videos;
|
||||||
/**
|
private bool $can_send_videos_notes;
|
||||||
* @var bool
|
private bool $can_send_voice_notes;
|
||||||
*/
|
private bool $can_send_polls;
|
||||||
private $can_send_audios;
|
private bool $can_send_other_messages;
|
||||||
|
private bool $can_add_web_page_previews;
|
||||||
/**
|
private bool $can_change_info;
|
||||||
* @var bool
|
private bool $can_invite_users;
|
||||||
*/
|
private bool $can_pin_messages;
|
||||||
private $can_send_documents;
|
private bool $can_manage_topics;
|
||||||
|
|
||||||
/**
|
|
||||||
* @var bool
|
|
||||||
*/
|
|
||||||
private $can_send_photos;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var bool
|
|
||||||
*/
|
|
||||||
private $can_send_videos;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var bool
|
|
||||||
*/
|
|
||||||
private $can_send_videos_notes;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var bool
|
|
||||||
*/
|
|
||||||
private $can_send_voice_notes;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var bool
|
|
||||||
*/
|
|
||||||
private $can_send_polls;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var bool
|
|
||||||
*/
|
|
||||||
private $can_send_other_messages;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var bool
|
|
||||||
*/
|
|
||||||
private $can_add_web_page_previews;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var bool
|
|
||||||
*/
|
|
||||||
private $can_change_info;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var bool
|
|
||||||
*/
|
|
||||||
private $can_invite_users;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var bool
|
|
||||||
*/
|
|
||||||
private $can_pin_messages;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var bool
|
|
||||||
*/
|
|
||||||
private $can_manage_topics;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Optional. True, if the user is allowed to send text messages, contacts, invoices, locations and venues
|
* Optional. True, if the user is allowed to send text messages, contacts, invoices, locations and venues
|
||||||
|
@ -220,9 +165,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns an array representation of the object
|
* @inheritDoc
|
||||||
*
|
|
||||||
* @return array
|
|
||||||
*/
|
*/
|
||||||
public function toArray(): array
|
public function toArray(): array
|
||||||
{
|
{
|
||||||
|
@ -245,16 +188,16 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs object from an array representation
|
* @inheritDoc
|
||||||
*
|
|
||||||
* @param array $data
|
|
||||||
* @return ChatPermissions
|
|
||||||
* @noinspection DuplicatedCode
|
|
||||||
*/
|
*/
|
||||||
public static function fromArray(array $data): self
|
public static function fromArray(?array $data): ?ChatPermissions
|
||||||
{
|
{
|
||||||
$object = new self();
|
if($data === null)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
$object = new self();
|
||||||
$object->can_send_messages = $data['can_send_messages'] ?? false;
|
$object->can_send_messages = $data['can_send_messages'] ?? false;
|
||||||
$object->can_send_audios = $data['can_send_audios'] ?? false;
|
$object->can_send_audios = $data['can_send_audios'] ?? false;
|
||||||
$object->can_send_documents = $data['can_send_documents'] ?? false;
|
$object->can_send_documents = $data['can_send_documents'] ?? false;
|
||||||
|
|
Loading…
Add table
Reference in a new issue