# 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 . import internal_api_pb2 as confidence_dot_flags_dot_resolver_dot_v1_dot_internal__api__pb2

GRPC_GENERATED_VERSION = '1.78.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 confidence/flags/resolver/v1/internal_api_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 InternalFlagLoggerServiceStub(object):
    """Simplified from confidence-resolver/protos/confidence/flags/resolver/v1/internal_api.proto
    Annotations removed for minimal dependencies

    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.ClientWriteFlagLogs = channel.unary_unary(
                '/confidence.flags.resolver.v1.InternalFlagLoggerService/ClientWriteFlagLogs',
                request_serializer=confidence_dot_flags_dot_resolver_dot_v1_dot_internal__api__pb2.WriteFlagLogsRequest.SerializeToString,
                response_deserializer=confidence_dot_flags_dot_resolver_dot_v1_dot_internal__api__pb2.WriteFlagLogsResponse.FromString,
                _registered_method=True)
        self.WriteMaterializedOperations = channel.unary_unary(
                '/confidence.flags.resolver.v1.InternalFlagLoggerService/WriteMaterializedOperations',
                request_serializer=confidence_dot_flags_dot_resolver_dot_v1_dot_internal__api__pb2.WriteOperationsRequest.SerializeToString,
                response_deserializer=confidence_dot_flags_dot_resolver_dot_v1_dot_internal__api__pb2.WriteOperationsResult.FromString,
                _registered_method=True)
        self.ReadMaterializedOperations = channel.unary_unary(
                '/confidence.flags.resolver.v1.InternalFlagLoggerService/ReadMaterializedOperations',
                request_serializer=confidence_dot_flags_dot_resolver_dot_v1_dot_internal__api__pb2.ReadOperationsRequest.SerializeToString,
                response_deserializer=confidence_dot_flags_dot_resolver_dot_v1_dot_internal__api__pb2.ReadOperationsResult.FromString,
                _registered_method=True)


class InternalFlagLoggerServiceServicer(object):
    """Simplified from confidence-resolver/protos/confidence/flags/resolver/v1/internal_api.proto
    Annotations removed for minimal dependencies

    """

    def ClientWriteFlagLogs(self, request, context):
        """Client writes flag assignment events and resolve logs using client secret authentication.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def WriteMaterializedOperations(self, request, context):
        """Stores materializations for units. Uses client secret authentication.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ReadMaterializedOperations(self, request, context):
        """Loads materializations for units. Uses client secret authentication.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_InternalFlagLoggerServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'ClientWriteFlagLogs': grpc.unary_unary_rpc_method_handler(
                    servicer.ClientWriteFlagLogs,
                    request_deserializer=confidence_dot_flags_dot_resolver_dot_v1_dot_internal__api__pb2.WriteFlagLogsRequest.FromString,
                    response_serializer=confidence_dot_flags_dot_resolver_dot_v1_dot_internal__api__pb2.WriteFlagLogsResponse.SerializeToString,
            ),
            'WriteMaterializedOperations': grpc.unary_unary_rpc_method_handler(
                    servicer.WriteMaterializedOperations,
                    request_deserializer=confidence_dot_flags_dot_resolver_dot_v1_dot_internal__api__pb2.WriteOperationsRequest.FromString,
                    response_serializer=confidence_dot_flags_dot_resolver_dot_v1_dot_internal__api__pb2.WriteOperationsResult.SerializeToString,
            ),
            'ReadMaterializedOperations': grpc.unary_unary_rpc_method_handler(
                    servicer.ReadMaterializedOperations,
                    request_deserializer=confidence_dot_flags_dot_resolver_dot_v1_dot_internal__api__pb2.ReadOperationsRequest.FromString,
                    response_serializer=confidence_dot_flags_dot_resolver_dot_v1_dot_internal__api__pb2.ReadOperationsResult.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'confidence.flags.resolver.v1.InternalFlagLoggerService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('confidence.flags.resolver.v1.InternalFlagLoggerService', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class InternalFlagLoggerService(object):
    """Simplified from confidence-resolver/protos/confidence/flags/resolver/v1/internal_api.proto
    Annotations removed for minimal dependencies

    """

    @staticmethod
    def ClientWriteFlagLogs(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,
            '/confidence.flags.resolver.v1.InternalFlagLoggerService/ClientWriteFlagLogs',
            confidence_dot_flags_dot_resolver_dot_v1_dot_internal__api__pb2.WriteFlagLogsRequest.SerializeToString,
            confidence_dot_flags_dot_resolver_dot_v1_dot_internal__api__pb2.WriteFlagLogsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def WriteMaterializedOperations(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,
            '/confidence.flags.resolver.v1.InternalFlagLoggerService/WriteMaterializedOperations',
            confidence_dot_flags_dot_resolver_dot_v1_dot_internal__api__pb2.WriteOperationsRequest.SerializeToString,
            confidence_dot_flags_dot_resolver_dot_v1_dot_internal__api__pb2.WriteOperationsResult.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ReadMaterializedOperations(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,
            '/confidence.flags.resolver.v1.InternalFlagLoggerService/ReadMaterializedOperations',
            confidence_dot_flags_dot_resolver_dot_v1_dot_internal__api__pb2.ReadOperationsRequest.SerializeToString,
            confidence_dot_flags_dot_resolver_dot_v1_dot_internal__api__pb2.ReadOperationsResult.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
