This repository has been archived by the owner on Oct 24, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Subscriptions): Support AwsSNS for subscriptions
Closes #282
- Loading branch information
Jens Schulze
committed
Jan 9, 2017
1 parent
6e48320
commit f4e2c0e
Showing
1 changed file
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
/** | ||
* @author @jayS-de <jens.schulze@commercetools.de> | ||
*/ | ||
|
||
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); | ||
} | ||
} |