Class KnowledgebasesImpl

  • All Implemented Interfaces:
    Knowledgebases

    public class KnowledgebasesImpl
    extends Object
    implements Knowledgebases
    An instance of this class provides access to all the operations defined in Knowledgebases.
    • Constructor Detail

      • KnowledgebasesImpl

        public KnowledgebasesImpl​(retrofit2.Retrofit retrofit,
                                  QnAMakerClientImpl client)
        Initializes an instance of KnowledgebasesImpl.
        Parameters:
        retrofit - the Retrofit instance built from a Retrofit Builder.
        client - the instance of the service client containing this operation class.
    • Method Detail

      • listAllAsync

        public com.microsoft.rest.ServiceFuture<KnowledgebasesDTO> listAllAsync​(com.microsoft.rest.ServiceCallback<KnowledgebasesDTO> serviceCallback)
        Gets all knowledgebases for a user.
        Parameters:
        serviceCallback - the async ServiceCallback to handle successful and failed responses.
        Returns:
        the ServiceFuture object
        Throws:
        IllegalArgumentException - thrown if parameters fail the validation
      • listAllWithServiceResponseAsync

        public rx.Observable<com.microsoft.rest.ServiceResponse<KnowledgebasesDTO>> listAllWithServiceResponseAsync()
        Gets all knowledgebases for a user.
        Returns:
        the observable to the KnowledgebasesDTO object
        Throws:
        IllegalArgumentException - thrown if parameters fail the validation
      • getDetailsAsync

        public com.microsoft.rest.ServiceFuture<KnowledgebaseDTO> getDetailsAsync​(String kbId,
                                                                                  com.microsoft.rest.ServiceCallback<KnowledgebaseDTO> serviceCallback)
        Gets details of a specific knowledgebase.
        Parameters:
        kbId - Knowledgebase id.
        serviceCallback - the async ServiceCallback to handle successful and failed responses.
        Returns:
        the ServiceFuture object
        Throws:
        IllegalArgumentException - thrown if parameters fail the validation
      • getDetailsWithServiceResponseAsync

        public rx.Observable<com.microsoft.rest.ServiceResponse<KnowledgebaseDTO>> getDetailsWithServiceResponseAsync​(String kbId)
        Gets details of a specific knowledgebase.
        Parameters:
        kbId - Knowledgebase id.
        Returns:
        the observable to the KnowledgebaseDTO object
        Throws:
        IllegalArgumentException - thrown if parameters fail the validation
      • deleteAsync

        public com.microsoft.rest.ServiceFuture<Void> deleteAsync​(String kbId,
                                                                  com.microsoft.rest.ServiceCallback<Void> serviceCallback)
        Deletes the knowledgebase and all its data.
        Parameters:
        kbId - Knowledgebase id.
        serviceCallback - the async ServiceCallback to handle successful and failed responses.
        Returns:
        the ServiceFuture object
        Throws:
        IllegalArgumentException - thrown if parameters fail the validation
      • deleteAsync

        public rx.Observable<Void> deleteAsync​(String kbId)
        Deletes the knowledgebase and all its data.
        Specified by:
        deleteAsync in interface Knowledgebases
        Parameters:
        kbId - Knowledgebase id.
        Returns:
        the ServiceResponse object if successful.
        Throws:
        IllegalArgumentException - thrown if parameters fail the validation
      • deleteWithServiceResponseAsync

        public rx.Observable<com.microsoft.rest.ServiceResponse<Void>> deleteWithServiceResponseAsync​(String kbId)
        Deletes the knowledgebase and all its data.
        Parameters:
        kbId - Knowledgebase id.
        Returns:
        the ServiceResponse object if successful.
        Throws:
        IllegalArgumentException - thrown if parameters fail the validation
      • publishAsync

        public com.microsoft.rest.ServiceFuture<Void> publishAsync​(String kbId,
                                                                   com.microsoft.rest.ServiceCallback<Void> serviceCallback)
        Publishes all changes in test index of a knowledgebase to its prod index.
        Parameters:
        kbId - Knowledgebase id.
        serviceCallback - the async ServiceCallback to handle successful and failed responses.
        Returns:
        the ServiceFuture object
        Throws:
        IllegalArgumentException - thrown if parameters fail the validation
      • publishAsync

        public rx.Observable<Void> publishAsync​(String kbId)
        Publishes all changes in test index of a knowledgebase to its prod index.
        Specified by:
        publishAsync in interface Knowledgebases
        Parameters:
        kbId - Knowledgebase id.
        Returns:
        the ServiceResponse object if successful.
        Throws:
        IllegalArgumentException - thrown if parameters fail the validation
      • publishWithServiceResponseAsync

        public rx.Observable<com.microsoft.rest.ServiceResponse<Void>> publishWithServiceResponseAsync​(String kbId)
        Publishes all changes in test index of a knowledgebase to its prod index.
        Parameters:
        kbId - Knowledgebase id.
        Returns:
        the ServiceResponse object if successful.
        Throws:
        IllegalArgumentException - thrown if parameters fail the validation
      • replace

        public void replace​(String kbId,
                            List<QnADTO> qnAList)
        Replace knowledgebase contents.
        Specified by:
        replace in interface Knowledgebases
        Parameters:
        kbId - Knowledgebase id.
        qnAList - List of Q-A (QnADTO) to be added to the knowledgebase. Q-A Ids are assigned by the service and should be omitted.
        Throws:
        IllegalArgumentException - thrown if parameters fail the validation
        ErrorResponseException - thrown if the request is rejected by server
        RuntimeException - all other wrapped checked exceptions if the request fails to be sent
      • replaceAsync

        public com.microsoft.rest.ServiceFuture<Void> replaceAsync​(String kbId,
                                                                   List<QnADTO> qnAList,
                                                                   com.microsoft.rest.ServiceCallback<Void> serviceCallback)
        Replace knowledgebase contents.
        Parameters:
        kbId - Knowledgebase id.
        qnAList - List of Q-A (QnADTO) to be added to the knowledgebase. Q-A Ids are assigned by the service and should be omitted.
        serviceCallback - the async ServiceCallback to handle successful and failed responses.
        Returns:
        the ServiceFuture object
        Throws:
        IllegalArgumentException - thrown if parameters fail the validation
      • replaceAsync

        public rx.Observable<Void> replaceAsync​(String kbId,
                                                List<QnADTO> qnAList)
        Replace knowledgebase contents.
        Specified by:
        replaceAsync in interface Knowledgebases
        Parameters:
        kbId - Knowledgebase id.
        qnAList - List of Q-A (QnADTO) to be added to the knowledgebase. Q-A Ids are assigned by the service and should be omitted.
        Returns:
        the ServiceResponse object if successful.
        Throws:
        IllegalArgumentException - thrown if parameters fail the validation
      • replaceWithServiceResponseAsync

        public rx.Observable<com.microsoft.rest.ServiceResponse<Void>> replaceWithServiceResponseAsync​(String kbId,
                                                                                                       List<QnADTO> qnAList)
        Replace knowledgebase contents.
        Parameters:
        kbId - Knowledgebase id.
        qnAList - List of Q-A (QnADTO) to be added to the knowledgebase. Q-A Ids are assigned by the service and should be omitted.
        Returns:
        the ServiceResponse object if successful.
        Throws:
        IllegalArgumentException - thrown if parameters fail the validation
      • updateAsync

        public com.microsoft.rest.ServiceFuture<Operation> updateAsync​(String kbId,
                                                                       UpdateKbOperationDTO updateKb,
                                                                       com.microsoft.rest.ServiceCallback<Operation> serviceCallback)
        Asynchronous operation to modify a knowledgebase.
        Parameters:
        kbId - Knowledgebase id.
        updateKb - Post body of the request.
        serviceCallback - the async ServiceCallback to handle successful and failed responses.
        Returns:
        the ServiceFuture object
        Throws:
        IllegalArgumentException - thrown if parameters fail the validation
      • updateWithServiceResponseAsync

        public rx.Observable<com.microsoft.rest.ServiceResponseWithHeaders<Operation,​KnowledgebaseUpdateHeaders>> updateWithServiceResponseAsync​(String kbId,
                                                                                                                                                       UpdateKbOperationDTO updateKb)
        Asynchronous operation to modify a knowledgebase.
        Parameters:
        kbId - Knowledgebase id.
        updateKb - Post body of the request.
        Returns:
        the observable to the Operation object
        Throws:
        IllegalArgumentException - thrown if parameters fail the validation
      • createAsync

        public com.microsoft.rest.ServiceFuture<Operation> createAsync​(CreateKbDTO createKbPayload,
                                                                       com.microsoft.rest.ServiceCallback<Operation> serviceCallback)
        Asynchronous operation to create a new knowledgebase.
        Parameters:
        createKbPayload - Post body of the request.
        serviceCallback - the async ServiceCallback to handle successful and failed responses.
        Returns:
        the ServiceFuture object
        Throws:
        IllegalArgumentException - thrown if parameters fail the validation
      • createAsync

        public rx.Observable<Operation> createAsync​(CreateKbDTO createKbPayload)
        Asynchronous operation to create a new knowledgebase.
        Specified by:
        createAsync in interface Knowledgebases
        Parameters:
        createKbPayload - Post body of the request.
        Returns:
        the observable to the Operation object
        Throws:
        IllegalArgumentException - thrown if parameters fail the validation
      • createWithServiceResponseAsync

        public rx.Observable<com.microsoft.rest.ServiceResponse<Operation>> createWithServiceResponseAsync​(CreateKbDTO createKbPayload)
        Asynchronous operation to create a new knowledgebase.
        Parameters:
        createKbPayload - Post body of the request.
        Returns:
        the observable to the Operation object
        Throws:
        IllegalArgumentException - thrown if parameters fail the validation
      • download

        public QnADocumentsDTO download​(String kbId,
                                        EnvironmentType environment,
                                        DownloadOptionalParameter downloadOptionalParameter)
        Download the knowledgebase.
        Specified by:
        download in interface Knowledgebases
        Parameters:
        kbId - Knowledgebase id.
        environment - Specifies whether environment is Test or Prod. Possible values include: 'Prod', 'Test'
        downloadOptionalParameter - the object representing the optional parameters to be set before calling this API
        Returns:
        the QnADocumentsDTO object if successful.
        Throws:
        IllegalArgumentException - thrown if parameters fail the validation
        ErrorResponseException - thrown if the request is rejected by server
        RuntimeException - all other wrapped checked exceptions if the request fails to be sent
      • downloadAsync

        public com.microsoft.rest.ServiceFuture<QnADocumentsDTO> downloadAsync​(String kbId,
                                                                               EnvironmentType environment,
                                                                               DownloadOptionalParameter downloadOptionalParameter,
                                                                               com.microsoft.rest.ServiceCallback<QnADocumentsDTO> serviceCallback)
        Download the knowledgebase.
        Parameters:
        kbId - Knowledgebase id.
        environment - Specifies whether environment is Test or Prod. Possible values include: 'Prod', 'Test'
        downloadOptionalParameter - the object representing the optional parameters to be set before calling this API
        serviceCallback - the async ServiceCallback to handle successful and failed responses.
        Returns:
        the ServiceFuture object
        Throws:
        IllegalArgumentException - thrown if parameters fail the validation
      • downloadAsync

        public rx.Observable<QnADocumentsDTO> downloadAsync​(String kbId,
                                                            EnvironmentType environment,
                                                            DownloadOptionalParameter downloadOptionalParameter)
        Download the knowledgebase.
        Specified by:
        downloadAsync in interface Knowledgebases
        Parameters:
        kbId - Knowledgebase id.
        environment - Specifies whether environment is Test or Prod. Possible values include: 'Prod', 'Test'
        downloadOptionalParameter - the object representing the optional parameters to be set before calling this API
        Returns:
        the observable to the QnADocumentsDTO object
        Throws:
        IllegalArgumentException - thrown if parameters fail the validation
      • downloadWithServiceResponseAsync

        public rx.Observable<com.microsoft.rest.ServiceResponse<QnADocumentsDTO>> downloadWithServiceResponseAsync​(String kbId,
                                                                                                                   EnvironmentType environment,
                                                                                                                   DownloadOptionalParameter downloadOptionalParameter)
        Download the knowledgebase.
        Parameters:
        kbId - Knowledgebase id.
        environment - Specifies whether environment is Test or Prod. Possible values include: 'Prod', 'Test'
        downloadOptionalParameter - the object representing the optional parameters to be set before calling this API
        Returns:
        the observable to the QnADocumentsDTO object
        Throws:
        IllegalArgumentException - thrown if parameters fail the validation
      • downloadWithServiceResponseAsync

        public rx.Observable<com.microsoft.rest.ServiceResponse<QnADocumentsDTO>> downloadWithServiceResponseAsync​(String kbId,
                                                                                                                   EnvironmentType environment,
                                                                                                                   String source,
                                                                                                                   String changedSince)
        Download the knowledgebase.
        Parameters:
        kbId - Knowledgebase id.
        environment - Specifies whether environment is Test or Prod. Possible values include: 'Prod', 'Test'
        source - The source property filter to apply.
        changedSince - The last changed status property filter to apply.
        Returns:
        the observable to the QnADocumentsDTO object
        Throws:
        IllegalArgumentException - thrown if parameters fail the validation
      • download

        public com.microsoft.azure.cognitiveservices.knowledge.qnamaker.implementation.KnowledgebasesImpl.KnowledgebasesDownloadParameters download()
        Description copied from interface: Knowledgebases
        Download the knowledgebase.
        Specified by:
        download in interface Knowledgebases
        Returns:
        the first stage of the download call
      • generateAnswerAsync

        public com.microsoft.rest.ServiceFuture<QnASearchResultList> generateAnswerAsync​(String kbId,
                                                                                         QueryDTO generateAnswerPayload,
                                                                                         com.microsoft.rest.ServiceCallback<QnASearchResultList> serviceCallback)
        GenerateAnswer call to query knowledgebase (QnA Maker Managed).
        Parameters:
        kbId - Knowledgebase id.
        generateAnswerPayload - Post body of the request.
        serviceCallback - the async ServiceCallback to handle successful and failed responses.
        Returns:
        the ServiceFuture object
        Throws:
        IllegalArgumentException - thrown if parameters fail the validation
      • generateAnswerAsync

        public rx.Observable<QnASearchResultList> generateAnswerAsync​(String kbId,
                                                                      QueryDTO generateAnswerPayload)
        GenerateAnswer call to query knowledgebase (QnA Maker Managed).
        Specified by:
        generateAnswerAsync in interface Knowledgebases
        Parameters:
        kbId - Knowledgebase id.
        generateAnswerPayload - Post body of the request.
        Returns:
        the observable to the QnASearchResultList object
        Throws:
        IllegalArgumentException - thrown if parameters fail the validation
      • generateAnswerWithServiceResponseAsync

        public rx.Observable<com.microsoft.rest.ServiceResponse<QnASearchResultList>> generateAnswerWithServiceResponseAsync​(String kbId,
                                                                                                                             QueryDTO generateAnswerPayload)
        GenerateAnswer call to query knowledgebase (QnA Maker Managed).
        Parameters:
        kbId - Knowledgebase id.
        generateAnswerPayload - Post body of the request.
        Returns:
        the observable to the QnASearchResultList object
        Throws:
        IllegalArgumentException - thrown if parameters fail the validation
      • train

        public void train​(String kbId,
                          TrainOptionalParameter trainOptionalParameter)
        Train call to add suggestions to knowledgebase (QnAMaker Managed).
        Specified by:
        train in interface Knowledgebases
        Parameters:
        kbId - Knowledgebase id.
        trainOptionalParameter - the object representing the optional parameters to be set before calling this API
        Throws:
        IllegalArgumentException - thrown if parameters fail the validation
        ErrorResponseException - thrown if the request is rejected by server
        RuntimeException - all other wrapped checked exceptions if the request fails to be sent
      • trainAsync

        public com.microsoft.rest.ServiceFuture<Void> trainAsync​(String kbId,
                                                                 TrainOptionalParameter trainOptionalParameter,
                                                                 com.microsoft.rest.ServiceCallback<Void> serviceCallback)
        Train call to add suggestions to knowledgebase (QnAMaker Managed).
        Parameters:
        kbId - Knowledgebase id.
        trainOptionalParameter - the object representing the optional parameters to be set before calling this API
        serviceCallback - the async ServiceCallback to handle successful and failed responses.
        Returns:
        the ServiceFuture object
        Throws:
        IllegalArgumentException - thrown if parameters fail the validation
      • trainAsync

        public rx.Observable<Void> trainAsync​(String kbId,
                                              TrainOptionalParameter trainOptionalParameter)
        Train call to add suggestions to knowledgebase (QnAMaker Managed).
        Specified by:
        trainAsync in interface Knowledgebases
        Parameters:
        kbId - Knowledgebase id.
        trainOptionalParameter - the object representing the optional parameters to be set before calling this API
        Returns:
        the ServiceResponse object if successful.
        Throws:
        IllegalArgumentException - thrown if parameters fail the validation
      • trainWithServiceResponseAsync

        public rx.Observable<com.microsoft.rest.ServiceResponse<Void>> trainWithServiceResponseAsync​(String kbId,
                                                                                                     TrainOptionalParameter trainOptionalParameter)
        Train call to add suggestions to knowledgebase (QnAMaker Managed).
        Parameters:
        kbId - Knowledgebase id.
        trainOptionalParameter - the object representing the optional parameters to be set before calling this API
        Returns:
        the ServiceResponse object if successful.
        Throws:
        IllegalArgumentException - thrown if parameters fail the validation
      • trainWithServiceResponseAsync

        public rx.Observable<com.microsoft.rest.ServiceResponse<Void>> trainWithServiceResponseAsync​(String kbId,
                                                                                                     List<FeedbackRecordDTO> feedbackRecords)
        Train call to add suggestions to knowledgebase (QnAMaker Managed).
        Parameters:
        kbId - Knowledgebase id.
        feedbackRecords - List of feedback records.
        Returns:
        the ServiceResponse object if successful.
        Throws:
        IllegalArgumentException - thrown if parameters fail the validation
      • train

        public com.microsoft.azure.cognitiveservices.knowledge.qnamaker.implementation.KnowledgebasesImpl.KnowledgebasesTrainParameters train()
        Description copied from interface: Knowledgebases
        Train call to add suggestions to knowledgebase (QnAMaker Managed).
        Specified by:
        train in interface Knowledgebases
        Returns:
        the first stage of the train call