
"""
    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 ShippingStates(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 getStates(self,profileCode):
		""" Retrieves a list of shipping states and their details.
		
		Args:
			| profileCode (string) - The unique, user-defined code of the profile with which the shipping state is associated.
		
		Returns:
			| array of ShippingStates 
		
		Raises:
			| ApiException
		
		"""

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

	
		
	def updateStates(self,states, profilecode):
		""" Updates the details of the shipping states.
		
		Args:
			| states(array|states) - The updated details of the shipping states associated with the specified profilecode.
			| profilecode (string) - The unique, user-defined code of the profile with which the shipping state is associated.
		
		Returns:
			| array of ShippingStates 
		
		Raises:
			| ApiException
		
		"""

		url = MozuUrl("/api/commerce/shipping/admin/profiles/{profilecode}/shippingstates", "PUT", UrlLocation.TenantPod, False);
		url.formatUrl("profilecode", profilecode);
		self.client.withResourceUrl(url).withBody(states).execute();
		return self.client.result();

	
	
	