# 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 ziplime.data.data_sources.grpc.grpc_stubs.grpc.tradeapi.v1.auth import auth_service_pb2 as grpc_dot_tradeapi_dot_v1_dot_auth_dot_auth__service__pb2

GRPC_GENERATED_VERSION = '1.74.0'
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 grpc/tradeapi/v1/auth/auth_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 AuthServiceStub(object):
    def __init__(self, channel):
        self.Auth = channel.unary_unary(
                '/grpc.tradeapi.v1.auth.AuthService/Auth',
                request_serializer=grpc_dot_tradeapi_dot_v1_dot_auth_dot_auth__service__pb2.AuthRequest.SerializeToString,
                response_deserializer=grpc_dot_tradeapi_dot_v1_dot_auth_dot_auth__service__pb2.AuthResponse.FromString,
                _registered_method=True)
        self.TokenDetails = channel.unary_unary(
                '/grpc.tradeapi.v1.auth.AuthService/TokenDetails',
                request_serializer=grpc_dot_tradeapi_dot_v1_dot_auth_dot_auth__service__pb2.TokenDetailsRequest.SerializeToString,
                response_deserializer=grpc_dot_tradeapi_dot_v1_dot_auth_dot_auth__service__pb2.TokenDetailsResponse.FromString,
                _registered_method=True)
        self.SubscribeJwtRenewal = channel.unary_stream(
                '/grpc.tradeapi.v1.auth.AuthService/SubscribeJwtRenewal',
                request_serializer=grpc_dot_tradeapi_dot_v1_dot_auth_dot_auth__service__pb2.SubscribeJwtRenewalRequest.SerializeToString,
                response_deserializer=grpc_dot_tradeapi_dot_v1_dot_auth_dot_auth__service__pb2.SubscribeJwtRenewalResponse.FromString,
                _registered_method=True)


class AuthServiceServicer(object):
    def Auth(self, request, context):
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def TokenDetails(self, request, context):
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def SubscribeJwtRenewal(self, request, context):
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_AuthServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'Auth': grpc.unary_unary_rpc_method_handler(
                    servicer.Auth,
                    request_deserializer=grpc_dot_tradeapi_dot_v1_dot_auth_dot_auth__service__pb2.AuthRequest.FromString,
                    response_serializer=grpc_dot_tradeapi_dot_v1_dot_auth_dot_auth__service__pb2.AuthResponse.SerializeToString,
            ),
            'TokenDetails': grpc.unary_unary_rpc_method_handler(
                    servicer.TokenDetails,
                    request_deserializer=grpc_dot_tradeapi_dot_v1_dot_auth_dot_auth__service__pb2.TokenDetailsRequest.FromString,
                    response_serializer=grpc_dot_tradeapi_dot_v1_dot_auth_dot_auth__service__pb2.TokenDetailsResponse.SerializeToString,
            ),
            'SubscribeJwtRenewal': grpc.unary_stream_rpc_method_handler(
                    servicer.SubscribeJwtRenewal,
                    request_deserializer=grpc_dot_tradeapi_dot_v1_dot_auth_dot_auth__service__pb2.SubscribeJwtRenewalRequest.FromString,
                    response_serializer=grpc_dot_tradeapi_dot_v1_dot_auth_dot_auth__service__pb2.SubscribeJwtRenewalResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'grpc.tradeapi.v1.auth.AuthService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('grpc.tradeapi.v1.auth.AuthService', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class AuthService(object):
    @staticmethod
    def Auth(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,
            '/grpc.tradeapi.v1.auth.AuthService/Auth',
            grpc_dot_tradeapi_dot_v1_dot_auth_dot_auth__service__pb2.AuthRequest.SerializeToString,
            grpc_dot_tradeapi_dot_v1_dot_auth_dot_auth__service__pb2.AuthResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def TokenDetails(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,
            '/grpc.tradeapi.v1.auth.AuthService/TokenDetails',
            grpc_dot_tradeapi_dot_v1_dot_auth_dot_auth__service__pb2.TokenDetailsRequest.SerializeToString,
            grpc_dot_tradeapi_dot_v1_dot_auth_dot_auth__service__pb2.TokenDetailsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def SubscribeJwtRenewal(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,
            '/grpc.tradeapi.v1.auth.AuthService/SubscribeJwtRenewal',
            grpc_dot_tradeapi_dot_v1_dot_auth_dot_auth__service__pb2.SubscribeJwtRenewalRequest.SerializeToString,
            grpc_dot_tradeapi_dot_v1_dot_auth_dot_auth__service__pb2.SubscribeJwtRenewalResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
