class CodedError(Exception):
    def __init__(
        self,
        code,           # type: int
        message,        # type: str
    ):
        # type: (...) -> None

        self.code = code
        self.message = message


class UpdateItemsError(object):
    INVALID_JSON = CodedError(
        code=-1,
        message="data must be a valid json",
    )

    NO_USER_ID = CodedError(
        code=-2,
        message="input json must contain a user_id field",
    )

    NO_ENABLED = CodedError(
        code=-3,
        message="input json must contain an enabled field",
    )

    NO_DISABLED = CodedError(
        code=-4,
        message="input json must contain a disabled field",
    )

    ENABLED_NOT_A_LIST = CodedError(
        code=-5,
        message="enabled field must be a list of integer part codes",
    )

    DISABLED_NOT_A_LIST = CodedError(
        code=-6,
        message="disabled field must be a list of integer part codes",
    )

    ENABLED_NOT_A_LIST_OF_INT = CodedError(
        code=-7,
        message="enabled field must be a list of integer part codes",
    )

    DISABLED_NOT_A_LIST_OF_INT = CodedError(
        code=-8,
        message="enabled field must be a list of integer part codes",
    )

    INVALID_PART_CODE = CodedError(
        code=-9,
        message="",
    )
