1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* @author @jayS-de <[email protected]> |
4
|
|
|
*/ |
5
|
|
|
|
6
|
|
|
namespace Commercetools\Core\Model\Subscription; |
7
|
|
|
|
8
|
|
|
use Commercetools\Core\Model\Common\Context; |
9
|
|
|
|
10
|
|
|
/** |
11
|
|
|
* @package Commercetools\Core\Model\Subscription |
12
|
|
|
* |
13
|
|
|
* @method string getType() |
14
|
|
|
* @method SNSDestination setType(string $type = null) |
15
|
|
|
* @method string getTopicArn() |
16
|
|
|
* @method SNSDestination setTopicArn(string $topicArn = null) |
17
|
|
|
* @method string getAccessKey() |
18
|
|
|
* @method SNSDestination setAccessKey(string $accessKey = null) |
19
|
|
|
* @method string getAccessSecret() |
20
|
|
|
* @method SNSDestination setAccessSecret(string $accessSecret = null) |
21
|
|
|
*/ |
22
|
|
|
class SNSDestination extends Destination |
23
|
|
|
{ |
24
|
|
|
public function fieldDefinitions() |
25
|
|
|
{ |
26
|
|
|
return [ |
27
|
|
|
'type' => [static::TYPE => 'string'], |
28
|
|
|
'topicArn' => [static::TYPE => 'string'], |
29
|
|
|
'accessKey' => [static::TYPE => 'string'], |
30
|
|
|
'accessSecret' => [static::TYPE => 'string'], |
31
|
|
|
]; |
32
|
|
|
} |
33
|
|
|
|
34
|
|
|
/** |
35
|
|
|
* @param string $topicArn |
36
|
|
|
* @param string $accessKey |
37
|
|
|
* @param string $accessSecret |
38
|
|
|
* @param Context|null $context |
39
|
|
|
* @return SNSDestination |
40
|
|
|
*/ |
41
|
|
|
public static function ofTopicArnAccessKeyAndSecret($topicArn, $accessKey, $accessSecret, Context $context = null) |
42
|
|
|
{ |
43
|
|
|
return static::of($context)->setType('SNS') |
44
|
|
|
->setTopicArn($topicArn)->setAccessKey($accessKey)->setAccessSecret($accessSecret); |
45
|
|
|
} |
46
|
|
|
} |
47
|
|
|
|