commercetools-sdk-php-v2  master
The platform, import-api and ml-api PHP sdks generated from our api reference.
ImportSummaryBuilder.php
1 <?php
2 
3 declare(strict_types=1);
10 
16 use stdClass;
17 
21 final class ImportSummaryBuilder implements Builder
22 {
27  private $states;
28 
33  private $total;
34 
41  public function getStates()
42  {
43  return $this->states instanceof OperationStatesBuilder ? $this->states->build() : $this->states;
44  }
45 
52  public function getTotal()
53  {
54  return $this->total;
55  }
56 
61  public function withStates(?OperationStates $states)
62  {
63  $this->states = $states;
64 
65  return $this;
66  }
67 
72  public function withTotal(?int $total)
73  {
74  $this->total = $total;
75 
76  return $this;
77  }
78 
83  public function withStatesBuilder(?OperationStatesBuilder $states)
84  {
85  $this->states = $states;
86 
87  return $this;
88  }
89 
90  public function build(): ImportSummary
91  {
92  return new ImportSummaryModel(
93  $this->states instanceof OperationStatesBuilder ? $this->states->build() : $this->states,
94  $this->total
95  );
96  }
97 
98  public static function of(): ImportSummaryBuilder
99  {
100  return new self();
101  }
102 }