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

from dialogflow_v2beta1.proto import (
    knowledge_base_pb2 as google_dot_cloud_dot_dialogflow__v2beta1_dot_proto_dot_knowledge__base__pb2,
)
from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2


class KnowledgeBasesStub(object):
    """Service for managing [KnowledgeBases][google.cloud.dialogflow.v2beta1.KnowledgeBase].
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.ListKnowledgeBases = channel.unary_unary(
            "/google.cloud.dialogflow.v2beta1.KnowledgeBases/ListKnowledgeBases",
            request_serializer=google_dot_cloud_dot_dialogflow__v2beta1_dot_proto_dot_knowledge__base__pb2.ListKnowledgeBasesRequest.SerializeToString,
            response_deserializer=google_dot_cloud_dot_dialogflow__v2beta1_dot_proto_dot_knowledge__base__pb2.ListKnowledgeBasesResponse.FromString,
        )
        self.GetKnowledgeBase = channel.unary_unary(
            "/google.cloud.dialogflow.v2beta1.KnowledgeBases/GetKnowledgeBase",
            request_serializer=google_dot_cloud_dot_dialogflow__v2beta1_dot_proto_dot_knowledge__base__pb2.GetKnowledgeBaseRequest.SerializeToString,
            response_deserializer=google_dot_cloud_dot_dialogflow__v2beta1_dot_proto_dot_knowledge__base__pb2.KnowledgeBase.FromString,
        )
        self.CreateKnowledgeBase = channel.unary_unary(
            "/google.cloud.dialogflow.v2beta1.KnowledgeBases/CreateKnowledgeBase",
            request_serializer=google_dot_cloud_dot_dialogflow__v2beta1_dot_proto_dot_knowledge__base__pb2.CreateKnowledgeBaseRequest.SerializeToString,
            response_deserializer=google_dot_cloud_dot_dialogflow__v2beta1_dot_proto_dot_knowledge__base__pb2.KnowledgeBase.FromString,
        )
        self.DeleteKnowledgeBase = channel.unary_unary(
            "/google.cloud.dialogflow.v2beta1.KnowledgeBases/DeleteKnowledgeBase",
            request_serializer=google_dot_cloud_dot_dialogflow__v2beta1_dot_proto_dot_knowledge__base__pb2.DeleteKnowledgeBaseRequest.SerializeToString,
            response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
        )
        self.UpdateKnowledgeBase = channel.unary_unary(
            "/google.cloud.dialogflow.v2beta1.KnowledgeBases/UpdateKnowledgeBase",
            request_serializer=google_dot_cloud_dot_dialogflow__v2beta1_dot_proto_dot_knowledge__base__pb2.UpdateKnowledgeBaseRequest.SerializeToString,
            response_deserializer=google_dot_cloud_dot_dialogflow__v2beta1_dot_proto_dot_knowledge__base__pb2.KnowledgeBase.FromString,
        )


class KnowledgeBasesServicer(object):
    """Service for managing [KnowledgeBases][google.cloud.dialogflow.v2beta1.KnowledgeBase].
    """

    def ListKnowledgeBases(self, request, context):
        """Returns the list of all knowledge bases of the specified agent.

        Note: The `projects.agent.knowledgeBases` resource is deprecated;
        only use `projects.knowledgeBases`.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def GetKnowledgeBase(self, request, context):
        """Retrieves the specified knowledge base.

        Note: The `projects.agent.knowledgeBases` resource is deprecated;
        only use `projects.knowledgeBases`.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def CreateKnowledgeBase(self, request, context):
        """Creates a knowledge base.

        Note: The `projects.agent.knowledgeBases` resource is deprecated;
        only use `projects.knowledgeBases`.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def DeleteKnowledgeBase(self, request, context):
        """Deletes the specified knowledge base.

        Note: The `projects.agent.knowledgeBases` resource is deprecated;
        only use `projects.knowledgeBases`.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def UpdateKnowledgeBase(self, request, context):
        """Updates the specified knowledge base.

        Note: The `projects.agent.knowledgeBases` resource is deprecated;
        only use `projects.knowledgeBases`.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")


