# -*- coding: utf-8 -*-
# Generated by https://github.com/connectrpc/connect-python.  DO NOT EDIT!
# source: chatto/api/v1/messages.proto

from collections.abc import AsyncGenerator, AsyncIterator, Iterable, Iterator, Mapping
from typing import Protocol

from connectrpc.client import ConnectClient, ConnectClientSync
from connectrpc.code import Code
from connectrpc.compression import Compression
from connectrpc.errors import ConnectError
from connectrpc.interceptor import Interceptor, InterceptorSync
from connectrpc.method import IdempotencyLevel, MethodInfo
from connectrpc.request import Headers, RequestContext
from connectrpc.server import ConnectASGIApplication, ConnectWSGIApplication, Endpoint, EndpointSync
import chatto.api.v1.link_previews_pb2 as chatto_dot_api_dot_v1_dot_link__previews__pb2
import chatto.api.v1.messages_pb2 as chatto_dot_api_dot_v1_dot_messages__pb2
import chatto.api.v1.reactions_pb2 as chatto_dot_api_dot_v1_dot_reactions__pb2


class MessageService(Protocol):
    async def fetch_link_preview(self, request: chatto_dot_api_dot_v1_dot_link__previews__pb2.FetchLinkPreviewRequest, ctx: RequestContext) -> chatto_dot_api_dot_v1_dot_link__previews__pb2.FetchLinkPreviewResponse:
        raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")

    async def create_message(self, request: chatto_dot_api_dot_v1_dot_messages__pb2.CreateMessageRequest, ctx: RequestContext) -> chatto_dot_api_dot_v1_dot_messages__pb2.CreateMessageResponse:
        raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")

    async def update_message(self, request: chatto_dot_api_dot_v1_dot_messages__pb2.UpdateMessageRequest, ctx: RequestContext) -> chatto_dot_api_dot_v1_dot_messages__pb2.UpdateMessageResponse:
        raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")

    async def delete_message(self, request: chatto_dot_api_dot_v1_dot_messages__pb2.DeleteMessageRequest, ctx: RequestContext) -> chatto_dot_api_dot_v1_dot_messages__pb2.DeleteMessageResponse:
        raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")

    async def delete_attachment(self, request: chatto_dot_api_dot_v1_dot_messages__pb2.DeleteAttachmentRequest, ctx: RequestContext) -> chatto_dot_api_dot_v1_dot_messages__pb2.DeleteAttachmentResponse:
        raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")

    async def delete_link_preview(self, request: chatto_dot_api_dot_v1_dot_messages__pb2.DeleteLinkPreviewRequest, ctx: RequestContext) -> chatto_dot_api_dot_v1_dot_messages__pb2.DeleteLinkPreviewResponse:
        raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")

    async def get_message(self, request: chatto_dot_api_dot_v1_dot_messages__pb2.GetMessageRequest, ctx: RequestContext) -> chatto_dot_api_dot_v1_dot_messages__pb2.GetMessageResponse:
        raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")

    async def batch_get_messages(self, request: chatto_dot_api_dot_v1_dot_messages__pb2.BatchGetMessagesRequest, ctx: RequestContext) -> chatto_dot_api_dot_v1_dot_messages__pb2.BatchGetMessagesResponse:
        raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")

    async def add_reaction(self, request: chatto_dot_api_dot_v1_dot_reactions__pb2.AddReactionRequest, ctx: RequestContext) -> chatto_dot_api_dot_v1_dot_reactions__pb2.AddReactionResponse:
        raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")

    async def remove_reaction(self, request: chatto_dot_api_dot_v1_dot_reactions__pb2.RemoveReactionRequest, ctx: RequestContext) -> chatto_dot_api_dot_v1_dot_reactions__pb2.RemoveReactionResponse:
        raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")


