# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc

from ..common import sessions_common_pb2 as sessions__common__pb2


class SessionsStub(object):
    """*
    Service for handling sessions.
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.ListSessions = channel.unary_unary(
                '/armonik.api.grpc.v1.sessions.Sessions/ListSessions',
                request_serializer=sessions__common__pb2.ListSessionsRequest.SerializeToString,
                response_deserializer=sessions__common__pb2.ListSessionsResponse.FromString,
                )
        self.GetSession = channel.unary_unary(
                '/armonik.api.grpc.v1.sessions.Sessions/GetSession',
                request_serializer=sessions__common__pb2.GetSessionRequest.SerializeToString,
                response_deserializer=sessions__common__pb2.GetSessionResponse.FromString,
                )
        self.CancelSession = channel.unary_unary(
                '/armonik.api.grpc.v1.sessions.Sessions/CancelSession',
                request_serializer=sessions__common__pb2.CancelSessionRequest.SerializeToString,
                response_deserializer=sessions__common__pb2.CancelSessionResponse.FromString,
                )
        self.CreateSession = channel.unary_unary(
                '/armonik.api.grpc.v1.sessions.Sessions/CreateSession',
                request_serializer=sessions__common__pb2.CreateSessionRequest.SerializeToString,
                response_deserializer=sessions__common__pb2.CreateSessionReply.FromString,
                )
        self.PauseSession = channel.unary_unary(
                '/armonik.api.grpc.v1.sessions.Sessions/PauseSession',
                request_serializer=sessions__common__pb2.PauseSessionRequest.SerializeToString,
                response_deserializer=sessions__common__pb2.PauseSessionResponse.FromString,
                )
        self.ResumeSession = channel.unary_unary(
                '/armonik.api.grpc.v1.sessions.Sessions/ResumeSession',
                request_serializer=sessions__common__pb2.ResumeSessionRequest.SerializeToString,
                response_deserializer=sessions__common__pb2.ResumeSessionResponse.FromString,
                )
        self.CloseSession = channel.unary_unary(
                '/armonik.api.grpc.v1.sessions.Sessions/CloseSession',
                request_serializer=sessions__common__pb2.CloseSessionRequest.SerializeToString,
                response_deserializer=sessions__common__pb2.CloseSessionResponse.FromString,
                )
        self.PurgeSession = channel.unary_unary(
                '/armonik.api.grpc.v1.sessions.Sessions/PurgeSession',
                request_serializer=sessions__common__pb2.PurgeSessionRequest.SerializeToString,
                response_deserializer=sessions__common__pb2.PurgeSessionResponse.FromString,
                )
        self.DeleteSession = channel.unary_unary(
                '/armonik.api.grpc.v1.sessions.Sessions/DeleteSession',
                request_serializer=sessions__common__pb2.DeleteSessionRequest.SerializeToString,
                response_deserializer=sessions__common__pb2.DeleteSessionResponse.FromString,
                )
        self.StopSubmission = channel.unary_unary(
                '/armonik.api.grpc.v1.sessions.Sessions/StopSubmission',
                request_serializer=sessions__common__pb2.StopSubmissionRequest.SerializeToString,
                response_deserializer=sessions__common__pb2.StopSubmissionResponse.FromString,
                )


class SessionsServicer(object):
    """*
    Service for handling sessions.
    """

    def ListSessions(self, request, context):
        """*
        Get a sessions list using pagination, filters and sorting.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetSession(self, request, context):
        """*
        Get a session by its id.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def CancelSession(self, request, context):
        """*
        Cancel a session by its id.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

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

    def PauseSession(self, request, context):
        """*
        Pause a session by its id.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ResumeSession(self, request, context):
        """*
        Resume a paused session by its id.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def CloseSession(self, request, context):
        """*
        Close a session by its id..
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def PurgeSession(self, request, context):
        """*
        Purge a session by its id. Removes Results data.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def DeleteSession(self, request, context):
        """*
        Delete a session by its id. Removes metadata from Results, Sessions and Tasks associated to the session.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def StopSubmission(self, request, context):
        """*
        Stops clients and/or workers from submitting new tasks in the given session.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_SessionsServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'ListSessions': grpc.unary_unary_rpc_method_handler(
                    servicer.ListSessions,
                    request_deserializer=sessions__common__pb2.ListSessionsRequest.FromString,
                    response_serializer=sessions__common__pb2.ListSessionsResponse.SerializeToString,
            ),
            'GetSession': grpc.unary_unary_rpc_method_handler(
                    servicer.GetSession,
                    request_deserializer=sessions__common__pb2.GetSessionRequest.FromString,
                    response_serializer=sessions__common__pb2.GetSessionResponse.SerializeToString,
            ),
            'CancelSession': grpc.unary_unary_rpc_method_handler(
                    servicer.CancelSession,
                    request_deserializer=sessions__common__pb2.CancelSessionRequest.FromString,
                    response_serializer=sessions__common__pb2.CancelSessionResponse.SerializeToString,
            ),
            'CreateSession': grpc.unary_unary_rpc_method_handler(
                    servicer.CreateSession,
                    request_deserializer=sessions__common__pb2.CreateSessionRequest.FromString,
                    response_serializer=sessions__common__pb2.CreateSessionReply.SerializeToString,
            ),
            'PauseSession': grpc.unary_unary_rpc_method_handler(
                    servicer.PauseSession,
                    request_deserializer=sessions__common__pb2.PauseSessionRequest.FromString,
                    response_serializer=sessions__common__pb2.PauseSessionResponse.SerializeToString,
            ),
            'ResumeSession': grpc.unary_unary_rpc_method_handler(
                    servicer.ResumeSession,
                    request_deserializer=sessions__common__pb2.ResumeSessionRequest.FromString,
                    response_serializer=sessions__common__pb2.ResumeSessionResponse.SerializeToString,
            ),
            'CloseSession': grpc.unary_unary_rpc_method_handler(
                    servicer.CloseSession,
                    request_deserializer=sessions__common__pb2.CloseSessionRequest.FromString,
                    response_serializer=sessions__common__pb2.CloseSessionResponse.SerializeToString,
            ),
            'PurgeSession': grpc.unary_unary_rpc_method_handler(
                    servicer.PurgeSession,
                    request_deserializer=sessions__common__pb2.PurgeSessionRequest.FromString,
                    response_serializer=sessions__common__pb2.PurgeSessionResponse.SerializeToString,
            ),
            'DeleteSession': grpc.unary_unary_rpc_method_handler(
                    servicer.DeleteSession,
                    request_deserializer=sessions__common__pb2.DeleteSessionRequest.FromString,
                    response_serializer=sessions__common__pb2.DeleteSessionResponse.SerializeToString,
            ),
            'StopSubmission': grpc.unary_unary_rpc_method_handler(
                    servicer.StopSubmission,
                    request_deserializer=sessions__common__pb2.StopSubmissionRequest.FromString,
                    response_serializer=sessions__common__pb2.StopSubmissionResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'armonik.api.grpc.v1.sessions.Sessions', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class Sessions(object):
    """*
    Service for handling sessions.
    """

    @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, '/armonik.api.grpc.v1.sessions.Sessions/ListSessions',
            sessions__common__pb2.ListSessionsRequest.SerializeToString,
            sessions__common__pb2.ListSessionsResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @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, '/armonik.api.grpc.v1.sessions.Sessions/GetSession',
            sessions__common__pb2.GetSessionRequest.SerializeToString,
            sessions__common__pb2.GetSessionResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def CancelSession(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, '/armonik.api.grpc.v1.sessions.Sessions/CancelSession',
            sessions__common__pb2.CancelSessionRequest.SerializeToString,
            sessions__common__pb2.CancelSessionResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def CreateSession(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, '/armonik.api.grpc.v1.sessions.Sessions/CreateSession',
            sessions__common__pb2.CreateSessionRequest.SerializeToString,
            sessions__common__pb2.CreateSessionReply.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def PauseSession(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, '/armonik.api.grpc.v1.sessions.Sessions/PauseSession',
            sessions__common__pb2.PauseSessionRequest.SerializeToString,
            sessions__common__pb2.PauseSessionResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def ResumeSession(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, '/armonik.api.grpc.v1.sessions.Sessions/ResumeSession',
            sessions__common__pb2.ResumeSessionRequest.SerializeToString,
            sessions__common__pb2.ResumeSessionResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @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, '/armonik.api.grpc.v1.sessions.Sessions/CloseSession',
            sessions__common__pb2.CloseSessionRequest.SerializeToString,
            sessions__common__pb2.CloseSessionResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def PurgeSession(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, '/armonik.api.grpc.v1.sessions.Sessions/PurgeSession',
            sessions__common__pb2.PurgeSessionRequest.SerializeToString,
            sessions__common__pb2.PurgeSessionResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def DeleteSession(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, '/armonik.api.grpc.v1.sessions.Sessions/DeleteSession',
            sessions__common__pb2.DeleteSessionRequest.SerializeToString,
            sessions__common__pb2.DeleteSessionResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def StopSubmission(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, '/armonik.api.grpc.v1.sessions.Sessions/StopSubmission',
            sessions__common__pb2.StopSubmissionRequest.SerializeToString,
            sessions__common__pb2.StopSubmissionResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
