1
0
mirror of synced 2024-11-22 03:46:02 +03:00

Add template attachments

This commit is contained in:
Pavel 2024-07-02 16:38:51 +03:00 committed by GitHub
commit 26aa42ce67
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 106 additions and 0 deletions

View File

@ -0,0 +1,74 @@
<?php
/**
* PHP version 7.1
*
* TemplateAttachment entity
*
* @package RetailCrm\Mg\Bot\Model\Entity\Template
*/
namespace RetailCrm\Mg\Bot\Model\Entity\Template;
use JMS\Serializer\Annotation\Accessor;
use JMS\Serializer\Annotation\SkipWhenEmpty;
use JMS\Serializer\Annotation\Type;
use RetailCrm\Mg\Bot\Model\ModelInterface;
/**
* TemplateAttachment class
*
* @package RetailCrm\Mg\Bot\Model\Entity\Template
*/
class TemplateAttachment implements ModelInterface
{
/**
* @var string $id
*
* @Type("string")
* @Accessor(getter="getId",setter="setId")
*/
private $id;
/**
* @var string $caption
*
* @Type("string")
* @Accessor(getter="getCaption",setter="setCaption")
* @SkipWhenEmpty()
*/
private $caption;
/**
* @return string|null
*/
public function getId(): ?string
{
return $this->id;
}
/**
* @param string $id
* @return void
*/
public function setId(string $id): void
{
$this->id = $id;
}
/**
* @return string|null
*/
public function getCaption(): ?string
{
return $this->caption;
}
/**
* @param string $caption
*/
public function setCaption(string $caption): void
{
$this->caption = $caption;
}
}

View File

@ -1,5 +1,13 @@
<?php
/**
* PHP version 7.1
*
* TemplateVariables entity
*
* @package RetailCrm\Mg\Bot\Model\Entity\Template
*/
namespace RetailCrm\Mg\Bot\Model\Entity\Template;
use JMS\Serializer\Annotation\Accessor;
@ -22,6 +30,14 @@ class TemplateVariables implements ModelInterface
*/
private $header;
/** @var array<TemplateAttachment> $attachments
*
* @Type("array")
* @Accessor(getter="getAttachments",setter="setAttachments")
*/
private $attachments;
/**
* @var array<string, string> $body
*
@ -85,4 +101,20 @@ class TemplateVariables implements ModelInterface
{
$this->buttons = $buttons;
}
/**
* @return TemplateAttachment[]|null
*/
public function getAttachments(): ?array
{
return $this->attachments;
}
/**
* @param TemplateAttachment[] $attachments
*/
public function setAttachments(array $attachments): void
{
$this->attachments = $attachments;
}
}