from pathlib import Path
from typing import Sequence

from clarabot_nano.server.fstx.filesystem.operation.base import AbstractIOQueueOperation


class MkdirOperation(AbstractIOQueueOperation):
    OPERATION_KEY = "MKD"

    def __init__(self, account_id: int, path: str):
        AbstractIOQueueOperation.__init__(self, account_id)
        self.path = path

    def paths(self) -> Sequence[str]:
        return (self.path,)

    def execute(self):
        Path(self.path).mkdir()
