
"""
    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 Shipping(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 getRates(self,rateRequest, includeRawResponse = False, responseFields = None):
		
""" Retrieves the shipping rates applicable for the site.
		
		Args:
			| rateRequest(rateRequest) - Properties required to request a shipping rate calculation.
			| includeRawResponse (bool) - Set this parameter to  to retrieve the full raw JSON response from a shipping carrier (instead of just the shipping rate).
			| responseFields (string) - Use this field to include those fields which are not included by default.
		
		Returns:
			| RatesResponse 
		
		Raises:
			| ApiException
		
		"""

		url = MozuUrl("/api/commerce/catalog/storefront/shipping/request-rates?responseFields={responseFields}", "POST", UrlLocation.TenantPod, False);
		url.formatUrl("includeRawResponse", includeRawResponse);
		url.formatUrl("responseFields", responseFields);
		self.client.withResourceUrl(url).withBody(rateRequest).execute();
		return self.client.result();