diff --git a/changes.md b/changes.md index 048f1ace496..53dc55e046b 100644 --- a/changes.md +++ b/changes.md @@ -1,19 +1,8 @@ -**Api changes** +**Import changes**
-Changed Property(s) +Removed Type(s) -- :warning: changed property `line` of type `GraphQLErrorLocation` from type `integer` to `number` -- :warning: changed property `column` of type `GraphQLErrorLocation` from type `integer` to `number` -- :warning: changed property `totalPrice` of type `StagedOrder` from type `TypedMoney` to `CentPrecisionMoney` -- :warning: changed property `totalPrice` of type `Order` from type `TypedMoney` to `CentPrecisionMoney` -
- - -
-Added QueryParameter(s) - -- added query parameter `where` to method `get /{projectKey}/product-selections/key={key}/products` -- added query parameter `where` to method `get /{projectKey}/product-selections/{ID}/products` +- :warning: removed type `ReferencedResourceNotFound`
diff --git a/lib/commercetools-import/src/Models/Errors/ErrorObjectModel.php b/lib/commercetools-import/src/Models/Errors/ErrorObjectModel.php index 672dcd87e37..43b6739772c 100644 --- a/lib/commercetools-import/src/Models/Errors/ErrorObjectModel.php +++ b/lib/commercetools-import/src/Models/Errors/ErrorObjectModel.php @@ -52,7 +52,6 @@ final class ErrorObjectModel extends JsonObjectModel implements ErrorObject 'InvalidOperation' => InvalidOperationModel::class, 'InvalidTransition' => InvalidStateTransitionErrorModel::class, 'NewMasterVariantAdditionNotAllowed' => NewMasterVariantAdditionNotAllowedErrorModel::class, - 'ReferencedResourceNotFound' => ReferencedResourceNotFoundModel::class, 'RequiredField' => RequiredFieldErrorModel::class, 'ResourceCreation' => ResourceCreationErrorModel::class, 'ResourceDeletion' => ResourceDeletionErrorModel::class, diff --git a/lib/commercetools-import/src/Models/Errors/ReferencedResourceNotFound.php b/lib/commercetools-import/src/Models/Errors/ReferencedResourceNotFound.php deleted file mode 100644 index a3160a85eea..00000000000 --- a/lib/commercetools-import/src/Models/Errors/ReferencedResourceNotFound.php +++ /dev/null @@ -1,77 +0,0 @@ -"The referenced object of type $typeId $predicate was not found. It either doesn't exist, or it can't be accessed from this endpoint (e.g., if the endpoint filters by store or customer account)."

