# Code generated by Lark OpenAPI.

from typing import Optional

from lark_oapi.core.construct import init
from .protected_range_editors import ProtectedRangeEditors


class PatchProtectedRangeEditors(object):
    _types = {
        "type": str,
        "add_editors": ProtectedRangeEditors,
        "remove_editors": ProtectedRangeEditors,
    }

    def __init__(self, d=None):
        self.type: Optional[str] = None
        self.add_editors: Optional[ProtectedRangeEditors] = None
        self.remove_editors: Optional[ProtectedRangeEditors] = None
        init(self, d, self._types)

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


class PatchProtectedRangeEditorsBuilder(object):
    def __init__(self) -> None:
        self._patch_protected_range_editors = PatchProtectedRangeEditors()

    def type(self, type: str) -> "PatchProtectedRangeEditorsBuilder":
        self._patch_protected_range_editors.type = type
        return self

    def add_editors(self, add_editors: ProtectedRangeEditors) -> "PatchProtectedRangeEditorsBuilder":
        self._patch_protected_range_editors.add_editors = add_editors
        return self

    def remove_editors(self, remove_editors: ProtectedRangeEditors) -> "PatchProtectedRangeEditorsBuilder":
        self._patch_protected_range_editors.remove_editors = remove_editors
        return self

    def build(self) -> "PatchProtectedRangeEditors":
        return self._patch_protected_range_editors
