diff --git a/src/AmoCRM/Models/Chats/Templates/TemplateModel.php b/src/AmoCRM/Models/Chats/Templates/TemplateModel.php index 5be5363..d79755b 100644 --- a/src/AmoCRM/Models/Chats/Templates/TemplateModel.php +++ b/src/AmoCRM/Models/Chats/Templates/TemplateModel.php @@ -84,6 +84,9 @@ class TemplateModel extends BaseApiModel implements HasIdInterface /** @var string|null */ protected $wabaLanguage = null; + /** @var string|null */ + protected $wabaHeader = null; + /** @var string|null */ protected $wabaFooter = null; @@ -155,6 +158,10 @@ public static function fromArray(array $template): TemplateModel $model->setType($template['type']); } + if (isset($template['waba_header'])) { + $model->setWabaHeader($template['waba_header']); + } + if (isset($template['waba_footer'])) { $model->setWabaFooter($template['waba_footer']); } @@ -196,6 +203,7 @@ public function toArray(): array 'external_id' => $this->getExternalId(), 'request_id' => $this->getRequestId(), 'type' => $this->getType(), + 'waba_header' => $this->getWabaHeader(), 'waba_footer' => $this->getWabaFooter(), 'waba_category' => $this->getWabaCategory(), 'waba_language' => $this->getWabaLanguage(), @@ -225,6 +233,10 @@ public function toApi(?string $requestId = "0"): array 'type' => $this->getType(), ]; + if ($this->getWabaHeader()) { + $result['waba_header'] = $this->getWabaHeader(); + } + if ($this->getWabaFooter()) { $result['waba_footer'] = $this->getWabaFooter(); } @@ -468,6 +480,16 @@ public function setWabaLanguage(?string $wabaLanguage): TemplateModel return $this; } + /** + * @param string|null $wabaHeader + * @return TemplateModel + */ + public function setWabaHeader(?string $wabaHeader): TemplateModel + { + $this->wabaHeader = $wabaHeader; + return $this; + } + /** * @param string|null $wabaFooter * @return TemplateModel @@ -522,6 +544,14 @@ public function getWabaLanguage(): ?string return $this->wabaLanguage; } + /** + * @return string|null + */ + public function getWabaHeader(): ?string + { + return $this->wabaHeader; + } + /** * @return string|null */