class MessageServiceASGIApplication(ConnectASGIApplication[MessageService]):
    def __init__(self, service: MessageService | AsyncGenerator[MessageService], *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None) -> None:
        super().__init__(
            service=service,
            endpoints=lambda svc: {
                "/chatto.api.v1.MessageService/FetchLinkPreview": Endpoint.unary(
                    method=MethodInfo(
                        name="FetchLinkPreview",
                        service_name="chatto.api.v1.MessageService",
                        input=chatto_dot_api_dot_v1_dot_link__previews__pb2.FetchLinkPreviewRequest,
                        output=chatto_dot_api_dot_v1_dot_link__previews__pb2.FetchLinkPreviewResponse,
                        idempotency_level=IdempotencyLevel.UNKNOWN,
                    ),
                    function=svc.fetch_link_preview,
                ),
                "/chatto.api.v1.MessageService/CreateMessage": Endpoint.unary(
                    method=MethodInfo(
                        name="CreateMessage",
                        service_name="chatto.api.v1.MessageService",
                        input=chatto_dot_api_dot_v1_dot_messages__pb2.CreateMessageRequest,
                        output=chatto_dot_api_dot_v1_dot_messages__pb2.CreateMessageResponse,
                        idempotency_level=IdempotencyLevel.UNKNOWN,
                    ),
                    function=svc.create_message,
                ),
                "/chatto.api.v1.MessageService/UpdateMessage": Endpoint.unary(
                    method=MethodInfo(
                        name="UpdateMessage",
                        service_name="chatto.api.v1.MessageService",
                        input=chatto_dot_api_dot_v1_dot_messages__pb2.UpdateMessageRequest,
                        output=chatto_dot_api_dot_v1_dot_messages__pb2.UpdateMessageResponse,
                        idempotency_level=IdempotencyLevel.UNKNOWN,
                    ),
                    function=svc.update_message,
                ),
                "/chatto.api.v1.MessageService/DeleteMessage": Endpoint.unary(
                    method=MethodInfo(
                        name="DeleteMessage",
                        service_name="chatto.api.v1.MessageService",
                        input=chatto_dot_api_dot_v1_dot_messages__pb2.DeleteMessageRequest,
                        output=chatto_dot_api_dot_v1_dot_messages__pb2.DeleteMessageResponse,
                        idempotency_level=IdempotencyLevel.UNKNOWN,
                    ),
                    function=svc.delete_message,
                ),
                "/chatto.api.v1.MessageService/DeleteAttachment": Endpoint.unary(
                    method=MethodInfo(
                        name="DeleteAttachment",
                        service_name="chatto.api.v1.MessageService",
                        input=chatto_dot_api_dot_v1_dot_messages__pb2.DeleteAttachmentRequest,
                        output=chatto_dot_api_dot_v1_dot_messages__pb2.DeleteAttachmentResponse,
                        idempotency_level=IdempotencyLevel.UNKNOWN,
                    ),
                    function=svc.delete_attachment,
                ),
                "/chatto.api.v1.MessageService/DeleteLinkPreview": Endpoint.unary(
                    method=MethodInfo(
                        name="DeleteLinkPreview",
                        service_name="chatto.api.v1.MessageService",
                        input=chatto_dot_api_dot_v1_dot_messages__pb2.DeleteLinkPreviewRequest,
                        output=chatto_dot_api_dot_v1_dot_messages__pb2.DeleteLinkPreviewResponse,
                        idempotency_level=IdempotencyLevel.UNKNOWN,
                    ),
                    function=svc.delete_link_preview,
                ),
                "/chatto.api.v1.MessageService/GetMessage": Endpoint.unary(
                    method=MethodInfo(
                        name="GetMessage",
                        service_name="chatto.api.v1.MessageService",
                        input=chatto_dot_api_dot_v1_dot_messages__pb2.GetMessageRequest,
                        output=chatto_dot_api_dot_v1_dot_messages__pb2.GetMessageResponse,
                        idempotency_level=IdempotencyLevel.UNKNOWN,
                    ),
                    function=svc.get_message,
                ),
                "/chatto.api.v1.MessageService/BatchGetMessages": Endpoint.unary(
                    method=MethodInfo(
                        name="BatchGetMessages",
                        service_name="chatto.api.v1.MessageService",
                        input=chatto_dot_api_dot_v1_dot_messages__pb2.BatchGetMessagesRequest,
                        output=chatto_dot_api_dot_v1_dot_messages__pb2.BatchGetMessagesResponse,
                        idempotency_level=IdempotencyLevel.UNKNOWN,
                    ),
                    function=svc.batch_get_messages,
                ),
                "/chatto.api.v1.MessageService/AddReaction": Endpoint.unary(
                    method=MethodInfo(
                        name="AddReaction",
                        service_name="chatto.api.v1.MessageService",
                        input=chatto_dot_api_dot_v1_dot_reactions__pb2.AddReactionRequest,
                        output=chatto_dot_api_dot_v1_dot_reactions__pb2.AddReactionResponse,
                        idempotency_level=IdempotencyLevel.UNKNOWN,
                    ),
                    function=svc.add_reaction,
                ),
                "/chatto.api.v1.MessageService/RemoveReaction": Endpoint.unary(
                    method=MethodInfo(
                        name="RemoveReaction",
                        service_name="chatto.api.v1.MessageService",
                        input=chatto_dot_api_dot_v1_dot_reactions__pb2.RemoveReactionRequest,
                        output=chatto_dot_api_dot_v1_dot_reactions__pb2.RemoveReactionResponse,
                        idempotency_level=IdempotencyLevel.UNKNOWN,
                    ),
                    function=svc.remove_reaction,
                ),
            },
            interceptors=interceptors,
            read_max_bytes=read_max_bytes,
            compressions=compressions,
        )

    @property
    def path(self) -> str:
        """Returns the URL path to mount the application to when serving multiple applications."""
        return "/chatto.api.v1.MessageService"


