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

import grpc
from isolate_proto import controller_pb2 as controller__pb2


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

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

        Args:
            channel: A grpc.Channel.
        """
        self.Run = channel.unary_stream(
            "/controller.IsolateController/Run",
            request_serializer=controller__pb2.HostedRun.SerializeToString,
            response_deserializer=controller__pb2.HostedRunResult.FromString,
        )
        self.Map = channel.unary_stream(
            "/controller.IsolateController/Map",
            request_serializer=controller__pb2.HostedMap.SerializeToString,
            response_deserializer=controller__pb2.HostedRunResult.FromString,
        )
        self.Schedule = channel.unary_unary(
            "/controller.IsolateController/Schedule",
            request_serializer=controller__pb2.HostedRunCron.SerializeToString,
            response_deserializer=controller__pb2.ScheduleInfo.FromString,
        )
        self.ListScheduledRuns = channel.unary_unary(
            "/controller.IsolateController/ListScheduledRuns",
            request_serializer=controller__pb2.ListScheduledRunsRequest.SerializeToString,
            response_deserializer=controller__pb2.ListScheduledRunsResponse.FromString,
        )
        self.CancelScheduledRun = channel.unary_unary(
            "/controller.IsolateController/CancelScheduledRun",
            request_serializer=controller__pb2.CancelScheduledRunRequest.SerializeToString,
            response_deserializer=controller__pb2.CancelScheduledRunResponse.FromString,
        )
        self.ListScheduledRunActivations = channel.unary_unary(
            "/controller.IsolateController/ListScheduledRunActivations",
            request_serializer=controller__pb2.ListScheduledRunActivationsRequest.SerializeToString,
            response_deserializer=controller__pb2.ListScheduledRunActivationsResponse.FromString,
        )
        self.GetScheduledActivationLogs = channel.unary_unary(
            "/controller.IsolateController/GetScheduledActivationLogs",
            request_serializer=controller__pb2.GetScheduledActivationLogsRequest.SerializeToString,
            response_deserializer=controller__pb2.GetScheduledActivationLogsResponse.FromString,
        )
        self.CreateUserKey = channel.unary_unary(
            "/controller.IsolateController/CreateUserKey",
            request_serializer=controller__pb2.CreateUserKeyRequest.SerializeToString,
            response_deserializer=controller__pb2.CreateUserKeyResponse.FromString,
        )
        self.ListUserKeys = channel.unary_unary(
            "/controller.IsolateController/ListUserKeys",
            request_serializer=controller__pb2.ListUserKeysRequest.SerializeToString,
            response_deserializer=controller__pb2.ListUserKeysResponse.FromString,
        )
        self.RevokeUserKey = channel.unary_unary(
            "/controller.IsolateController/RevokeUserKey",
            request_serializer=controller__pb2.RevokeUserKeyRequest.SerializeToString,
            response_deserializer=controller__pb2.RevokeUserKeyResponse.FromString,
        )
        self.WorkerStatusList = channel.unary_unary(
            "/controller.IsolateController/WorkerStatusList",
            request_serializer=controller__pb2.WorkerStatusListRequest.SerializeToString,
            response_deserializer=controller__pb2.WorkerStatusListResponse.FromString,
        )


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

    def Run(self, request, context):
        """Run the given function on the specified environment. Streams logs
        and the result originating from that function.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def Map(self, request, context):
        """Run the given function in parallel with the given inputs"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def Schedule(self, request, context):
        """Schedule the given function to be run with the specified cron."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def ListScheduledRuns(self, request, context):
        """List scheduled runs."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def CancelScheduledRun(self, request, context):
        """Cancel a scheduled run."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def ListScheduledRunActivations(self, request, context):
        """List all the activations of one scheduled run."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def GetScheduledActivationLogs(self, request, context):
        """Get logs from a particular activation of a scheduled run."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def CreateUserKey(self, request, context):
        """Creates an authentication key for a user"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def ListUserKeys(self, request, context):
        """Lists the user's authentication keys"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def RevokeUserKey(self, request, context):
        """Revokes an authentication key for a user"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def WorkerStatusList(self, request, context):
        """Worker usage of a user"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")


