Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 4 additions & 93 deletions changes.md
Original file line number Diff line number Diff line change
@@ -1,104 +1,15 @@
**Api changes**

<details>
<summary>Changed Property(s)</summary>

- :warning: changed property `exact` of type `SearchExactExpression` from type `SearchAnyValue` to `SearchExactValue`
</details>


<details>
<summary>Added Property(s)</summary>

- added property `applicationMode` to type `CartDiscountValueFixed`
- added property `applicationMode` to type `CartDiscountValueFixedDraft`
- added property `custom` to type `CartSetCustomShippingMethodAction`
- added property `custom` to type `StagedOrderSetCustomShippingMethodAction`
- added property `custom` to type `StagedOrderSetShippingAddressAndCustomShippingMethodAction`
- added property `businessUnits` to type `SearchIndexingConfiguration`
</details>


<details>
<summary>Added Resource(s)</summary>

- added resource `/{projectKey}/business-units/search`
- added resource `/{projectKey}/business-units/search/indexing-status`
- added resource `/{projectKey}/channels/key={key}`
</details>


<details>
<summary>Added Method(s)</summary>

- added method `$apiRoot->withProjectKey()->businessUnits()->search()->post()`
- added method `$apiRoot->withProjectKey()->businessUnits()->search()->head()`
- added method `$apiRoot->withProjectKey()->businessUnits()->searchIndexingStatus()->get()`
- added method `$apiRoot->withProjectKey()->channels()->withKey()->get()`
- added method `$apiRoot->withProjectKey()->channels()->withKey()->head()`
- added method `$apiRoot->withProjectKey()->channels()->withKey()->post()`
- added method `$apiRoot->withProjectKey()->channels()->withKey()->delete()`
</details>


<details>
<summary>Added Type(s)</summary>

- added type `BusinessUnitIndexingProgress`
- added type `BusinessUnitIndexingStatus`
- added type `BusinessUnitPagedSearchResponse`
- added type `BusinessUnitSearchIndexingStatusResponse`
- added type `BusinessUnitSearchRequest`
- added type `BusinessUnitSearchResult`
- added type `CartDiscountPatternTarget`
- added type `CountOnCustomLineItemUnits`
- added type `CountOnLineItemUnits`
- added type `PatternComponent`
- added type `ShoppingListLineItemAddedMessage`
- added type `ShoppingListLineItemRemovedMessage`
- added type `ShoppingListMessage`
- added type `ShoppingListLineItemAddedMessagePayload`
- added type `ShoppingListLineItemRemovedMessagePayload`
- added type `ShoppingListMessagePayload`
- added type `BusinessUnitSearchStatus`
- added type `ProjectChangeBusinessUnitSearchStatusAction`
- added type `SearchExactValue`
</details>


<details>
<summary>Added Enum(s)</summary>

- added enum `Canceled` to type `ShipmentState`
- added enum `shopping-list` to type `MessageSubscriptionResourceTypeId`
</details>

**History changes**

<details>
<summary>Added Resource(s)</summary>

- added resource `/{projectKey}/graphql`
</details>


<details>
<summary>Added Method(s)</summary>
<summary>Changed Property(s)</summary>

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


<details>
<summary>Added Type(s)</summary>
<summary>Removed Type(s)</summary>

- added type `GraphQLRequest`
- added type `GraphQLResponse`
- added type `GraphQLError`
- added type `GraphQLErrorLocation`
- added type `GraphQLVariablesMap`
- added type `GraphQLErrorObject`
- added type `ChangeTargetPatternChangeValue`
- added type `PatternComponent`
- :warning: removed type `GraphQLErrorObject`
</details>

Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

interface PatternComponent extends JsonObject
{
public const DISCRIMINATOR_FIELD = 'type';

public const FIELD_TYPE = 'type';

/**
Expand All @@ -22,4 +22,8 @@ interface PatternComponent extends JsonObject
*/
public function getType();

/**
* @param ?string $type
*/
public function setType(?string $type): void;
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,37 @@
*/
final class PatternComponentBuilder implements Builder
{
/**

* @var ?string
*/
private $type;

/**

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

/**
* @param ?string $type
* @return $this
*/
public function withType(?string $type)
{
$this->type = $type;

return $this;
}


public function build(): PatternComponent
{
return new PatternComponentModel(
$this->type
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,13 @@
final class PatternComponentModel extends JsonObjectModel implements PatternComponent
{

public const DISCRIMINATOR_VALUE = '';

/**
*
* @var ?string
*/
protected $type;

/**
* @psalm-var array<string, class-string<PatternComponent> >
*
*/
private static $discriminatorClasses = [
];

/**
* @psalm-suppress MissingParamType
Expand Down Expand Up @@ -63,33 +57,14 @@ public function getType()
}





/**
* @psalm-param stdClass|array<string, mixed> $value
* @psalm-return class-string<PatternComponent>
* @param ?string $type
*/
public static function resolveDiscriminatorClass($value): string
public function setType(?string $type): void
{
$fieldName = PatternComponent::DISCRIMINATOR_FIELD;
if (is_object($value) && isset($value->$fieldName)) {
/** @psalm-var string $discriminatorValue */
$discriminatorValue = $value->$fieldName;
if (isset(self::$discriminatorClasses[$discriminatorValue])) {
return self::$discriminatorClasses[$discriminatorValue];
}
}
if (is_array($value) && isset($value[$fieldName])) {
/** @psalm-var string $discriminatorValue */
$discriminatorValue = $value[$fieldName];
if (isset(self::$discriminatorClasses[$discriminatorValue])) {
return self::$discriminatorClasses[$discriminatorValue];
}
}

/** @psalm-var class-string<PatternComponent> */
$type = PatternComponentModel::class;
return $type;
$this->type = $type;
}



}

This file was deleted.

This file was deleted.

This file was deleted.

Loading
Loading