diff --git a/init.php b/init.php index 3790014..d5fad70 100644 --- a/init.php +++ b/init.php @@ -1735,6 +1735,9 @@ require_once __DIR__ . '/src/Endpoint/Reviews/GetListOfProjectReviewsResponse/GetListOfProjectReviewsResponse/Data/Reviews.php'; require_once __DIR__ . '/src/Endpoint/Reviews/GetListOfProjectReviewsResponse/GetListOfProjectReviewsResponse/Data/Reviews/Item.php'; require_once __DIR__ . '/src/Endpoint/Reviews/GetListOfProjectReviewsResponse/GetListOfProjectReviewsResponse/Data/Reviews/Item/Reaction.php'; +require_once __DIR__ . '/src/Endpoint/Reviews/GetReviewsSettings.php'; +require_once __DIR__ . '/src/Endpoint/Reviews/GetReviewsSettingsResponse/GetReviewsSettingsResponse.php'; +require_once __DIR__ . '/src/Endpoint/Reviews/GetReviewsSettingsResponse/GetReviewsSettingsResponse/Data.php'; require_once __DIR__ . '/src/Endpoint/Reviews/UpdateProductReview.php'; require_once __DIR__ . '/src/Endpoint/Reviews/UpdateProductReviewRequest/UpdateProductReviewRequest.php'; require_once __DIR__ . '/src/Endpoint/Reviews/UpdateProductReviewRequest/UpdateProductReviewRequest/Data.php'; diff --git a/src/Endpoint/EndpointMap.php b/src/Endpoint/EndpointMap.php index 0966756..b6c3f62 100644 --- a/src/Endpoint/EndpointMap.php +++ b/src/Endpoint/EndpointMap.php @@ -197,6 +197,7 @@ class EndpointMap '/api/system/jobs/{jobId}' => 'Shoptet\Api\Sdk\Php\Endpoint\Jobs\GetJobDetail', '/api/system/files' => 'Shoptet\Api\Sdk\Php\Endpoint\Files\GetListOfUploadedFiles', '/api/system/endpoints' => 'Shoptet\Api\Sdk\Php\Endpoint\Endpoints\GetListOfAvailableEndpoints', + '/api/reviews/settings' => 'Shoptet\Api\Sdk\Php\Endpoint\Reviews\GetReviewsSettings', '/api/reviews/products' => 'Shoptet\Api\Sdk\Php\Endpoint\Reviews\GetListOfProductsReviews', '/api/reviews/project' => 'Shoptet\Api\Sdk\Php\Endpoint\Reviews\GetListOfProjectReviews', ], diff --git a/src/Endpoint/Reviews/GetReviewsSettings.php b/src/Endpoint/Reviews/GetReviewsSettings.php new file mode 100644 index 0000000..ffe21dd --- /dev/null +++ b/src/Endpoint/Reviews/GetReviewsSettings.php @@ -0,0 +1,33 @@ + false]; + + public function getRequestEntityClass(): null + { + return null; + } + + public function getResponseEntityClass(): string + { + return GetReviewsSettingsResponse::class; + } + + public function getEndpoint(): string + { + return '/api/reviews/settings'; + } +} diff --git a/src/Endpoint/Reviews/GetReviewsSettingsResponse/GetReviewsSettingsResponse.php b/src/Endpoint/Reviews/GetReviewsSettingsResponse/GetReviewsSettingsResponse.php new file mode 100644 index 0000000..bfb3321 --- /dev/null +++ b/src/Endpoint/Reviews/GetReviewsSettingsResponse/GetReviewsSettingsResponse.php @@ -0,0 +1,48 @@ +data; + } + + public function setData(?Data $data): static + { + $this->data = $data; + return $this; + } + + public function getErrors(): ?Errors + { + return $this->errors; + } + + public function setErrors(?Errors $errors): static + { + $this->errors = $errors; + return $this; + } + + public function getMetadata(): ?Metadata + { + return $this->metadata; + } + + public function setMetadata(?Metadata $metadata): static + { + $this->metadata = $metadata; + return $this; + } +} diff --git a/src/Endpoint/Reviews/GetReviewsSettingsResponse/GetReviewsSettingsResponse/Data.php b/src/Endpoint/Reviews/GetReviewsSettingsResponse/GetReviewsSettingsResponse/Data.php new file mode 100644 index 0000000..c33a315 --- /dev/null +++ b/src/Endpoint/Reviews/GetReviewsSettingsResponse/GetReviewsSettingsResponse/Data.php @@ -0,0 +1,141 @@ +showDiscussion; + } + + public function setShowDiscussion(bool $showDiscussion): static + { + $this->showDiscussion = $showDiscussion; + return $this; + } + + public function getAuthorizationType(): string + { + return $this->authorizationType; + } + + public function setAuthorizationType(string $authorizationType): static + { + $this->authorizationType = $authorizationType; + return $this; + } + + public function isOnlyRegisteredUsers(): bool + { + return $this->onlyRegisteredUsers; + } + + public function setOnlyRegisteredUsers(bool $onlyRegisteredUsers): static + { + $this->onlyRegisteredUsers = $onlyRegisteredUsers; + return $this; + } + + public function isCommentAndFullNameRequired(): bool + { + return $this->commentAndFullNameRequired; + } + + public function setCommentAndFullNameRequired(bool $commentAndFullNameRequired): static + { + $this->commentAndFullNameRequired = $commentAndFullNameRequired; + return $this; + } + + public function isSendConfirmationEmail(): bool + { + return $this->sendConfirmationEmail; + } + + public function setSendConfirmationEmail(bool $sendConfirmationEmail): static + { + $this->sendConfirmationEmail = $sendConfirmationEmail; + return $this; + } + + public function isShowVerificationInfo(): bool + { + return $this->showVerificationInfo; + } + + public function setShowVerificationInfo(bool $showVerificationInfo): static + { + $this->showVerificationInfo = $showVerificationInfo; + return $this; + } + + public function getReviewsPerPage(): int + { + return $this->reviewsPerPage; + } + + public function setReviewsPerPage(int $reviewsPerPage): static + { + $this->reviewsPerPage = $reviewsPerPage; + return $this; + } + + public function isStoreRatingEnabled(): bool + { + return $this->storeRatingEnabled; + } + + public function setStoreRatingEnabled(bool $storeRatingEnabled): static + { + $this->storeRatingEnabled = $storeRatingEnabled; + return $this; + } + + public function isStoreRatingCommentsRequired(): bool + { + return $this->storeRatingCommentsRequired; + } + + public function setStoreRatingCommentsRequired(bool $storeRatingCommentsRequired): static + { + $this->storeRatingCommentsRequired = $storeRatingCommentsRequired; + return $this; + } + + public function isStoreRatingShowVerificationInfo(): bool + { + return $this->storeRatingShowVerificationInfo; + } + + public function setStoreRatingShowVerificationInfo(bool $storeRatingShowVerificationInfo): static + { + $this->storeRatingShowVerificationInfo = $storeRatingShowVerificationInfo; + return $this; + } + + public function isVerificationIconAllowed(): bool + { + return $this->verificationIconAllowed; + } + + public function setVerificationIconAllowed(bool $verificationIconAllowed): static + { + $this->verificationIconAllowed = $verificationIconAllowed; + return $this; + } +} diff --git a/src/Sdk.php b/src/Sdk.php index 7c2b6c5..40f7904 100644 --- a/src/Sdk.php +++ b/src/Sdk.php @@ -388,6 +388,7 @@ use Shoptet\Api\Sdk\Php\Endpoint\Reviews\CreateProjectReviewRequest\CreateProjectReviewRequest; use Shoptet\Api\Sdk\Php\Endpoint\Reviews\GetListOfProductsReviews; use Shoptet\Api\Sdk\Php\Endpoint\Reviews\GetListOfProjectReviews; +use Shoptet\Api\Sdk\Php\Endpoint\Reviews\GetReviewsSettings; use Shoptet\Api\Sdk\Php\Endpoint\Reviews\UpdateProductReview; use Shoptet\Api\Sdk\Php\Endpoint\Reviews\UpdateProductReviewRequest\UpdateProductReviewRequest; use Shoptet\Api\Sdk\Php\Endpoint\Reviews\UpdateProjectReview; @@ -8636,6 +8637,26 @@ public static function getListOfAvailableEndpoints(array $queryParams = []): Res ->execute(); } + /** + * @param array{ + * language?: string, + * } $queryParams + * + * @return ResponseInterface + * + * @throws LogicException + * @throws RuntimeException + * + * @see https://api.docs.shoptet.com/shoptet-api/openapi/Reviews/getreviewssettings + */ + public static function getReviewsSettings(array $queryParams = []): ResponseInterface + { + return self::getEndpointFactory() + ->createEndpoint(GetReviewsSettings::class) + ->setQueryParams($queryParams) + ->execute(); + } + /** * @param array{ * language?: string,