commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
McpServerBuilder.php
1<?php
2
3declare(strict_types=1);
10
24use DateTimeImmutable;
25use stdClass;
26
30final class McpServerBuilder implements Builder
31{
36 private $id;
37
42 private $version;
43
48 private $createdAt;
49
54 private $lastModifiedAt;
55
60 private $lastModifiedBy;
61
66 private $createdBy;
67
72 private $key;
73
78 private $name;
79
84 private $description;
85
90 private $authenticationMode;
91
96 private $state;
97
102 private $mcpServer;
103
110 public function getId()
111 {
112 return $this->id;
113 }
114
121 public function getVersion()
122 {
123 return $this->version;
124 }
125
132 public function getCreatedAt()
133 {
134 return $this->createdAt;
135 }
136
143 public function getLastModifiedAt()
144 {
145 return $this->lastModifiedAt;
146 }
147
154 public function getLastModifiedBy()
155 {
156 return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy;
157 }
158
165 public function getCreatedBy()
166 {
167 return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy;
168 }
169
176 public function getKey()
177 {
178 return $this->key;
179 }
180
187 public function getName()
188 {
189 return $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name;
190 }
191
198 public function getDescription()
199 {
200 return $this->description instanceof LocalizedStringBuilder ? $this->description->build() : $this->description;
201 }
202
209 public function getAuthenticationMode()
210 {
211 return $this->authenticationMode;
212 }
213
220 public function getState()
221 {
222 return $this->state;
223 }
224
231 public function getMcpServer()
232 {
233 return $this->mcpServer instanceof McpServerConfigBuilder ? $this->mcpServer->build() : $this->mcpServer;
234 }
235
240 public function withId(?string $id)
241 {
242 $this->id = $id;
243
244 return $this;
245 }
246
251 public function withVersion(?int $version)
252 {
253 $this->version = $version;
254
255 return $this;
256 }
257
262 public function withCreatedAt(?DateTimeImmutable $createdAt)
263 {
264 $this->createdAt = $createdAt;
265
266 return $this;
267 }
268
273 public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt)
274 {
275 $this->lastModifiedAt = $lastModifiedAt;
276
277 return $this;
278 }
279
284 public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy)
285 {
286 $this->lastModifiedBy = $lastModifiedBy;
287
288 return $this;
289 }
290
295 public function withCreatedBy(?CreatedBy $createdBy)
296 {
297 $this->createdBy = $createdBy;
298
299 return $this;
300 }
301
306 public function withKey(?string $key)
307 {
308 $this->key = $key;
309
310 return $this;
311 }
312
317 public function withName(?LocalizedString $name)
318 {
319 $this->name = $name;
320
321 return $this;
322 }
323
328 public function withDescription(?LocalizedString $description)
329 {
330 $this->description = $description;
331
332 return $this;
333 }
334
339 public function withAuthenticationMode(?string $authenticationMode)
340 {
341 $this->authenticationMode = $authenticationMode;
342
343 return $this;
344 }
345
350 public function withState(?string $state)
351 {
352 $this->state = $state;
353
354 return $this;
355 }
356
361 public function withMcpServer(?McpServerConfig $mcpServer)
362 {
363 $this->mcpServer = $mcpServer;
364
365 return $this;
366 }
367
372 public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy)
373 {
374 $this->lastModifiedBy = $lastModifiedBy;
375
376 return $this;
377 }
378
383 public function withCreatedByBuilder(?CreatedByBuilder $createdBy)
384 {
385 $this->createdBy = $createdBy;
386
387 return $this;
388 }
389
395 {
396 $this->name = $name;
397
398 return $this;
399 }
400
405 public function withDescriptionBuilder(?LocalizedStringBuilder $description)
406 {
407 $this->description = $description;
408
409 return $this;
410 }
411
416 public function withMcpServerBuilder(?McpServerConfigBuilder $mcpServer)
417 {
418 $this->mcpServer = $mcpServer;
419
420 return $this;
421 }
422
423 public function build(): McpServer
424 {
425 return new McpServerModel(
426 $this->id,
427 $this->version,
428 $this->createdAt,
429 $this->lastModifiedAt,
430 $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy,
431 $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy,
432 $this->key,
433 $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name,
434 $this->description instanceof LocalizedStringBuilder ? $this->description->build() : $this->description,
435 $this->authenticationMode,
436 $this->state,
437 $this->mcpServer instanceof McpServerConfigBuilder ? $this->mcpServer->build() : $this->mcpServer
438 );
439 }
440
441 public static function of(): McpServerBuilder
442 {
443 return new self();
444 }
445}
withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy)
withLastModifiedAt(?DateTimeImmutable $lastModifiedAt)
withDescriptionBuilder(?LocalizedStringBuilder $description)
withMcpServerBuilder(?McpServerConfigBuilder $mcpServer)