/** * 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.returns; 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 Return Notes resource to access and modify internal notes associated with returns. These notes can be useful to customer service representatives viewing them in . * </summary> */ public class OrderNoteResource { /// /// <see cref="Mozu.Api.ApiContext"/> /// private ApiContext _apiContext; public OrderNoteResource(ApiContext apiContext) { _apiContext = apiContext; } /** * Retrieves all internal notes associated with a return. * <p><pre><code> * OrderNote ordernote = new OrderNote(); * OrderNote orderNote = ordernote.getReturnNotes( returnId); * </code></pre></p> * @param returnId Unique identifier of the return whose items you want to get. * @return List<com.mozu.api.contracts.commerceruntime.orders.OrderNote> * @see com.mozu.api.contracts.commerceruntime.orders.OrderNote */ public List<com.mozu.api.contracts.commerceruntime.orders.OrderNote> getReturnNotes(String returnId) throws Exception { MozuClient<List<com.mozu.api.contracts.commerceruntime.orders.OrderNote>> client = com.mozu.api.clients.commerce.returns.OrderNoteClient.getReturnNotesClient( returnId); client.setContext(_apiContext); client.executeRequest(); return client.getResult(); } /** * Retrieves a specific internal note from a return. * <p><pre><code> * OrderNote ordernote = new OrderNote(); * OrderNote orderNote = ordernote.getReturnNote( returnId, noteId); * </code></pre></p> * @param noteId Unique identifier of a particular note to retrieve. * @param returnId Unique identifier of the return whose items you want to get. * @return com.mozu.api.contracts.commerceruntime.orders.OrderNote * @see com.mozu.api.contracts.commerceruntime.orders.OrderNote */ public com.mozu.api.contracts.commerceruntime.orders.OrderNote getReturnNote(String returnId, String noteId) throws Exception { return getReturnNote( returnId, noteId, null); } /** * Retrieves a specific internal note from a return. * <p><pre><code> * OrderNote ordernote = new OrderNote(); * OrderNote orderNote = ordernote.getReturnNote( returnId, noteId, responseFields); * </code></pre></p> * @param noteId Unique identifier of a particular note to retrieve. * @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 returnId Unique identifier of the return whose items you want to get. * @return com.mozu.api.contracts.commerceruntime.orders.OrderNote * @see com.mozu.api.contracts.commerceruntime.orders.OrderNote */ public com.mozu.api.contracts.commerceruntime.orders.OrderNote getReturnNote(String returnId, String noteId, String responseFields) throws Exception { MozuClient<com.mozu.api.contracts.commerceruntime.orders.OrderNote> client = com.mozu.api.clients.commerce.returns.OrderNoteClient.getReturnNoteClient( returnId, noteId, responseFields); client.setContext(_apiContext); client.executeRequest(); return client.getResult(); } /** * Creates an internal note on a given return. This note is visible in for customer service representatives to see. * <p><pre><code> * OrderNote ordernote = new OrderNote(); * OrderNote orderNote = ordernote.createReturnNote( returnNote, returnId); * </code></pre></p> * @param returnId Unique identifier of the return whose items you want to get. * @param returnNote * @return com.mozu.api.contracts.commerceruntime.orders.OrderNote * @see com.mozu.api.contracts.commerceruntime.orders.OrderNote * @see com.mozu.api.contracts.commerceruntime.orders.OrderNote */ public com.mozu.api.contracts.commerceruntime.orders.OrderNote createReturnNote(com.mozu.api.contracts.commerceruntime.orders.OrderNote returnNote, String returnId) throws Exception { return createReturnNote( returnNote, returnId, null); } /** * Creates an internal note on a given return. This note is visible in for customer service representatives to see. * <p><pre><code> * OrderNote ordernote = new OrderNote(); * OrderNote orderNote = ordernote.createReturnNote( returnNote, returnId, responseFields); * </code></pre></p> * @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 returnId Unique identifier of the return whose items you want to get. * @param returnNote * @return com.mozu.api.contracts.commerceruntime.orders.OrderNote * @see com.mozu.api.contracts.commerceruntime.orders.OrderNote * @see com.mozu.api.contracts.commerceruntime.orders.OrderNote */ public com.mozu.api.contracts.commerceruntime.orders.OrderNote createReturnNote(com.mozu.api.contracts.commerceruntime.orders.OrderNote returnNote, String returnId, String responseFields) throws Exception { MozuClient<com.mozu.api.contracts.commerceruntime.orders.OrderNote> client = com.mozu.api.clients.commerce.returns.OrderNoteClient.createReturnNoteClient( returnNote, returnId, responseFields); client.setContext(_apiContext); client.executeRequest(); return client.getResult(); } /** * Updates an internal note on a given return. This note is visible in for customer service representatives to see. * <p><pre><code> * OrderNote ordernote = new OrderNote(); * OrderNote orderNote = ordernote.updateReturnNote( returnNote, returnId, noteId); * </code></pre></p> * @param noteId Unique identifier of a particular note to retrieve. * @param returnId Unique identifier of the return whose items you want to get. * @param returnNote * @return com.mozu.api.contracts.commerceruntime.orders.OrderNote * @see com.mozu.api.contracts.commerceruntime.orders.OrderNote * @see com.mozu.api.contracts.commerceruntime.orders.OrderNote */ public com.mozu.api.contracts.commerceruntime.orders.OrderNote updateReturnNote(com.mozu.api.contracts.commerceruntime.orders.OrderNote returnNote, String returnId, String noteId) throws Exception { return updateReturnNote( returnNote, returnId, noteId, null); } /** * Updates an internal note on a given return. This note is visible in for customer service representatives to see. * <p><pre><code> * OrderNote ordernote = new OrderNote(); * OrderNote orderNote = ordernote.updateReturnNote( returnNote, returnId, noteId, responseFields); * </code></pre></p> * @param noteId Unique identifier of a particular note to retrieve. * @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 returnId Unique identifier of the return whose items you want to get. * @param returnNote * @return com.mozu.api.contracts.commerceruntime.orders.OrderNote * @see com.mozu.api.contracts.commerceruntime.orders.OrderNote * @see com.mozu.api.contracts.commerceruntime.orders.OrderNote */ public com.mozu.api.contracts.commerceruntime.orders.OrderNote updateReturnNote(com.mozu.api.contracts.commerceruntime.orders.OrderNote returnNote, String returnId, String noteId, String responseFields) throws Exception { MozuClient<com.mozu.api.contracts.commerceruntime.orders.OrderNote> client = com.mozu.api.clients.commerce.returns.OrderNoteClient.updateReturnNoteClient( returnNote, returnId, noteId, responseFields); client.setContext(_apiContext); client.executeRequest(); return client.getResult(); } /** * Deletes an internal note from a given return. * <p><pre><code> * OrderNote ordernote = new OrderNote(); * ordernote.deleteReturnNote( returnId, noteId); * </code></pre></p> * @param noteId Unique identifier of a particular note to retrieve. * @param returnId Unique identifier of the return whose items you want to get. * @return */ public void deleteReturnNote(String returnId, String noteId) throws Exception { MozuClient client = com.mozu.api.clients.commerce.returns.OrderNoteClient.deleteReturnNoteClient( returnId, noteId); client.setContext(_apiContext); client.executeRequest(); client.cleanupHttpConnection(); } }