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

from nebius.api.nebius.compute.v1 import maintenance_event_pb2 as nebius_dot_compute_dot_v1_dot_maintenance__event__pb2
from nebius.api.nebius.compute.v1 import maintenance_service_pb2 as nebius_dot_compute_dot_v1_dot_maintenance__service__pb2


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

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

        Args:
            channel: A grpc.Channel.
        """
        self.GetByInstance = channel.unary_unary(
                '/nebius.compute.v1.MaintenanceService/GetByInstance',
                request_serializer=nebius_dot_compute_dot_v1_dot_maintenance__service__pb2.GetMaintenanceEventByInstanceRequest.SerializeToString,
                response_deserializer=nebius_dot_compute_dot_v1_dot_maintenance__event__pb2.MaintenanceEvent.FromString,
                )
        self.ListActive = channel.unary_unary(
                '/nebius.compute.v1.MaintenanceService/ListActive',
                request_serializer=nebius_dot_compute_dot_v1_dot_maintenance__service__pb2.ListMaintenanceEventsRequest.SerializeToString,
                response_deserializer=nebius_dot_compute_dot_v1_dot_maintenance__service__pb2.ListMaintenanceEventsResponse.FromString,
                )


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

    def GetByInstance(self, request, context):
        """Returns only active maintenance event for the instance
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ListActive(self, request, context):
        """Returns all unfinished maintenance events for the parent
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_MaintenanceServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'GetByInstance': grpc.unary_unary_rpc_method_handler(
                    servicer.GetByInstance,
                    request_deserializer=nebius_dot_compute_dot_v1_dot_maintenance__service__pb2.GetMaintenanceEventByInstanceRequest.FromString,
                    response_serializer=nebius_dot_compute_dot_v1_dot_maintenance__event__pb2.MaintenanceEvent.SerializeToString,
            ),
            'ListActive': grpc.unary_unary_rpc_method_handler(
                    servicer.ListActive,
                    request_deserializer=nebius_dot_compute_dot_v1_dot_maintenance__service__pb2.ListMaintenanceEventsRequest.FromString,
                    response_serializer=nebius_dot_compute_dot_v1_dot_maintenance__service__pb2.ListMaintenanceEventsResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'nebius.compute.v1.MaintenanceService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


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

    @staticmethod
    def GetByInstance(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, '/nebius.compute.v1.MaintenanceService/GetByInstance',
            nebius_dot_compute_dot_v1_dot_maintenance__service__pb2.GetMaintenanceEventByInstanceRequest.SerializeToString,
            nebius_dot_compute_dot_v1_dot_maintenance__event__pb2.MaintenanceEvent.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def ListActive(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, '/nebius.compute.v1.MaintenanceService/ListActive',
            nebius_dot_compute_dot_v1_dot_maintenance__service__pb2.ListMaintenanceEventsRequest.SerializeToString,
            nebius_dot_compute_dot_v1_dot_maintenance__service__pb2.ListMaintenanceEventsResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
