Skip to content

Commit

Permalink
Add template attachments
Browse files Browse the repository at this point in the history
  • Loading branch information
Chupocabra committed Jul 2, 2024
1 parent 1fc8ccd commit 54486d4
Show file tree
Hide file tree
Showing 2 changed files with 106 additions and 0 deletions.
74 changes: 74 additions & 0 deletions src/Bot/Model/Entity/Template/TemplateAttachment.php
Original file line number Diff line number Diff line change
@@ -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 $header
*
* @Type("string")
* @Accessor(getter="getId",setter="setId")
*/
private $id;

Check failure on line 31 in src/Bot/Model/Entity/Template/TemplateAttachment.php

View workflow job for this annotation

GitHub Actions / test (7.3)

Property RetailCrm\Mg\Bot\Model\Entity\Template\TemplateAttachment::$id has no typehint specified.

Check failure on line 31 in src/Bot/Model/Entity/Template/TemplateAttachment.php

View workflow job for this annotation

GitHub Actions / test (7.4)

Property RetailCrm\Mg\Bot\Model\Entity\Template\TemplateAttachment::$id has no typehint specified.

Check failure on line 31 in src/Bot/Model/Entity/Template/TemplateAttachment.php

View workflow job for this annotation

GitHub Actions / test (8.0)

Property RetailCrm\Mg\Bot\Model\Entity\Template\TemplateAttachment::$id has no typehint specified.

Check failure on line 31 in src/Bot/Model/Entity/Template/TemplateAttachment.php

View workflow job for this annotation

GitHub Actions / test (8.1)

Property RetailCrm\Mg\Bot\Model\Entity\Template\TemplateAttachment::$id has no typehint specified.

/**
* @var string $header
*
* @Type("string")
* @Accessor(getter="getCaption",setter="setCaption")
* @SkipWhenEmpty()
*/
private $caption;

Check failure on line 40 in src/Bot/Model/Entity/Template/TemplateAttachment.php

View workflow job for this annotation

GitHub Actions / test (7.3)

Property RetailCrm\Mg\Bot\Model\Entity\Template\TemplateAttachment::$caption has no typehint specified.

Check failure on line 40 in src/Bot/Model/Entity/Template/TemplateAttachment.php

View workflow job for this annotation

GitHub Actions / test (7.4)

Property RetailCrm\Mg\Bot\Model\Entity\Template\TemplateAttachment::$caption has no typehint specified.

Check failure on line 40 in src/Bot/Model/Entity/Template/TemplateAttachment.php

View workflow job for this annotation

GitHub Actions / test (8.0)

Property RetailCrm\Mg\Bot\Model\Entity\Template\TemplateAttachment::$caption has no typehint specified.

Check failure on line 40 in src/Bot/Model/Entity/Template/TemplateAttachment.php

View workflow job for this annotation

GitHub Actions / test (8.1)

Property RetailCrm\Mg\Bot\Model\Entity\Template\TemplateAttachment::$caption has no typehint specified.

/**
* @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;
}
}
32 changes: 32 additions & 0 deletions src/Bot/Model/Entity/Template/TemplateVariables.php
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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
*
Expand Down Expand Up @@ -85,4 +101,20 @@ public function setButtons(array $buttons): void
{
$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;
}
}

0 comments on commit 54486d4

Please sign in to comment.