/**
 *     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.orders;

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 com.mozu.api.AsyncCallback;
import java.util.concurrent.CountDownLatch;
import com.mozu.api.security.AuthTicket;
import org.apache.commons.lang.StringUtils;

/** <summary>
 * Use the Fulfillment Information resource to manage shipping or pickup information for orders.
 * </summary>
 */
public class FulfillmentInfoResource {
	///
	/// <see cref="Mozu.Api.ApiContext"/>
	///
	private ApiContext _apiContext;


	public FulfillmentInfoResource(ApiContext apiContext) 
	{
		_apiContext = apiContext;
	}

	
	/**
	 * Retrieves a list of the fulfillment information for the specified order.
	 * <p><pre><code>
	 *	FulfillmentInfo fulfillmentinfo = new FulfillmentInfo();
	 *	FulfillmentInfo fulfillmentInfo = fulfillmentinfo.getFulfillmentInfo( orderId);
	 * </code></pre></p>
	 * @param orderId Unique identifier of the order.
	 * @return com.mozu.api.contracts.commerceruntime.fulfillment.FulfillmentInfo
	 * @see com.mozu.api.contracts.commerceruntime.fulfillment.FulfillmentInfo
	 */
	public com.mozu.api.contracts.commerceruntime.fulfillment.FulfillmentInfo getFulfillmentInfo(String orderId) throws Exception
	{
		return getFulfillmentInfo( orderId,  null,  null);
	}

	/**
	 * Retrieves a list of the fulfillment information for the specified order.
	 * <p><pre><code>
	 *	FulfillmentInfo fulfillmentinfo = new FulfillmentInfo();
	 *	CountDownLatch latch = fulfillmentinfo.getFulfillmentInfo( orderId, callback );
	 *	latch.await()	 * </code></pre></p>
	 * @param orderId Unique identifier of the order.
	 * @param  callback callback handler for asynchronous operations
	 * @return com.mozu.api.contracts.commerceruntime.fulfillment.FulfillmentInfo
	 * @see com.mozu.api.contracts.commerceruntime.fulfillment.FulfillmentInfo
	 */
	public CountDownLatch getFulfillmentInfoAsync(String orderId, AsyncCallback<com.mozu.api.contracts.commerceruntime.fulfillment.FulfillmentInfo> callback) throws Exception
	{
		return getFulfillmentInfoAsync( orderId,  null,  null, callback);
	}

	/**
	 * Retrieves a list of the fulfillment information for the specified order.
	 * <p><pre><code>
	 *	FulfillmentInfo fulfillmentinfo = new FulfillmentInfo();
	 *	FulfillmentInfo fulfillmentInfo = fulfillmentinfo.getFulfillmentInfo( orderId,  draft,  responseFields);
	 * </code></pre></p>
	 * @param draft If true, retrieve the draft version of the order, which might include uncommitted changes to the order or its components.
	 * @param orderId Unique identifier of the order.
	 * @param responseFields Use this field to include those fields which are not included by default.
	 * @return com.mozu.api.contracts.commerceruntime.fulfillment.FulfillmentInfo
	 * @see com.mozu.api.contracts.commerceruntime.fulfillment.FulfillmentInfo
	 */
	public com.mozu.api.contracts.commerceruntime.fulfillment.FulfillmentInfo getFulfillmentInfo(String orderId, Boolean draft, String responseFields) throws Exception
	{
		MozuClient<com.mozu.api.contracts.commerceruntime.fulfillment.FulfillmentInfo> client = com.mozu.api.clients.commerce.orders.FulfillmentInfoClient.getFulfillmentInfoClient( orderId,  draft,  responseFields);
		client.setContext(_apiContext);
		client.executeRequest();
		return client.getResult();

	}

