
"""
    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 PriceListEntry(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 getPriceListEntry(self,priceListCode, productCode, currencyCode, startDate = None, responseFields = None):
		""" Retrieves the details of a price list entry.
		
		Args:
			| priceListCode (string) - The unique code of the price list associated with the price list entry.
			| productCode (string) - The unique, user-defined product code of a product, used throughout  to reference and associate to a product.
			| currencyCode (string) - The three character ISO currency code, such as USD for US Dollars.
			| startDate (DateTime) - The start date of the price list entry.
			| 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:
			| PriceListEntry 
		
		Raises:
			| ApiException
		
		"""

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

	
		
	def getPriceListEntries(self,priceListCode, startIndex = None, pageSize = None, sortBy = None, filter = None, responseFields = None):
		""" Retrieves a list of price list entries associated with the specified price list according to any specified facets, filter criteria, and sort options.
		
		Args:
			| priceListCode (string) - The unique code of the price list associated with the price list entry.
			| 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:
			| PriceListEntryCollection 
		
		Raises:
			| ApiException
		
		"""

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

	
		
	def addPriceListEntry(self,priceListEntryIn, priceListCode, responseFields = None):
		""" Adds a new price list entry to the specified price list.
		
		Args:
			| priceListEntryIn(priceListEntryIn) - The details of the new price list entry.
			| priceListCode (string) - The specified price list to which you want to add the price list entry.
			| 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:
			| PriceListEntry 
		
		Raises:
			| ApiException
		
		"""

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

	
		
	def updatePriceListEntry(self,priceListEntryIn, priceListCode, productCode, currencyCode, startDate = None, responseFields = None):
		""" Updates the details of a price list entry.
		
		Args:
			| priceListEntryIn(priceListEntryIn) - The updated details of the price list entry.
			| priceListCode (string) - The unique code of the price list associated with the price list entry.
			| productCode (string) - The unique, user-defined product code of a product, used throughout  to reference and associate to a product.
			| currencyCode (string) - The three character ISO currency code, such as USD for US Dollars.
			| startDate (DateTime) - The start date of the price list entry.
			| 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:
			| PriceListEntry 
		
		Raises:
			| ApiException
		
		"""

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

	
		
	def deletePriceListEntry(self,priceListCode, productCode, currencyCode, startDate = None):
		""" Deletes a price list entry.
		
		Args:
			| priceListCode (string) - The code of the specified price list associated with the price list entry.
			| productCode (string) - The unique, user-defined product code of a product, used throughout  to reference and associate to a product.
			| currencyCode (string) - The three character ISO currency code, such as USD for US Dollars.
			| startDate (DateTime) - The start date of the price list entry.
		
		Raises:
			| ApiException
		
		"""

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

	
	
	