diff --git a/changes.md b/changes.md
index f5a06a8e53f..709e4fdf328 100644
--- a/changes.md
+++ b/changes.md
@@ -3,6 +3,8 @@
Added Resource(s)
+- added resource `/{projectKey}/business-units/search`
+- added resource `/{projectKey}/business-units/search/indexing-status`
- added resource `/{projectKey}/channels/key={key}`
Added Method(s)
+- added method `$apiRoot->withProjectKey()->businessUnits()->search()->post()`
+- added method `$apiRoot->withProjectKey()->businessUnits()->search()->head()`
+- added method `$apiRoot->withProjectKey()->businessUnits()->searchIndexingStatus()->get()`
- added method `$apiRoot->withProjectKey()->channels()->withKey()->get()`
- added method `$apiRoot->withProjectKey()->channels()->withKey()->head()`
- added method `$apiRoot->withProjectKey()->channels()->withKey()->post()`
@@ -20,6 +25,12 @@
Added Type(s)
+- added type `BusinessUnitIndexingProgress`
+- added type `BusinessUnitIndexingStatus`
+- added type `BusinessUnitPagedSearchResponse`
+- added type `BusinessUnitSearchIndexingStatusResponse`
+- added type `BusinessUnitSearchRequest`
+- added type `BusinessUnitSearchResult`
- added type `CartDiscountPatternTarget`
- added type `CountOnCustomLineItemUnits`
- added type `CountOnLineItemUnits`
@@ -30,6 +41,8 @@
- added type `ShoppingListLineItemAddedMessagePayload`
- added type `ShoppingListLineItemRemovedMessagePayload`
- added type `ShoppingListMessagePayload`
+- added type `BusinessUnitSearchStatus`
+- added type `ProjectChangeBusinessUnitSearchStatusAction`
The number of Business Units that failed to be indexed.
+ * + + * @return null|int + */ + public function getFailed(); + + /** + *The estimated total number of Business Units to be indexed.
+ * + + * @return null|int + */ + public function getEstimatedTotal(); + + /** + * @param ?int $indexed + */ + public function setIndexed(?int $indexed): void; + + /** + * @param ?int $failed + */ + public function setFailed(?int $failed): void; + + /** + * @param ?int $estimatedTotal + */ + public function setEstimatedTotal(?int $estimatedTotal): void; +} diff --git a/lib/commercetools-api/src/Models/BusinessUnitSearch/BusinessUnitIndexingProgressBuilder.php b/lib/commercetools-api/src/Models/BusinessUnitSearch/BusinessUnitIndexingProgressBuilder.php new file mode 100644 index 00000000000..eea6bf3d6f5 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnitSearch/BusinessUnitIndexingProgressBuilder.php @@ -0,0 +1,121 @@ + + */ +final class BusinessUnitIndexingProgressBuilder implements Builder +{ + /** + + * @var ?int + */ + private $indexed; + + /** + + * @var ?int + */ + private $failed; + + /** + + * @var ?int + */ + private $estimatedTotal; + + /** + *The number of Business Units successfully indexed.
+ * + + * @return null|int + */ + public function getIndexed() + { + return $this->indexed; + } + + /** + *The number of Business Units that failed to be indexed.
+ * + + * @return null|int + */ + public function getFailed() + { + return $this->failed; + } + + /** + *The estimated total number of Business Units to be indexed.
+ * + + * @return null|int + */ + public function getEstimatedTotal() + { + return $this->estimatedTotal; + } + + /** + * @param ?int $indexed + * @return $this + */ + public function withIndexed(?int $indexed) + { + $this->indexed = $indexed; + + return $this; + } + + /** + * @param ?int $failed + * @return $this + */ + public function withFailed(?int $failed) + { + $this->failed = $failed; + + return $this; + } + + /** + * @param ?int $estimatedTotal + * @return $this + */ + public function withEstimatedTotal(?int $estimatedTotal) + { + $this->estimatedTotal = $estimatedTotal; + + return $this; + } + + + public function build(): BusinessUnitIndexingProgress + { + return new BusinessUnitIndexingProgressModel( + $this->indexed, + $this->failed, + $this->estimatedTotal + ); + } + + public static function of(): BusinessUnitIndexingProgressBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnitSearch/BusinessUnitIndexingProgressCollection.php b/lib/commercetools-api/src/Models/BusinessUnitSearch/BusinessUnitIndexingProgressCollection.php new file mode 100644 index 00000000000..9afaea6ed10 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnitSearch/BusinessUnitIndexingProgressCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitIndexingProgress current() + * @method BusinessUnitIndexingProgress end() + * @method BusinessUnitIndexingProgress at($offset) + */ +class BusinessUnitIndexingProgressCollection extends MapperSequence +{ + /** + * @psalm-assert BusinessUnitIndexingProgress $value + * @psalm-param BusinessUnitIndexingProgress|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitIndexingProgressCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitIndexingProgress) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitIndexingProgress + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitIndexingProgress { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitIndexingProgress $data */ + $data = BusinessUnitIndexingProgressModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnitSearch/BusinessUnitIndexingProgressModel.php b/lib/commercetools-api/src/Models/BusinessUnitSearch/BusinessUnitIndexingProgressModel.php new file mode 100644 index 00000000000..36db5428c2a --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnitSearch/BusinessUnitIndexingProgressModel.php @@ -0,0 +1,138 @@ +indexed = $indexed; + $this->failed = $failed; + $this->estimatedTotal = $estimatedTotal; + } + + /** + *The number of Business Units successfully indexed.
+ * + * + * @return null|int + */ + public function getIndexed() + { + if (is_null($this->indexed)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_INDEXED); + if (is_null($data)) { + return null; + } + $this->indexed = (int) $data; + } + + return $this->indexed; + } + + /** + *The number of Business Units that failed to be indexed.
+ * + * + * @return null|int + */ + public function getFailed() + { + if (is_null($this->failed)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_FAILED); + if (is_null($data)) { + return null; + } + $this->failed = (int) $data; + } + + return $this->failed; + } + + /** + *The estimated total number of Business Units to be indexed.
+ * + * + * @return null|int + */ + public function getEstimatedTotal() + { + if (is_null($this->estimatedTotal)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_ESTIMATED_TOTAL); + if (is_null($data)) { + return null; + } + $this->estimatedTotal = (int) $data; + } + + return $this->estimatedTotal; + } + + + /** + * @param ?int $indexed + */ + public function setIndexed(?int $indexed): void + { + $this->indexed = $indexed; + } + + /** + * @param ?int $failed + */ + public function setFailed(?int $failed): void + { + $this->failed = $failed; + } + + /** + * @param ?int $estimatedTotal + */ + public function setEstimatedTotal(?int $estimatedTotal): void + { + $this->estimatedTotal = $estimatedTotal; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnitSearch/BusinessUnitPagedSearchResponse.php b/lib/commercetools-api/src/Models/BusinessUnitSearch/BusinessUnitPagedSearchResponse.php new file mode 100644 index 00000000000..c0008190fb8 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnitSearch/BusinessUnitPagedSearchResponse.php @@ -0,0 +1,72 @@ +Total number of results matching the query. + * + + * @return null|int + */ + public function getTotal(); + + /** + *Number of results requested.
+ * + + * @return null|int + */ + public function getLimit(); + + /** + *Number of elements skipped.
+ * + + * @return null|int + */ + public function getOffset(); + + /** + *Search result containing the Business Units matching the search query.
+ * + + * @return null|BusinessUnitSearchResultCollection + */ + public function getResults(); + + /** + * @param ?int $total + */ + public function setTotal(?int $total): void; + + /** + * @param ?int $limit + */ + public function setLimit(?int $limit): void; + + /** + * @param ?int $offset + */ + public function setOffset(?int $offset): void; + + /** + * @param ?BusinessUnitSearchResultCollection $results + */ + public function setResults(?BusinessUnitSearchResultCollection $results): void; +} diff --git a/lib/commercetools-api/src/Models/BusinessUnitSearch/BusinessUnitPagedSearchResponseBuilder.php b/lib/commercetools-api/src/Models/BusinessUnitSearch/BusinessUnitPagedSearchResponseBuilder.php new file mode 100644 index 00000000000..f83467419f2 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnitSearch/BusinessUnitPagedSearchResponseBuilder.php @@ -0,0 +1,150 @@ + + */ +final class BusinessUnitPagedSearchResponseBuilder implements Builder +{ + /** + + * @var ?int + */ + private $total; + + /** + + * @var ?int + */ + private $limit; + + /** + + * @var ?int + */ + private $offset; + + /** + + * @var ?BusinessUnitSearchResultCollection + */ + private $results; + + /** + *Total number of results matching the query.
+ * + + * @return null|int + */ + public function getTotal() + { + return $this->total; + } + + /** + *Number of results requested.
+ * + + * @return null|int + */ + public function getLimit() + { + return $this->limit; + } + + /** + *Number of elements skipped.
+ * + + * @return null|int + */ + public function getOffset() + { + return $this->offset; + } + + /** + *Search result containing the Business Units matching the search query.
+ * + + * @return null|BusinessUnitSearchResultCollection + */ + public function getResults() + { + return $this->results; + } + + /** + * @param ?int $total + * @return $this + */ + public function withTotal(?int $total) + { + $this->total = $total; + + return $this; + } + + /** + * @param ?int $limit + * @return $this + */ + public function withLimit(?int $limit) + { + $this->limit = $limit; + + return $this; + } + + /** + * @param ?int $offset + * @return $this + */ + public function withOffset(?int $offset) + { + $this->offset = $offset; + + return $this; + } + + /** + * @param ?BusinessUnitSearchResultCollection $results + * @return $this + */ + public function withResults(?BusinessUnitSearchResultCollection $results) + { + $this->results = $results; + + return $this; + } + + + public function build(): BusinessUnitPagedSearchResponse + { + return new BusinessUnitPagedSearchResponseModel( + $this->total, + $this->limit, + $this->offset, + $this->results + ); + } + + public static function of(): BusinessUnitPagedSearchResponseBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnitSearch/BusinessUnitPagedSearchResponseCollection.php b/lib/commercetools-api/src/Models/BusinessUnitSearch/BusinessUnitPagedSearchResponseCollection.php new file mode 100644 index 00000000000..ae48ef92bd9 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnitSearch/BusinessUnitPagedSearchResponseCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitPagedSearchResponse current() + * @method BusinessUnitPagedSearchResponse end() + * @method BusinessUnitPagedSearchResponse at($offset) + */ +class BusinessUnitPagedSearchResponseCollection extends MapperSequence +{ + /** + * @psalm-assert BusinessUnitPagedSearchResponse $value + * @psalm-param BusinessUnitPagedSearchResponse|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitPagedSearchResponseCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitPagedSearchResponse) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitPagedSearchResponse + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitPagedSearchResponse { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitPagedSearchResponse $data */ + $data = BusinessUnitPagedSearchResponseModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnitSearch/BusinessUnitPagedSearchResponseModel.php b/lib/commercetools-api/src/Models/BusinessUnitSearch/BusinessUnitPagedSearchResponseModel.php new file mode 100644 index 00000000000..75150857277 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnitSearch/BusinessUnitPagedSearchResponseModel.php @@ -0,0 +1,174 @@ +total = $total; + $this->limit = $limit; + $this->offset = $offset; + $this->results = $results; + } + + /** + *Total number of results matching the query.
+ * + * + * @return null|int + */ + public function getTotal() + { + if (is_null($this->total)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_TOTAL); + if (is_null($data)) { + return null; + } + $this->total = (int) $data; + } + + return $this->total; + } + + /** + *Number of results requested.
+ * + * + * @return null|int + */ + public function getLimit() + { + if (is_null($this->limit)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_LIMIT); + if (is_null($data)) { + return null; + } + $this->limit = (int) $data; + } + + return $this->limit; + } + + /** + *Number of elements skipped.
+ * + * + * @return null|int + */ + public function getOffset() + { + if (is_null($this->offset)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_OFFSET); + if (is_null($data)) { + return null; + } + $this->offset = (int) $data; + } + + return $this->offset; + } + + /** + *Search result containing the Business Units matching the search query.
+ * + * + * @return null|BusinessUnitSearchResultCollection + */ + public function getResults() + { + if (is_null($this->results)) { + /** @psalm-var ?listProgress of indexing. Only available when indexing is in progress.
+ * + + * @return null|BusinessUnitIndexingProgress + */ + public function getStates(); + + /** + *Date and time (UTC) when the last indexing started.
+ * + + * @return null|DateTimeImmutable + */ + public function getStartedAt(); + + /** + *Time when the status was last modified.
+ * + + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt(); + + /** + *Indicates how many times the system tried to start indexing after failed attempts. The counter is set to null after an indexing finished successfully.
+ * + + * @return null|int + */ + public function getRetryCount(); + + /** + * @param ?string $status + */ + public function setStatus(?string $status): void; + + /** + * @param ?BusinessUnitIndexingProgress $states + */ + public function setStates(?BusinessUnitIndexingProgress $states): void; + + /** + * @param ?DateTimeImmutable $startedAt + */ + public function setStartedAt(?DateTimeImmutable $startedAt): void; + + /** + * @param ?DateTimeImmutable $lastModifiedAt + */ + public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void; + + /** + * @param ?int $retryCount + */ + public function setRetryCount(?int $retryCount): void; +} diff --git a/lib/commercetools-api/src/Models/BusinessUnitSearch/BusinessUnitSearchIndexingStatusResponseBuilder.php b/lib/commercetools-api/src/Models/BusinessUnitSearch/BusinessUnitSearchIndexingStatusResponseBuilder.php new file mode 100644 index 00000000000..5bfcc19e48c --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnitSearch/BusinessUnitSearchIndexingStatusResponseBuilder.php @@ -0,0 +1,190 @@ + + */ +final class BusinessUnitSearchIndexingStatusResponseBuilder implements Builder +{ + /** + + * @var ?string + */ + private $status; + + /** + + * @var null|BusinessUnitIndexingProgress|BusinessUnitIndexingProgressBuilder + */ + private $states; + + /** + + * @var ?DateTimeImmutable + */ + private $startedAt; + + /** + + * @var ?DateTimeImmutable + */ + private $lastModifiedAt; + + /** + + * @var ?int + */ + private $retryCount; + + /** + *Current status of indexing the Business Unit Search.
+ * + + * @return null|string + */ + public function getStatus() + { + return $this->status; + } + + /** + *Progress of indexing. Only available when indexing is in progress.
+ * + + * @return null|BusinessUnitIndexingProgress + */ + public function getStates() + { + return $this->states instanceof BusinessUnitIndexingProgressBuilder ? $this->states->build() : $this->states; + } + + /** + *Date and time (UTC) when the last indexing started.
+ * + + * @return null|DateTimeImmutable + */ + public function getStartedAt() + { + return $this->startedAt; + } + + /** + *Time when the status was last modified.
+ * + + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + return $this->lastModifiedAt; + } + + /** + *Indicates how many times the system tried to start indexing after failed attempts. The counter is set to null after an indexing finished successfully.
+ * + + * @return null|int + */ + public function getRetryCount() + { + return $this->retryCount; + } + + /** + * @param ?string $status + * @return $this + */ + public function withStatus(?string $status) + { + $this->status = $status; + + return $this; + } + + /** + * @param ?BusinessUnitIndexingProgress $states + * @return $this + */ + public function withStates(?BusinessUnitIndexingProgress $states) + { + $this->states = $states; + + return $this; + } + + /** + * @param ?DateTimeImmutable $startedAt + * @return $this + */ + public function withStartedAt(?DateTimeImmutable $startedAt) + { + $this->startedAt = $startedAt; + + return $this; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + * @return $this + */ + public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt) + { + $this->lastModifiedAt = $lastModifiedAt; + + return $this; + } + + /** + * @param ?int $retryCount + * @return $this + */ + public function withRetryCount(?int $retryCount) + { + $this->retryCount = $retryCount; + + return $this; + } + + /** + * @deprecated use withStates() instead + * @return $this + */ + public function withStatesBuilder(?BusinessUnitIndexingProgressBuilder $states) + { + $this->states = $states; + + return $this; + } + + public function build(): BusinessUnitSearchIndexingStatusResponse + { + return new BusinessUnitSearchIndexingStatusResponseModel( + $this->status, + $this->states instanceof BusinessUnitIndexingProgressBuilder ? $this->states->build() : $this->states, + $this->startedAt, + $this->lastModifiedAt, + $this->retryCount + ); + } + + public static function of(): BusinessUnitSearchIndexingStatusResponseBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnitSearch/BusinessUnitSearchIndexingStatusResponseCollection.php b/lib/commercetools-api/src/Models/BusinessUnitSearch/BusinessUnitSearchIndexingStatusResponseCollection.php new file mode 100644 index 00000000000..b1bc496d4e2 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnitSearch/BusinessUnitSearchIndexingStatusResponseCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitSearchIndexingStatusResponse current() + * @method BusinessUnitSearchIndexingStatusResponse end() + * @method BusinessUnitSearchIndexingStatusResponse at($offset) + */ +class BusinessUnitSearchIndexingStatusResponseCollection extends MapperSequence +{ + /** + * @psalm-assert BusinessUnitSearchIndexingStatusResponse $value + * @psalm-param BusinessUnitSearchIndexingStatusResponse|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitSearchIndexingStatusResponseCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitSearchIndexingStatusResponse) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitSearchIndexingStatusResponse + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitSearchIndexingStatusResponse { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitSearchIndexingStatusResponse $data */ + $data = BusinessUnitSearchIndexingStatusResponseModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnitSearch/BusinessUnitSearchIndexingStatusResponseModel.php b/lib/commercetools-api/src/Models/BusinessUnitSearch/BusinessUnitSearchIndexingStatusResponseModel.php new file mode 100644 index 00000000000..574144f7e8c --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnitSearch/BusinessUnitSearchIndexingStatusResponseModel.php @@ -0,0 +1,235 @@ +status = $status; + $this->states = $states; + $this->startedAt = $startedAt; + $this->lastModifiedAt = $lastModifiedAt; + $this->retryCount = $retryCount; + } + + /** + *Current status of indexing the Business Unit Search.
+ * + * + * @return null|string + */ + public function getStatus() + { + if (is_null($this->status)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_STATUS); + if (is_null($data)) { + return null; + } + $this->status = (string) $data; + } + + return $this->status; + } + + /** + *Progress of indexing. Only available when indexing is in progress.
+ * + * + * @return null|BusinessUnitIndexingProgress + */ + public function getStates() + { + if (is_null($this->states)) { + /** @psalm-var stdClass|arrayDate and time (UTC) when the last indexing started.
+ * + * + * @return null|DateTimeImmutable + */ + public function getStartedAt() + { + if (is_null($this->startedAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_STARTED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->startedAt = $data; + } + + return $this->startedAt; + } + + /** + *Time when the status was last modified.
+ * + * + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + if (is_null($this->lastModifiedAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->lastModifiedAt = $data; + } + + return $this->lastModifiedAt; + } + + /** + *Indicates how many times the system tried to start indexing after failed attempts. The counter is set to null after an indexing finished successfully.
+ * + * + * @return null|int + */ + public function getRetryCount() + { + if (is_null($this->retryCount)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_RETRY_COUNT); + if (is_null($data)) { + return null; + } + $this->retryCount = (int) $data; + } + + return $this->retryCount; + } + + + /** + * @param ?string $status + */ + public function setStatus(?string $status): void + { + $this->status = $status; + } + + /** + * @param ?BusinessUnitIndexingProgress $states + */ + public function setStates(?BusinessUnitIndexingProgress $states): void + { + $this->states = $states; + } + + /** + * @param ?DateTimeImmutable $startedAt + */ + public function setStartedAt(?DateTimeImmutable $startedAt): void + { + $this->startedAt = $startedAt; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + */ + public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void + { + $this->lastModifiedAt = $lastModifiedAt; + } + + /** + * @param ?int $retryCount + */ + public function setRetryCount(?int $retryCount): void + { + $this->retryCount = $retryCount; + } + + + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + $data = $this->toArray(); + if (isset($data[BusinessUnitSearchIndexingStatusResponse::FIELD_STARTED_AT]) && $data[BusinessUnitSearchIndexingStatusResponse::FIELD_STARTED_AT] instanceof \DateTimeImmutable) { + $data[BusinessUnitSearchIndexingStatusResponse::FIELD_STARTED_AT] = $data[BusinessUnitSearchIndexingStatusResponse::FIELD_STARTED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + + if (isset($data[BusinessUnitSearchIndexingStatusResponse::FIELD_LAST_MODIFIED_AT]) && $data[BusinessUnitSearchIndexingStatusResponse::FIELD_LAST_MODIFIED_AT] instanceof \DateTimeImmutable) { + $data[BusinessUnitSearchIndexingStatusResponse::FIELD_LAST_MODIFIED_AT] = $data[BusinessUnitSearchIndexingStatusResponse::FIELD_LAST_MODIFIED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + return (object) $data; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnitSearch/BusinessUnitSearchRequest.php b/lib/commercetools-api/src/Models/BusinessUnitSearch/BusinessUnitSearchRequest.php new file mode 100644 index 00000000000..d5b58ea5d7d --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnitSearch/BusinessUnitSearchRequest.php @@ -0,0 +1,74 @@ +The Business Unit Search query. + * + + * @return null|SearchQuery + */ + public function getQuery(); + + /** + *Controls how results to your query are sorted. If not provided, the results are sorted by relevance in descending order.
+ * + + * @return null|SearchSortingCollection + */ + public function getSort(); + + /** + *The maximum number of search results to be returned.
+ * + + * @return null|int + */ + public function getLimit(); + + /** + *The number of search results to be skipped in the response for pagination.
+ * + + * @return null|int + */ + public function getOffset(); + + /** + * @param ?SearchQuery $query + */ + public function setQuery(?SearchQuery $query): void; + + /** + * @param ?SearchSortingCollection $sort + */ + public function setSort(?SearchSortingCollection $sort): void; + + /** + * @param ?int $limit + */ + public function setLimit(?int $limit): void; + + /** + * @param ?int $offset + */ + public function setOffset(?int $offset): void; +} diff --git a/lib/commercetools-api/src/Models/BusinessUnitSearch/BusinessUnitSearchRequestBuilder.php b/lib/commercetools-api/src/Models/BusinessUnitSearch/BusinessUnitSearchRequestBuilder.php new file mode 100644 index 00000000000..3ec3a4be554 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnitSearch/BusinessUnitSearchRequestBuilder.php @@ -0,0 +1,163 @@ + + */ +final class BusinessUnitSearchRequestBuilder implements Builder +{ + /** + + * @var null|SearchQuery|SearchQueryBuilder + */ + private $query; + + /** + + * @var ?SearchSortingCollection + */ + private $sort; + + /** + + * @var ?int + */ + private $limit; + + /** + + * @var ?int + */ + private $offset; + + /** + *The Business Unit Search query.
+ * + + * @return null|SearchQuery + */ + public function getQuery() + { + return $this->query instanceof SearchQueryBuilder ? $this->query->build() : $this->query; + } + + /** + *Controls how results to your query are sorted. If not provided, the results are sorted by relevance in descending order.
+ * + + * @return null|SearchSortingCollection + */ + public function getSort() + { + return $this->sort; + } + + /** + *The maximum number of search results to be returned.
+ * + + * @return null|int + */ + public function getLimit() + { + return $this->limit; + } + + /** + *The number of search results to be skipped in the response for pagination.
+ * + + * @return null|int + */ + public function getOffset() + { + return $this->offset; + } + + /** + * @param ?SearchQuery $query + * @return $this + */ + public function withQuery(?SearchQuery $query) + { + $this->query = $query; + + return $this; + } + + /** + * @param ?SearchSortingCollection $sort + * @return $this + */ + public function withSort(?SearchSortingCollection $sort) + { + $this->sort = $sort; + + return $this; + } + + /** + * @param ?int $limit + * @return $this + */ + public function withLimit(?int $limit) + { + $this->limit = $limit; + + return $this; + } + + /** + * @param ?int $offset + * @return $this + */ + public function withOffset(?int $offset) + { + $this->offset = $offset; + + return $this; + } + + /** + * @deprecated use withQuery() instead + * @return $this + */ + public function withQueryBuilder(?SearchQueryBuilder $query) + { + $this->query = $query; + + return $this; + } + + public function build(): BusinessUnitSearchRequest + { + return new BusinessUnitSearchRequestModel( + $this->query instanceof SearchQueryBuilder ? $this->query->build() : $this->query, + $this->sort, + $this->limit, + $this->offset + ); + } + + public static function of(): BusinessUnitSearchRequestBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnitSearch/BusinessUnitSearchRequestCollection.php b/lib/commercetools-api/src/Models/BusinessUnitSearch/BusinessUnitSearchRequestCollection.php new file mode 100644 index 00000000000..35755a36179 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnitSearch/BusinessUnitSearchRequestCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitSearchRequest current() + * @method BusinessUnitSearchRequest end() + * @method BusinessUnitSearchRequest at($offset) + */ +class BusinessUnitSearchRequestCollection extends MapperSequence +{ + /** + * @psalm-assert BusinessUnitSearchRequest $value + * @psalm-param BusinessUnitSearchRequest|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitSearchRequestCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitSearchRequest) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitSearchRequest + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitSearchRequest { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitSearchRequest $data */ + $data = BusinessUnitSearchRequestModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnitSearch/BusinessUnitSearchRequestModel.php b/lib/commercetools-api/src/Models/BusinessUnitSearch/BusinessUnitSearchRequestModel.php new file mode 100644 index 00000000000..bc75476d62d --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnitSearch/BusinessUnitSearchRequestModel.php @@ -0,0 +1,178 @@ +query = $query; + $this->sort = $sort; + $this->limit = $limit; + $this->offset = $offset; + } + + /** + *The Business Unit Search query.
+ * + * + * @return null|SearchQuery + */ + public function getQuery() + { + if (is_null($this->query)) { + /** @psalm-var stdClass|arrayControls how results to your query are sorted. If not provided, the results are sorted by relevance in descending order.
+ * + * + * @return null|SearchSortingCollection + */ + public function getSort() + { + if (is_null($this->sort)) { + /** @psalm-var ?listThe maximum number of search results to be returned.
+ * + * + * @return null|int + */ + public function getLimit() + { + if (is_null($this->limit)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_LIMIT); + if (is_null($data)) { + return null; + } + $this->limit = (int) $data; + } + + return $this->limit; + } + + /** + *The number of search results to be skipped in the response for pagination.
+ * + * + * @return null|int + */ + public function getOffset() + { + if (is_null($this->offset)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_OFFSET); + if (is_null($data)) { + return null; + } + $this->offset = (int) $data; + } + + return $this->offset; + } + + + /** + * @param ?SearchQuery $query + */ + public function setQuery(?SearchQuery $query): void + { + $this->query = $query; + } + + /** + * @param ?SearchSortingCollection $sort + */ + public function setSort(?SearchSortingCollection $sort): void + { + $this->sort = $sort; + } + + /** + * @param ?int $limit + */ + public function setLimit(?int $limit): void + { + $this->limit = $limit; + } + + /** + * @param ?int $offset + */ + public function setOffset(?int $offset): void + { + $this->offset = $offset; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnitSearch/BusinessUnitSearchResult.php b/lib/commercetools-api/src/Models/BusinessUnitSearch/BusinessUnitSearchResult.php new file mode 100644 index 00000000000..faf5a752154 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnitSearch/BusinessUnitSearchResult.php @@ -0,0 +1,44 @@ +id of the BusinessUnit matching the search query.
+ *
+
+ * @return null|string
+ */
+ public function getId();
+
+ /**
+ * How closely this customer matches the search query.
+ * + + * @return null|float + */ + public function getRelevance(); + + /** + * @param ?string $id + */ + public function setId(?string $id): void; + + /** + * @param ?float $relevance + */ + public function setRelevance(?float $relevance): void; +} diff --git a/lib/commercetools-api/src/Models/BusinessUnitSearch/BusinessUnitSearchResultBuilder.php b/lib/commercetools-api/src/Models/BusinessUnitSearch/BusinessUnitSearchResultBuilder.php new file mode 100644 index 00000000000..7fdc7947b5f --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnitSearch/BusinessUnitSearchResultBuilder.php @@ -0,0 +1,92 @@ + + */ +final class BusinessUnitSearchResultBuilder implements Builder +{ + /** + + * @var ?string + */ + private $id; + + /** + + * @var ?float + */ + private $relevance; + + /** + *id of the BusinessUnit matching the search query.
How closely this customer matches the search query.
+ * + + * @return null|float + */ + public function getRelevance() + { + return $this->relevance; + } + + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?float $relevance + * @return $this + */ + public function withRelevance(?float $relevance) + { + $this->relevance = $relevance; + + return $this; + } + + + public function build(): BusinessUnitSearchResult + { + return new BusinessUnitSearchResultModel( + $this->id, + $this->relevance + ); + } + + public static function of(): BusinessUnitSearchResultBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnitSearch/BusinessUnitSearchResultCollection.php b/lib/commercetools-api/src/Models/BusinessUnitSearch/BusinessUnitSearchResultCollection.php new file mode 100644 index 00000000000..750a633fff0 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnitSearch/BusinessUnitSearchResultCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitSearchResult current() + * @method BusinessUnitSearchResult end() + * @method BusinessUnitSearchResult at($offset) + */ +class BusinessUnitSearchResultCollection extends MapperSequence +{ + /** + * @psalm-assert BusinessUnitSearchResult $value + * @psalm-param BusinessUnitSearchResult|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitSearchResultCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitSearchResult) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitSearchResult + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitSearchResult { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitSearchResult $data */ + $data = BusinessUnitSearchResultModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnitSearch/BusinessUnitSearchResultModel.php b/lib/commercetools-api/src/Models/BusinessUnitSearch/BusinessUnitSearchResultModel.php new file mode 100644 index 00000000000..9aa1e7483d6 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnitSearch/BusinessUnitSearchResultModel.php @@ -0,0 +1,102 @@ +id = $id; + $this->relevance = $relevance; + } + + /** + *id of the BusinessUnit matching the search query.
How closely this customer matches the search query.
+ * + * + * @return null|float + */ + public function getRelevance() + { + if (is_null($this->relevance)) { + /** @psalm-var ?float $data */ + $data = $this->raw(self::FIELD_RELEVANCE); + if (is_null($data)) { + return null; + } + $this->relevance = (float) $data; + } + + return $this->relevance; + } + + + /** + * @param ?string $id + */ + public function setId(?string $id): void + { + $this->id = $id; + } + + /** + * @param ?float $relevance + */ + public function setRelevance(?float $relevance): void + { + $this->relevance = $relevance; + } +} diff --git a/lib/commercetools-api/src/Models/Project/ProjectChangeBusinessUnitSearchStatusAction.php b/lib/commercetools-api/src/Models/Project/ProjectChangeBusinessUnitSearchStatusAction.php new file mode 100644 index 00000000000..6e4b743377b --- /dev/null +++ b/lib/commercetools-api/src/Models/Project/ProjectChangeBusinessUnitSearchStatusAction.php @@ -0,0 +1,30 @@ +Activates or deactivates the Search Business Units feature. Activation will trigger building a search index for the Business Units in the Project. + * + + * @return null|string + */ + public function getStatus(); + + /** + * @param ?string $status + */ + public function setStatus(?string $status): void; +} diff --git a/lib/commercetools-api/src/Models/Project/ProjectChangeBusinessUnitSearchStatusActionBuilder.php b/lib/commercetools-api/src/Models/Project/ProjectChangeBusinessUnitSearchStatusActionBuilder.php new file mode 100644 index 00000000000..02a7451eb3e --- /dev/null +++ b/lib/commercetools-api/src/Models/Project/ProjectChangeBusinessUnitSearchStatusActionBuilder.php @@ -0,0 +1,63 @@ + + */ +final class ProjectChangeBusinessUnitSearchStatusActionBuilder implements Builder +{ + /** + + * @var ?string + */ + private $status; + + /** + *Activates or deactivates the Search Business Units feature. Activation will trigger building a search index for the Business Units in the Project.
+ * + + * @return null|string + */ + public function getStatus() + { + return $this->status; + } + + /** + * @param ?string $status + * @return $this + */ + public function withStatus(?string $status) + { + $this->status = $status; + + return $this; + } + + + public function build(): ProjectChangeBusinessUnitSearchStatusAction + { + return new ProjectChangeBusinessUnitSearchStatusActionModel( + $this->status + ); + } + + public static function of(): ProjectChangeBusinessUnitSearchStatusActionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Project/ProjectChangeBusinessUnitSearchStatusActionCollection.php b/lib/commercetools-api/src/Models/Project/ProjectChangeBusinessUnitSearchStatusActionCollection.php new file mode 100644 index 00000000000..9ffb0337f62 --- /dev/null +++ b/lib/commercetools-api/src/Models/Project/ProjectChangeBusinessUnitSearchStatusActionCollection.php @@ -0,0 +1,56 @@ + + * @method ProjectChangeBusinessUnitSearchStatusAction current() + * @method ProjectChangeBusinessUnitSearchStatusAction end() + * @method ProjectChangeBusinessUnitSearchStatusAction at($offset) + */ +class ProjectChangeBusinessUnitSearchStatusActionCollection extends ProjectUpdateActionCollection +{ + /** + * @psalm-assert ProjectChangeBusinessUnitSearchStatusAction $value + * @psalm-param ProjectChangeBusinessUnitSearchStatusAction|stdClass $value + * @throws InvalidArgumentException + * + * @return ProjectChangeBusinessUnitSearchStatusActionCollection + */ + public function add($value) + { + if (!$value instanceof ProjectChangeBusinessUnitSearchStatusAction) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?ProjectChangeBusinessUnitSearchStatusAction + */ + protected function mapper() + { + return function (?int $index): ?ProjectChangeBusinessUnitSearchStatusAction { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var ProjectChangeBusinessUnitSearchStatusAction $data */ + $data = ProjectChangeBusinessUnitSearchStatusActionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Project/ProjectChangeBusinessUnitSearchStatusActionModel.php b/lib/commercetools-api/src/Models/Project/ProjectChangeBusinessUnitSearchStatusActionModel.php new file mode 100644 index 00000000000..234e3ef5c72 --- /dev/null +++ b/lib/commercetools-api/src/Models/Project/ProjectChangeBusinessUnitSearchStatusActionModel.php @@ -0,0 +1,93 @@ +status = $status; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } + + /** + *Activates or deactivates the Search Business Units feature. Activation will trigger building a search index for the Business Units in the Project.
+ * + * + * @return null|string + */ + public function getStatus() + { + if (is_null($this->status)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_STATUS); + if (is_null($data)) { + return null; + } + $this->status = (string) $data; + } + + return $this->status; + } + + + /** + * @param ?string $status + */ + public function setStatus(?string $status): void + { + $this->status = $status; + } +} diff --git a/lib/commercetools-api/src/Models/Project/ProjectUpdateActionModel.php b/lib/commercetools-api/src/Models/Project/ProjectUpdateActionModel.php index 53cd41dd948..20bf969c027 100644 --- a/lib/commercetools-api/src/Models/Project/ProjectUpdateActionModel.php +++ b/lib/commercetools-api/src/Models/Project/ProjectUpdateActionModel.php @@ -31,6 +31,7 @@ final class ProjectUpdateActionModel extends JsonObjectModel implements ProjectU * */ private static $discriminatorClasses = [ + 'changeBusinessUnitSearchStatus' => ProjectChangeBusinessUnitSearchStatusActionModel::class, 'changeCartsConfiguration' => ProjectChangeCartsConfigurationActionModel::class, 'changeCountries' => ProjectChangeCountriesActionModel::class, 'changeCountryTaxRateFallbackEnabled' => ProjectChangeCountryTaxRateFallbackEnabledActionModel::class, diff --git a/lib/commercetools-api/src/Models/Project/SearchIndexingConfiguration.php b/lib/commercetools-api/src/Models/Project/SearchIndexingConfiguration.php index 79ef199a0fc..fe787594f74 100644 --- a/lib/commercetools-api/src/Models/Project/SearchIndexingConfiguration.php +++ b/lib/commercetools-api/src/Models/Project/SearchIndexingConfiguration.php @@ -17,6 +17,7 @@ interface SearchIndexingConfiguration extends JsonObject public const FIELD_PRODUCTS_SEARCH = 'productsSearch'; public const FIELD_ORDERS = 'orders'; public const FIELD_CUSTOMERS = 'customers'; + public const FIELD_BUSINESS_UNITS = 'businessUnits'; /** *Configuration for the Product Projection Search and Product Suggestions endpoints.
@@ -50,6 +51,14 @@ public function getOrders(); */ public function getCustomers(); + /** + *Configuration for the Business Unit Search feature.
+ * + + * @return null|SearchIndexingConfigurationValues + */ + public function getBusinessUnits(); + /** * @param ?SearchIndexingConfigurationValues $products */ @@ -69,4 +78,9 @@ public function setOrders(?SearchIndexingConfigurationValues $orders): void; * @param ?SearchIndexingConfigurationValues $customers */ public function setCustomers(?SearchIndexingConfigurationValues $customers): void; + + /** + * @param ?SearchIndexingConfigurationValues $businessUnits + */ + public function setBusinessUnits(?SearchIndexingConfigurationValues $businessUnits): void; } diff --git a/lib/commercetools-api/src/Models/Project/SearchIndexingConfigurationBuilder.php b/lib/commercetools-api/src/Models/Project/SearchIndexingConfigurationBuilder.php index c7d14b8322a..7f1f7f265cb 100644 --- a/lib/commercetools-api/src/Models/Project/SearchIndexingConfigurationBuilder.php +++ b/lib/commercetools-api/src/Models/Project/SearchIndexingConfigurationBuilder.php @@ -44,6 +44,12 @@ final class SearchIndexingConfigurationBuilder implements Builder */ private $customers; + /** + + * @var null|SearchIndexingConfigurationValues|SearchIndexingConfigurationValuesBuilder + */ + private $businessUnits; + /** *Configuration for the Product Projection Search and Product Suggestions endpoints.
* @@ -88,6 +94,17 @@ public function getCustomers() return $this->customers instanceof SearchIndexingConfigurationValuesBuilder ? $this->customers->build() : $this->customers; } + /** + *Configuration for the Business Unit Search feature.
+ * + + * @return null|SearchIndexingConfigurationValues + */ + public function getBusinessUnits() + { + return $this->businessUnits instanceof SearchIndexingConfigurationValuesBuilder ? $this->businessUnits->build() : $this->businessUnits; + } + /** * @param ?SearchIndexingConfigurationValues $products * @return $this @@ -132,6 +149,17 @@ public function withCustomers(?SearchIndexingConfigurationValues $customers) return $this; } + /** + * @param ?SearchIndexingConfigurationValues $businessUnits + * @return $this + */ + public function withBusinessUnits(?SearchIndexingConfigurationValues $businessUnits) + { + $this->businessUnits = $businessUnits; + + return $this; + } + /** * @deprecated use withProducts() instead * @return $this @@ -176,13 +204,25 @@ public function withCustomersBuilder(?SearchIndexingConfigurationValuesBuilder $ return $this; } + /** + * @deprecated use withBusinessUnits() instead + * @return $this + */ + public function withBusinessUnitsBuilder(?SearchIndexingConfigurationValuesBuilder $businessUnits) + { + $this->businessUnits = $businessUnits; + + return $this; + } + public function build(): SearchIndexingConfiguration { return new SearchIndexingConfigurationModel( $this->products instanceof SearchIndexingConfigurationValuesBuilder ? $this->products->build() : $this->products, $this->productsSearch instanceof SearchIndexingConfigurationValuesBuilder ? $this->productsSearch->build() : $this->productsSearch, $this->orders instanceof SearchIndexingConfigurationValuesBuilder ? $this->orders->build() : $this->orders, - $this->customers instanceof SearchIndexingConfigurationValuesBuilder ? $this->customers->build() : $this->customers + $this->customers instanceof SearchIndexingConfigurationValuesBuilder ? $this->customers->build() : $this->customers, + $this->businessUnits instanceof SearchIndexingConfigurationValuesBuilder ? $this->businessUnits->build() : $this->businessUnits ); } diff --git a/lib/commercetools-api/src/Models/Project/SearchIndexingConfigurationModel.php b/lib/commercetools-api/src/Models/Project/SearchIndexingConfigurationModel.php index d8405925d0c..5958fa720ec 100644 --- a/lib/commercetools-api/src/Models/Project/SearchIndexingConfigurationModel.php +++ b/lib/commercetools-api/src/Models/Project/SearchIndexingConfigurationModel.php @@ -43,6 +43,12 @@ final class SearchIndexingConfigurationModel extends JsonObjectModel implements */ protected $customers; + /** + * + * @var ?SearchIndexingConfigurationValues + */ + protected $businessUnits; + /** * @psalm-suppress MissingParamType @@ -51,12 +57,14 @@ public function __construct( ?SearchIndexingConfigurationValues $products = null, ?SearchIndexingConfigurationValues $productsSearch = null, ?SearchIndexingConfigurationValues $orders = null, - ?SearchIndexingConfigurationValues $customers = null + ?SearchIndexingConfigurationValues $customers = null, + ?SearchIndexingConfigurationValues $businessUnits = null ) { $this->products = $products; $this->productsSearch = $productsSearch; $this->orders = $orders; $this->customers = $customers; + $this->businessUnits = $businessUnits; } /** @@ -143,6 +151,27 @@ public function getCustomers() return $this->customers; } + /** + *Configuration for the Business Unit Search feature.
+ * + * + * @return null|SearchIndexingConfigurationValues + */ + public function getBusinessUnits() + { + if (is_null($this->businessUnits)) { + /** @psalm-var stdClass|array