Skip to content

Commit

Permalink
update types
Browse files Browse the repository at this point in the history
  • Loading branch information
madmages committed Nov 5, 2022
1 parent 28f9f9e commit b336c3f
Show file tree
Hide file tree
Showing 16 changed files with 1,515 additions and 55 deletions.
363 changes: 339 additions & 24 deletions src/Client.php

Large diffs are not rendered by default.

97 changes: 97 additions & 0 deletions src/Type/Chat.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ public static function _getPropertyNames(): array
'username',
'first_name',
'last_name',
'is_forum',
'photo',
'active_usernames',
'emoji_status_custom_emoji_id',
'bio',
'has_private_forwards',
'has_restricted_voice_and_video_messages',
Expand Down Expand Up @@ -68,7 +71,10 @@ public function _getData(): array
'username' => $this->getUsername(),
'first_name' => $this->getFirstName(),
'last_name' => $this->getLastName(),
'is_forum' => $this->getIsForum(),
'photo' => $this->getPhoto(),
'active_usernames' => $this->getActiveUsernames(),
'emoji_status_custom_emoji_id' => $this->getEmojiStatusCustomEmojiId(),
'bio' => $this->getBio(),
'has_private_forwards' => $this->getHasPrivateForwards(),
'has_restricted_voice_and_video_messages' => $this->getHasRestrictedVoiceAndVideoMessages(),
Expand Down Expand Up @@ -156,6 +162,17 @@ public function _getData(): array
*/
protected $lastName;

/**
* Optional. True, if the supergroup chat is a forum (has topics enabled)
*
* @var bool|null
* @SkipWhenEmpty
* @SerializedName("is_forum")
* @Accessor(getter="getIsForum", setter="setIsForum")
* @Type("bool")
*/
protected $isForum;

/**
* Optional. Chat photo. Returned only in getChat.
*
Expand All @@ -167,6 +184,29 @@ public function _getData(): array
*/
protected $photo;

/**
* Optional. If non-empty, the list of all active chat usernames; for private chats, supergroups and channels.
* Returned only in getChat.
*
* @var string[]|null
* @SkipWhenEmpty
* @SerializedName("active_usernames")
* @Accessor(getter="getActiveUsernames", setter="setActiveUsernames")
* @Type("array<string>")
*/
protected $activeUsernames;

/**
* Optional. Custom emoji identifier of emoji status of the other party in a private chat. Returned only in getChat.
*
* @var string|null
* @SkipWhenEmpty
* @SerializedName("emoji_status_custom_emoji_id")
* @Accessor(getter="getEmojiStatusCustomEmojiId", setter="setEmojiStatusCustomEmojiId")
* @Type("string")
*/
protected $emojiStatusCustomEmojiId;

/**
* Optional. Bio of the other party in a private chat. Returned only in getChat.
*
Expand Down Expand Up @@ -466,6 +506,25 @@ public function getLastName(): ?string
return $this->lastName;
}

/**
* @param bool $isForum
* @return static
*/
public function setIsForum(bool $isForum): self
{
$this->isForum = $isForum;

return $this;
}

/**
* @return bool|null
*/
public function getIsForum(): ?bool
{
return $this->isForum;
}

/**
* @param ChatPhoto $photo
* @return static
Expand All @@ -485,6 +544,44 @@ public function getPhoto(): ?ChatPhoto
return $this->photo;
}

/**
* @param string[] $activeUsernames
* @return static
*/
public function setActiveUsernames(array $activeUsernames): self
{
$this->activeUsernames = $activeUsernames;

return $this;
}

/**
* @return string[]|null
*/
public function getActiveUsernames(): ?array
{
return $this->activeUsernames;
}

/**
* @param string $emojiStatusCustomEmojiId
* @return static
*/
public function setEmojiStatusCustomEmojiId(string $emojiStatusCustomEmojiId): self
{
$this->emojiStatusCustomEmojiId = $emojiStatusCustomEmojiId;

return $this;
}

/**
* @return string|null
*/
public function getEmojiStatusCustomEmojiId(): ?string
{
return $this->emojiStatusCustomEmojiId;
}

/**
* @param string $bio
* @return static
Expand Down
32 changes: 32 additions & 0 deletions src/Type/ChatAdministratorRights.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public static function _getPropertyNames(): array
'can_post_messages',
'can_edit_messages',
'can_pin_messages',
'can_manage_topics',
];
}

Expand All @@ -61,6 +62,7 @@ public function _getData(): array
'can_post_messages' => $this->getCanPostMessages(),
'can_edit_messages' => $this->getCanEditMessages(),
'can_pin_messages' => $this->getCanPinMessages(),
'can_manage_topics' => $this->getCanManageTopics(),
];

return parent::normalizeData($result);
Expand Down Expand Up @@ -182,6 +184,17 @@ public function _getData(): array
*/
protected $canPinMessages;

/**
* Optional. True, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only
*
* @var bool|null
* @SkipWhenEmpty
* @SerializedName("can_manage_topics")
* @Accessor(getter="getCanManageTopics", setter="setCanManageTopics")
* @Type("bool")
*/
protected $canManageTopics;


/**
* @param bool $isAnonymous
Expand Down Expand Up @@ -392,4 +405,23 @@ public function getCanPinMessages(): ?bool
return $this->canPinMessages;
}

/**
* @param bool $canManageTopics
* @return static
*/
public function setCanManageTopics(bool $canManageTopics): self
{
$this->canManageTopics = $canManageTopics;

return $this;
}

