# Code generated by Lark OpenAPI.

from typing import Any, Optional, Union, Dict, List, Set, IO, Callable, Type
from lark_oapi.core.construct import init


class Sort(object):
    _types = {
        "field": str,
        "direction": str,
    }

    def __init__(self, d=None):
        self.field: Optional[str] = None
        self.direction: Optional[str] = None
        init(self, d, self._types)

    @staticmethod
    def builder() -> "SortBuilder":
        return SortBuilder()


class SortBuilder(object):
    def __init__(self) -> None:
        self._sort = Sort()

    def field(self, field: str) -> "SortBuilder":
        self._sort.field = field
        return self

    def direction(self, direction: str) -> "SortBuilder":
        self._sort.direction = direction
        return self

    def build(self) -> "Sort":
        return self._sort
