|
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 SQSDestination setType(string $type = null) |
|
15
|
|
|
* @method string getUri() |
|
16
|
|
|
* @method IronMQDestination setUri(string $uri = null) |
|
17
|
|
|
* @method string getQueueURL() |
|
18
|
|
|
* @method SQSDestination setQueueURL(string $queueURL = null) |
|
19
|
|
|
* @method string getAccessKey() |
|
20
|
|
|
* @method SQSDestination setAccessKey(string $accessKey = null) |
|
21
|
|
|
* @method string getAccessSecret() |
|
22
|
|
|
* @method SQSDestination setAccessSecret(string $accessSecret = null) |
|
23
|
|
|
* @method string getRegion() |
|
24
|
|
|
* @method SQSDestination setRegion(string $region = null) |
|
25
|
|
|
*/ |
|
26
|
|
|
class SQSDestination extends Destination |
|
27
|
|
|
{ |
|
28
|
|
|
public function fieldDefinitions() |
|
29
|
|
|
{ |
|
30
|
|
|
return [ |
|
31
|
|
|
'type' => [static::TYPE => 'string'], |
|
32
|
|
|
'queueURL' => [static::TYPE => 'string'], |
|
33
|
|
|
'accessKey' => [static::TYPE => 'string'], |
|
34
|
|
|
'accessSecret' => [static::TYPE => 'string'], |
|
35
|
|
|
'region' => [static::TYPE => 'string'], |
|
36
|
|
|
]; |
|
37
|
|
|
} |
|
38
|
|
|
|
|
39
|
|
|
/** |
|
40
|
|
|
* @param $uri |
|
41
|
|
|
* @param $accessKey |
|
42
|
|
|
* @param $accessSecret |
|
43
|
|
|
* @param Context|null $context |
|
44
|
|
|
* @return SQSDestination |
|
45
|
|
|
*/ |
|
46
|
|
|
public static function ofQueueURLAccessKeyAndSecret($uri, $accessKey, $accessSecret, Context $context = null) |
|
47
|
|
|
{ |
|
48
|
|
|
return static::of($context) |
|
49
|
|
|
->setType('SQS') |
|
50
|
|
|
->setQueueURL($uri) |
|
51
|
|
|
->setAccessKey($accessKey) |
|
52
|
|
|
->setAccessSecret($accessSecret); |
|
53
|
|
|
} |
|
54
|
|
|
} |
|
55
|
|
|
|