Package com.commercetools.api.client
Class ByProjectKeyCartsReplicatePostString
java.lang.Object
io.vrap.rmf.base.client.ApiMethod<T,TResult>
io.vrap.rmf.base.client.BodyApiMethod<T,TResult,TBody>
io.vrap.rmf.base.client.TypeBodyApiMethod<T,TResult,String>
io.vrap.rmf.base.client.StringBodyApiMethod<ByProjectKeyCartsReplicatePostString,Cart>
com.commercetools.api.client.ByProjectKeyCartsReplicatePostString
- All Implemented Interfaces:
ErrorableTrait<ByProjectKeyCartsReplicatePostString>,ClientRequestCommand<Cart>,CreateHttpRequestCommand,HttpRequestCommand<Cart>,RequestCommand<Cart>
public class ByProjectKeyCartsReplicatePostString
extends StringBodyApiMethod<ByProjectKeyCartsReplicatePostString,Cart>
implements ErrorableTrait<ByProjectKeyCartsReplicatePostString>
Creates a new Cart by replicating an existing Cart or Order.
The following applies to the new Cart:
- It contains the same Customer information, Line Items and Custom Line Items, Custom Fields, Discount Codes, and other settings of the originating Cart or Order.
- If a Line Item becomes invalid, it is removed from the new Cart. A common reason for this is removed Products or Prices.
- Line items and Custom Line Items are reset to their initial state.
- It contains no payments or delivery information.
- It contains up-to-date Tax Rates, Prices, and Line Item product data.
- The CartState is
Active. - If using the
customerGroupfield (for a single Customer Group) and the referenced Customer switched to another Customer Group, the new Cart is automatically updated to reflect the new group and corresponding prices. - If using the
customerGroupAssignmentsfield (for multiple Customer Groups), the Cart no longer keeps a direct reference to a Customer Group. If a Customer’s group assignments change, the Cart and its Line Item prices are not updated automatically. Prices are only updated when the Cart is changed via a direct update action.
Specific Error Codes:
CompletableFuture<ApiHttpResponse<com.commercetools.api.models.cart.Cart>> result = apiRoot
.withProjectKey("{projectKey}")
.carts()
.replicate()
.post("")
.execute()
-
Nested Class Summary
Nested classes/interfaces inherited from class io.vrap.rmf.base.client.ApiMethod
ApiMethod.ParamEntry<K,V> -
Constructor Summary
ConstructorsConstructorDescriptionByProjectKeyCartsReplicatePostString(ApiHttpClient apiHttpClient, String projectKey, String replicaCartDraft) -
Method Summary
Modifier and TypeMethodDescriptionbooleanexecute(ApiHttpClient client) executeBlocking(ApiHttpClient client, Duration timeout) getBody()inthashCode()intcom.fasterxml.jackson.core.type.TypeReference<Cart>voidsetProjectKey(String projectKey) toString()Methods inherited from class io.vrap.rmf.base.client.ApiMethod
addHeader, addQueryParam, addQueryParams, contentType, createHttpRequest, execute, execute, execute, execute, execute, execute, execute, executeBlocking, executeBlocking, executeBlocking, executeBlocking, executeBlocking, executeBlocking, executeBlocking, executeBlocking, executeBlocking, executeBlocking, executeBlocking, executeBlocking, executeBlocking, getFirstQueryParam, getHeaders, getQueryParam, getQueryParams, getQueryParamUriString, getQueryParamUriStrings, send, sendBlocking, sendBlocking, with, with, withHeader, withHeaders, withHttpRequest, withoutHeader, withoutQueryParam, withQueryParam, withQueryParamsMethods inherited from interface io.vrap.rmf.base.client.ClientRequestCommand
executeBlockingMethods inherited from interface io.vrap.rmf.base.client.CreateHttpRequestCommand
createHttpRequestMethods inherited from interface com.commercetools.api.client.ErrorableTrait
asErrorableTrait, asErrorableTraitToBaseTypeMethods inherited from interface io.vrap.rmf.base.client.RequestCommand
executeBlocking
-
Constructor Details
-
ByProjectKeyCartsReplicatePostString
public ByProjectKeyCartsReplicatePostString(ApiHttpClient apiHttpClient, String projectKey, String replicaCartDraft) -
ByProjectKeyCartsReplicatePostString
-
-
Method Details
-
resultType
- Specified by:
resultTypein interfaceHttpRequestCommand<Cart>
-
executeBlocking
- Specified by:
executeBlockingin interfaceClientRequestCommand<Cart>- Specified by:
executeBlockingin classApiMethod<ByProjectKeyCartsReplicatePostString,Cart>
-
execute
- Specified by:
executein interfaceClientRequestCommand<Cart>- Specified by:
executein classApiMethod<ByProjectKeyCartsReplicatePostString,Cart>
-
getProjectKey
-
setProjectKey
-
getBody
- Overrides:
getBodyin classStringBodyApiMethod<ByProjectKeyCartsReplicatePostString,Cart>
-
withBody
- Overrides:
withBodyin classStringBodyApiMethod<ByProjectKeyCartsReplicatePostString,Cart>
-
equals
-
hashCode
public int hashCode() -
toString
-
reflectionHashCode
public int reflectionHashCode()
-