Skip to content

Commit 29d9a4e

Browse files
Merge pull request #256 from commercetools/gen-sdk-updates
Update generated SDKs
2 parents 77db745 + 88b2de7 commit 29d9a4e

File tree

5 files changed

+77
-68
lines changed

5 files changed

+77
-68
lines changed

changes.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,11 @@
6464
- added type `NewMasterVariantAdditionNotAllowedError`
6565
</details>
6666

67+
**History changes**
68+
69+
<details>
70+
<summary>Required Property(s)</summary>
71+
72+
- changed property `id` of type `ModifiedBy` to be optional
73+
</details>
74+

lib/commercetools-history/src/Models/ChangeHistory/ModifiedBy.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,25 @@
1515
interface ModifiedBy extends JsonObject
1616
{
1717

18+
public const FIELD_IS_PLATFORM_CLIENT = 'isPlatformClient';
1819
public const FIELD_ID = 'id';
1920
public const FIELD_TYPE = 'type';
2021
public const FIELD_CLIENT_ID = 'clientId';
2122
public const FIELD_ANONYMOUS_ID = 'anonymousId';
2223
public const FIELD_CUSTOMER = 'customer';
2324
public const FIELD_ASSOCIATE = 'associate';
24-
public const FIELD_IS_PLATFORM_CLIENT = 'isPlatformClient';
25+
26+
/**
27+
* <p><code>true</code> if the change was made using the Merchant Center or <a href="https://impex.europe-west1.gcp.commercetools.com/">ImpEx</a>.</p>
28+
*
29+
30+
* @return null|bool
31+
*/
32+
public function getIsPlatformClient();
2533

2634
/**
2735
* <p><a href="/general-concepts#identifier">ID</a> of the Merchant Center user who made the change.</p>
28-
* <p>Present only if the change was made in the Merchant Center.</p>
36+
* <p>Present only if <code>isPlatformClient</code> is <code>true</code>.</p>
2937
*
3038
3139
* @return null|string
@@ -80,12 +88,9 @@ public function getCustomer();
8088
public function getAssociate();
8189

8290
/**
83-
* <p><code>true</code> if the change was made using the Merchant Center or <a href="https://impex.europe-west1.gcp.commercetools.com/">ImpEx</a>.</p>
84-
*
85-
86-
* @return null|bool
91+
* @param ?bool $isPlatformClient
8792
*/
88-
public function getIsPlatformClient();
93+
public function setIsPlatformClient(?bool $isPlatformClient): void;
8994

9095
/**
9196
* @param ?string $id
@@ -116,9 +121,4 @@ public function setCustomer(?Reference $customer): void;
116121
* @param ?Reference $associate
117122
*/
118123
public function setAssociate(?Reference $associate): void;
119-
120-
/**
121-
* @param ?bool $isPlatformClient
122-
*/
123-
public function setIsPlatformClient(?bool $isPlatformClient): void;
124124
}

