# 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 cline_core.proto.cline import account_pb2 as cline_dot_account__pb2
from cline_core.proto.cline import common_pb2 as cline_dot_common__pb2

GRPC_GENERATED_VERSION = '1.76.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},'
        + ' but the generated code in cline/account_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 AccountServiceStub(object):
    """Service for account-related operations
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.accountLoginClicked = channel.unary_unary(
                '/cline.AccountService/accountLoginClicked',
                request_serializer=cline_dot_common__pb2.EmptyRequest.SerializeToString,
                response_deserializer=cline_dot_common__pb2.String.FromString,
                _registered_method=True)
        self.accountLogoutClicked = channel.unary_unary(
                '/cline.AccountService/accountLogoutClicked',
                request_serializer=cline_dot_common__pb2.EmptyRequest.SerializeToString,
                response_deserializer=cline_dot_common__pb2.Empty.FromString,
                _registered_method=True)
        self.subscribeToAuthStatusUpdate = channel.unary_stream(
                '/cline.AccountService/subscribeToAuthStatusUpdate',
                request_serializer=cline_dot_common__pb2.EmptyRequest.SerializeToString,
                response_deserializer=cline_dot_account__pb2.AuthState.FromString,
                _registered_method=True)
        self.authStateChanged = channel.unary_unary(
                '/cline.AccountService/authStateChanged',
                request_serializer=cline_dot_account__pb2.AuthStateChangedRequest.SerializeToString,
                response_deserializer=cline_dot_account__pb2.AuthState.FromString,
                _registered_method=True)
        self.getUserCredits = channel.unary_unary(
                '/cline.AccountService/getUserCredits',
                request_serializer=cline_dot_common__pb2.EmptyRequest.SerializeToString,
                response_deserializer=cline_dot_account__pb2.UserCreditsData.FromString,
                _registered_method=True)
        self.getOrganizationCredits = channel.unary_unary(
                '/cline.AccountService/getOrganizationCredits',
                request_serializer=cline_dot_account__pb2.GetOrganizationCreditsRequest.SerializeToString,
                response_deserializer=cline_dot_account__pb2.OrganizationCreditsData.FromString,
                _registered_method=True)
        self.getUserOrganizations = channel.unary_unary(
                '/cline.AccountService/getUserOrganizations',
                request_serializer=cline_dot_common__pb2.EmptyRequest.SerializeToString,
                response_deserializer=cline_dot_account__pb2.UserOrganizationsResponse.FromString,
                _registered_method=True)
        self.setUserOrganization = channel.unary_unary(
                '/cline.AccountService/setUserOrganization',
                request_serializer=cline_dot_account__pb2.UserOrganizationUpdateRequest.SerializeToString,
                response_deserializer=cline_dot_common__pb2.Empty.FromString,
                _registered_method=True)
        self.openrouterAuthClicked = channel.unary_unary(
                '/cline.AccountService/openrouterAuthClicked',
                request_serializer=cline_dot_common__pb2.EmptyRequest.SerializeToString,
                response_deserializer=cline_dot_common__pb2.Empty.FromString,
                _registered_method=True)
        self.requestyAuthClicked = channel.unary_unary(
                '/cline.AccountService/requestyAuthClicked',
                request_serializer=cline_dot_common__pb2.StringRequest.SerializeToString,
                response_deserializer=cline_dot_common__pb2.Empty.FromString,
                _registered_method=True)
        self.getRedirectUrl = channel.unary_unary(
                '/cline.AccountService/getRedirectUrl',
                request_serializer=cline_dot_common__pb2.EmptyRequest.SerializeToString,
                response_deserializer=cline_dot_common__pb2.String.FromString,
                _registered_method=True)


class AccountServiceServicer(object):
    """Service for account-related operations
    """

    def accountLoginClicked(self, request, context):
        """Handles the user clicking the login link in the UI.
        Generates a secure nonce for state validation, stores it in secrets,
        and opens the authentication URL in the external browser.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def accountLogoutClicked(self, request, context):
        """Handles the user clicking the logout button in the UI.
        Clears API keys and user state.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def subscribeToAuthStatusUpdate(self, request, context):
        """Subscribe to auth status update events (when authentication state changes)
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def authStateChanged(self, request, context):
        """Handles authentication state changes from the Firebase context.
        Updates the user info in global state and returns the updated value.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def getUserCredits(self, request, context):
        """Fetches all user credits data
        (balance, usage transactions, payment transactions)
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def getOrganizationCredits(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def getUserOrganizations(self, request, context):
        """Fetches all user organizations data
        Returns a list of UserOrganization objects
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def setUserOrganization(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def openrouterAuthClicked(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def requestyAuthClicked(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def getRedirectUrl(self, request, context):
        """Returns a link the webview can use to redirect back to the user's IDE.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_AccountServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'accountLoginClicked': grpc.unary_unary_rpc_method_handler(
                    servicer.accountLoginClicked,
                    request_deserializer=cline_dot_common__pb2.EmptyRequest.FromString,
                    response_serializer=cline_dot_common__pb2.String.SerializeToString,
            ),
            'accountLogoutClicked': grpc.unary_unary_rpc_method_handler(
                    servicer.accountLogoutClicked,
                    request_deserializer=cline_dot_common__pb2.EmptyRequest.FromString,
                    response_serializer=cline_dot_common__pb2.Empty.SerializeToString,
            ),
            'subscribeToAuthStatusUpdate': grpc.unary_stream_rpc_method_handler(
                    servicer.subscribeToAuthStatusUpdate,
                    request_deserializer=cline_dot_common__pb2.EmptyRequest.FromString,
                    response_serializer=cline_dot_account__pb2.AuthState.SerializeToString,
            ),
            'authStateChanged': grpc.unary_unary_rpc_method_handler(
                    servicer.authStateChanged,
                    request_deserializer=cline_dot_account__pb2.AuthStateChangedRequest.FromString,
                    response_serializer=cline_dot_account__pb2.AuthState.SerializeToString,
            ),
            'getUserCredits': grpc.unary_unary_rpc_method_handler(
                    servicer.getUserCredits,
                    request_deserializer=cline_dot_common__pb2.EmptyRequest.FromString,
                    response_serializer=cline_dot_account__pb2.UserCreditsData.SerializeToString,
            ),
            'getOrganizationCredits': grpc.unary_unary_rpc_method_handler(
                    servicer.getOrganizationCredits,
                    request_deserializer=cline_dot_account__pb2.GetOrganizationCreditsRequest.FromString,
                    response_serializer=cline_dot_account__pb2.OrganizationCreditsData.SerializeToString,
            ),
            'getUserOrganizations': grpc.unary_unary_rpc_method_handler(
                    servicer.getUserOrganizations,
                    request_deserializer=cline_dot_common__pb2.EmptyRequest.FromString,
                    response_serializer=cline_dot_account__pb2.UserOrganizationsResponse.SerializeToString,
            ),
            'setUserOrganization': grpc.unary_unary_rpc_method_handler(
                    servicer.setUserOrganization,
                    request_deserializer=cline_dot_account__pb2.UserOrganizationUpdateRequest.FromString,
                    response_serializer=cline_dot_common__pb2.Empty.SerializeToString,
            ),
            'openrouterAuthClicked': grpc.unary_unary_rpc_method_handler(
                    servicer.openrouterAuthClicked,
                    request_deserializer=cline_dot_common__pb2.EmptyRequest.FromString,
                    response_serializer=cline_dot_common__pb2.Empty.SerializeToString,
            ),
            'requestyAuthClicked': grpc.unary_unary_rpc_method_handler(
                    servicer.requestyAuthClicked,
                    request_deserializer=cline_dot_common__pb2.StringRequest.FromString,
                    response_serializer=cline_dot_common__pb2.Empty.SerializeToString,
            ),
            'getRedirectUrl': grpc.unary_unary_rpc_method_handler(
                    servicer.getRedirectUrl,
                    request_deserializer=cline_dot_common__pb2.EmptyRequest.FromString,
                    response_serializer=cline_dot_common__pb2.String.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'cline.AccountService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('cline.AccountService', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class AccountService(object):
    """Service for account-related operations
    """

    @staticmethod
    def accountLoginClicked(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,
            '/cline.AccountService/accountLoginClicked',
            cline_dot_common__pb2.EmptyRequest.SerializeToString,
            cline_dot_common__pb2.String.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def accountLogoutClicked(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,
            '/cline.AccountService/accountLogoutClicked',
            cline_dot_common__pb2.EmptyRequest.SerializeToString,
            cline_dot_common__pb2.Empty.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def subscribeToAuthStatusUpdate(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,
            '/cline.AccountService/subscribeToAuthStatusUpdate',
            cline_dot_common__pb2.EmptyRequest.SerializeToString,
            cline_dot_account__pb2.AuthState.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def authStateChanged(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,
            '/cline.AccountService/authStateChanged',
            cline_dot_account__pb2.AuthStateChangedRequest.SerializeToString,
            cline_dot_account__pb2.AuthState.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def getUserCredits(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,
            '/cline.AccountService/getUserCredits',
            cline_dot_common__pb2.EmptyRequest.SerializeToString,
            cline_dot_account__pb2.UserCreditsData.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def getOrganizationCredits(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,
            '/cline.AccountService/getOrganizationCredits',
            cline_dot_account__pb2.GetOrganizationCreditsRequest.SerializeToString,
            cline_dot_account__pb2.OrganizationCreditsData.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def getUserOrganizations(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,
            '/cline.AccountService/getUserOrganizations',
            cline_dot_common__pb2.EmptyRequest.SerializeToString,
            cline_dot_account__pb2.UserOrganizationsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def setUserOrganization(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,
            '/cline.AccountService/setUserOrganization',
            cline_dot_account__pb2.UserOrganizationUpdateRequest.SerializeToString,
            cline_dot_common__pb2.Empty.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def openrouterAuthClicked(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,
            '/cline.AccountService/openrouterAuthClicked',
            cline_dot_common__pb2.EmptyRequest.SerializeToString,
            cline_dot_common__pb2.Empty.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def requestyAuthClicked(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,
            '/cline.AccountService/requestyAuthClicked',
            cline_dot_common__pb2.StringRequest.SerializeToString,
            cline_dot_common__pb2.Empty.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def getRedirectUrl(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,
            '/cline.AccountService/getRedirectUrl',
            cline_dot_common__pb2.EmptyRequest.SerializeToString,
            cline_dot_common__pb2.String.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
