Skip to content

Commit

Permalink
Updated types
Browse files Browse the repository at this point in the history
  • Loading branch information
madmages committed Jan 6, 2022
1 parent 459f0b3 commit 15a29ed
Show file tree
Hide file tree
Showing 50 changed files with 3,213 additions and 567 deletions.
450 changes: 372 additions & 78 deletions src/Client.php

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions src/Type/AbstractChatMember.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?php declare(strict_types=1);

namespace MadmagesTelegram\Types\Type;

abstract class AbstractChatMember extends AbstractType {}
2 changes: 1 addition & 1 deletion src/Type/Animation.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public function _getData(): array
protected $mimeType;

/**
* Optional. File size
* Optional. File size in bytes
*
* @var int|null
* @SkipWhenEmpty
Expand Down
2 changes: 1 addition & 1 deletion src/Type/Audio.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public function _getData(): array
protected $mimeType;

/**
* Optional. File size
* Optional. File size in bytes
*
* @var int|null
* @SkipWhenEmpty
Expand Down
4 changes: 2 additions & 2 deletions src/Type/BotCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function _getData(): array
}

/**
* Text of the command, 1-32 characters. Can contain only lowercase English letters, digits and underscores.
* Text of the command; 1-32 characters. Can contain only lowercase English letters, digits and underscores.
*
* @var string
* @SerializedName("command")
Expand All @@ -59,7 +59,7 @@ public function _getData(): array
protected $command;

/**
* Description of the command, 3-256 characters.
* Description of the command; 1-256 characters.
*
* @var string
* @SerializedName("description")
Expand Down
48 changes: 48 additions & 0 deletions src/Type/BotCommandScope.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?php declare(strict_types=1);

namespace MadmagesTelegram\Types\Type;

use JMS\Serializer\Annotation\ExclusionPolicy;
use JMS\Serializer\Annotation\AccessType;
use JMS\Serializer\Annotation\SkipWhenEmpty;
use JMS\Serializer\Annotation\SerializedName;
use JMS\Serializer\Annotation\Accessor;
use JMS\Serializer\Annotation\Type;

/**
* https://core.telegram.org/bots/api#botcommandscope
*
* This object represents the scope to which bot commands are applied. Currently, the following 7 scopes are supported:
*
* @ExclusionPolicy("none")
* @AccessType("public_method")
*/
class BotCommandScope extends AbstractType
{

/**
* Returns raw names of properties of this type
*
* @return string[]
*/
public static function _getPropertyNames(): array
{
return [
];
}

/**
* Returns associative array of raw data
*
* @return array
*/
public function _getData(): array
{
$result = [
];

return parent::normalizeData($result);
}


}
80 changes: 80 additions & 0 deletions src/Type/BotCommandScopeAllChatAdministrators.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<?php declare(strict_types=1);

namespace MadmagesTelegram\Types\Type;

use JMS\Serializer\Annotation\ExclusionPolicy;
use JMS\Serializer\Annotation\AccessType;
use JMS\Serializer\Annotation\SkipWhenEmpty;
use JMS\Serializer\Annotation\SerializedName;
use JMS\Serializer\Annotation\Accessor;
use JMS\Serializer\Annotation\Type;

/**
* https://core.telegram.org/bots/api#botcommandscopeallchatadministrators
*
* Represents the scope of bot commands, covering all group and supergroup chat
* administrators.
*
* @ExclusionPolicy("none")
* @AccessType("public_method")
*/
class BotCommandScopeAllChatAdministrators extends AbstractType
{

/**
* Returns raw names of properties of this type
*
* @return string[]
*/
public static function _getPropertyNames(): array
{
return [
'type',
];
}

/**
* Returns associative array of raw data
*
* @return array
*/
public function _getData(): array
{
$result = [
'type' => $this->getType(),
];

return parent::normalizeData($result);
}

/**
* Scope type, must be all_chat_administrators
*
* @var string
* @SerializedName("type")
* @Accessor(getter="getType",setter="setType")
* @Type("string")
*/
protected $type;


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

return $this;
}

/**
* @return string
*/
public function getType(): string
{
return $this->type;
}

}
79 changes: 79 additions & 0 deletions src/Type/BotCommandScopeAllGroupChats.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<?php declare(strict_types=1);

namespace MadmagesTelegram\Types\Type;

use JMS\Serializer\Annotation\ExclusionPolicy;
use JMS\Serializer\Annotation\AccessType;
use JMS\Serializer\Annotation\SkipWhenEmpty;
use JMS\Serializer\Annotation\SerializedName;
use JMS\Serializer\Annotation\Accessor;
use JMS\Serializer\Annotation\Type;

/**
* https://core.telegram.org/bots/api#botcommandscopeallgroupchats
*
* Represents the scope of bot commands, covering all group and supergroup chats.
*
* @ExclusionPolicy("none")
* @AccessType("public_method")
*/
class BotCommandScopeAllGroupChats extends AbstractType
{

/**
* Returns raw names of properties of this type
*
* @return string[]
*/
public static function _getPropertyNames(): array
{
return [
'type',
];
}

/**
* Returns associative array of raw data
*
* @return array
*/
public function _getData(): array
{
$result = [
'type' => $this->getType(),
];

return parent::normalizeData($result);
}

/**
* Scope type, must be all_group_chats
*
* @var string
* @SerializedName("type")
* @Accessor(getter="getType",setter="setType")
* @Type("string")
*/
protected $type;


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

return $this;
}

/**
* @return string
*/
public function getType(): string
{
return $this->type;
}

}
79 changes: 79 additions & 0 deletions src/Type/BotCommandScopeAllPrivateChats.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<?php declare(strict_types=1);

namespace MadmagesTelegram\Types\Type;

use JMS\Serializer\Annotation\ExclusionPolicy;
use JMS\Serializer\Annotation\AccessType;
use JMS\Serializer\Annotation\SkipWhenEmpty;
use JMS\Serializer\Annotation\SerializedName;
use JMS\Serializer\Annotation\Accessor;
use JMS\Serializer\Annotation\Type;

/**
* https://core.telegram.org/bots/api#botcommandscopeallprivatechats
*
* Represents the scope of bot commands, covering all private chats.
*
* @ExclusionPolicy("none")
* @AccessType("public_method")
*/
class BotCommandScopeAllPrivateChats extends AbstractType
{

/**
* Returns raw names of properties of this type
*
* @return string[]
*/
public static function _getPropertyNames(): array
{
return [
'type',
];
}

/**
* Returns associative array of raw data
*
* @return array
*/
public function _getData(): array
{
$result = [
'type' => $this->getType(),
];

return parent::normalizeData($result);
}

/**
* Scope type, must be all_private_chats
*
* @var string
* @SerializedName("type")
* @Accessor(getter="getType",setter="setType")
* @Type("string")
*/
protected $type;


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

return $this;
}

/**
* @return string
*/
public function getType(): string
{
return $this->type;
}

}
Loading

0 comments on commit 15a29ed

Please sign in to comment.