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

from chromiumos.longrunning import operations_pb2 as chromiumos_dot_longrunning_dot_operations__pb2
from chromiumos.test.api import cros_publish_service_pb2 as chromiumos_dot_test_dot_api_dot_cros__publish__service__pb2


class GenericPublishServiceStub(object):
    """Generic publishing interface for CFT. Intended to be interchangeable across
    services
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.Publish = channel.unary_unary(
                '/chromiumos.test.api.GenericPublishService/Publish',
                request_serializer=chromiumos_dot_test_dot_api_dot_cros__publish__service__pb2.PublishRequest.SerializeToString,
                response_deserializer=chromiumos_dot_longrunning_dot_operations__pb2.Operation.FromString,
                )


class GenericPublishServiceServicer(object):
    """Generic publishing interface for CFT. Intended to be interchangeable across
    services
    """

    def Publish(self, request, context):
        """Publish publishes test results to a specific endpoint.
        It is intended to be a generic publish grpc that may be
        used by all endpoints.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_GenericPublishServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'Publish': grpc.unary_unary_rpc_method_handler(
                    servicer.Publish,
                    request_deserializer=chromiumos_dot_test_dot_api_dot_cros__publish__service__pb2.PublishRequest.FromString,
                    response_serializer=chromiumos_dot_longrunning_dot_operations__pb2.Operation.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'chromiumos.test.api.GenericPublishService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class GenericPublishService(object):
    """Generic publishing interface for CFT. Intended to be interchangeable across
    services
    """

    @staticmethod
    def Publish(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, '/chromiumos.test.api.GenericPublishService/Publish',
            chromiumos_dot_test_dot_api_dot_cros__publish__service__pb2.PublishRequest.SerializeToString,
            chromiumos_dot_longrunning_dot_operations__pb2.Operation.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
