/**
 *     This code was auto-generated by a tool.     
 *
 *     Changes to this file may cause incorrect behavior and will be lost if
 *     the code is regenerated.
 */
package com.mozu.api.clients.commerce;

import java.util.List;
import java.util.ArrayList;
import com.mozu.api.MozuClient;
import com.mozu.api.MozuUrl;
import com.mozu.api.Headers;
import com.mozu.api.security.AuthTicket;

/** <summary>
 * Use the Channel Groups resource to manage groups of channels with common information.
 * </summary>
 */
public class ChannelGroupClient {
	
	/**
	 * Retrieves a list of defined channel groups according to any filter and sort criteria specified in the request.
	 * <p><pre><code>
	 * MozuClient<com.mozu.api.contracts.commerceruntime.channels.ChannelGroupCollection> mozuClient=GetChannelGroupsClient();
	 * client.setBaseAddress(url);
	 * client.executeRequest();
	 * ChannelGroupCollection channelGroupCollection = client.Result();
	 * </code></pre></p>
	 * @param authTicket User Auth Ticket
	 * @return Mozu.Api.MozuClient <com.mozu.api.contracts.commerceruntime.channels.ChannelGroupCollection>
	 * @see com.mozu.api.contracts.commerceruntime.channels.ChannelGroupCollection
	 */
	public static MozuClient<com.mozu.api.contracts.commerceruntime.channels.ChannelGroupCollection> getChannelGroupsClient() throws Exception
	{
		return getChannelGroupsClient( null,  null,  null,  null, null);
	}

	/**
	 * Retrieves a list of defined channel groups according to any filter and sort criteria specified in the request.
	 * <p><pre><code>
	 * MozuClient<com.mozu.api.contracts.commerceruntime.channels.ChannelGroupCollection> mozuClient=GetChannelGroupsClient( startIndex,  pageSize,  sortBy,  filter, authTicket);
	 * client.setBaseAddress(url);
	 * client.executeRequest();
	 * ChannelGroupCollection channelGroupCollection = client.Result();
	 * </code></pre></p>
	 * @param filter FilterSetAll
	 * @param pageSize The number of results to display on each page when creating paged results from a query. The maximum value is 200.
	 * @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 authTicket User Auth Ticket
	 * @return Mozu.Api.MozuClient <com.mozu.api.contracts.commerceruntime.channels.ChannelGroupCollection>
	 * @see com.mozu.api.contracts.commerceruntime.channels.ChannelGroupCollection
	 */
	public static MozuClient<com.mozu.api.contracts.commerceruntime.channels.ChannelGroupCollection> getChannelGroupsClient(Integer startIndex, Integer pageSize, String sortBy, String filter, AuthTicket authTicket) throws Exception
	{
		MozuUrl url = com.mozu.api.urls.commerce.ChannelGroupUrl.getChannelGroupsUrl(filter, pageSize, sortBy, startIndex);
		String verb = "GET";
		Class<?> clz = com.mozu.api.contracts.commerceruntime.channels.ChannelGroupCollection.class;
		MozuClient<com.mozu.api.contracts.commerceruntime.channels.ChannelGroupCollection> mozuClient = new MozuClient(clz);
		mozuClient.setVerb(verb);
		mozuClient.setResourceUrl(url);
		if (authTicket != null)
			mozuClient.setUserAuth(authTicket);
		return mozuClient;

	}

	/**
	 * Retrieves the details of a defined channel group.
	 * <p><pre><code>
	 * MozuClient<com.mozu.api.contracts.commerceruntime.channels.ChannelGroup> mozuClient=GetChannelGroupClient( code, authTicket);
	 * client.setBaseAddress(url);
	 * client.executeRequest();
	 * ChannelGroup channelGroup = client.Result();
	 * </code></pre></p>
	 * @param code The code that uniquely identifies the channel group.
	 * @param authTicket User Auth Ticket
	 * @return Mozu.Api.MozuClient <com.mozu.api.contracts.commerceruntime.channels.ChannelGroup>
	 * @see com.mozu.api.contracts.commerceruntime.channels.ChannelGroup
	 */
	public static MozuClient<com.mozu.api.contracts.commerceruntime.channels.ChannelGroup> getChannelGroupClient(String code, AuthTicket authTicket) throws Exception
	{
		MozuUrl url = com.mozu.api.urls.commerce.ChannelGroupUrl.getChannelGroupUrl(code);
		String verb = "GET";
		Class<?> clz = com.mozu.api.contracts.commerceruntime.channels.ChannelGroup.class;
		MozuClient<com.mozu.api.contracts.commerceruntime.channels.ChannelGroup> mozuClient = new MozuClient(clz);
		mozuClient.setVerb(verb);
		mozuClient.setResourceUrl(url);
		if (authTicket != null)
			mozuClient.setUserAuth(authTicket);
		return mozuClient;

	}

