diff --git a/src/Model/Subscription/SNSDestination.php b/src/Model/Subscription/SNSDestination.php new file mode 100644 index 0000000000..b3cc3c3abe --- /dev/null +++ b/src/Model/Subscription/SNSDestination.php @@ -0,0 +1,46 @@ + + */ + +namespace Commercetools\Core\Model\Subscription; + +use Commercetools\Core\Model\Common\Context; + +/** + * @package Commercetools\Core\Model\Subscription + * + * @method string getType() + * @method SNSDestination setType(string $type = null) + * @method string getTopicArn() + * @method SNSDestination setTopicArn(string $topicArn = null) + * @method string getAccessKey() + * @method SNSDestination setAccessKey(string $accessKey = null) + * @method string getAccessSecret() + * @method SNSDestination setAccessSecret(string $accessSecret = null) + */ +class SNSDestination extends Destination +{ + public function fieldDefinitions() + { + return [ + 'type' => [static::TYPE => 'string'], + 'topicArn' => [static::TYPE => 'string'], + 'accessKey' => [static::TYPE => 'string'], + 'accessSecret' => [static::TYPE => 'string'], + ]; + } + + /** + * @param string $topicArn + * @param string $accessKey + * @param string $accessSecret + * @param Context|null $context + * @return SNSDestination + */ + public static function ofTopicArnAccessKeyAndSecret($topicArn, $accessKey, $accessSecret, Context $context = null) + { + return static::of($context)->setType('SNS') + ->setTopicArn($topicArn)->setAccessKey($accessKey)->setAccessSecret($accessSecret); + } +}