#Generated by quicktype.io

# To use this code, make sure you
#
#     import json
#
# and then, to convert JSON from a string, do
#
#     result = GetDatafromdict(json.loads(json_string))

from typing import List, Any, TypeVar, Callable, Type, cast


T = TypeVar("T")


def from_str(x: Any) -> str:
    assert isinstance(x, str)
    return x


def from_list(f: Callable[[Any], T], x: Any) -> List[T]:
    assert isinstance(x, list)
    return [f(y) for y in x]


def to_class(c: Type[T], x: Any) -> dict:
    assert isinstance(x, c)
    return cast(Any, x).to_dict()


class GetData:
    cmd: str
    get: List[List[str]]

    def __init__(self, cmd: str, get: List[List[str]]) -> None:
        self.cmd = cmd
        self.get = get

    @staticmethod
    def from_dict(obj: Any) -> 'GetData':
        assert isinstance(obj, dict)
        cmd = from_str(obj.get("cmd"))
        get = from_list(lambda x: from_list(from_str, x), obj.get("get"))
        return GetData(cmd, get)

    def to_dict(self) -> dict:
        result: dict = {'cmd': from_str(self.cmd)}
        result["get"] = from_list(lambda x: from_list(from_str, x), self.get)
        return result


def GetDatafromdict(s: Any) -> GetData:
    return GetData.from_dict(s)


def GetDatatodict(x: GetData) -> Any:
    return to_class(GetData, x)
