commercetools-sdk-php-v2  master
The platform, import-api and ml-api PHP sdks generated from our api reference.
ImportOperationBuilder.php
1 <?php
2 
3 declare(strict_types=1);
10 
18 use DateTimeImmutable;
19 use stdClass;
20 
24 final class ImportOperationBuilder implements Builder
25 {
30  private $version;
31 
36  private $importContainerKey;
37 
42  private $resourceKey;
43 
48  private $id;
49 
54  private $state;
55 
60  private $resourceVersion;
61 
66  private $errors;
67 
72  private $unresolvedReferences;
73 
78  private $createdAt;
79 
84  private $lastModifiedAt;
85 
90  private $expiresAt;
91 
98  public function getVersion()
99  {
100  return $this->version;
101  }
102 
109  public function getImportContainerKey()
110  {
111  return $this->importContainerKey;
112  }
113 
120  public function getResourceKey()
121  {
122  return $this->resourceKey;
123  }
124 
131  public function getId()
132  {
133  return $this->id;
134  }
135 
142  public function getState()
143  {
144  return $this->state;
145  }
146 
153  public function getResourceVersion()
154  {
155  return $this->resourceVersion;
156  }
157 
164  public function getErrors()
165  {
166  return $this->errors;
167  }
168 
175  public function getUnresolvedReferences()
176  {
177  return $this->unresolvedReferences;
178  }
179 
186  public function getCreatedAt()
187  {
188  return $this->createdAt;
189  }
190 
197  public function getLastModifiedAt()
198  {
199  return $this->lastModifiedAt;
200  }
201 
208  public function getExpiresAt()
209  {
210  return $this->expiresAt;
211  }
212 
217  public function withVersion(?int $version)
218  {
219  $this->version = $version;
220 
221  return $this;
222  }
223 
228  public function withImportContainerKey(?string $importContainerKey)
229  {
230  $this->importContainerKey = $importContainerKey;
231 
232  return $this;
233  }
234 
239  public function withResourceKey(?string $resourceKey)
240  {
241  $this->resourceKey = $resourceKey;
242 
243  return $this;
244  }
245 
250  public function withId(?string $id)
251  {
252  $this->id = $id;
253 
254  return $this;
255  }
256 
261  public function withState(?string $state)
262  {
263  $this->state = $state;
264 
265  return $this;
266  }
267 
272  public function withResourceVersion(?int $resourceVersion)
273  {
274  $this->resourceVersion = $resourceVersion;
275 
276  return $this;
277  }
278 
283  public function withErrors(?ErrorObjectCollection $errors)
284  {
285  $this->errors = $errors;
286 
287  return $this;
288  }
289 
294  public function withUnresolvedReferences(?UnresolvedReferencesCollection $unresolvedReferences)
295  {
296  $this->unresolvedReferences = $unresolvedReferences;
297 
298  return $this;
299  }
300 
305  public function withCreatedAt(?DateTimeImmutable $createdAt)
306  {
307  $this->createdAt = $createdAt;
308 
309  return $this;
310  }
311 
316  public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt)
317  {
318  $this->lastModifiedAt = $lastModifiedAt;
319 
320  return $this;
321  }
322 
327  public function withExpiresAt(?DateTimeImmutable $expiresAt)
328  {
329  $this->expiresAt = $expiresAt;
330 
331  return $this;
332  }
333 
334 
335  public function build(): ImportOperation
336  {
337  return new ImportOperationModel(
338  $this->version,
339  $this->importContainerKey,
340  $this->resourceKey,
341  $this->id,
342  $this->state,
343  $this->resourceVersion,
344  $this->errors,
345  $this->unresolvedReferences,
346  $this->createdAt,
347  $this->lastModifiedAt,
348  $this->expiresAt
349  );
350  }
351 
352  public static function of(): ImportOperationBuilder
353  {
354  return new self();
355  }
356 }
withUnresolvedReferences(?UnresolvedReferencesCollection $unresolvedReferences)