
"""
    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 PaymentSettings(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 getThirdPartyPaymentWorkflowWithValues(self,fullyQualifiedName, responseFields = None):
		""" Retrieves the schema and definition along with the actual instance values of the third-party payment service workflow configured for the corresponding fully qualified name.
		
		Args:
			| fullyQualifiedName (string) - Fully qualified name of the attribute for the third-party payment workflow.
			| 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:
			| ExternalPaymentWorkflowDefinition 
		
		Raises:
			| ApiException
		
		"""

		url = MozuUrl("/api/commerce/settings/checkout/paymentsettings/thirdpartyworkflow/{fullyQualifiedName}?responseFields={responseFields}", "GET", UrlLocation.TenantPod, False);
		url.formatUrl("fullyQualifiedName", fullyQualifiedName);
		url.formatUrl("responseFields", responseFields);
		self.client.withResourceUrl(url).execute();
		return self.client.result();

	
		
	def getThirdPartyPaymentWorkflows(self,):
		""" Retrieves the schema and definition of all third-party payment service workflows configured for the site.
		
		Returns:
			| array of ExternalPaymentWorkflowDefinition 
		
		Raises:
			| ApiException
		
		"""

		url = MozuUrl("/api/commerce/settings/checkout/paymentsettings/thirdpartyworkflows", "GET", UrlLocation.TenantPod, False);
		self.client.withResourceUrl(url).execute();
		return self.client.result();

	
		
	def addThirdPartyPaymentWorkflow(self,definition):
		""" Adds a third-party payment workflow to the site. A third-party payment workflow is a definition of a process by which a third-party payment provider (such as Amazon Payments or PayPal Express) interacts with the  platform.
		
		Args:
			| definition(definition) - Properties of an external payment processing workflow defined for the site. At this time, only PayPal Express is supported.
		
		Raises:
			| ApiException
		
		"""

		url = MozuUrl("/api/commerce/settings/checkout/paymentsettings/thirdpartyworkflows", "PUT", UrlLocation.TenantPod, False);
		self.client.withResourceUrl(url).withBody(definition).execute();

	
		
	def deleteThirdPartyPaymentWorkflow(self,fullyQualifiedName):
		""" Deletes a third-party payment workflow. A third-party payment workflow is a definition of a process by which a third-party payment provider (such as Amazon Payments or PayPal Express) interacts with the  platform. 
		
		Args:
			| fullyQualifiedName (string) - Fully qualified name of the attribute for the third-party payment workflow.
		
		Raises:
			| ApiException
		
		"""

		url = MozuUrl("/api/commerce/settings/checkout/paymentsettings/thirdpartyworkflows/{fullyQualifiedName}", "DELETE", UrlLocation.TenantPod, False);
		url.formatUrl("fullyQualifiedName", fullyQualifiedName);
		self.client.withResourceUrl(url).execute();

	
	
	