	/**
	 * Retrieves a list of the fulfillment information for the specified order.
	 * <p><pre><code>
	 *	FulfillmentInfo fulfillmentinfo = new FulfillmentInfo();
	 *	CountDownLatch latch = fulfillmentinfo.getFulfillmentInfo( orderId,  draft,  responseFields, callback );
	 *	latch.await()	 * </code></pre></p>
	 * @param draft If true, retrieve the draft version of the order, which might include uncommitted changes to the order or its components.
	 * @param orderId Unique identifier of the order.
	 * @param responseFields Use this field to include those fields which are not included by default.
	 * @param  callback callback handler for asynchronous operations
	 * @return com.mozu.api.contracts.commerceruntime.fulfillment.FulfillmentInfo
	 * @see com.mozu.api.contracts.commerceruntime.fulfillment.FulfillmentInfo
	 */
	public CountDownLatch getFulfillmentInfoAsync(String orderId, Boolean draft, String responseFields, AsyncCallback<com.mozu.api.contracts.commerceruntime.fulfillment.FulfillmentInfo> callback) throws Exception
	{
		MozuClient<com.mozu.api.contracts.commerceruntime.fulfillment.FulfillmentInfo> client = com.mozu.api.clients.commerce.orders.FulfillmentInfoClient.getFulfillmentInfoClient( orderId,  draft,  responseFields);
		client.setContext(_apiContext);
		return client.executeRequest(callback);

	}

	/**
	 * Updates one or more properties of fulfillment information for the specified order.
	 * <p><pre><code>
	 *	FulfillmentInfo fulfillmentinfo = new FulfillmentInfo();
	 *	FulfillmentInfo fulfillmentInfo = fulfillmentinfo.setFulFillmentInfo( fulfillmentInfo,  orderId);
	 * </code></pre></p>
	 * @param orderId Unique identifier of the order.
	 * @param fulfillmentInfo Properties of the information needed to fulfill an order, whether via in-store pickup or direct shipping.
	 * @return com.mozu.api.contracts.commerceruntime.fulfillment.FulfillmentInfo
	 * @see com.mozu.api.contracts.commerceruntime.fulfillment.FulfillmentInfo
	 * @see com.mozu.api.contracts.commerceruntime.fulfillment.FulfillmentInfo
	 */
	public com.mozu.api.contracts.commerceruntime.fulfillment.FulfillmentInfo setFulFillmentInfo(com.mozu.api.contracts.commerceruntime.fulfillment.FulfillmentInfo fulfillmentInfo, String orderId) throws Exception
	{
		return setFulFillmentInfo( fulfillmentInfo,  orderId,  null,  null,  null);
	}

	/**
	 * Updates one or more properties of fulfillment information for the specified order.
	 * <p><pre><code>
	 *	FulfillmentInfo fulfillmentinfo = new FulfillmentInfo();
	 *	CountDownLatch latch = fulfillmentinfo.setFulFillmentInfo( fulfillmentInfo,  orderId, callback );
	 *	latch.await()	 * </code></pre></p>
	 * @param orderId Unique identifier of the order.
	 * @param  callback callback handler for asynchronous operations
	 * @param fulfillmentInfo Properties of the information needed to fulfill an order, whether via in-store pickup or direct shipping.
	 * @return com.mozu.api.contracts.commerceruntime.fulfillment.FulfillmentInfo
	 * @see com.mozu.api.contracts.commerceruntime.fulfillment.FulfillmentInfo
	 * @see com.mozu.api.contracts.commerceruntime.fulfillment.FulfillmentInfo
	 */
	public CountDownLatch setFulFillmentInfoAsync(com.mozu.api.contracts.commerceruntime.fulfillment.FulfillmentInfo fulfillmentInfo, String orderId, AsyncCallback<com.mozu.api.contracts.commerceruntime.fulfillment.FulfillmentInfo> callback) throws Exception
	{
		return setFulFillmentInfoAsync( fulfillmentInfo,  orderId,  null,  null,  null, callback);
	}

