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

from cosmpy.protos.cosmos.upgrade.v1beta1 import (
    query_pb2 as cosmos_dot_upgrade_dot_v1beta1_dot_query__pb2,
)


class QueryStub(object):
    """Query defines the gRPC upgrade querier service."""

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

        Args:
            channel: A grpc.Channel.
        """
        self.CurrentPlan = channel.unary_unary(
            "/cosmos.upgrade.v1beta1.Query/CurrentPlan",
            request_serializer=cosmos_dot_upgrade_dot_v1beta1_dot_query__pb2.QueryCurrentPlanRequest.SerializeToString,
            response_deserializer=cosmos_dot_upgrade_dot_v1beta1_dot_query__pb2.QueryCurrentPlanResponse.FromString,
        )
        self.AppliedPlan = channel.unary_unary(
            "/cosmos.upgrade.v1beta1.Query/AppliedPlan",
            request_serializer=cosmos_dot_upgrade_dot_v1beta1_dot_query__pb2.QueryAppliedPlanRequest.SerializeToString,
            response_deserializer=cosmos_dot_upgrade_dot_v1beta1_dot_query__pb2.QueryAppliedPlanResponse.FromString,
        )
        self.UpgradedConsensusState = channel.unary_unary(
            "/cosmos.upgrade.v1beta1.Query/UpgradedConsensusState",
            request_serializer=cosmos_dot_upgrade_dot_v1beta1_dot_query__pb2.QueryUpgradedConsensusStateRequest.SerializeToString,
            response_deserializer=cosmos_dot_upgrade_dot_v1beta1_dot_query__pb2.QueryUpgradedConsensusStateResponse.FromString,
        )


class QueryServicer(object):
    """Query defines the gRPC upgrade querier service."""

    def CurrentPlan(self, request, context):
        """CurrentPlan queries the current upgrade plan."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def AppliedPlan(self, request, context):
        """AppliedPlan queries a previously applied upgrade plan by its name."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def UpgradedConsensusState(self, request, context):
        """UpgradedConsensusState queries the consensus state that will serve
        as a trusted kernel for the next version of this chain. It will only be
        stored at the last height of this chain.
        UpgradedConsensusState RPC not supported with legacy querier
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")


def add_QueryServicer_to_server(servicer, server):
    rpc_method_handlers = {
        "CurrentPlan": grpc.unary_unary_rpc_method_handler(
            servicer.CurrentPlan,
            request_deserializer=cosmos_dot_upgrade_dot_v1beta1_dot_query__pb2.QueryCurrentPlanRequest.FromString,
            response_serializer=cosmos_dot_upgrade_dot_v1beta1_dot_query__pb2.QueryCurrentPlanResponse.SerializeToString,
        ),
        "AppliedPlan": grpc.unary_unary_rpc_method_handler(
            servicer.AppliedPlan,
            request_deserializer=cosmos_dot_upgrade_dot_v1beta1_dot_query__pb2.QueryAppliedPlanRequest.FromString,
            response_serializer=cosmos_dot_upgrade_dot_v1beta1_dot_query__pb2.QueryAppliedPlanResponse.SerializeToString,
        ),
        "UpgradedConsensusState": grpc.unary_unary_rpc_method_handler(
            servicer.UpgradedConsensusState,
            request_deserializer=cosmos_dot_upgrade_dot_v1beta1_dot_query__pb2.QueryUpgradedConsensusStateRequest.FromString,
            response_serializer=cosmos_dot_upgrade_dot_v1beta1_dot_query__pb2.QueryUpgradedConsensusStateResponse.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        "cosmos.upgrade.v1beta1.Query", rpc_method_handlers
    )
    server.add_generic_rpc_handlers((generic_handler,))


# This class is part of an EXPERIMENTAL API.
class Query(object):
    """Query defines the gRPC upgrade querier service."""

    @staticmethod
    def CurrentPlan(
        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,
            "/cosmos.upgrade.v1beta1.Query/CurrentPlan",
            cosmos_dot_upgrade_dot_v1beta1_dot_query__pb2.QueryCurrentPlanRequest.SerializeToString,
            cosmos_dot_upgrade_dot_v1beta1_dot_query__pb2.QueryCurrentPlanResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )

    @staticmethod
    def AppliedPlan(
        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,
            "/cosmos.upgrade.v1beta1.Query/AppliedPlan",
            cosmos_dot_upgrade_dot_v1beta1_dot_query__pb2.QueryAppliedPlanRequest.SerializeToString,
            cosmos_dot_upgrade_dot_v1beta1_dot_query__pb2.QueryAppliedPlanResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )

    @staticmethod
    def UpgradedConsensusState(
        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,
            "/cosmos.upgrade.v1beta1.Query/UpgradedConsensusState",
            cosmos_dot_upgrade_dot_v1beta1_dot_query__pb2.QueryUpgradedConsensusStateRequest.SerializeToString,
            cosmos_dot_upgrade_dot_v1beta1_dot_query__pb2.QueryUpgradedConsensusStateResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )
