/** * 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.resources.commerce.admin; import com.mozu.api.ApiContext; 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> * Use the Location Types resource to manage the types of locations your tenant maintains, such as warehouses, physical storefronts, and kiosks. * </summary> */ public class LocationTypeResource { /// /// <see cref="Mozu.Api.ApiContext"/> /// private ApiContext _apiContext; public LocationTypeResource(ApiContext apiContext) { _apiContext = apiContext; } /** * Retrieve a list of all location types defined for the tenant. * <p><pre><code> * LocationType locationtype = new LocationType(); * LocationType locationType = locationtype.getLocationTypes(); * </code></pre></p> * @return List<com.mozu.api.contracts.location.LocationType> * @see com.mozu.api.contracts.location.LocationType */ public List<com.mozu.api.contracts.location.LocationType> getLocationTypes() throws Exception { MozuClient<List<com.mozu.api.contracts.location.LocationType>> client = com.mozu.api.clients.commerce.admin.LocationTypeClient.getLocationTypesClient(); client.setContext(_apiContext); client.executeRequest(); return client.getResult(); } /** * Retrieves the details of the location type specified in the request. * <p><pre><code> * LocationType locationtype = new LocationType(); * LocationType locationType = locationtype.getLocationType( locationTypeCode); * </code></pre></p> * @param locationTypeCode The user-defined code that identifies the location type. * @return com.mozu.api.contracts.location.LocationType * @see com.mozu.api.contracts.location.LocationType */ public com.mozu.api.contracts.location.LocationType getLocationType(String locationTypeCode) throws Exception { return getLocationType( locationTypeCode, null); } /** * Retrieves the details of the location type specified in the request. * <p><pre><code> * LocationType locationtype = new LocationType(); * LocationType locationType = locationtype.getLocationType( locationTypeCode, responseFields); * </code></pre></p> * @param locationTypeCode The user-defined code that identifies the location type. * @param responseFields Use this field to include those fields which are not included by default. * @return com.mozu.api.contracts.location.LocationType * @see com.mozu.api.contracts.location.LocationType */ public com.mozu.api.contracts.location.LocationType getLocationType(String locationTypeCode, String responseFields) throws Exception { MozuClient<com.mozu.api.contracts.location.LocationType> client = com.mozu.api.clients.commerce.admin.LocationTypeClient.getLocationTypeClient( locationTypeCode, responseFields); client.setContext(_apiContext); client.executeRequest(); return client.getResult(); } /** * Creates a new location type based on the information specified in the request. * <p><pre><code> * LocationType locationtype = new LocationType(); * LocationType locationType = locationtype.addLocationType( locationType); * </code></pre></p> * @param locationType Properties of a type of physical location, such as warehouse or kiosk. Location types enable tenants to group similar locations for filtering and location usage type definition. * @return com.mozu.api.contracts.location.LocationType * @see com.mozu.api.contracts.location.LocationType * @see com.mozu.api.contracts.location.LocationType */ public com.mozu.api.contracts.location.LocationType addLocationType(com.mozu.api.contracts.location.LocationType locationType) throws Exception { return addLocationType( locationType, null); } /** * Creates a new location type based on the information specified in the request. * <p><pre><code> * LocationType locationtype = new LocationType(); * LocationType locationType = locationtype.addLocationType( locationType, responseFields); * </code></pre></p> * @param responseFields Use this field to include those fields which are not included by default. * @param locationType Properties of a type of physical location, such as warehouse or kiosk. Location types enable tenants to group similar locations for filtering and location usage type definition. * @return com.mozu.api.contracts.location.LocationType * @see com.mozu.api.contracts.location.LocationType * @see com.mozu.api.contracts.location.LocationType */ public com.mozu.api.contracts.location.LocationType addLocationType(com.mozu.api.contracts.location.LocationType locationType, String responseFields) throws Exception { MozuClient<com.mozu.api.contracts.location.LocationType> client = com.mozu.api.clients.commerce.admin.LocationTypeClient.addLocationTypeClient( locationType, responseFields); client.setContext(_apiContext); client.executeRequest(); return client.getResult(); } /** * Updates the name of a defined location type. * <p><pre><code> * LocationType locationtype = new LocationType(); * LocationType locationType = locationtype.updateLocationType( locationType, locationTypeCode); * </code></pre></p> * @param locationTypeCode The user-defined code that identifies the location type. * @param locationType Properties of a type of physical location, such as warehouse or kiosk. Location types enable tenants to group similar locations for filtering and location usage type definition. * @return com.mozu.api.contracts.location.LocationType * @see com.mozu.api.contracts.location.LocationType * @see com.mozu.api.contracts.location.LocationType */ public com.mozu.api.contracts.location.LocationType updateLocationType(com.mozu.api.contracts.location.LocationType locationType, String locationTypeCode) throws Exception { return updateLocationType( locationType, locationTypeCode, null); } /** * Updates the name of a defined location type. * <p><pre><code> * LocationType locationtype = new LocationType(); * LocationType locationType = locationtype.updateLocationType( locationType, locationTypeCode, responseFields); * </code></pre></p> * @param locationTypeCode The user-defined code that identifies the location type. * @param responseFields Use this field to include those fields which are not included by default. * @param locationType Properties of a type of physical location, such as warehouse or kiosk. Location types enable tenants to group similar locations for filtering and location usage type definition. * @return com.mozu.api.contracts.location.LocationType * @see com.mozu.api.contracts.location.LocationType * @see com.mozu.api.contracts.location.LocationType */ public com.mozu.api.contracts.location.LocationType updateLocationType(com.mozu.api.contracts.location.LocationType locationType, String locationTypeCode, String responseFields) throws Exception { MozuClient<com.mozu.api.contracts.location.LocationType> client = com.mozu.api.clients.commerce.admin.LocationTypeClient.updateLocationTypeClient( locationType, locationTypeCode, responseFields); client.setContext(_apiContext); client.executeRequest(); return client.getResult(); } /** * Deletes the location type specified in the request. * <p><pre><code> * LocationType locationtype = new LocationType(); * locationtype.deleteLocationType( locationTypeCode); * </code></pre></p> * @param locationTypeCode The user-defined code that identifies the location type. * @return */ public void deleteLocationType(String locationTypeCode) throws Exception { MozuClient client = com.mozu.api.clients.commerce.admin.LocationTypeClient.deleteLocationTypeClient( locationTypeCode); client.setContext(_apiContext); client.executeRequest(); client.cleanupHttpConnection(); } }