Skip to content

Commit e2a1817

Browse files
Merge pull request #293 from commercetools/gen-sdk-updates
Update generated SDKs
2 parents 9bf0c3a + e40c856 commit e2a1817

13 files changed

+57
-391
lines changed

changes.md

Lines changed: 4 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -1,104 +1,15 @@
1-
**Api changes**
2-
3-
<details>
4-
<summary>Changed Property(s)</summary>
5-
6-
- :warning: changed property `exact` of type `SearchExactExpression` from type `SearchAnyValue` to `SearchExactValue`
7-
</details>
8-
9-
10-
<details>
11-
<summary>Added Property(s)</summary>
12-
13-
- added property `applicationMode` to type `CartDiscountValueFixed`
14-
- added property `applicationMode` to type `CartDiscountValueFixedDraft`
15-
- added property `custom` to type `CartSetCustomShippingMethodAction`
16-
- added property `custom` to type `StagedOrderSetCustomShippingMethodAction`
17-
- added property `custom` to type `StagedOrderSetShippingAddressAndCustomShippingMethodAction`
18-
- added property `businessUnits` to type `SearchIndexingConfiguration`
19-
</details>
20-
21-
22-
<details>
23-
<summary>Added Resource(s)</summary>
24-
25-
- added resource `/{projectKey}/business-units/search`
26-
- added resource `/{projectKey}/business-units/search/indexing-status`
27-
- added resource `/{projectKey}/channels/key={key}`
28-
</details>
29-
30-
31-
<details>
32-
<summary>Added Method(s)</summary>
33-
34-
- added method `$apiRoot->withProjectKey()->businessUnits()->search()->post()`
35-
- added method `$apiRoot->withProjectKey()->businessUnits()->search()->head()`
36-
- added method `$apiRoot->withProjectKey()->businessUnits()->searchIndexingStatus()->get()`
37-
- added method `$apiRoot->withProjectKey()->channels()->withKey()->get()`
38-
- added method `$apiRoot->withProjectKey()->channels()->withKey()->head()`
39-
- added method `$apiRoot->withProjectKey()->channels()->withKey()->post()`
40-
- added method `$apiRoot->withProjectKey()->channels()->withKey()->delete()`
41-
</details>
42-
43-
44-
<details>
45-
<summary>Added Type(s)</summary>
46-
47-
- added type `BusinessUnitIndexingProgress`
48-
- added type `BusinessUnitIndexingStatus`
49-
- added type `BusinessUnitPagedSearchResponse`
50-
- added type `BusinessUnitSearchIndexingStatusResponse`
51-
- added type `BusinessUnitSearchRequest`
52-
- added type `BusinessUnitSearchResult`
53-
- added type `CartDiscountPatternTarget`
54-
- added type `CountOnCustomLineItemUnits`
55-
- added type `CountOnLineItemUnits`
56-
- added type `PatternComponent`
57-
- added type `ShoppingListLineItemAddedMessage`
58-
- added type `ShoppingListLineItemRemovedMessage`
59-
- added type `ShoppingListMessage`
60-
- added type `ShoppingListLineItemAddedMessagePayload`
61-
- added type `ShoppingListLineItemRemovedMessagePayload`
62-
- added type `ShoppingListMessagePayload`
63-
- added type `BusinessUnitSearchStatus`
64-
- added type `ProjectChangeBusinessUnitSearchStatusAction`
65-
- added type `SearchExactValue`
66-
</details>
67-
68-
69-
<details>
70-
<summary>Added Enum(s)</summary>
71-
72-
- added enum `Canceled` to type `ShipmentState`
73-
- added enum `shopping-list` to type `MessageSubscriptionResourceTypeId`
74-
</details>
75-
761
**History changes**
772

783
<details>
79-
<summary>Added Resource(s)</summary>
80-
81-
- added resource `/{projectKey}/graphql`
82-
</details>
83-
84-
85-
<details>
86-
<summary>Added Method(s)</summary>
4+
<summary>Changed Property(s)</summary>
875

88-
- added method `$apiRoot->withProjectKeyValue()->graphql()->post()`
6+
- :warning: changed property `extensions` of type `GraphQLError` from type `GraphQLErrorObject` to `object`
897
</details>
908

919

9210
<details>
93-
<summary>Added Type(s)</summary>
11+
<summary>Removed Type(s)</summary>
9412

