commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
McpServerDraftBuilder.php
1<?php
2
3declare(strict_types=1);
10
18use stdClass;
19
23final class McpServerDraftBuilder implements Builder
24{
29 private $key;
30
35 private $name;
36
41 private $description;
42
47 private $authenticationMode;
48
53 private $state;
54
59 private $mcpServer;
60
67 public function getKey()
68 {
69 return $this->key;
70 }
71
78 public function getName()
79 {
80 return $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name;
81 }
82
89 public function getDescription()
90 {
91 return $this->description instanceof LocalizedStringBuilder ? $this->description->build() : $this->description;
92 }
93
100 public function getAuthenticationMode()
101 {
102 return $this->authenticationMode;
103 }
104
111 public function getState()
112 {
113 return $this->state;
114 }
115
122 public function getMcpServer()
123 {
124 return $this->mcpServer instanceof McpServerConfigDraftBuilder ? $this->mcpServer->build() : $this->mcpServer;
125 }
126
131 public function withKey(?string $key)
132 {
133 $this->key = $key;
134
135 return $this;
136 }
137
142 public function withName(?LocalizedString $name)
143 {
144 $this->name = $name;
145
146 return $this;
147 }
148
153 public function withDescription(?LocalizedString $description)
154 {
155 $this->description = $description;
156
157 return $this;
158 }
159
164 public function withAuthenticationMode(?string $authenticationMode)
165 {
166 $this->authenticationMode = $authenticationMode;
167
168 return $this;
169 }
170
175 public function withState(?string $state)
176 {
177 $this->state = $state;
178
179 return $this;
180 }
181
186 public function withMcpServer(?McpServerConfigDraft $mcpServer)
187 {
188 $this->mcpServer = $mcpServer;
189
190 return $this;
191 }
192
198 {
199 $this->name = $name;
200
201 return $this;
202 }
203
208 public function withDescriptionBuilder(?LocalizedStringBuilder $description)
209 {
210 $this->description = $description;
211
212 return $this;
213 }
214
220 {
221 $this->mcpServer = $mcpServer;
222
223 return $this;
224 }
225
226 public function build(): McpServerDraft
227 {
228 return new McpServerDraftModel(
229 $this->key,
230 $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name,
231 $this->description instanceof LocalizedStringBuilder ? $this->description->build() : $this->description,
232 $this->authenticationMode,
233 $this->state,
234 $this->mcpServer instanceof McpServerConfigDraftBuilder ? $this->mcpServer->build() : $this->mcpServer
235 );
236 }
237
238 public static function of(): McpServerDraftBuilder
239 {
240 return new self();
241 }
242}
withMcpServerBuilder(?McpServerConfigDraftBuilder $mcpServer)