/** * 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.catalog.admin.attributedefinition; 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; /** <summary> * Attributes are used to add custom definitions and characteristics to the following objects: * — are attributes that define the characteristics of products, enabling you to uniquely describe a product. They consist of options, properties, and extras. Refer to [Product Attributes](https://www.mozu.com/docs/guides/catalog/product-attributes.htm) in the Guides section for more information. * — are custom attributes that you can apply to customer accounts to add further definition for special uses, such as marketing campaigns, or discounts. Refer to [Customer Attributes](https://www.mozu.com/docs/guides/customers/customers.htm#customer_attributes) in the Guides section for more information. * — are custom attributes that enable you to uniquely describe an aspect of an order. Depending on the attribute definition, either you or a shopper can enter values for the order attribute. Refer to [Order Attributes](https://www.mozu.com/docs/guides/orders/order-attributes.htm) in the Guides section for more information. * </summary> */ public class AttributeClient { /** * Retrieves a paged list of attributes according to any specified filter criteria and sort options. * <p><pre><code> * MozuClient<com.mozu.api.contracts.productadmin.AttributeCollection> mozuClient=GetAttributesClient(); * client.setBaseAddress(url); * client.executeRequest(); * AttributeCollection attributeCollection = client.Result(); * </code></pre></p> * @param dataViewMode DataViewMode * @return Mozu.Api.MozuClient <com.mozu.api.contracts.productadmin.AttributeCollection> * @see com.mozu.api.contracts.productadmin.AttributeCollection */ public static MozuClient<com.mozu.api.contracts.productadmin.AttributeCollection> getAttributesClient() throws Exception { return getAttributesClient( null, null, null, null, null); } /** * Retrieves a paged list of attributes according to any specified filter criteria and sort options. * <p><pre><code> * MozuClient<com.mozu.api.contracts.productadmin.AttributeCollection> mozuClient=GetAttributesClient( startIndex, pageSize, sortBy, filter, responseFields); * client.setBaseAddress(url); * client.executeRequest(); * AttributeCollection attributeCollection = 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 responseFields Use this field to include those fields which are not included by default. * @param sortBy * @param startIndex * @param dataViewMode DataViewMode * @return Mozu.Api.MozuClient <com.mozu.api.contracts.productadmin.AttributeCollection> * @see com.mozu.api.contracts.productadmin.AttributeCollection */ public static MozuClient<com.mozu.api.contracts.productadmin.AttributeCollection> getAttributesClient(Integer startIndex, Integer pageSize, String sortBy, String filter, String responseFields) throws Exception { MozuUrl url = com.mozu.api.urls.commerce.catalog.admin.attributedefinition.AttributeUrl.getAttributesUrl(filter, pageSize, responseFields, sortBy, startIndex); String verb = "GET"; Class<?> clz = com.mozu.api.contracts.productadmin.AttributeCollection.class; MozuClient<com.mozu.api.contracts.productadmin.AttributeCollection> mozuClient = (MozuClient<com.mozu.api.contracts.productadmin.AttributeCollection>) MozuClientFactory.getInstance(clz); mozuClient.setVerb(verb); mozuClient.setResourceUrl(url); return mozuClient; } /** * Retrieves the details of the specified product attribute. * <p><pre><code> * MozuClient<com.mozu.api.contracts.productadmin.Attribute> mozuClient=GetAttributeClient( attributeFQN); * client.setBaseAddress(url); * client.executeRequest(); * Attribute attribute = client.Result(); * </code></pre></p> * @param attributeFQN The fully qualified name of the attribute, which is a user defined attribute identifier. * @param dataViewMode DataViewMode * @return Mozu.Api.MozuClient <com.mozu.api.contracts.productadmin.Attribute> * @see com.mozu.api.contracts.productadmin.Attribute */ public static MozuClient<com.mozu.api.contracts.productadmin.Attribute> getAttributeClient(String attributeFQN) throws Exception { return getAttributeClient( attributeFQN, null); } /** * Retrieves the details of the specified product attribute. * <p><pre><code> * MozuClient<com.mozu.api.contracts.productadmin.Attribute> mozuClient=GetAttributeClient( attributeFQN, responseFields); * client.setBaseAddress(url); * client.executeRequest(); * Attribute attribute = client.Result(); * </code></pre></p> * @param attributeFQN The fully qualified name of the attribute, which is a user defined attribute identifier. * @param responseFields Use this field to include those fields which are not included by default. * @param dataViewMode DataViewMode * @return Mozu.Api.MozuClient <com.mozu.api.contracts.productadmin.Attribute> * @see com.mozu.api.contracts.productadmin.Attribute */ public static MozuClient<com.mozu.api.contracts.productadmin.Attribute> getAttributeClient(String attributeFQN, String responseFields) throws Exception { MozuUrl url = com.mozu.api.urls.commerce.catalog.admin.attributedefinition.AttributeUrl.getAttributeUrl(attributeFQN, responseFields); String verb = "GET"; Class<?> clz = com.mozu.api.contracts.productadmin.Attribute.class; MozuClient<com.mozu.api.contracts.productadmin.Attribute> mozuClient = (MozuClient<com.mozu.api.contracts.productadmin.Attribute>) MozuClientFactory.getInstance(clz); mozuClient.setVerb(verb); mozuClient.setResourceUrl(url); return mozuClient; } /** * Creates a new attribute to describe one aspect of a product such as color or size, based on its defined product type. The attribute name, attribute type, input type, and data type are required. * <p><pre><code> * MozuClient<com.mozu.api.contracts.productadmin.Attribute> mozuClient=AddAttributeClient( attribute); * client.setBaseAddress(url); * client.executeRequest(); * Attribute attribute = client.Result(); * </code></pre></p> * @param dataViewMode DataViewMode * @param attribute Properties of an attribute used to describe customers or orders. * @return Mozu.Api.MozuClient <com.mozu.api.contracts.productadmin.Attribute> * @see com.mozu.api.contracts.productadmin.Attribute * @see com.mozu.api.contracts.productadmin.Attribute */ public static MozuClient<com.mozu.api.contracts.productadmin.Attribute> addAttributeClient(com.mozu.api.contracts.productadmin.Attribute attribute) throws Exception { return addAttributeClient( attribute, null); } /** * Creates a new attribute to describe one aspect of a product such as color or size, based on its defined product type. The attribute name, attribute type, input type, and data type are required. * <p><pre><code> * MozuClient<com.mozu.api.contracts.productadmin.Attribute> mozuClient=AddAttributeClient( attribute, responseFields); * client.setBaseAddress(url); * client.executeRequest(); * Attribute attribute = client.Result(); * </code></pre></p> * @param responseFields Use this field to include those fields which are not included by default. * @param dataViewMode DataViewMode * @param attribute Properties of an attribute used to describe customers or orders. * @return Mozu.Api.MozuClient <com.mozu.api.contracts.productadmin.Attribute> * @see com.mozu.api.contracts.productadmin.Attribute * @see com.mozu.api.contracts.productadmin.Attribute */ public static MozuClient<com.mozu.api.contracts.productadmin.Attribute> addAttributeClient(com.mozu.api.contracts.productadmin.Attribute attribute, String responseFields) throws Exception { MozuUrl url = com.mozu.api.urls.commerce.catalog.admin.attributedefinition.AttributeUrl.addAttributeUrl(responseFields); String verb = "POST"; Class<?> clz = com.mozu.api.contracts.productadmin.Attribute.class; MozuClient<com.mozu.api.contracts.productadmin.Attribute> mozuClient = (MozuClient<com.mozu.api.contracts.productadmin.Attribute>) MozuClientFactory.getInstance(clz); mozuClient.setVerb(verb); mozuClient.setResourceUrl(url); mozuClient.setBody(attribute); return mozuClient; } /** * Updates an existing attribute with attribute properties to set. * <p><pre><code> * MozuClient<com.mozu.api.contracts.productadmin.Attribute> mozuClient=UpdateAttributeClient( attribute, attributeFQN); * client.setBaseAddress(url); * client.executeRequest(); * Attribute attribute = client.Result(); * </code></pre></p> * @param attributeFQN The fully qualified name of the attribute, which is a user defined attribute identifier. * @param dataViewMode DataViewMode * @param attribute Properties of an attribute used to describe customers or orders. * @return Mozu.Api.MozuClient <com.mozu.api.contracts.productadmin.Attribute> * @see com.mozu.api.contracts.productadmin.Attribute * @see com.mozu.api.contracts.productadmin.Attribute */ public static MozuClient<com.mozu.api.contracts.productadmin.Attribute> updateAttributeClient(com.mozu.api.contracts.productadmin.Attribute attribute, String attributeFQN) throws Exception { return updateAttributeClient( attribute, attributeFQN, null); } /** * Updates an existing attribute with attribute properties to set. * <p><pre><code> * MozuClient<com.mozu.api.contracts.productadmin.Attribute> mozuClient=UpdateAttributeClient( attribute, attributeFQN, responseFields); * client.setBaseAddress(url); * client.executeRequest(); * Attribute attribute = client.Result(); * </code></pre></p> * @param attributeFQN The fully qualified name of the attribute, which is a user defined attribute identifier. * @param responseFields Use this field to include those fields which are not included by default. * @param dataViewMode DataViewMode * @param attribute Properties of an attribute used to describe customers or orders. * @return Mozu.Api.MozuClient <com.mozu.api.contracts.productadmin.Attribute> * @see com.mozu.api.contracts.productadmin.Attribute * @see com.mozu.api.contracts.productadmin.Attribute */ public static MozuClient<com.mozu.api.contracts.productadmin.Attribute> updateAttributeClient(com.mozu.api.contracts.productadmin.Attribute attribute, String attributeFQN, String responseFields) throws Exception { MozuUrl url = com.mozu.api.urls.commerce.catalog.admin.attributedefinition.AttributeUrl.updateAttributeUrl(attributeFQN, responseFields); String verb = "PUT"; Class<?> clz = com.mozu.api.contracts.productadmin.Attribute.class; MozuClient<com.mozu.api.contracts.productadmin.Attribute> mozuClient = (MozuClient<com.mozu.api.contracts.productadmin.Attribute>) MozuClientFactory.getInstance(clz); mozuClient.setVerb(verb); mozuClient.setResourceUrl(url); mozuClient.setBody(attribute); return mozuClient; } /** * Deletes a defined product attribute. You cannot delete an attribute assigned a value for a product. * <p><pre><code> * MozuClient mozuClient=DeleteAttributeClient( attributeFQN); * client.setBaseAddress(url); * client.executeRequest(); * </code></pre></p> * @param attributeFQN The fully qualified name of the attribute, which is a user defined attribute identifier. * @param dataViewMode DataViewMode * @return Mozu.Api.MozuClient */ public static MozuClient deleteAttributeClient(String attributeFQN) throws Exception { MozuUrl url = com.mozu.api.urls.commerce.catalog.admin.attributedefinition.AttributeUrl.deleteAttributeUrl(attributeFQN); String verb = "DELETE"; MozuClient mozuClient = (MozuClient) MozuClientFactory.getInstance(); mozuClient.setVerb(verb); mozuClient.setResourceUrl(url); return mozuClient; } }