def add_IsolateControllerServicer_to_server(servicer, server):
    rpc_method_handlers = {
        "Run": grpc.unary_stream_rpc_method_handler(
            servicer.Run,
            request_deserializer=controller__pb2.HostedRun.FromString,
            response_serializer=controller__pb2.HostedRunResult.SerializeToString,
        ),
        "Map": grpc.unary_stream_rpc_method_handler(
            servicer.Map,
            request_deserializer=controller__pb2.HostedMap.FromString,
            response_serializer=controller__pb2.HostedRunResult.SerializeToString,
        ),
        "Schedule": grpc.unary_unary_rpc_method_handler(
            servicer.Schedule,
            request_deserializer=controller__pb2.HostedRunCron.FromString,
            response_serializer=controller__pb2.ScheduleInfo.SerializeToString,
        ),
        "ListScheduledRuns": grpc.unary_unary_rpc_method_handler(
            servicer.ListScheduledRuns,
            request_deserializer=controller__pb2.ListScheduledRunsRequest.FromString,
            response_serializer=controller__pb2.ListScheduledRunsResponse.SerializeToString,
        ),
        "CancelScheduledRun": grpc.unary_unary_rpc_method_handler(
            servicer.CancelScheduledRun,
            request_deserializer=controller__pb2.CancelScheduledRunRequest.FromString,
            response_serializer=controller__pb2.CancelScheduledRunResponse.SerializeToString,
        ),
        "ListScheduledRunActivations": grpc.unary_unary_rpc_method_handler(
            servicer.ListScheduledRunActivations,
            request_deserializer=controller__pb2.ListScheduledRunActivationsRequest.FromString,
            response_serializer=controller__pb2.ListScheduledRunActivationsResponse.SerializeToString,
        ),
        "GetScheduledActivationLogs": grpc.unary_unary_rpc_method_handler(
            servicer.GetScheduledActivationLogs,
            request_deserializer=controller__pb2.GetScheduledActivationLogsRequest.FromString,
            response_serializer=controller__pb2.GetScheduledActivationLogsResponse.SerializeToString,
        ),
        "CreateUserKey": grpc.unary_unary_rpc_method_handler(
            servicer.CreateUserKey,
            request_deserializer=controller__pb2.CreateUserKeyRequest.FromString,
            response_serializer=controller__pb2.CreateUserKeyResponse.SerializeToString,
        ),
        "ListUserKeys": grpc.unary_unary_rpc_method_handler(
            servicer.ListUserKeys,
            request_deserializer=controller__pb2.ListUserKeysRequest.FromString,
            response_serializer=controller__pb2.ListUserKeysResponse.SerializeToString,
        ),
        "RevokeUserKey": grpc.unary_unary_rpc_method_handler(
            servicer.RevokeUserKey,
            request_deserializer=controller__pb2.RevokeUserKeyRequest.FromString,
            response_serializer=controller__pb2.RevokeUserKeyResponse.SerializeToString,
        ),
        "WorkerStatusList": grpc.unary_unary_rpc_method_handler(
            servicer.WorkerStatusList,
            request_deserializer=controller__pb2.WorkerStatusListRequest.FromString,
            response_serializer=controller__pb2.WorkerStatusListResponse.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        "controller.IsolateController", rpc_method_handlers
    )
    server.add_generic_rpc_handlers((generic_handler,))


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

    @staticmethod
    def Run(
        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,
            "/controller.IsolateController/Run",
            controller__pb2.HostedRun.SerializeToString,
            controller__pb2.HostedRunResult.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )

    @staticmethod
    def Map(
        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,
            "/controller.IsolateController/Map",
            controller__pb2.HostedMap.SerializeToString,
            controller__pb2.HostedRunResult.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )

    @staticmethod
    def Schedule(
        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,
            "/controller.IsolateController/Schedule",
            controller__pb2.HostedRunCron.SerializeToString,
            controller__pb2.ScheduleInfo.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )

    @staticmethod
    def ListScheduledRuns(
        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,
            "/controller.IsolateController/ListScheduledRuns",
            controller__pb2.ListScheduledRunsRequest.SerializeToString,
            controller__pb2.ListScheduledRunsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )

    @staticmethod
    def CancelScheduledRun(
        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,
            "/controller.IsolateController/CancelScheduledRun",
            controller__pb2.CancelScheduledRunRequest.SerializeToString,
            controller__pb2.CancelScheduledRunResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )

    @staticmethod
    def ListScheduledRunActivations(
        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,
            "/controller.IsolateController/ListScheduledRunActivations",
            controller__pb2.ListScheduledRunActivationsRequest.SerializeToString,
            controller__pb2.ListScheduledRunActivationsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )

    @staticmethod
    def GetScheduledActivationLogs(
        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,
            "/controller.IsolateController/GetScheduledActivationLogs",
            controller__pb2.GetScheduledActivationLogsRequest.SerializeToString,
            controller__pb2.GetScheduledActivationLogsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )

    @staticmethod
    def CreateUserKey(
        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,
            "/controller.IsolateController/CreateUserKey",
            controller__pb2.CreateUserKeyRequest.SerializeToString,
            controller__pb2.CreateUserKeyResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )

    @staticmethod
    def ListUserKeys(
        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,
            "/controller.IsolateController/ListUserKeys",
            controller__pb2.ListUserKeysRequest.SerializeToString,
            controller__pb2.ListUserKeysResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )

    @staticmethod
    def RevokeUserKey(
        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,
            "/controller.IsolateController/RevokeUserKey",
            controller__pb2.RevokeUserKeyRequest.SerializeToString,
            controller__pb2.RevokeUserKeyResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )

    @staticmethod
    def WorkerStatusList(
        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,
            "/controller.IsolateController/WorkerStatusList",
            controller__pb2.WorkerStatusListRequest.SerializeToString,
            controller__pb2.WorkerStatusListResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )
