Skip to content

Commit ee5912f

Browse files
committed
build(codegen): updating SDK
1 parent 692c6ca commit ee5912f

13 files changed

+345
-3
lines changed

changes.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,11 @@
4242
- added enum `product-tailoring` to type `ResourceTypeId`
4343
</details>
4444

45+
**Import changes**
46+
47+
<details>
48+
<summary>Added Type(s)</summary>
49+
50+
- added type `InvalidFieldsUpdateError`
51+
</details>
52+

lib/commercetools-import/src/Models/DiscountCodes/DiscountCodeImport.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ public function getDescription();
5757

5858
/**
5959
* <p>User-defined unique identifier of the DiscountCode that is used by the customer to apply the discount.</p>
60+
* <p>The value cannot be updated. Attempting to update the value will result in an <a href="/error#invalidfieldsupdateerror">InvalidFieldsUpdate</a> error.</p>
6061
*
6162
6263
* @return null|string

lib/commercetools-import/src/Models/DiscountCodes/DiscountCodeImportBuilder.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ public function getDescription()
141141

142142
/**
143143
* <p>User-defined unique identifier of the DiscountCode that is used by the customer to apply the discount.</p>
144+
* <p>The value cannot be updated. Attempting to update the value will result in an <a href="/error#invalidfieldsupdateerror">InvalidFieldsUpdate</a> error.</p>
144145
*
145146
146147
* @return null|string

lib/commercetools-import/src/Models/DiscountCodes/DiscountCodeImportModel.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ public function getDescription()
203203

204204
/**
205205
* <p>User-defined unique identifier of the DiscountCode that is used by the customer to apply the discount.</p>
206+
* <p>The value cannot be updated. Attempting to update the value will result in an <a href="/error#invalidfieldsupdateerror">InvalidFieldsUpdate</a> error.</p>
206207
*
207208
*
208209
* @return null|string

lib/commercetools-import/src/Models/Errors/ErrorObjectModel.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ final class ErrorObjectModel extends JsonObjectModel implements ErrorObject
4646
'Generic' => GenericErrorModel::class,
4747
'InvalidCredentials' => InvalidCredentialsErrorModel::class,
4848
'InvalidField' => InvalidFieldErrorModel::class,
49+
'InvalidFieldUpdate' => InvalidFieldsUpdateErrorModel::class,
4950
'InvalidInput' => InvalidInputModel::class,
5051
'InvalidJsonInput' => InvalidJsonInputModel::class,
5152
'InvalidOperation' => InvalidOperationModel::class,
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
/**
5+
* This file has been auto generated
6+
* Do not change it.
7+
*/
8+
9+
namespace Commercetools\Import\Models\Errors;
10+
11+
use Commercetools\Base\DateTimeImmutableCollection;
12+
use Commercetools\Base\JsonObject;
13+
14+
interface InvalidFieldsUpdateError extends ErrorObject
15+
{
16+
public const FIELD_FIELDS = 'fields';
17+
18+
/**
19+
* <p><code>&quot;The following fields are currently not supported for changes/updates&quot;</code></p>
20+
*
21+
22+
* @return null|string
23+
*/
24+
public function getMessage();
25+
26+
/**
27+
* <p>Fields that cannot be updated.</p>
28+
*
29+
30+
* @return null|array
31+
*/
32+
public function getFields();
33+
34+
/**
35+
* @param ?string $message
36+
*/
37+
public function setMessage(?string $message): void;
38+
39+
/**
40+
* @param ?array $fields
41+
*/
42+
public function setFields(?array $fields): void;
43+
}
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
/**
5+
* This file has been auto generated
6+
* Do not change it.
7+
*/
8+
9+
namespace Commercetools\Import\Models\Errors;
10+
11+
use Commercetools\Base\Builder;
12+
use Commercetools\Base\DateTimeImmutableCollection;
13+
use Commercetools\Base\JsonObject;
14+
use Commercetools\Base\JsonObjectModel;
15+
use Commercetools\Base\MapperFactory;
16+
use stdClass;
17+
18+
/**
19+
* @implements Builder<InvalidFieldsUpdateError>
20+
*/
21+
final class InvalidFieldsUpdateErrorBuilder implements Builder
22+
{
23+
/**
24+
25+
* @var ?string
26+
*/
27+
private $message;
28+
29+
/**
30+
31+
* @var ?array
32+
*/
33+
private $fields;
34+
35+
/**
36+
* <p><code>&quot;The following fields are currently not supported for changes/updates&quot;</code></p>
37+
*
38+
39+
* @return null|string
40+
*/
41+
public function getMessage()
42+
{
43+
return $this->message;
44+
}
45+
46+
/**
47+
* <p>Fields that cannot be updated.</p>
48+
*
49+
50+
* @return null|array
51+
*/
52+
public function getFields()
53+
{
54+
return $this->fields;
55+
}
56+
57+
/**
58+
* @param ?string $message
59+
* @return $this
60+
*/
61+
public function withMessage(?string $message)
62+
{
63+
$this->message = $message;
64+
65+
return $this;
66+
}
67+
68+
/**
69+
* @param ?array $fields
70+
* @return $this
71+
*/
72+
public function withFields(?array $fields)
73+
{
74+
$this->fields = $fields;
75+
76+
return $this;
77+
}
78+
79+
80+
public function build(): InvalidFieldsUpdateError
81+
{
82+
return new InvalidFieldsUpdateErrorModel(
83+
$this->message,
84+
$this->fields
85+
);
86+
}
87+
88+
public static function of(): InvalidFieldsUpdateErrorBuilder
89+
{
90+
return new self();
91+
}
92+
}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
/**
5+
* This file has been auto generated
6+
* Do not change it.
7+
*/
8+
9+
namespace Commercetools\Import\Models\Errors;
10+
11+
use Commercetools\Exception\InvalidArgumentException;
12+
use Commercetools\Import\Models\Errors\ErrorObjectCollection;
13+
use stdClass;
14+
15+
/**
16+
* @extends ErrorObjectCollection<InvalidFieldsUpdateError>
17+
* @method InvalidFieldsUpdateError current()
18+
* @method InvalidFieldsUpdateError end()
19+
* @method InvalidFieldsUpdateError at($offset)
20+
*/
21+
class InvalidFieldsUpdateErrorCollection extends ErrorObjectCollection
22+
{
23+
/**
24+
* @psalm-assert InvalidFieldsUpdateError $value
25+
* @psalm-param InvalidFieldsUpdateError|stdClass $value
26+
* @throws InvalidArgumentException
27+
*
28+
* @return InvalidFieldsUpdateErrorCollection
29+
*/
30+
public function add($value)
31+
{
32+
if (!$value instanceof InvalidFieldsUpdateError) {
33+
throw new InvalidArgumentException();
34+
}
35+
$this->store($value);
36+
37+
return $this;
38+
}
39+
40+
/**
41+
* @psalm-return callable(int):?InvalidFieldsUpdateError
42+
*/
43+
protected function mapper()
44+
{
45+
return function (?int $index): ?InvalidFieldsUpdateError {
46+
$data = $this->get($index);
47+
if ($data instanceof stdClass) {
48+
/** @var InvalidFieldsUpdateError $data */
49+
$data = InvalidFieldsUpdateErrorModel::of($data);
50+
$this->set($data, $index);
51+
}
52+
53+
return $data;
54+
};
55+
}
56+
}
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
/**
5+
* This file has been auto generated
6+
* Do not change it.
7+
*/
8+
9+
namespace Commercetools\Import\Models\Errors;
10+
11+
use Commercetools\Base\DateTimeImmutableCollection;
12+
use Commercetools\Base\JsonObject;
13+
use Commercetools\Base\JsonObjectModel;
14+
use Commercetools\Base\MapperFactory;
15+
use stdClass;
16+
17+
/**
18+
* @internal
19+
*/
20+
final class InvalidFieldsUpdateErrorModel extends JsonObjectModel implements InvalidFieldsUpdateError
21+
{
22+
public const DISCRIMINATOR_VALUE = 'InvalidFieldUpdate';
23+
/**
24+
*
25+
* @var ?string
26+
*/
27+
protected $code;
28+
29+
/**
30+
*
31+
* @var ?string
32+
*/
33+
protected $message;
34+
35+
/**
36+
*
37+
* @var ?array
38+
*/
39+
protected $fields;
40+
41+
42+
/**
43+
* @psalm-suppress MissingParamType
44+
*/
45+
public function __construct(
46+
?string $message = null,
47+
?array $fields = null,
48+
?string $code = null
49+
) {
50+
$this->message = $message;
51+
$this->fields = $fields;
52+
$this->code = $code ?? self::DISCRIMINATOR_VALUE;
53+
}
54+
55+
/**
56+
*
57+
* @return null|string
58+
*/
59+
public function getCode()
60+
{
61+
if (is_null($this->code)) {
62+
/** @psalm-var ?string $data */
63+
$data = $this->raw(self::FIELD_CODE);
64+
if (is_null($data)) {
65+
return null;
66+
}
67+
$this->code = (string) $data;
68+
}
69+
70+
return $this->code;
71+
}
72+
73+
/**
74+
* <p><code>&quot;The following fields are currently not supported for changes/updates&quot;</code></p>
75+
*
76+
*
77+
* @return null|string
78+
*/
79+
public function getMessage()
80+
{
81+
if (is_null($this->message)) {
82+
/** @psalm-var ?string $data */
83+
$data = $this->raw(self::FIELD_MESSAGE);
84+
if (is_null($data)) {
85+
return null;
86+
}
87+
$this->message = (string) $data;
88+
}
89+
90+
return $this->message;
91+
}
92+
93+
/**
94+
* <p>Fields that cannot be updated.</p>
95+
*
96+
*
97+
* @return null|array
98+
*/
99+
public function getFields()
100+
{
101+
if (is_null($this->fields)) {
102+
/** @psalm-var ?list<mixed> $data */
103+
$data = $this->raw(self::FIELD_FIELDS);
104+
if (is_null($data)) {
105+
return null;
106+
}
107+
$this->fields = $data;
108+
}
109+
110+
return $this->fields;
111+
}
112+
113+
114+
/**
115+
* @param ?string $message
116+
*/
117+
public function setMessage(?string $message): void
118+
{
119+
$this->message = $message;
120+
}
121+
122+
/**
123+
* @param ?array $fields
124+
*/
125+
public function setFields(?array $fields): void
126+
{
127+
$this->fields = $fields;
128+
}
129+
}

lib/commercetools-import/src/Models/StandalonePrices/StandalonePriceImport.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ public function getValue();
5858

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

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

7577
/**
76-
* <p>Sets the product distribution Channel for which this Price is valid</p>
78+
* <p>Sets the product distribution Channel for which this Price is valid.</p>
79+
* <p>The value cannot be updated. Attempting to update the value will result in an <a href="/error#invalidfieldsupdateerror">InvalidFieldsUpdate</a> error.</p>
7780
*
7881
7982
* @return null|ChannelKeyReference

0 commit comments

Comments
 (0)