# 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 yandex.cloud.operation import operation_pb2 as yandex_dot_cloud_dot_operation_dot_operation__pb2
from yandex.cloud.organizationmanager.v1.idp import synchronization_session_service_pb2 as yandex_dot_cloud_dot_organizationmanager_dot_v1_dot_idp_dot_synchronization__session__service__pb2

GRPC_GENERATED_VERSION = '1.70.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 yandex/cloud/organizationmanager/v1/idp/synchronization_session_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 SynchronizationSessionServiceStub(object):
    """A set of methods for managing synchronization sessions.
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.OpenSession = channel.unary_unary(
                '/yandex.cloud.organizationmanager.v1.idp.SynchronizationSessionService/OpenSession',
                request_serializer=yandex_dot_cloud_dot_organizationmanager_dot_v1_dot_idp_dot_synchronization__session__service__pb2.OpenSessionRequest.SerializeToString,
                response_deserializer=yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.FromString,
                _registered_method=True)
        self.CloseSession = channel.unary_unary(
                '/yandex.cloud.organizationmanager.v1.idp.SynchronizationSessionService/CloseSession',
                request_serializer=yandex_dot_cloud_dot_organizationmanager_dot_v1_dot_idp_dot_synchronization__session__service__pb2.CloseSessionRequest.SerializeToString,
                response_deserializer=yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.FromString,
                _registered_method=True)
        self.ReportSessionProgress = channel.unary_unary(
                '/yandex.cloud.organizationmanager.v1.idp.SynchronizationSessionService/ReportSessionProgress',
                request_serializer=yandex_dot_cloud_dot_organizationmanager_dot_v1_dot_idp_dot_synchronization__session__service__pb2.ReportSessionProgressRequest.SerializeToString,
                response_deserializer=yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.FromString,
                _registered_method=True)
        self.Heartbeat = channel.unary_unary(
                '/yandex.cloud.organizationmanager.v1.idp.SynchronizationSessionService/Heartbeat',
                request_serializer=yandex_dot_cloud_dot_organizationmanager_dot_v1_dot_idp_dot_synchronization__session__service__pb2.HeartbeatRequest.SerializeToString,
                response_deserializer=yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.FromString,
                _registered_method=True)
        self.GetSession = channel.unary_unary(
                '/yandex.cloud.organizationmanager.v1.idp.SynchronizationSessionService/GetSession',
                request_serializer=yandex_dot_cloud_dot_organizationmanager_dot_v1_dot_idp_dot_synchronization__session__service__pb2.GetSessionRequest.SerializeToString,
                response_deserializer=yandex_dot_cloud_dot_organizationmanager_dot_v1_dot_idp_dot_synchronization__session__service__pb2.GetSessionResponse.FromString,
                _registered_method=True)
        self.ListSessions = channel.unary_unary(
                '/yandex.cloud.organizationmanager.v1.idp.SynchronizationSessionService/ListSessions',
                request_serializer=yandex_dot_cloud_dot_organizationmanager_dot_v1_dot_idp_dot_synchronization__session__service__pb2.ListSessionsRequest.SerializeToString,
                response_deserializer=yandex_dot_cloud_dot_organizationmanager_dot_v1_dot_idp_dot_synchronization__session__service__pb2.ListSessionsResponse.FromString,
                _registered_method=True)


class SynchronizationSessionServiceServicer(object):
    """A set of methods for managing synchronization sessions.
    """

    def OpenSession(self, request, context):
        """Opens a new synchronization session.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def CloseSession(self, request, context):
        """Closes a synchronization session.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ReportSessionProgress(self, request, context):
        """Reports progress for a synchronization session.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Heartbeat(self, request, context):
        """Sends a heartbeat for a synchronization session.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetSession(self, request, context):
        """Returns the specified synchronization session.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ListSessions(self, request, context):
        """Lists synchronization sessions for a subject container.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_SynchronizationSessionServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'OpenSession': grpc.unary_unary_rpc_method_handler(
                    servicer.OpenSession,
                    request_deserializer=yandex_dot_cloud_dot_organizationmanager_dot_v1_dot_idp_dot_synchronization__session__service__pb2.OpenSessionRequest.FromString,
                    response_serializer=yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.SerializeToString,
            ),
            'CloseSession': grpc.unary_unary_rpc_method_handler(
                    servicer.CloseSession,
                    request_deserializer=yandex_dot_cloud_dot_organizationmanager_dot_v1_dot_idp_dot_synchronization__session__service__pb2.CloseSessionRequest.FromString,
                    response_serializer=yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.SerializeToString,
            ),
            'ReportSessionProgress': grpc.unary_unary_rpc_method_handler(
                    servicer.ReportSessionProgress,
                    request_deserializer=yandex_dot_cloud_dot_organizationmanager_dot_v1_dot_idp_dot_synchronization__session__service__pb2.ReportSessionProgressRequest.FromString,
                    response_serializer=yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.SerializeToString,
            ),
            'Heartbeat': grpc.unary_unary_rpc_method_handler(
                    servicer.Heartbeat,
                    request_deserializer=yandex_dot_cloud_dot_organizationmanager_dot_v1_dot_idp_dot_synchronization__session__service__pb2.HeartbeatRequest.FromString,
                    response_serializer=yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.SerializeToString,
            ),
            'GetSession': grpc.unary_unary_rpc_method_handler(
                    servicer.GetSession,
                    request_deserializer=yandex_dot_cloud_dot_organizationmanager_dot_v1_dot_idp_dot_synchronization__session__service__pb2.GetSessionRequest.FromString,
                    response_serializer=yandex_dot_cloud_dot_organizationmanager_dot_v1_dot_idp_dot_synchronization__session__service__pb2.GetSessionResponse.SerializeToString,
            ),
            'ListSessions': grpc.unary_unary_rpc_method_handler(
                    servicer.ListSessions,
                    request_deserializer=yandex_dot_cloud_dot_organizationmanager_dot_v1_dot_idp_dot_synchronization__session__service__pb2.ListSessionsRequest.FromString,
                    response_serializer=yandex_dot_cloud_dot_organizationmanager_dot_v1_dot_idp_dot_synchronization__session__service__pb2.ListSessionsResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'yandex.cloud.organizationmanager.v1.idp.SynchronizationSessionService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('yandex.cloud.organizationmanager.v1.idp.SynchronizationSessionService', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class SynchronizationSessionService(object):
    """A set of methods for managing synchronization sessions.
    """

    @staticmethod
    def OpenSession(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,
            '/yandex.cloud.organizationmanager.v1.idp.SynchronizationSessionService/OpenSession',
            yandex_dot_cloud_dot_organizationmanager_dot_v1_dot_idp_dot_synchronization__session__service__pb2.OpenSessionRequest.SerializeToString,
            yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def CloseSession(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,
            '/yandex.cloud.organizationmanager.v1.idp.SynchronizationSessionService/CloseSession',
            yandex_dot_cloud_dot_organizationmanager_dot_v1_dot_idp_dot_synchronization__session__service__pb2.CloseSessionRequest.SerializeToString,
            yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ReportSessionProgress(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,
            '/yandex.cloud.organizationmanager.v1.idp.SynchronizationSessionService/ReportSessionProgress',
            yandex_dot_cloud_dot_organizationmanager_dot_v1_dot_idp_dot_synchronization__session__service__pb2.ReportSessionProgressRequest.SerializeToString,
            yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def Heartbeat(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,
            '/yandex.cloud.organizationmanager.v1.idp.SynchronizationSessionService/Heartbeat',
            yandex_dot_cloud_dot_organizationmanager_dot_v1_dot_idp_dot_synchronization__session__service__pb2.HeartbeatRequest.SerializeToString,
            yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetSession(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,
            '/yandex.cloud.organizationmanager.v1.idp.SynchronizationSessionService/GetSession',
            yandex_dot_cloud_dot_organizationmanager_dot_v1_dot_idp_dot_synchronization__session__service__pb2.GetSessionRequest.SerializeToString,
            yandex_dot_cloud_dot_organizationmanager_dot_v1_dot_idp_dot_synchronization__session__service__pb2.GetSessionResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ListSessions(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,
            '/yandex.cloud.organizationmanager.v1.idp.SynchronizationSessionService/ListSessions',
            yandex_dot_cloud_dot_organizationmanager_dot_v1_dot_idp_dot_synchronization__session__service__pb2.ListSessionsRequest.SerializeToString,
            yandex_dot_cloud_dot_organizationmanager_dot_v1_dot_idp_dot_synchronization__session__service__pb2.ListSessionsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
