
"""
    This code was generated by Codezu.     

    Changes to this file may cause incorrect behavior and will be lost if
    the code is regenerated.
"""


from mozurestsdk.mozuclient import default as default_client
from mozurestsdk.mozuurl import MozuUrl;
from mozurestsdk.urllocation import UrlLocation
from mozurestsdk.apicontext import ApiContext;

class PriceList(object):
	def __init__(self, apiContext: ApiContext = None, mozuClient = None):
		self.client = mozuClient or default_client();
		if (apiContext is not None):
			self.client.withApiContext(apiContext);
		else:
			self.client.withApiContext(ApiContext());
	
	def getPriceLists(self,startIndex = None, pageSize = None, sortBy = None, filter = None, responseFields = None):
		""" Retrieves a list of price lists according to any specified facets, filter criteria, and sort options.
		
		Args:
			| startIndex (int) - 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 pageSize set to 25, to get the 51st through the 75th items, set this parameter to 50.
			| pageSize (int) - 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 this parameter set to 25, to get the 51st through the 75th items, set startIndex to 50.
			| sortBy (string) - The element to sort the results by and the channel in which the results appear. Either ascending (a-z) or descending (z-a) channel. Optional. Refer to [Sorting and Filtering](../../../../Developer/api-guides/sorting-filtering.htm) for more information.
			| filter (string) - A set of filter expressions representing the search parameters for a query. This parameter is optional. Refer to [Sorting and Filtering](../../../../Developer/api-guides/sorting-filtering.htm) for a list of supported filters.
			| responseFields (string) - Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss.
		
		Returns:
			| PriceListCollection 
		
		Raises:
			| ApiException
		
		"""

		url = MozuUrl("/api/commerce/catalog/admin/pricelists/?startIndex={startIndex}&pageSize={pageSize}&sortBy={sortBy}&filter={filter}&responseFields={responseFields}", "GET", UrlLocation.TenantPod, False);
		url.formatUrl("filter", filter);
		url.formatUrl("pageSize", pageSize);
		url.formatUrl("responseFields", responseFields);
		url.formatUrl("sortBy", sortBy);
		url.formatUrl("startIndex", startIndex);
		self.client.withResourceUrl(url).execute();
		return self.client.result();

	
		
	def getPriceList(self,priceListCode, responseFields = None):
		""" Retrieves the details of the specified price list.
		
		Args:
			| priceListCode (string) - The unique, user-defined code of the price list.
			| responseFields (string) - Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss.
		
		Returns:
			| PriceList 
		
		Raises:
			| ApiException
		
		"""

		url = MozuUrl("/api/commerce/catalog/admin/pricelists/{priceListCode}?responseFields={responseFields}", "GET", UrlLocation.TenantPod, False);
		url.formatUrl("priceListCode", priceListCode);
		url.formatUrl("responseFields", responseFields);
		self.client.withResourceUrl(url).execute();
		return self.client.result();

	
		
	def addPriceList(self,priceList, responseFields = None):
		""" Adds a new price list to the tenant.
		
		Args:
			| priceList(priceList) - The details of the new price list.
			| responseFields (string) - Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss.
		
		Returns:
			| PriceList 
		
		Raises:
			| ApiException
		
		"""

		url = MozuUrl("/api/commerce/catalog/admin/pricelists/?responseFields={responseFields}", "POST", UrlLocation.TenantPod, False);
		url.formatUrl("responseFields", responseFields);
		self.client.withResourceUrl(url).withBody(priceList).execute();
		return self.client.result();

	
		
	def bulkAddPriceListEntries(self,priceListEntriesIn, publishEvents = False, invalidateCache = False):
		""" admin-pricelists Post BulkAddPriceListEntries description DOCUMENT_HERE 
		
		Args:
			| priceListEntriesIn(array|priceListEntriesIn) - 
			| publishEvents (bool) - 
			| invalidateCache (bool) - 
		
		Raises:
			| ApiException
		
		"""

		url = MozuUrl("/api/commerce/catalog/admin/pricelists/bulkaddentries?publishEvents={publishEvents}&invalidateCache={invalidateCache}", "POST", UrlLocation.TenantPod, False);
		url.formatUrl("invalidateCache", invalidateCache);
		url.formatUrl("publishEvents", publishEvents);
		self.client.withResourceUrl(url).withBody(priceListEntriesIn).execute();

	
		
	def bulkDeletePriceListEntries(self,priceListEntriesIn, publishEvents = False, invalidateCache = False):
		""" admin-pricelists Post BulkDeletePriceListEntries description DOCUMENT_HERE 
		
		Args:
			| priceListEntriesIn(array|priceListEntriesIn) - 
			| publishEvents (bool) - 
			| invalidateCache (bool) - 
		
		Raises:
			| ApiException
		
		"""

		url = MozuUrl("/api/commerce/catalog/admin/pricelists/bulkdeleteentries?publishEvents={publishEvents}&invalidateCache={invalidateCache}", "POST", UrlLocation.TenantPod, False);
		url.formatUrl("invalidateCache", invalidateCache);
		url.formatUrl("publishEvents", publishEvents);
		self.client.withResourceUrl(url).withBody(priceListEntriesIn).execute();

	
		
	def bulkUpdatePriceListEntries(self,priceListEntriesIn, publishEvents = False, invalidateCache = False):
		""" admin-pricelists Post BulkUpdatePriceListEntries description DOCUMENT_HERE 
		
		Args:
			| priceListEntriesIn(array|priceListEntriesIn) - 
			| publishEvents (bool) - 
			| invalidateCache (bool) - 
		
		Raises:
			| ApiException
		
		"""

		url = MozuUrl("/api/commerce/catalog/admin/pricelists/bulkupdateentries?publishEvents={publishEvents}&invalidateCache={invalidateCache}", "POST", UrlLocation.TenantPod, False);
		url.formatUrl("invalidateCache", invalidateCache);
		url.formatUrl("publishEvents", publishEvents);
		self.client.withResourceUrl(url).withBody(priceListEntriesIn).execute();

	
		
	def updatePriceList(self,priceList, priceListCode, responseFields = None):
		""" Updates the details of the specified price list.
		
		Args:
			| priceList(priceList) - The details of the updated price list.
			| priceListCode (string) - The unique, user-defined code of the price list.
			| responseFields (string) - Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss.
		
		Returns:
			| PriceList 
		
		Raises:
			| ApiException
		
		"""

		url = MozuUrl("/api/commerce/catalog/admin/pricelists/{priceListCode}?responseFields={responseFields}", "PUT", UrlLocation.TenantPod, False);
		url.formatUrl("priceListCode", priceListCode);
		url.formatUrl("responseFields", responseFields);
		self.client.withResourceUrl(url).withBody(priceList).execute();
		return self.client.result();

	
		
	def deletePriceList(self,priceListCode, cascadeDeleteEntries = False):
		""" Deletes the specified price list from the tenant.
		
		Args:
			| priceListCode (string) - The unique, user-defined code of the price list.
			| cascadeDeleteEntries (bool) - Specifies whether to deletes all price list entries associated with the price list.
		
		Raises:
			| ApiException
		
		"""

		url = MozuUrl("/api/commerce/catalog/admin/pricelists/{priceListCode}?cascadeDeleteEntries={cascadeDeleteEntries}", "DELETE", UrlLocation.TenantPod, False);
		url.formatUrl("cascadeDeleteEntries", cascadeDeleteEntries);
		url.formatUrl("priceListCode", priceListCode);
		self.client.withResourceUrl(url).execute();

	
	
	