def add_KnowledgeBasesServicer_to_server(servicer, server):
    rpc_method_handlers = {
        "ListKnowledgeBases": grpc.unary_unary_rpc_method_handler(
            servicer.ListKnowledgeBases,
            request_deserializer=google_dot_cloud_dot_dialogflow__v2beta1_dot_proto_dot_knowledge__base__pb2.ListKnowledgeBasesRequest.FromString,
            response_serializer=google_dot_cloud_dot_dialogflow__v2beta1_dot_proto_dot_knowledge__base__pb2.ListKnowledgeBasesResponse.SerializeToString,
        ),
        "GetKnowledgeBase": grpc.unary_unary_rpc_method_handler(
            servicer.GetKnowledgeBase,
            request_deserializer=google_dot_cloud_dot_dialogflow__v2beta1_dot_proto_dot_knowledge__base__pb2.GetKnowledgeBaseRequest.FromString,
            response_serializer=google_dot_cloud_dot_dialogflow__v2beta1_dot_proto_dot_knowledge__base__pb2.KnowledgeBase.SerializeToString,
        ),
        "CreateKnowledgeBase": grpc.unary_unary_rpc_method_handler(
            servicer.CreateKnowledgeBase,
            request_deserializer=google_dot_cloud_dot_dialogflow__v2beta1_dot_proto_dot_knowledge__base__pb2.CreateKnowledgeBaseRequest.FromString,
            response_serializer=google_dot_cloud_dot_dialogflow__v2beta1_dot_proto_dot_knowledge__base__pb2.KnowledgeBase.SerializeToString,
        ),
        "DeleteKnowledgeBase": grpc.unary_unary_rpc_method_handler(
            servicer.DeleteKnowledgeBase,
            request_deserializer=google_dot_cloud_dot_dialogflow__v2beta1_dot_proto_dot_knowledge__base__pb2.DeleteKnowledgeBaseRequest.FromString,
            response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
        ),
        "UpdateKnowledgeBase": grpc.unary_unary_rpc_method_handler(
            servicer.UpdateKnowledgeBase,
            request_deserializer=google_dot_cloud_dot_dialogflow__v2beta1_dot_proto_dot_knowledge__base__pb2.UpdateKnowledgeBaseRequest.FromString,
            response_serializer=google_dot_cloud_dot_dialogflow__v2beta1_dot_proto_dot_knowledge__base__pb2.KnowledgeBase.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        "google.cloud.dialogflow.v2beta1.KnowledgeBases", rpc_method_handlers
    )
    server.add_generic_rpc_handlers((generic_handler,))


# This class is part of an EXPERIMENTAL API.
class KnowledgeBases(object):
    """Service for managing [KnowledgeBases][google.cloud.dialogflow.v2beta1.KnowledgeBase].
    """

    @staticmethod
    def ListKnowledgeBases(
        request,
        target,
        options=(),
        channel_credentials=None,
        call_credentials=None,
        compression=None,
        wait_for_ready=None,
        timeout=None,
        metadata=None,
    ):
        return grpc.experimental.unary_unary(
            request,
            target,
            "/google.cloud.dialogflow.v2beta1.KnowledgeBases/ListKnowledgeBases",
            google_dot_cloud_dot_dialogflow__v2beta1_dot_proto_dot_knowledge__base__pb2.ListKnowledgeBasesRequest.SerializeToString,
            google_dot_cloud_dot_dialogflow__v2beta1_dot_proto_dot_knowledge__base__pb2.ListKnowledgeBasesResponse.FromString,
            options,
            channel_credentials,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )

    @staticmethod
    def GetKnowledgeBase(
        request,
        target,
        options=(),
        channel_credentials=None,
        call_credentials=None,
        compression=None,
        wait_for_ready=None,
        timeout=None,
        metadata=None,
    ):
        return grpc.experimental.unary_unary(
            request,
            target,
            "/google.cloud.dialogflow.v2beta1.KnowledgeBases/GetKnowledgeBase",
            google_dot_cloud_dot_dialogflow__v2beta1_dot_proto_dot_knowledge__base__pb2.GetKnowledgeBaseRequest.SerializeToString,
            google_dot_cloud_dot_dialogflow__v2beta1_dot_proto_dot_knowledge__base__pb2.KnowledgeBase.FromString,
            options,
            channel_credentials,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )

    @staticmethod
    def CreateKnowledgeBase(
        request,
        target,
        options=(),
        channel_credentials=None,
        call_credentials=None,
        compression=None,
        wait_for_ready=None,
        timeout=None,
        metadata=None,
    ):
        return grpc.experimental.unary_unary(
            request,
            target,
            "/google.cloud.dialogflow.v2beta1.KnowledgeBases/CreateKnowledgeBase",
            google_dot_cloud_dot_dialogflow__v2beta1_dot_proto_dot_knowledge__base__pb2.CreateKnowledgeBaseRequest.SerializeToString,
            google_dot_cloud_dot_dialogflow__v2beta1_dot_proto_dot_knowledge__base__pb2.KnowledgeBase.FromString,
            options,
            channel_credentials,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )

    @staticmethod
    def DeleteKnowledgeBase(
        request,
        target,
        options=(),
        channel_credentials=None,
        call_credentials=None,
        compression=None,
        wait_for_ready=None,
        timeout=None,
        metadata=None,
    ):
        return grpc.experimental.unary_unary(
            request,
            target,
            "/google.cloud.dialogflow.v2beta1.KnowledgeBases/DeleteKnowledgeBase",
            google_dot_cloud_dot_dialogflow__v2beta1_dot_proto_dot_knowledge__base__pb2.DeleteKnowledgeBaseRequest.SerializeToString,
            google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            options,
            channel_credentials,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )

    @staticmethod
    def UpdateKnowledgeBase(
        request,
        target,
        options=(),
        channel_credentials=None,
        call_credentials=None,
        compression=None,
        wait_for_ready=None,
        timeout=None,
        metadata=None,
    ):
        return grpc.experimental.unary_unary(
            request,
            target,
            "/google.cloud.dialogflow.v2beta1.KnowledgeBases/UpdateKnowledgeBase",
            google_dot_cloud_dot_dialogflow__v2beta1_dot_proto_dot_knowledge__base__pb2.UpdateKnowledgeBaseRequest.SerializeToString,
            google_dot_cloud_dot_dialogflow__v2beta1_dot_proto_dot_knowledge__base__pb2.KnowledgeBase.FromString,
            options,
            channel_credentials,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )
