-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2f03c5d
commit 7d85b38
Showing
12 changed files
with
445 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
lib/commercetools-api/src/Models/Error/GraphQLSearchNotReadyError.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
/** | ||
* This file has been auto generated | ||
* Do not change it. | ||
*/ | ||
|
||
namespace Commercetools\Api\Models\Error; | ||
|
||
use Commercetools\Base\DateTimeImmutableCollection; | ||
use Commercetools\Base\JsonObject; | ||
|
||
interface GraphQLSearchNotReadyError extends GraphQLErrorObject | ||
{ | ||
/** | ||
* @return null|string | ||
*/ | ||
public function getCode(); | ||
} |
33 changes: 33 additions & 0 deletions
33
lib/commercetools-api/src/Models/Error/GraphQLSearchNotReadyErrorBuilder.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
/** | ||
* This file has been auto generated | ||
* Do not change it. | ||
*/ | ||
|
||
namespace Commercetools\Api\Models\Error; | ||
|
||
use Commercetools\Base\Builder; | ||
use Commercetools\Base\DateTimeImmutableCollection; | ||
use Commercetools\Base\JsonObject; | ||
use Commercetools\Base\JsonObjectModel; | ||
use Commercetools\Base\MapperFactory; | ||
use stdClass; | ||
|
||
/** | ||
* @implements Builder<GraphQLSearchNotReadyError> | ||
*/ | ||
final class GraphQLSearchNotReadyErrorBuilder implements Builder | ||
{ | ||
public function build(): GraphQLSearchNotReadyError | ||
{ | ||
return new GraphQLSearchNotReadyErrorModel( | ||
); | ||
} | ||
|
||
public static function of(): GraphQLSearchNotReadyErrorBuilder | ||
{ | ||
return new self(); | ||
} | ||
} |
56 changes: 56 additions & 0 deletions
56
lib/commercetools-api/src/Models/Error/GraphQLSearchNotReadyErrorCollection.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
/** | ||
* This file has been auto generated | ||
* Do not change it. | ||
*/ | ||
|
||
namespace Commercetools\Api\Models\Error; | ||
|
||
use Commercetools\Api\Models\Error\GraphQLErrorObjectCollection; | ||
use Commercetools\Exception\InvalidArgumentException; | ||
use stdClass; | ||
|
||
/** | ||
* @extends GraphQLErrorObjectCollection<GraphQLSearchNotReadyError> | ||
* @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; | ||
}; | ||
} | ||
} |
71 changes: 71 additions & 0 deletions
71
lib/commercetools-api/src/Models/Error/GraphQLSearchNotReadyErrorModel.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
/** | ||
* This file has been auto generated | ||
* Do not change it. | ||
*/ | ||
|
||
namespace Commercetools\Api\Models\Error; | ||
|
||
use Commercetools\Base\DateTimeImmutableCollection; | ||
use Commercetools\Base\JsonObject; | ||
use Commercetools\Base\JsonObjectModel; | ||
use Commercetools\Base\MapperFactory; | ||
use stdClass; | ||
|
||
/** | ||
* @internal | ||
*/ | ||
final class GraphQLSearchNotReadyErrorModel extends JsonObjectModel implements GraphQLSearchNotReadyError | ||
{ | ||
public const DISCRIMINATOR_VALUE = 'SearchNotReady'; | ||
/** | ||
* | ||
* @var ?string | ||
*/ | ||
protected $code; | ||
|
||
|
||
/** | ||
* @psalm-suppress MissingParamType | ||
*/ | ||
public function __construct( | ||
?string $code = null | ||
) { | ||
$this->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; | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
lib/commercetools-api/src/Models/Error/SearchNotReadyError.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
/** | ||
* This file has been auto generated | ||
* Do not change it. | ||
*/ | ||
|
||
namespace Commercetools\Api\Models\Error; | ||
|
||
use Commercetools\Base\DateTimeImmutableCollection; | ||
use Commercetools\Base\JsonObject; | ||
|
||
interface SearchNotReadyError extends ErrorObject | ||
{ | ||
/** | ||
* @return null|string | ||
*/ | ||
public function getCode(); | ||
|
||
/** | ||
* <p><code>$Search is not ready. Check the indexing-status endpoint and that the feature has been activated in the project settings.</code></p> | ||
* | ||
* @return null|string | ||
*/ | ||
public function getMessage(); | ||
|
||
/** | ||
* @param ?string $message | ||
*/ | ||
public function setMessage(?string $message): void; | ||
} |
63 changes: 63 additions & 0 deletions
63
lib/commercetools-api/src/Models/Error/SearchNotReadyErrorBuilder.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
/** | ||
* This file has been auto generated | ||
* Do not change it. | ||
*/ | ||
|
||
namespace Commercetools\Api\Models\Error; | ||
|
||
use Commercetools\Base\Builder; | ||
use Commercetools\Base\DateTimeImmutableCollection; | ||
use Commercetools\Base\JsonObject; | ||
use Commercetools\Base\JsonObjectModel; | ||
use Commercetools\Base\MapperFactory; | ||
use stdClass; | ||
|
||
/** | ||
* @implements Builder<SearchNotReadyError> | ||
*/ | ||
final class SearchNotReadyErrorBuilder implements Builder | ||
{ | ||
/** | ||
* @var ?string | ||
*/ | ||
private $message; | ||
|
||
/** | ||
* <p><code>$Search is not ready. Check the indexing-status endpoint and that the feature has been activated in the project settings.</code></p> | ||
* | ||
* @return null|string | ||
*/ | ||
public function getMessage() | ||
{ | ||
return $this->message; | ||
} | ||
|
||
/** | ||
* @param ?string $message | ||
* @return $this | ||
*/ | ||
public function withMessage(?string $message) | ||
{ | ||
$this->message = $message; | ||
|
||
return $this; | ||
} | ||
|
||
|
||
public function build(): SearchNotReadyError | ||
{ | ||
return new SearchNotReadyErrorModel( | ||
$this->message | ||
); | ||
} | ||
|
||
public static function of(): SearchNotReadyErrorBuilder | ||
{ | ||
return new self(); | ||
} | ||
} |
56 changes: 56 additions & 0 deletions
56
lib/commercetools-api/src/Models/Error/SearchNotReadyErrorCollection.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
/** | ||
* This file has been auto generated | ||
* Do not change it. | ||
*/ | ||
|
||
namespace Commercetools\Api\Models\Error; | ||
|
||
use Commercetools\Api\Models\Error\ErrorObjectCollection; | ||
use Commercetools\Exception\InvalidArgumentException; | ||
use stdClass; | ||
|
||
/** | ||
* @extends ErrorObjectCollection<SearchNotReadyError> | ||
* @method SearchNotReadyError current() | ||
* @method SearchNotReadyError end() | ||
* @method SearchNotReadyError at($offset) | ||
*/ | ||
class SearchNotReadyErrorCollection extends ErrorObjectCollection | ||
{ | ||
/** | ||
* @psalm-assert SearchNotReadyError $value | ||
* @psalm-param SearchNotReadyError|stdClass $value | ||
* @throws InvalidArgumentException | ||
* | ||
* @return SearchNotReadyErrorCollection | ||
*/ | ||
public function add($value) | ||
{ | ||
if (!$value instanceof SearchNotReadyError) { | ||
throw new InvalidArgumentException(); | ||
} | ||
$this->store($value); | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* @psalm-return callable(int):?SearchNotReadyError | ||
*/ | ||
protected function mapper() | ||
{ | ||
return function (?int $index): ?SearchNotReadyError { | ||
$data = $this->get($index); | ||
if ($data instanceof stdClass) { | ||
/** @var SearchNotReadyError $data */ | ||
$data = SearchNotReadyErrorModel::of($data); | ||
$this->set($data, $index); | ||
} | ||
|
||
return $data; | ||
}; | ||
} | ||
} |
Oops, something went wrong.