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

from yandex.cloud.cdn.v1 import resource_pb2 as yandex_dot_cloud_dot_cdn_dot_v1_dot_resource__pb2
from yandex.cloud.cdn.v1 import resource_service_pb2 as yandex_dot_cloud_dot_cdn_dot_v1_dot_resource__service__pb2
from yandex.cloud.operation import operation_pb2 as yandex_dot_cloud_dot_operation_dot_operation__pb2


class ResourceServiceStub(object):
    """
    Provider's resources management service.

    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.Get = channel.unary_unary(
                '/yandex.cloud.cdn.v1.ResourceService/Get',
                request_serializer=yandex_dot_cloud_dot_cdn_dot_v1_dot_resource__service__pb2.GetResourceRequest.SerializeToString,
                response_deserializer=yandex_dot_cloud_dot_cdn_dot_v1_dot_resource__pb2.Resource.FromString,
                )
        self.List = channel.unary_unary(
                '/yandex.cloud.cdn.v1.ResourceService/List',
                request_serializer=yandex_dot_cloud_dot_cdn_dot_v1_dot_resource__service__pb2.ListResourcesRequest.SerializeToString,
                response_deserializer=yandex_dot_cloud_dot_cdn_dot_v1_dot_resource__service__pb2.ListResourcesResponse.FromString,
                )
        self.Create = channel.unary_unary(
                '/yandex.cloud.cdn.v1.ResourceService/Create',
                request_serializer=yandex_dot_cloud_dot_cdn_dot_v1_dot_resource__service__pb2.CreateResourceRequest.SerializeToString,
                response_deserializer=yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.FromString,
                )
        self.Update = channel.unary_unary(
                '/yandex.cloud.cdn.v1.ResourceService/Update',
                request_serializer=yandex_dot_cloud_dot_cdn_dot_v1_dot_resource__service__pb2.UpdateResourceRequest.SerializeToString,
                response_deserializer=yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.FromString,
                )
        self.Delete = channel.unary_unary(
                '/yandex.cloud.cdn.v1.ResourceService/Delete',
                request_serializer=yandex_dot_cloud_dot_cdn_dot_v1_dot_resource__service__pb2.DeleteResourceRequest.SerializeToString,
                response_deserializer=yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.FromString,
                )
        self.GetProviderCName = channel.unary_unary(
                '/yandex.cloud.cdn.v1.ResourceService/GetProviderCName',
                request_serializer=yandex_dot_cloud_dot_cdn_dot_v1_dot_resource__service__pb2.GetProviderCNameRequest.SerializeToString,
                response_deserializer=yandex_dot_cloud_dot_cdn_dot_v1_dot_resource__service__pb2.GetProviderCNameResponse.FromString,
                )


class ResourceServiceServicer(object):
    """
    Provider's resources management service.

    """

    def Get(self, request, context):
        """Get client's CDN resource by resource id.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def List(self, request, context):
        """Lists CDN resources.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Create(self, request, context):
        """Creates client's CDN resource.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Update(self, request, context):
        """Updates of client's CDN resource. (PATCH behavior)
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Delete(self, request, context):
        """Deletes client's CDN resource.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetProviderCName(self, request, context):
        """Get Provider's CNAME (edge endpoint) binded to specified folder id.
        Returns UNIMPLEMENTED error, if provider doesn't support CNAME request.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_ResourceServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'Get': grpc.unary_unary_rpc_method_handler(
                    servicer.Get,
                    request_deserializer=yandex_dot_cloud_dot_cdn_dot_v1_dot_resource__service__pb2.GetResourceRequest.FromString,
                    response_serializer=yandex_dot_cloud_dot_cdn_dot_v1_dot_resource__pb2.Resource.SerializeToString,
            ),
            'List': grpc.unary_unary_rpc_method_handler(
                    servicer.List,
                    request_deserializer=yandex_dot_cloud_dot_cdn_dot_v1_dot_resource__service__pb2.ListResourcesRequest.FromString,
                    response_serializer=yandex_dot_cloud_dot_cdn_dot_v1_dot_resource__service__pb2.ListResourcesResponse.SerializeToString,
            ),
            'Create': grpc.unary_unary_rpc_method_handler(
                    servicer.Create,
                    request_deserializer=yandex_dot_cloud_dot_cdn_dot_v1_dot_resource__service__pb2.CreateResourceRequest.FromString,
                    response_serializer=yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.SerializeToString,
            ),
            'Update': grpc.unary_unary_rpc_method_handler(
                    servicer.Update,
                    request_deserializer=yandex_dot_cloud_dot_cdn_dot_v1_dot_resource__service__pb2.UpdateResourceRequest.FromString,
                    response_serializer=yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.SerializeToString,
            ),
            'Delete': grpc.unary_unary_rpc_method_handler(
                    servicer.Delete,
                    request_deserializer=yandex_dot_cloud_dot_cdn_dot_v1_dot_resource__service__pb2.DeleteResourceRequest.FromString,
                    response_serializer=yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.SerializeToString,
            ),
            'GetProviderCName': grpc.unary_unary_rpc_method_handler(
                    servicer.GetProviderCName,
                    request_deserializer=yandex_dot_cloud_dot_cdn_dot_v1_dot_resource__service__pb2.GetProviderCNameRequest.FromString,
                    response_serializer=yandex_dot_cloud_dot_cdn_dot_v1_dot_resource__service__pb2.GetProviderCNameResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'yandex.cloud.cdn.v1.ResourceService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class ResourceService(object):
    """
    Provider's resources management service.

    """

    @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.ResourceService/Get',
            yandex_dot_cloud_dot_cdn_dot_v1_dot_resource__service__pb2.GetResourceRequest.SerializeToString,
            yandex_dot_cloud_dot_cdn_dot_v1_dot_resource__pb2.Resource.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def List(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.ResourceService/List',
            yandex_dot_cloud_dot_cdn_dot_v1_dot_resource__service__pb2.ListResourcesRequest.SerializeToString,
            yandex_dot_cloud_dot_cdn_dot_v1_dot_resource__service__pb2.ListResourcesResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def Create(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.ResourceService/Create',
            yandex_dot_cloud_dot_cdn_dot_v1_dot_resource__service__pb2.CreateResourceRequest.SerializeToString,
            yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @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.ResourceService/Update',
            yandex_dot_cloud_dot_cdn_dot_v1_dot_resource__service__pb2.UpdateResourceRequest.SerializeToString,
            yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def Delete(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.ResourceService/Delete',
            yandex_dot_cloud_dot_cdn_dot_v1_dot_resource__service__pb2.DeleteResourceRequest.SerializeToString,
            yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def GetProviderCName(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.ResourceService/GetProviderCName',
            yandex_dot_cloud_dot_cdn_dot_v1_dot_resource__service__pb2.GetProviderCNameRequest.SerializeToString,
            yandex_dot_cloud_dot_cdn_dot_v1_dot_resource__service__pb2.GetProviderCNameResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
