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

from union.internal.workspace import workspace_instance_payload_pb2 as workspace_dot_workspace__instance__payload__pb2


class WorkspaceInstanceServiceStub(object):
    """WorkspaceRegistryService defines the inventory service for creating and fetching workspace definitions.
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.StartWorkspaceInstance = channel.unary_unary(
                '/cloudidl.workspace.WorkspaceInstanceService/StartWorkspaceInstance',
                request_serializer=workspace_dot_workspace__instance__payload__pb2.StartWorkspaceInstanceRequest.SerializeToString,
                response_deserializer=workspace_dot_workspace__instance__payload__pb2.StartWorkspaceInstanceResponse.FromString,
                )
        self.GetWorkspaceInstance = channel.unary_unary(
                '/cloudidl.workspace.WorkspaceInstanceService/GetWorkspaceInstance',
                request_serializer=workspace_dot_workspace__instance__payload__pb2.GetWorkspaceInstanceRequest.SerializeToString,
                response_deserializer=workspace_dot_workspace__instance__payload__pb2.GetWorkspaceInstanceResponse.FromString,
                )
        self.ListWorkspaceInstances = channel.unary_unary(
                '/cloudidl.workspace.WorkspaceInstanceService/ListWorkspaceInstances',
                request_serializer=workspace_dot_workspace__instance__payload__pb2.ListWorkspaceInstancesRequest.SerializeToString,
                response_deserializer=workspace_dot_workspace__instance__payload__pb2.ListWorkspaceInstancesResponse.FromString,
                )
        self.StopWorkspaceInstance = channel.unary_unary(
                '/cloudidl.workspace.WorkspaceInstanceService/StopWorkspaceInstance',
                request_serializer=workspace_dot_workspace__instance__payload__pb2.StopWorkspaceInstanceRequest.SerializeToString,
                response_deserializer=workspace_dot_workspace__instance__payload__pb2.StopWorkspaceInstanceResponse.FromString,
                )
        self.WatchWorkspaceInstances = channel.unary_stream(
                '/cloudidl.workspace.WorkspaceInstanceService/WatchWorkspaceInstances',
                request_serializer=workspace_dot_workspace__instance__payload__pb2.WatchWorkspaceInstancesRequest.SerializeToString,
                response_deserializer=workspace_dot_workspace__instance__payload__pb2.WatchWorkspaceInstancesResponse.FromString,
                )


class WorkspaceInstanceServiceServicer(object):
    """WorkspaceRegistryService defines the inventory service for creating and fetching workspace definitions.
    """

    def StartWorkspaceInstance(self, request, context):
        """StartWorkspaceInstance creates a new workspace definition.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetWorkspaceInstance(self, request, context):
        """GetWorkspaceInstance fetches a workspace definition by its ID.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ListWorkspaceInstances(self, request, context):
        """ListWorkspaceInstances fetches all workspace definitions for a given organization and project.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def StopWorkspaceInstance(self, request, context):
        """StopWorkspaceInstance fetches a workspace definition by its ID.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def WatchWorkspaceInstances(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_WorkspaceInstanceServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'StartWorkspaceInstance': grpc.unary_unary_rpc_method_handler(
                    servicer.StartWorkspaceInstance,
                    request_deserializer=workspace_dot_workspace__instance__payload__pb2.StartWorkspaceInstanceRequest.FromString,
                    response_serializer=workspace_dot_workspace__instance__payload__pb2.StartWorkspaceInstanceResponse.SerializeToString,
            ),
            'GetWorkspaceInstance': grpc.unary_unary_rpc_method_handler(
                    servicer.GetWorkspaceInstance,
                    request_deserializer=workspace_dot_workspace__instance__payload__pb2.GetWorkspaceInstanceRequest.FromString,
                    response_serializer=workspace_dot_workspace__instance__payload__pb2.GetWorkspaceInstanceResponse.SerializeToString,
            ),
            'ListWorkspaceInstances': grpc.unary_unary_rpc_method_handler(
                    servicer.ListWorkspaceInstances,
                    request_deserializer=workspace_dot_workspace__instance__payload__pb2.ListWorkspaceInstancesRequest.FromString,
                    response_serializer=workspace_dot_workspace__instance__payload__pb2.ListWorkspaceInstancesResponse.SerializeToString,
            ),
            'StopWorkspaceInstance': grpc.unary_unary_rpc_method_handler(
                    servicer.StopWorkspaceInstance,
                    request_deserializer=workspace_dot_workspace__instance__payload__pb2.StopWorkspaceInstanceRequest.FromString,
                    response_serializer=workspace_dot_workspace__instance__payload__pb2.StopWorkspaceInstanceResponse.SerializeToString,
            ),
            'WatchWorkspaceInstances': grpc.unary_stream_rpc_method_handler(
                    servicer.WatchWorkspaceInstances,
                    request_deserializer=workspace_dot_workspace__instance__payload__pb2.WatchWorkspaceInstancesRequest.FromString,
                    response_serializer=workspace_dot_workspace__instance__payload__pb2.WatchWorkspaceInstancesResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'cloudidl.workspace.WorkspaceInstanceService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class WorkspaceInstanceService(object):
    """WorkspaceRegistryService defines the inventory service for creating and fetching workspace definitions.
    """

    @staticmethod
    def StartWorkspaceInstance(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, '/cloudidl.workspace.WorkspaceInstanceService/StartWorkspaceInstance',
            workspace_dot_workspace__instance__payload__pb2.StartWorkspaceInstanceRequest.SerializeToString,
            workspace_dot_workspace__instance__payload__pb2.StartWorkspaceInstanceResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def GetWorkspaceInstance(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, '/cloudidl.workspace.WorkspaceInstanceService/GetWorkspaceInstance',
            workspace_dot_workspace__instance__payload__pb2.GetWorkspaceInstanceRequest.SerializeToString,
            workspace_dot_workspace__instance__payload__pb2.GetWorkspaceInstanceResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def ListWorkspaceInstances(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, '/cloudidl.workspace.WorkspaceInstanceService/ListWorkspaceInstances',
            workspace_dot_workspace__instance__payload__pb2.ListWorkspaceInstancesRequest.SerializeToString,
            workspace_dot_workspace__instance__payload__pb2.ListWorkspaceInstancesResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def StopWorkspaceInstance(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, '/cloudidl.workspace.WorkspaceInstanceService/StopWorkspaceInstance',
            workspace_dot_workspace__instance__payload__pb2.StopWorkspaceInstanceRequest.SerializeToString,
            workspace_dot_workspace__instance__payload__pb2.StopWorkspaceInstanceResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def WatchWorkspaceInstances(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_stream(request, target, '/cloudidl.workspace.WorkspaceInstanceService/WatchWorkspaceInstances',
            workspace_dot_workspace__instance__payload__pb2.WatchWorkspaceInstancesRequest.SerializeToString,
            workspace_dot_workspace__instance__payload__pb2.WatchWorkspaceInstancesResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
