from httpmessageprocessorutil.automapped import auto_map
from typing import List


class ToAddItem(object):
    def __init__(
        self,
        context,        # type: str
        line_number,    # type: int
        product_code,   # type: int
        quantity        # type: int
    ):
        # type: (...) -> None

        self.context = context
        self.line_number = line_number
        self.product_code = int(product_code)
        self.quantity = int(quantity)


@auto_map({"system_api_key": {"name": "X-Api-Key", "location": "header", "type": str},
           "pos_id": {"name": "posId", "type": str},
           "to_add_items": {"name": "toAddItems", "type": List[ToAddItem]}})
class AddItemsRequest(object):
    def __init__(self, system_api_key, pos_id, to_add_items):
        # type: (str, str, List[ToAddItem]) -> None

        self.system_api_key = system_api_key
        self.pos_id = pos_id
        self.items = to_add_items
