/** * 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.AsyncCallback; import java.util.concurrent.CountDownLatch; import com.mozu.api.security.AuthTicket; import org.apache.commons.lang.StringUtils; /** <summary> * Use the Wish Lists resource to manage the shopper wish lists of products associated with a customer account. Although customer accounts are managed at the tenant level, the system stores shopper wish lists at the site level. This enables the same customer to have wish lists for each of a merchant's sites. Use the Wish List Items resource to manage items in a wish list. * </summary> */ public class WishlistClient { /** * Retrieves a list of shopper wish lists according to any filter and sort criteria. * <p><pre><code> * MozuClient<com.mozu.api.contracts.commerceruntime.wishlists.WishlistCollection> mozuClient=GetWishlistsClient(); * client.setBaseAddress(url); * client.executeRequest(); * WishlistCollection wishlistCollection = client.Result(); * </code></pre></p> * @return Mozu.Api.MozuClient <com.mozu.api.contracts.commerceruntime.wishlists.WishlistCollection> * @see com.mozu.api.contracts.commerceruntime.wishlists.WishlistCollection */ public static MozuClient<com.mozu.api.contracts.commerceruntime.wishlists.WishlistCollection> getWishlistsClient() throws Exception { return getWishlistsClient( null, null, null, null, null, null, null); } /** * Retrieves a list of shopper wish lists according to any filter and sort criteria. * <p><pre><code> * MozuClient<com.mozu.api.contracts.commerceruntime.wishlists.WishlistCollection> mozuClient=GetWishlistsClient( startIndex, pageSize, sortBy, filter, q, qLimit, responseFields); * client.setBaseAddress(url); * client.executeRequest(); * WishlistCollection wishlistCollection = client.Result(); * </code></pre></p> * @param filter A set of expressions that consist of a field, operator, and value and represent search parameter syntax when filtering results of a query. Valid operators include equals (eq), does not equal (ne), greater than (gt), less than (lt), greater than or equal to (ge), less than or equal to (le), starts with (sw), or contains (cont). For example - "filter=IsDisplayed+eq+true" * @param pageSize The number of results to display on each page when creating paged results from a query. The maximum value is 200. * @param q A list of order search terms (not phrases) to use in the query when searching across order number and the name or email of the billing contact. When entering, separate multiple search terms with a space character. * @param qLimit The maximum number of search results to return in the response. You can limit any range between 1-100. * @param responseFields Use this field to include those fields which are not included by default. * @param sortBy The property by which to sort results and whether the results appear in ascending (a-z) order, represented by ASC or in descending (z-a) order, represented by DESC. The sortBy parameter follows an available property. For example: "sortBy=productCode+asc" * @param startIndex When creating paged results from a query, this value indicates the zero-based offset in the complete result set where the returned entities begin. For example, with a PageSize of 25, to get the 51st through the 75th items, use startIndex=3. * @return Mozu.Api.MozuClient <com.mozu.api.contracts.commerceruntime.wishlists.WishlistCollection> * @see com.mozu.api.contracts.commerceruntime.wishlists.WishlistCollection */ public static MozuClient<com.mozu.api.contracts.commerceruntime.wishlists.WishlistCollection> getWishlistsClient(Integer startIndex, Integer pageSize, String sortBy, String filter, String q, Integer qLimit, String responseFields) throws Exception { MozuUrl url = com.mozu.api.urls.commerce.WishlistUrl.getWishlistsUrl(filter, pageSize, q, qLimit, responseFields, sortBy, startIndex); String verb = "GET"; Class<?> clz = com.mozu.api.contracts.commerceruntime.wishlists.WishlistCollection.class; MozuClient<com.mozu.api.contracts.commerceruntime.wishlists.WishlistCollection> mozuClient = (MozuClient<com.mozu.api.contracts.commerceruntime.wishlists.WishlistCollection>) MozuClientFactory.getInstance(clz); mozuClient.setVerb(verb); mozuClient.setResourceUrl(url); return mozuClient; } /** * Retrieves the details of the shopper wish list specified in the request. * <p><pre><code> * MozuClient<com.mozu.api.contracts.commerceruntime.wishlists.Wishlist> mozuClient=GetWishlistClient( wishlistId); * client.setBaseAddress(url); * client.executeRequest(); * Wishlist wishlist = client.Result(); * </code></pre></p> * @param wishlistId Unique identifier of the wish list. * @return Mozu.Api.MozuClient <com.mozu.api.contracts.commerceruntime.wishlists.Wishlist> * @see com.mozu.api.contracts.commerceruntime.wishlists.Wishlist */ public static MozuClient<com.mozu.api.contracts.commerceruntime.wishlists.Wishlist> getWishlistClient(String wishlistId) throws Exception { return getWishlistClient( wishlistId, null); } /** * Retrieves the details of the shopper wish list specified in the request. * <p><pre><code> * MozuClient<com.mozu.api.contracts.commerceruntime.wishlists.Wishlist> mozuClient=GetWishlistClient( wishlistId, responseFields); * client.setBaseAddress(url); * client.executeRequest(); * Wishlist wishlist = client.Result(); * </code></pre></p> * @param responseFields Use this field to include those fields which are not included by default. * @param wishlistId Unique identifier of the wish list. * @return Mozu.Api.MozuClient <com.mozu.api.contracts.commerceruntime.wishlists.Wishlist> * @see com.mozu.api.contracts.commerceruntime.wishlists.Wishlist */ public static MozuClient<com.mozu.api.contracts.commerceruntime.wishlists.Wishlist> getWishlistClient(String wishlistId, String responseFields) throws Exception { MozuUrl url = com.mozu.api.urls.commerce.WishlistUrl.getWishlistUrl(responseFields, wishlistId); String verb = "GET"; Class<?> clz = com.mozu.api.contracts.commerceruntime.wishlists.Wishlist.class; MozuClient<com.mozu.api.contracts.commerceruntime.wishlists.Wishlist> mozuClient = (MozuClient<com.mozu.api.contracts.commerceruntime.wishlists.Wishlist>) MozuClientFactory.getInstance(clz); mozuClient.setVerb(verb); mozuClient.setResourceUrl(url); return mozuClient; } /** * Retrieves the details of a wish list by supplying the wish list name. * <p><pre><code> * MozuClient<com.mozu.api.contracts.commerceruntime.wishlists.Wishlist> mozuClient=GetWishlistByNameClient( customerAccountId, wishlistName); * client.setBaseAddress(url); * client.executeRequest(); * Wishlist wishlist = client.Result(); * </code></pre></p> * @param customerAccountId The unique identifier of the customer account for which to retrieve wish lists. * @param wishlistName The name of the wish list to retrieve. * @return Mozu.Api.MozuClient <com.mozu.api.contracts.commerceruntime.wishlists.Wishlist> * @see com.mozu.api.contracts.commerceruntime.wishlists.Wishlist */ public static MozuClient<com.mozu.api.contracts.commerceruntime.wishlists.Wishlist> getWishlistByNameClient(Integer customerAccountId, String wishlistName) throws Exception { return getWishlistByNameClient( customerAccountId, wishlistName, null); } /** * Retrieves the details of a wish list by supplying the wish list name. * <p><pre><code> * MozuClient<com.mozu.api.contracts.commerceruntime.wishlists.Wishlist> mozuClient=GetWishlistByNameClient( customerAccountId, wishlistName, responseFields); * client.setBaseAddress(url); * client.executeRequest(); * Wishlist wishlist = client.Result(); * </code></pre></p> * @param customerAccountId The unique identifier of the customer account for which to retrieve wish lists. * @param responseFields Use this field to include those fields which are not included by default. * @param wishlistName The name of the wish list to retrieve. * @return Mozu.Api.MozuClient <com.mozu.api.contracts.commerceruntime.wishlists.Wishlist> * @see com.mozu.api.contracts.commerceruntime.wishlists.Wishlist */ public static MozuClient<com.mozu.api.contracts.commerceruntime.wishlists.Wishlist> getWishlistByNameClient(Integer customerAccountId, String wishlistName, String responseFields) throws Exception { MozuUrl url = com.mozu.api.urls.commerce.WishlistUrl.getWishlistByNameUrl(customerAccountId, responseFields, wishlistName); String verb = "GET"; Class<?> clz = com.mozu.api.contracts.commerceruntime.wishlists.Wishlist.class; MozuClient<com.mozu.api.contracts.commerceruntime.wishlists.Wishlist> mozuClient = (MozuClient<com.mozu.api.contracts.commerceruntime.wishlists.Wishlist>) MozuClientFactory.getInstance(clz); mozuClient.setVerb(verb); mozuClient.setResourceUrl(url); return mozuClient; } /** * Creates a new shopper wish list for the associated customer account. Although customer accounts are maintained at the tenant level, the system stores wish lists at the site level. Newly created wish lists do not have any items. * <p><pre><code> * MozuClient<com.mozu.api.contracts.commerceruntime.wishlists.Wishlist> mozuClient=CreateWishlistClient( wishlist); * client.setBaseAddress(url); * client.executeRequest(); * Wishlist wishlist = client.Result(); * </code></pre></p> * @param wishlist Properties of a shopper wish list defined for a site, associated with a customer account. * @return Mozu.Api.MozuClient <com.mozu.api.contracts.commerceruntime.wishlists.Wishlist> * @see com.mozu.api.contracts.commerceruntime.wishlists.Wishlist * @see com.mozu.api.contracts.commerceruntime.wishlists.Wishlist */ public static MozuClient<com.mozu.api.contracts.commerceruntime.wishlists.Wishlist> createWishlistClient(com.mozu.api.contracts.commerceruntime.wishlists.Wishlist wishlist) throws Exception { return createWishlistClient( wishlist, null); } /** * Creates a new shopper wish list for the associated customer account. Although customer accounts are maintained at the tenant level, the system stores wish lists at the site level. Newly created wish lists do not have any items. * <p><pre><code> * MozuClient<com.mozu.api.contracts.commerceruntime.wishlists.Wishlist> mozuClient=CreateWishlistClient( wishlist, responseFields); * client.setBaseAddress(url); * client.executeRequest(); * Wishlist wishlist = client.Result(); * </code></pre></p> * @param responseFields Use this field to include those fields which are not included by default. * @param wishlist Properties of a shopper wish list defined for a site, associated with a customer account. * @return Mozu.Api.MozuClient <com.mozu.api.contracts.commerceruntime.wishlists.Wishlist> * @see com.mozu.api.contracts.commerceruntime.wishlists.Wishlist * @see com.mozu.api.contracts.commerceruntime.wishlists.Wishlist */ public static MozuClient<com.mozu.api.contracts.commerceruntime.wishlists.Wishlist> createWishlistClient(com.mozu.api.contracts.commerceruntime.wishlists.Wishlist wishlist, String responseFields) throws Exception { MozuUrl url = com.mozu.api.urls.commerce.WishlistUrl.createWishlistUrl(responseFields); String verb = "POST"; Class<?> clz = com.mozu.api.contracts.commerceruntime.wishlists.Wishlist.class; MozuClient<com.mozu.api.contracts.commerceruntime.wishlists.Wishlist> mozuClient = (MozuClient<com.mozu.api.contracts.commerceruntime.wishlists.Wishlist>) MozuClientFactory.getInstance(clz); mozuClient.setVerb(verb); mozuClient.setResourceUrl(url); mozuClient.setBody(wishlist); return mozuClient; } /** * Updates one or more properties of a shopper wish list defined for a customer account. * <p><pre><code> * MozuClient<com.mozu.api.contracts.commerceruntime.wishlists.Wishlist> mozuClient=UpdateWishlistClient( wishlist, wishlistId); * client.setBaseAddress(url); * client.executeRequest(); * Wishlist wishlist = client.Result(); * </code></pre></p> * @param wishlistId Unique identifier of the wish list. * @param wishlist Properties of a shopper wish list defined for a site, associated with a customer account. * @return Mozu.Api.MozuClient <com.mozu.api.contracts.commerceruntime.wishlists.Wishlist> * @see com.mozu.api.contracts.commerceruntime.wishlists.Wishlist * @see com.mozu.api.contracts.commerceruntime.wishlists.Wishlist */ public static MozuClient<com.mozu.api.contracts.commerceruntime.wishlists.Wishlist> updateWishlistClient(com.mozu.api.contracts.commerceruntime.wishlists.Wishlist wishlist, String wishlistId) throws Exception { return updateWishlistClient( wishlist, wishlistId, null); } /** * Updates one or more properties of a shopper wish list defined for a customer account. * <p><pre><code> * MozuClient<com.mozu.api.contracts.commerceruntime.wishlists.Wishlist> mozuClient=UpdateWishlistClient( wishlist, wishlistId, responseFields); * client.setBaseAddress(url); * client.executeRequest(); * Wishlist wishlist = client.Result(); * </code></pre></p> * @param responseFields Use this field to include those fields which are not included by default. * @param wishlistId Unique identifier of the wish list. * @param wishlist Properties of a shopper wish list defined for a site, associated with a customer account. * @return Mozu.Api.MozuClient <com.mozu.api.contracts.commerceruntime.wishlists.Wishlist> * @see com.mozu.api.contracts.commerceruntime.wishlists.Wishlist * @see com.mozu.api.contracts.commerceruntime.wishlists.Wishlist */ public static MozuClient<com.mozu.api.contracts.commerceruntime.wishlists.Wishlist> updateWishlistClient(com.mozu.api.contracts.commerceruntime.wishlists.Wishlist wishlist, String wishlistId, String responseFields) throws Exception { MozuUrl url = com.mozu.api.urls.commerce.WishlistUrl.updateWishlistUrl(responseFields, wishlistId); String verb = "PUT"; Class<?> clz = com.mozu.api.contracts.commerceruntime.wishlists.Wishlist.class; MozuClient<com.mozu.api.contracts.commerceruntime.wishlists.Wishlist> mozuClient = (MozuClient<com.mozu.api.contracts.commerceruntime.wishlists.Wishlist>) MozuClientFactory.getInstance(clz); mozuClient.setVerb(verb); mozuClient.setResourceUrl(url); mozuClient.setBody(wishlist); return mozuClient; } /** * Deletes the shopper wish list specified in the request and all items associated with it. * <p><pre><code> * MozuClient mozuClient=DeleteWishlistClient( wishlistId); * client.setBaseAddress(url); * client.executeRequest(); * </code></pre></p> * @param wishlistId Unique identifier of the wish list. * @return Mozu.Api.MozuClient */ public static MozuClient deleteWishlistClient(String wishlistId) throws Exception { MozuUrl url = com.mozu.api.urls.commerce.WishlistUrl.deleteWishlistUrl(wishlistId); String verb = "DELETE"; MozuClient mozuClient = (MozuClient) MozuClientFactory.getInstance(); mozuClient.setVerb(verb); mozuClient.setResourceUrl(url); return mozuClient; } }