/**
* @return bool|null
*/
public function getCanManageTopics(): ?bool
{
return $this->canManageTopics;
}

}
32 changes: 32 additions & 0 deletions src/Type/ChatMemberAdministrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public static function _getPropertyNames(): array
'can_post_messages',
'can_edit_messages',
'can_pin_messages',
'can_manage_topics',
'custom_title',
];
}
Expand All @@ -68,6 +69,7 @@ public function _getData(): array
'can_post_messages' => $this->getCanPostMessages(),
'can_edit_messages' => $this->getCanEditMessages(),
'can_pin_messages' => $this->getCanPinMessages(),
'can_manage_topics' => $this->getCanManageTopics(),
'custom_title' => $this->getCustomTitle(),
];

Expand Down Expand Up @@ -220,6 +222,17 @@ public function _getData(): array
*/
protected $canPinMessages;

/**
* Optional. True, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only
*
* @var bool|null
* @SkipWhenEmpty
* @SerializedName("can_manage_topics")
* @Accessor(getter="getCanManageTopics", setter="setCanManageTopics")
* @Type("bool")
*/
protected $canManageTopics;

/**
* Optional. Custom title for this user
*
Expand Down Expand Up @@ -498,6 +511,25 @@ public function getCanPinMessages(): ?bool
return $this->canPinMessages;
}

/**
* @param bool $canManageTopics
* @return static
*/
public function setCanManageTopics(bool $canManageTopics): self
{
$this->canManageTopics = $canManageTopics;

return $this;
}

/**
* @return bool|null
*/
public function getCanManageTopics(): ?bool
{
return $this->canManageTopics;
}

/**
* @param string $customTitle
* @return static
Expand Down
31 changes: 31 additions & 0 deletions src/Type/ChatMemberRestricted.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public static function _getPropertyNames(): array
'can_change_info',
'can_invite_users',
'can_pin_messages',
'can_manage_topics',
'can_send_messages',
'can_send_media_messages',
'can_send_polls',
Expand All @@ -58,6 +59,7 @@ public function _getData(): array
'can_change_info' => $this->getCanChangeInfo(),
'can_invite_users' => $this->getCanInviteUsers(),
'can_pin_messages' => $this->getCanPinMessages(),
'can_manage_topics' => $this->getCanManageTopics(),
'can_send_messages' => $this->getCanSendMessages(),
'can_send_media_messages' => $this->getCanSendMediaMessages(),
'can_send_polls' => $this->getCanSendPolls(),
Expand Down Expand Up @@ -129,6 +131,16 @@ public function _getData(): array
*/
protected $canPinMessages;

/**
* True, if the user is allowed to create forum topics
*
* @var bool
* @SerializedName("can_manage_topics")
* @Accessor(getter="getCanManageTopics", setter="setCanManageTopics")
* @Type("bool")
*/
protected $canManageTopics;

/**
* True, if the user is allowed to send text messages, contacts, locations and venues
*
Expand Down Expand Up @@ -304,6 +316,25 @@ public function getCanPinMessages(): bool
return $this->canPinMessages;
}

/**
* @param bool $canManageTopics
* @return static
*/
public function setCanManageTopics(bool $canManageTopics): self
{
$this->canManageTopics = $canManageTopics;

return $this;
}

/**
* @return bool
*/
public function getCanManageTopics(): bool
{
return $this->canManageTopics;
}

/**
* @param bool $canSendMessages
* @return static
Expand Down
32 changes: 32 additions & 0 deletions src/Type/ChatPermissions.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public static function _getPropertyNames(): array
'can_change_info',
'can_invite_users',
'can_pin_messages',
'can_manage_topics',
];
}

Expand All @@ -55,6 +56,7 @@ public function _getData(): array
'can_change_info' => $this->getCanChangeInfo(),
'can_invite_users' => $this->getCanInviteUsers(),
'can_pin_messages' => $this->getCanPinMessages(),
'can_manage_topics' => $this->getCanManageTopics(),
];

return parent::normalizeData($result);
Expand Down Expand Up @@ -151,6 +153,17 @@ public function _getData(): array
*/
protected $canPinMessages;

/**
* Optional. True, if the user is allowed to create forum topics. If omitted defaults to the value of can_pin_messages
*
* @var bool|null
* @SkipWhenEmpty
* @SerializedName("can_manage_topics")
* @Accessor(getter="getCanManageTopics", setter="setCanManageTopics")
* @Type("bool")
*/
protected $canManageTopics;


/**
* @param bool $canSendMessages
Expand Down Expand Up @@ -304,4 +317,23 @@ public function getCanPinMessages(): ?bool
return $this->canPinMessages;
}

/**
* @param bool $canManageTopics
* @return static
*/
public function setCanManageTopics(bool $canManageTopics): self
{
$this->canManageTopics = $canManageTopics;

return $this;
}

/**
* @return bool|null
*/
public function getCanManageTopics(): ?bool
{
return $this->canManageTopics;
}

}
4 changes: 2 additions & 2 deletions src/Type/EncryptedCredentials.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
/**
* https://core.telegram.org/bots/api#encryptedcredentials
*
* Describes data required for decrypting and authenticating EncryptedPassportElement. See the Telegram Passport
* Documentation for a complete description of the data decryption and authentication processes.
* Describes data required for decrypting and authenticating EncryptedPassportElement. See the Telegram Passport Documentation for a complete
* description of the data decryption and authentication processes.
*
* @ExclusionPolicy("none")
* @AccessType("public_method")
Expand Down
Loading

0 comments on commit b336c3f

Please sign in to comment.