-
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.
Merge pull request #245 from commercetools/gen-sdk-updates
Update generated SDKs
- Loading branch information
Showing
13 changed files
with
345 additions
and
3 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
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
43 changes: 43 additions & 0 deletions
43
lib/commercetools-import/src/Models/Errors/InvalidFieldsUpdateError.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,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>"The following fields are currently not supported for changes/updates"</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; | ||
} |
92 changes: 92 additions & 0 deletions
92
lib/commercetools-import/src/Models/Errors/InvalidFieldsUpdateErrorBuilder.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,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>"The following fields are currently not supported for changes/updates"</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(); | ||
} | ||
} |
56 changes: 56 additions & 0 deletions
56
lib/commercetools-import/src/Models/Errors/InvalidFieldsUpdateErrorCollection.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\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; | ||
}; | ||
} | ||
} |
129 changes: 129 additions & 0 deletions
129
lib/commercetools-import/src/Models/Errors/InvalidFieldsUpdateErrorModel.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,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>"The following fields are currently not supported for changes/updates"</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; | ||
} | ||
} |
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
Oops, something went wrong.