	/**
	 * Creates a new group of channels with common information.
	 * <p><pre><code>
	 * MozuClient<com.mozu.api.contracts.commerceruntime.channels.ChannelGroup> mozuClient=CreateChannelGroupClient( channelGroup, authTicket);
	 * client.setBaseAddress(url);
	 * client.executeRequest();
	 * ChannelGroup channelGroup = client.Result();
	 * </code></pre></p>
	 * @param authTicket User Auth Ticket
	 * @param channelGroup Properties of the channel group to create.
	 * @return Mozu.Api.MozuClient <com.mozu.api.contracts.commerceruntime.channels.ChannelGroup>
	 * @see com.mozu.api.contracts.commerceruntime.channels.ChannelGroup
	 * @see com.mozu.api.contracts.commerceruntime.channels.ChannelGroup
	 */
	public static MozuClient<com.mozu.api.contracts.commerceruntime.channels.ChannelGroup> createChannelGroupClient(com.mozu.api.contracts.commerceruntime.channels.ChannelGroup channelGroup, AuthTicket authTicket) throws Exception
	{
		MozuUrl url = com.mozu.api.urls.commerce.ChannelGroupUrl.createChannelGroupUrl();
		String verb = "POST";
		Class<?> clz = com.mozu.api.contracts.commerceruntime.channels.ChannelGroup.class;
		MozuClient<com.mozu.api.contracts.commerceruntime.channels.ChannelGroup> mozuClient = new MozuClient(clz);
		mozuClient.setVerb(verb);
		mozuClient.setResourceUrl(url);
		mozuClient.setBody(channelGroup);
		if (authTicket != null)
			mozuClient.setUserAuth(authTicket);
		return mozuClient;

	}

	/**
	 * Updates one or more properties of a defined channel group.
	 * <p><pre><code>
	 * MozuClient<com.mozu.api.contracts.commerceruntime.channels.ChannelGroup> mozuClient=UpdateChannelGroupClient( channelGroup,  code, authTicket);
	 * client.setBaseAddress(url);
	 * client.executeRequest();
	 * ChannelGroup channelGroup = client.Result();
	 * </code></pre></p>
	 * @param code Code that identifies the channel group.
	 * @param authTicket User Auth Ticket
	 * @param channelGroup Properties of the channel group to update.
	 * @return Mozu.Api.MozuClient <com.mozu.api.contracts.commerceruntime.channels.ChannelGroup>
	 * @see com.mozu.api.contracts.commerceruntime.channels.ChannelGroup
	 * @see com.mozu.api.contracts.commerceruntime.channels.ChannelGroup
	 */
	public static MozuClient<com.mozu.api.contracts.commerceruntime.channels.ChannelGroup> updateChannelGroupClient(com.mozu.api.contracts.commerceruntime.channels.ChannelGroup channelGroup, String code, AuthTicket authTicket) throws Exception
	{
		MozuUrl url = com.mozu.api.urls.commerce.ChannelGroupUrl.updateChannelGroupUrl(code);
		String verb = "PUT";
		Class<?> clz = com.mozu.api.contracts.commerceruntime.channels.ChannelGroup.class;
		MozuClient<com.mozu.api.contracts.commerceruntime.channels.ChannelGroup> mozuClient = new MozuClient(clz);
		mozuClient.setVerb(verb);
		mozuClient.setResourceUrl(url);
		mozuClient.setBody(channelGroup);
		if (authTicket != null)
			mozuClient.setUserAuth(authTicket);
		return mozuClient;

	}

	/**
	 * Deletes a defined group of channels, which removes the group association with each channel in the group but does not delete the channel definitions themselves.
	 * <p><pre><code>
	 * MozuClient mozuClient=DeleteChannelGroupClient( code, authTicket);
	 * client.setBaseAddress(url);
	 * client.executeRequest();
	 * </code></pre></p>
	 * @param code User-defined code that uniqely identifies the channel group.
	 * @param authTicket User Auth Ticket
	 * @return Mozu.Api.MozuClient 
	 */
	public static MozuClient deleteChannelGroupClient(String code, AuthTicket authTicket) throws Exception
	{
		MozuUrl url = com.mozu.api.urls.commerce.ChannelGroupUrl.deleteChannelGroupUrl(code);
		String verb = "DELETE";
				MozuClient mozuClient = new MozuClient();
		mozuClient.setVerb(verb);
		mozuClient.setResourceUrl(url);
		if (authTicket != null)
			mozuClient.setUserAuth(authTicket);
		return mozuClient;

	}

}



