%% WARNING: DO NOT EDIT, AUTO-GENERATED CODE! %% See https://github.com/aws-beam/aws-codegen for more details. %% @doc Amazon Connect Wisdom delivers agents the information they need to %% solve customer issues as they're actively speaking with customers. %% %% Agents can search across connected repositories from within their agent %% desktop to find answers quickly. Use Amazon Connect Wisdom to create an %% assistant and a knowledge base, for example, or manage content by %% uploading custom files. -module(aws_wisdom). -export([create_assistant/2, create_assistant/3, create_assistant_association/3, create_assistant_association/4, create_content/3, create_content/4, create_knowledge_base/2, create_knowledge_base/3, create_quick_response/3, create_quick_response/4, create_session/3, create_session/4, delete_assistant/3, delete_assistant/4, delete_assistant_association/4, delete_assistant_association/5, delete_content/4, delete_content/5, delete_import_job/4, delete_import_job/5, delete_knowledge_base/3, delete_knowledge_base/4, delete_quick_response/4, delete_quick_response/5, get_assistant/2, get_assistant/4, get_assistant/5, get_assistant_association/3, get_assistant_association/5, get_assistant_association/6, get_content/3, get_content/5, get_content/6, get_content_summary/3, get_content_summary/5, get_content_summary/6, get_import_job/3, get_import_job/5, get_import_job/6, get_knowledge_base/2, get_knowledge_base/4, get_knowledge_base/5, get_quick_response/3, get_quick_response/5, get_quick_response/6, get_recommendations/3, get_recommendations/5, get_recommendations/6, get_session/3, get_session/5, get_session/6, list_assistant_associations/2, list_assistant_associations/4, list_assistant_associations/5, list_assistants/1, list_assistants/3, list_assistants/4, list_contents/2, list_contents/4, list_contents/5, list_import_jobs/2, list_import_jobs/4, list_import_jobs/5, list_knowledge_bases/1, list_knowledge_bases/3, list_knowledge_bases/4, list_quick_responses/2, list_quick_responses/4, list_quick_responses/5, list_tags_for_resource/2, list_tags_for_resource/4, list_tags_for_resource/5, notify_recommendations_received/4, notify_recommendations_received/5, query_assistant/3, query_assistant/4, remove_knowledge_base_template_uri/3, remove_knowledge_base_template_uri/4, search_content/3, search_content/4, search_quick_responses/3, search_quick_responses/4, search_sessions/3, search_sessions/4, start_content_upload/3, start_content_upload/4, start_import_job/3, start_import_job/4, tag_resource/3, tag_resource/4, untag_resource/3, untag_resource/4, update_content/4, update_content/5, update_knowledge_base_template_uri/3, update_knowledge_base_template_uri/4, update_quick_response/4, update_quick_response/5]). -include_lib("hackney/include/hackney_lib.hrl"). %%==================================================================== %% API %%==================================================================== %% @doc Creates an Amazon Connect Wisdom assistant. create_assistant(Client, Input) -> create_assistant(Client, Input, []). create_assistant(Client, Input0, Options0) -> Method = post, Path = ["/assistants"], SuccessStatusCode = 200, Options = [{send_body_as_binary, false}, {receive_body_as_binary, false}, {append_sha256_content_hash, false} | Options0], Headers = [], Input1 = Input0, CustomHeaders = [], Input2 = Input1, Query_ = [], Input = Input2, request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). %% @doc Creates an association between an Amazon Connect Wisdom assistant and %% another resource. %% %% Currently, the only supported association is with a knowledge base. An %% assistant can have only a single association. create_assistant_association(Client, AssistantId, Input) -> create_assistant_association(Client, AssistantId, Input, []). create_assistant_association(Client, AssistantId, Input0, Options0) -> Method = post, Path = ["/assistants/", aws_util:encode_uri(AssistantId), "/associations"], SuccessStatusCode = 200, Options = [{send_body_as_binary, false}, {receive_body_as_binary, false}, {append_sha256_content_hash, false} | Options0], Headers = [], Input1 = Input0, CustomHeaders = [], Input2 = Input1, Query_ = [], Input = Input2, request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). %% @doc Creates Wisdom content. %% %% Before to calling this API, use StartContentUpload: %% https://docs.aws.amazon.com/wisdom/latest/APIReference/API_StartContentUpload.html %% to upload an asset. create_content(Client, KnowledgeBaseId, Input) -> create_content(Client, KnowledgeBaseId, Input, []). create_content(Client, KnowledgeBaseId, Input0, Options0) -> Method = post, Path = ["/knowledgeBases/", aws_util:encode_uri(KnowledgeBaseId), "/contents"], SuccessStatusCode = 200, Options = [{send_body_as_binary, false}, {receive_body_as_binary, false}, {append_sha256_content_hash, false} | Options0], Headers = [], Input1 = Input0, CustomHeaders = [], Input2 = Input1, Query_ = [], Input = Input2, request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). %% @doc Creates a knowledge base. %% %% When using this API, you cannot reuse Amazon AppIntegrations: %% https://docs.aws.amazon.com/appintegrations/latest/APIReference/Welcome.html %% DataIntegrations with external knowledge bases such as Salesforce and %% ServiceNow. If you do, you'll get an `InvalidRequestException' %% error. %% %% For example, you're programmatically managing your external knowledge %% base, and you want to add or remove one of the fields that is being %% ingested from Salesforce. Do the following: %% %% Call DeleteKnowledgeBase: %% https://docs.aws.amazon.com/wisdom/latest/APIReference/API_DeleteKnowledgeBase.html. %% %% Call DeleteDataIntegration: %% https://docs.aws.amazon.com/appintegrations/latest/APIReference/API_DeleteDataIntegration.html. %% %% Call CreateDataIntegration: %% https://docs.aws.amazon.com/appintegrations/latest/APIReference/API_CreateDataIntegration.html %% to recreate the DataIntegration or a create different one. %% %% Call CreateKnowledgeBase. create_knowledge_base(Client, Input) -> create_knowledge_base(Client, Input, []). create_knowledge_base(Client, Input0, Options0) -> Method = post, Path = ["/knowledgeBases"], SuccessStatusCode = 200, Options = [{send_body_as_binary, false}, {receive_body_as_binary, false}, {append_sha256_content_hash, false} | Options0], Headers = [], Input1 = Input0, CustomHeaders = [], Input2 = Input1, Query_ = [], Input = Input2, request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). %% @doc Creates a Wisdom quick response. create_quick_response(Client, KnowledgeBaseId, Input) -> create_quick_response(Client, KnowledgeBaseId, Input, []). create_quick_response(Client, KnowledgeBaseId, Input0, Options0) -> Method = post, Path = ["/knowledgeBases/", aws_util:encode_uri(KnowledgeBaseId), "/quickResponses"], SuccessStatusCode = 200, Options = [{send_body_as_binary, false}, {receive_body_as_binary, false}, {append_sha256_content_hash, false} | Options0], Headers = [], Input1 = Input0, CustomHeaders = [], Input2 = Input1, Query_ = [], Input = Input2, request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). %% @doc Creates a session. %% %% A session is a contextual container used for generating recommendations. %% Amazon Connect creates a new Wisdom session for each contact on which %% Wisdom is enabled. create_session(Client, AssistantId, Input) -> create_session(Client, AssistantId, Input, []). create_session(Client, AssistantId, Input0, Options0) -> Method = post, Path = ["/assistants/", aws_util:encode_uri(AssistantId), "/sessions"], SuccessStatusCode = 200, Options = [{send_body_as_binary, false}, {receive_body_as_binary, false}, {append_sha256_content_hash, false} | Options0], Headers = [], Input1 = Input0, CustomHeaders = [], Input2 = Input1, Query_ = [], Input = Input2, request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). %% @doc Deletes an assistant. delete_assistant(Client, AssistantId, Input) -> delete_assistant(Client, AssistantId, Input, []). delete_assistant(Client, AssistantId, Input0, Options0) -> Method = delete, Path = ["/assistants/", aws_util:encode_uri(AssistantId), ""], SuccessStatusCode = 204, Options = [{send_body_as_binary, false}, {receive_body_as_binary, false}, {append_sha256_content_hash, false} | Options0], Headers = [], Input1 = Input0, CustomHeaders = [], Input2 = Input1, Query_ = [], Input = Input2, request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). %% @doc Deletes an assistant association. delete_assistant_association(Client, AssistantAssociationId, AssistantId, Input) -> delete_assistant_association(Client, AssistantAssociationId, AssistantId, Input, []). delete_assistant_association(Client, AssistantAssociationId, AssistantId, Input0, Options0) -> Method = delete, Path = ["/assistants/", aws_util:encode_uri(AssistantId), "/associations/", aws_util:encode_uri(AssistantAssociationId), ""], SuccessStatusCode = 204, Options = [{send_body_as_binary, false}, {receive_body_as_binary, false}, {append_sha256_content_hash, false} | Options0], Headers = [], Input1 = Input0, CustomHeaders = [], Input2 = Input1, Query_ = [], Input = Input2, request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). %% @doc Deletes the content. delete_content(Client, ContentId, KnowledgeBaseId, Input) -> delete_content(Client, ContentId, KnowledgeBaseId, Input, []). delete_content(Client, ContentId, KnowledgeBaseId, Input0, Options0) -> Method = delete, Path = ["/knowledgeBases/", aws_util:encode_uri(KnowledgeBaseId), "/contents/", aws_util:encode_uri(ContentId), ""], SuccessStatusCode = 204, Options = [{send_body_as_binary, false}, {receive_body_as_binary, false}, {append_sha256_content_hash, false} | Options0], Headers = [], Input1 = Input0, CustomHeaders = [], Input2 = Input1, Query_ = [], Input = Input2, request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). %% @doc Deletes the quick response import job. delete_import_job(Client, ImportJobId, KnowledgeBaseId, Input) -> delete_import_job(Client, ImportJobId, KnowledgeBaseId, Input, []). delete_import_job(Client, ImportJobId, KnowledgeBaseId, Input0, Options0) -> Method = delete, Path = ["/knowledgeBases/", aws_util:encode_uri(KnowledgeBaseId), "/importJobs/", aws_util:encode_uri(ImportJobId), ""], SuccessStatusCode = 204, Options = [{send_body_as_binary, false}, {receive_body_as_binary, false}, {append_sha256_content_hash, false} | Options0], Headers = [], Input1 = Input0, CustomHeaders = [], Input2 = Input1, Query_ = [], Input = Input2, request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). %% @doc Deletes the knowledge base. %% %% When you use this API to delete an external knowledge base such as %% Salesforce or ServiceNow, you must also delete the Amazon AppIntegrations: %% https://docs.aws.amazon.com/appintegrations/latest/APIReference/Welcome.html %% DataIntegration. This is because you can't reuse the DataIntegration %% after it's been associated with an external knowledge base. However, %% you can delete and recreate it. See DeleteDataIntegration: %% https://docs.aws.amazon.com/appintegrations/latest/APIReference/API_DeleteDataIntegration.html %% and CreateDataIntegration: %% https://docs.aws.amazon.com/appintegrations/latest/APIReference/API_CreateDataIntegration.html %% in the Amazon AppIntegrations API Reference. delete_knowledge_base(Client, KnowledgeBaseId, Input) -> delete_knowledge_base(Client, KnowledgeBaseId, Input, []). delete_knowledge_base(Client, KnowledgeBaseId, Input0, Options0) -> Method = delete, Path = ["/knowledgeBases/", aws_util:encode_uri(KnowledgeBaseId), ""], SuccessStatusCode = 204, Options = [{send_body_as_binary, false}, {receive_body_as_binary, false}, {append_sha256_content_hash, false} | Options0], Headers = [], Input1 = Input0, CustomHeaders = [], Input2 = Input1, Query_ = [], Input = Input2, request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). %% @doc Deletes a quick response. delete_quick_response(Client, KnowledgeBaseId, QuickResponseId, Input) -> delete_quick_response(Client, KnowledgeBaseId, QuickResponseId, Input, []). delete_quick_response(Client, KnowledgeBaseId, QuickResponseId, Input0, Options0) -> Method = delete, Path = ["/knowledgeBases/", aws_util:encode_uri(KnowledgeBaseId), "/quickResponses/", aws_util:encode_uri(QuickResponseId), ""], SuccessStatusCode = 204, Options = [{send_body_as_binary, false}, {receive_body_as_binary, false}, {append_sha256_content_hash, false} | Options0], Headers = [], Input1 = Input0, CustomHeaders = [], Input2 = Input1, Query_ = [], Input = Input2, request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). %% @doc Retrieves information about an assistant. get_assistant(Client, AssistantId) when is_map(Client) -> get_assistant(Client, AssistantId, #{}, #{}). get_assistant(Client, AssistantId, QueryMap, HeadersMap) when is_map(Client), is_map(QueryMap), is_map(HeadersMap) -> get_assistant(Client, AssistantId, QueryMap, HeadersMap, []). get_assistant(Client, AssistantId, QueryMap, HeadersMap, Options0) when is_map(Client), is_map(QueryMap), is_map(HeadersMap), is_list(Options0) -> Path = ["/assistants/", aws_util:encode_uri(AssistantId), ""], SuccessStatusCode = 200, Options = [{send_body_as_binary, false}, {receive_body_as_binary, false} | Options0], Headers = [], Query_ = [], request(Client, get, Path, Query_, Headers, undefined, Options, SuccessStatusCode). %% @doc Retrieves information about an assistant association. get_assistant_association(Client, AssistantAssociationId, AssistantId) when is_map(Client) -> get_assistant_association(Client, AssistantAssociationId, AssistantId, #{}, #{}). get_assistant_association(Client, AssistantAssociationId, AssistantId, QueryMap, HeadersMap) when is_map(Client), is_map(QueryMap), is_map(HeadersMap) -> get_assistant_association(Client, AssistantAssociationId, AssistantId, QueryMap, HeadersMap, []). get_assistant_association(Client, AssistantAssociationId, AssistantId, QueryMap, HeadersMap, Options0) when is_map(Client), is_map(QueryMap), is_map(HeadersMap), is_list(Options0) -> Path = ["/assistants/", aws_util:encode_uri(AssistantId), "/associations/", aws_util:encode_uri(AssistantAssociationId), ""], SuccessStatusCode = 200, Options = [{send_body_as_binary, false}, {receive_body_as_binary, false} | Options0], Headers = [], Query_ = [], request(Client, get, Path, Query_, Headers, undefined, Options, SuccessStatusCode). %% @doc Retrieves content, including a pre-signed URL to download the %% content. get_content(Client, ContentId, KnowledgeBaseId) when is_map(Client) -> get_content(Client, ContentId, KnowledgeBaseId, #{}, #{}). get_content(Client, ContentId, KnowledgeBaseId, QueryMap, HeadersMap) when is_map(Client), is_map(QueryMap), is_map(HeadersMap) -> get_content(Client, ContentId, KnowledgeBaseId, QueryMap, HeadersMap, []). get_content(Client, ContentId, KnowledgeBaseId, QueryMap, HeadersMap, Options0) when is_map(Client), is_map(QueryMap), is_map(HeadersMap), is_list(Options0) -> Path = ["/knowledgeBases/", aws_util:encode_uri(KnowledgeBaseId), "/contents/", aws_util:encode_uri(ContentId), ""], SuccessStatusCode = 200, Options = [{send_body_as_binary, false}, {receive_body_as_binary, false} | Options0], Headers = [], Query_ = [], request(Client, get, Path, Query_, Headers, undefined, Options, SuccessStatusCode). %% @doc Retrieves summary information about the content. get_content_summary(Client, ContentId, KnowledgeBaseId) when is_map(Client) -> get_content_summary(Client, ContentId, KnowledgeBaseId, #{}, #{}). get_content_summary(Client, ContentId, KnowledgeBaseId, QueryMap, HeadersMap) when is_map(Client), is_map(QueryMap), is_map(HeadersMap) -> get_content_summary(Client, ContentId, KnowledgeBaseId, QueryMap, HeadersMap, []). get_content_summary(Client, ContentId, KnowledgeBaseId, QueryMap, HeadersMap, Options0) when is_map(Client), is_map(QueryMap), is_map(HeadersMap), is_list(Options0) -> Path = ["/knowledgeBases/", aws_util:encode_uri(KnowledgeBaseId), "/contents/", aws_util:encode_uri(ContentId), "/summary"], SuccessStatusCode = 200, Options = [{send_body_as_binary, false}, {receive_body_as_binary, false} | Options0], Headers = [], Query_ = [], request(Client, get, Path, Query_, Headers, undefined, Options, SuccessStatusCode). %% @doc Retrieves the started import job. get_import_job(Client, ImportJobId, KnowledgeBaseId) when is_map(Client) -> get_import_job(Client, ImportJobId, KnowledgeBaseId, #{}, #{}). get_import_job(Client, ImportJobId, KnowledgeBaseId, QueryMap, HeadersMap) when is_map(Client), is_map(QueryMap), is_map(HeadersMap) -> get_import_job(Client, ImportJobId, KnowledgeBaseId, QueryMap, HeadersMap, []). get_import_job(Client, ImportJobId, KnowledgeBaseId, QueryMap, HeadersMap, Options0) when is_map(Client), is_map(QueryMap), is_map(HeadersMap), is_list(Options0) -> Path = ["/knowledgeBases/", aws_util:encode_uri(KnowledgeBaseId), "/importJobs/", aws_util:encode_uri(ImportJobId), ""], SuccessStatusCode = 200, Options = [{send_body_as_binary, false}, {receive_body_as_binary, false} | Options0], Headers = [], Query_ = [], request(Client, get, Path, Query_, Headers, undefined, Options, SuccessStatusCode). %% @doc Retrieves information about the knowledge base. get_knowledge_base(Client, KnowledgeBaseId) when is_map(Client) -> get_knowledge_base(Client, KnowledgeBaseId, #{}, #{}). get_knowledge_base(Client, KnowledgeBaseId, QueryMap, HeadersMap) when is_map(Client), is_map(QueryMap), is_map(HeadersMap) -> get_knowledge_base(Client, KnowledgeBaseId, QueryMap, HeadersMap, []). get_knowledge_base(Client, KnowledgeBaseId, QueryMap, HeadersMap, Options0) when is_map(Client), is_map(QueryMap), is_map(HeadersMap), is_list(Options0) -> Path = ["/knowledgeBases/", aws_util:encode_uri(KnowledgeBaseId), ""], SuccessStatusCode = 200, Options = [{send_body_as_binary, false}, {receive_body_as_binary, false} | Options0], Headers = [], Query_ = [], request(Client, get, Path, Query_, Headers, undefined, Options, SuccessStatusCode). %% @doc Retrieves the quick response. get_quick_response(Client, KnowledgeBaseId, QuickResponseId) when is_map(Client) -> get_quick_response(Client, KnowledgeBaseId, QuickResponseId, #{}, #{}). get_quick_response(Client, KnowledgeBaseId, QuickResponseId, QueryMap, HeadersMap) when is_map(Client), is_map(QueryMap), is_map(HeadersMap) -> get_quick_response(Client, KnowledgeBaseId, QuickResponseId, QueryMap, HeadersMap, []). get_quick_response(Client, KnowledgeBaseId, QuickResponseId, QueryMap, HeadersMap, Options0) when is_map(Client), is_map(QueryMap), is_map(HeadersMap), is_list(Options0) -> Path = ["/knowledgeBases/", aws_util:encode_uri(KnowledgeBaseId), "/quickResponses/", aws_util:encode_uri(QuickResponseId), ""], SuccessStatusCode = 200, Options = [{send_body_as_binary, false}, {receive_body_as_binary, false} | Options0], Headers = [], Query_ = [], request(Client, get, Path, Query_, Headers, undefined, Options, SuccessStatusCode). %% @doc Retrieves recommendations for the specified session. %% %% To avoid retrieving the same recommendations in subsequent calls, use %% NotifyRecommendationsReceived: %% https://docs.aws.amazon.com/wisdom/latest/APIReference/API_NotifyRecommendationsReceived.html. %% This API supports long-polling behavior with the `waitTimeSeconds' %% parameter. Short poll is the default behavior and only returns %% recommendations already available. To perform a manual query against an %% assistant, use QueryAssistant: %% https://docs.aws.amazon.com/wisdom/latest/APIReference/API_QueryAssistant.html. get_recommendations(Client, AssistantId, SessionId) when is_map(Client) -> get_recommendations(Client, AssistantId, SessionId, #{}, #{}). get_recommendations(Client, AssistantId, SessionId, QueryMap, HeadersMap) when is_map(Client), is_map(QueryMap), is_map(HeadersMap) -> get_recommendations(Client, AssistantId, SessionId, QueryMap, HeadersMap, []). get_recommendations(Client, AssistantId, SessionId, QueryMap, HeadersMap, Options0) when is_map(Client), is_map(QueryMap), is_map(HeadersMap), is_list(Options0) -> Path = ["/assistants/", aws_util:encode_uri(AssistantId), "/sessions/", aws_util:encode_uri(SessionId), "/recommendations"], SuccessStatusCode = 200, Options = [{send_body_as_binary, false}, {receive_body_as_binary, false} | Options0], Headers = [], Query0_ = [ {<<"maxResults">>, maps:get(<<"maxResults">>, QueryMap, undefined)}, {<<"waitTimeSeconds">>, maps:get(<<"waitTimeSeconds">>, QueryMap, undefined)} ], Query_ = [H || {_, V} = H <- Query0_, V =/= undefined], request(Client, get, Path, Query_, Headers, undefined, Options, SuccessStatusCode). %% @doc Retrieves information for a specified session. get_session(Client, AssistantId, SessionId) when is_map(Client) -> get_session(Client, AssistantId, SessionId, #{}, #{}). get_session(Client, AssistantId, SessionId, QueryMap, HeadersMap) when is_map(Client), is_map(QueryMap), is_map(HeadersMap) -> get_session(Client, AssistantId, SessionId, QueryMap, HeadersMap, []). get_session(Client, AssistantId, SessionId, QueryMap, HeadersMap, Options0) when is_map(Client), is_map(QueryMap), is_map(HeadersMap), is_list(Options0) -> Path = ["/assistants/", aws_util:encode_uri(AssistantId), "/sessions/", aws_util:encode_uri(SessionId), ""], SuccessStatusCode = 200, Options = [{send_body_as_binary, false}, {receive_body_as_binary, false} | Options0], Headers = [], Query_ = [], request(Client, get, Path, Query_, Headers, undefined, Options, SuccessStatusCode). %% @doc Lists information about assistant associations. list_assistant_associations(Client, AssistantId) when is_map(Client) -> list_assistant_associations(Client, AssistantId, #{}, #{}). list_assistant_associations(Client, AssistantId, QueryMap, HeadersMap) when is_map(Client), is_map(QueryMap), is_map(HeadersMap) -> list_assistant_associations(Client, AssistantId, QueryMap, HeadersMap, []). list_assistant_associations(Client, AssistantId, QueryMap, HeadersMap, Options0) when is_map(Client), is_map(QueryMap), is_map(HeadersMap), is_list(Options0) -> Path = ["/assistants/", aws_util:encode_uri(AssistantId), "/associations"], SuccessStatusCode = 200, Options = [{send_body_as_binary, false}, {receive_body_as_binary, false} | Options0], Headers = [], Query0_ = [ {<<"maxResults">>, maps:get(<<"maxResults">>, QueryMap, undefined)}, {<<"nextToken">>, maps:get(<<"nextToken">>, QueryMap, undefined)} ], Query_ = [H || {_, V} = H <- Query0_, V =/= undefined], request(Client, get, Path, Query_, Headers, undefined, Options, SuccessStatusCode). %% @doc Lists information about assistants. list_assistants(Client) when is_map(Client) -> list_assistants(Client, #{}, #{}). list_assistants(Client, QueryMap, HeadersMap) when is_map(Client), is_map(QueryMap), is_map(HeadersMap) -> list_assistants(Client, QueryMap, HeadersMap, []). list_assistants(Client, QueryMap, HeadersMap, Options0) when is_map(Client), is_map(QueryMap), is_map(HeadersMap), is_list(Options0) -> Path = ["/assistants"], SuccessStatusCode = 200, Options = [{send_body_as_binary, false}, {receive_body_as_binary, false} | Options0], Headers = [], Query0_ = [ {<<"maxResults">>, maps:get(<<"maxResults">>, QueryMap, undefined)}, {<<"nextToken">>, maps:get(<<"nextToken">>, QueryMap, undefined)} ], Query_ = [H || {_, V} = H <- Query0_, V =/= undefined], request(Client, get, Path, Query_, Headers, undefined, Options, SuccessStatusCode). %% @doc Lists the content. list_contents(Client, KnowledgeBaseId) when is_map(Client) -> list_contents(Client, KnowledgeBaseId, #{}, #{}). list_contents(Client, KnowledgeBaseId, QueryMap, HeadersMap) when is_map(Client), is_map(QueryMap), is_map(HeadersMap) -> list_contents(Client, KnowledgeBaseId, QueryMap, HeadersMap, []). list_contents(Client, KnowledgeBaseId, QueryMap, HeadersMap, Options0) when is_map(Client), is_map(QueryMap), is_map(HeadersMap), is_list(Options0) -> Path = ["/knowledgeBases/", aws_util:encode_uri(KnowledgeBaseId), "/contents"], SuccessStatusCode = 200, Options = [{send_body_as_binary, false}, {receive_body_as_binary, false} | Options0], Headers = [], Query0_ = [ {<<"maxResults">>, maps:get(<<"maxResults">>, QueryMap, undefined)}, {<<"nextToken">>, maps:get(<<"nextToken">>, QueryMap, undefined)} ], Query_ = [H || {_, V} = H <- Query0_, V =/= undefined], request(Client, get, Path, Query_, Headers, undefined, Options, SuccessStatusCode). %% @doc Lists information about import jobs. list_import_jobs(Client, KnowledgeBaseId) when is_map(Client) -> list_import_jobs(Client, KnowledgeBaseId, #{}, #{}). list_import_jobs(Client, KnowledgeBaseId, QueryMap, HeadersMap) when is_map(Client), is_map(QueryMap), is_map(HeadersMap) -> list_import_jobs(Client, KnowledgeBaseId, QueryMap, HeadersMap, []). list_import_jobs(Client, KnowledgeBaseId, QueryMap, HeadersMap, Options0) when is_map(Client), is_map(QueryMap), is_map(HeadersMap), is_list(Options0) -> Path = ["/knowledgeBases/", aws_util:encode_uri(KnowledgeBaseId), "/importJobs"], SuccessStatusCode = 200, Options = [{send_body_as_binary, false}, {receive_body_as_binary, false} | Options0], Headers = [], Query0_ = [ {<<"maxResults">>, maps:get(<<"maxResults">>, QueryMap, undefined)}, {<<"nextToken">>, maps:get(<<"nextToken">>, QueryMap, undefined)} ], Query_ = [H || {_, V} = H <- Query0_, V =/= undefined], request(Client, get, Path, Query_, Headers, undefined, Options, SuccessStatusCode). %% @doc Lists the knowledge bases. list_knowledge_bases(Client) when is_map(Client) -> list_knowledge_bases(Client, #{}, #{}). list_knowledge_bases(Client, QueryMap, HeadersMap) when is_map(Client), is_map(QueryMap), is_map(HeadersMap) -> list_knowledge_bases(Client, QueryMap, HeadersMap, []). list_knowledge_bases(Client, QueryMap, HeadersMap, Options0) when is_map(Client), is_map(QueryMap), is_map(HeadersMap), is_list(Options0) -> Path = ["/knowledgeBases"], SuccessStatusCode = 200, Options = [{send_body_as_binary, false}, {receive_body_as_binary, false} | Options0], Headers = [], Query0_ = [ {<<"maxResults">>, maps:get(<<"maxResults">>, QueryMap, undefined)}, {<<"nextToken">>, maps:get(<<"nextToken">>, QueryMap, undefined)} ], Query_ = [H || {_, V} = H <- Query0_, V =/= undefined], request(Client, get, Path, Query_, Headers, undefined, Options, SuccessStatusCode). %% @doc Lists information about quick response. list_quick_responses(Client, KnowledgeBaseId) when is_map(Client) -> list_quick_responses(Client, KnowledgeBaseId, #{}, #{}). list_quick_responses(Client, KnowledgeBaseId, QueryMap, HeadersMap) when is_map(Client), is_map(QueryMap), is_map(HeadersMap) -> list_quick_responses(Client, KnowledgeBaseId, QueryMap, HeadersMap, []). list_quick_responses(Client, KnowledgeBaseId, QueryMap, HeadersMap, Options0) when is_map(Client), is_map(QueryMap), is_map(HeadersMap), is_list(Options0) -> Path = ["/knowledgeBases/", aws_util:encode_uri(KnowledgeBaseId), "/quickResponses"], SuccessStatusCode = 200, Options = [{send_body_as_binary, false}, {receive_body_as_binary, false} | Options0], Headers = [], Query0_ = [ {<<"maxResults">>, maps:get(<<"maxResults">>, QueryMap, undefined)}, {<<"nextToken">>, maps:get(<<"nextToken">>, QueryMap, undefined)} ], Query_ = [H || {_, V} = H <- Query0_, V =/= undefined], request(Client, get, Path, Query_, Headers, undefined, Options, SuccessStatusCode). %% @doc Lists the tags for the specified resource. list_tags_for_resource(Client, ResourceArn) when is_map(Client) -> list_tags_for_resource(Client, ResourceArn, #{}, #{}). list_tags_for_resource(Client, ResourceArn, QueryMap, HeadersMap) when is_map(Client), is_map(QueryMap), is_map(HeadersMap) -> list_tags_for_resource(Client, ResourceArn, QueryMap, HeadersMap, []). list_tags_for_resource(Client, ResourceArn, QueryMap, HeadersMap, Options0) when is_map(Client), is_map(QueryMap), is_map(HeadersMap), is_list(Options0) -> Path = ["/tags/", aws_util:encode_uri(ResourceArn), ""], SuccessStatusCode = 200, Options = [{send_body_as_binary, false}, {receive_body_as_binary, false} | Options0], Headers = [], Query_ = [], request(Client, get, Path, Query_, Headers, undefined, Options, SuccessStatusCode). %% @doc Removes the specified recommendations from the specified %% assistant's queue of newly available recommendations. %% %% You can use this API in conjunction with GetRecommendations: %% https://docs.aws.amazon.com/wisdom/latest/APIReference/API_GetRecommendations.html %% and a `waitTimeSeconds' input for long-polling behavior and avoiding %% duplicate recommendations. notify_recommendations_received(Client, AssistantId, SessionId, Input) -> notify_recommendations_received(Client, AssistantId, SessionId, Input, []). notify_recommendations_received(Client, AssistantId, SessionId, Input0, Options0) -> Method = post, Path = ["/assistants/", aws_util:encode_uri(AssistantId), "/sessions/", aws_util:encode_uri(SessionId), "/recommendations/notify"], SuccessStatusCode = 200, Options = [{send_body_as_binary, false}, {receive_body_as_binary, false}, {append_sha256_content_hash, false} | Options0], Headers = [], Input1 = Input0, CustomHeaders = [], Input2 = Input1, Query_ = [], Input = Input2, request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). %% @doc Performs a manual search against the specified assistant. %% %% To retrieve recommendations for an assistant, use GetRecommendations: %% https://docs.aws.amazon.com/wisdom/latest/APIReference/API_GetRecommendations.html. query_assistant(Client, AssistantId, Input) -> query_assistant(Client, AssistantId, Input, []). query_assistant(Client, AssistantId, Input0, Options0) -> Method = post, Path = ["/assistants/", aws_util:encode_uri(AssistantId), "/query"], SuccessStatusCode = 200, Options = [{send_body_as_binary, false}, {receive_body_as_binary, false}, {append_sha256_content_hash, false} | Options0], Headers = [], Input1 = Input0, CustomHeaders = [], Input2 = Input1, Query_ = [], Input = Input2, request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). %% @doc Removes a URI template from a knowledge base. remove_knowledge_base_template_uri(Client, KnowledgeBaseId, Input) -> remove_knowledge_base_template_uri(Client, KnowledgeBaseId, Input, []). remove_knowledge_base_template_uri(Client, KnowledgeBaseId, Input0, Options0) -> Method = delete, Path = ["/knowledgeBases/", aws_util:encode_uri(KnowledgeBaseId), "/templateUri"], SuccessStatusCode = 204, Options = [{send_body_as_binary, false}, {receive_body_as_binary, false}, {append_sha256_content_hash, false} | Options0], Headers = [], Input1 = Input0, CustomHeaders = [], Input2 = Input1, Query_ = [], Input = Input2, request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). %% @doc Searches for content in a specified knowledge base. %% %% Can be used to get a specific content resource by its name. search_content(Client, KnowledgeBaseId, Input) -> search_content(Client, KnowledgeBaseId, Input, []). search_content(Client, KnowledgeBaseId, Input0, Options0) -> Method = post, Path = ["/knowledgeBases/", aws_util:encode_uri(KnowledgeBaseId), "/search"], SuccessStatusCode = 200, Options = [{send_body_as_binary, false}, {receive_body_as_binary, false}, {append_sha256_content_hash, false} | Options0], Headers = [], Input1 = Input0, CustomHeaders = [], Input2 = Input1, QueryMapping = [ {<<"maxResults">>, <<"maxResults">>}, {<<"nextToken">>, <<"nextToken">>} ], {Query_, Input} = aws_request:build_headers(QueryMapping, Input2), request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). %% @doc Searches existing Wisdom quick responses in a Wisdom knowledge base. search_quick_responses(Client, KnowledgeBaseId, Input) -> search_quick_responses(Client, KnowledgeBaseId, Input, []). search_quick_responses(Client, KnowledgeBaseId, Input0, Options0) -> Method = post, Path = ["/knowledgeBases/", aws_util:encode_uri(KnowledgeBaseId), "/search/quickResponses"], SuccessStatusCode = 200, Options = [{send_body_as_binary, false}, {receive_body_as_binary, false}, {append_sha256_content_hash, false} | Options0], Headers = [], Input1 = Input0, CustomHeaders = [], Input2 = Input1, QueryMapping = [ {<<"maxResults">>, <<"maxResults">>}, {<<"nextToken">>, <<"nextToken">>} ], {Query_, Input} = aws_request:build_headers(QueryMapping, Input2), request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). %% @doc Searches for sessions. search_sessions(Client, AssistantId, Input) -> search_sessions(Client, AssistantId, Input, []). search_sessions(Client, AssistantId, Input0, Options0) -> Method = post, Path = ["/assistants/", aws_util:encode_uri(AssistantId), "/searchSessions"], SuccessStatusCode = 200, Options = [{send_body_as_binary, false}, {receive_body_as_binary, false}, {append_sha256_content_hash, false} | Options0], Headers = [], Input1 = Input0, CustomHeaders = [], Input2 = Input1, QueryMapping = [ {<<"maxResults">>, <<"maxResults">>}, {<<"nextToken">>, <<"nextToken">>} ], {Query_, Input} = aws_request:build_headers(QueryMapping, Input2), request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). %% @doc Get a URL to upload content to a knowledge base. %% %% To upload content, first make a PUT request to the returned URL with your %% file, making sure to include the required headers. Then use CreateContent: %% https://docs.aws.amazon.com/wisdom/latest/APIReference/API_CreateContent.html %% to finalize the content creation process or UpdateContent: %% https://docs.aws.amazon.com/wisdom/latest/APIReference/API_UpdateContent.html %% to modify an existing resource. You can only upload content to a knowledge %% base of type CUSTOM. start_content_upload(Client, KnowledgeBaseId, Input) -> start_content_upload(Client, KnowledgeBaseId, Input, []). start_content_upload(Client, KnowledgeBaseId, Input0, Options0) -> Method = post, Path = ["/knowledgeBases/", aws_util:encode_uri(KnowledgeBaseId), "/upload"], SuccessStatusCode = 200, Options = [{send_body_as_binary, false}, {receive_body_as_binary, false}, {append_sha256_content_hash, false} | Options0], Headers = [], Input1 = Input0, CustomHeaders = [], Input2 = Input1, Query_ = [], Input = Input2, request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). %% @doc Start an asynchronous job to import Wisdom resources from an uploaded %% source file. %% %% Before calling this API, use StartContentUpload: %% https://docs.aws.amazon.com/wisdom/latest/APIReference/API_StartContentUpload.html %% to upload an asset that contains the resource data. %% %%