# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc

from api.v1 import merchant_webhooks_pb2 as api_dot_v1_dot_merchant__webhooks__pb2


class WebhookServiceStub(object):
    """WebhookService is a placeholder service just to let OpenAPI codegen.
    Jamm's current OpenAPI generator only generates code that is associated
    with services.
    """

    def __init__(self, channel):
        """Constructor.

        Args:
            channel: A grpc.Channel.
        """
        self.Message = channel.unary_unary(
            "/api.v1.WebhookService/Message",
            request_serializer=api_dot_v1_dot_merchant__webhooks__pb2.MessageRequest.SerializeToString,
            response_deserializer=api_dot_v1_dot_merchant__webhooks__pb2.MessageResponse.FromString,
            _registered_method=True,
        )


class WebhookServiceServicer(object):
    """WebhookService is a placeholder service just to let OpenAPI codegen.
    Jamm's current OpenAPI generator only generates code that is associated
    with services.
    """

    def Message(self, request, context):
        """Message placeholder.
        This method is not implemented on Jamm backend.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")


def add_WebhookServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
        "Message": grpc.unary_unary_rpc_method_handler(
            servicer.Message,
            request_deserializer=api_dot_v1_dot_merchant__webhooks__pb2.MessageRequest.FromString,
            response_serializer=api_dot_v1_dot_merchant__webhooks__pb2.MessageResponse.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        "api.v1.WebhookService", rpc_method_handlers
    )
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers("api.v1.WebhookService", rpc_method_handlers)


# This class is part of an EXPERIMENTAL API.
class WebhookService(object):
    """WebhookService is a placeholder service just to let OpenAPI codegen.
    Jamm's current OpenAPI generator only generates code that is associated
    with services.
    """

    @staticmethod
    def Message(
        request,
        target,
        options=(),
        channel_credentials=None,
        call_credentials=None,
        insecure=False,
        compression=None,
        wait_for_ready=None,
        timeout=None,
        metadata=None,
    ):
        return grpc.experimental.unary_unary(
            request,
            target,
            "/api.v1.WebhookService/Message",
            api_dot_v1_dot_merchant__webhooks__pb2.MessageRequest.SerializeToString,
            api_dot_v1_dot_merchant__webhooks__pb2.MessageResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True,
        )
