Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions init.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
1 change: 1 addition & 0 deletions src/Endpoint/EndpointMap.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
],
Expand Down
33 changes: 33 additions & 0 deletions src/Endpoint/Reviews/GetReviewsSettings.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace Shoptet\Api\Sdk\Php\Endpoint\Reviews;

use Shoptet\Api\Sdk\Php\Endpoint\Get;
use Shoptet\Api\Sdk\Php\Endpoint\Reviews\GetReviewsSettingsResponse\GetReviewsSettingsResponse;

/**
* @see https://api.docs.shoptet.com/shoptet-api/openapi/Reviews/getreviewssettings
*
* @method GetReviewsSettings setBody(null $entity)
* @method null getBody()
*/
class GetReviewsSettings extends Get
{
protected array $supportedPathParams = [];
protected array $supportedQueryParams = ['language' => false];

public function getRequestEntityClass(): null
{
return null;
}

public function getResponseEntityClass(): string
{
return GetReviewsSettingsResponse::class;
}

public function getEndpoint(): string
{
return '/api/reviews/settings';
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?php

namespace Shoptet\Api\Sdk\Php\Endpoint\Reviews\GetReviewsSettingsResponse;

use Shoptet\Api\Sdk\Php\Component\Entity\Entity;
use Shoptet\Api\Sdk\Php\Component\Entity\Errors;
use Shoptet\Api\Sdk\Php\Component\Entity\Metadata;
use Shoptet\Api\Sdk\Php\Endpoint\Reviews\GetReviewsSettingsResponse\GetReviewsSettingsResponse\Data;

class GetReviewsSettingsResponse extends Entity
{
protected ?Data $data;
protected ?Errors $errors;
protected ?Metadata $metadata;

public function getData(): ?Data
{
return $this->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;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
<?php

namespace Shoptet\Api\Sdk\Php\Endpoint\Reviews\GetReviewsSettingsResponse\GetReviewsSettingsResponse;

use Shoptet\Api\Sdk\Php\Component\Entity\Entity;

class Data extends Entity
{
protected bool $showDiscussion;
protected string $authorizationType;
protected bool $onlyRegisteredUsers;
protected bool $commentAndFullNameRequired;
protected bool $sendConfirmationEmail;
protected bool $showVerificationInfo;
protected int $reviewsPerPage;
protected bool $storeRatingEnabled;
protected bool $storeRatingCommentsRequired;
protected bool $storeRatingShowVerificationInfo;
protected bool $verificationIconAllowed;

public function isShowDiscussion(): bool
{
return $this->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;
}
}
21 changes: 21 additions & 0 deletions src/Sdk.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand Down
Loading