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


class MsgStub(object):
    """Msg defines the pricefeed Msg service."""

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

        Args:
            channel: A grpc.Channel.
        """
        self.PostPrice = channel.unary_unary(
            '/nibiru.pricefeed.v1.Msg/PostPrice',
            request_serializer=pricefeed_dot_tx__pb2.MsgPostPrice.SerializeToString,
            response_deserializer=pricefeed_dot_tx__pb2.MsgPostPriceResponse.FromString,
        )


class MsgServicer(object):
    """Msg defines the pricefeed Msg service."""

    def PostPrice(self, request, context):
        """PostPrice defines a method for creating a new post price"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_MsgServicer_to_server(servicer, server):
    rpc_method_handlers = {
        'PostPrice': grpc.unary_unary_rpc_method_handler(
            servicer.PostPrice,
            request_deserializer=pricefeed_dot_tx__pb2.MsgPostPrice.FromString,
            response_serializer=pricefeed_dot_tx__pb2.MsgPostPriceResponse.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler('nibiru.pricefeed.v1.Msg', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


# This class is part of an EXPERIMENTAL API.
class Msg(object):
    """Msg defines the pricefeed Msg service."""

    @staticmethod
    def PostPrice(
        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,
            '/nibiru.pricefeed.v1.Msg/PostPrice',
            pricefeed_dot_tx__pb2.MsgPostPrice.SerializeToString,
            pricefeed_dot_tx__pb2.MsgPostPriceResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )
