=begin PureCloud Platform API With the PureCloud Platform API, you can control all aspects of your PureCloud environment. With the APIs you can access the system configuration, manage conversations and more. OpenAPI spec version: v2 Contact: DeveloperEvangelists@genesys.com Generated by: https://github.com/swagger-api/swagger-codegen.git License: UNLICENSED https://help.mypurecloud.com/articles/terms-and-conditions/ Terms of Service: https://help.mypurecloud.com/articles/terms-and-conditions/ =end require "uri" module PureCloud class KnowledgeApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # Delete knowledge base # # @param knowledge_base_id Knowledge base ID # @param [Hash] opts the optional parameters # @return [KnowledgeBase] def delete_knowledge_knowledgebase(knowledge_base_id, opts = {}) data, _status_code, _headers = delete_knowledge_knowledgebase_with_http_info(knowledge_base_id, opts) return data end # Delete knowledge base # # @param knowledge_base_id Knowledge base ID # @param [Hash] opts the optional parameters # @return [Array<(KnowledgeBase, Fixnum, Hash)>] KnowledgeBase data, response status code and response headers def delete_knowledge_knowledgebase_with_http_info(knowledge_base_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: KnowledgeApi.delete_knowledge_knowledgebase ..." end # verify the required parameter 'knowledge_base_id' is set fail ArgumentError, "Missing the required parameter 'knowledge_base_id' when calling KnowledgeApi.delete_knowledge_knowledgebase" if knowledge_base_id.nil? # resource path local_var_path = "/api/v2/knowledge/knowledgebases/{knowledgeBaseId}".sub('{format}','json').sub('{' + 'knowledgeBaseId' + '}', knowledge_base_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud OAuth'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'KnowledgeBase') if @api_client.config.debugging @api_client.config.logger.debug "API called: KnowledgeApi#delete_knowledge_knowledgebase\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete category # # @param category_id Category ID # @param knowledge_base_id Knowledge base ID # @param language_code Language code, format: iso2-LOCALE # @param [Hash] opts the optional parameters # @return [KnowledgeCategory] def delete_knowledge_knowledgebase_language_category(category_id, knowledge_base_id, language_code, opts = {}) data, _status_code, _headers = delete_knowledge_knowledgebase_language_category_with_http_info(category_id, knowledge_base_id, language_code, opts) return data end # Delete category # # @param category_id Category ID # @param knowledge_base_id Knowledge base ID # @param language_code Language code, format: iso2-LOCALE # @param [Hash] opts the optional parameters # @return [Array<(KnowledgeCategory, Fixnum, Hash)>] KnowledgeCategory data, response status code and response headers def delete_knowledge_knowledgebase_language_category_with_http_info(category_id, knowledge_base_id, language_code, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: KnowledgeApi.delete_knowledge_knowledgebase_language_category ..." end # verify the required parameter 'category_id' is set fail ArgumentError, "Missing the required parameter 'category_id' when calling KnowledgeApi.delete_knowledge_knowledgebase_language_category" if category_id.nil? # verify the required parameter 'knowledge_base_id' is set fail ArgumentError, "Missing the required parameter 'knowledge_base_id' when calling KnowledgeApi.delete_knowledge_knowledgebase_language_category" if knowledge_base_id.nil? # verify the required parameter 'language_code' is set fail ArgumentError, "Missing the required parameter 'language_code' when calling KnowledgeApi.delete_knowledge_knowledgebase_language_category" if language_code.nil? # verify enum value unless ['en-US'].include?(language_code) fail ArgumentError, "invalid value for 'language_code', must be one of en-US" end # resource path local_var_path = "/api/v2/knowledge/knowledgebases/{knowledgeBaseId}/languages/{languageCode}/categories/{categoryId}".sub('{format}','json').sub('{' + 'categoryId' + '}', category_id.to_s).sub('{' + 'knowledgeBaseId' + '}', knowledge_base_id.to_s).sub('{' + 'languageCode' + '}', language_code.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud OAuth'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'KnowledgeCategory') if @api_client.config.debugging @api_client.config.logger.debug "API called: KnowledgeApi#delete_knowledge_knowledgebase_language_category\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete document # # @param document_id Document ID # @param knowledge_base_id Knowledge base ID # @param language_code Language code, format: iso2-LOCALE # @param [Hash] opts the optional parameters # @return [KnowledgeDocument] def delete_knowledge_knowledgebase_language_document(document_id, knowledge_base_id, language_code, opts = {}) data, _status_code, _headers = delete_knowledge_knowledgebase_language_document_with_http_info(document_id, knowledge_base_id, language_code, opts) return data end # Delete document # # @param document_id Document ID # @param knowledge_base_id Knowledge base ID # @param language_code Language code, format: iso2-LOCALE # @param [Hash] opts the optional parameters # @return [Array<(KnowledgeDocument, Fixnum, Hash)>] KnowledgeDocument data, response status code and response headers def delete_knowledge_knowledgebase_language_document_with_http_info(document_id, knowledge_base_id, language_code, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: KnowledgeApi.delete_knowledge_knowledgebase_language_document ..." end # verify the required parameter 'document_id' is set fail ArgumentError, "Missing the required parameter 'document_id' when calling KnowledgeApi.delete_knowledge_knowledgebase_language_document" if document_id.nil? # verify the required parameter 'knowledge_base_id' is set fail ArgumentError, "Missing the required parameter 'knowledge_base_id' when calling KnowledgeApi.delete_knowledge_knowledgebase_language_document" if knowledge_base_id.nil? # verify the required parameter 'language_code' is set fail ArgumentError, "Missing the required parameter 'language_code' when calling KnowledgeApi.delete_knowledge_knowledgebase_language_document" if language_code.nil? # verify enum value unless ['en-US'].include?(language_code) fail ArgumentError, "invalid value for 'language_code', must be one of en-US" end # resource path local_var_path = "/api/v2/knowledge/knowledgebases/{knowledgeBaseId}/languages/{languageCode}/documents/{documentId}".sub('{format}','json').sub('{' + 'documentId' + '}', document_id.to_s).sub('{' + 'knowledgeBaseId' + '}', knowledge_base_id.to_s).sub('{' + 'languageCode' + '}', language_code.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud OAuth'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'KnowledgeDocument') if @api_client.config.debugging @api_client.config.logger.debug "API called: KnowledgeApi#delete_knowledge_knowledgebase_language_document\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get knowledge base # # @param knowledge_base_id Knowledge base ID # @param [Hash] opts the optional parameters # @return [KnowledgeBase] def get_knowledge_knowledgebase(knowledge_base_id, opts = {}) data, _status_code, _headers = get_knowledge_knowledgebase_with_http_info(knowledge_base_id, opts) return data end # Get knowledge base # # @param knowledge_base_id Knowledge base ID # @param [Hash] opts the optional parameters # @return [Array<(KnowledgeBase, Fixnum, Hash)>] KnowledgeBase data, response status code and response headers def get_knowledge_knowledgebase_with_http_info(knowledge_base_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: KnowledgeApi.get_knowledge_knowledgebase ..." end # verify the required parameter 'knowledge_base_id' is set fail ArgumentError, "Missing the required parameter 'knowledge_base_id' when calling KnowledgeApi.get_knowledge_knowledgebase" if knowledge_base_id.nil? # resource path local_var_path = "/api/v2/knowledge/knowledgebases/{knowledgeBaseId}".sub('{format}','json').sub('{' + 'knowledgeBaseId' + '}', knowledge_base_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud OAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'KnowledgeBase') if @api_client.config.debugging @api_client.config.logger.debug "API called: KnowledgeApi#get_knowledge_knowledgebase\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get categories # # @param knowledge_base_id Knowledge base ID # @param language_code Language code, format: iso2-LOCALE # @param [Hash] opts the optional parameters # @option opts [String] :before The cursor that points to the start of the set of entities that has been returned. # @option opts [String] :after The cursor that points to the end of the set of entities that has been returned. # @option opts [String] :limit Number of entities to return. Maximum of 200. # @option opts [String] :page_size Number of entities to return. Maximum of 200. # @return [CategoryListing] def get_knowledge_knowledgebase_language_categories(knowledge_base_id, language_code, opts = {}) data, _status_code, _headers = get_knowledge_knowledgebase_language_categories_with_http_info(knowledge_base_id, language_code, opts) return data end # Get categories # # @param knowledge_base_id Knowledge base ID # @param language_code Language code, format: iso2-LOCALE # @param [Hash] opts the optional parameters # @option opts [String] :before The cursor that points to the start of the set of entities that has been returned. # @option opts [String] :after The cursor that points to the end of the set of entities that has been returned. # @option opts [String] :limit Number of entities to return. Maximum of 200. # @option opts [String] :page_size Number of entities to return. Maximum of 200. # @return [Array<(CategoryListing, Fixnum, Hash)>] CategoryListing data, response status code and response headers def get_knowledge_knowledgebase_language_categories_with_http_info(knowledge_base_id, language_code, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: KnowledgeApi.get_knowledge_knowledgebase_language_categories ..." end # verify the required parameter 'knowledge_base_id' is set fail ArgumentError, "Missing the required parameter 'knowledge_base_id' when calling KnowledgeApi.get_knowledge_knowledgebase_language_categories" if knowledge_base_id.nil? # verify the required parameter 'language_code' is set fail ArgumentError, "Missing the required parameter 'language_code' when calling KnowledgeApi.get_knowledge_knowledgebase_language_categories" if language_code.nil? # verify enum value unless ['en-US'].include?(language_code) fail ArgumentError, "invalid value for 'language_code', must be one of en-US" end # resource path local_var_path = "/api/v2/knowledge/knowledgebases/{knowledgeBaseId}/languages/{languageCode}/categories".sub('{format}','json').sub('{' + 'knowledgeBaseId' + '}', knowledge_base_id.to_s).sub('{' + 'languageCode' + '}', language_code.to_s) # query parameters query_params = {} query_params[:'before'] = opts[:'before'] if opts[:'before'] query_params[:'after'] = opts[:'after'] if opts[:'after'] query_params[:'limit'] = opts[:'limit'] if opts[:'limit'] query_params[:'pageSize'] = opts[:'page_size'] if opts[:'page_size'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud OAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'CategoryListing') if @api_client.config.debugging @api_client.config.logger.debug "API called: KnowledgeApi#get_knowledge_knowledgebase_language_categories\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get category # # @param category_id Category ID # @param knowledge_base_id Knowledge base ID # @param language_code Language code, format: iso2-LOCALE # @param [Hash] opts the optional parameters # @return [KnowledgeExtendedCategory] def get_knowledge_knowledgebase_language_category(category_id, knowledge_base_id, language_code, opts = {}) data, _status_code, _headers = get_knowledge_knowledgebase_language_category_with_http_info(category_id, knowledge_base_id, language_code, opts) return data end # Get category # # @param category_id Category ID # @param knowledge_base_id Knowledge base ID # @param language_code Language code, format: iso2-LOCALE # @param [Hash] opts the optional parameters # @return [Array<(KnowledgeExtendedCategory, Fixnum, Hash)>] KnowledgeExtendedCategory data, response status code and response headers def get_knowledge_knowledgebase_language_category_with_http_info(category_id, knowledge_base_id, language_code, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: KnowledgeApi.get_knowledge_knowledgebase_language_category ..." end # verify the required parameter 'category_id' is set fail ArgumentError, "Missing the required parameter 'category_id' when calling KnowledgeApi.get_knowledge_knowledgebase_language_category" if category_id.nil? # verify the required parameter 'knowledge_base_id' is set fail ArgumentError, "Missing the required parameter 'knowledge_base_id' when calling KnowledgeApi.get_knowledge_knowledgebase_language_category" if knowledge_base_id.nil? # verify the required parameter 'language_code' is set fail ArgumentError, "Missing the required parameter 'language_code' when calling KnowledgeApi.get_knowledge_knowledgebase_language_category" if language_code.nil? # verify enum value unless ['en-US'].include?(language_code) fail ArgumentError, "invalid value for 'language_code', must be one of en-US" end # resource path local_var_path = "/api/v2/knowledge/knowledgebases/{knowledgeBaseId}/languages/{languageCode}/categories/{categoryId}".sub('{format}','json').sub('{' + 'categoryId' + '}', category_id.to_s).sub('{' + 'knowledgeBaseId' + '}', knowledge_base_id.to_s).sub('{' + 'languageCode' + '}', language_code.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud OAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'KnowledgeExtendedCategory') if @api_client.config.debugging @api_client.config.logger.debug "API called: KnowledgeApi#get_knowledge_knowledgebase_language_category\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get document # # @param document_id Document ID # @param knowledge_base_id Knowledge base ID # @param language_code Language code, format: iso2-LOCALE # @param [Hash] opts the optional parameters # @return [KnowledgeDocument] def get_knowledge_knowledgebase_language_document(document_id, knowledge_base_id, language_code, opts = {}) data, _status_code, _headers = get_knowledge_knowledgebase_language_document_with_http_info(document_id, knowledge_base_id, language_code, opts) return data end # Get document # # @param document_id Document ID # @param knowledge_base_id Knowledge base ID # @param language_code Language code, format: iso2-LOCALE # @param [Hash] opts the optional parameters # @return [Array<(KnowledgeDocument, Fixnum, Hash)>] KnowledgeDocument data, response status code and response headers def get_knowledge_knowledgebase_language_document_with_http_info(document_id, knowledge_base_id, language_code, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: KnowledgeApi.get_knowledge_knowledgebase_language_document ..." end # verify the required parameter 'document_id' is set fail ArgumentError, "Missing the required parameter 'document_id' when calling KnowledgeApi.get_knowledge_knowledgebase_language_document" if document_id.nil? # verify the required parameter 'knowledge_base_id' is set fail ArgumentError, "Missing the required parameter 'knowledge_base_id' when calling KnowledgeApi.get_knowledge_knowledgebase_language_document" if knowledge_base_id.nil? # verify the required parameter 'language_code' is set fail ArgumentError, "Missing the required parameter 'language_code' when calling KnowledgeApi.get_knowledge_knowledgebase_language_document" if language_code.nil? # verify enum value unless ['en-US'].include?(language_code) fail ArgumentError, "invalid value for 'language_code', must be one of en-US" end # resource path local_var_path = "/api/v2/knowledge/knowledgebases/{knowledgeBaseId}/languages/{languageCode}/documents/{documentId}".sub('{format}','json').sub('{' + 'documentId' + '}', document_id.to_s).sub('{' + 'knowledgeBaseId' + '}', knowledge_base_id.to_s).sub('{' + 'languageCode' + '}', language_code.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud OAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'KnowledgeDocument') if @api_client.config.debugging @api_client.config.logger.debug "API called: KnowledgeApi#get_knowledge_knowledgebase_language_document\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get documents # # @param knowledge_base_id Knowledge base ID # @param language_code Language code, format: iso2-LOCALE # @param [Hash] opts the optional parameters # @option opts [String] :before The cursor that points to the start of the set of entities that has been returned. # @option opts [String] :after The cursor that points to the end of the set of entities that has been returned. # @option opts [String] :limit Number of entities to return. Maximum of 200. # @option opts [String] :page_size Number of entities to return. Maximum of 200. # @option opts [String] :categories Filter by categories ids, comma separated values expected. # @return [DocumentListing] def get_knowledge_knowledgebase_language_documents(knowledge_base_id, language_code, opts = {}) data, _status_code, _headers = get_knowledge_knowledgebase_language_documents_with_http_info(knowledge_base_id, language_code, opts) return data end # Get documents # # @param knowledge_base_id Knowledge base ID # @param language_code Language code, format: iso2-LOCALE # @param [Hash] opts the optional parameters # @option opts [String] :before The cursor that points to the start of the set of entities that has been returned. # @option opts [String] :after The cursor that points to the end of the set of entities that has been returned. # @option opts [String] :limit Number of entities to return. Maximum of 200. # @option opts [String] :page_size Number of entities to return. Maximum of 200. # @option opts [String] :categories Filter by categories ids, comma separated values expected. # @return [Array<(DocumentListing, Fixnum, Hash)>] DocumentListing data, response status code and response headers def get_knowledge_knowledgebase_language_documents_with_http_info(knowledge_base_id, language_code, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: KnowledgeApi.get_knowledge_knowledgebase_language_documents ..." end # verify the required parameter 'knowledge_base_id' is set fail ArgumentError, "Missing the required parameter 'knowledge_base_id' when calling KnowledgeApi.get_knowledge_knowledgebase_language_documents" if knowledge_base_id.nil? # verify the required parameter 'language_code' is set fail ArgumentError, "Missing the required parameter 'language_code' when calling KnowledgeApi.get_knowledge_knowledgebase_language_documents" if language_code.nil? # verify enum value unless ['en-US'].include?(language_code) fail ArgumentError, "invalid value for 'language_code', must be one of en-US" end # resource path local_var_path = "/api/v2/knowledge/knowledgebases/{knowledgeBaseId}/languages/{languageCode}/documents".sub('{format}','json').sub('{' + 'knowledgeBaseId' + '}', knowledge_base_id.to_s).sub('{' + 'languageCode' + '}', language_code.to_s) # query parameters query_params = {} query_params[:'before'] = opts[:'before'] if opts[:'before'] query_params[:'after'] = opts[:'after'] if opts[:'after'] query_params[:'limit'] = opts[:'limit'] if opts[:'limit'] query_params[:'pageSize'] = opts[:'page_size'] if opts[:'page_size'] query_params[:'categories'] = opts[:'categories'] if opts[:'categories'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud OAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'DocumentListing') if @api_client.config.debugging @api_client.config.logger.debug "API called: KnowledgeApi#get_knowledge_knowledgebase_language_documents\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get training detail # # @param knowledge_base_id Knowledge base ID # @param language_code Language code, format: iso2-LOCALE # @param training_id Training ID # @param [Hash] opts the optional parameters # @return [KnowledgeTraining] def get_knowledge_knowledgebase_language_training(knowledge_base_id, language_code, training_id, opts = {}) data, _status_code, _headers = get_knowledge_knowledgebase_language_training_with_http_info(knowledge_base_id, language_code, training_id, opts) return data end # Get training detail # # @param knowledge_base_id Knowledge base ID # @param language_code Language code, format: iso2-LOCALE # @param training_id Training ID # @param [Hash] opts the optional parameters # @return [Array<(KnowledgeTraining, Fixnum, Hash)>] KnowledgeTraining data, response status code and response headers def get_knowledge_knowledgebase_language_training_with_http_info(knowledge_base_id, language_code, training_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: KnowledgeApi.get_knowledge_knowledgebase_language_training ..." end # verify the required parameter 'knowledge_base_id' is set fail ArgumentError, "Missing the required parameter 'knowledge_base_id' when calling KnowledgeApi.get_knowledge_knowledgebase_language_training" if knowledge_base_id.nil? # verify the required parameter 'language_code' is set fail ArgumentError, "Missing the required parameter 'language_code' when calling KnowledgeApi.get_knowledge_knowledgebase_language_training" if language_code.nil? # verify enum value unless ['en-US'].include?(language_code) fail ArgumentError, "invalid value for 'language_code', must be one of en-US" end # verify the required parameter 'training_id' is set fail ArgumentError, "Missing the required parameter 'training_id' when calling KnowledgeApi.get_knowledge_knowledgebase_language_training" if training_id.nil? # resource path local_var_path = "/api/v2/knowledge/knowledgebases/{knowledgeBaseId}/languages/{languageCode}/trainings/{trainingId}".sub('{format}','json').sub('{' + 'knowledgeBaseId' + '}', knowledge_base_id.to_s).sub('{' + 'languageCode' + '}', language_code.to_s).sub('{' + 'trainingId' + '}', training_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud OAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'KnowledgeTraining') if @api_client.config.debugging @api_client.config.logger.debug "API called: KnowledgeApi#get_knowledge_knowledgebase_language_training\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get All trainings information for a knowledgebase # # @param knowledge_base_id Knowledge base ID # @param language_code Language code, format: iso2-LOCALE # @param [Hash] opts the optional parameters # @option opts [String] :before The cursor that points to the start of the set of entities that has been returned. # @option opts [String] :after The cursor that points to the end of the set of entities that has been returned. # @option opts [String] :limit Number of entities to return. Maximum of 200. # @option opts [String] :page_size Number of entities to return. Maximum of 200. # @return [TrainingListing] def get_knowledge_knowledgebase_language_trainings(knowledge_base_id, language_code, opts = {}) data, _status_code, _headers = get_knowledge_knowledgebase_language_trainings_with_http_info(knowledge_base_id, language_code, opts) return data end # Get All trainings information for a knowledgebase # # @param knowledge_base_id Knowledge base ID # @param language_code Language code, format: iso2-LOCALE # @param [Hash] opts the optional parameters # @option opts [String] :before The cursor that points to the start of the set of entities that has been returned. # @option opts [String] :after The cursor that points to the end of the set of entities that has been returned. # @option opts [String] :limit Number of entities to return. Maximum of 200. # @option opts [String] :page_size Number of entities to return. Maximum of 200. # @return [Array<(TrainingListing, Fixnum, Hash)>] TrainingListing data, response status code and response headers def get_knowledge_knowledgebase_language_trainings_with_http_info(knowledge_base_id, language_code, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: KnowledgeApi.get_knowledge_knowledgebase_language_trainings ..." end # verify the required parameter 'knowledge_base_id' is set fail ArgumentError, "Missing the required parameter 'knowledge_base_id' when calling KnowledgeApi.get_knowledge_knowledgebase_language_trainings" if knowledge_base_id.nil? # verify the required parameter 'language_code' is set fail ArgumentError, "Missing the required parameter 'language_code' when calling KnowledgeApi.get_knowledge_knowledgebase_language_trainings" if language_code.nil? # verify enum value unless ['en-US'].include?(language_code) fail ArgumentError, "invalid value for 'language_code', must be one of en-US" end # resource path local_var_path = "/api/v2/knowledge/knowledgebases/{knowledgeBaseId}/languages/{languageCode}/trainings".sub('{format}','json').sub('{' + 'knowledgeBaseId' + '}', knowledge_base_id.to_s).sub('{' + 'languageCode' + '}', language_code.to_s) # query parameters query_params = {} query_params[:'before'] = opts[:'before'] if opts[:'before'] query_params[:'after'] = opts[:'after'] if opts[:'after'] query_params[:'limit'] = opts[:'limit'] if opts[:'limit'] query_params[:'pageSize'] = opts[:'page_size'] if opts[:'page_size'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud OAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'TrainingListing') if @api_client.config.debugging @api_client.config.logger.debug "API called: KnowledgeApi#get_knowledge_knowledgebase_language_trainings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get knowledge bases # # @param [Hash] opts the optional parameters # @option opts [String] :before The cursor that points to the start of the set of entities that has been returned. # @option opts [String] :after The cursor that points to the end of the set of entities that has been returned. # @option opts [String] :limit Number of entities to return. Maximum of 200. # @option opts [String] :page_size Number of entities to return. Maximum of 200. # @return [KnowledgeBaseListing] def get_knowledge_knowledgebases(opts = {}) data, _status_code, _headers = get_knowledge_knowledgebases_with_http_info(opts) return data end # Get knowledge bases # # @param [Hash] opts the optional parameters # @option opts [String] :before The cursor that points to the start of the set of entities that has been returned. # @option opts [String] :after The cursor that points to the end of the set of entities that has been returned. # @option opts [String] :limit Number of entities to return. Maximum of 200. # @option opts [String] :page_size Number of entities to return. Maximum of 200. # @return [Array<(KnowledgeBaseListing, Fixnum, Hash)>] KnowledgeBaseListing data, response status code and response headers def get_knowledge_knowledgebases_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: KnowledgeApi.get_knowledge_knowledgebases ..." end # resource path local_var_path = "/api/v2/knowledge/knowledgebases".sub('{format}','json') # query parameters query_params = {} query_params[:'before'] = opts[:'before'] if opts[:'before'] query_params[:'after'] = opts[:'after'] if opts[:'after'] query_params[:'limit'] = opts[:'limit'] if opts[:'limit'] query_params[:'pageSize'] = opts[:'page_size'] if opts[:'page_size'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud OAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'KnowledgeBaseListing') if @api_client.config.debugging @api_client.config.logger.debug "API called: KnowledgeApi#get_knowledge_knowledgebases\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update knowledge base # # @param knowledge_base_id Knowledge base ID # @param body # @param [Hash] opts the optional parameters # @return [KnowledgeBase] def patch_knowledge_knowledgebase(knowledge_base_id, body, opts = {}) data, _status_code, _headers = patch_knowledge_knowledgebase_with_http_info(knowledge_base_id, body, opts) return data end # Update knowledge base # # @param knowledge_base_id Knowledge base ID # @param body # @param [Hash] opts the optional parameters # @return [Array<(KnowledgeBase, Fixnum, Hash)>] KnowledgeBase data, response status code and response headers def patch_knowledge_knowledgebase_with_http_info(knowledge_base_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: KnowledgeApi.patch_knowledge_knowledgebase ..." end # verify the required parameter 'knowledge_base_id' is set fail ArgumentError, "Missing the required parameter 'knowledge_base_id' when calling KnowledgeApi.patch_knowledge_knowledgebase" if knowledge_base_id.nil? # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling KnowledgeApi.patch_knowledge_knowledgebase" if body.nil? # resource path local_var_path = "/api/v2/knowledge/knowledgebases/{knowledgeBaseId}".sub('{format}','json').sub('{' + 'knowledgeBaseId' + '}', knowledge_base_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['PureCloud OAuth'] data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'KnowledgeBase') if @api_client.config.debugging @api_client.config.logger.debug "API called: KnowledgeApi#patch_knowledge_knowledgebase\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update category # # @param category_id Category ID # @param knowledge_base_id Knowledge base ID # @param language_code Language code, format: iso2-LOCALE # @param body # @param [Hash] opts the optional parameters # @return [KnowledgeExtendedCategory] def patch_knowledge_knowledgebase_language_category(category_id, knowledge_base_id, language_code, body, opts = {}) data, _status_code, _headers = patch_knowledge_knowledgebase_language_category_with_http_info(category_id, knowledge_base_id, language_code, body, opts) return data end # Update category # # @param category_id Category ID # @param knowledge_base_id Knowledge base ID # @param language_code Language code, format: iso2-LOCALE # @param body # @param [Hash] opts the optional parameters # @return [Array<(KnowledgeExtendedCategory, Fixnum, Hash)>] KnowledgeExtendedCategory data, response status code and response headers def patch_knowledge_knowledgebase_language_category_with_http_info(category_id, knowledge_base_id, language_code, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: KnowledgeApi.patch_knowledge_knowledgebase_language_category ..." end # verify the required parameter 'category_id' is set fail ArgumentError, "Missing the required parameter 'category_id' when calling KnowledgeApi.patch_knowledge_knowledgebase_language_category" if category_id.nil? # verify the required parameter 'knowledge_base_id' is set fail ArgumentError, "Missing the required parameter 'knowledge_base_id' when calling KnowledgeApi.patch_knowledge_knowledgebase_language_category" if knowledge_base_id.nil? # verify the required parameter 'language_code' is set fail ArgumentError, "Missing the required parameter 'language_code' when calling KnowledgeApi.patch_knowledge_knowledgebase_language_category" if language_code.nil? # verify enum value unless ['en-US'].include?(language_code) fail ArgumentError, "invalid value for 'language_code', must be one of en-US" end # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling KnowledgeApi.patch_knowledge_knowledgebase_language_category" if body.nil? # resource path local_var_path = "/api/v2/knowledge/knowledgebases/{knowledgeBaseId}/languages/{languageCode}/categories/{categoryId}".sub('{format}','json').sub('{' + 'categoryId' + '}', category_id.to_s).sub('{' + 'knowledgeBaseId' + '}', knowledge_base_id.to_s).sub('{' + 'languageCode' + '}', language_code.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['PureCloud OAuth'] data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'KnowledgeExtendedCategory') if @api_client.config.debugging @api_client.config.logger.debug "API called: KnowledgeApi#patch_knowledge_knowledgebase_language_category\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update document # # @param document_id Document ID # @param knowledge_base_id Knowledge base ID # @param language_code Language code, format: iso2-LOCALE # @param body # @param [Hash] opts the optional parameters # @return [KnowledgeDocument] def patch_knowledge_knowledgebase_language_document(document_id, knowledge_base_id, language_code, body, opts = {}) data, _status_code, _headers = patch_knowledge_knowledgebase_language_document_with_http_info(document_id, knowledge_base_id, language_code, body, opts) return data end # Update document # # @param document_id Document ID # @param knowledge_base_id Knowledge base ID # @param language_code Language code, format: iso2-LOCALE # @param body # @param [Hash] opts the optional parameters # @return [Array<(KnowledgeDocument, Fixnum, Hash)>] KnowledgeDocument data, response status code and response headers def patch_knowledge_knowledgebase_language_document_with_http_info(document_id, knowledge_base_id, language_code, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: KnowledgeApi.patch_knowledge_knowledgebase_language_document ..." end # verify the required parameter 'document_id' is set fail ArgumentError, "Missing the required parameter 'document_id' when calling KnowledgeApi.patch_knowledge_knowledgebase_language_document" if document_id.nil? # verify the required parameter 'knowledge_base_id' is set fail ArgumentError, "Missing the required parameter 'knowledge_base_id' when calling KnowledgeApi.patch_knowledge_knowledgebase_language_document" if knowledge_base_id.nil? # verify the required parameter 'language_code' is set fail ArgumentError, "Missing the required parameter 'language_code' when calling KnowledgeApi.patch_knowledge_knowledgebase_language_document" if language_code.nil? # verify enum value unless ['en-US'].include?(language_code) fail ArgumentError, "invalid value for 'language_code', must be one of en-US" end # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling KnowledgeApi.patch_knowledge_knowledgebase_language_document" if body.nil? # resource path local_var_path = "/api/v2/knowledge/knowledgebases/{knowledgeBaseId}/languages/{languageCode}/documents/{documentId}".sub('{format}','json').sub('{' + 'documentId' + '}', document_id.to_s).sub('{' + 'knowledgeBaseId' + '}', knowledge_base_id.to_s).sub('{' + 'languageCode' + '}', language_code.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['PureCloud OAuth'] data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'KnowledgeDocument') if @api_client.config.debugging @api_client.config.logger.debug "API called: KnowledgeApi#patch_knowledge_knowledgebase_language_document\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update documents collection # # @param knowledge_base_id Knowledge base ID # @param language_code Language code, format: iso2-LOCALE # @param body # @param [Hash] opts the optional parameters # @return [DocumentListing] def patch_knowledge_knowledgebase_language_documents(knowledge_base_id, language_code, body, opts = {}) data, _status_code, _headers = patch_knowledge_knowledgebase_language_documents_with_http_info(knowledge_base_id, language_code, body, opts) return data end # Update documents collection # # @param knowledge_base_id Knowledge base ID # @param language_code Language code, format: iso2-LOCALE # @param body # @param [Hash] opts the optional parameters # @return [Array<(DocumentListing, Fixnum, Hash)>] DocumentListing data, response status code and response headers def patch_knowledge_knowledgebase_language_documents_with_http_info(knowledge_base_id, language_code, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: KnowledgeApi.patch_knowledge_knowledgebase_language_documents ..." end # verify the required parameter 'knowledge_base_id' is set fail ArgumentError, "Missing the required parameter 'knowledge_base_id' when calling KnowledgeApi.patch_knowledge_knowledgebase_language_documents" if knowledge_base_id.nil? # verify the required parameter 'language_code' is set fail ArgumentError, "Missing the required parameter 'language_code' when calling KnowledgeApi.patch_knowledge_knowledgebase_language_documents" if language_code.nil? # verify enum value unless ['en-US'].include?(language_code) fail ArgumentError, "invalid value for 'language_code', must be one of en-US" end # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling KnowledgeApi.patch_knowledge_knowledgebase_language_documents" if body.nil? # resource path local_var_path = "/api/v2/knowledge/knowledgebases/{knowledgeBaseId}/languages/{languageCode}/documents".sub('{format}','json').sub('{' + 'knowledgeBaseId' + '}', knowledge_base_id.to_s).sub('{' + 'languageCode' + '}', language_code.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['PureCloud OAuth'] data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'DocumentListing') if @api_client.config.debugging @api_client.config.logger.debug "API called: KnowledgeApi#patch_knowledge_knowledgebase_language_documents\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Create new category # # @param knowledge_base_id Knowledge base ID # @param language_code Language code, format: iso2-LOCALE # @param body # @param [Hash] opts the optional parameters # @return [KnowledgeExtendedCategory] def post_knowledge_knowledgebase_language_categories(knowledge_base_id, language_code, body, opts = {}) data, _status_code, _headers = post_knowledge_knowledgebase_language_categories_with_http_info(knowledge_base_id, language_code, body, opts) return data end # Create new category # # @param knowledge_base_id Knowledge base ID # @param language_code Language code, format: iso2-LOCALE # @param body # @param [Hash] opts the optional parameters # @return [Array<(KnowledgeExtendedCategory, Fixnum, Hash)>] KnowledgeExtendedCategory data, response status code and response headers def post_knowledge_knowledgebase_language_categories_with_http_info(knowledge_base_id, language_code, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: KnowledgeApi.post_knowledge_knowledgebase_language_categories ..." end # verify the required parameter 'knowledge_base_id' is set fail ArgumentError, "Missing the required parameter 'knowledge_base_id' when calling KnowledgeApi.post_knowledge_knowledgebase_language_categories" if knowledge_base_id.nil? # verify the required parameter 'language_code' is set fail ArgumentError, "Missing the required parameter 'language_code' when calling KnowledgeApi.post_knowledge_knowledgebase_language_categories" if language_code.nil? # verify enum value unless ['en-US'].include?(language_code) fail ArgumentError, "invalid value for 'language_code', must be one of en-US" end # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling KnowledgeApi.post_knowledge_knowledgebase_language_categories" if body.nil? # resource path local_var_path = "/api/v2/knowledge/knowledgebases/{knowledgeBaseId}/languages/{languageCode}/categories".sub('{format}','json').sub('{' + 'knowledgeBaseId' + '}', knowledge_base_id.to_s).sub('{' + 'languageCode' + '}', language_code.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['PureCloud OAuth'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'KnowledgeExtendedCategory') if @api_client.config.debugging @api_client.config.logger.debug "API called: KnowledgeApi#post_knowledge_knowledgebase_language_categories\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Create document # # @param knowledge_base_id Knowledge base ID # @param language_code Language code, format: iso2-LOCALE # @param body # @param [Hash] opts the optional parameters # @return [KnowledgeDocument] def post_knowledge_knowledgebase_language_documents(knowledge_base_id, language_code, body, opts = {}) data, _status_code, _headers = post_knowledge_knowledgebase_language_documents_with_http_info(knowledge_base_id, language_code, body, opts) return data end # Create document # # @param knowledge_base_id Knowledge base ID # @param language_code Language code, format: iso2-LOCALE # @param body # @param [Hash] opts the optional parameters # @return [Array<(KnowledgeDocument, Fixnum, Hash)>] KnowledgeDocument data, response status code and response headers def post_knowledge_knowledgebase_language_documents_with_http_info(knowledge_base_id, language_code, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: KnowledgeApi.post_knowledge_knowledgebase_language_documents ..." end # verify the required parameter 'knowledge_base_id' is set fail ArgumentError, "Missing the required parameter 'knowledge_base_id' when calling KnowledgeApi.post_knowledge_knowledgebase_language_documents" if knowledge_base_id.nil? # verify the required parameter 'language_code' is set fail ArgumentError, "Missing the required parameter 'language_code' when calling KnowledgeApi.post_knowledge_knowledgebase_language_documents" if language_code.nil? # verify enum value unless ['en-US'].include?(language_code) fail ArgumentError, "invalid value for 'language_code', must be one of en-US" end # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling KnowledgeApi.post_knowledge_knowledgebase_language_documents" if body.nil? # resource path local_var_path = "/api/v2/knowledge/knowledgebases/{knowledgeBaseId}/languages/{languageCode}/documents".sub('{format}','json').sub('{' + 'knowledgeBaseId' + '}', knowledge_base_id.to_s).sub('{' + 'languageCode' + '}', language_code.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['PureCloud OAuth'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'KnowledgeDocument') if @api_client.config.debugging @api_client.config.logger.debug "API called: KnowledgeApi#post_knowledge_knowledgebase_language_documents\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Promote trained documents from draft state to active. # # @param knowledge_base_id Knowledge base ID # @param language_code Language code, format: iso2-LOCALE # @param training_id Training ID # @param [Hash] opts the optional parameters # @return [KnowledgeTraining] def post_knowledge_knowledgebase_language_training_promote(knowledge_base_id, language_code, training_id, opts = {}) data, _status_code, _headers = post_knowledge_knowledgebase_language_training_promote_with_http_info(knowledge_base_id, language_code, training_id, opts) return data end # Promote trained documents from draft state to active. # # @param knowledge_base_id Knowledge base ID # @param language_code Language code, format: iso2-LOCALE # @param training_id Training ID # @param [Hash] opts the optional parameters # @return [Array<(KnowledgeTraining, Fixnum, Hash)>] KnowledgeTraining data, response status code and response headers def post_knowledge_knowledgebase_language_training_promote_with_http_info(knowledge_base_id, language_code, training_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: KnowledgeApi.post_knowledge_knowledgebase_language_training_promote ..." end # verify the required parameter 'knowledge_base_id' is set fail ArgumentError, "Missing the required parameter 'knowledge_base_id' when calling KnowledgeApi.post_knowledge_knowledgebase_language_training_promote" if knowledge_base_id.nil? # verify the required parameter 'language_code' is set fail ArgumentError, "Missing the required parameter 'language_code' when calling KnowledgeApi.post_knowledge_knowledgebase_language_training_promote" if language_code.nil? # verify enum value unless ['en-US'].include?(language_code) fail ArgumentError, "invalid value for 'language_code', must be one of en-US" end # verify the required parameter 'training_id' is set fail ArgumentError, "Missing the required parameter 'training_id' when calling KnowledgeApi.post_knowledge_knowledgebase_language_training_promote" if training_id.nil? # resource path local_var_path = "/api/v2/knowledge/knowledgebases/{knowledgeBaseId}/languages/{languageCode}/trainings/{trainingId}/promote".sub('{format}','json').sub('{' + 'knowledgeBaseId' + '}', knowledge_base_id.to_s).sub('{' + 'languageCode' + '}', language_code.to_s).sub('{' + 'trainingId' + '}', training_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud OAuth'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'KnowledgeTraining') if @api_client.config.debugging @api_client.config.logger.debug "API called: KnowledgeApi#post_knowledge_knowledgebase_language_training_promote\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Trigger training # # @param knowledge_base_id Knowledge base ID # @param language_code Language code, format: iso2-LOCALE # @param [Hash] opts the optional parameters # @return [KnowledgeTraining] def post_knowledge_knowledgebase_language_trainings(knowledge_base_id, language_code, opts = {}) data, _status_code, _headers = post_knowledge_knowledgebase_language_trainings_with_http_info(knowledge_base_id, language_code, opts) return data end # Trigger training # # @param knowledge_base_id Knowledge base ID # @param language_code Language code, format: iso2-LOCALE # @param [Hash] opts the optional parameters # @return [Array<(KnowledgeTraining, Fixnum, Hash)>] KnowledgeTraining data, response status code and response headers def post_knowledge_knowledgebase_language_trainings_with_http_info(knowledge_base_id, language_code, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: KnowledgeApi.post_knowledge_knowledgebase_language_trainings ..." end # verify the required parameter 'knowledge_base_id' is set fail ArgumentError, "Missing the required parameter 'knowledge_base_id' when calling KnowledgeApi.post_knowledge_knowledgebase_language_trainings" if knowledge_base_id.nil? # verify the required parameter 'language_code' is set fail ArgumentError, "Missing the required parameter 'language_code' when calling KnowledgeApi.post_knowledge_knowledgebase_language_trainings" if language_code.nil? # verify enum value unless ['en-US'].include?(language_code) fail ArgumentError, "invalid value for 'language_code', must be one of en-US" end # resource path local_var_path = "/api/v2/knowledge/knowledgebases/{knowledgeBaseId}/languages/{languageCode}/trainings".sub('{format}','json').sub('{' + 'knowledgeBaseId' + '}', knowledge_base_id.to_s).sub('{' + 'languageCode' + '}', language_code.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud OAuth'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'KnowledgeTraining') if @api_client.config.debugging @api_client.config.logger.debug "API called: KnowledgeApi#post_knowledge_knowledgebase_language_trainings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Search Documents # # @param knowledge_base_id Knowledge base ID # @param [Hash] opts the optional parameters # @option opts [KnowledgeSearchRequest] :body # @return [KnowledgeSearchResponse] def post_knowledge_knowledgebase_search(knowledge_base_id, opts = {}) data, _status_code, _headers = post_knowledge_knowledgebase_search_with_http_info(knowledge_base_id, opts) return data end # Search Documents # # @param knowledge_base_id Knowledge base ID # @param [Hash] opts the optional parameters # @option opts [KnowledgeSearchRequest] :body # @return [Array<(KnowledgeSearchResponse, Fixnum, Hash)>] KnowledgeSearchResponse data, response status code and response headers def post_knowledge_knowledgebase_search_with_http_info(knowledge_base_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: KnowledgeApi.post_knowledge_knowledgebase_search ..." end # verify the required parameter 'knowledge_base_id' is set fail ArgumentError, "Missing the required parameter 'knowledge_base_id' when calling KnowledgeApi.post_knowledge_knowledgebase_search" if knowledge_base_id.nil? # resource path local_var_path = "/api/v2/knowledge/knowledgebases/{knowledgeBaseId}/search".sub('{format}','json').sub('{' + 'knowledgeBaseId' + '}', knowledge_base_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(opts[:'body']) auth_names = ['PureCloud OAuth'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'KnowledgeSearchResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: KnowledgeApi#post_knowledge_knowledgebase_search\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Create new knowledge base # # @param body # @param [Hash] opts the optional parameters # @return [KnowledgeBase] def post_knowledge_knowledgebases(body, opts = {}) data, _status_code, _headers = post_knowledge_knowledgebases_with_http_info(body, opts) return data end # Create new knowledge base # # @param body # @param [Hash] opts the optional parameters # @return [Array<(KnowledgeBase, Fixnum, Hash)>] KnowledgeBase data, response status code and response headers def post_knowledge_knowledgebases_with_http_info(body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: KnowledgeApi.post_knowledge_knowledgebases ..." end # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling KnowledgeApi.post_knowledge_knowledgebases" if body.nil? # resource path local_var_path = "/api/v2/knowledge/knowledgebases".sub('{format}','json') # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['PureCloud OAuth'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'KnowledgeBase') if @api_client.config.debugging @api_client.config.logger.debug "API called: KnowledgeApi#post_knowledge_knowledgebases\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end