# 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,
                )


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 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,
            ),
    }
    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)
