Initial commit: CloudOps infrastructure platform
This commit is contained in:
@@ -0,0 +1,121 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Mautic\IntegrationsBundle\DTO;
|
||||
|
||||
/**
|
||||
* This class represents tokens which provide links to objects which have been
|
||||
* synced from integrations into Mautic.
|
||||
*/
|
||||
class IntegrationObjectToken
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $objectName;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $integration;
|
||||
|
||||
private string $defaultValue = '';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $linkText;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $baseURL;
|
||||
|
||||
public function __construct(
|
||||
private string $token,
|
||||
) {
|
||||
}
|
||||
|
||||
public function getToken(): string
|
||||
{
|
||||
return $this->token;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $objectName
|
||||
*/
|
||||
public function setObjectName($objectName): void
|
||||
{
|
||||
$this->objectName = $objectName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getObjectName()
|
||||
{
|
||||
return $this->objectName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $integration
|
||||
*/
|
||||
public function setIntegration($integration): void
|
||||
{
|
||||
$this->integration = $integration;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getIntegration()
|
||||
{
|
||||
return $this->integration;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $defaultValue
|
||||
*/
|
||||
public function setDefaultValue($defaultValue): void
|
||||
{
|
||||
$this->defaultValue = $defaultValue;
|
||||
}
|
||||
|
||||
public function getDefaultValue(): string
|
||||
{
|
||||
return $this->defaultValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $linkText
|
||||
*/
|
||||
public function setLinkText($linkText): void
|
||||
{
|
||||
$this->linkText = $linkText;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getLinkText()
|
||||
{
|
||||
return $this->linkText;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $baseURL
|
||||
*/
|
||||
public function setBaseURL($baseURL): void
|
||||
{
|
||||
$this->baseURL = $baseURL;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getBaseURL()
|
||||
{
|
||||
return $this->baseURL;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Mautic\IntegrationsBundle\DTO;
|
||||
|
||||
final class Note
|
||||
{
|
||||
public const TYPE_WARNING = 'warning';
|
||||
|
||||
public const TYPE_INFO = 'info';
|
||||
|
||||
private string $type;
|
||||
|
||||
public function __construct(
|
||||
private string $note,
|
||||
string $type,
|
||||
) {
|
||||
if (!in_array($type, [self::TYPE_INFO, self::TYPE_WARNING])) {
|
||||
throw new \InvalidArgumentException(sprintf('Type value can be either "%s" or "%s".', self::TYPE_INFO, self::TYPE_WARNING));
|
||||
}
|
||||
|
||||
$this->type = $type;
|
||||
}
|
||||
|
||||
public function getNote(): string
|
||||
{
|
||||
return $this->note;
|
||||
}
|
||||
|
||||
public function getType(): string
|
||||
{
|
||||
return $this->type;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user