com.mozu.api.clients.commerce.CartClient Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mozu-api-core Show documentation
Show all versions of mozu-api-core Show documentation
Mozu Java is a SDK that enables you to create robust Java applications that integrate with the Mozu platform
/**
* This code was auto-generated by a Codezu.
*
* Changes to this file may cause incorrect behavior and will be lost if
* the code is regenerated.
*/
package com.mozu.api.clients.commerce;
import java.util.List;
import java.util.ArrayList;
import com.mozu.api.MozuClient;
import com.mozu.api.MozuClientFactory;
import com.mozu.api.MozuUrl;
import com.mozu.api.Headers;
import org.joda.time.DateTime;
import com.mozu.api.security.AuthTicket;
import org.apache.commons.lang.StringUtils;
/**
* Use this resource to manage storefront shopping carts as shoppers add and remove items for purchase. Each time a shopper's cart is modified, the Carts resource updates the estimated total with any applicable discounts.
*
*/
public class CartClient {
/**
*
*
* MozuClient mozuClient=GetCartClient( cartId);
* client.setBaseAddress(url);
* client.executeRequest();
* Cart cart = client.Result();
*
* @param cartId Identifier of the cart to delete.
* @return Mozu.Api.MozuClient
* @see com.mozu.api.contracts.commerceruntime.carts.Cart
*/
public static MozuClient getCartClient(String cartId) throws Exception
{
return getCartClient( cartId, null);
}
/**
*
*
* MozuClient mozuClient=GetCartClient( cartId, responseFields);
* client.setBaseAddress(url);
* client.executeRequest();
* Cart cart = client.Result();
*
* @param cartId Identifier of the cart to delete.
* @param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss.
* @return Mozu.Api.MozuClient
* @see com.mozu.api.contracts.commerceruntime.carts.Cart
*/
public static MozuClient getCartClient(String cartId, String responseFields) throws Exception
{
MozuUrl url = com.mozu.api.urls.commerce.CartUrl.getCartUrl(cartId, responseFields);
String verb = "GET";
Class> clz = com.mozu.api.contracts.commerceruntime.carts.Cart.class;
MozuClient mozuClient = (MozuClient) MozuClientFactory.getInstance(clz);
mozuClient.setVerb(verb);
mozuClient.setResourceUrl(url);
return mozuClient;
}
/**
*
*
* MozuClient mozuClient=GetOrCreateCartClient();
* client.setBaseAddress(url);
* client.executeRequest();
* Cart cart = client.Result();
*
* @return Mozu.Api.MozuClient
* @see com.mozu.api.contracts.commerceruntime.carts.Cart
*/
public static MozuClient getOrCreateCartClient() throws Exception
{
return getOrCreateCartClient( null);
}
/**
*
*
* MozuClient mozuClient=GetOrCreateCartClient( responseFields);
* client.setBaseAddress(url);
* client.executeRequest();
* Cart cart = client.Result();
*
* @param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss.
* @return Mozu.Api.MozuClient
* @see com.mozu.api.contracts.commerceruntime.carts.Cart
*/
public static MozuClient getOrCreateCartClient(String responseFields) throws Exception
{
MozuUrl url = com.mozu.api.urls.commerce.CartUrl.getOrCreateCartUrl(responseFields);
String verb = "GET";
Class> clz = com.mozu.api.contracts.commerceruntime.carts.Cart.class;
MozuClient mozuClient = (MozuClient) MozuClientFactory.getInstance(clz);
mozuClient.setVerb(verb);
mozuClient.setResourceUrl(url);
return mozuClient;
}
/**
*
*
* MozuClient mozuClient=GetCartSummaryClient();
* client.setBaseAddress(url);
* client.executeRequest();
* CartSummary cartSummary = client.Result();
*
* @return Mozu.Api.MozuClient
* @see com.mozu.api.contracts.commerceruntime.carts.CartSummary
*/
public static MozuClient getCartSummaryClient() throws Exception
{
return getCartSummaryClient( null);
}
/**
*
*
* MozuClient mozuClient=GetCartSummaryClient( responseFields);
* client.setBaseAddress(url);
* client.executeRequest();
* CartSummary cartSummary = client.Result();
*
* @param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss.
* @return Mozu.Api.MozuClient
* @see com.mozu.api.contracts.commerceruntime.carts.CartSummary
*/
public static MozuClient getCartSummaryClient(String responseFields) throws Exception
{
MozuUrl url = com.mozu.api.urls.commerce.CartUrl.getCartSummaryUrl(responseFields);
String verb = "GET";
Class> clz = com.mozu.api.contracts.commerceruntime.carts.CartSummary.class;
MozuClient mozuClient = (MozuClient) MozuClientFactory.getInstance(clz);
mozuClient.setVerb(verb);
mozuClient.setResourceUrl(url);
return mozuClient;
}
/**
*
*
* MozuClient mozuClient=GetUserCartSummaryClient( userId);
* client.setBaseAddress(url);
* client.executeRequest();
* CartSummary cartSummary = client.Result();
*
* @param userId Unique identifier of the user whose tenant scopes you want to retrieve.
* @return Mozu.Api.MozuClient
* @see com.mozu.api.contracts.commerceruntime.carts.CartSummary
*/
public static MozuClient getUserCartSummaryClient(String userId) throws Exception
{
return getUserCartSummaryClient( userId, null);
}
/**
*
*
* MozuClient mozuClient=GetUserCartSummaryClient( userId, responseFields);
* client.setBaseAddress(url);
* client.executeRequest();
* CartSummary cartSummary = client.Result();
*
* @param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss.
* @param userId Unique identifier of the user whose tenant scopes you want to retrieve.
* @return Mozu.Api.MozuClient
* @see com.mozu.api.contracts.commerceruntime.carts.CartSummary
*/
public static MozuClient getUserCartSummaryClient(String userId, String responseFields) throws Exception
{
MozuUrl url = com.mozu.api.urls.commerce.CartUrl.getUserCartSummaryUrl(responseFields, userId);
String verb = "GET";
Class> clz = com.mozu.api.contracts.commerceruntime.carts.CartSummary.class;
MozuClient mozuClient = (MozuClient) MozuClientFactory.getInstance(clz);
mozuClient.setVerb(verb);
mozuClient.setResourceUrl(url);
return mozuClient;
}
/**
*
*
* MozuClient mozuClient=GetUserCartClient( userId);
* client.setBaseAddress(url);
* client.executeRequest();
* Cart cart = client.Result();
*
* @param userId Unique identifier of the user whose tenant scopes you want to retrieve.
* @return Mozu.Api.MozuClient
* @see com.mozu.api.contracts.commerceruntime.carts.Cart
*/
public static MozuClient getUserCartClient(String userId) throws Exception
{
return getUserCartClient( userId, null);
}
/**
*
*
* MozuClient mozuClient=GetUserCartClient( userId, responseFields);
* client.setBaseAddress(url);
* client.executeRequest();
* Cart cart = client.Result();
*
* @param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss.
* @param userId Unique identifier of the user whose tenant scopes you want to retrieve.
* @return Mozu.Api.MozuClient
* @see com.mozu.api.contracts.commerceruntime.carts.Cart
*/
public static MozuClient getUserCartClient(String userId, String responseFields) throws Exception
{
MozuUrl url = com.mozu.api.urls.commerce.CartUrl.getUserCartUrl(responseFields, userId);
String verb = "GET";
Class> clz = com.mozu.api.contracts.commerceruntime.carts.Cart.class;
MozuClient mozuClient = (MozuClient) MozuClientFactory.getInstance(clz);
mozuClient.setVerb(verb);
mozuClient.setResourceUrl(url);
return mozuClient;
}
/**
*
*
* MozuClient mozuClient=RejectSuggestedDiscountClient( cartId, discountId);
* client.setBaseAddress(url);
* client.executeRequest();
* Cart cart = client.Result();
*
* @param cartId Identifier of the cart to delete.
* @param discountId discountId parameter description DOCUMENT_HERE
* @return Mozu.Api.MozuClient
* @see com.mozu.api.contracts.commerceruntime.carts.Cart
*/
public static MozuClient rejectSuggestedDiscountClient(String cartId, Integer discountId) throws Exception
{
return rejectSuggestedDiscountClient( cartId, discountId, null);
}
/**
*
*
* MozuClient mozuClient=RejectSuggestedDiscountClient( cartId, discountId, responseFields);
* client.setBaseAddress(url);
* client.executeRequest();
* Cart cart = client.Result();
*
* @param cartId Identifier of the cart to delete.
* @param discountId discountId parameter description DOCUMENT_HERE
* @param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss.
* @return Mozu.Api.MozuClient
* @see com.mozu.api.contracts.commerceruntime.carts.Cart
*/
public static MozuClient rejectSuggestedDiscountClient(String cartId, Integer discountId, String responseFields) throws Exception
{
MozuUrl url = com.mozu.api.urls.commerce.CartUrl.rejectSuggestedDiscountUrl(cartId, discountId, responseFields);
String verb = "POST";
Class> clz = com.mozu.api.contracts.commerceruntime.carts.Cart.class;
MozuClient mozuClient = (MozuClient) MozuClientFactory.getInstance(clz);
mozuClient.setVerb(verb);
mozuClient.setResourceUrl(url);
return mozuClient;
}
/**
*
*
* MozuClient mozuClient=UpdateCartClient( cart);
* client.setBaseAddress(url);
* client.executeRequest();
* Cart cart = client.Result();
*
* @param cart Properties of a shopping cart.
* @return Mozu.Api.MozuClient
* @see com.mozu.api.contracts.commerceruntime.carts.Cart
* @see com.mozu.api.contracts.commerceruntime.carts.Cart
*/
public static MozuClient updateCartClient(com.mozu.api.contracts.commerceruntime.carts.Cart cart) throws Exception
{
return updateCartClient( cart, null);
}
/**
*
*
* MozuClient mozuClient=UpdateCartClient( cart, responseFields);
* client.setBaseAddress(url);
* client.executeRequest();
* Cart cart = client.Result();
*
* @param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss.
* @param cart Properties of a shopping cart.
* @return Mozu.Api.MozuClient
* @see com.mozu.api.contracts.commerceruntime.carts.Cart
* @see com.mozu.api.contracts.commerceruntime.carts.Cart
*/
public static MozuClient updateCartClient(com.mozu.api.contracts.commerceruntime.carts.Cart cart, String responseFields) throws Exception
{
MozuUrl url = com.mozu.api.urls.commerce.CartUrl.updateCartUrl(responseFields);
String verb = "PUT";
Class> clz = com.mozu.api.contracts.commerceruntime.carts.Cart.class;
MozuClient mozuClient = (MozuClient) MozuClientFactory.getInstance(clz);
mozuClient.setVerb(verb);
mozuClient.setResourceUrl(url);
mozuClient.setBody(cart);
return mozuClient;
}
/**
*
*
* MozuClient mozuClient=DeleteCartClient( cartId);
* client.setBaseAddress(url);
* client.executeRequest();
* Stream stream = client.Result();
*
* @param cartId Identifier of the cart to delete.
* @return Mozu.Api.MozuClient
* @see Stream
*/
public static MozuClient deleteCartClient(String cartId) throws Exception
{
MozuUrl url = com.mozu.api.urls.commerce.CartUrl.deleteCartUrl(cartId);
String verb = "DELETE";
Class> clz = java.io.InputStream.class;
MozuClient mozuClient = (MozuClient) MozuClientFactory.getInstance(clz);
mozuClient.setVerb(verb);
mozuClient.setResourceUrl(url);
return mozuClient;
}
/**
*
*
* MozuClient mozuClient=DeleteCurrentCartClient();
* client.setBaseAddress(url);
* client.executeRequest();
* Stream stream = client.Result();
*
* @return Mozu.Api.MozuClient
* @see Stream
*/
public static MozuClient deleteCurrentCartClient() throws Exception
{
MozuUrl url = com.mozu.api.urls.commerce.CartUrl.deleteCurrentCartUrl();
String verb = "DELETE";
Class> clz = java.io.InputStream.class;
MozuClient mozuClient = (MozuClient) MozuClientFactory.getInstance(clz);
mozuClient.setVerb(verb);
mozuClient.setResourceUrl(url);
return mozuClient;
}
}