/** * 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.event; 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> * Events are notifications publishes to the application when a create, read, update, or delete operation is performed. If the application subscribes to the event, you can use the Events resource to query for recent events published to your application or events that were not published successfully. * </summary> */ public class EventNotificationClient { /** * Retrieves a list of events. * <p><pre><code> * MozuClient<com.mozu.api.contracts.event.EventCollection> mozuClient=GetEventsClient(); * client.setBaseAddress(url); * client.executeRequest(); * EventCollection eventCollection = client.Result(); * </code></pre></p> * @return Mozu.Api.MozuClient <com.mozu.api.contracts.event.EventCollection> * @see com.mozu.api.contracts.event.EventCollection */ public static MozuClient<com.mozu.api.contracts.event.EventCollection> getEventsClient() throws Exception { return getEventsClient( null, null, null, null, null); } /** * Retrieves a list of events. * <p><pre><code> * MozuClient<com.mozu.api.contracts.event.EventCollection> mozuClient=GetEventsClient( startIndex, pageSize, sortBy, filter, responseFields); * client.setBaseAddress(url); * client.executeRequest(); * EventCollection eventCollection = 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 * @return Mozu.Api.MozuClient <com.mozu.api.contracts.event.EventCollection> * @see com.mozu.api.contracts.event.EventCollection */ public static MozuClient<com.mozu.api.contracts.event.EventCollection> getEventsClient(Integer startIndex, Integer pageSize, String sortBy, String filter, String responseFields) throws Exception { MozuUrl url = com.mozu.api.urls.event.EventNotificationUrl.getEventsUrl(filter, pageSize, responseFields, sortBy, startIndex); String verb = "GET"; Class<?> clz = com.mozu.api.contracts.event.EventCollection.class; MozuClient<com.mozu.api.contracts.event.EventCollection> mozuClient = (MozuClient<com.mozu.api.contracts.event.EventCollection>) MozuClientFactory.getInstance(clz); mozuClient.setVerb(verb); mozuClient.setResourceUrl(url); return mozuClient; } /** * Retrieves an event by providing the event ID. * <p><pre><code> * MozuClient<com.mozu.api.contracts.event.Event> mozuClient=GetEventClient( eventId); * client.setBaseAddress(url); * client.executeRequest(); * Event event = client.Result(); * </code></pre></p> * @param eventId The unique identifier of the event being retrieved. An event is a notification about a create, read, update, or delete on an order, product, discount or category. * @return Mozu.Api.MozuClient <com.mozu.api.contracts.event.Event> * @see com.mozu.api.contracts.event.Event */ public static MozuClient<com.mozu.api.contracts.event.Event> getEventClient(String eventId) throws Exception { return getEventClient( eventId, null); } /** * Retrieves an event by providing the event ID. * <p><pre><code> * MozuClient<com.mozu.api.contracts.event.Event> mozuClient=GetEventClient( eventId, responseFields); * client.setBaseAddress(url); * client.executeRequest(); * Event event = client.Result(); * </code></pre></p> * @param eventId The unique identifier of the event being retrieved. An event is a notification about a create, read, update, or delete on an order, product, discount or category. * @param responseFields Use this field to include those fields which are not included by default. * @return Mozu.Api.MozuClient <com.mozu.api.contracts.event.Event> * @see com.mozu.api.contracts.event.Event */ public static MozuClient<com.mozu.api.contracts.event.Event> getEventClient(String eventId, String responseFields) throws Exception { MozuUrl url = com.mozu.api.urls.event.EventNotificationUrl.getEventUrl(eventId, responseFields); String verb = "GET"; Class<?> clz = com.mozu.api.contracts.event.Event.class; MozuClient<com.mozu.api.contracts.event.Event> mozuClient = (MozuClient<com.mozu.api.contracts.event.Event>) MozuClientFactory.getInstance(clz); mozuClient.setVerb(verb); mozuClient.setResourceUrl(url); return mozuClient; } }