commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
lib
commercetools-api
src
Models
Subscription
GoogleCloudPubSubDestinationModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\Subscription
;
10
11
use
Commercetools\Base\DateTimeImmutableCollection
;
12
use
Commercetools\Base\JsonObject
;
13
use
Commercetools\Base\JsonObjectModel
;
14
use
Commercetools\Base\MapperFactory
;
15
use stdClass;
16
20
final
class
GoogleCloudPubSubDestinationModel
extends
JsonObjectModel
implements
GoogleCloudPubSubDestination
21
{
22
public
const
DISCRIMINATOR_VALUE
=
'GoogleCloudPubSub'
;
27
protected
$type
;
28
33
protected
$projectId
;
34
39
protected
$topic
;
40
41
45
public
function
__construct
(
46
?
string
$projectId
=
null
,
47
?
string
$topic
=
null
,
48
?
string
$type
=
null
49
) {
50
$this->projectId =
$projectId
;
51
$this->topic =
$topic
;
52
$this->type =
$type
??
self::DISCRIMINATOR_VALUE
;
53
}
54
59
public
function
getType
()
60
{
61
if
(is_null($this->type)) {
63
$data = $this->
raw
(self::FIELD_TYPE);
64
if
(is_null($data)) {
65
return
null
;
66
}
67
$this->type = (string) $data;
68
}
69
70
return
$this->type
;
71
}
72
79
public
function
getProjectId
()
80
{
81
if
(is_null($this->projectId)) {
83
$data = $this->
raw
(self::FIELD_PROJECT_ID);
84
if
(is_null($data)) {
85
return
null
;
86
}
87
$this->projectId = (string) $data;
88
}
89
90
return
$this->projectId
;
91
}
92
99
public
function
getTopic
()
100
{
101
if
(is_null($this->topic)) {
103
$data = $this->
raw
(self::FIELD_TOPIC);
104
if
(is_null($data)) {
105
return
null
;
106
}
107
$this->topic = (string) $data;
108
}
109
110
return
$this->topic
;
111
}
112
113
117
public
function
setProjectId
(?
string
$projectId
): void
118
{
119
$this->projectId =
$projectId
;
120
}
121
125
public
function
setTopic
(?
string
$topic
): void
126
{
127
$this->topic =
$topic
;
128
}
129
}
Commercetools\Api\Models\Subscription\GoogleCloudPubSubDestinationModel
Definition:
GoogleCloudPubSubDestinationModel.php:21
Commercetools\Api\Models\Subscription\GoogleCloudPubSubDestinationModel\$projectId
$projectId
Definition:
GoogleCloudPubSubDestinationModel.php:33
Commercetools\Api\Models\Subscription\GoogleCloudPubSubDestinationModel\getProjectId
getProjectId()
Definition:
GoogleCloudPubSubDestinationModel.php:79
Commercetools\Api\Models\Subscription\GoogleCloudPubSubDestinationModel\__construct
__construct(?string $projectId=null, ?string $topic=null, ?string $type=null)
Definition:
GoogleCloudPubSubDestinationModel.php:45
Commercetools\Api\Models\Subscription\GoogleCloudPubSubDestinationModel\getTopic
getTopic()
Definition:
GoogleCloudPubSubDestinationModel.php:99
Commercetools\Api\Models\Subscription\GoogleCloudPubSubDestinationModel\getType
getType()
Definition:
GoogleCloudPubSubDestinationModel.php:59
Commercetools\Api\Models\Subscription\GoogleCloudPubSubDestinationModel\setProjectId
setProjectId(?string $projectId)
Definition:
GoogleCloudPubSubDestinationModel.php:117
Commercetools\Api\Models\Subscription\GoogleCloudPubSubDestinationModel\setTopic
setTopic(?string $topic)
Definition:
GoogleCloudPubSubDestinationModel.php:125
Commercetools\Api\Models\Subscription\GoogleCloudPubSubDestinationModel\$topic
$topic
Definition:
GoogleCloudPubSubDestinationModel.php:39
Commercetools\Api\Models\Subscription\GoogleCloudPubSubDestinationModel\$type
$type
Definition:
GoogleCloudPubSubDestinationModel.php:27
Commercetools\Api\Models\Subscription\GoogleCloudPubSubDestinationModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition:
GoogleCloudPubSubDestinationModel.php:22
Commercetools\Base\BaseJsonObject\raw
raw(string $field)
Definition:
BaseJsonObject.php:57
Commercetools\Base\DateTimeImmutableCollection
Definition:
DateTimeImmutableCollection.php:21
Commercetools\Base\JsonObjectModel
Definition:
JsonObjectModel.php:15
Commercetools\Base\MapperFactory
Definition:
MapperFactory.php:16
Commercetools\Api\Models\Subscription\GoogleCloudPubSubDestination
Definition:
GoogleCloudPubSubDestination.php:15
Commercetools\Base\JsonObject
Definition:
JsonObject.php:15
Commercetools\Api\Models\Subscription
Definition:
AzureEventGridDestination.php:9
Generated by
1.9.1