From b70347af59bfa4bfa108948537bfe9cc4368bcef Mon Sep 17 00:00:00 2001 From: "ct-sdks[bot]" <153784748+ct-sdks[bot]@users.noreply.github.com> Date: Fri, 20 Dec 2024 13:29:18 +0000 Subject: [PATCH] build(codegen): updating SDK --- changes.md | 32 ++- .../Models/Search/SearchExactExpression.php | 6 +- .../Search/SearchExactExpressionBuilder.php | 14 +- .../Search/SearchExactExpressionModel.php | 12 +- .../src/Models/Search/SearchExactValue.php | 66 +++++ .../Models/Search/SearchExactValueBuilder.php | 227 +++++++++++++++ .../Search/SearchExactValueCollection.php | 56 ++++ .../Models/Search/SearchExactValueModel.php | 272 ++++++++++++++++++ references.txt | 1 + 9 files changed, 658 insertions(+), 28 deletions(-) create mode 100644 lib/commercetools-api/src/Models/Search/SearchExactValue.php create mode 100644 lib/commercetools-api/src/Models/Search/SearchExactValueBuilder.php create mode 100644 lib/commercetools-api/src/Models/Search/SearchExactValueCollection.php create mode 100644 lib/commercetools-api/src/Models/Search/SearchExactValueModel.php diff --git a/changes.md b/changes.md index 709e4fdf328..0fb00c35f92 100644 --- a/changes.md +++ b/changes.md @@ -1,5 +1,24 @@ **Api changes** +
+Changed Property(s) + +- :warning: changed property `exact` of type `SearchExactExpression` from type `SearchAnyValue` to `SearchExactValue` +
+ + +
+Added Property(s) + +- added property `applicationMode` to type `CartDiscountValueFixed` +- added property `applicationMode` to type `CartDiscountValueFixedDraft` +- added property `custom` to type `CartSetCustomShippingMethodAction` +- added property `custom` to type `StagedOrderSetCustomShippingMethodAction` +- added property `custom` to type `StagedOrderSetShippingAddressAndCustomShippingMethodAction` +- added property `businessUnits` to type `SearchIndexingConfiguration` +
+ +
Added Resource(s) @@ -43,6 +62,7 @@ - added type `ShoppingListMessagePayload` - added type `BusinessUnitSearchStatus` - added type `ProjectChangeBusinessUnitSearchStatusAction` +- added type `SearchExactValue`
@@ -53,18 +73,6 @@ - added enum `shopping-list` to type `MessageSubscriptionResourceTypeId` - -
-Added Property(s) - -- added property `applicationMode` to type `CartDiscountValueFixed` -- added property `applicationMode` to type `CartDiscountValueFixedDraft` -- added property `custom` to type `CartSetCustomShippingMethodAction` -- added property `custom` to type `StagedOrderSetCustomShippingMethodAction` -- added property `custom` to type `StagedOrderSetShippingAddressAndCustomShippingMethodAction` -- added property `businessUnits` to type `SearchIndexingConfiguration` -
- **History changes**
diff --git a/lib/commercetools-api/src/Models/Search/SearchExactExpression.php b/lib/commercetools-api/src/Models/Search/SearchExactExpression.php index af828d15aa4..89e7e45ea1c 100644 --- a/lib/commercetools-api/src/Models/Search/SearchExactExpression.php +++ b/lib/commercetools-api/src/Models/Search/SearchExactExpression.php @@ -17,12 +17,12 @@ interface SearchExactExpression extends SearchQueryExpression /** - * @return null|SearchAnyValue + * @return null|SearchExactValue */ public function getExact(); /** - * @param ?SearchAnyValue $exact + * @param ?SearchExactValue $exact */ - public function setExact(?SearchAnyValue $exact): void; + public function setExact(?SearchExactValue $exact): void; } diff --git a/lib/commercetools-api/src/Models/Search/SearchExactExpressionBuilder.php b/lib/commercetools-api/src/Models/Search/SearchExactExpressionBuilder.php index 0fd3620a328..c9da76035a7 100644 --- a/lib/commercetools-api/src/Models/Search/SearchExactExpressionBuilder.php +++ b/lib/commercetools-api/src/Models/Search/SearchExactExpressionBuilder.php @@ -22,24 +22,24 @@ final class SearchExactExpressionBuilder implements Builder { /** - * @var null|SearchAnyValue|SearchAnyValueBuilder + * @var null|SearchExactValue|SearchExactValueBuilder */ private $exact; /** - * @return null|SearchAnyValue + * @return null|SearchExactValue */ public function getExact() { - return $this->exact instanceof SearchAnyValueBuilder ? $this->exact->build() : $this->exact; + return $this->exact instanceof SearchExactValueBuilder ? $this->exact->build() : $this->exact; } /** - * @param ?SearchAnyValue $exact + * @param ?SearchExactValue $exact * @return $this */ - public function withExact(?SearchAnyValue $exact) + public function withExact(?SearchExactValue $exact) { $this->exact = $exact; @@ -50,7 +50,7 @@ public function withExact(?SearchAnyValue $exact) * @deprecated use withExact() instead * @return $this */ - public function withExactBuilder(?SearchAnyValueBuilder $exact) + public function withExactBuilder(?SearchExactValueBuilder $exact) { $this->exact = $exact; @@ -60,7 +60,7 @@ public function withExactBuilder(?SearchAnyValueBuilder $exact) public function build(): SearchExactExpression { return new SearchExactExpressionModel( - $this->exact instanceof SearchAnyValueBuilder ? $this->exact->build() : $this->exact + $this->exact instanceof SearchExactValueBuilder ? $this->exact->build() : $this->exact ); } diff --git a/lib/commercetools-api/src/Models/Search/SearchExactExpressionModel.php b/lib/commercetools-api/src/Models/Search/SearchExactExpressionModel.php index ffbac9410b1..ee1ff9a3944 100644 --- a/lib/commercetools-api/src/Models/Search/SearchExactExpressionModel.php +++ b/lib/commercetools-api/src/Models/Search/SearchExactExpressionModel.php @@ -21,7 +21,7 @@ final class SearchExactExpressionModel extends JsonObjectModel implements Search { /** * - * @var ?SearchAnyValue + * @var ?SearchExactValue */ protected $exact; @@ -30,14 +30,14 @@ final class SearchExactExpressionModel extends JsonObjectModel implements Search * @psalm-suppress MissingParamType */ public function __construct( - ?SearchAnyValue $exact = null + ?SearchExactValue $exact = null ) { $this->exact = $exact; } /** * - * @return null|SearchAnyValue + * @return null|SearchExactValue */ public function getExact() { @@ -48,7 +48,7 @@ public function getExact() return null; } - $this->exact = SearchAnyValueModel::of($data); + $this->exact = SearchExactValueModel::of($data); } return $this->exact; @@ -56,9 +56,9 @@ public function getExact() /** - * @param ?SearchAnyValue $exact + * @param ?SearchExactValue $exact */ - public function setExact(?SearchAnyValue $exact): void + public function setExact(?SearchExactValue $exact): void { $this->exact = $exact; } diff --git a/lib/commercetools-api/src/Models/Search/SearchExactValue.php b/lib/commercetools-api/src/Models/Search/SearchExactValue.php new file mode 100644 index 00000000000..18d3be0b89f --- /dev/null +++ b/lib/commercetools-api/src/Models/Search/SearchExactValue.php @@ -0,0 +1,66 @@ +String value specifying linguistic and regional preferences using the IETF language tag format, as described in BCP 47. The format combines language, script, and region using hyphen-separated subtags. For example: en, en-US, zh-Hans-SG.

+ * + + * @return null|string + */ + public function getLanguage(); + + /** + + * @return null|bool + */ + public function getCaseInsensitive(); + + /** + * @param mixed $value + */ + public function setValue($value): void; + + /** + * @param ?array $values + */ + public function setValues(?array $values): void; + + /** + * @param ?string $language + */ + public function setLanguage(?string $language): void; + + /** + * @param ?bool $caseInsensitive + */ + public function setCaseInsensitive(?bool $caseInsensitive): void; +} diff --git a/lib/commercetools-api/src/Models/Search/SearchExactValueBuilder.php b/lib/commercetools-api/src/Models/Search/SearchExactValueBuilder.php new file mode 100644 index 00000000000..34c662c4c82 --- /dev/null +++ b/lib/commercetools-api/src/Models/Search/SearchExactValueBuilder.php @@ -0,0 +1,227 @@ + + */ +final class SearchExactValueBuilder implements Builder +{ + /** + + * @var ?string + */ + private $field; + + /** + + * @var ?float + */ + private $boost; + + /** + + * @var ?string + */ + private $fieldType; + + /** + + * @var null|mixed|mixed + */ + private $value; + + /** + + * @var ?array + */ + private $values; + + /** + + * @var ?string + */ + private $language; + + /** + + * @var ?bool + */ + private $caseInsensitive; + + /** + + * @return null|string + */ + public function getField() + { + return $this->field; + } + + /** + + * @return null|float + */ + public function getBoost() + { + return $this->boost; + } + + /** + *

Possible values for the fieldType property on query expressions indicating the data type of the field.

+ * + + * @return null|string + */ + public function getFieldType() + { + return $this->fieldType; + } + + /** + + * @return null|mixed + */ + public function getValue() + { + return $this->value; + } + + /** + + * @return null|array + */ + public function getValues() + { + return $this->values; + } + + /** + *

String value specifying linguistic and regional preferences using the IETF language tag format, as described in BCP 47. The format combines language, script, and region using hyphen-separated subtags. For example: en, en-US, zh-Hans-SG.

+ * + + * @return null|string + */ + public function getLanguage() + { + return $this->language; + } + + /** + + * @return null|bool + */ + public function getCaseInsensitive() + { + return $this->caseInsensitive; + } + + /** + * @param ?string $field + * @return $this + */ + public function withField(?string $field) + { + $this->field = $field; + + return $this; + } + + /** + * @param ?float $boost + * @return $this + */ + public function withBoost(?float $boost) + { + $this->boost = $boost; + + return $this; + } + + /** + * @param ?string $fieldType + * @return $this + */ + public function withFieldType(?string $fieldType) + { + $this->fieldType = $fieldType; + + return $this; + } + + /** + * @param mixed $value + * @return $this + */ + public function withValue($value) + { + $this->value = $value; + + return $this; + } + + /** + * @param ?array $values + * @return $this + */ + public function withValues(?array $values) + { + $this->values = $values; + + return $this; + } + + /** + * @param ?string $language + * @return $this + */ + public function withLanguage(?string $language) + { + $this->language = $language; + + return $this; + } + + /** + * @param ?bool $caseInsensitive + * @return $this + */ + public function withCaseInsensitive(?bool $caseInsensitive) + { + $this->caseInsensitive = $caseInsensitive; + + return $this; + } + + + public function build(): SearchExactValue + { + return new SearchExactValueModel( + $this->field, + $this->boost, + $this->fieldType, + $this->value, + $this->values, + $this->language, + $this->caseInsensitive + ); + } + + public static function of(): SearchExactValueBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Search/SearchExactValueCollection.php b/lib/commercetools-api/src/Models/Search/SearchExactValueCollection.php new file mode 100644 index 00000000000..ccd7198b77b --- /dev/null +++ b/lib/commercetools-api/src/Models/Search/SearchExactValueCollection.php @@ -0,0 +1,56 @@ + + * @method SearchExactValue current() + * @method SearchExactValue end() + * @method SearchExactValue at($offset) + */ +class SearchExactValueCollection extends SearchQueryExpressionValueCollection +{ + /** + * @psalm-assert SearchExactValue $value + * @psalm-param SearchExactValue|stdClass $value + * @throws InvalidArgumentException + * + * @return SearchExactValueCollection + */ + public function add($value) + { + if (!$value instanceof SearchExactValue) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?SearchExactValue + */ + protected function mapper() + { + return function (?int $index): ?SearchExactValue { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var SearchExactValue $data */ + $data = SearchExactValueModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Search/SearchExactValueModel.php b/lib/commercetools-api/src/Models/Search/SearchExactValueModel.php new file mode 100644 index 00000000000..cad543408e1 --- /dev/null +++ b/lib/commercetools-api/src/Models/Search/SearchExactValueModel.php @@ -0,0 +1,272 @@ +field = $field; + $this->boost = $boost; + $this->fieldType = $fieldType; + $this->value = $value; + $this->values = $values; + $this->language = $language; + $this->caseInsensitive = $caseInsensitive; + } + + /** + * + * @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; + } + + /** + * + * @return null|float + */ + public function getBoost() + { + if (is_null($this->boost)) { + /** @psalm-var ?float $data */ + $data = $this->raw(self::FIELD_BOOST); + if (is_null($data)) { + return null; + } + $this->boost = (float) $data; + } + + return $this->boost; + } + + /** + *

Possible values for the fieldType property on query expressions indicating the data type of the field.

+ * + * + * @return null|string + */ + public function getFieldType() + { + if (is_null($this->fieldType)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->fieldType = (string) $data; + } + + return $this->fieldType; + } + + /** + * + * @return null|mixed + */ + public function getValue() + { + if (is_null($this->value)) { + /** @psalm-var mixed $data */ + $data = $this->raw(self::FIELD_VALUE); + if (is_null($data)) { + return null; + } + $this->value = $data; + } + + return $this->value; + } + + /** + * + * @return null|array + */ + public function getValues() + { + if (is_null($this->values)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_VALUES); + if (is_null($data)) { + return null; + } + $this->values = $data; + } + + return $this->values; + } + + /** + *

String value specifying linguistic and regional preferences using the IETF language tag format, as described in BCP 47. The format combines language, script, and region using hyphen-separated subtags. For example: en, en-US, zh-Hans-SG.

+ * + * + * @return null|string + */ + public function getLanguage() + { + if (is_null($this->language)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LANGUAGE); + if (is_null($data)) { + return null; + } + $this->language = (string) $data; + } + + return $this->language; + } + + /** + * + * @return null|bool + */ + public function getCaseInsensitive() + { + if (is_null($this->caseInsensitive)) { + /** @psalm-var ?bool $data */ + $data = $this->raw(self::FIELD_CASE_INSENSITIVE); + if (is_null($data)) { + return null; + } + $this->caseInsensitive = (bool) $data; + } + + return $this->caseInsensitive; + } + + + /** + * @param ?string $field + */ + public function setField(?string $field): void + { + $this->field = $field; + } + + /** + * @param ?float $boost + */ + public function setBoost(?float $boost): void + { + $this->boost = $boost; + } + + /** + * @param ?string $fieldType + */ + public function setFieldType(?string $fieldType): void + { + $this->fieldType = $fieldType; + } + + /** + * @param mixed $value + */ + public function setValue($value): void + { + $this->value = $value; + } + + /** + * @param ?array $values + */ + public function setValues(?array $values): void + { + $this->values = $values; + } + + /** + * @param ?string $language + */ + public function setLanguage(?string $language): void + { + $this->language = $language; + } + + /** + * @param ?bool $caseInsensitive + */ + public function setCaseInsensitive(?bool $caseInsensitive): void + { + $this->caseInsensitive = $caseInsensitive; + } +} diff --git a/references.txt b/references.txt index 55afd8f0daf..598bf6b1d63 100644 --- a/references.txt +++ b/references.txt @@ -341,3 +341,4 @@ df53588d26d7953dfdf44166866ca03045f0a70b 7abe530c4e76020a59ffb61623f20b87ae406e02 55ee33c4d18af345c4e89be226286c56c187a878 e5666d7956fd6de53e41f965b052896d2a2ddd9b +98343f9a365a2f9d4db86190003d00b8682c71d9