"""
@generated by mypy-protobuf.  Do not edit manually!
isort:skip_file
Copyright 2018 Codethink Limited

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""
import abc
import buildgrid.common.protos.buildstream.v2.buildstream_pb2
import grpc.aio as grpc
import typing

class ReferenceStorageStub:
    def __init__(self, channel: grpc.Channel) -> None: ...
    GetReference: grpc.UnaryUnaryMultiCallable[
        buildgrid.common.protos.buildstream.v2.buildstream_pb2.GetReferenceRequest,
        buildgrid.common.protos.buildstream.v2.buildstream_pb2.GetReferenceResponse,
    ]
    """Retrieve a CAS [Directory][build.bazel.remote.execution.v2.Directory]
    digest by name.

    Errors:
    * `NOT_FOUND`: The requested reference is not in the cache.
    """
    UpdateReference: grpc.UnaryUnaryMultiCallable[
        buildgrid.common.protos.buildstream.v2.buildstream_pb2.UpdateReferenceRequest,
        buildgrid.common.protos.buildstream.v2.buildstream_pb2.UpdateReferenceResponse,
    ]
    """Associate a name with a CAS [Directory][build.bazel.remote.execution.v2.Directory]
    digest.

    Errors:
    * `RESOURCE_EXHAUSTED`: There is insufficient storage space to add the
      entry to the cache.
    """
    Status: grpc.UnaryUnaryMultiCallable[
        buildgrid.common.protos.buildstream.v2.buildstream_pb2.StatusRequest,
        buildgrid.common.protos.buildstream.v2.buildstream_pb2.StatusResponse,
    ]

class ReferenceStorageServicer(metaclass=abc.ABCMeta):
    @abc.abstractmethod
    async def GetReference(
        self,
        request: buildgrid.common.protos.buildstream.v2.buildstream_pb2.GetReferenceRequest,
        context: grpc.ServicerContext[typing.Any, typing.Any],
    ) -> buildgrid.common.protos.buildstream.v2.buildstream_pb2.GetReferenceResponse:
        """Retrieve a CAS [Directory][build.bazel.remote.execution.v2.Directory]
        digest by name.

        Errors:
        * `NOT_FOUND`: The requested reference is not in the cache.
        """
    @abc.abstractmethod
    async def UpdateReference(
        self,
        request: buildgrid.common.protos.buildstream.v2.buildstream_pb2.UpdateReferenceRequest,
        context: grpc.ServicerContext[typing.Any, typing.Any],
    ) -> buildgrid.common.protos.buildstream.v2.buildstream_pb2.UpdateReferenceResponse:
        """Associate a name with a CAS [Directory][build.bazel.remote.execution.v2.Directory]
        digest.

        Errors:
        * `RESOURCE_EXHAUSTED`: There is insufficient storage space to add the
          entry to the cache.
        """
    @abc.abstractmethod
    async def Status(
        self,
        request: buildgrid.common.protos.buildstream.v2.buildstream_pb2.StatusRequest,
        context: grpc.ServicerContext[typing.Any, typing.Any],
    ) -> buildgrid.common.protos.buildstream.v2.buildstream_pb2.StatusResponse: ...

def add_ReferenceStorageServicer_to_server(servicer: ReferenceStorageServicer, server: grpc.Server) -> None: ...
