From c090391a558c4cf64ecce3805b1f18cf5b54f0b1 Mon Sep 17 00:00:00 2001 From: "ct-sdks[bot]" <153784748+ct-sdks[bot]@users.noreply.github.com> Date: Mon, 14 Jul 2025 16:24:23 +0000 Subject: [PATCH] build(codegen): updating SDK --- changes.md | 3 + .../ProductSearchFacetResultStats.php | 88 +++++++ .../ProductSearchFacetResultStatsBuilder.php | 210 +++++++++++++++ ...roductSearchFacetResultStatsCollection.php | 56 ++++ .../ProductSearchFacetResultStatsModel.php | 248 ++++++++++++++++++ .../ProductSearchFacetStatsExpression.php | 30 +++ ...oductSearchFacetStatsExpressionBuilder.php | 73 ++++++ ...ctSearchFacetStatsExpressionCollection.php | 56 ++++ ...ProductSearchFacetStatsExpressionModel.php | 67 +++++ .../ProductSearchFacetStatsValue.php | 87 ++++++ .../ProductSearchFacetStatsValueBuilder.php | 191 ++++++++++++++ ...ProductSearchFacetStatsValueCollection.php | 56 ++++ .../ProductSearchFacetStatsValueModel.php | 213 +++++++++++++++ references.txt | 1 + 14 files changed, 1379 insertions(+) create mode 100644 lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetResultStats.php create mode 100644 lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetResultStatsBuilder.php create mode 100644 lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetResultStatsCollection.php create mode 100644 lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetResultStatsModel.php create mode 100644 lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetStatsExpression.php create mode 100644 lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetStatsExpressionBuilder.php create mode 100644 lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetStatsExpressionCollection.php create mode 100644 lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetStatsExpressionModel.php create mode 100644 lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetStatsValue.php create mode 100644 lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetStatsValueBuilder.php create mode 100644 lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetStatsValueCollection.php create mode 100644 lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetStatsValueModel.php diff --git a/changes.md b/changes.md index 90ff776cac8..370f019a8ba 100644 --- a/changes.md +++ b/changes.md @@ -297,6 +297,9 @@ - added type `PaymentSetMethodInfoCustomTypeAction` - added type `PaymentSetMethodInfoInterfaceAccountAction` - added type `PaymentSetMethodInfoTokenAction` +- added type `ProductSearchFacetResultStats` +- added type `ProductSearchFacetStatsExpression` +- added type `ProductSearchFacetStatsValue` - added type `ProductTailoringSetProductAttributeAction` - added type `AttributeLevelEnum` - added type `ProductSetProductAttributeAction` diff --git a/lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetResultStats.php b/lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetResultStats.php new file mode 100644 index 00000000000..2932ddc1d16 --- /dev/null +++ b/lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetResultStats.php @@ -0,0 +1,88 @@ +The minimum value of the field, scoped to the faceted results.
+ * + + * @return null|mixed + */ + public function getMin(); + + /** + *The maximum value of the field, scoped to the faceted results.
+ * + + * @return null|mixed + */ + public function getMax(); + + /** + *The average value of the field calculated as sum / count.
Only returned for number fields.
+ * + + * @return null|mixed + */ + public function getMean(); + + /** + *The sum of values of the field that match the facet expression.
+ *Only returned for number fields.
+ * + + * @return null|mixed + */ + public function getSum(); + + /** + *The total number of values counted that match the facet expression.
+ * + + * @return null|int + */ + public function getCount(); + + /** + * @param mixed $min + */ + public function setMin($min): void; + + /** + * @param mixed $max + */ + public function setMax($max): void; + + /** + * @param mixed $mean + */ + public function setMean($mean): void; + + /** + * @param mixed $sum + */ + public function setSum($sum): void; + + /** + * @param ?int $count + */ + public function setCount(?int $count): void; +} diff --git a/lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetResultStatsBuilder.php b/lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetResultStatsBuilder.php new file mode 100644 index 00000000000..d13a0fdeaa3 --- /dev/null +++ b/lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetResultStatsBuilder.php @@ -0,0 +1,210 @@ + + */ +final class ProductSearchFacetResultStatsBuilder implements Builder +{ + /** + + * @var ?string + */ + private $name; + + /** + + * @var null|mixed|mixed + */ + private $min; + + /** + + * @var null|mixed|mixed + */ + private $max; + + /** + + * @var null|mixed|mixed + */ + private $mean; + + /** + + * @var null|mixed|mixed + */ + private $sum; + + /** + + * @var ?int + */ + private $count; + + /** + *Name of the facet.
+ * + + * @return null|string + */ + public function getName() + { + return $this->name; + } + + /** + *The minimum value of the field, scoped to the faceted results.
+ * + + * @return null|mixed + */ + public function getMin() + { + return $this->min; + } + + /** + *The maximum value of the field, scoped to the faceted results.
+ * + + * @return null|mixed + */ + public function getMax() + { + return $this->max; + } + + /** + *The average value of the field calculated as sum / count.
Only returned for number fields.
+ * + + * @return null|mixed + */ + public function getMean() + { + return $this->mean; + } + + /** + *The sum of values of the field that match the facet expression.
+ *Only returned for number fields.
+ * + + * @return null|mixed + */ + public function getSum() + { + return $this->sum; + } + + /** + *The total number of values counted that match the facet expression.
+ * + + * @return null|int + */ + public function getCount() + { + return $this->count; + } + + /** + * @param ?string $name + * @return $this + */ + public function withName(?string $name) + { + $this->name = $name; + + return $this; + } + + /** + * @param mixed $min + * @return $this + */ + public function withMin($min) + { + $this->min = $min; + + return $this; + } + + /** + * @param mixed $max + * @return $this + */ + public function withMax($max) + { + $this->max = $max; + + return $this; + } + + /** + * @param mixed $mean + * @return $this + */ + public function withMean($mean) + { + $this->mean = $mean; + + return $this; + } + + /** + * @param mixed $sum + * @return $this + */ + public function withSum($sum) + { + $this->sum = $sum; + + return $this; + } + + /** + * @param ?int $count + * @return $this + */ + public function withCount(?int $count) + { + $this->count = $count; + + return $this; + } + + + public function build(): ProductSearchFacetResultStats + { + return new ProductSearchFacetResultStatsModel( + $this->name, + $this->min, + $this->max, + $this->mean, + $this->sum, + $this->count + ); + } + + public static function of(): ProductSearchFacetResultStatsBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetResultStatsCollection.php b/lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetResultStatsCollection.php new file mode 100644 index 00000000000..f28aa28ebae --- /dev/null +++ b/lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetResultStatsCollection.php @@ -0,0 +1,56 @@ + + * @method ProductSearchFacetResultStats current() + * @method ProductSearchFacetResultStats end() + * @method ProductSearchFacetResultStats at($offset) + */ +class ProductSearchFacetResultStatsCollection extends ProductSearchFacetResultCollection +{ + /** + * @psalm-assert ProductSearchFacetResultStats $value + * @psalm-param ProductSearchFacetResultStats|stdClass $value + * @throws InvalidArgumentException + * + * @return ProductSearchFacetResultStatsCollection + */ + public function add($value) + { + if (!$value instanceof ProductSearchFacetResultStats) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?ProductSearchFacetResultStats + */ + protected function mapper() + { + return function (?int $index): ?ProductSearchFacetResultStats { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var ProductSearchFacetResultStats $data */ + $data = ProductSearchFacetResultStatsModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetResultStatsModel.php b/lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetResultStatsModel.php new file mode 100644 index 00000000000..d62505cc0ef --- /dev/null +++ b/lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetResultStatsModel.php @@ -0,0 +1,248 @@ +name = $name; + $this->min = $min; + $this->max = $max; + $this->mean = $mean; + $this->sum = $sum; + $this->count = $count; + } + + /** + *Name of the facet.
+ * + * + * @return null|string + */ + public function getName() + { + if (is_null($this->name)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_NAME); + if (is_null($data)) { + return null; + } + $this->name = (string) $data; + } + + return $this->name; + } + + /** + *The minimum value of the field, scoped to the faceted results.
+ * + * + * @return null|mixed + */ + public function getMin() + { + if (is_null($this->min)) { + /** @psalm-var mixed $data */ + $data = $this->raw(self::FIELD_MIN); + if (is_null($data)) { + return null; + } + $this->min = $data; + } + + return $this->min; + } + + /** + *The maximum value of the field, scoped to the faceted results.
+ * + * + * @return null|mixed + */ + public function getMax() + { + if (is_null($this->max)) { + /** @psalm-var mixed $data */ + $data = $this->raw(self::FIELD_MAX); + if (is_null($data)) { + return null; + } + $this->max = $data; + } + + return $this->max; + } + + /** + *The average value of the field calculated as sum / count.
Only returned for number fields.
+ * + * + * @return null|mixed + */ + public function getMean() + { + if (is_null($this->mean)) { + /** @psalm-var mixed $data */ + $data = $this->raw(self::FIELD_MEAN); + if (is_null($data)) { + return null; + } + $this->mean = $data; + } + + return $this->mean; + } + + /** + *The sum of values of the field that match the facet expression.
+ *Only returned for number fields.
+ * + * + * @return null|mixed + */ + public function getSum() + { + if (is_null($this->sum)) { + /** @psalm-var mixed $data */ + $data = $this->raw(self::FIELD_SUM); + if (is_null($data)) { + return null; + } + $this->sum = $data; + } + + return $this->sum; + } + + /** + *The total number of values counted that match the facet expression.
+ * + * + * @return null|int + */ + public function getCount() + { + if (is_null($this->count)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_COUNT); + if (is_null($data)) { + return null; + } + $this->count = (int) $data; + } + + return $this->count; + } + + + /** + * @param ?string $name + */ + public function setName(?string $name): void + { + $this->name = $name; + } + + /** + * @param mixed $min + */ + public function setMin($min): void + { + $this->min = $min; + } + + /** + * @param mixed $max + */ + public function setMax($max): void + { + $this->max = $max; + } + + /** + * @param mixed $mean + */ + public function setMean($mean): void + { + $this->mean = $mean; + } + + /** + * @param mixed $sum + */ + public function setSum($sum): void + { + $this->sum = $sum; + } + + /** + * @param ?int $count + */ + public function setCount(?int $count): void + { + $this->count = $count; + } +} diff --git a/lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetStatsExpression.php b/lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetStatsExpression.php new file mode 100644 index 00000000000..8c96db25b34 --- /dev/null +++ b/lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetStatsExpression.php @@ -0,0 +1,30 @@ +Definition of the stats facet. + * + + * @return null|ProductSearchFacetStatsValue + */ + public function getStats(); + + /** + * @param ?ProductSearchFacetStatsValue $stats + */ + public function setStats(?ProductSearchFacetStatsValue $stats): void; +} diff --git a/lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetStatsExpressionBuilder.php b/lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetStatsExpressionBuilder.php new file mode 100644 index 00000000000..c2b333b2529 --- /dev/null +++ b/lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetStatsExpressionBuilder.php @@ -0,0 +1,73 @@ + + */ +final class ProductSearchFacetStatsExpressionBuilder implements Builder +{ + /** + + * @var null|ProductSearchFacetStatsValue|ProductSearchFacetStatsValueBuilder + */ + private $stats; + + /** + *Definition of the stats facet.
+ * + + * @return null|ProductSearchFacetStatsValue + */ + public function getStats() + { + return $this->stats instanceof ProductSearchFacetStatsValueBuilder ? $this->stats->build() : $this->stats; + } + + /** + * @param ?ProductSearchFacetStatsValue $stats + * @return $this + */ + public function withStats(?ProductSearchFacetStatsValue $stats) + { + $this->stats = $stats; + + return $this; + } + + /** + * @deprecated use withStats() instead + * @return $this + */ + public function withStatsBuilder(?ProductSearchFacetStatsValueBuilder $stats) + { + $this->stats = $stats; + + return $this; + } + + public function build(): ProductSearchFacetStatsExpression + { + return new ProductSearchFacetStatsExpressionModel( + $this->stats instanceof ProductSearchFacetStatsValueBuilder ? $this->stats->build() : $this->stats + ); + } + + public static function of(): ProductSearchFacetStatsExpressionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetStatsExpressionCollection.php b/lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetStatsExpressionCollection.php new file mode 100644 index 00000000000..47725b74ca1 --- /dev/null +++ b/lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetStatsExpressionCollection.php @@ -0,0 +1,56 @@ + + * @method ProductSearchFacetStatsExpression current() + * @method ProductSearchFacetStatsExpression end() + * @method ProductSearchFacetStatsExpression at($offset) + */ +class ProductSearchFacetStatsExpressionCollection extends ProductSearchFacetExpressionCollection +{ + /** + * @psalm-assert ProductSearchFacetStatsExpression $value + * @psalm-param ProductSearchFacetStatsExpression|stdClass $value + * @throws InvalidArgumentException + * + * @return ProductSearchFacetStatsExpressionCollection + */ + public function add($value) + { + if (!$value instanceof ProductSearchFacetStatsExpression) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?ProductSearchFacetStatsExpression + */ + protected function mapper() + { + return function (?int $index): ?ProductSearchFacetStatsExpression { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var ProductSearchFacetStatsExpression $data */ + $data = ProductSearchFacetStatsExpressionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetStatsExpressionModel.php b/lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetStatsExpressionModel.php new file mode 100644 index 00000000000..7b54910f027 --- /dev/null +++ b/lib/commercetools-api/src/Models/ProductSearch/ProductSearchFacetStatsExpressionModel.php @@ -0,0 +1,67 @@ +stats = $stats; + } + + /** + *Definition of the stats facet.
+ * + * + * @return null|ProductSearchFacetStatsValue + */ + public function getStats() + { + if (is_null($this->stats)) { + /** @psalm-var stdClass|arrayWhether the facet must consider only the Products resulting from the search (query) or all the Products (all).
Additional filtering expression to apply to the search result before calculating the facet.
+ * + + * @return null|SearchQuery + */ + public function getFilter(); + + /** + *The searchable Product field to facet on.
+ * + + * @return null|string + */ + public function getField(); + + /** + *If the field is not standard, this must be the Attribute type.
Name of the stats facet to appear in the ProductSearchFacetResultStats.
+ * + + * @return null|string + */ + public function getName() + { + return $this->name; + } + + /** + *Whether the facet must consider only the Products resulting from the search (query) or all the Products (all).
Additional filtering expression to apply to the search result before calculating the facet.
+ * + + * @return null|SearchQuery + */ + public function getFilter() + { + return $this->filter instanceof SearchQueryBuilder ? $this->filter->build() : $this->filter; + } + + /** + *The searchable Product field to facet on.
+ * + + * @return null|string + */ + public function getField() + { + return $this->field; + } + + /** + *If the field is not standard, this must be the Attribute type.
Name of the stats facet to appear in the ProductSearchFacetResultStats.
+ * + * + * @return null|string + */ + public function getName() + { + if (is_null($this->name)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_NAME); + if (is_null($data)) { + return null; + } + $this->name = (string) $data; + } + + return $this->name; + } + + /** + *Whether the facet must consider only the Products resulting from the search (query) or all the Products (all).
Additional filtering expression to apply to the search result before calculating the facet.
+ * + * + * @return null|SearchQuery + */ + public function getFilter() + { + if (is_null($this->filter)) { + /** @psalm-var stdClass|arrayThe searchable Product field to facet on.
+ * + * + * @return null|string + */ + public function getField() + { + if (is_null($this->field)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_FIELD); + if (is_null($data)) { + return null; + } + $this->field = (string) $data; + } + + return $this->field; + } + + /** + *If the field is not standard, this must be the Attribute type.