# 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 origin_pb2 as yandex_dot_cloud_dot_cdn_dot_v1_dot_origin__pb2
from yandex.cloud.cdn.v1 import origin_service_pb2 as yandex_dot_cloud_dot_cdn_dot_v1_dot_origin__service__pb2
from yandex.cloud.operation import operation_pb2 as yandex_dot_cloud_dot_operation_dot_operation__pb2


class OriginServiceStub(object):
    """
    Origin management service.
    Origin is not a standalone entity. It can live only within origin group.

    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.Get = channel.unary_unary(
                '/yandex.cloud.cdn.v1.OriginService/Get',
                request_serializer=yandex_dot_cloud_dot_cdn_dot_v1_dot_origin__service__pb2.GetOriginRequest.SerializeToString,
                response_deserializer=yandex_dot_cloud_dot_cdn_dot_v1_dot_origin__pb2.Origin.FromString,
                )
        self.List = channel.unary_unary(
                '/yandex.cloud.cdn.v1.OriginService/List',
                request_serializer=yandex_dot_cloud_dot_cdn_dot_v1_dot_origin__service__pb2.ListOriginsRequest.SerializeToString,
                response_deserializer=yandex_dot_cloud_dot_cdn_dot_v1_dot_origin__service__pb2.ListOriginsResponse.FromString,
                )
        self.Create = channel.unary_unary(
                '/yandex.cloud.cdn.v1.OriginService/Create',
                request_serializer=yandex_dot_cloud_dot_cdn_dot_v1_dot_origin__service__pb2.CreateOriginRequest.SerializeToString,
                response_deserializer=yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.FromString,
                )
        self.Update = channel.unary_unary(
                '/yandex.cloud.cdn.v1.OriginService/Update',
                request_serializer=yandex_dot_cloud_dot_cdn_dot_v1_dot_origin__service__pb2.UpdateOriginRequest.SerializeToString,
                response_deserializer=yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.FromString,
                )
        self.Delete = channel.unary_unary(
                '/yandex.cloud.cdn.v1.OriginService/Delete',
                request_serializer=yandex_dot_cloud_dot_cdn_dot_v1_dot_origin__service__pb2.DeleteOriginRequest.SerializeToString,
                response_deserializer=yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.FromString,
                )


class OriginServiceServicer(object):
    """
    Origin management service.
    Origin is not a standalone entity. It can live only within origin group.

    """

    def Get(self, request, context):
        """Get origin in origin group.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

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

    def Create(self, request, context):
        """Creates origin inside origin group.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Update(self, request, context):
        """Updates the specified origin from the origin group.

        Changes may take up to 15 minutes to apply. Afterwards, it is recommended to purge cache of the resources that
        use the origin via a [CacheService.Purge] request.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Delete(self, request, context):
        """Deletes origin from origin group.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_OriginServiceServicer_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_origin__service__pb2.GetOriginRequest.FromString,
                    response_serializer=yandex_dot_cloud_dot_cdn_dot_v1_dot_origin__pb2.Origin.SerializeToString,
            ),
            'List': grpc.unary_unary_rpc_method_handler(
                    servicer.List,
                    request_deserializer=yandex_dot_cloud_dot_cdn_dot_v1_dot_origin__service__pb2.ListOriginsRequest.FromString,
                    response_serializer=yandex_dot_cloud_dot_cdn_dot_v1_dot_origin__service__pb2.ListOriginsResponse.SerializeToString,
            ),
            'Create': grpc.unary_unary_rpc_method_handler(
                    servicer.Create,
                    request_deserializer=yandex_dot_cloud_dot_cdn_dot_v1_dot_origin__service__pb2.CreateOriginRequest.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_origin__service__pb2.UpdateOriginRequest.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_origin__service__pb2.DeleteOriginRequest.FromString,
                    response_serializer=yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'yandex.cloud.cdn.v1.OriginService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class OriginService(object):
    """
    Origin management service.
    Origin is not a standalone entity. It can live only within origin group.

    """

    @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.OriginService/Get',
            yandex_dot_cloud_dot_cdn_dot_v1_dot_origin__service__pb2.GetOriginRequest.SerializeToString,
            yandex_dot_cloud_dot_cdn_dot_v1_dot_origin__pb2.Origin.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.OriginService/List',
            yandex_dot_cloud_dot_cdn_dot_v1_dot_origin__service__pb2.ListOriginsRequest.SerializeToString,
            yandex_dot_cloud_dot_cdn_dot_v1_dot_origin__service__pb2.ListOriginsResponse.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.OriginService/Create',
            yandex_dot_cloud_dot_cdn_dot_v1_dot_origin__service__pb2.CreateOriginRequest.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.OriginService/Update',
            yandex_dot_cloud_dot_cdn_dot_v1_dot_origin__service__pb2.UpdateOriginRequest.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.OriginService/Delete',
            yandex_dot_cloud_dot_cdn_dot_v1_dot_origin__service__pb2.DeleteOriginRequest.SerializeToString,
            yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
