Skip to content

Commit

Permalink
Merge pull request #245 from commercetools/gen-sdk-updates
Browse files Browse the repository at this point in the history
Update generated SDKs
  • Loading branch information
kodiakhq[bot] authored Oct 7, 2024
2 parents 692c6ca + ee5912f commit 650a7a2
Show file tree
Hide file tree
Showing 13 changed files with 345 additions and 3 deletions.
8 changes: 8 additions & 0 deletions changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,11 @@
- added enum `product-tailoring` to type `ResourceTypeId`
</details>

**Import changes**

<details>
<summary>Added Type(s)</summary>

- added type `InvalidFieldsUpdateError`
</details>

Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public function getDescription();

/**
* <p>User-defined unique identifier of the DiscountCode that is used by the customer to apply the discount.</p>
* <p>The value cannot be updated. Attempting to update the value will result in an <a href="/error#invalidfieldsupdateerror">InvalidFieldsUpdate</a> error.</p>
*
* @return null|string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ public function getDescription()

/**
* <p>User-defined unique identifier of the DiscountCode that is used by the customer to apply the discount.</p>
* <p>The value cannot be updated. Attempting to update the value will result in an <a href="/error#invalidfieldsupdateerror">InvalidFieldsUpdate</a> error.</p>
*
* @return null|string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ public function getDescription()

/**
* <p>User-defined unique identifier of the DiscountCode that is used by the customer to apply the discount.</p>
* <p>The value cannot be updated. Attempting to update the value will result in an <a href="/error#invalidfieldsupdateerror">InvalidFieldsUpdate</a> error.</p>
*
*
* @return null|string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ final class ErrorObjectModel extends JsonObjectModel implements ErrorObject
'Generic' => GenericErrorModel::class,
'InvalidCredentials' => InvalidCredentialsErrorModel::class,
'InvalidField' => InvalidFieldErrorModel::class,
'InvalidFieldUpdate' => InvalidFieldsUpdateErrorModel::class,
'InvalidInput' => InvalidInputModel::class,
'InvalidJsonInput' => InvalidJsonInputModel::class,
'InvalidOperation' => InvalidOperationModel::class,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?php

declare(strict_types=1);
/**
* This file has been auto generated
* Do not change it.
*/

namespace Commercetools\Import\Models\Errors;

use Commercetools\Base\DateTimeImmutableCollection;
use Commercetools\Base\JsonObject;