95-
- added type `GraphQLRequest`
96-
- added type `GraphQLResponse`
97-
- added type `GraphQLError`
98-
- added type `GraphQLErrorLocation`
99-
- added type `GraphQLVariablesMap`
100-
- added type `GraphQLErrorObject`
101-
- added type `ChangeTargetPatternChangeValue`
102-
- added type `PatternComponent`
13+
- :warning: removed type `GraphQLErrorObject`
10314
</details>
10415

lib/commercetools-history/src/Models/CartDiscount/PatternComponent.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
interface PatternComponent extends JsonObject
1515
{
16-
public const DISCRIMINATOR_FIELD = 'type';
16+
1717
public const FIELD_TYPE = 'type';
1818

1919
/**
@@ -22,4 +22,8 @@ interface PatternComponent extends JsonObject
2222
*/
2323
public function getType();
2424

25+
/**
26+
* @param ?string $type
27+
*/
28+
public function setType(?string $type): void;
2529
}

lib/commercetools-history/src/Models/CartDiscount/PatternComponentBuilder.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,37 @@
2020
*/
2121
final class PatternComponentBuilder implements Builder
2222
{
23+
/**
2324
25+
* @var ?string
26+
*/
27+
private $type;
2428

29+
/**
30+
31+
* @return null|string
32+
*/
33+
public function getType()
34+
{
35+
return $this->type;
36+
}
37+
38+
/**
39+
* @param ?string $type
40+
* @return $this
41+
*/
42+
public function withType(?string $type)
43+
{
44+
$this->type = $type;
45+
46+
return $this;
47+
}
2548

2649

2750
public function build(): PatternComponent
2851
{
2952
return new PatternComponentModel(
53+
$this->type
3054
);
3155
}
3256

lib/commercetools-history/src/Models/CartDiscount/PatternComponentModel.php

Lines changed: 7 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,13 @@
2020
final class PatternComponentModel extends JsonObjectModel implements PatternComponent
2121
{
2222

23-
public const DISCRIMINATOR_VALUE = '';
23+
2424
/**
2525
*
2626
* @var ?string
2727
*/
2828
protected $type;
2929

30-
/**
31-
* @psalm-var array<string, class-string<PatternComponent> >
32-
*
33-
*/
34-
private static $discriminatorClasses = [
35-
];
3630

3731
/**
3832
* @psalm-suppress MissingParamType
@@ -63,33 +57,14 @@ public function getType()
6357
}
6458

6559

66-
67-
68-
6960
/**
70-
* @psalm-param stdClass|array<string, mixed> $value
71-
* @psalm-return class-string<PatternComponent>
61+
* @param ?string $type
7262
*/
73-
public static function resolveDiscriminatorClass($value): string
63+
public function setType(?string $type): void
7464
{
75-
$fieldName = PatternComponent::DISCRIMINATOR_FIELD;
76-
if (is_object($value) && isset($value->$fieldName)) {
77-
/** @psalm-var string $discriminatorValue */
78-
$discriminatorValue = $value->$fieldName;
79-
if (isset(self::$discriminatorClasses[$discriminatorValue])) {
80-
return self::$discriminatorClasses[$discriminatorValue];
81-
}
82-
}
83-
if (is_array($value) && isset($value[$fieldName])) {
84-
/** @psalm-var string $discriminatorValue */
85-
$discriminatorValue = $value[$fieldName];
86-
if (isset(self::$discriminatorClasses[$discriminatorValue])) {
87-
return self::$discriminatorClasses[$discriminatorValue];
88-
}
89-
}
90-
91-
/** @psalm-var class-string<PatternComponent> */
92-
$type = PatternComponentModel::class;
93-
return $type;
65+
$this->type = $type;
9466
}
67+
68+
69+
9570
}

lib/commercetools-history/src/Models/Error/GraphQLErrorObject.php

Lines changed: 0 additions & 28 deletions
This file was deleted.

lib/commercetools-history/src/Models/Error/GraphQLErrorObjectBuilder.php

Lines changed: 0 additions & 37 deletions
This file was deleted.

lib/commercetools-history/src/Models/Error/GraphQLErrorObjectCollection.php

Lines changed: 0 additions & 56 deletions
This file was deleted.

0 commit comments

Comments
 (0)