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

import abc
import collections.abc
import grpc
import grpc.aio
import typing
import yandex.cloud.marketplace.licensemanager.saas.v1.lock_service_pb2
import yandex.cloud.marketplace.licensemanager.v1.lock_pb2
import yandex.cloud.operation.operation_pb2

_T = typing.TypeVar("_T")

class _MaybeAsyncIterator(collections.abc.AsyncIterator[_T], collections.abc.Iterator[_T], metaclass=abc.ABCMeta): ...

class _ServicerContext(grpc.ServicerContext, grpc.aio.ServicerContext):  # type: ignore[misc, type-arg]
    ...

class LockServiceStub:
    """A set of methods for managing subscription locks."""

    def __init__(self, channel: typing.Union[grpc.Channel, grpc.aio.Channel]) -> None: ...
    Ensure: grpc.UnaryUnaryMultiCallable[
        yandex.cloud.marketplace.licensemanager.saas.v1.lock_service_pb2.EnsureLockRequest,
        yandex.cloud.operation.operation_pb2.Operation,
    ]
    """Checks if the she specified subscription is already locked to the specified resource.
    If it is not locked, locks the subscription to the resource.
    """

    Get: grpc.UnaryUnaryMultiCallable[
        yandex.cloud.marketplace.licensemanager.saas.v1.lock_service_pb2.GetLockRequest,
        yandex.cloud.marketplace.licensemanager.v1.lock_pb2.Lock,
    ]
    """Returns the specified subscription lock."""

    GetByResourceID: grpc.UnaryUnaryMultiCallable[
        yandex.cloud.marketplace.licensemanager.saas.v1.lock_service_pb2.GetLockByResourceIDRequest,
        yandex.cloud.marketplace.licensemanager.v1.lock_pb2.Lock,
    ]
    """Returns the subscription lock for given resource and subscription."""

class LockServiceAsyncStub:
    """A set of methods for managing subscription locks."""

    Ensure: grpc.aio.UnaryUnaryMultiCallable[
        yandex.cloud.marketplace.licensemanager.saas.v1.lock_service_pb2.EnsureLockRequest,
        yandex.cloud.operation.operation_pb2.Operation,
    ]
    """Checks if the she specified subscription is already locked to the specified resource.
    If it is not locked, locks the subscription to the resource.
    """

    Get: grpc.aio.UnaryUnaryMultiCallable[
        yandex.cloud.marketplace.licensemanager.saas.v1.lock_service_pb2.GetLockRequest,
        yandex.cloud.marketplace.licensemanager.v1.lock_pb2.Lock,
    ]
    """Returns the specified subscription lock."""

    GetByResourceID: grpc.aio.UnaryUnaryMultiCallable[
        yandex.cloud.marketplace.licensemanager.saas.v1.lock_service_pb2.GetLockByResourceIDRequest,
        yandex.cloud.marketplace.licensemanager.v1.lock_pb2.Lock,
    ]
    """Returns the subscription lock for given resource and subscription."""

class LockServiceServicer(metaclass=abc.ABCMeta):
    """A set of methods for managing subscription locks."""

    @abc.abstractmethod
    def Ensure(
        self,
        request: yandex.cloud.marketplace.licensemanager.saas.v1.lock_service_pb2.EnsureLockRequest,
        context: _ServicerContext,
    ) -> typing.Union[yandex.cloud.operation.operation_pb2.Operation, collections.abc.Awaitable[yandex.cloud.operation.operation_pb2.Operation]]:
        """Checks if the she specified subscription is already locked to the specified resource.
        If it is not locked, locks the subscription to the resource.
        """

    @abc.abstractmethod
    def Get(
        self,
        request: yandex.cloud.marketplace.licensemanager.saas.v1.lock_service_pb2.GetLockRequest,
        context: _ServicerContext,
    ) -> typing.Union[yandex.cloud.marketplace.licensemanager.v1.lock_pb2.Lock, collections.abc.Awaitable[yandex.cloud.marketplace.licensemanager.v1.lock_pb2.Lock]]:
        """Returns the specified subscription lock."""

    @abc.abstractmethod
    def GetByResourceID(
        self,
        request: yandex.cloud.marketplace.licensemanager.saas.v1.lock_service_pb2.GetLockByResourceIDRequest,
        context: _ServicerContext,
    ) -> typing.Union[yandex.cloud.marketplace.licensemanager.v1.lock_pb2.Lock, collections.abc.Awaitable[yandex.cloud.marketplace.licensemanager.v1.lock_pb2.Lock]]:
        """Returns the subscription lock for given resource and subscription."""

def add_LockServiceServicer_to_server(servicer: LockServiceServicer, server: typing.Union[grpc.Server, grpc.aio.Server]) -> None: ...
