from ..base import AdyenServiceBase


class UtilityApi(AdyenServiceBase):
    """NOTE: This class is auto generated by OpenAPI Generator
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """

    def __init__(self, client=None):
        super().__init__(client=client)
        self.service = "checkout"
        self.baseUrl = "https://checkout-test.adyen.com/v71"

    def get_apple_pay_session(self, request, idempotency_key=None, **kwargs):
        """
        Get an Apple Pay session
        """
        endpoint = self.baseUrl + "/applePay/sessions"
        method = "POST"
        return self.client.call_adyen_api(
            request, self.service, method, endpoint, idempotency_key, **kwargs
        )

    def origin_keys(self, request, idempotency_key=None, **kwargs):
        """
        Create originKey values for domains

        Deprecated since Adyen Checkout API v67
        """
        endpoint = self.baseUrl + "/originKeys"
        method = "POST"
        return self.client.call_adyen_api(
            request, self.service, method, endpoint, idempotency_key, **kwargs
        )

    def updates_order_for_paypal_express_checkout(self, request, idempotency_key=None, **kwargs):
        """
        Updates the order for PayPal Express Checkout
        """
        endpoint = self.baseUrl + "/paypal/updateOrder"
        method = "POST"
        return self.client.call_adyen_api(
            request, self.service, method, endpoint, idempotency_key, **kwargs
        )

    def validate_shopper_id(self, request, idempotency_key=None, **kwargs):
        """
        Validates shopper Id
        """
        endpoint = self.baseUrl + "/validateShopperId"
        method = "POST"
        return self.client.call_adyen_api(
            request, self.service, method, endpoint, idempotency_key, **kwargs
        )
