Skip to content

Commit

Permalink
build(codegen): updating SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
ct-sdks[bot] committed Sep 26, 2024
1 parent 2f03c5d commit 7d85b38
Show file tree
Hide file tree
Showing 12 changed files with 445 additions and 0 deletions.
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

0 comments on commit 7d85b38

Please sign in to comment.