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

from yandex.cloud.cdn.v1 import shielding_pb2 as yandex_dot_cloud_dot_cdn_dot_v1_dot_shielding__pb2
from yandex.cloud.cdn.v1 import shielding_service_pb2 as yandex_dot_cloud_dot_cdn_dot_v1_dot_shielding__service__pb2
from yandex.cloud.operation import operation_pb2 as yandex_dot_cloud_dot_operation_dot_operation__pb2

GRPC_GENERATED_VERSION = '1.70.0'
GRPC_VERSION = grpc.__version__
_version_not_supported = False

try:
    from grpc._utilities import first_version_is_lower
    _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
except ImportError:
    _version_not_supported = True

if _version_not_supported:
    raise RuntimeError(
        f'The grpc package installed is at version {GRPC_VERSION},'
        + f' but the generated code in yandex/cloud/cdn/v1/shielding_service_pb2_grpc.py depends on'
        + f' grpcio>={GRPC_GENERATED_VERSION}.'
        + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
        + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
    )


class ShieldingServiceStub(object):
    """Shielding management service.
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.Activate = channel.unary_unary(
                '/yandex.cloud.cdn.v1.ShieldingService/Activate',
                request_serializer=yandex_dot_cloud_dot_cdn_dot_v1_dot_shielding__service__pb2.ActivateShieldingRequest.SerializeToString,
                response_deserializer=yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.FromString,
                _registered_method=True)
        self.Deactivate = channel.unary_unary(
                '/yandex.cloud.cdn.v1.ShieldingService/Deactivate',
                request_serializer=yandex_dot_cloud_dot_cdn_dot_v1_dot_shielding__service__pb2.DeactivateShieldingRequest.SerializeToString,
                response_deserializer=yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.FromString,
                _registered_method=True)
        self.Get = channel.unary_unary(
                '/yandex.cloud.cdn.v1.ShieldingService/Get',
                request_serializer=yandex_dot_cloud_dot_cdn_dot_v1_dot_shielding__service__pb2.GetShieldingDetailsRequest.SerializeToString,
                response_deserializer=yandex_dot_cloud_dot_cdn_dot_v1_dot_shielding__pb2.ShieldingDetails.FromString,
                _registered_method=True)
        self.Update = channel.unary_unary(
                '/yandex.cloud.cdn.v1.ShieldingService/Update',
                request_serializer=yandex_dot_cloud_dot_cdn_dot_v1_dot_shielding__service__pb2.UpdateShieldingRequest.SerializeToString,
                response_deserializer=yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.FromString,
                _registered_method=True)
        self.ListAvailableLocations = channel.unary_unary(
                '/yandex.cloud.cdn.v1.ShieldingService/ListAvailableLocations',
                request_serializer=yandex_dot_cloud_dot_cdn_dot_v1_dot_shielding__service__pb2.ListShieldingLocationsRequest.SerializeToString,
                response_deserializer=yandex_dot_cloud_dot_cdn_dot_v1_dot_shielding__service__pb2.ListShieldingLocationsResponse.FromString,
                _registered_method=True)


class ShieldingServiceServicer(object):
    """Shielding management service.
    """

    def Activate(self, request, context):
        """Activate shielding for a resource.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Deactivate(self, request, context):
        """Deactivate shielding for a resource.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Get(self, request, context):
        """Get shielding details by resource ID.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Update(self, request, context):
        """Updates shielding parameters for a resource, such as changing the geographical location of the shielding server.
        Changes may take up to 15 minutes to propagate across CDN servers.
        After updating, it is recommended to purge the resource's cache.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ListAvailableLocations(self, request, context):
        """Lists available geographical locations.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_ShieldingServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'Activate': grpc.unary_unary_rpc_method_handler(
                    servicer.Activate,
                    request_deserializer=yandex_dot_cloud_dot_cdn_dot_v1_dot_shielding__service__pb2.ActivateShieldingRequest.FromString,
                    response_serializer=yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.SerializeToString,
            ),
            'Deactivate': grpc.unary_unary_rpc_method_handler(
                    servicer.Deactivate,
                    request_deserializer=yandex_dot_cloud_dot_cdn_dot_v1_dot_shielding__service__pb2.DeactivateShieldingRequest.FromString,
                    response_serializer=yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.SerializeToString,
            ),
            'Get': grpc.unary_unary_rpc_method_handler(
                    servicer.Get,
                    request_deserializer=yandex_dot_cloud_dot_cdn_dot_v1_dot_shielding__service__pb2.GetShieldingDetailsRequest.FromString,
                    response_serializer=yandex_dot_cloud_dot_cdn_dot_v1_dot_shielding__pb2.ShieldingDetails.SerializeToString,
            ),
            'Update': grpc.unary_unary_rpc_method_handler(
                    servicer.Update,
                    request_deserializer=yandex_dot_cloud_dot_cdn_dot_v1_dot_shielding__service__pb2.UpdateShieldingRequest.FromString,
                    response_serializer=yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.SerializeToString,
            ),
            'ListAvailableLocations': grpc.unary_unary_rpc_method_handler(
                    servicer.ListAvailableLocations,
                    request_deserializer=yandex_dot_cloud_dot_cdn_dot_v1_dot_shielding__service__pb2.ListShieldingLocationsRequest.FromString,
                    response_serializer=yandex_dot_cloud_dot_cdn_dot_v1_dot_shielding__service__pb2.ListShieldingLocationsResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'yandex.cloud.cdn.v1.ShieldingService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('yandex.cloud.cdn.v1.ShieldingService', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class ShieldingService(object):
    """Shielding management service.
    """

    @staticmethod
    def Activate(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,
            '/yandex.cloud.cdn.v1.ShieldingService/Activate',
            yandex_dot_cloud_dot_cdn_dot_v1_dot_shielding__service__pb2.ActivateShieldingRequest.SerializeToString,
            yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def Deactivate(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,
            '/yandex.cloud.cdn.v1.ShieldingService/Deactivate',
            yandex_dot_cloud_dot_cdn_dot_v1_dot_shielding__service__pb2.DeactivateShieldingRequest.SerializeToString,
            yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def Get(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,
            '/yandex.cloud.cdn.v1.ShieldingService/Get',
            yandex_dot_cloud_dot_cdn_dot_v1_dot_shielding__service__pb2.GetShieldingDetailsRequest.SerializeToString,
            yandex_dot_cloud_dot_cdn_dot_v1_dot_shielding__pb2.ShieldingDetails.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def Update(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,
            '/yandex.cloud.cdn.v1.ShieldingService/Update',
            yandex_dot_cloud_dot_cdn_dot_v1_dot_shielding__service__pb2.UpdateShieldingRequest.SerializeToString,
            yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ListAvailableLocations(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,
            '/yandex.cloud.cdn.v1.ShieldingService/ListAvailableLocations',
            yandex_dot_cloud_dot_cdn_dot_v1_dot_shielding__service__pb2.ListShieldingLocationsRequest.SerializeToString,
            yandex_dot_cloud_dot_cdn_dot_v1_dot_shielding__service__pb2.ListShieldingLocationsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
