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

from terrascope_api.models import toi_pb2 as toi__pb2


class TOIApiStub(object):
    """Missing associated documentation comment in .proto file."""

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

        Args:
            channel: A grpc.Channel.
        """
        self.create = channel.unary_unary(
                '/oi.papi.TOIApi/create',
                request_serializer=toi__pb2.TOICreateRequest.SerializeToString,
                response_deserializer=toi__pb2.TOICreateResponse.FromString,
                )
        self.delete = channel.unary_unary(
                '/oi.papi.TOIApi/delete',
                request_serializer=toi__pb2.TOIDeleteRequest.SerializeToString,
                response_deserializer=toi__pb2.TOIDeleteResponse.FromString,
                )
        self.get = channel.unary_unary(
                '/oi.papi.TOIApi/get',
                request_serializer=toi__pb2.TOIGetRequest.SerializeToString,
                response_deserializer=toi__pb2.TOIGetResponse.FromString,
                )
        self.list = channel.unary_unary(
                '/oi.papi.TOIApi/list',
                request_serializer=toi__pb2.TOIListRequest.SerializeToString,
                response_deserializer=toi__pb2.TOIListResponse.FromString,
                )


class TOIApiServicer(object):
    """Missing associated documentation comment in .proto file."""

    def create(self, request, context):
        """
        Create a new TOI from the given set of TOI metadata. The toi_id for the newly created TOI is returned.
        TOIs that continue past the current date will cause the associated computations to run on a recurring basis until the end date has been reached.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def delete(self, request, context):
        """
        Deletes the specified TOI, provided that it has not already been used as part of a computation.
        The user must have permission to access the specified TOI.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def get(self, request, context):
        """
        Retrieve the TOI for the specified toi_id. The user must have permission to access the specified TOI.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def list(self, request, context):
        """
        Retrieves all TOIs that the user has permissions for and that match the provided search filters.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_TOIApiServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'create': grpc.unary_unary_rpc_method_handler(
                    servicer.create,
                    request_deserializer=toi__pb2.TOICreateRequest.FromString,
                    response_serializer=toi__pb2.TOICreateResponse.SerializeToString,
            ),
            'delete': grpc.unary_unary_rpc_method_handler(
                    servicer.delete,
                    request_deserializer=toi__pb2.TOIDeleteRequest.FromString,
                    response_serializer=toi__pb2.TOIDeleteResponse.SerializeToString,
            ),
            'get': grpc.unary_unary_rpc_method_handler(
                    servicer.get,
                    request_deserializer=toi__pb2.TOIGetRequest.FromString,
                    response_serializer=toi__pb2.TOIGetResponse.SerializeToString,
            ),
            'list': grpc.unary_unary_rpc_method_handler(
                    servicer.list,
                    request_deserializer=toi__pb2.TOIListRequest.FromString,
                    response_serializer=toi__pb2.TOIListResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'oi.papi.TOIApi', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class TOIApi(object):
    """Missing associated documentation comment in .proto file."""

    @staticmethod
    def create(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, '/oi.papi.TOIApi/create',
            toi__pb2.TOICreateRequest.SerializeToString,
            toi__pb2.TOICreateResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def delete(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, '/oi.papi.TOIApi/delete',
            toi__pb2.TOIDeleteRequest.SerializeToString,
            toi__pb2.TOIDeleteResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def get(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, '/oi.papi.TOIApi/get',
            toi__pb2.TOIGetRequest.SerializeToString,
            toi__pb2.TOIGetResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def list(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, '/oi.papi.TOIApi/list',
            toi__pb2.TOIListRequest.SerializeToString,
            toi__pb2.TOIListResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
