Class ByProjectKeyCartsPost

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<ByProjectKeyCartsPost,Cart,CartDraft>
com.commercetools.api.client.ByProjectKeyCartsPost
All Implemented Interfaces:
Deprecatable201Trait<ByProjectKeyCartsPost>, ErrorableTrait<ByProjectKeyCartsPost>, ExpandableTrait<ByProjectKeyCartsPost>, io.vrap.rmf.base.client.ClientRequestCommand<Cart>, io.vrap.rmf.base.client.CreateHttpRequestCommand, io.vrap.rmf.base.client.HttpRequestCommand<Cart>, io.vrap.rmf.base.client.RequestCommand<Cart>

public class ByProjectKeyCartsPost extends io.vrap.rmf.base.client.TypeBodyApiMethod<ByProjectKeyCartsPost,Cart,CartDraft> implements ExpandableTrait<ByProjectKeyCartsPost>, Deprecatable201Trait<ByProjectKeyCartsPost>, ErrorableTrait<ByProjectKeyCartsPost>

Creating a Cart fails with an InvalidOperation error if the ShippingMethod referenced in the CartDraft has a predicate that does not match the Cart.



   CompletableFuture<ApiHttpResponse<com.commercetools.api.models.cart.Cart>> result = apiRoot
            .withProjectKey("{projectKey}")
            .carts()
            .post(null)
            .execute()
 
  • Constructor Details

    • ByProjectKeyCartsPost

      public ByProjectKeyCartsPost(io.vrap.rmf.base.client.ApiHttpClient apiHttpClient, String projectKey, CartDraft cartDraft)
    • ByProjectKeyCartsPost

      public ByProjectKeyCartsPost(ByProjectKeyCartsPost t)
  • Method Details

    • resultType

      public com.fasterxml.jackson.core.type.TypeReference<Cart> resultType()
      Specified by:
      resultType in interface io.vrap.rmf.base.client.HttpRequestCommand<Cart>
    • executeBlocking

      public io.vrap.rmf.base.client.ApiHttpResponse<Cart> executeBlocking(io.vrap.rmf.base.client.ApiHttpClient client, Duration timeout)
      Specified by:
      executeBlocking in interface io.vrap.rmf.base.client.ClientRequestCommand<Cart>
      Specified by:
      executeBlocking in class io.vrap.rmf.base.client.ApiMethod<ByProjectKeyCartsPost,Cart>
    • execute

      public CompletableFuture<io.vrap.rmf.base.client.ApiHttpResponse<Cart>> execute(io.vrap.rmf.base.client.ApiHttpClient client)
      Specified by:
      execute in interface io.vrap.rmf.base.client.ClientRequestCommand<Cart>
      Specified by:
      execute in class io.vrap.rmf.base.client.ApiMethod<ByProjectKeyCartsPost,Cart>
    • getProjectKey

      public String getProjectKey()
    • getExpand

      public List<String> getExpand()
      Specified by:
      getExpand in interface ExpandableTrait<ByProjectKeyCartsPost>
    • setProjectKey

      public void setProjectKey(String projectKey)
    • withExpand

      public <TValue> ByProjectKeyCartsPost withExpand(TValue expand)
      set expand with the specified value
      Specified by:
      withExpand in interface ExpandableTrait<ByProjectKeyCartsPost>
      Type Parameters:
      TValue - value type
      Parameters:
      expand - value to be set
      Returns:
      ByProjectKeyCartsPost
    • addExpand

      public <TValue> ByProjectKeyCartsPost addExpand(TValue expand)
      add additional expand query parameter
      Specified by:
      addExpand in interface ExpandableTrait<ByProjectKeyCartsPost>
      Type Parameters:
      TValue - value type
      Parameters:
      expand - value to be added
      Returns:
      ByProjectKeyCartsPost
    • withExpand

      public ByProjectKeyCartsPost withExpand(Supplier<String> supplier)
      set expand with the specified value
      Parameters:
      supplier - supplier for the value to be set
      Returns:
      ByProjectKeyCartsPost
    • addExpand

      public ByProjectKeyCartsPost addExpand(Supplier<String> supplier)
      add additional expand query parameter
      Parameters:
      supplier - supplier for the value to be added
      Returns:
      ByProjectKeyCartsPost
    • withExpand

      set expand with the specified value
      Parameters:
      op - builder for the value to be set
      Returns:
      ByProjectKeyCartsPost
    • addExpand

      add additional expand query parameter
      Parameters:
      op - builder for the value to be added
      Returns:
      ByProjectKeyCartsPost
    • withExpand

      public <TValue> ByProjectKeyCartsPost withExpand(Collection<TValue> expand)
      set expand with the specified values
      Type Parameters:
      TValue - value type
      Parameters:
      expand - values to be set
      Returns:
      ByProjectKeyCartsPost
    • addExpand

      public <TValue> ByProjectKeyCartsPost addExpand(Collection<TValue> expand)
      add additional expand query parameters
      Type Parameters:
      TValue - value type
      Parameters:
      expand - values to be added
      Returns:
      ByProjectKeyCartsPost
    • getBody

      public CartDraft getBody()
      Overrides:
      getBody in class io.vrap.rmf.base.client.TypeBodyApiMethod<ByProjectKeyCartsPost,Cart,CartDraft>
    • withBody

      public ByProjectKeyCartsPost withBody(CartDraft cartDraft)
      Overrides:
      withBody in class io.vrap.rmf.base.client.TypeBodyApiMethod<ByProjectKeyCartsPost,Cart,CartDraft>
    • equals

      public boolean equals(Object o)
    • hashCode

      public int hashCode()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • reflectionHashCode

      public int reflectionHashCode()