- * - - * @return null|string - */ - public function getMessage(); - - /** - *

Type of referenced resource.

- * - - * @return null|string - */ - public function getTypeId(); - - /** - *

Unique identifier of the referenced resource, if known.

- * - - * @return null|string - */ - public function getId(); - - /** - *

User-defined unique identifier of the referenced resource, if known.

- * - - * @return null|string - */ - public function getKey(); - - /** - * @param ?string $message - */ - public function setMessage(?string $message): void; - - /** - * @param ?string $typeId - */ - public function setTypeId(?string $typeId): void; - - /** - * @param ?string $id - */ - public function setId(?string $id): void; - - /** - * @param ?string $key - */ - public function setKey(?string $key): void; -} diff --git a/lib/commercetools-import/src/Models/Errors/ReferencedResourceNotFoundBuilder.php b/lib/commercetools-import/src/Models/Errors/ReferencedResourceNotFoundBuilder.php deleted file mode 100644 index d3684c6c302..00000000000 --- a/lib/commercetools-import/src/Models/Errors/ReferencedResourceNotFoundBuilder.php +++ /dev/null @@ -1,150 +0,0 @@ - - */ -final class ReferencedResourceNotFoundBuilder implements Builder -{ - /** - - * @var ?string - */ - private $message; - - /** - - * @var ?string - */ - private $typeId; - - /** - - * @var ?string - */ - private $id; - - /** - - * @var ?string - */ - private $key; - - /** - *

"The referenced object of type $typeId $predicate was not found. It either doesn't exist, or it can't be accessed from this endpoint (e.g., if the endpoint filters by store or customer account)."

- * - - * @return null|string - */ - public function getMessage() - { - return $this->message; - } - - /** - *

Type of referenced resource.

- * - - * @return null|string - */ - public function getTypeId() - { - return $this->typeId; - } - - /** - *

Unique identifier of the referenced resource, if known.

- * - - * @return null|string - */ - public function getId() - { - return $this->id; - } - - /** - *

User-defined unique identifier of the referenced resource, if known.

- * - - * @return null|string - */ - public function getKey() - { - return $this->key; - } - - /** - * @param ?string $message - * @return $this - */ - public function withMessage(?string $message) - { - $this->message = $message; - - return $this; - } - - /** - * @param ?string $typeId - * @return $this - */ - public function withTypeId(?string $typeId) - { - $this->typeId = $typeId; - - return $this; - } - - /** - * @param ?string $id - * @return $this - */ - public function withId(?string $id) - { - $this->id = $id; - - return $this; - } - - /** - * @param ?string $key - * @return $this - */ - public function withKey(?string $key) - { - $this->key = $key; - - return $this; - } - - - public function build(): ReferencedResourceNotFound - { - return new ReferencedResourceNotFoundModel( - $this->message, - $this->typeId, - $this->id, - $this->key - ); - } - - public static function of(): ReferencedResourceNotFoundBuilder - { - return new self(); - } -} diff --git a/lib/commercetools-import/src/Models/Errors/ReferencedResourceNotFoundCollection.php b/lib/commercetools-import/src/Models/Errors/ReferencedResourceNotFoundCollection.php deleted file mode 100644 index 91eca1f5dfb..00000000000 --- a/lib/commercetools-import/src/Models/Errors/ReferencedResourceNotFoundCollection.php +++ /dev/null @@ -1,56 +0,0 @@ - - * @method ReferencedResourceNotFound current() - * @method ReferencedResourceNotFound end() - * @method ReferencedResourceNotFound at($offset) - */ -class ReferencedResourceNotFoundCollection extends ErrorObjectCollection -{ - /** - * @psalm-assert ReferencedResourceNotFound $value - * @psalm-param ReferencedResourceNotFound|stdClass $value - * @throws InvalidArgumentException - * - * @return ReferencedResourceNotFoundCollection - */ - public function add($value) - { - if (!$value instanceof ReferencedResourceNotFound) { - throw new InvalidArgumentException(); - } - $this->store($value); - - return $this; - } - - /** - * @psalm-return callable(int):?ReferencedResourceNotFound - */ - protected function mapper() - { - return function (?int $index): ?ReferencedResourceNotFound { - $data = $this->get($index); - if ($data instanceof stdClass) { - /** @var ReferencedResourceNotFound $data */ - $data = ReferencedResourceNotFoundModel::of($data); - $this->set($data, $index); - } - - return $data; - }; - } -} diff --git a/lib/commercetools-import/src/Models/Errors/ReferencedResourceNotFoundModel.php b/lib/commercetools-import/src/Models/Errors/ReferencedResourceNotFoundModel.php deleted file mode 100644 index 0149614858e..00000000000 --- a/lib/commercetools-import/src/Models/Errors/ReferencedResourceNotFoundModel.php +++ /dev/null @@ -1,201 +0,0 @@ -message = $message; - $this->typeId = $typeId; - $this->id = $id; - $this->key = $key; - $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; - } - - /** - *

"The referenced object of type $typeId $predicate was not found. It either doesn't exist, or it can't be accessed from this endpoint (e.g., if the endpoint filters by store or customer account)."

- * - * - * @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; - } - - /** - *

Type of referenced resource.

- * - * - * @return null|string - */ - public function getTypeId() - { - if (is_null($this->typeId)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_TYPE_ID); - if (is_null($data)) { - return null; - } - $this->typeId = (string) $data; - } - - return $this->typeId; - } - - /** - *

Unique identifier of the referenced resource, if known.

- * - * - * @return null|string - */ - public function getId() - { - if (is_null($this->id)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_ID); - if (is_null($data)) { - return null; - } - $this->id = (string) $data; - } - - return $this->id; - } - - /** - *

User-defined unique identifier of the referenced resource, if known.

- * - * - * @return null|string - */ - public function getKey() - { - if (is_null($this->key)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_KEY); - if (is_null($data)) { - return null; - } - $this->key = (string) $data; - } - - return $this->key; - } - - - /** - * @param ?string $message - */ - public function setMessage(?string $message): void - { - $this->message = $message; - } - - /** - * @param ?string $typeId - */ - public function setTypeId(?string $typeId): void - { - $this->typeId = $typeId; - } - - /** - * @param ?string $id - */ - public function setId(?string $id): void - { - $this->id = $id; - } - - /** - * @param ?string $key - */ - public function setKey(?string $key): void - { - $this->key = $key; - } -} diff --git a/references.txt b/references.txt index a02cdc558ba..93c13d9e40c 100644 --- a/references.txt +++ b/references.txt @@ -329,3 +329,4 @@ f254d17f05343dcc4299fc53ff9b335b5ef63d69 b747e1fa4f246b748a89bccbfd8a43f5b6f51175 505b3af56b4452b22dfb595f93e010b3e2fccc53 7375cdc26481ba55e756479a87270432635bfcf7 +df53588d26d7953dfdf44166866ca03045f0a70b