Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update generated SDKs #241

Merged
merged 1 commit into from
Sep 26, 2024
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
2 changes: 2 additions & 0 deletions changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
<details>
<summary>Added Type(s)</summary>

- added type `SearchNotReadyError`
- added type `GraphQLSearchNotReadyError`
- added type `ProductTailoringAttribute`
- added type `ProductTailoringSetAttributeAction`
- added type `ProductTailoringSetAttributeInAllVariantsAction`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
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();
}
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();
}
}
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;
};
}
}
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 lib/commercetools-api/src/Models/Error/SearchNotReadyError.php
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;
}
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();
}
}
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;
};
}
}
Loading
Loading