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

from utxorpc_spec.utxorpc.v1alpha.query import query_pb2 as utxorpc_dot_v1alpha_dot_query_dot_query__pb2


class QueryServiceStub(object):
    """Service definition for querying the state of the chain.
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.ReadParams = channel.unary_unary(
                '/utxorpc.v1alpha.query.QueryService/ReadParams',
                request_serializer=utxorpc_dot_v1alpha_dot_query_dot_query__pb2.ReadParamsRequest.SerializeToString,
                response_deserializer=utxorpc_dot_v1alpha_dot_query_dot_query__pb2.ReadParamsResponse.FromString,
                _registered_method=True)
        self.ReadUtxos = channel.unary_unary(
                '/utxorpc.v1alpha.query.QueryService/ReadUtxos',
                request_serializer=utxorpc_dot_v1alpha_dot_query_dot_query__pb2.ReadUtxosRequest.SerializeToString,
                response_deserializer=utxorpc_dot_v1alpha_dot_query_dot_query__pb2.ReadUtxosResponse.FromString,
                _registered_method=True)
        self.SearchUtxos = channel.unary_unary(
                '/utxorpc.v1alpha.query.QueryService/SearchUtxos',
                request_serializer=utxorpc_dot_v1alpha_dot_query_dot_query__pb2.SearchUtxosRequest.SerializeToString,
                response_deserializer=utxorpc_dot_v1alpha_dot_query_dot_query__pb2.SearchUtxosResponse.FromString,
                _registered_method=True)
        self.ReadData = channel.unary_unary(
                '/utxorpc.v1alpha.query.QueryService/ReadData',
                request_serializer=utxorpc_dot_v1alpha_dot_query_dot_query__pb2.ReadDataRequest.SerializeToString,
                response_deserializer=utxorpc_dot_v1alpha_dot_query_dot_query__pb2.ReadDataResponse.FromString,
                _registered_method=True)


class QueryServiceServicer(object):
    """Service definition for querying the state of the chain.
    """

    def ReadParams(self, request, context):
        """Get overall chain state.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ReadUtxos(self, request, context):
        """Read specific UTxOs by reference.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def SearchUtxos(self, request, context):
        """Search for UTxO based on a pattern.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ReadData(self, request, context):
        """Read specific datum by hash
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_QueryServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'ReadParams': grpc.unary_unary_rpc_method_handler(
                    servicer.ReadParams,
                    request_deserializer=utxorpc_dot_v1alpha_dot_query_dot_query__pb2.ReadParamsRequest.FromString,
                    response_serializer=utxorpc_dot_v1alpha_dot_query_dot_query__pb2.ReadParamsResponse.SerializeToString,
            ),
            'ReadUtxos': grpc.unary_unary_rpc_method_handler(
                    servicer.ReadUtxos,
                    request_deserializer=utxorpc_dot_v1alpha_dot_query_dot_query__pb2.ReadUtxosRequest.FromString,
                    response_serializer=utxorpc_dot_v1alpha_dot_query_dot_query__pb2.ReadUtxosResponse.SerializeToString,
            ),
            'SearchUtxos': grpc.unary_unary_rpc_method_handler(
                    servicer.SearchUtxos,
                    request_deserializer=utxorpc_dot_v1alpha_dot_query_dot_query__pb2.SearchUtxosRequest.FromString,
                    response_serializer=utxorpc_dot_v1alpha_dot_query_dot_query__pb2.SearchUtxosResponse.SerializeToString,
            ),
            'ReadData': grpc.unary_unary_rpc_method_handler(
                    servicer.ReadData,
                    request_deserializer=utxorpc_dot_v1alpha_dot_query_dot_query__pb2.ReadDataRequest.FromString,
                    response_serializer=utxorpc_dot_v1alpha_dot_query_dot_query__pb2.ReadDataResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'utxorpc.v1alpha.query.QueryService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('utxorpc.v1alpha.query.QueryService', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class QueryService(object):
    """Service definition for querying the state of the chain.
    """

    @staticmethod
    def ReadParams(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,
            '/utxorpc.v1alpha.query.QueryService/ReadParams',
            utxorpc_dot_v1alpha_dot_query_dot_query__pb2.ReadParamsRequest.SerializeToString,
            utxorpc_dot_v1alpha_dot_query_dot_query__pb2.ReadParamsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ReadUtxos(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,
            '/utxorpc.v1alpha.query.QueryService/ReadUtxos',
            utxorpc_dot_v1alpha_dot_query_dot_query__pb2.ReadUtxosRequest.SerializeToString,
            utxorpc_dot_v1alpha_dot_query_dot_query__pb2.ReadUtxosResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def SearchUtxos(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,
            '/utxorpc.v1alpha.query.QueryService/SearchUtxos',
            utxorpc_dot_v1alpha_dot_query_dot_query__pb2.SearchUtxosRequest.SerializeToString,
            utxorpc_dot_v1alpha_dot_query_dot_query__pb2.SearchUtxosResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ReadData(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,
            '/utxorpc.v1alpha.query.QueryService/ReadData',
            utxorpc_dot_v1alpha_dot_query_dot_query__pb2.ReadDataRequest.SerializeToString,
            utxorpc_dot_v1alpha_dot_query_dot_query__pb2.ReadDataResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