interface InvalidFieldsUpdateError extends ErrorObject
{
public const FIELD_FIELDS = 'fields';

/**
* <p><code>&quot;The following fields are currently not supported for changes/updates&quot;</code></p>
*
* @return null|string
*/
public function getMessage();

/**
* <p>Fields that cannot be updated.</p>
*
* @return null|array
*/
public function getFields();

/**
* @param ?string $message
*/
public function setMessage(?string $message): void;

/**
* @param ?array $fields
*/
public function setFields(?array $fields): void;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
<?php

declare(strict_types=1);
/**
* This file has been auto generated
* Do not change it.
*/

namespace Commercetools\Import\Models\Errors;

use Commercetools\Base\Builder;
use Commercetools\Base\DateTimeImmutableCollection;
use Commercetools\Base\JsonObject;
use Commercetools\Base\JsonObjectModel;
use Commercetools\Base\MapperFactory;
use stdClass;

/**
* @implements Builder<InvalidFieldsUpdateError>
*/
final class InvalidFieldsUpdateErrorBuilder implements Builder
{
/**
* @var ?string
*/
private $message;

/**
* @var ?array
*/
private $fields;

/**
* <p><code>&quot;The following fields are currently not supported for changes/updates&quot;</code></p>
*
* @return null|string
*/
public function getMessage()
{
return $this->message;
}

/**
* <p>Fields that cannot be updated.</p>
*
* @return null|array
*/
public function getFields()
{
return $this->fields;
}

/**
* @param ?string $message
* @return $this
*/
public function withMessage(?string $message)
{
$this->message = $message;

return $this;
}

/**
* @param ?array $fields
* @return $this
*/
public function withFields(?array $fields)
{
$this->fields = $fields;

return $this;
}


public function build(): InvalidFieldsUpdateError
{
return new InvalidFieldsUpdateErrorModel(
$this->message,
$this->fields
);
}

public static function of(): InvalidFieldsUpdateErrorBuilder
{
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\Import\Models\Errors;

use Commercetools\Exception\InvalidArgumentException;
use Commercetools\Import\Models\Errors\ErrorObjectCollection;
use stdClass;

/**
* @extends ErrorObjectCollection<InvalidFieldsUpdateError>
* @method InvalidFieldsUpdateError current()
* @method InvalidFieldsUpdateError end()
* @method InvalidFieldsUpdateError at($offset)
*/
class InvalidFieldsUpdateErrorCollection extends ErrorObjectCollection
{
/**
* @psalm-assert InvalidFieldsUpdateError $value
* @psalm-param InvalidFieldsUpdateError|stdClass $value
* @throws InvalidArgumentException
*
* @return InvalidFieldsUpdateErrorCollection
*/
public function add($value)
{
if (!$value instanceof InvalidFieldsUpdateError) {
throw new InvalidArgumentException();
}
$this->store($value);

return $this;
}

/**
* @psalm-return callable(int):?InvalidFieldsUpdateError
*/
protected function mapper()
{
return function (?int $index): ?InvalidFieldsUpdateError {
$data = $this->get($index);
if ($data instanceof stdClass) {
/** @var InvalidFieldsUpdateError $data */
$data = InvalidFieldsUpdateErrorModel::of($data);
$this->set($data, $index);
}

return $data;
};
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
<?php

declare(strict_types=1);
/**
* This file has been auto generated
* Do not change it.
*/

namespace Commercetools\Import\Models\Errors;

use Commercetools\Base\DateTimeImmutableCollection;
use Commercetools\Base\JsonObject;
use Commercetools\Base\JsonObjectModel;
use Commercetools\Base\MapperFactory;
use stdClass;

/**
* @internal
*/
final class InvalidFieldsUpdateErrorModel extends JsonObjectModel implements InvalidFieldsUpdateError
{
public const DISCRIMINATOR_VALUE = 'InvalidFieldUpdate';
/**
*
* @var ?string
*/
protected $code;

/**
*
* @var ?string
*/
protected $message;

/**
*
* @var ?array
*/
protected $fields;


/**
* @psalm-suppress MissingParamType
*/
public function __construct(
?string $message = null,
?array $fields = null,
?string $code = null
) {
$this->message = $message;
$this->fields = $fields;
$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;
}

/**
* <p><code>&quot;The following fields are currently not supported for changes/updates&quot;</code></p>
*
*
* @return null|string
*/
public function getMessage()
{
if (is_null($this->message)) {
/** @psalm-var ?string $data */
$data = $this->raw(self::FIELD_MESSAGE);
if (is_null($data)) {
return null;
}
$this->message = (string) $data;
}

return $this->message;
}

/**
* <p>Fields that cannot be updated.</p>
*
*
* @return null|array
*/
public function getFields()
{
if (is_null($this->fields)) {
/** @psalm-var ?list<mixed> $data */
$data = $this->raw(self::FIELD_FIELDS);
if (is_null($data)) {
return null;
}
$this->fields = $data;
}

return $this->fields;
}


/**
* @param ?string $message
*/
public function setMessage(?string $message): void
{
$this->message = $message;
}

/**
* @param ?array $fields
*/
public function setFields(?array $fields): void
{
$this->fields = $fields;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public function getValue();

/**
* <p>Sets the country for which this Price is valid.</p>
* <p>The value cannot be updated. Attempting to update the value will result in an <a href="/error#invalidfieldsupdateerror">InvalidFieldsUpdate</a> error.</p>
*
* @return null|string
Expand All @@ -66,14 +67,16 @@ public function getCountry();

/**
* <p>Sets the CustomerGroup for which this Price is valid.</p>
* <p>The value cannot be updated. Attempting to update the value will result in an <a href="/error#invalidfieldsupdateerror">InvalidFieldsUpdate</a> error.</p>
*
* @return null|CustomerGroupKeyReference
*/
public function getCustomerGroup();

/**
* <p>Sets the product distribution Channel for which this Price is valid</p>
* <p>Sets the product distribution Channel for which this Price is valid.</p>
* <p>The value cannot be updated. Attempting to update the value will result in an <a href="/error#invalidfieldsupdateerror">InvalidFieldsUpdate</a> error.</p>
*
* @return null|ChannelKeyReference
Expand Down
Loading

0 comments on commit 650a7a2

Please sign in to comment.