from typing import Optional

from httpmessageprocessorutil.automapped import auto_map


@auto_map({"system_api_key": {"name": "X-Api-Key", "location": "header", "type": str},
           "pos_id": {"name": "posId", "type": str},
           "print_coupon": {"name": "printCoupon", "type": Optional[str]}},
          )
class OrderSaveRequest(object):
    def __init__(
        self,
        system_api_key,           # type: str
        pos_id,                   # type: str
        print_coupon='True',      # type: Optional[str]
    ):
        # type: (...) -> None

        self.system_api_key = system_api_key
        self.pos_id = pos_id
        self.print_coupon = True if print_coupon is None else print_coupon.lower() == 'true'
