# 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 antigravity_grpc import cloudcode_pb2 as cloudcode__pb2

GRPC_GENERATED_VERSION = '1.80.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 cloudcode_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 PredictionServiceStub(object):
    """─── Service ──────────────────────────────────────────────────────────

    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.GenerateContent = channel.unary_unary(
                '/google.internal.cloud.code.v1internal.PredictionService/GenerateContent',
                request_serializer=cloudcode__pb2.GenerateContentRequest.SerializeToString,
                response_deserializer=cloudcode__pb2.GenerateContentResponse.FromString,
                _registered_method=True)
        self.StreamGenerateContent = channel.unary_stream(
                '/google.internal.cloud.code.v1internal.PredictionService/StreamGenerateContent',
                request_serializer=cloudcode__pb2.GenerateContentRequest.SerializeToString,
                response_deserializer=cloudcode__pb2.StreamGenerateContentChunk.FromString,
                _registered_method=True)
        self.FetchAvailableModels = channel.unary_unary(
                '/google.internal.cloud.code.v1internal.PredictionService/FetchAvailableModels',
                request_serializer=cloudcode__pb2.FetchAvailableModelsRequest.SerializeToString,
                response_deserializer=cloudcode__pb2.FetchAvailableModelsResponse.FromString,
                _registered_method=True)
        self.CountTokens = channel.unary_unary(
                '/google.internal.cloud.code.v1internal.PredictionService/CountTokens',
                request_serializer=cloudcode__pb2.CountTokensRequest.SerializeToString,
                response_deserializer=cloudcode__pb2.CountTokensResponse.FromString,
                _registered_method=True)
        self.RetrieveUserQuota = channel.unary_unary(
                '/google.internal.cloud.code.v1internal.PredictionService/RetrieveUserQuota',
                request_serializer=cloudcode__pb2.RetrieveUserQuotaRequest.SerializeToString,
                response_deserializer=cloudcode__pb2.RetrieveUserQuotaResponse.FromString,
                _registered_method=True)


class PredictionServiceServicer(object):
    """─── Service ──────────────────────────────────────────────────────────

    """

    def GenerateContent(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 StreamGenerateContent(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 FetchAvailableModels(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 CountTokens(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 RetrieveUserQuota(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 add_PredictionServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'GenerateContent': grpc.unary_unary_rpc_method_handler(
                    servicer.GenerateContent,
                    request_deserializer=cloudcode__pb2.GenerateContentRequest.FromString,
                    response_serializer=cloudcode__pb2.GenerateContentResponse.SerializeToString,
            ),
            'StreamGenerateContent': grpc.unary_stream_rpc_method_handler(
                    servicer.StreamGenerateContent,
                    request_deserializer=cloudcode__pb2.GenerateContentRequest.FromString,
                    response_serializer=cloudcode__pb2.StreamGenerateContentChunk.SerializeToString,
            ),
            'FetchAvailableModels': grpc.unary_unary_rpc_method_handler(
                    servicer.FetchAvailableModels,
                    request_deserializer=cloudcode__pb2.FetchAvailableModelsRequest.FromString,
                    response_serializer=cloudcode__pb2.FetchAvailableModelsResponse.SerializeToString,
            ),
            'CountTokens': grpc.unary_unary_rpc_method_handler(
                    servicer.CountTokens,
                    request_deserializer=cloudcode__pb2.CountTokensRequest.FromString,
                    response_serializer=cloudcode__pb2.CountTokensResponse.SerializeToString,
            ),
            'RetrieveUserQuota': grpc.unary_unary_rpc_method_handler(
                    servicer.RetrieveUserQuota,
                    request_deserializer=cloudcode__pb2.RetrieveUserQuotaRequest.FromString,
                    response_serializer=cloudcode__pb2.RetrieveUserQuotaResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'google.internal.cloud.code.v1internal.PredictionService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('google.internal.cloud.code.v1internal.PredictionService', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class PredictionService(object):
    """─── Service ──────────────────────────────────────────────────────────

    """

    @staticmethod
    def GenerateContent(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,
            '/google.internal.cloud.code.v1internal.PredictionService/GenerateContent',
            cloudcode__pb2.GenerateContentRequest.SerializeToString,
            cloudcode__pb2.GenerateContentResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def StreamGenerateContent(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,
            '/google.internal.cloud.code.v1internal.PredictionService/StreamGenerateContent',
            cloudcode__pb2.GenerateContentRequest.SerializeToString,
            cloudcode__pb2.StreamGenerateContentChunk.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def FetchAvailableModels(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,
            '/google.internal.cloud.code.v1internal.PredictionService/FetchAvailableModels',
            cloudcode__pb2.FetchAvailableModelsRequest.SerializeToString,
            cloudcode__pb2.FetchAvailableModelsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def CountTokens(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,
            '/google.internal.cloud.code.v1internal.PredictionService/CountTokens',
            cloudcode__pb2.CountTokensRequest.SerializeToString,
            cloudcode__pb2.CountTokensResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def RetrieveUserQuota(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,
            '/google.internal.cloud.code.v1internal.PredictionService/RetrieveUserQuota',
            cloudcode__pb2.RetrieveUserQuotaRequest.SerializeToString,
            cloudcode__pb2.RetrieveUserQuotaResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
