
"""
    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 ShippingInclusionRule(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 getShippingInclusionRule(self,profilecode, id, responseFields = None):
		""" Retrieves the details of the specified shipping inclusion rule.
		
		Args:
			| profilecode (string) - The unique, user-defined code of the profile with which the shipping inclusion rule is associated.
			| id (string) - Unique identifier of the customer segment to retrieve.
			| 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:
			| ShippingInclusionRule 
		
		Raises:
			| ApiException
		
		"""

		url = MozuUrl("/api/commerce/shipping/admin/profiles/{profilecode}/rules/shippinginclusions/{id}?responseFields={responseFields}", "GET", UrlLocation.TenantPod, False);
		url.formatUrl("id", id);
		url.formatUrl("profilecode", profilecode);
		url.formatUrl("responseFields", responseFields);
		self.client.withResourceUrl(url).execute();
		return self.client.result();

	
		
	def getShippingInclusionRules(self,profilecode, responseFields = None):
		""" Retrieves a list of shipping inclusion rules and their details.
		
		Args:
			| profilecode (string) - The unique, user-defined code of the profile with which the shipping inclusion rule is associated.
			| 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:
			| ShippingInclusionRuleCollection 
		
		Raises:
			| ApiException
		
		"""

		url = MozuUrl("/api/commerce/shipping/admin/profiles/{profilecode}/rules/shippinginclusions?responseFields={responseFields}", "GET", UrlLocation.TenantPod, False);
		url.formatUrl("profilecode", profilecode);
		url.formatUrl("responseFields", responseFields);
		self.client.withResourceUrl(url).execute();
		return self.client.result();

	
		
	def createShippingInclusionRule(self,rule, profilecode, responseFields = None):
		""" Creates a new shipping inclusion rule.
		
		Args:
			| rule(rule) - The details of the new shipping inclusion rule.
			| profilecode (string) - The unique, user-defined code of the profile with which the shipping inclusion rule is associated.
			| 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:
			| ShippingInclusionRule 
		
		Raises:
			| ApiException
		
		"""

		url = MozuUrl("/api/commerce/shipping/admin/profiles/{profilecode}/rules/shippinginclusions?responseFields={responseFields}", "POST", UrlLocation.TenantPod, False);
		url.formatUrl("profilecode", profilecode);
		url.formatUrl("responseFields", responseFields);
		self.client.withResourceUrl(url).withBody(rule).execute();
		return self.client.result();

	
		
	def updateShippingInclusionRule(self,rule, profilecode, id, responseFields = None):
		""" Updates the details of the specified shipping inclusion rule.
		
		Args:
			| rule(rule) - The updated details of the shipping inclusion rule.
			| profilecode (string) - The unique, user-defined code of the profile with which the shipping inclusion rule is associated.
			| id (string) - Unique identifier of the customer segment to retrieve.
			| 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:
			| ShippingInclusionRule 
		
		Raises:
			| ApiException
		
		"""

		url = MozuUrl("/api/commerce/shipping/admin/profiles/{profilecode}/rules/shippinginclusions/{id}?responseFields={responseFields}", "PUT", UrlLocation.TenantPod, False);
		url.formatUrl("id", id);
		url.formatUrl("profilecode", profilecode);
		url.formatUrl("responseFields", responseFields);
		self.client.withResourceUrl(url).withBody(rule).execute();
		return self.client.result();

	
		
	def deleteShippingInclusionRule(self,profilecode, id):
		""" Deletes the specified shipping inclusion rule.
		
		Args:
			| profilecode (string) - The unique, user-defined code of the profile with which the shipping inclusion rule is associated.
			| id (string) - Unique identifier of the customer segment to retrieve.
		
		Raises:
			| ApiException
		
		"""

		url = MozuUrl("/api/commerce/shipping/admin/profiles/{profilecode}/rules/shippinginclusions/{id}", "DELETE", UrlLocation.TenantPod, False);
		url.formatUrl("id", id);
		url.formatUrl("profilecode", profilecode);
		self.client.withResourceUrl(url).execute();

	
	
	