| # WARNING: This file is machine generated by fidlgen. |
| |
| from __future__ import annotations |
| |
| from dataclasses import dataclass |
| from fidl_codec import add_ir_path, encode_fidl_object |
| import sys |
| import typing |
| import enum |
| |
| import fidl |
| from fidl._ir import get_fidl_ir_map |
| |
| _ir_path = get_fidl_ir_map()["test.service"] |
| add_ir_path(_ir_path) |
| |
| from fidl._client import EventHandlerBase, FidlClient # type: ignore[unused-ignore,unused-import] |
| import fidl._construct # type: ignore[unused-ignore,unused-import] |
| from fidl._server import ServerBase # type: ignore[unused-ignore,unused-import] |
| from fidl._fidl_common import DomainError, FrameworkError, MethodInfo, FidlProtocolMarker, normalize_identifier # type: ignore[unused-ignore,unused-import] |
| |
| from abc import abstractmethod, ABC # type: ignore[unused-ignore,unused-import] |
| import collections.abc # type: ignore[unused-ignore,unused-import] |
| |
| |
| class FirstProtocolServer(ServerBase, ABC): |
| __fidl_kind__ = "server" |
| library = "test.service" |
| method_map: typing.Dict[int, MethodInfo] = { |
| 6352548393671797041: MethodInfo( |
| name="method_on_first", |
| request_ident="", |
| requires_response=False, |
| empty_response=False, |
| has_result=False, |
| response_identifier="", |
| ), |
| } |
| |
| @staticmethod |
| def construct_response_object( |
| response_ident: str, response_obj: typing.Any |
| ) -> typing.Any: |
| return fidl._construct.construct_response_object( |
| response_ident, response_obj |
| ) |
| |
| MethodOnFirstResponse: typing.TypeAlias = None |
| |
| @abstractmethod |
| def method_on_first( |
| self, |
| ) -> ( |
| collections.abc.Coroutine[typing.Any, typing.Any, MethodOnFirstResponse] |
| | MethodOnFirstResponse |
| ): |
| ... |
| |
| |
| class FirstProtocolClient(FidlClient): |
| __fidl_kind__ = "client" |
| library = "test.service" |
| |
| @staticmethod |
| def construct_response_object( |
| response_ident: str, response_obj: typing.Any |
| ) -> typing.Any: |
| return fidl._construct.construct_response_object( |
| response_ident, response_obj |
| ) |
| |
| def method_on_first( |
| self, |
| ) -> None: |
| msg = None |
| |
| self._send_one_way_fidl_request( |
| 0, |
| 6352548393671797041, |
| "test.service", |
| msg, |
| ) |
| |
| |
| class FirstProtocolEventHandler(EventHandlerBase, ABC): |
| __fidl_kind__ = "event_handler" |
| library = "test.service" |
| method_map: typing.Dict[int, MethodInfo] = {} |
| |
| @staticmethod |
| def construct_response_object( |
| response_ident: str, response_obj: typing.Any |
| ) -> typing.Any: |
| return fidl._construct.construct_response_object( |
| response_ident, response_obj |
| ) |
| |
| |
| FirstProtocolMarker = FidlProtocolMarker( |
| "(nondiscoverable) test.service/FirstProtocol" |
| ) |
| |
| |
| class SecondProtocolServer(ServerBase, ABC): |
| __fidl_kind__ = "server" |
| library = "test.service" |
| method_map: typing.Dict[int, MethodInfo] = { |
| 8121179205110225988: MethodInfo( |
| name="method_on_second", |
| request_ident="", |
| requires_response=False, |
| empty_response=False, |
| has_result=False, |
| response_identifier="", |
| ), |
| } |
| |
| @staticmethod |
| def construct_response_object( |
| response_ident: str, response_obj: typing.Any |
| ) -> typing.Any: |
| return fidl._construct.construct_response_object( |
| response_ident, response_obj |
| ) |
| |
| MethodOnSecondResponse: typing.TypeAlias = None |
| |
| @abstractmethod |
| def method_on_second( |
| self, |
| ) -> ( |
| collections.abc.Coroutine[ |
| typing.Any, typing.Any, MethodOnSecondResponse |
| ] |
| | MethodOnSecondResponse |
| ): |
| ... |
| |
| |
| class SecondProtocolClient(FidlClient): |
| __fidl_kind__ = "client" |
| library = "test.service" |
| |
| @staticmethod |
| def construct_response_object( |
| response_ident: str, response_obj: typing.Any |
| ) -> typing.Any: |
| return fidl._construct.construct_response_object( |
| response_ident, response_obj |
| ) |
| |
| def method_on_second( |
| self, |
| ) -> None: |
| msg = None |
| |
| self._send_one_way_fidl_request( |
| 0, |
| 8121179205110225988, |
| "test.service", |
| msg, |
| ) |
| |
| |
| class SecondProtocolEventHandler(EventHandlerBase, ABC): |
| __fidl_kind__ = "event_handler" |
| library = "test.service" |
| method_map: typing.Dict[int, MethodInfo] = {} |
| |
| @staticmethod |
| def construct_response_object( |
| response_ident: str, response_obj: typing.Any |
| ) -> typing.Any: |
| return fidl._construct.construct_response_object( |
| response_ident, response_obj |
| ) |
| |
| |
| SecondProtocolMarker = FidlProtocolMarker( |
| "(nondiscoverable) test.service/SecondProtocol" |
| ) |