1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* @author @jenschude <[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 AzureServiceBusDestination setType(string $type = null) |
15
|
|
|
* @method string getConnectionString() |
16
|
|
|
* @method AzureServiceBusDestination setConnectionString(string $connectionString = null) |
17
|
|
|
*/ |
18
|
|
|
class AzureServiceBusDestination extends Destination |
19
|
|
|
{ |
20
|
1 |
|
public function fieldDefinitions() |
21
|
|
|
{ |
22
|
|
|
return [ |
23
|
1 |
|
'type' => [static::TYPE => 'string'], |
24
|
1 |
|
'connectionString' => [static::TYPE => 'string'], |
25
|
|
|
]; |
26
|
|
|
} |
27
|
|
|
|
28
|
|
|
/** |
29
|
|
|
* @deprecated use ofConnectionString instead |
30
|
|
|
* @param string $connectionString |
31
|
|
|
* @param Context|null $context |
32
|
|
|
* @return AzureServiceBusDestination |
33
|
|
|
*/ |
34
|
|
|
public static function ofQueueURLAccessKeyAndSecret($connectionString, Context $context = null) |
35
|
|
|
{ |
36
|
|
|
return static::of($context) |
37
|
|
|
->setType(static::DESTINATION_AZURE_SERVICE_BUS) |
38
|
|
|
->setConnectionString($connectionString); |
39
|
|
|
} |
40
|
|
|
|
41
|
|
|
/** |
42
|
|
|
* @param string $connectionString |
43
|
|
|
* @param Context|null $context |
44
|
|
|
* @return AzureServiceBusDestination |
45
|
|
|
*/ |
46
|
|
|
public static function ofConnectionString($connectionString, Context $context = null) |
47
|
|
|
{ |
48
|
|
|
return static::of($context) |
49
|
|
|
->setType(static::DESTINATION_AZURE_SERVICE_BUS) |
50
|
|
|
->setConnectionString($connectionString); |
51
|
|
|
} |
52
|
|
|
} |
53
|
|
|
|