# 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.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,
        )
        self.RegisterApplication = channel.unary_stream(
            "/controller.IsolateController/RegisterApplication",
            request_serializer=controller__pb2.RegisterApplicationRequest.SerializeToString,
            response_deserializer=controller__pb2.RegisterApplicationResult.FromString,
        )
        self.ListAliases = channel.unary_unary(
            "/controller.IsolateController/ListAliases",
            request_serializer=controller__pb2.ListAliasesRequest.SerializeToString,
            response_deserializer=controller__pb2.ListAliasesResult.FromString,
        )
        self.RegisterCron = channel.unary_unary(
            "/controller.IsolateController/RegisterCron",
            request_serializer=controller__pb2.RegisterCronRequest.SerializeToString,
            response_deserializer=controller__pb2.RegisterCronResult.FromString,
        )
        self.CancelCron = channel.unary_unary(
            "/controller.IsolateController/CancelCron",
            request_serializer=controller__pb2.CancelCronRequest.SerializeToString,
            response_deserializer=controller__pb2.CancelCronResult.FromString,
        )
        self.ListCrons = channel.unary_unary(
            "/controller.IsolateController/ListCrons",
            request_serializer=controller__pb2.ListCronsRequest.SerializeToString,
            response_deserializer=controller__pb2.ListCronsResult.FromString,
        )
        self.ListActivations = channel.unary_unary(
            "/controller.IsolateController/ListActivations",
            request_serializer=controller__pb2.ListActivationsRequest.SerializeToString,
            response_deserializer=controller__pb2.ListActivationsResult.FromString,
        )
        self.GetActivationLogs = channel.unary_unary(
            "/controller.IsolateController/GetActivationLogs",
            request_serializer=controller__pb2.GetActivationLogsRequest.SerializeToString,
            response_deserializer=controller__pb2.GetActivationLogsResult.FromString,
        )
        self.GetLogs = channel.unary_stream(
            "/controller.IsolateController/GetLogs",
            request_serializer=controller__pb2.GetLogsRequest.SerializeToString,
            response_deserializer=controller__pb2.GetLogsResult.FromString,
        )
        self.SetSecret = channel.unary_unary(
            "/controller.IsolateController/SetSecret",
            request_serializer=controller__pb2.SetSecretRequest.SerializeToString,
            response_deserializer=controller__pb2.SetSecretResponse.FromString,
        )
        self.ListSecrets = channel.unary_unary(
            "/controller.IsolateController/ListSecrets",
            request_serializer=controller__pb2.ListSecretsRequest.SerializeToString,
            response_deserializer=controller__pb2.ListSecretsResponse.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 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 RegisterApplication(self, request, context):
        """Register a funtion"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def ListAliases(self, request, context):
        """List aliased registered functions"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def RegisterCron(self, request, context):
        """Registers a function to be run at specified times according to a cron schedule."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def CancelCron(self, request, context):
        """Cancels the registired cron."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def ListCrons(self, request, context):
        """Retrieves a list of all scheduled cron jobs."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def ListActivations(self, request, context):
        """Retrieves a list of all cron activations."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

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

    def GetLogs(self, request, context):
        """Get logs from web endpoints."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def SetSecret(self, request, context):
        """Sets a user secret."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def ListSecrets(self, request, context):
        """Lists all secrets"""
        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,
        ),
        "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,
        ),
        "RegisterApplication": grpc.unary_stream_rpc_method_handler(
            servicer.RegisterApplication,
            request_deserializer=controller__pb2.RegisterApplicationRequest.FromString,
            response_serializer=controller__pb2.RegisterApplicationResult.SerializeToString,
        ),
        "ListAliases": grpc.unary_unary_rpc_method_handler(
            servicer.ListAliases,
            request_deserializer=controller__pb2.ListAliasesRequest.FromString,
            response_serializer=controller__pb2.ListAliasesResult.SerializeToString,
        ),
        "RegisterCron": grpc.unary_unary_rpc_method_handler(
            servicer.RegisterCron,
            request_deserializer=controller__pb2.RegisterCronRequest.FromString,
            response_serializer=controller__pb2.RegisterCronResult.SerializeToString,
        ),
        "CancelCron": grpc.unary_unary_rpc_method_handler(
            servicer.CancelCron,
            request_deserializer=controller__pb2.CancelCronRequest.FromString,
            response_serializer=controller__pb2.CancelCronResult.SerializeToString,
        ),
        "ListCrons": grpc.unary_unary_rpc_method_handler(
            servicer.ListCrons,
            request_deserializer=controller__pb2.ListCronsRequest.FromString,
            response_serializer=controller__pb2.ListCronsResult.SerializeToString,
        ),
        "ListActivations": grpc.unary_unary_rpc_method_handler(
            servicer.ListActivations,
            request_deserializer=controller__pb2.ListActivationsRequest.FromString,
            response_serializer=controller__pb2.ListActivationsResult.SerializeToString,
        ),
        "GetActivationLogs": grpc.unary_unary_rpc_method_handler(
            servicer.GetActivationLogs,
            request_deserializer=controller__pb2.GetActivationLogsRequest.FromString,
            response_serializer=controller__pb2.GetActivationLogsResult.SerializeToString,
        ),
        "GetLogs": grpc.unary_stream_rpc_method_handler(
            servicer.GetLogs,
            request_deserializer=controller__pb2.GetLogsRequest.FromString,
            response_serializer=controller__pb2.GetLogsResult.SerializeToString,
        ),
        "SetSecret": grpc.unary_unary_rpc_method_handler(
            servicer.SetSecret,
            request_deserializer=controller__pb2.SetSecretRequest.FromString,
            response_serializer=controller__pb2.SetSecretResponse.SerializeToString,
        ),
        "ListSecrets": grpc.unary_unary_rpc_method_handler(
            servicer.ListSecrets,
            request_deserializer=controller__pb2.ListSecretsRequest.FromString,
            response_serializer=controller__pb2.ListSecretsResponse.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 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,
        )

    @staticmethod
    def RegisterApplication(
        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/RegisterApplication",
            controller__pb2.RegisterApplicationRequest.SerializeToString,
            controller__pb2.RegisterApplicationResult.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )

    @staticmethod
    def ListAliases(
        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/ListAliases",
            controller__pb2.ListAliasesRequest.SerializeToString,
            controller__pb2.ListAliasesResult.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )

    @staticmethod
    def RegisterCron(
        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/RegisterCron",
            controller__pb2.RegisterCronRequest.SerializeToString,
            controller__pb2.RegisterCronResult.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )

    @staticmethod
    def CancelCron(
        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/CancelCron",
            controller__pb2.CancelCronRequest.SerializeToString,
            controller__pb2.CancelCronResult.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )

    @staticmethod
    def ListCrons(
        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/ListCrons",
            controller__pb2.ListCronsRequest.SerializeToString,
            controller__pb2.ListCronsResult.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )

    @staticmethod
    def ListActivations(
        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/ListActivations",
            controller__pb2.ListActivationsRequest.SerializeToString,
            controller__pb2.ListActivationsResult.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )

    @staticmethod
    def GetActivationLogs(
        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/GetActivationLogs",
            controller__pb2.GetActivationLogsRequest.SerializeToString,
            controller__pb2.GetActivationLogsResult.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )

    @staticmethod
    def GetLogs(
        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/GetLogs",
            controller__pb2.GetLogsRequest.SerializeToString,
            controller__pb2.GetLogsResult.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )

    @staticmethod
    def SetSecret(
        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/SetSecret",
            controller__pb2.SetSecretRequest.SerializeToString,
            controller__pb2.SetSecretResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )

    @staticmethod
    def ListSecrets(
        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/ListSecrets",
            controller__pb2.ListSecretsRequest.SerializeToString,
            controller__pb2.ListSecretsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )
