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

from apexnova.market import market_service_pb2 as apexnova_dot_market_dot_market__service__pb2

GRPC_GENERATED_VERSION = '1.72.1'
GRPC_VERSION = grpc.__version__
_version_not_supported = False

try:
    from grpc._utilities import first_version_is_lower
    _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
except ImportError:
    _version_not_supported = True

if _version_not_supported:
    raise RuntimeError(
        f'The grpc package installed is at version {GRPC_VERSION},'
        + f' but the generated code in apexnova/market/market_service_pb2_grpc.py depends on'
        + f' grpcio>={GRPC_GENERATED_VERSION}.'
        + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
        + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
    )


class StockServiceStub(object):
    """Service definition for gRPC communication

    StockService provides gRPC methods for stock-related operations.
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.ReadStock = channel.unary_unary(
                '/market.StockService/ReadStock',
                request_serializer=apexnova_dot_market_dot_market__service__pb2.ReadStockRequest.SerializeToString,
                response_deserializer=apexnova_dot_market_dot_market__service__pb2.ReadStockResponse.FromString,
                _registered_method=True)
        self.ReadQuote = channel.unary_unary(
                '/market.StockService/ReadQuote',
                request_serializer=apexnova_dot_market_dot_market__service__pb2.ReadQuoteRequest.SerializeToString,
                response_deserializer=apexnova_dot_market_dot_market__service__pb2.ReadQuoteResponse.FromString,
                _registered_method=True)
        self.StreamBalanceSheetStatements = channel.unary_stream(
                '/market.StockService/StreamBalanceSheetStatements',
                request_serializer=apexnova_dot_market_dot_market__service__pb2.StreamStatementsRequest.SerializeToString,
                response_deserializer=apexnova_dot_market_dot_market__service__pb2.BalanceSheetStatementResponse.FromString,
                _registered_method=True)
        self.StreamCashflowStatements = channel.unary_stream(
                '/market.StockService/StreamCashflowStatements',
                request_serializer=apexnova_dot_market_dot_market__service__pb2.StreamStatementsRequest.SerializeToString,
                response_deserializer=apexnova_dot_market_dot_market__service__pb2.CashflowStatementResponse.FromString,
                _registered_method=True)
        self.StreamIncomeStatements = channel.unary_stream(
                '/market.StockService/StreamIncomeStatements',
                request_serializer=apexnova_dot_market_dot_market__service__pb2.StreamStatementsRequest.SerializeToString,
                response_deserializer=apexnova_dot_market_dot_market__service__pb2.IncomeStatementResponse.FromString,
                _registered_method=True)
        self.FreeCashFlowGrowthScreener = channel.unary_stream(
                '/market.StockService/FreeCashFlowGrowthScreener',
                request_serializer=apexnova_dot_market_dot_market__service__pb2.FreeCashFlowGrowthScreenerRequest.SerializeToString,
                response_deserializer=apexnova_dot_market_dot_market__service__pb2.FreeCashFlowGrowthScreenerResponse.FromString,
                _registered_method=True)


class StockServiceServicer(object):
    """Service definition for gRPC communication

    StockService provides gRPC methods for stock-related operations.
    """

    def ReadStock(self, request, context):
        """Reads stock information by symbol.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ReadQuote(self, request, context):
        """Reads quote information by symbol and date.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def StreamBalanceSheetStatements(self, request, context):
        """Streams balance sheet statements.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def StreamCashflowStatements(self, request, context):
        """Streams cash flow statements.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def StreamIncomeStatements(self, request, context):
        """Streams income statements.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def FreeCashFlowGrowthScreener(self, request, context):
        """Subscription-like streaming for free cash flow growth screener.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_StockServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'ReadStock': grpc.unary_unary_rpc_method_handler(
                    servicer.ReadStock,
                    request_deserializer=apexnova_dot_market_dot_market__service__pb2.ReadStockRequest.FromString,
                    response_serializer=apexnova_dot_market_dot_market__service__pb2.ReadStockResponse.SerializeToString,
            ),
            'ReadQuote': grpc.unary_unary_rpc_method_handler(
                    servicer.ReadQuote,
                    request_deserializer=apexnova_dot_market_dot_market__service__pb2.ReadQuoteRequest.FromString,
                    response_serializer=apexnova_dot_market_dot_market__service__pb2.ReadQuoteResponse.SerializeToString,
            ),
            'StreamBalanceSheetStatements': grpc.unary_stream_rpc_method_handler(
                    servicer.StreamBalanceSheetStatements,
                    request_deserializer=apexnova_dot_market_dot_market__service__pb2.StreamStatementsRequest.FromString,
                    response_serializer=apexnova_dot_market_dot_market__service__pb2.BalanceSheetStatementResponse.SerializeToString,
            ),
            'StreamCashflowStatements': grpc.unary_stream_rpc_method_handler(
                    servicer.StreamCashflowStatements,
                    request_deserializer=apexnova_dot_market_dot_market__service__pb2.StreamStatementsRequest.FromString,
                    response_serializer=apexnova_dot_market_dot_market__service__pb2.CashflowStatementResponse.SerializeToString,
            ),
            'StreamIncomeStatements': grpc.unary_stream_rpc_method_handler(
                    servicer.StreamIncomeStatements,
                    request_deserializer=apexnova_dot_market_dot_market__service__pb2.StreamStatementsRequest.FromString,
                    response_serializer=apexnova_dot_market_dot_market__service__pb2.IncomeStatementResponse.SerializeToString,
            ),
            'FreeCashFlowGrowthScreener': grpc.unary_stream_rpc_method_handler(
                    servicer.FreeCashFlowGrowthScreener,
                    request_deserializer=apexnova_dot_market_dot_market__service__pb2.FreeCashFlowGrowthScreenerRequest.FromString,
                    response_serializer=apexnova_dot_market_dot_market__service__pb2.FreeCashFlowGrowthScreenerResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'market.StockService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('market.StockService', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class StockService(object):
    """Service definition for gRPC communication

    StockService provides gRPC methods for stock-related operations.
    """

    @staticmethod
    def ReadStock(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,
            '/market.StockService/ReadStock',
            apexnova_dot_market_dot_market__service__pb2.ReadStockRequest.SerializeToString,
            apexnova_dot_market_dot_market__service__pb2.ReadStockResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ReadQuote(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,
            '/market.StockService/ReadQuote',
            apexnova_dot_market_dot_market__service__pb2.ReadQuoteRequest.SerializeToString,
            apexnova_dot_market_dot_market__service__pb2.ReadQuoteResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def StreamBalanceSheetStatements(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_stream(
            request,
            target,
            '/market.StockService/StreamBalanceSheetStatements',
            apexnova_dot_market_dot_market__service__pb2.StreamStatementsRequest.SerializeToString,
            apexnova_dot_market_dot_market__service__pb2.BalanceSheetStatementResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def StreamCashflowStatements(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_stream(
            request,
            target,
            '/market.StockService/StreamCashflowStatements',
            apexnova_dot_market_dot_market__service__pb2.StreamStatementsRequest.SerializeToString,
            apexnova_dot_market_dot_market__service__pb2.CashflowStatementResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def StreamIncomeStatements(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_stream(
            request,
            target,
            '/market.StockService/StreamIncomeStatements',
            apexnova_dot_market_dot_market__service__pb2.StreamStatementsRequest.SerializeToString,
            apexnova_dot_market_dot_market__service__pb2.IncomeStatementResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def FreeCashFlowGrowthScreener(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_stream(
            request,
            target,
            '/market.StockService/FreeCashFlowGrowthScreener',
            apexnova_dot_market_dot_market__service__pb2.FreeCashFlowGrowthScreenerRequest.SerializeToString,
            apexnova_dot_market_dot_market__service__pb2.FreeCashFlowGrowthScreenerResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
