Skip to content

Commit c090391

Browse files
committed
build(codegen): updating SDK
1 parent 831827f commit c090391

14 files changed

+1379
-0
lines changed

changes.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,9 @@
297297
- added type `PaymentSetMethodInfoCustomTypeAction`
298298
- added type `PaymentSetMethodInfoInterfaceAccountAction`
299299
- added type `PaymentSetMethodInfoTokenAction`
300+
- added type `ProductSearchFacetResultStats`
301+
- added type `ProductSearchFacetStatsExpression`
302+
- added type `ProductSearchFacetStatsValue`
300303
- added type `ProductTailoringSetProductAttributeAction`
301304
- added type `AttributeLevelEnum`
302305
- added type `ProductSetProductAttributeAction`
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
/**
5+
* This file has been auto generated
6+
* Do not change it.
7+
*/
8+
9+
namespace Commercetools\Api\Models\ProductSearch;
10+
11+
use Commercetools\Base\DateTimeImmutableCollection;
12+
use Commercetools\Base\JsonObject;
13+
14+
interface ProductSearchFacetResultStats extends ProductSearchFacetResult
15+
{
16+
public const FIELD_MIN = 'min';
17+
public const FIELD_MAX = 'max';
18+
public const FIELD_MEAN = 'mean';
19+
public const FIELD_SUM = 'sum';
20+
public const FIELD_COUNT = 'count';
21+
22+
/**
23+
* <p>The minimum value of the field, scoped to the faceted results.</p>
24+
*
25+
26+
* @return null|mixed
27+
*/
28+
public function getMin();
29+
30+
/**
31+
* <p>The maximum value of the field, scoped to the faceted results.</p>
32+
*
33+
34+
* @return null|mixed
35+
*/
36+
public function getMax();
37+
38+
/**
39+
* <p>The average value of the field calculated as <code>sum</code> / <code>count</code>.</p>
40+
* <p>Only returned for number fields.</p>
41+
*
42+
43+
* @return null|mixed
44+
*/
45+
public function getMean();
46+
47+
/**
48+
* <p>The sum of values of the field that match the <a href="ctp:api:type:ProductSearchFacetStatsExpression">facet expression</a>.</p>
49+
* <p>Only returned for number fields.</p>
50+
*
51+
52+
* @return null|mixed
53+
*/
54+
public function getSum();
55+
56+
/**
57+
* <p>The total number of values counted that match the facet expression.</p>
58+
*
59+
60+
* @return null|int
61+
*/
62+
public function getCount();
63+
64+
/**
65+
* @param mixed $min
66+
*/
67+
public function setMin($min): void;
68+
69+
/**
70+
* @param mixed $max
71+
*/
72+
public function setMax($max): void;
73+
74+
/**
75+
* @param mixed $mean
76+
*/
77+
public function setMean($mean): void;
78+
79+
/**
80+
* @param mixed $sum
81+
*/
82+
public function setSum($sum): void;
83+
84+
/**
85+
* @param ?int $count
86+
*/
87+
public function setCount(?int $count): void;
88+
}
Lines changed: 210 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,210 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
/**
5+
* This file has been auto generated
6+
* Do not change it.
7+
*/
8+
9+
namespace Commercetools\Api\Models\ProductSearch;
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 stdClass;
17+
18+
/**
19+
* @implements Builder<ProductSearchFacetResultStats>
20+
*/
21+
final class ProductSearchFacetResultStatsBuilder implements Builder
22+
{
23+
/**
24+
25+
* @var ?string
26+
*/
27+
private $name;
28+
29+
/**
30+
31+
* @var null|mixed|mixed
32+
*/
33+
private $min;
34+
35+
/**
36+
37+
* @var null|mixed|mixed
38+
*/
39+
private $max;
40+
41+
/**
42+
43+
* @var null|mixed|mixed
44+
*/
45+
private $mean;
46+
47+
/**
48+
49+
* @var null|mixed|mixed
50+
*/
51+
private $sum;
52+
53+
/**
54+
55+
* @var ?int
56+
*/
57+
private $count;
58+
59+
/**
60+
* <p>Name of the facet.</p>
61+
*
62+
63+
* @return null|string
64+
*/
65+
public function getName()
66+
{
67+
return $this->name;
68+
}
69+
70+
/**
71+
* <p>The minimum value of the field, scoped to the faceted results.</p>
72+
*
73+
74+
* @return null|mixed
75+
*/
76+
public function getMin()
77+
{
78+
return $this->min;
79+
}
80+
81+
/**
82+
* <p>The maximum value of the field, scoped to the faceted results.</p>
83+
*
84+
85+
* @return null|mixed
86+
*/
87+
public function getMax()
88+
{
89+
return $this->max;
90+
}
91+
92+
/**
93+
* <p>The average value of the field calculated as <code>sum</code> / <code>count</code>.</p>
94+
* <p>Only returned for number fields.</p>
95+
*
96+
97+
* @return null|mixed
98+
*/
99+
public function getMean()
100+
{
101+
return $this->mean;
102+
}
103+
104+
/**
105+
* <p>The sum of values of the field that match the <a href="ctp:api:type:ProductSearchFacetStatsExpression">facet expression</a>.</p>
106+
* <p>Only returned for number fields.</p>
107+
*
108+
109+
* @return null|mixed
110+
*/
111+
public function getSum()
112+
{
113+
return $this->sum;
114+
}
115+
116+
/**
117+
* <p>The total number of values counted that match the facet expression.</p>
118+
*
119+
120+
* @return null|int
121+
*/
122+
public function getCount()
123+
{
124+
return $this->count;
125+
}
126+
127+
/**
128+
* @param ?string $name
129+
* @return $this
130+
*/
131+
public function withName(?string $name)
132+
{
133+
$this->name = $name;
134+
135+
return $this;
136+
}
137+
138+
/**
139+
* @param mixed $min
140+
* @return $this
141+
*/
142+
public function withMin($min)
143+
{
144+
$this->min = $min;
145+
146+
return $this;
147+
}
148+
149+
/**
150+
* @param mixed $max
151+
* @return $this
152+
*/
153+
public function withMax($max)
154+
{
155+
$this->max = $max;
156+
157+
return $this;
158+
}
159+
160+
/**
161+
* @param mixed $mean
162+
* @return $this
163+
*/
164+
public function withMean($mean)
165+
{
166+
$this->mean = $mean;
167+
168+
return $this;
169+
}
170+
171+
/**
172+
* @param mixed $sum
173+
* @return $this
174+
*/
175+
public function withSum($sum)
176+
{
177+
$this->sum = $sum;
178+
179+
return $this;
180+
}
181+
182+
/**
183+
* @param ?int $count
184+
* @return $this
185+
*/
186+
public function withCount(?int $count)
187+
{
188+
$this->count = $count;
189+
190+
return $this;
191+
}
192+
193+
194+
public function build(): ProductSearchFacetResultStats
195+
{
196+
return new ProductSearchFacetResultStatsModel(
197+
$this->name,
198+
$this->min,
199+
$this->max,
200+
$this->mean,
201+
$this->sum,
202+
$this->count
203+
);
204+
}
205+
206+
public static function of(): ProductSearchFacetResultStatsBuilder
207+
{
208+
return new self();
209+
}
210+
}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
/**
5+
* This file has been auto generated
6+
* Do not change it.
7+
*/
8+
9+
namespace Commercetools\Api\Models\ProductSearch;
10+
11+
use Commercetools\Api\Models\ProductSearch\ProductSearchFacetResultCollection;
12+
use Commercetools\Exception\InvalidArgumentException;
13+
use stdClass;
14+
15+
/**
16+
* @extends ProductSearchFacetResultCollection<ProductSearchFacetResultStats>
17+
* @method ProductSearchFacetResultStats current()
18+
* @method ProductSearchFacetResultStats end()
19+
* @method ProductSearchFacetResultStats at($offset)
20+
*/
21+
class ProductSearchFacetResultStatsCollection extends ProductSearchFacetResultCollection
22+
{
23+
/**
24+
* @psalm-assert ProductSearchFacetResultStats $value
25+
* @psalm-param ProductSearchFacetResultStats|stdClass $value
26+
* @throws InvalidArgumentException
27+
*
28+
* @return ProductSearchFacetResultStatsCollection
29+
*/
30+
public function add($value)
31+
{
32+
if (!$value instanceof ProductSearchFacetResultStats) {
33+
throw new InvalidArgumentException();
34+
}
35+
$this->store($value);
36+
37+
return $this;
38+
}
39+
40+
/**
41+
* @psalm-return callable(int):?ProductSearchFacetResultStats
42+
*/
43+
protected function mapper()
44+
{
45+
return function (?int $index): ?ProductSearchFacetResultStats {
46+
$data = $this->get($index);
47+
if ($data instanceof stdClass) {
48+
/** @var ProductSearchFacetResultStats $data */
49+
$data = ProductSearchFacetResultStatsModel::of($data);
50+
$this->set($data, $index);
51+
}
52+
53+
return $data;
54+
};
55+
}
56+
}

0 commit comments

Comments
 (0)