lib/commercetools-history/src/Models/ChangeHistory/ModifiedByBuilder.php

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@
2222
*/
2323
final class ModifiedByBuilder implements Builder
2424
{
25+
/**
26+
27+
* @var ?bool
28+
*/
29+
private $isPlatformClient;
30+
2531
/**
2632
2733
* @var ?string
@@ -59,14 +65,19 @@ final class ModifiedByBuilder implements Builder
5965
private $associate;
6066

6167
/**
68+
* <p><code>true</code> if the change was made using the Merchant Center or <a href="https://impex.europe-west1.gcp.commercetools.com/">ImpEx</a>.</p>
69+
*
6270
63-
* @var ?bool
71+
* @return null|bool
6472
*/
65-
private $isPlatformClient;
73+
public function getIsPlatformClient()
74+
{
75+
return $this->isPlatformClient;
76+
}
6677

6778
/**
6879
* <p><a href="/general-concepts#identifier">ID</a> of the Merchant Center user who made the change.</p>
69-
* <p>Present only if the change was made in the Merchant Center.</p>
80+
* <p>Present only if <code>isPlatformClient</code> is <code>true</code>.</p>
7081
*
7182
7283
* @return null|string
@@ -139,14 +150,14 @@ public function getAssociate()
139150
}
140151

141152
/**
142-
* <p><code>true</code> if the change was made using the Merchant Center or <a href="https://impex.europe-west1.gcp.commercetools.com/">ImpEx</a>.</p>
143-
*
144-
145-
* @return null|bool
153+
* @param ?bool $isPlatformClient
154+
* @return $this
146155
*/
147-
public function getIsPlatformClient()
156+
public function withIsPlatformClient(?bool $isPlatformClient)
148157
{
149-
return $this->isPlatformClient;
158+
$this->isPlatformClient = $isPlatformClient;
159+
160+
return $this;
150161
}
151162

152163
/**
@@ -215,17 +226,6 @@ public function withAssociate(?Reference $associate)
215226
return $this;
216227
}
217228

218-
/**
219-
* @param ?bool $isPlatformClient
220-
* @return $this
221-
*/
222-
public function withIsPlatformClient(?bool $isPlatformClient)
223-
{
224-
$this->isPlatformClient = $isPlatformClient;
225-
226-
return $this;
227-
}
228-
229229
/**
230230
* @deprecated use withCustomer() instead
231231
* @return $this
@@ -251,13 +251,13 @@ public function withAssociateBuilder(?ReferenceBuilder $associate)
251251
public function build(): ModifiedBy
252252
{
253253
return new ModifiedByModel(
254+
$this->isPlatformClient,
254255
$this->id,
255256
$this->type,
256257
$this->clientId,
257258
$this->anonymousId,
258259
$this->customer instanceof ReferenceBuilder ? $this->customer->build() : $this->customer,
259-
$this->associate instanceof ReferenceBuilder ? $this->associate->build() : $this->associate,
260-
$this->isPlatformClient
260+
$this->associate instanceof ReferenceBuilder ? $this->associate->build() : $this->associate
261261
);
262262
}
263263

lib/commercetools-history/src/Models/ChangeHistory/ModifiedByModel.php

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ final class ModifiedByModel extends JsonObjectModel implements ModifiedBy
2323
{
2424

2525

26+
/**
27+
*
28+
* @var ?bool
29+
*/
30+
protected $isPlatformClient;
31+
2632
/**
2733
*
2834
* @var ?string
@@ -59,38 +65,52 @@ final class ModifiedByModel extends JsonObjectModel implements ModifiedBy
5965
*/
6066
protected $associate;
6167

62-
/**
63-
*
64-
* @var ?bool
65-
*/
66-
protected $isPlatformClient;
67-
6868

6969
/**
7070
* @psalm-suppress MissingParamType
7171
*/
7272
public function __construct(
73+
?bool $isPlatformClient = null,
7374
?string $id = null,
7475
?string $type = null,
7576
?string $clientId = null,
7677
?string $anonymousId = null,
7778
?Reference $customer = null,
78-
?Reference $associate = null,
79-
?bool $isPlatformClient = null
79+
?Reference $associate = null
8080
) {
81+
$this->isPlatformClient = $isPlatformClient;
8182
$this->id = $id;
8283
$this->type = $type;
8384
$this->clientId = $clientId;
8485
$this->anonymousId = $anonymousId;
8586
$this->customer = $customer;
8687
$this->associate = $associate;
87-
$this->isPlatformClient = $isPlatformClient;
8888

8989
}
9090

91+
/**
92+
* <p><code>true</code> if the change was made using the Merchant Center or <a href="https://impex.europe-west1.gcp.commercetools.com/">ImpEx</a>.</p>
93+
*
94+
*
95+
* @return null|bool
96+
*/
97+
public function getIsPlatformClient()
98+
{
99+
if (is_null($this->isPlatformClient)) {
100+
/** @psalm-var ?bool $data */
101+
$data = $this->raw(self::FIELD_IS_PLATFORM_CLIENT);
102+
if (is_null($data)) {
103+
return null;
104+
}
105+
$this->isPlatformClient = (bool) $data;
106+
}
107+
108+
return $this->isPlatformClient;
109+
}
110+
91111
/**
92112
* <p><a href="/general-concepts#identifier">ID</a> of the Merchant Center user who made the change.</p>
93-
* <p>Present only if the change was made in the Merchant Center.</p>
113+
* <p>Present only if <code>isPlatformClient</code> is <code>true</code>.</p>
94114
*
95115
*
96116
* @return null|string
@@ -218,27 +238,15 @@ public function getAssociate()
218238
return $this->associate;
219239
}
220240

241+
221242
/**
222-
* <p><code>true</code> if the change was made using the Merchant Center or <a href="https://impex.europe-west1.gcp.commercetools.com/">ImpEx</a>.</p>
223-
*
224-
*
225-
* @return null|bool
243+
* @param ?bool $isPlatformClient
226244
*/
227-
public function getIsPlatformClient()
245+
public function setIsPlatformClient(?bool $isPlatformClient): void
228246
{
229-
if (is_null($this->isPlatformClient)) {
230-
/** @psalm-var ?bool $data */
231-
$data = $this->raw(self::FIELD_IS_PLATFORM_CLIENT);
232-
if (is_null($data)) {
233-
return null;
234-
}
235-
$this->isPlatformClient = (bool) $data;
236-
}
237-
238-
return $this->isPlatformClient;
247+
$this->isPlatformClient = $isPlatformClient;
239248
}
240249

241-
242250
/**
243251
* @param ?string $id
244252
*/
@@ -287,14 +295,6 @@ public function setAssociate(?Reference $associate): void
287295
$this->associate = $associate;
288296
}
289297

290-
/**
291-
* @param ?bool $isPlatformClient
292-
*/
293-
public function setIsPlatformClient(?bool $isPlatformClient): void
294-
{
295-
$this->isPlatformClient = $isPlatformClient;
296-
}
297-
298298

299299

300300
}

references.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,3 +315,4 @@ c8c2455221baca20421082b7715eaa0a712af7f1
315315
8e5c10a0c61ddaa5eabbd15344258f53ce6971ee
316316
71b6bfba97b7019e0ba081bb188e43c90c6d79e8
317317
41774e015e4f946bd57f0e2dc76522ed757860c4
318+
1406d1e9ac4945b1179cfce2a956a39f67b757a9

0 commit comments

Comments
 (0)