from httpmessageprocessorutil.automapped import auto_map
from typing import List


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

        self.context = str(context)
        self.product_code = int(product_code)
        self.new_quantity = int(new_quantity)
        self.line_number = int(line_number)


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

        self.system_api_key = system_api_key
        self.pos_id = pos_id
        self.items = to_change_items
