commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
lib
commercetools-api
src
Models
Subscription
CloudEventsPayloadBuilder.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\Subscription
;
10
11
use
Commercetools\Base\Builder
;
12
use
Commercetools\Base\DateTimeImmutableCollection
;
13
use
Commercetools\Base\JsonObject
;
14
use
Commercetools\Base\JsonObjectModel
;
15
use
Commercetools\Base\MapperFactory
;
16
use DateTimeImmutable;
17
use stdClass;
18
22
final
class
CloudEventsPayloadBuilder
implements
Builder
23
{
28
private
$specversion;
29
34
private
$id;
35
40
private
$type;
41
46
private
$source;
47
52
private
$subject;
53
58
private
$time;
59
64
private
$sequence;
65
70
private
$sequencetype;
71
76
private
$dataref;
77
82
private
$data;
83
90
public
function
getSpecversion
()
91
{
92
return
$this->specversion;
93
}
94
101
public
function
getId
()
102
{
103
return
$this->id;
104
}
105
113
public
function
getType
()
114
{
115
return
$this->type;
116
}
117
124
public
function
getSource
()
125
{
126
return
$this->source;
127
}
128
135
public
function
getSubject
()
136
{
137
return
$this->subject;
138
}
139
146
public
function
getTime
()
147
{
148
return
$this->time;
149
}
150
157
public
function
getSequence
()
158
{
159
return
$this->sequence;
160
}
161
168
public
function
getSequencetype
()
169
{
170
return
$this->sequencetype;
171
}
172
179
public
function
getDataref
()
180
{
181
return
$this->dataref;
182
}
183
190
public
function
getData
()
191
{
192
return
$this->data instanceof
DeliveryPayloadBuilder
? $this->data->
build
() : $this->data;
193
}
194
199
public
function
withSpecversion
(?
string
$specversion)
200
{
201
$this->specversion = $specversion;
202
203
return
$this;
204
}
205
210
public
function
withId
(?
string
$id)
211
{
212
$this->
id
= $id;
213
214
return
$this;
215
}
216
221
public
function
withType
(?
string
$type)
222
{
223
$this->type = $type;
224
225
return
$this;
226
}
227
232
public
function
withSource
(?
string
$source)
233
{
234
$this->source = $source;
235
236
return
$this;
237
}
238
243
public
function
withSubject
(?
string
$subject)
244
{
245
$this->subject = $subject;
246
247
return
$this;
248
}
249
254
public
function
withTime
(?DateTimeImmutable $time)
255
{
256
$this->time = $time;
257
258
return
$this;
259
}
260
265
public
function
withSequence
(?
string
$sequence)
266
{
267
$this->sequence = $sequence;
268
269
return
$this;
270
}
271
276
public
function
withSequencetype
(?
string
$sequencetype)
277
{
278
$this->sequencetype = $sequencetype;
279
280
return
$this;
281
}
282
287
public
function
withDataref
(?
string
$dataref)
288
{
289
$this->dataref = $dataref;
290
291
return
$this;
292
}
293
298
public
function
withData
(?
DeliveryPayload
$data)
299
{
300
$this->data = $data;
301
302
return
$this;
303
}
304
309
public
function
withDataBuilder
(?
DeliveryPayloadBuilder
$data)
310
{
311
$this->data = $data;
312
313
return
$this;
314
}
315
316
public
function
build
():
CloudEventsPayload
317
{
318
return
new
CloudEventsPayloadModel
(
319
$this->specversion,
320
$this->
id
,
321
$this->type,
322
$this->source,
323
$this->subject,
324
$this->time,
325
$this->sequence,
326
$this->sequencetype,
327
$this->dataref,
328
$this->data instanceof
DeliveryPayloadBuilder
? $this->data->
build
() : $this->data
329
);
330
}
331
332
public
static
function
of
():
CloudEventsPayloadBuilder
333
{
334
return
new
self
();
335
}
336
}
Commercetools\Api\Models\Subscription\CloudEventsPayloadBuilder
Definition
CloudEventsPayloadBuilder.php:23
Commercetools\Api\Models\Subscription\CloudEventsPayloadBuilder\getSequencetype
getSequencetype()
Definition
CloudEventsPayloadBuilder.php:168
Commercetools\Api\Models\Subscription\CloudEventsPayloadBuilder\withDataBuilder
withDataBuilder(?DeliveryPayloadBuilder $data)
Definition
CloudEventsPayloadBuilder.php:309
Commercetools\Api\Models\Subscription\CloudEventsPayloadBuilder\of
static of()
Definition
CloudEventsPayloadBuilder.php:332
Commercetools\Api\Models\Subscription\CloudEventsPayloadBuilder\withSequencetype
withSequencetype(?string $sequencetype)
Definition
CloudEventsPayloadBuilder.php:276
Commercetools\Api\Models\Subscription\CloudEventsPayloadBuilder\getSequence
getSequence()
Definition
CloudEventsPayloadBuilder.php:157
Commercetools\Api\Models\Subscription\CloudEventsPayloadBuilder\withId
withId(?string $id)
Definition
CloudEventsPayloadBuilder.php:210
Commercetools\Api\Models\Subscription\CloudEventsPayloadBuilder\getDataref
getDataref()
Definition
CloudEventsPayloadBuilder.php:179
Commercetools\Api\Models\Subscription\CloudEventsPayloadBuilder\getSubject
getSubject()
Definition
CloudEventsPayloadBuilder.php:135
Commercetools\Api\Models\Subscription\CloudEventsPayloadBuilder\withDataref
withDataref(?string $dataref)
Definition
CloudEventsPayloadBuilder.php:287
Commercetools\Api\Models\Subscription\CloudEventsPayloadBuilder\withSubject
withSubject(?string $subject)
Definition
CloudEventsPayloadBuilder.php:243
Commercetools\Api\Models\Subscription\CloudEventsPayloadBuilder\getData
getData()
Definition
CloudEventsPayloadBuilder.php:190
Commercetools\Api\Models\Subscription\CloudEventsPayloadBuilder\withSpecversion
withSpecversion(?string $specversion)
Definition
CloudEventsPayloadBuilder.php:199
Commercetools\Api\Models\Subscription\CloudEventsPayloadBuilder\getId
getId()
Definition
CloudEventsPayloadBuilder.php:101
Commercetools\Api\Models\Subscription\CloudEventsPayloadBuilder\withSource
withSource(?string $source)
Definition
CloudEventsPayloadBuilder.php:232
Commercetools\Api\Models\Subscription\CloudEventsPayloadBuilder\getType
getType()
Definition
CloudEventsPayloadBuilder.php:113
Commercetools\Api\Models\Subscription\CloudEventsPayloadBuilder\withSequence
withSequence(?string $sequence)
Definition
CloudEventsPayloadBuilder.php:265
Commercetools\Api\Models\Subscription\CloudEventsPayloadBuilder\getSpecversion
getSpecversion()
Definition
CloudEventsPayloadBuilder.php:90
Commercetools\Api\Models\Subscription\CloudEventsPayloadBuilder\getTime
getTime()
Definition
CloudEventsPayloadBuilder.php:146
Commercetools\Api\Models\Subscription\CloudEventsPayloadBuilder\build
build()
Definition
CloudEventsPayloadBuilder.php:316
Commercetools\Api\Models\Subscription\CloudEventsPayloadBuilder\withData
withData(?DeliveryPayload $data)
Definition
CloudEventsPayloadBuilder.php:298
Commercetools\Api\Models\Subscription\CloudEventsPayloadBuilder\withTime
withTime(?DateTimeImmutable $time)
Definition
CloudEventsPayloadBuilder.php:254
Commercetools\Api\Models\Subscription\CloudEventsPayloadBuilder\getSource
getSource()
Definition
CloudEventsPayloadBuilder.php:124
Commercetools\Api\Models\Subscription\CloudEventsPayloadBuilder\withType
withType(?string $type)
Definition
CloudEventsPayloadBuilder.php:221
Commercetools\Api\Models\Subscription\CloudEventsPayloadModel
Definition
CloudEventsPayloadModel.php:22
Commercetools\Api\Models\Subscription\DeliveryPayloadBuilder
Definition
DeliveryPayloadBuilder.php:26
Commercetools\Api\Models\Subscription\DeliveryPayloadBuilder\build
build()
Definition
DeliveryPayloadBuilder.php:134
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\CloudEventsPayload
Definition
CloudEventsPayload.php:16
Commercetools\Api\Models\Subscription\DeliveryPayload
Definition
DeliveryPayload.php:17
Commercetools\Base\Builder
Definition
Builder.php:16
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\Api\Models\Subscription
Definition
AzureEventGridDestination.php:9
Generated by
1.9.8