class MessageServiceClient(ConnectClient):
    async def fetch_link_preview(
        self,
        request: chatto_dot_api_dot_v1_dot_link__previews__pb2.FetchLinkPreviewRequest,
        *,
        headers: Headers | Mapping[str, str] | None = None,
        timeout_ms: int | None = None,
    ) -> chatto_dot_api_dot_v1_dot_link__previews__pb2.FetchLinkPreviewResponse:
        return await self.execute_unary(
            request=request,
            method=MethodInfo(
                name="FetchLinkPreview",
                service_name="chatto.api.v1.MessageService",
                input=chatto_dot_api_dot_v1_dot_link__previews__pb2.FetchLinkPreviewRequest,
                output=chatto_dot_api_dot_v1_dot_link__previews__pb2.FetchLinkPreviewResponse,
                idempotency_level=IdempotencyLevel.UNKNOWN,
            ),
            headers=headers,
            timeout_ms=timeout_ms,
        )

    async def create_message(
        self,
        request: chatto_dot_api_dot_v1_dot_messages__pb2.CreateMessageRequest,
        *,
        headers: Headers | Mapping[str, str] | None = None,
        timeout_ms: int | None = None,
    ) -> chatto_dot_api_dot_v1_dot_messages__pb2.CreateMessageResponse:
        return await self.execute_unary(
            request=request,
            method=MethodInfo(
                name="CreateMessage",
                service_name="chatto.api.v1.MessageService",
                input=chatto_dot_api_dot_v1_dot_messages__pb2.CreateMessageRequest,
                output=chatto_dot_api_dot_v1_dot_messages__pb2.CreateMessageResponse,
                idempotency_level=IdempotencyLevel.UNKNOWN,
            ),
            headers=headers,
            timeout_ms=timeout_ms,
        )

    async def update_message(
        self,
        request: chatto_dot_api_dot_v1_dot_messages__pb2.UpdateMessageRequest,
        *,
        headers: Headers | Mapping[str, str] | None = None,
        timeout_ms: int | None = None,
    ) -> chatto_dot_api_dot_v1_dot_messages__pb2.UpdateMessageResponse:
        return await self.execute_unary(
            request=request,
            method=MethodInfo(
                name="UpdateMessage",
                service_name="chatto.api.v1.MessageService",
                input=chatto_dot_api_dot_v1_dot_messages__pb2.UpdateMessageRequest,
                output=chatto_dot_api_dot_v1_dot_messages__pb2.UpdateMessageResponse,
                idempotency_level=IdempotencyLevel.UNKNOWN,
            ),
            headers=headers,
            timeout_ms=timeout_ms,
        )

    async def delete_message(
        self,
        request: chatto_dot_api_dot_v1_dot_messages__pb2.DeleteMessageRequest,
        *,
        headers: Headers | Mapping[str, str] | None = None,
        timeout_ms: int | None = None,
    ) -> chatto_dot_api_dot_v1_dot_messages__pb2.DeleteMessageResponse:
        return await self.execute_unary(
            request=request,
            method=MethodInfo(
                name="DeleteMessage",
                service_name="chatto.api.v1.MessageService",
                input=chatto_dot_api_dot_v1_dot_messages__pb2.DeleteMessageRequest,
                output=chatto_dot_api_dot_v1_dot_messages__pb2.DeleteMessageResponse,
                idempotency_level=IdempotencyLevel.UNKNOWN,
            ),
            headers=headers,
            timeout_ms=timeout_ms,
        )

    async def delete_attachment(
        self,
        request: chatto_dot_api_dot_v1_dot_messages__pb2.DeleteAttachmentRequest,
        *,
        headers: Headers | Mapping[str, str] | None = None,
        timeout_ms: int | None = None,
    ) -> chatto_dot_api_dot_v1_dot_messages__pb2.DeleteAttachmentResponse:
        return await self.execute_unary(
            request=request,
            method=MethodInfo(
                name="DeleteAttachment",
                service_name="chatto.api.v1.MessageService",
                input=chatto_dot_api_dot_v1_dot_messages__pb2.DeleteAttachmentRequest,
                output=chatto_dot_api_dot_v1_dot_messages__pb2.DeleteAttachmentResponse,
                idempotency_level=IdempotencyLevel.UNKNOWN,
            ),
            headers=headers,
            timeout_ms=timeout_ms,
        )

    async def delete_link_preview(
        self,
        request: chatto_dot_api_dot_v1_dot_messages__pb2.DeleteLinkPreviewRequest,
        *,
        headers: Headers | Mapping[str, str] | None = None,
        timeout_ms: int | None = None,
    ) -> chatto_dot_api_dot_v1_dot_messages__pb2.DeleteLinkPreviewResponse:
        return await self.execute_unary(
            request=request,
            method=MethodInfo(
                name="DeleteLinkPreview",
                service_name="chatto.api.v1.MessageService",
                input=chatto_dot_api_dot_v1_dot_messages__pb2.DeleteLinkPreviewRequest,
                output=chatto_dot_api_dot_v1_dot_messages__pb2.DeleteLinkPreviewResponse,
                idempotency_level=IdempotencyLevel.UNKNOWN,
            ),
            headers=headers,
            timeout_ms=timeout_ms,
        )

    async def get_message(
        self,
        request: chatto_dot_api_dot_v1_dot_messages__pb2.GetMessageRequest,
        *,
        headers: Headers | Mapping[str, str] | None = None,
        timeout_ms: int | None = None,
    ) -> chatto_dot_api_dot_v1_dot_messages__pb2.GetMessageResponse:
        return await self.execute_unary(
            request=request,
            method=MethodInfo(
                name="GetMessage",
                service_name="chatto.api.v1.MessageService",
                input=chatto_dot_api_dot_v1_dot_messages__pb2.GetMessageRequest,
                output=chatto_dot_api_dot_v1_dot_messages__pb2.GetMessageResponse,
                idempotency_level=IdempotencyLevel.UNKNOWN,
            ),
            headers=headers,
            timeout_ms=timeout_ms,
        )

    async def batch_get_messages(
        self,
        request: chatto_dot_api_dot_v1_dot_messages__pb2.BatchGetMessagesRequest,
        *,
        headers: Headers | Mapping[str, str] | None = None,
        timeout_ms: int | None = None,
    ) -> chatto_dot_api_dot_v1_dot_messages__pb2.BatchGetMessagesResponse:
        return await self.execute_unary(
            request=request,
            method=MethodInfo(
                name="BatchGetMessages",
                service_name="chatto.api.v1.MessageService",
                input=chatto_dot_api_dot_v1_dot_messages__pb2.BatchGetMessagesRequest,
                output=chatto_dot_api_dot_v1_dot_messages__pb2.BatchGetMessagesResponse,
                idempotency_level=IdempotencyLevel.UNKNOWN,
            ),
            headers=headers,
            timeout_ms=timeout_ms,
        )

    async def add_reaction(
        self,
        request: chatto_dot_api_dot_v1_dot_reactions__pb2.AddReactionRequest,
        *,
        headers: Headers | Mapping[str, str] | None = None,
        timeout_ms: int | None = None,
    ) -> chatto_dot_api_dot_v1_dot_reactions__pb2.AddReactionResponse:
        return await self.execute_unary(
            request=request,
            method=MethodInfo(
                name="AddReaction",
                service_name="chatto.api.v1.MessageService",
                input=chatto_dot_api_dot_v1_dot_reactions__pb2.AddReactionRequest,
                output=chatto_dot_api_dot_v1_dot_reactions__pb2.AddReactionResponse,
                idempotency_level=IdempotencyLevel.UNKNOWN,
            ),
            headers=headers,
            timeout_ms=timeout_ms,
        )

    async def remove_reaction(
        self,
        request: chatto_dot_api_dot_v1_dot_reactions__pb2.RemoveReactionRequest,
        *,
        headers: Headers | Mapping[str, str] | None = None,
        timeout_ms: int | None = None,
    ) -> chatto_dot_api_dot_v1_dot_reactions__pb2.RemoveReactionResponse:
        return await self.execute_unary(
            request=request,
            method=MethodInfo(
                name="RemoveReaction",
                service_name="chatto.api.v1.MessageService",
                input=chatto_dot_api_dot_v1_dot_reactions__pb2.RemoveReactionRequest,
                output=chatto_dot_api_dot_v1_dot_reactions__pb2.RemoveReactionResponse,
                idempotency_level=IdempotencyLevel.UNKNOWN,
            ),
            headers=headers,
            timeout_ms=timeout_ms,
        )


