diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyTest.php index e6cb5943300..f7f7f80e5fd 100644 --- a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyTest.php +++ b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyTest.php @@ -67,38 +67,38 @@ public function getRequests() public function getResources() { return [ - 'ResourceByProjectKeyInStoreKeyByStoreKeyCarts' => [ - function (ApiRequestBuilder $builder): ResourceByProjectKeyInStoreKeyByStoreKeyCarts { + 'ResourceByProjectKeyInStoreKeyByStoreKeyBusinessUnits' => [ + function (ApiRequestBuilder $builder): ResourceByProjectKeyInStoreKeyByStoreKeyBusinessUnits { return $builder ->withProjectKey("test_projectKey") ->inStoreKeyWithStoreKeyValue("test_storeKey") - ->carts(); + ->businessUnits(); }, - ResourceByProjectKeyInStoreKeyByStoreKeyCarts::class, + ResourceByProjectKeyInStoreKeyByStoreKeyBusinessUnits::class, ['projectKey' => 'test_projectKey', 'storeKey' => 'test_storeKey'], - '/{projectKey}/in-store/key={storeKey}/carts' + '/{projectKey}/in-store/key={storeKey}/business-units' ], - 'ResourceByProjectKeyInStoreKeyByStoreKeyOrders' => [ - function (ApiRequestBuilder $builder): ResourceByProjectKeyInStoreKeyByStoreKeyOrders { + 'ResourceByProjectKeyInStoreKeyByStoreKeyCartDiscounts' => [ + function (ApiRequestBuilder $builder): ResourceByProjectKeyInStoreKeyByStoreKeyCartDiscounts { return $builder ->withProjectKey("test_projectKey") ->inStoreKeyWithStoreKeyValue("test_storeKey") - ->orders(); + ->cartDiscounts(); }, - ResourceByProjectKeyInStoreKeyByStoreKeyOrders::class, + ResourceByProjectKeyInStoreKeyByStoreKeyCartDiscounts::class, ['projectKey' => 'test_projectKey', 'storeKey' => 'test_storeKey'], - '/{projectKey}/in-store/key={storeKey}/orders' + '/{projectKey}/in-store/key={storeKey}/cart-discounts' ], - 'ResourceByProjectKeyInStoreKeyByStoreKeyMe' => [ - function (ApiRequestBuilder $builder): ResourceByProjectKeyInStoreKeyByStoreKeyMe { + 'ResourceByProjectKeyInStoreKeyByStoreKeyCarts' => [ + function (ApiRequestBuilder $builder): ResourceByProjectKeyInStoreKeyByStoreKeyCarts { return $builder ->withProjectKey("test_projectKey") ->inStoreKeyWithStoreKeyValue("test_storeKey") - ->me(); + ->carts(); }, - ResourceByProjectKeyInStoreKeyByStoreKeyMe::class, + ResourceByProjectKeyInStoreKeyByStoreKeyCarts::class, ['projectKey' => 'test_projectKey', 'storeKey' => 'test_storeKey'], - '/{projectKey}/in-store/key={storeKey}/me' + '/{projectKey}/in-store/key={storeKey}/carts' ], 'ResourceByProjectKeyInStoreKeyByStoreKeyCustomers' => [ function (ApiRequestBuilder $builder): ResourceByProjectKeyInStoreKeyByStoreKeyCustomers { @@ -111,38 +111,27 @@ function (ApiRequestBuilder $builder): ResourceByProjectKeyInStoreKeyByStoreKeyC ['projectKey' => 'test_projectKey', 'storeKey' => 'test_storeKey'], '/{projectKey}/in-store/key={storeKey}/customers' ], - 'ResourceByProjectKeyInStoreKeyByStoreKeyLogin' => [ - function (ApiRequestBuilder $builder): ResourceByProjectKeyInStoreKeyByStoreKeyLogin { - return $builder - ->withProjectKey("test_projectKey") - ->inStoreKeyWithStoreKeyValue("test_storeKey") - ->login(); - }, - ResourceByProjectKeyInStoreKeyByStoreKeyLogin::class, - ['projectKey' => 'test_projectKey', 'storeKey' => 'test_storeKey'], - '/{projectKey}/in-store/key={storeKey}/login' - ], - 'ResourceByProjectKeyInStoreKeyByStoreKeyShippingMethods' => [ - function (ApiRequestBuilder $builder): ResourceByProjectKeyInStoreKeyByStoreKeyShippingMethods { + 'ResourceByProjectKeyInStoreKeyByStoreKeyMe' => [ + function (ApiRequestBuilder $builder): ResourceByProjectKeyInStoreKeyByStoreKeyMe { return $builder ->withProjectKey("test_projectKey") ->inStoreKeyWithStoreKeyValue("test_storeKey") - ->shippingMethods(); + ->me(); }, - ResourceByProjectKeyInStoreKeyByStoreKeyShippingMethods::class, + ResourceByProjectKeyInStoreKeyByStoreKeyMe::class, ['projectKey' => 'test_projectKey', 'storeKey' => 'test_storeKey'], - '/{projectKey}/in-store/key={storeKey}/shipping-methods' + '/{projectKey}/in-store/key={storeKey}/me' ], - 'ResourceByProjectKeyInStoreKeyByStoreKeyShoppingLists' => [ - function (ApiRequestBuilder $builder): ResourceByProjectKeyInStoreKeyByStoreKeyShoppingLists { + 'ResourceByProjectKeyInStoreKeyByStoreKeyOrders' => [ + function (ApiRequestBuilder $builder): ResourceByProjectKeyInStoreKeyByStoreKeyOrders { return $builder ->withProjectKey("test_projectKey") ->inStoreKeyWithStoreKeyValue("test_storeKey") - ->shoppingLists(); + ->orders(); }, - ResourceByProjectKeyInStoreKeyByStoreKeyShoppingLists::class, + ResourceByProjectKeyInStoreKeyByStoreKeyOrders::class, ['projectKey' => 'test_projectKey', 'storeKey' => 'test_storeKey'], - '/{projectKey}/in-store/key={storeKey}/shopping-lists' + '/{projectKey}/in-store/key={storeKey}/orders' ], 'ResourceByProjectKeyInStoreKeyByStoreKeyProductProjections' => [ function (ApiRequestBuilder $builder): ResourceByProjectKeyInStoreKeyByStoreKeyProductProjections { @@ -166,17 +155,6 @@ function (ApiRequestBuilder $builder): ResourceByProjectKeyInStoreKeyByStoreKeyP ['projectKey' => 'test_projectKey', 'storeKey' => 'test_storeKey'], '/{projectKey}/in-store/key={storeKey}/product-selection-assignments' ], - 'ResourceByProjectKeyInStoreKeyByStoreKeyCartDiscounts' => [ - function (ApiRequestBuilder $builder): ResourceByProjectKeyInStoreKeyByStoreKeyCartDiscounts { - return $builder - ->withProjectKey("test_projectKey") - ->inStoreKeyWithStoreKeyValue("test_storeKey") - ->cartDiscounts(); - }, - ResourceByProjectKeyInStoreKeyByStoreKeyCartDiscounts::class, - ['projectKey' => 'test_projectKey', 'storeKey' => 'test_storeKey'], - '/{projectKey}/in-store/key={storeKey}/cart-discounts' - ], 'ResourceByProjectKeyInStoreKeyByStoreKeyProductTailoring' => [ function (ApiRequestBuilder $builder): ResourceByProjectKeyInStoreKeyByStoreKeyProductTailoring { return $builder @@ -210,38 +188,60 @@ function (ApiRequestBuilder $builder): ResourceByProjectKeyInStoreKeyByStoreKeyQ ['projectKey' => 'test_projectKey', 'storeKey' => 'test_storeKey'], '/{projectKey}/in-store/key={storeKey}/quote-requests' ], - 'ResourceByProjectKeyInStoreKeyByStoreKeyStagedQuotes' => [ - function (ApiRequestBuilder $builder): ResourceByProjectKeyInStoreKeyByStoreKeyStagedQuotes { + 'ResourceByProjectKeyInStoreKeyByStoreKeyQuotes' => [ + function (ApiRequestBuilder $builder): ResourceByProjectKeyInStoreKeyByStoreKeyQuotes { return $builder ->withProjectKey("test_projectKey") ->inStoreKeyWithStoreKeyValue("test_storeKey") - ->stagedQuotes(); + ->quotes(); }, - ResourceByProjectKeyInStoreKeyByStoreKeyStagedQuotes::class, + ResourceByProjectKeyInStoreKeyByStoreKeyQuotes::class, ['projectKey' => 'test_projectKey', 'storeKey' => 'test_storeKey'], - '/{projectKey}/in-store/key={storeKey}/staged-quotes' + '/{projectKey}/in-store/key={storeKey}/quotes' ], - 'ResourceByProjectKeyInStoreKeyByStoreKeyQuotes' => [ - function (ApiRequestBuilder $builder): ResourceByProjectKeyInStoreKeyByStoreKeyQuotes { + 'ResourceByProjectKeyInStoreKeyByStoreKeyShippingMethods' => [ + function (ApiRequestBuilder $builder): ResourceByProjectKeyInStoreKeyByStoreKeyShippingMethods { return $builder ->withProjectKey("test_projectKey") ->inStoreKeyWithStoreKeyValue("test_storeKey") - ->quotes(); + ->shippingMethods(); }, - ResourceByProjectKeyInStoreKeyByStoreKeyQuotes::class, + ResourceByProjectKeyInStoreKeyByStoreKeyShippingMethods::class, ['projectKey' => 'test_projectKey', 'storeKey' => 'test_storeKey'], - '/{projectKey}/in-store/key={storeKey}/quotes' + '/{projectKey}/in-store/key={storeKey}/shipping-methods' ], - 'ResourceByProjectKeyInStoreKeyByStoreKeyBusinessUnits' => [ - function (ApiRequestBuilder $builder): ResourceByProjectKeyInStoreKeyByStoreKeyBusinessUnits { + 'ResourceByProjectKeyInStoreKeyByStoreKeyShoppingLists' => [ + function (ApiRequestBuilder $builder): ResourceByProjectKeyInStoreKeyByStoreKeyShoppingLists { return $builder ->withProjectKey("test_projectKey") ->inStoreKeyWithStoreKeyValue("test_storeKey") - ->businessUnits(); + ->shoppingLists(); }, - ResourceByProjectKeyInStoreKeyByStoreKeyBusinessUnits::class, + ResourceByProjectKeyInStoreKeyByStoreKeyShoppingLists::class, ['projectKey' => 'test_projectKey', 'storeKey' => 'test_storeKey'], - '/{projectKey}/in-store/key={storeKey}/business-units' + '/{projectKey}/in-store/key={storeKey}/shopping-lists' + ], + 'ResourceByProjectKeyInStoreKeyByStoreKeyStagedQuotes' => [ + function (ApiRequestBuilder $builder): ResourceByProjectKeyInStoreKeyByStoreKeyStagedQuotes { + return $builder + ->withProjectKey("test_projectKey") + ->inStoreKeyWithStoreKeyValue("test_storeKey") + ->stagedQuotes(); + }, + ResourceByProjectKeyInStoreKeyByStoreKeyStagedQuotes::class, + ['projectKey' => 'test_projectKey', 'storeKey' => 'test_storeKey'], + '/{projectKey}/in-store/key={storeKey}/staged-quotes' + ], + 'ResourceByProjectKeyInStoreKeyByStoreKeyLogin' => [ + function (ApiRequestBuilder $builder): ResourceByProjectKeyInStoreKeyByStoreKeyLogin { + return $builder + ->withProjectKey("test_projectKey") + ->inStoreKeyWithStoreKeyValue("test_storeKey") + ->login(); + }, + ResourceByProjectKeyInStoreKeyByStoreKeyLogin::class, + ['projectKey' => 'test_projectKey', 'storeKey' => 'test_storeKey'], + '/{projectKey}/in-store/key={storeKey}/login' ] ]; } diff --git a/lib/commercetools-api/docs/RequestBuilder.md b/lib/commercetools-api/docs/RequestBuilder.md index 01b7365aeb4..5915aefc759 100644 --- a/lib/commercetools-api/docs/RequestBuilder.md +++ b/lib/commercetools-api/docs/RequestBuilder.md @@ -4989,7 +4989,7 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->me()->activeCart()->head()` -Checks if an active Cart exists in a Store. Returns `200` status if successful. +Checks if an active Cart exists in a Store. Returns `200 OK` status if successful. A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: @@ -5394,7 +5394,7 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->me()->shoppingLists()->get()` -Retrieves ShoppingLists for the authenticated Customer or anonymous user in a [Store](ctp:api:type:Store). Returns `200` status if successful. +Retrieves ShoppingLists for the authenticated Customer or anonymous user in a [Store](ctp:api:type:Store). Returns `200 OK` status if successful. A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: @@ -5417,7 +5417,7 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->me()->shoppingLists()->head()` -Checks if one or more ShoppingLists exist for the provided query predicate for the authenticated Customer or anonymous user in a [Store](ctp:api:type:Store). Returns `200` status if successful. +Checks if one or more ShoppingLists exist for the provided query predicate for the authenticated Customer or anonymous user in a [Store](ctp:api:type:Store). Returns `200 OK` status if successful. A [Not Found](/../api/errors#404-not-found) error is returned in the following scenarios: @@ -5460,7 +5460,7 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->me()->shoppingLists()->withId("ID")->get()` -Retrieves a ShoppingList with the provided `id` for the authenticated Customer or anonymous user in a [Store](ctp:api:type:Store). Returns `200` status if successful. +Retrieves a ShoppingList with the provided `id` for the authenticated Customer or anonymous user in a [Store](ctp:api:type:Store). Returns `200 OK` status if successful. A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: @@ -5556,14 +5556,14 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->me()->shoppingLists()->withKey("key")->get()` -Retrieves a ShoppingList with the provided `key` for the authenticated Customer or anonymous user in a [Store](ctp:api:type:Store). Returns `200` status if successful. +Retrieves a ShoppingList with the provided `key` for the authenticated Customer or anonymous user in a [Store](ctp:api:type:Store). Returns `200 OK` status if successful. A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: - If no ShoppingList matches the provided `key` in a Store. - If a ShoppingList matches the provided `key` but does not have a `store` specified, or the `store` field references a different Store. - If a ShoppingList matches the provided `key` in a Store but does not contain either an `anonymousId` that matches the [anonymous_id:{id}](/scopes#composable-commerce-oauth) scope, - or a `customer` with `id` value that matches the [customer:{id}](/scopes#composable-commerce-oauth) scope. + or a `customer` with `id` value that matches the [customer:{id}](/scopes#composable-commerce-oauth) scope. ### Example @@ -6615,7 +6615,7 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->shoppingLists()->head()` -Checks if one or more ShoppingLists exist for the provided query predicate in a [Store](ctp:api:type:Store). Returns a `200` status if any ShoppingLists match the query predicate, or a `404` status otherwise. +Checks if one or more ShoppingLists exist for the provided query predicate in a [Store](ctp:api:type:Store). Returns a `200` status if any ShoppingLists match the query predicate or, or a `404` status otherwise. ### Example ```php diff --git a/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKey.php b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKey.php index 8893fb58739..3b24f8bb3c0 100644 --- a/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKey.php +++ b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKey.php @@ -27,27 +27,27 @@ public function __construct(array $args = [], ?ClientInterface $client = null) /** */ - public function carts(): ResourceByProjectKeyInStoreKeyByStoreKeyCarts + public function businessUnits(): ResourceByProjectKeyInStoreKeyByStoreKeyBusinessUnits { $args = $this->getArgs(); - return new ResourceByProjectKeyInStoreKeyByStoreKeyCarts($args, $this->getClient()); + return new ResourceByProjectKeyInStoreKeyByStoreKeyBusinessUnits($args, $this->getClient()); } /** */ - public function orders(): ResourceByProjectKeyInStoreKeyByStoreKeyOrders + public function cartDiscounts(): ResourceByProjectKeyInStoreKeyByStoreKeyCartDiscounts { $args = $this->getArgs(); - return new ResourceByProjectKeyInStoreKeyByStoreKeyOrders($args, $this->getClient()); + return new ResourceByProjectKeyInStoreKeyByStoreKeyCartDiscounts($args, $this->getClient()); } /** */ - public function me(): ResourceByProjectKeyInStoreKeyByStoreKeyMe + public function carts(): ResourceByProjectKeyInStoreKeyByStoreKeyCarts { $args = $this->getArgs(); - return new ResourceByProjectKeyInStoreKeyByStoreKeyMe($args, $this->getClient()); + return new ResourceByProjectKeyInStoreKeyByStoreKeyCarts($args, $this->getClient()); } /** */ @@ -59,98 +59,98 @@ public function customers(): ResourceByProjectKeyInStoreKeyByStoreKeyCustomers } /** */ - public function login(): ResourceByProjectKeyInStoreKeyByStoreKeyLogin + public function me(): ResourceByProjectKeyInStoreKeyByStoreKeyMe { $args = $this->getArgs(); - return new ResourceByProjectKeyInStoreKeyByStoreKeyLogin($args, $this->getClient()); + return new ResourceByProjectKeyInStoreKeyByStoreKeyMe($args, $this->getClient()); } /** */ - public function shippingMethods(): ResourceByProjectKeyInStoreKeyByStoreKeyShippingMethods + public function orders(): ResourceByProjectKeyInStoreKeyByStoreKeyOrders { $args = $this->getArgs(); - return new ResourceByProjectKeyInStoreKeyByStoreKeyShippingMethods($args, $this->getClient()); + return new ResourceByProjectKeyInStoreKeyByStoreKeyOrders($args, $this->getClient()); } /** */ - public function shoppingLists(): ResourceByProjectKeyInStoreKeyByStoreKeyShoppingLists + public function productProjections(): ResourceByProjectKeyInStoreKeyByStoreKeyProductProjections { $args = $this->getArgs(); - return new ResourceByProjectKeyInStoreKeyByStoreKeyShoppingLists($args, $this->getClient()); + return new ResourceByProjectKeyInStoreKeyByStoreKeyProductProjections($args, $this->getClient()); } /** */ - public function productProjections(): ResourceByProjectKeyInStoreKeyByStoreKeyProductProjections + public function productSelectionAssignments(): ResourceByProjectKeyInStoreKeyByStoreKeyProductSelectionAssignments { $args = $this->getArgs(); - return new ResourceByProjectKeyInStoreKeyByStoreKeyProductProjections($args, $this->getClient()); + return new ResourceByProjectKeyInStoreKeyByStoreKeyProductSelectionAssignments($args, $this->getClient()); } /** */ - public function productSelectionAssignments(): ResourceByProjectKeyInStoreKeyByStoreKeyProductSelectionAssignments + public function productTailoring(): ResourceByProjectKeyInStoreKeyByStoreKeyProductTailoring { $args = $this->getArgs(); - return new ResourceByProjectKeyInStoreKeyByStoreKeyProductSelectionAssignments($args, $this->getClient()); + return new ResourceByProjectKeyInStoreKeyByStoreKeyProductTailoring($args, $this->getClient()); } /** */ - public function cartDiscounts(): ResourceByProjectKeyInStoreKeyByStoreKeyCartDiscounts + public function products(): ResourceByProjectKeyInStoreKeyByStoreKeyProducts { $args = $this->getArgs(); - return new ResourceByProjectKeyInStoreKeyByStoreKeyCartDiscounts($args, $this->getClient()); + return new ResourceByProjectKeyInStoreKeyByStoreKeyProducts($args, $this->getClient()); } /** */ - public function productTailoring(): ResourceByProjectKeyInStoreKeyByStoreKeyProductTailoring + public function quoteRequests(): ResourceByProjectKeyInStoreKeyByStoreKeyQuoteRequests { $args = $this->getArgs(); - return new ResourceByProjectKeyInStoreKeyByStoreKeyProductTailoring($args, $this->getClient()); + return new ResourceByProjectKeyInStoreKeyByStoreKeyQuoteRequests($args, $this->getClient()); } /** */ - public function products(): ResourceByProjectKeyInStoreKeyByStoreKeyProducts + public function quotes(): ResourceByProjectKeyInStoreKeyByStoreKeyQuotes { $args = $this->getArgs(); - return new ResourceByProjectKeyInStoreKeyByStoreKeyProducts($args, $this->getClient()); + return new ResourceByProjectKeyInStoreKeyByStoreKeyQuotes($args, $this->getClient()); } /** */ - public function quoteRequests(): ResourceByProjectKeyInStoreKeyByStoreKeyQuoteRequests + public function shippingMethods(): ResourceByProjectKeyInStoreKeyByStoreKeyShippingMethods { $args = $this->getArgs(); - return new ResourceByProjectKeyInStoreKeyByStoreKeyQuoteRequests($args, $this->getClient()); + return new ResourceByProjectKeyInStoreKeyByStoreKeyShippingMethods($args, $this->getClient()); } /** */ - public function stagedQuotes(): ResourceByProjectKeyInStoreKeyByStoreKeyStagedQuotes + public function shoppingLists(): ResourceByProjectKeyInStoreKeyByStoreKeyShoppingLists { $args = $this->getArgs(); - return new ResourceByProjectKeyInStoreKeyByStoreKeyStagedQuotes($args, $this->getClient()); + return new ResourceByProjectKeyInStoreKeyByStoreKeyShoppingLists($args, $this->getClient()); } /** */ - public function quotes(): ResourceByProjectKeyInStoreKeyByStoreKeyQuotes + public function stagedQuotes(): ResourceByProjectKeyInStoreKeyByStoreKeyStagedQuotes { $args = $this->getArgs(); - return new ResourceByProjectKeyInStoreKeyByStoreKeyQuotes($args, $this->getClient()); + return new ResourceByProjectKeyInStoreKeyByStoreKeyStagedQuotes($args, $this->getClient()); } /** */ - public function businessUnits(): ResourceByProjectKeyInStoreKeyByStoreKeyBusinessUnits + public function login(): ResourceByProjectKeyInStoreKeyByStoreKeyLogin { $args = $this->getArgs(); - return new ResourceByProjectKeyInStoreKeyByStoreKeyBusinessUnits($args, $this->getClient()); + return new ResourceByProjectKeyInStoreKeyByStoreKeyLogin($args, $this->getClient()); } } diff --git a/references.txt b/references.txt index d95a6f1fced..55094b6fef1 100644 --- a/references.txt +++ b/references.txt @@ -465,3 +465,4 @@ aa465ddc60683d2befa938584d2d88fa054cc5cb 5c92f154265d21fff776730b17f7c6f27cbfdcb7 cd07396232802b1c29238fb92214946462f19e5d 01e4fa445e281319f4701427798eb2f10d9577d6 +75be7d69ebbeef0c07001c09c4c84e318aead40c