From 7d85b381a7cfe325ed8f4ac7374289d1bfc24c14 Mon Sep 17 00:00:00 2001
From: "ct-sdks[bot]" <153784748+ct-sdks[bot]@users.noreply.github.com>
Date: Thu, 26 Sep 2024 14:21:45 +0000
Subject: [PATCH] build(codegen): updating SDK
---
changes.md | 2 +
.../src/Models/Error/ErrorObjectModel.php | 1 +
.../Models/Error/GraphQLErrorObjectModel.php | 1 +
.../Error/GraphQLSearchNotReadyError.php | 21 ++++
.../GraphQLSearchNotReadyErrorBuilder.php | 33 ++++++
.../GraphQLSearchNotReadyErrorCollection.php | 56 +++++++++
.../Error/GraphQLSearchNotReadyErrorModel.php | 71 ++++++++++++
.../src/Models/Error/SearchNotReadyError.php | 34 ++++++
.../Error/SearchNotReadyErrorBuilder.php | 63 +++++++++++
.../Error/SearchNotReadyErrorCollection.php | 56 +++++++++
.../Models/Error/SearchNotReadyErrorModel.php | 106 ++++++++++++++++++
references.txt | 1 +
12 files changed, 445 insertions(+)
create mode 100644 lib/commercetools-api/src/Models/Error/GraphQLSearchNotReadyError.php
create mode 100644 lib/commercetools-api/src/Models/Error/GraphQLSearchNotReadyErrorBuilder.php
create mode 100644 lib/commercetools-api/src/Models/Error/GraphQLSearchNotReadyErrorCollection.php
create mode 100644 lib/commercetools-api/src/Models/Error/GraphQLSearchNotReadyErrorModel.php
create mode 100644 lib/commercetools-api/src/Models/Error/SearchNotReadyError.php
create mode 100644 lib/commercetools-api/src/Models/Error/SearchNotReadyErrorBuilder.php
create mode 100644 lib/commercetools-api/src/Models/Error/SearchNotReadyErrorCollection.php
create mode 100644 lib/commercetools-api/src/Models/Error/SearchNotReadyErrorModel.php
diff --git a/changes.md b/changes.md
index eeba47dbfcd..f8305c9efcb 100644
--- a/changes.md
+++ b/changes.md
@@ -16,6 +16,8 @@
Added Type(s)
+- added type `SearchNotReadyError`
+- added type `GraphQLSearchNotReadyError`
- added type `ProductTailoringAttribute`
- added type `ProductTailoringSetAttributeAction`
- added type `ProductTailoringSetAttributeInAllVariantsAction`
diff --git a/lib/commercetools-api/src/Models/Error/ErrorObjectModel.php b/lib/commercetools-api/src/Models/Error/ErrorObjectModel.php
index c1b8b2efe77..b67434a5749 100644
--- a/lib/commercetools-api/src/Models/Error/ErrorObjectModel.php
+++ b/lib/commercetools-api/src/Models/Error/ErrorObjectModel.php
@@ -107,6 +107,7 @@ final class ErrorObjectModel extends JsonObjectModel implements ErrorObject
'SearchExecutionFailure' => SearchExecutionFailureErrorModel::class,
'SearchFacetPathNotFound' => SearchFacetPathNotFoundErrorModel::class,
'SearchIndexingInProgress' => SearchIndexingInProgressErrorModel::class,
+ 'SearchNotReady' => SearchNotReadyErrorModel::class,
'SemanticError' => SemanticErrorErrorModel::class,
'ShippingMethodDoesNotMatchCart' => ShippingMethodDoesNotMatchCartErrorModel::class,
'StoreCartDiscountsLimitReached' => StoreCartDiscountsLimitReachedErrorModel::class,
diff --git a/lib/commercetools-api/src/Models/Error/GraphQLErrorObjectModel.php b/lib/commercetools-api/src/Models/Error/GraphQLErrorObjectModel.php
index c46e973141a..00a1ec20e38 100644
--- a/lib/commercetools-api/src/Models/Error/GraphQLErrorObjectModel.php
+++ b/lib/commercetools-api/src/Models/Error/GraphQLErrorObjectModel.php
@@ -101,6 +101,7 @@ final class GraphQLErrorObjectModel extends JsonObjectModel implements GraphQLEr
'SearchExecutionFailure' => GraphQLSearchExecutionFailureErrorModel::class,
'SearchFacetPathNotFound' => GraphQLSearchFacetPathNotFoundErrorModel::class,
'SearchIndexingInProgress' => GraphQLSearchIndexingInProgressErrorModel::class,
+ 'SearchNotReady' => GraphQLSearchNotReadyErrorModel::class,
'SemanticError' => GraphQLSemanticErrorErrorModel::class,
'ShippingMethodDoesNotMatchCart' => GraphQLShippingMethodDoesNotMatchCartErrorModel::class,
'StoreCartDiscountsLimitReached' => GraphQLStoreCartDiscountsLimitReachedErrorModel::class,
diff --git a/lib/commercetools-api/src/Models/Error/GraphQLSearchNotReadyError.php b/lib/commercetools-api/src/Models/Error/GraphQLSearchNotReadyError.php
new file mode 100644
index 00000000000..4eb3ccfde62
--- /dev/null
+++ b/lib/commercetools-api/src/Models/Error/GraphQLSearchNotReadyError.php
@@ -0,0 +1,21 @@
+
+ */
+final class GraphQLSearchNotReadyErrorBuilder implements Builder
+{
+ public function build(): GraphQLSearchNotReadyError
+ {
+ return new GraphQLSearchNotReadyErrorModel(
+ );
+ }
+
+ public static function of(): GraphQLSearchNotReadyErrorBuilder
+ {
+ return new self();
+ }
+}
diff --git a/lib/commercetools-api/src/Models/Error/GraphQLSearchNotReadyErrorCollection.php b/lib/commercetools-api/src/Models/Error/GraphQLSearchNotReadyErrorCollection.php
new file mode 100644
index 00000000000..5d4a36d5932
--- /dev/null
+++ b/lib/commercetools-api/src/Models/Error/GraphQLSearchNotReadyErrorCollection.php
@@ -0,0 +1,56 @@
+
+ * @method GraphQLSearchNotReadyError current()
+ * @method GraphQLSearchNotReadyError end()
+ * @method GraphQLSearchNotReadyError at($offset)
+ */
+class GraphQLSearchNotReadyErrorCollection extends GraphQLErrorObjectCollection
+{
+ /**
+ * @psalm-assert GraphQLSearchNotReadyError $value
+ * @psalm-param GraphQLSearchNotReadyError|stdClass $value
+ * @throws InvalidArgumentException
+ *
+ * @return GraphQLSearchNotReadyErrorCollection
+ */
+ public function add($value)
+ {
+ if (!$value instanceof GraphQLSearchNotReadyError) {
+ throw new InvalidArgumentException();
+ }
+ $this->store($value);
+
+ return $this;
+ }
+
+ /**
+ * @psalm-return callable(int):?GraphQLSearchNotReadyError
+ */
+ protected function mapper()
+ {
+ return function (?int $index): ?GraphQLSearchNotReadyError {
+ $data = $this->get($index);
+ if ($data instanceof stdClass) {
+ /** @var GraphQLSearchNotReadyError $data */
+ $data = GraphQLSearchNotReadyErrorModel::of($data);
+ $this->set($data, $index);
+ }
+
+ return $data;
+ };
+ }
+}
diff --git a/lib/commercetools-api/src/Models/Error/GraphQLSearchNotReadyErrorModel.php b/lib/commercetools-api/src/Models/Error/GraphQLSearchNotReadyErrorModel.php
new file mode 100644
index 00000000000..f0d795e4b01
--- /dev/null
+++ b/lib/commercetools-api/src/Models/Error/GraphQLSearchNotReadyErrorModel.php
@@ -0,0 +1,71 @@
+code = $code ?? self::DISCRIMINATOR_VALUE;
+ }
+
+ /**
+ *
+ * @return null|string
+ */
+ public function getCode()
+ {
+ if (is_null($this->code)) {
+ /** @psalm-var ?string $data */
+ $data = $this->raw(self::FIELD_CODE);
+ if (is_null($data)) {
+ return null;
+ }
+ $this->code = (string) $data;
+ }
+
+ return $this->code;
+ }
+
+
+
+ /**
+ * @return mixed
+ */
+ public function by(string $key)
+ {
+ $data = $this->raw($key);
+ if (is_null($data)) {
+ return null;
+ }
+
+ return $data;
+ }
+}
diff --git a/lib/commercetools-api/src/Models/Error/SearchNotReadyError.php b/lib/commercetools-api/src/Models/Error/SearchNotReadyError.php
new file mode 100644
index 00000000000..cedc85103fb
--- /dev/null
+++ b/lib/commercetools-api/src/Models/Error/SearchNotReadyError.php
@@ -0,0 +1,34 @@
+$Search is not ready. Check the indexing-status endpoint and that the feature has been activated in the project settings.
$Search is not ready. Check the indexing-status endpoint and that the feature has been activated in the project settings.
$Search is not ready. Check the indexing-status endpoint and that the feature has been activated in the project settings.