class MessageServiceSync(Protocol):
    def fetch_link_preview(self, request: chatto_dot_api_dot_v1_dot_link__previews__pb2.FetchLinkPreviewRequest, ctx: RequestContext) -> chatto_dot_api_dot_v1_dot_link__previews__pb2.FetchLinkPreviewResponse:
        raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")
    def create_message(self, request: chatto_dot_api_dot_v1_dot_messages__pb2.CreateMessageRequest, ctx: RequestContext) -> chatto_dot_api_dot_v1_dot_messages__pb2.CreateMessageResponse:
        raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")
    def update_message(self, request: chatto_dot_api_dot_v1_dot_messages__pb2.UpdateMessageRequest, ctx: RequestContext) -> chatto_dot_api_dot_v1_dot_messages__pb2.UpdateMessageResponse:
        raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")
    def delete_message(self, request: chatto_dot_api_dot_v1_dot_messages__pb2.DeleteMessageRequest, ctx: RequestContext) -> chatto_dot_api_dot_v1_dot_messages__pb2.DeleteMessageResponse:
        raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")
    def delete_attachment(self, request: chatto_dot_api_dot_v1_dot_messages__pb2.DeleteAttachmentRequest, ctx: RequestContext) -> chatto_dot_api_dot_v1_dot_messages__pb2.DeleteAttachmentResponse:
        raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")
    def delete_link_preview(self, request: chatto_dot_api_dot_v1_dot_messages__pb2.DeleteLinkPreviewRequest, ctx: RequestContext) -> chatto_dot_api_dot_v1_dot_messages__pb2.DeleteLinkPreviewResponse:
        raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")
    def get_message(self, request: chatto_dot_api_dot_v1_dot_messages__pb2.GetMessageRequest, ctx: RequestContext) -> chatto_dot_api_dot_v1_dot_messages__pb2.GetMessageResponse:
        raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")
    def batch_get_messages(self, request: chatto_dot_api_dot_v1_dot_messages__pb2.BatchGetMessagesRequest, ctx: RequestContext) -> chatto_dot_api_dot_v1_dot_messages__pb2.BatchGetMessagesResponse:
        raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")
    def add_reaction(self, request: chatto_dot_api_dot_v1_dot_reactions__pb2.AddReactionRequest, ctx: RequestContext) -> chatto_dot_api_dot_v1_dot_reactions__pb2.AddReactionResponse:
        raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")
    def remove_reaction(self, request: chatto_dot_api_dot_v1_dot_reactions__pb2.RemoveReactionRequest, ctx: RequestContext) -> chatto_dot_api_dot_v1_dot_reactions__pb2.RemoveReactionResponse:
        raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")