	/**
	 * Updates one or more properties of fulfillment information for the specified order.
	 * <p><pre><code>
	 *	FulfillmentInfo fulfillmentinfo = new FulfillmentInfo();
	 *	FulfillmentInfo fulfillmentInfo = fulfillmentinfo.setFulFillmentInfo( fulfillmentInfo,  orderId,  updateMode,  version,  responseFields);
	 * </code></pre></p>
	 * @param orderId Unique identifier of the order.
	 * @param responseFields Use this field to include those fields which are not included by default.
	 * @param updateMode Specifies whether to update the original order, update the order in draft mode, or update the order in draft mode and then commit the changes to the original. Draft mode enables users to make incremental order changes before committing the changes to the original order. Valid values are "ApplyToOriginal," "ApplyToDraft," or "ApplyAndCommit."
	 * @param version System-supplied integer that represents the current version of the order, which prevents users from unintentionally overriding changes to the order. When a user performs an operation for a defined order, the system validates that the version of the updated order matches the version of the order on the server. After the operation completes successfully, the system increments the version number by one.
	 * @param fulfillmentInfo Properties of the information needed to fulfill an order, whether via in-store pickup or direct shipping.
	 * @return com.mozu.api.contracts.commerceruntime.fulfillment.FulfillmentInfo
	 * @see com.mozu.api.contracts.commerceruntime.fulfillment.FulfillmentInfo
	 * @see com.mozu.api.contracts.commerceruntime.fulfillment.FulfillmentInfo
	 */
	public com.mozu.api.contracts.commerceruntime.fulfillment.FulfillmentInfo setFulFillmentInfo(com.mozu.api.contracts.commerceruntime.fulfillment.FulfillmentInfo fulfillmentInfo, String orderId, String updateMode, String version, String responseFields) throws Exception
	{
		MozuClient<com.mozu.api.contracts.commerceruntime.fulfillment.FulfillmentInfo> client = com.mozu.api.clients.commerce.orders.FulfillmentInfoClient.setFulFillmentInfoClient( fulfillmentInfo,  orderId,  updateMode,  version,  responseFields);
		client.setContext(_apiContext);
		client.executeRequest();
		return client.getResult();

	}

	/**
	 * Updates one or more properties of fulfillment information for the specified order.
	 * <p><pre><code>
	 *	FulfillmentInfo fulfillmentinfo = new FulfillmentInfo();
	 *	CountDownLatch latch = fulfillmentinfo.setFulFillmentInfo( fulfillmentInfo,  orderId,  updateMode,  version,  responseFields, callback );
	 *	latch.await()	 * </code></pre></p>
	 * @param orderId Unique identifier of the order.
	 * @param responseFields Use this field to include those fields which are not included by default.
	 * @param updateMode Specifies whether to update the original order, update the order in draft mode, or update the order in draft mode and then commit the changes to the original. Draft mode enables users to make incremental order changes before committing the changes to the original order. Valid values are "ApplyToOriginal," "ApplyToDraft," or "ApplyAndCommit."
	 * @param version System-supplied integer that represents the current version of the order, which prevents users from unintentionally overriding changes to the order. When a user performs an operation for a defined order, the system validates that the version of the updated order matches the version of the order on the server. After the operation completes successfully, the system increments the version number by one.
	 * @param  callback callback handler for asynchronous operations
	 * @param fulfillmentInfo Properties of the information needed to fulfill an order, whether via in-store pickup or direct shipping.
	 * @return com.mozu.api.contracts.commerceruntime.fulfillment.FulfillmentInfo
	 * @see com.mozu.api.contracts.commerceruntime.fulfillment.FulfillmentInfo
	 * @see com.mozu.api.contracts.commerceruntime.fulfillment.FulfillmentInfo
	 */
	public CountDownLatch setFulFillmentInfoAsync(com.mozu.api.contracts.commerceruntime.fulfillment.FulfillmentInfo fulfillmentInfo, String orderId, String updateMode, String version, String responseFields, AsyncCallback<com.mozu.api.contracts.commerceruntime.fulfillment.FulfillmentInfo> callback) throws Exception
	{
		MozuClient<com.mozu.api.contracts.commerceruntime.fulfillment.FulfillmentInfo> client = com.mozu.api.clients.commerce.orders.FulfillmentInfoClient.setFulFillmentInfoClient( fulfillmentInfo,  orderId,  updateMode,  version,  responseFields);
		client.setContext(_apiContext);
		return client.executeRequest(callback);

	}

}



