# DO NOT EDIT! This file is automatically generated
import typing

from commercetools._schemas._customer import CustomerSignInResultSchema
from commercetools.helpers import RemoveEmptyValuesMixin
from commercetools.types._customer import CustomerSignInResult
from commercetools.typing import OptionalListStr

from . import abstract, traits


class LoginService(abstract.AbstractService):
    """Retrieves the authenticated customer."""

    def create(self) -> CustomerSignInResult:
        """Authenticate Customer (Sign In).

        Retrieves the authenticated customer (a customer that matches the given
        email/password pair). If used with an access token for Anonymous
        Sessions, all orders and carts belonging to the anonymousId will be
        assigned to the newly created customer. If a cart is is returned as part
        of the CustomerSignInResult, it has been recalculated (It will have up-
        to-date prices, taxes and discounts, and invalid line items have been
        removed.).   Retrieves the authenticated customer.
        """
        params: typing.Dict[str, str] = {}
        return self._client._post(
            endpoint="login",
            params=params,
            data_object=None,
            request_schema_cls=None,
            response_schema_cls=CustomerSignInResultSchema,
        )