class MessageServiceWSGIApplication(ConnectWSGIApplication):
    def __init__(self, service: MessageServiceSync, interceptors: Iterable[InterceptorSync]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None) -> None:
        super().__init__(
            endpoints={
                "/chatto.api.v1.MessageService/FetchLinkPreview": EndpointSync.unary(
                    method=MethodInfo(
                        name="FetchLinkPreview",
                        service_name="chatto.api.v1.MessageService",
                        input=chatto_dot_api_dot_v1_dot_link__previews__pb2.FetchLinkPreviewRequest,
                        output=chatto_dot_api_dot_v1_dot_link__previews__pb2.FetchLinkPreviewResponse,
                        idempotency_level=IdempotencyLevel.UNKNOWN,
                    ),
                    function=service.fetch_link_preview,
                ),
                "/chatto.api.v1.MessageService/CreateMessage": EndpointSync.unary(
                    method=MethodInfo(
                        name="CreateMessage",
                        service_name="chatto.api.v1.MessageService",
                        input=chatto_dot_api_dot_v1_dot_messages__pb2.CreateMessageRequest,
                        output=chatto_dot_api_dot_v1_dot_messages__pb2.CreateMessageResponse,
                        idempotency_level=IdempotencyLevel.UNKNOWN,
                    ),
                    function=service.create_message,
                ),
                "/chatto.api.v1.MessageService/UpdateMessage": EndpointSync.unary(
                    method=MethodInfo(
                        name="UpdateMessage",
                        service_name="chatto.api.v1.MessageService",
                        input=chatto_dot_api_dot_v1_dot_messages__pb2.UpdateMessageRequest,
                        output=chatto_dot_api_dot_v1_dot_messages__pb2.UpdateMessageResponse,
                        idempotency_level=IdempotencyLevel.UNKNOWN,
                    ),
                    function=service.update_message,
                ),
                "/chatto.api.v1.MessageService/DeleteMessage": EndpointSync.unary(
                    method=MethodInfo(
                        name="DeleteMessage",
                        service_name="chatto.api.v1.MessageService",
                        input=chatto_dot_api_dot_v1_dot_messages__pb2.DeleteMessageRequest,
                        output=chatto_dot_api_dot_v1_dot_messages__pb2.DeleteMessageResponse,
                        idempotency_level=IdempotencyLevel.UNKNOWN,
                    ),
                    function=service.delete_message,
                ),
                "/chatto.api.v1.MessageService/DeleteAttachment": EndpointSync.unary(
                    method=MethodInfo(
                        name="DeleteAttachment",
                        service_name="chatto.api.v1.MessageService",
                        input=chatto_dot_api_dot_v1_dot_messages__pb2.DeleteAttachmentRequest,
                        output=chatto_dot_api_dot_v1_dot_messages__pb2.DeleteAttachmentResponse,
                        idempotency_level=IdempotencyLevel.UNKNOWN,
                    ),
                    function=service.delete_attachment,
                ),
                "/chatto.api.v1.MessageService/DeleteLinkPreview": EndpointSync.unary(
                    method=MethodInfo(
                        name="DeleteLinkPreview",
                        service_name="chatto.api.v1.MessageService",
                        input=chatto_dot_api_dot_v1_dot_messages__pb2.DeleteLinkPreviewRequest,
                        output=chatto_dot_api_dot_v1_dot_messages__pb2.DeleteLinkPreviewResponse,
                        idempotency_level=IdempotencyLevel.UNKNOWN,
                    ),
                    function=service.delete_link_preview,
                ),
                "/chatto.api.v1.MessageService/GetMessage": EndpointSync.unary(
                    method=MethodInfo(
                        name="GetMessage",
                        service_name="chatto.api.v1.MessageService",
                        input=chatto_dot_api_dot_v1_dot_messages__pb2.GetMessageRequest,
                        output=chatto_dot_api_dot_v1_dot_messages__pb2.GetMessageResponse,
                        idempotency_level=IdempotencyLevel.UNKNOWN,
                    ),
                    function=service.get_message,
                ),
                "/chatto.api.v1.MessageService/BatchGetMessages": EndpointSync.unary(
                    method=MethodInfo(
                        name="BatchGetMessages",
                        service_name="chatto.api.v1.MessageService",
                        input=chatto_dot_api_dot_v1_dot_messages__pb2.BatchGetMessagesRequest,
                        output=chatto_dot_api_dot_v1_dot_messages__pb2.BatchGetMessagesResponse,
                        idempotency_level=IdempotencyLevel.UNKNOWN,
                    ),
                    function=service.batch_get_messages,
                ),
                "/chatto.api.v1.MessageService/AddReaction": EndpointSync.unary(
                    method=MethodInfo(
                        name="AddReaction",
                        service_name="chatto.api.v1.MessageService",
                        input=chatto_dot_api_dot_v1_dot_reactions__pb2.AddReactionRequest,
                        output=chatto_dot_api_dot_v1_dot_reactions__pb2.AddReactionResponse,
                        idempotency_level=IdempotencyLevel.UNKNOWN,
                    ),
                    function=service.add_reaction,
                ),
                "/chatto.api.v1.MessageService/RemoveReaction": EndpointSync.unary(
                    method=MethodInfo(
                        name="RemoveReaction",
                        service_name="chatto.api.v1.MessageService",
                        input=chatto_dot_api_dot_v1_dot_reactions__pb2.RemoveReactionRequest,
                        output=chatto_dot_api_dot_v1_dot_reactions__pb2.RemoveReactionResponse,
                        idempotency_level=IdempotencyLevel.UNKNOWN,
                    ),
                    function=service.remove_reaction,
                ),
            },
            interceptors=interceptors,
            read_max_bytes=read_max_bytes,
            compressions=compressions,
        )

    @property
    def path(self) -> str:
        """Returns the URL path to mount the application to when serving multiple applications."""
        return "/chatto.api.v1.MessageService"


