# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc

from yandex.cloud.operation import operation_pb2 as yandex_dot_cloud_dot_operation_dot_operation__pb2
from yandex.cloud.operation import operation_service_pb2 as yandex_dot_cloud_dot_operation_dot_operation__service__pb2


class OperationServiceStub(object):
  """A set of methods for managing operations for asynchronous API requests.
  """

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

    Args:
      channel: A grpc.Channel.
    """
    self.Get = channel.unary_unary(
        '/yandex.cloud.operation.OperationService/Get',
        request_serializer=yandex_dot_cloud_dot_operation_dot_operation__service__pb2.GetOperationRequest.SerializeToString,
        response_deserializer=yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.FromString,
        )
    self.Cancel = channel.unary_unary(
        '/yandex.cloud.operation.OperationService/Cancel',
        request_serializer=yandex_dot_cloud_dot_operation_dot_operation__service__pb2.CancelOperationRequest.SerializeToString,
        response_deserializer=yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.FromString,
        )


class OperationServiceServicer(object):
  """A set of methods for managing operations for asynchronous API requests.
  """

  def Get(self, request, context):
    """Returns the specified Operation resource.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def Cancel(self, request, context):
    """Cancels the specified operation.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')


def add_OperationServiceServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'Get': grpc.unary_unary_rpc_method_handler(
          servicer.Get,
          request_deserializer=yandex_dot_cloud_dot_operation_dot_operation__service__pb2.GetOperationRequest.FromString,
          response_serializer=yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.SerializeToString,
      ),
      'Cancel': grpc.unary_unary_rpc_method_handler(
          servicer.Cancel,
          request_deserializer=yandex_dot_cloud_dot_operation_dot_operation__service__pb2.CancelOperationRequest.FromString,
          response_serializer=yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'yandex.cloud.operation.OperationService', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))