class MessageServiceClientSync(ConnectClientSync):
    def fetch_link_preview(
        self,
        request: chatto_dot_api_dot_v1_dot_link__previews__pb2.FetchLinkPreviewRequest,
        *,
        headers: Headers | Mapping[str, str] | None = None,
        timeout_ms: int | None = None,
    ) -> chatto_dot_api_dot_v1_dot_link__previews__pb2.FetchLinkPreviewResponse:
        return self.execute_unary(
            request=request,
            method=MethodInfo(
                name="FetchLinkPreview",
                service_name="chatto.api.v1.MessageService",
                input=chatto_dot_api_dot_v1_dot_link__previews__pb2.FetchLinkPreviewRequest,
                output=chatto_dot_api_dot_v1_dot_link__previews__pb2.FetchLinkPreviewResponse,
                idempotency_level=IdempotencyLevel.UNKNOWN,
            ),
            headers=headers,
            timeout_ms=timeout_ms,
        )

    def create_message(
        self,
        request: chatto_dot_api_dot_v1_dot_messages__pb2.CreateMessageRequest,
        *,
        headers: Headers | Mapping[str, str] | None = None,
        timeout_ms: int | None = None,
    ) -> chatto_dot_api_dot_v1_dot_messages__pb2.CreateMessageResponse:
        return self.execute_unary(
            request=request,
            method=MethodInfo(
                name="CreateMessage",
                service_name="chatto.api.v1.MessageService",
                input=chatto_dot_api_dot_v1_dot_messages__pb2.CreateMessageRequest,
                output=chatto_dot_api_dot_v1_dot_messages__pb2.CreateMessageResponse,
                idempotency_level=IdempotencyLevel.UNKNOWN,
            ),
            headers=headers,
            timeout_ms=timeout_ms,
        )

    def update_message(
        self,
        request: chatto_dot_api_dot_v1_dot_messages__pb2.UpdateMessageRequest,
        *,
        headers: Headers | Mapping[str, str] | None = None,
        timeout_ms: int | None = None,
    ) -> chatto_dot_api_dot_v1_dot_messages__pb2.UpdateMessageResponse:
        return self.execute_unary(
            request=request,
            method=MethodInfo(
                name="UpdateMessage",
                service_name="chatto.api.v1.MessageService",
                input=chatto_dot_api_dot_v1_dot_messages__pb2.UpdateMessageRequest,
                output=chatto_dot_api_dot_v1_dot_messages__pb2.UpdateMessageResponse,
                idempotency_level=IdempotencyLevel.UNKNOWN,
            ),
            headers=headers,
            timeout_ms=timeout_ms,
        )

    def delete_message(
        self,
        request: chatto_dot_api_dot_v1_dot_messages__pb2.DeleteMessageRequest,
        *,
        headers: Headers | Mapping[str, str] | None = None,
        timeout_ms: int | None = None,
    ) -> chatto_dot_api_dot_v1_dot_messages__pb2.DeleteMessageResponse:
        return self.execute_unary(
            request=request,
            method=MethodInfo(
                name="DeleteMessage",
                service_name="chatto.api.v1.MessageService",
                input=chatto_dot_api_dot_v1_dot_messages__pb2.DeleteMessageRequest,
                output=chatto_dot_api_dot_v1_dot_messages__pb2.DeleteMessageResponse,
                idempotency_level=IdempotencyLevel.UNKNOWN,
            ),
            headers=headers,
            timeout_ms=timeout_ms,
        )

    def delete_attachment(
        self,
        request: chatto_dot_api_dot_v1_dot_messages__pb2.DeleteAttachmentRequest,
        *,
        headers: Headers | Mapping[str, str] | None = None,
        timeout_ms: int | None = None,
    ) -> chatto_dot_api_dot_v1_dot_messages__pb2.DeleteAttachmentResponse:
        return self.execute_unary(
            request=request,
            method=MethodInfo(
                name="DeleteAttachment",
                service_name="chatto.api.v1.MessageService",
                input=chatto_dot_api_dot_v1_dot_messages__pb2.DeleteAttachmentRequest,
                output=chatto_dot_api_dot_v1_dot_messages__pb2.DeleteAttachmentResponse,
                idempotency_level=IdempotencyLevel.UNKNOWN,
            ),
            headers=headers,
            timeout_ms=timeout_ms,
        )

    def delete_link_preview(
        self,
        request: chatto_dot_api_dot_v1_dot_messages__pb2.DeleteLinkPreviewRequest,
        *,
        headers: Headers | Mapping[str, str] | None = None,
        timeout_ms: int | None = None,
    ) -> chatto_dot_api_dot_v1_dot_messages__pb2.DeleteLinkPreviewResponse:
        return self.execute_unary(
            request=request,
            method=MethodInfo(
                name="DeleteLinkPreview",
                service_name="chatto.api.v1.MessageService",
                input=chatto_dot_api_dot_v1_dot_messages__pb2.DeleteLinkPreviewRequest,
                output=chatto_dot_api_dot_v1_dot_messages__pb2.DeleteLinkPreviewResponse,
                idempotency_level=IdempotencyLevel.UNKNOWN,
            ),
            headers=headers,
            timeout_ms=timeout_ms,
        )

    def get_message(
        self,
        request: chatto_dot_api_dot_v1_dot_messages__pb2.GetMessageRequest,
        *,
        headers: Headers | Mapping[str, str] | None = None,
        timeout_ms: int | None = None,
    ) -> chatto_dot_api_dot_v1_dot_messages__pb2.GetMessageResponse:
        return self.execute_unary(
            request=request,
            method=MethodInfo(
                name="GetMessage",
                service_name="chatto.api.v1.MessageService",
                input=chatto_dot_api_dot_v1_dot_messages__pb2.GetMessageRequest,
                output=chatto_dot_api_dot_v1_dot_messages__pb2.GetMessageResponse,
                idempotency_level=IdempotencyLevel.UNKNOWN,
            ),
            headers=headers,
            timeout_ms=timeout_ms,
        )

    def batch_get_messages(
        self,
        request: chatto_dot_api_dot_v1_dot_messages__pb2.BatchGetMessagesRequest,
        *,
        headers: Headers | Mapping[str, str] | None = None,
        timeout_ms: int | None = None,
    ) -> chatto_dot_api_dot_v1_dot_messages__pb2.BatchGetMessagesResponse:
        return self.execute_unary(
            request=request,
            method=MethodInfo(
                name="BatchGetMessages",
                service_name="chatto.api.v1.MessageService",
                input=chatto_dot_api_dot_v1_dot_messages__pb2.BatchGetMessagesRequest,
                output=chatto_dot_api_dot_v1_dot_messages__pb2.BatchGetMessagesResponse,
                idempotency_level=IdempotencyLevel.UNKNOWN,
            ),
            headers=headers,
            timeout_ms=timeout_ms,
        )

    def add_reaction(
        self,
        request: chatto_dot_api_dot_v1_dot_reactions__pb2.AddReactionRequest,
        *,
        headers: Headers | Mapping[str, str] | None = None,
        timeout_ms: int | None = None,
    ) -> chatto_dot_api_dot_v1_dot_reactions__pb2.AddReactionResponse:
        return self.execute_unary(
            request=request,
            method=MethodInfo(
                name="AddReaction",
                service_name="chatto.api.v1.MessageService",
                input=chatto_dot_api_dot_v1_dot_reactions__pb2.AddReactionRequest,
                output=chatto_dot_api_dot_v1_dot_reactions__pb2.AddReactionResponse,
                idempotency_level=IdempotencyLevel.UNKNOWN,
            ),
            headers=headers,
            timeout_ms=timeout_ms,
        )

    def remove_reaction(
        self,
        request: chatto_dot_api_dot_v1_dot_reactions__pb2.RemoveReactionRequest,
        *,
        headers: Headers | Mapping[str, str] | None = None,
        timeout_ms: int | None = None,
    ) -> chatto_dot_api_dot_v1_dot_reactions__pb2.RemoveReactionResponse:
        return self.execute_unary(
            request=request,
            method=MethodInfo(
                name="RemoveReaction",
                service_name="chatto.api.v1.MessageService",
                input=chatto_dot_api_dot_v1_dot_reactions__pb2.RemoveReactionRequest,
                output=chatto_dot_api_dot_v1_dot_reactions__pb2.RemoveReactionResponse,
                idempotency_level=IdempotencyLevel.UNKNOWN,
            ),
            headers=headers,
            timeout_ms=timeout_ms,
        )
