egain-api-python 0.1.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- egain_api_python/__init__.py +17 -0
- egain_api_python/_hooks/__init__.py +5 -0
- egain_api_python/_hooks/registration.py +13 -0
- egain_api_python/_hooks/sdkhooks.py +76 -0
- egain_api_python/_hooks/types.py +112 -0
- egain_api_python/_version.py +15 -0
- egain_api_python/aiservices.py +23 -0
- egain_api_python/answers.py +281 -0
- egain_api_python/articlelists.py +469 -0
- egain_api_python/basesdk.py +368 -0
- egain_api_python/connectorssearchevents.py +537 -0
- egain_api_python/content.py +23 -0
- egain_api_python/errors/__init__.py +78 -0
- egain_api_python/errors/egaindefaulterror.py +40 -0
- egain_api_python/errors/egainerror.py +30 -0
- egain_api_python/errors/gethealthop.py +74 -0
- egain_api_python/errors/no_response_error.py +17 -0
- egain_api_python/errors/responsevalidationerror.py +27 -0
- egain_api_python/errors/schemas_wserrorcommon.py +51 -0
- egain_api_python/errors/wserrorcommon.py +49 -0
- egain_api_python/escalation.py +955 -0
- egain_api_python/export.py +487 -0
- egain_api_python/federatedsearchevent.py +287 -0
- egain_api_python/general.py +925 -0
- egain_api_python/guidedhelp.py +3373 -0
- egain_api_python/health.py +253 -0
- egain_api_python/httpclient.py +125 -0
- egain_api_python/import_.py +1161 -0
- egain_api_python/models/__init__.py +2136 -0
- egain_api_python/models/acceptghsolutionop.py +52 -0
- egain_api_python/models/acceptlanguage.py +23 -0
- egain_api_python/models/accessibleportal.py +37 -0
- egain_api_python/models/action.py +56 -0
- egain_api_python/models/actionsearch.py +92 -0
- egain_api_python/models/addasreferenceop.py +52 -0
- egain_api_python/models/addbookmarkop.py +43 -0
- egain_api_python/models/additionalsnippets.py +57 -0
- egain_api_python/models/addtoreplyop.py +52 -0
- egain_api_python/models/aisearchop.py +131 -0
- egain_api_python/models/aisearchresponse.py +67 -0
- egain_api_python/models/allaccessibleportals.py +28 -0
- egain_api_python/models/answer.py +21 -0
- egain_api_python/models/answeredquestion.py +125 -0
- egain_api_python/models/answerrange.py +41 -0
- egain_api_python/models/answersrequest.py +78 -0
- egain_api_python/models/answersresponse.py +93 -0
- egain_api_python/models/article.py +241 -0
- egain_api_python/models/articleactivitylink.py +62 -0
- egain_api_python/models/articleadditionalattributes.py +23 -0
- egain_api_python/models/articleaisearchresult.py +254 -0
- egain_api_python/models/articleattachment.py +44 -0
- egain_api_python/models/articlelist.py +48 -0
- egain_api_python/models/articlelistresult.py +38 -0
- egain_api_python/models/articlelistsresult.py +22 -0
- egain_api_python/models/articlepermissions.py +25 -0
- egain_api_python/models/articlepermissionsresult.py +27 -0
- egain_api_python/models/articlerating.py +51 -0
- egain_api_python/models/articleratingsresponse.py +28 -0
- egain_api_python/models/articleresult.py +159 -0
- egain_api_python/models/articleresultadditionalattributes.py +22 -0
- egain_api_python/models/articleresults.py +32 -0
- egain_api_python/models/articlesearchresult.py +243 -0
- egain_api_python/models/articlesearchresults.py +32 -0
- egain_api_python/models/articlesort.py +11 -0
- egain_api_python/models/articlesortorder.py +11 -0
- egain_api_python/models/articletype.py +56 -0
- egain_api_python/models/articlewitheditions.py +227 -0
- egain_api_python/models/attachment.py +31 -0
- egain_api_python/models/attachmentadditionalattributes.py +10 -0
- egain_api_python/models/attachmentcontent.py +57 -0
- egain_api_python/models/attachmentcontentresult.py +22 -0
- egain_api_python/models/attachmentforcreatesuggestion.py +25 -0
- egain_api_python/models/attachments.py +35 -0
- egain_api_python/models/attachmentsummary.py +37 -0
- egain_api_python/models/attachmentupload.py +20 -0
- egain_api_python/models/avertcustomerescalationop.py +44 -0
- egain_api_python/models/bookmark.py +57 -0
- egain_api_python/models/bookmarkresult.py +26 -0
- egain_api_python/models/bookmarkstatus.py +34 -0
- egain_api_python/models/case.py +158 -0
- egain_api_python/models/caseadditionalattributes.py +11 -0
- egain_api_python/models/caseanswer.py +21 -0
- egain_api_python/models/casebase.py +67 -0
- egain_api_python/models/casebaseresult.py +28 -0
- egain_api_python/models/casebasesearchsettings.py +26 -0
- egain_api_python/models/caselistresult.py +74 -0
- egain_api_python/models/caselistresults.py +28 -0
- egain_api_python/models/casequestion.py +16 -0
- egain_api_python/models/casequestiondetail.py +29 -0
- egain_api_python/models/casesearch.py +80 -0
- egain_api_python/models/clusterid.py +16 -0
- egain_api_python/models/clusterresult.py +37 -0
- egain_api_python/models/clusterresults.py +28 -0
- egain_api_python/models/comment.py +33 -0
- egain_api_python/models/comments.py +26 -0
- egain_api_python/models/completecustomerescalationop.py +44 -0
- egain_api_python/models/compliancearticleresult.py +166 -0
- egain_api_python/models/compliancearticleresultadditionalattributes.py +22 -0
- egain_api_python/models/compliancearticleresults.py +35 -0
- egain_api_python/models/complianceforarticle.py +59 -0
- egain_api_python/models/complyarticleop.py +40 -0
- egain_api_python/models/components_schemas_tag.py +25 -0
- egain_api_python/models/components_schemas_tagcategory.py +39 -0
- egain_api_python/models/components_schemas_taggroup.py +25 -0
- egain_api_python/models/configurableattribute.py +25 -0
- egain_api_python/models/configurableattributes.py +15 -0
- egain_api_python/models/contactperson.py +43 -0
- egain_api_python/models/contacts.py +21 -0
- egain_api_python/models/createbookmark.py +64 -0
- egain_api_python/models/createdby.py +37 -0
- egain_api_python/models/createfederatedsearchevent.py +85 -0
- egain_api_python/models/createfederatedsearchresulteventop.py +46 -0
- egain_api_python/models/createimportop.py +20 -0
- egain_api_python/models/createimportvalidationop.py +20 -0
- egain_api_python/models/createquickpick.py +34 -0
- egain_api_python/models/createquickpickop.py +55 -0
- egain_api_python/models/createsearchresulteventforconnectors.py +71 -0
- egain_api_python/models/createsearchresulteventforconnectorsop.py +48 -0
- egain_api_python/models/createsignedurlop.py +29 -0
- egain_api_python/models/createsuggestion.py +126 -0
- egain_api_python/models/createviewedsearchresulteventforconnectors.py +76 -0
- egain_api_python/models/createviewedsearchresultseventforconnectorsop.py +48 -0
- egain_api_python/models/customattribute.py +35 -0
- egain_api_python/models/deletebookmarkop.py +40 -0
- egain_api_python/models/deletesuggestionop.py +40 -0
- egain_api_python/models/department.py +21 -0
- egain_api_python/models/detailfield.py +32 -0
- egain_api_python/models/displayfield.py +27 -0
- egain_api_python/models/dynamiccluster.py +21 -0
- egain_api_python/models/dynamicsearch.py +40 -0
- egain_api_python/models/edition.py +79 -0
- egain_api_python/models/editionwithcontent.py +68 -0
- egain_api_python/models/email.py +21 -0
- egain_api_python/models/exportcontentop.py +14 -0
- egain_api_python/models/exportstatus.py +106 -0
- egain_api_python/models/exportstatusop.py +31 -0
- egain_api_python/models/feedbackarticleforsuggestion.py +34 -0
- egain_api_python/models/folderbreadcrumb.py +24 -0
- egain_api_python/models/foldersummary.py +29 -0
- egain_api_python/models/getacknowledgedcompliancearticlesop.py +119 -0
- egain_api_python/models/getallarticlelistsop.py +47 -0
- egain_api_python/models/getallcasebasesreleasesop.py +65 -0
- egain_api_python/models/getallcasesop.py +83 -0
- egain_api_python/models/getallportalsop.py +60 -0
- egain_api_python/models/getallprofilesinportalop.py +64 -0
- egain_api_python/models/getallquickpicksop.py +83 -0
- egain_api_python/models/getalltopicsop.py +132 -0
- egain_api_python/models/getalluserprofilesop.py +47 -0
- egain_api_python/models/getancestortopicsop.py +133 -0
- egain_api_python/models/getannouncementarticlesop.py +134 -0
- egain_api_python/models/getarticleattachmentbyidop.py +31 -0
- egain_api_python/models/getarticlebyidop.py +257 -0
- egain_api_python/models/getarticlebyidwitheditionsop.py +46 -0
- egain_api_python/models/getarticleeditiondetailsop.py +55 -0
- egain_api_python/models/getarticlelistdetailsop.py +115 -0
- egain_api_python/models/getarticlepermissionsbyidop.py +40 -0
- egain_api_python/models/getarticlepersonalizationop.py +73 -0
- egain_api_python/models/getarticleratingsop.py +74 -0
- egain_api_python/models/getarticlesintopicop.py +172 -0
- egain_api_python/models/getattachmentbyidinportalop.py +56 -0
- egain_api_python/models/getbookmarkop.py +31 -0
- egain_api_python/models/getcasebasereleasebyidop.py +64 -0
- egain_api_python/models/getcasebyidop.py +75 -0
- egain_api_python/models/getchildtopicsop.py +150 -0
- egain_api_python/models/getclusterbycasebasereleaseidop.py +74 -0
- egain_api_python/models/gethealthop.py +130 -0
- egain_api_python/models/getimportcontentop.py +46 -0
- egain_api_python/models/getmyportalsop.py +97 -0
- egain_api_python/models/getmysubscriptionop.py +115 -0
- egain_api_python/models/getpendingcompliancearticlesop.py +119 -0
- egain_api_python/models/getpopulararticlesop.py +133 -0
- egain_api_python/models/getportaldetailsbyidop.py +47 -0
- egain_api_python/models/getrelatedarticlesforsuggestionop.py +96 -0
- egain_api_python/models/getrelatedarticlesop.py +143 -0
- egain_api_python/models/getsuggestionattachmentbyidop.py +76 -0
- egain_api_python/models/getsuggestionattachmentsop.py +40 -0
- egain_api_python/models/getsuggestioncommentsop.py +40 -0
- egain_api_python/models/getsuggestionop.py +107 -0
- egain_api_python/models/gettagcategoriesforinterestforportalop.py +46 -0
- egain_api_python/models/gettopicbreadcrumbforarticleop.py +55 -0
- egain_api_python/models/getuserdetailsop.py +22 -0
- egain_api_python/models/getusermilestonesop.py +22 -0
- egain_api_python/models/ghsearchrequest.py +67 -0
- egain_api_python/models/ghsearchresult.py +75 -0
- egain_api_python/models/ghstepsearchrequest.py +64 -0
- egain_api_python/models/image.py +17 -0
- egain_api_python/models/importcontent.py +79 -0
- egain_api_python/models/importstatus.py +29 -0
- egain_api_python/models/kblanguage.py +63 -0
- egain_api_python/models/kblanguagecode.py +48 -0
- egain_api_python/models/kblanguages.py +22 -0
- egain_api_python/models/knowledgeexport.py +237 -0
- egain_api_python/models/l10nstring.py +22 -0
- egain_api_python/models/languagecode.py +39 -0
- egain_api_python/models/languagecode_parameter.py +39 -0
- egain_api_python/models/languagequeryparameter.py +39 -0
- egain_api_python/models/link.py +25 -0
- egain_api_python/models/makesuggestionop.py +44 -0
- egain_api_python/models/mandatorylanguagequeryparameter.py +38 -0
- egain_api_python/models/metadata.py +29 -0
- egain_api_python/models/milestone.py +21 -0
- egain_api_python/models/milestonename.py +26 -0
- egain_api_python/models/milestones.py +21 -0
- egain_api_python/models/modifiedby.py +37 -0
- egain_api_python/models/modifysuggestion.py +78 -0
- egain_api_python/models/modifysuggestionsop.py +44 -0
- egain_api_python/models/optionalarticleattributes.py +20 -0
- egain_api_python/models/order.py +10 -0
- egain_api_python/models/ownedby.py +37 -0
- egain_api_python/models/paginationinfo.py +32 -0
- egain_api_python/models/patchimportcontentvalidationop.py +46 -0
- egain_api_python/models/personalization.py +67 -0
- egain_api_python/models/phone.py +21 -0
- egain_api_python/models/portal.py +102 -0
- egain_api_python/models/portalresult.py +28 -0
- egain_api_python/models/portalsettings.py +398 -0
- egain_api_python/models/post_portalid_answersop.py +88 -0
- egain_api_python/models/post_portalid_retrieveop.py +88 -0
- egain_api_python/models/profile.py +26 -0
- egain_api_python/models/profileresult.py +24 -0
- egain_api_python/models/publishprofile.py +30 -0
- egain_api_python/models/publishview.py +38 -0
- egain_api_python/models/question.py +101 -0
- egain_api_python/models/questionandanswer.py +26 -0
- egain_api_python/models/quickpickrating.py +32 -0
- egain_api_python/models/quickpickresult.py +38 -0
- egain_api_python/models/quickpickresults.py +28 -0
- egain_api_python/models/ratearticleop.py +71 -0
- egain_api_python/models/referenceresponse.py +80 -0
- egain_api_python/models/rejectghsolutionop.py +52 -0
- egain_api_python/models/relatedquestions.py +28 -0
- egain_api_python/models/resourcetype_parameter.py +10 -0
- egain_api_python/models/restorequickpickop.py +63 -0
- egain_api_python/models/retrieverequest.py +47 -0
- egain_api_python/models/retrieveresponse.py +96 -0
- egain_api_python/models/role.py +26 -0
- egain_api_python/models/roletemplate.py +25 -0
- egain_api_python/models/schemas_answer.py +94 -0
- egain_api_python/models/schemas_customattribute.py +35 -0
- egain_api_python/models/schemas_link.py +27 -0
- egain_api_python/models/schemas_tag.py +21 -0
- egain_api_python/models/schemas_tagcategory.py +75 -0
- egain_api_python/models/schemas_taggroup.py +31 -0
- egain_api_python/models/schemas_tags.py +19 -0
- egain_api_python/models/schemas_wserrorcommon.py +17 -0
- egain_api_python/models/searchfilterattribute.py +61 -0
- egain_api_python/models/searchpriortoescalationop.py +108 -0
- egain_api_python/models/searchresult.py +101 -0
- egain_api_python/models/searchsuggestionop.py +93 -0
- egain_api_python/models/security.py +25 -0
- egain_api_python/models/selectuserprofileop.py +44 -0
- egain_api_python/models/sessioncontextvariable.py +17 -0
- egain_api_python/models/shorturl.py +32 -0
- egain_api_python/models/sortidname.py +10 -0
- egain_api_python/models/sortidnamedepartment.py +11 -0
- egain_api_python/models/stage.py +26 -0
- egain_api_python/models/startcustomerescalationop.py +66 -0
- egain_api_python/models/startescalationrequest.py +94 -0
- egain_api_python/models/startghsearchop.py +74 -0
- egain_api_python/models/startquestionandanswer.py +26 -0
- egain_api_python/models/stepghsearchop.py +62 -0
- egain_api_python/models/stringattributevalue.py +30 -0
- egain_api_python/models/structuredauthoringfields.py +33 -0
- egain_api_python/models/subscribearticleop.py +40 -0
- egain_api_python/models/suggestion.py +190 -0
- egain_api_python/models/suggestionadditionalattributes.py +11 -0
- egain_api_python/models/suggestionattachment.py +46 -0
- egain_api_python/models/suggestions.py +28 -0
- egain_api_python/models/tag.py +17 -0
- egain_api_python/models/tagcategoriesforinterest.py +22 -0
- egain_api_python/models/tagcategory.py +34 -0
- egain_api_python/models/taggroup.py +17 -0
- egain_api_python/models/taggroups.py +20 -0
- egain_api_python/models/tags.py +17 -0
- egain_api_python/models/topic.py +113 -0
- egain_api_python/models/topicadditionalattributes.py +20 -0
- egain_api_python/models/topicaisearchresult.py +67 -0
- egain_api_python/models/topicbreadcrumb.py +24 -0
- egain_api_python/models/topicresult.py +26 -0
- egain_api_python/models/topicsummary.py +31 -0
- egain_api_python/models/topictreenode.py +27 -0
- egain_api_python/models/topictreeresult.py +28 -0
- egain_api_python/models/unsubscribearticleop.py +55 -0
- egain_api_python/models/uploadattachmentop.py +36 -0
- egain_api_python/models/userdetails.py +44 -0
- egain_api_python/models/userprofile.py +33 -0
- egain_api_python/models/userprofiles.py +21 -0
- egain_api_python/models/userview.py +33 -0
- egain_api_python/models/validateimportcontent.py +58 -0
- egain_api_python/models/virtualcase.py +52 -0
- egain_api_python/models/workflow.py +21 -0
- egain_api_python/models/workflowmilestone.py +11 -0
- egain_api_python/models/wserrorcommon.py +17 -0
- egain_api_python/populararticles.py +287 -0
- egain_api_python/portal_article.py +4935 -0
- egain_api_python/portal_attachment.py +494 -0
- egain_api_python/portal_bookmark.py +707 -0
- egain_api_python/portal_sdk.py +88 -0
- egain_api_python/portal_suggestion.py +2283 -0
- egain_api_python/portal_topic.py +975 -0
- egain_api_python/portal_userdetails.py +211 -0
- egain_api_python/portal_userprofile.py +431 -0
- egain_api_python/py.typed +1 -0
- egain_api_python/retrieve.py +265 -0
- egain_api_python/sdk.py +216 -0
- egain_api_python/sdkconfiguration.py +50 -0
- egain_api_python/search.py +251 -0
- egain_api_python/types/__init__.py +21 -0
- egain_api_python/types/basemodel.py +39 -0
- egain_api_python/usermilestones.py +219 -0
- egain_api_python/utils/__init__.py +200 -0
- egain_api_python/utils/annotations.py +79 -0
- egain_api_python/utils/datetimes.py +23 -0
- egain_api_python/utils/enums.py +74 -0
- egain_api_python/utils/eventstreaming.py +248 -0
- egain_api_python/utils/forms.py +223 -0
- egain_api_python/utils/headers.py +136 -0
- egain_api_python/utils/logger.py +27 -0
- egain_api_python/utils/metadata.py +118 -0
- egain_api_python/utils/queryparams.py +205 -0
- egain_api_python/utils/requestbodies.py +66 -0
- egain_api_python/utils/retries.py +217 -0
- egain_api_python/utils/security.py +192 -0
- egain_api_python/utils/serializers.py +249 -0
- egain_api_python/utils/unmarshal_json_response.py +24 -0
- egain_api_python/utils/url.py +155 -0
- egain_api_python/utils/values.py +137 -0
- egain_api_python-0.1.1.dist-info/METADATA +827 -0
- egain_api_python-0.1.1.dist-info/RECORD +332 -0
- egain_api_python-0.1.1.dist-info/WHEEL +5 -0
- egain_api_python-0.1.1.dist-info/licenses/LICENSE +21 -0
- egain_api_python-0.1.1.dist-info/top_level.txt +1 -0
@@ -0,0 +1,251 @@
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
2
|
+
|
3
|
+
from .basesdk import BaseSDK
|
4
|
+
from egain_api_python import errors, models, utils
|
5
|
+
from egain_api_python._hooks import HookContext
|
6
|
+
from egain_api_python.types import OptionalNullable, UNSET
|
7
|
+
from egain_api_python.utils import get_security_from_env
|
8
|
+
from egain_api_python.utils.unmarshal_json_response import unmarshal_json_response
|
9
|
+
from typing import Dict, List, Mapping, Optional
|
10
|
+
|
11
|
+
|
12
|
+
class Search(BaseSDK):
|
13
|
+
def ai_search(
|
14
|
+
self,
|
15
|
+
*,
|
16
|
+
q: str,
|
17
|
+
portal_id: str,
|
18
|
+
dollar_filter_user_profile_id: Optional[str] = None,
|
19
|
+
language: Optional[models.LanguageCodeParameter] = None,
|
20
|
+
dollar_filter_tags: Optional[Dict[str, List[str]]] = None,
|
21
|
+
dollar_filter_topic_ids: Optional[List[str]] = None,
|
22
|
+
dollar_filter_exclude_topic_ids: Optional[List[str]] = None,
|
23
|
+
resource_type: Optional[models.ResourceTypeParameter] = None,
|
24
|
+
article_custom_additional_attributes: Optional[str] = None,
|
25
|
+
topic_custom_additional_attributes: Optional[str] = None,
|
26
|
+
pagenum: Optional[int] = 1,
|
27
|
+
pagesize: Optional[int] = 10,
|
28
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
29
|
+
server_url: Optional[str] = None,
|
30
|
+
timeout_ms: Optional[int] = None,
|
31
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
32
|
+
) -> models.AISearchResponse:
|
33
|
+
r"""Get the best search results for a user query
|
34
|
+
|
35
|
+
Submit a user query and receive a list of search results.
|
36
|
+
|
37
|
+
:param q: The search query string. The string must be escaped as required by the URL syntax rules.
|
38
|
+
:param portal_id: The ID of the portal being accessed.<br><br>A portal ID is composed of a 2-4 letter prefix, followed by a dash and 4-15 digits.
|
39
|
+
:param dollar_filter_user_profile_id: The ID of the user profile.
|
40
|
+
:param language: The language that describes the details of a resource. Resources available in different languages may differ from each other. <br><br> If lang is not passed, then the portal's default language is used.
|
41
|
+
:param dollar_filter_tags: An object where each key is a **Category Tag ID** (numeric string), and each value is an array of **Tag IDs** for that category.
|
42
|
+
:param dollar_filter_topic_ids: An array of topic IDs. It is used to restrict search results to specific topics.
|
43
|
+
:param dollar_filter_exclude_topic_ids: An array of topic IDs that will be excluded from the search. It includes articles that belong to the topic.
|
44
|
+
:param resource_type: Type of resource to be fetched.
|
45
|
+
:param article_custom_additional_attributes: One or more comma-separated names for article custom attributes defined by the user to be returned.
|
46
|
+
:param topic_custom_additional_attributes: One or more comma-separated names for topic custom attributes defined by the user to be returned.
|
47
|
+
:param pagenum: Pagination parameter that specifies the page number of results to be returned. Used in conjunction with $pagesize.
|
48
|
+
:param pagesize: Pagination parameter that specifies the number of results per page. Used in conjunction with $pagenum.
|
49
|
+
:param retries: Override the default retry configuration for this method
|
50
|
+
:param server_url: Override the default server URL for this method
|
51
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
52
|
+
:param http_headers: Additional headers to set or replace on requests.
|
53
|
+
"""
|
54
|
+
base_url = None
|
55
|
+
url_variables = None
|
56
|
+
if timeout_ms is None:
|
57
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
58
|
+
|
59
|
+
if server_url is not None:
|
60
|
+
base_url = server_url
|
61
|
+
else:
|
62
|
+
base_url = self._get_url(base_url, url_variables)
|
63
|
+
|
64
|
+
request = models.AiSearchRequest(
|
65
|
+
q=q,
|
66
|
+
portal_id=portal_id,
|
67
|
+
dollar_filter_user_profile_id=dollar_filter_user_profile_id,
|
68
|
+
language=language,
|
69
|
+
dollar_filter_tags=dollar_filter_tags,
|
70
|
+
dollar_filter_topic_ids=dollar_filter_topic_ids,
|
71
|
+
dollar_filter_exclude_topic_ids=dollar_filter_exclude_topic_ids,
|
72
|
+
resource_type=resource_type,
|
73
|
+
article_custom_additional_attributes=article_custom_additional_attributes,
|
74
|
+
topic_custom_additional_attributes=topic_custom_additional_attributes,
|
75
|
+
pagenum=pagenum,
|
76
|
+
pagesize=pagesize,
|
77
|
+
)
|
78
|
+
|
79
|
+
req = self._build_request(
|
80
|
+
method="GET",
|
81
|
+
path="/{portalID}/search",
|
82
|
+
base_url=base_url,
|
83
|
+
url_variables=url_variables,
|
84
|
+
request=request,
|
85
|
+
request_body_required=False,
|
86
|
+
request_has_path_params=True,
|
87
|
+
request_has_query_params=True,
|
88
|
+
user_agent_header="user-agent",
|
89
|
+
accept_header_value="application/json",
|
90
|
+
http_headers=http_headers,
|
91
|
+
security=self.sdk_configuration.security,
|
92
|
+
timeout_ms=timeout_ms,
|
93
|
+
)
|
94
|
+
|
95
|
+
if retries == UNSET:
|
96
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
97
|
+
retries = self.sdk_configuration.retry_config
|
98
|
+
|
99
|
+
retry_config = None
|
100
|
+
if isinstance(retries, utils.RetryConfig):
|
101
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
102
|
+
|
103
|
+
http_res = self.do_request(
|
104
|
+
hook_ctx=HookContext(
|
105
|
+
config=self.sdk_configuration,
|
106
|
+
base_url=base_url or "",
|
107
|
+
operation_id="aiSearch",
|
108
|
+
oauth2_scopes=[],
|
109
|
+
security_source=get_security_from_env(
|
110
|
+
self.sdk_configuration.security, models.Security
|
111
|
+
),
|
112
|
+
),
|
113
|
+
request=req,
|
114
|
+
error_status_codes=["400", "4XX", "500", "5XX"],
|
115
|
+
retry_config=retry_config,
|
116
|
+
)
|
117
|
+
|
118
|
+
if utils.match_response(http_res, "200", "application/json"):
|
119
|
+
return unmarshal_json_response(models.AISearchResponse, http_res)
|
120
|
+
if utils.match_response(http_res, ["400", "4XX"], "*"):
|
121
|
+
http_res_text = utils.stream_to_text(http_res)
|
122
|
+
raise errors.EgainDefaultError(
|
123
|
+
"API error occurred", http_res, http_res_text
|
124
|
+
)
|
125
|
+
if utils.match_response(http_res, ["500", "5XX"], "*"):
|
126
|
+
http_res_text = utils.stream_to_text(http_res)
|
127
|
+
raise errors.EgainDefaultError(
|
128
|
+
"API error occurred", http_res, http_res_text
|
129
|
+
)
|
130
|
+
|
131
|
+
raise errors.EgainDefaultError("Unexpected response received", http_res)
|
132
|
+
|
133
|
+
async def ai_search_async(
|
134
|
+
self,
|
135
|
+
*,
|
136
|
+
q: str,
|
137
|
+
portal_id: str,
|
138
|
+
dollar_filter_user_profile_id: Optional[str] = None,
|
139
|
+
language: Optional[models.LanguageCodeParameter] = None,
|
140
|
+
dollar_filter_tags: Optional[Dict[str, List[str]]] = None,
|
141
|
+
dollar_filter_topic_ids: Optional[List[str]] = None,
|
142
|
+
dollar_filter_exclude_topic_ids: Optional[List[str]] = None,
|
143
|
+
resource_type: Optional[models.ResourceTypeParameter] = None,
|
144
|
+
article_custom_additional_attributes: Optional[str] = None,
|
145
|
+
topic_custom_additional_attributes: Optional[str] = None,
|
146
|
+
pagenum: Optional[int] = 1,
|
147
|
+
pagesize: Optional[int] = 10,
|
148
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
149
|
+
server_url: Optional[str] = None,
|
150
|
+
timeout_ms: Optional[int] = None,
|
151
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
152
|
+
) -> models.AISearchResponse:
|
153
|
+
r"""Get the best search results for a user query
|
154
|
+
|
155
|
+
Submit a user query and receive a list of search results.
|
156
|
+
|
157
|
+
:param q: The search query string. The string must be escaped as required by the URL syntax rules.
|
158
|
+
:param portal_id: The ID of the portal being accessed.<br><br>A portal ID is composed of a 2-4 letter prefix, followed by a dash and 4-15 digits.
|
159
|
+
:param dollar_filter_user_profile_id: The ID of the user profile.
|
160
|
+
:param language: The language that describes the details of a resource. Resources available in different languages may differ from each other. <br><br> If lang is not passed, then the portal's default language is used.
|
161
|
+
:param dollar_filter_tags: An object where each key is a **Category Tag ID** (numeric string), and each value is an array of **Tag IDs** for that category.
|
162
|
+
:param dollar_filter_topic_ids: An array of topic IDs. It is used to restrict search results to specific topics.
|
163
|
+
:param dollar_filter_exclude_topic_ids: An array of topic IDs that will be excluded from the search. It includes articles that belong to the topic.
|
164
|
+
:param resource_type: Type of resource to be fetched.
|
165
|
+
:param article_custom_additional_attributes: One or more comma-separated names for article custom attributes defined by the user to be returned.
|
166
|
+
:param topic_custom_additional_attributes: One or more comma-separated names for topic custom attributes defined by the user to be returned.
|
167
|
+
:param pagenum: Pagination parameter that specifies the page number of results to be returned. Used in conjunction with $pagesize.
|
168
|
+
:param pagesize: Pagination parameter that specifies the number of results per page. Used in conjunction with $pagenum.
|
169
|
+
:param retries: Override the default retry configuration for this method
|
170
|
+
:param server_url: Override the default server URL for this method
|
171
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
172
|
+
:param http_headers: Additional headers to set or replace on requests.
|
173
|
+
"""
|
174
|
+
base_url = None
|
175
|
+
url_variables = None
|
176
|
+
if timeout_ms is None:
|
177
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
178
|
+
|
179
|
+
if server_url is not None:
|
180
|
+
base_url = server_url
|
181
|
+
else:
|
182
|
+
base_url = self._get_url(base_url, url_variables)
|
183
|
+
|
184
|
+
request = models.AiSearchRequest(
|
185
|
+
q=q,
|
186
|
+
portal_id=portal_id,
|
187
|
+
dollar_filter_user_profile_id=dollar_filter_user_profile_id,
|
188
|
+
language=language,
|
189
|
+
dollar_filter_tags=dollar_filter_tags,
|
190
|
+
dollar_filter_topic_ids=dollar_filter_topic_ids,
|
191
|
+
dollar_filter_exclude_topic_ids=dollar_filter_exclude_topic_ids,
|
192
|
+
resource_type=resource_type,
|
193
|
+
article_custom_additional_attributes=article_custom_additional_attributes,
|
194
|
+
topic_custom_additional_attributes=topic_custom_additional_attributes,
|
195
|
+
pagenum=pagenum,
|
196
|
+
pagesize=pagesize,
|
197
|
+
)
|
198
|
+
|
199
|
+
req = self._build_request_async(
|
200
|
+
method="GET",
|
201
|
+
path="/{portalID}/search",
|
202
|
+
base_url=base_url,
|
203
|
+
url_variables=url_variables,
|
204
|
+
request=request,
|
205
|
+
request_body_required=False,
|
206
|
+
request_has_path_params=True,
|
207
|
+
request_has_query_params=True,
|
208
|
+
user_agent_header="user-agent",
|
209
|
+
accept_header_value="application/json",
|
210
|
+
http_headers=http_headers,
|
211
|
+
security=self.sdk_configuration.security,
|
212
|
+
timeout_ms=timeout_ms,
|
213
|
+
)
|
214
|
+
|
215
|
+
if retries == UNSET:
|
216
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
217
|
+
retries = self.sdk_configuration.retry_config
|
218
|
+
|
219
|
+
retry_config = None
|
220
|
+
if isinstance(retries, utils.RetryConfig):
|
221
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
222
|
+
|
223
|
+
http_res = await self.do_request_async(
|
224
|
+
hook_ctx=HookContext(
|
225
|
+
config=self.sdk_configuration,
|
226
|
+
base_url=base_url or "",
|
227
|
+
operation_id="aiSearch",
|
228
|
+
oauth2_scopes=[],
|
229
|
+
security_source=get_security_from_env(
|
230
|
+
self.sdk_configuration.security, models.Security
|
231
|
+
),
|
232
|
+
),
|
233
|
+
request=req,
|
234
|
+
error_status_codes=["400", "4XX", "500", "5XX"],
|
235
|
+
retry_config=retry_config,
|
236
|
+
)
|
237
|
+
|
238
|
+
if utils.match_response(http_res, "200", "application/json"):
|
239
|
+
return unmarshal_json_response(models.AISearchResponse, http_res)
|
240
|
+
if utils.match_response(http_res, ["400", "4XX"], "*"):
|
241
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
242
|
+
raise errors.EgainDefaultError(
|
243
|
+
"API error occurred", http_res, http_res_text
|
244
|
+
)
|
245
|
+
if utils.match_response(http_res, ["500", "5XX"], "*"):
|
246
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
247
|
+
raise errors.EgainDefaultError(
|
248
|
+
"API error occurred", http_res, http_res_text
|
249
|
+
)
|
250
|
+
|
251
|
+
raise errors.EgainDefaultError("Unexpected response received", http_res)
|
@@ -0,0 +1,21 @@
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
2
|
+
|
3
|
+
from .basemodel import (
|
4
|
+
BaseModel,
|
5
|
+
Nullable,
|
6
|
+
OptionalNullable,
|
7
|
+
UnrecognizedInt,
|
8
|
+
UnrecognizedStr,
|
9
|
+
UNSET,
|
10
|
+
UNSET_SENTINEL,
|
11
|
+
)
|
12
|
+
|
13
|
+
__all__ = [
|
14
|
+
"BaseModel",
|
15
|
+
"Nullable",
|
16
|
+
"OptionalNullable",
|
17
|
+
"UnrecognizedInt",
|
18
|
+
"UnrecognizedStr",
|
19
|
+
"UNSET",
|
20
|
+
"UNSET_SENTINEL",
|
21
|
+
]
|
@@ -0,0 +1,39 @@
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
2
|
+
|
3
|
+
from pydantic import ConfigDict, model_serializer
|
4
|
+
from pydantic import BaseModel as PydanticBaseModel
|
5
|
+
from typing import TYPE_CHECKING, Literal, Optional, TypeVar, Union
|
6
|
+
from typing_extensions import TypeAliasType, TypeAlias
|
7
|
+
|
8
|
+
|
9
|
+
class BaseModel(PydanticBaseModel):
|
10
|
+
model_config = ConfigDict(
|
11
|
+
populate_by_name=True, arbitrary_types_allowed=True, protected_namespaces=()
|
12
|
+
)
|
13
|
+
|
14
|
+
|
15
|
+
class Unset(BaseModel):
|
16
|
+
@model_serializer(mode="plain")
|
17
|
+
def serialize_model(self):
|
18
|
+
return UNSET_SENTINEL
|
19
|
+
|
20
|
+
def __bool__(self) -> Literal[False]:
|
21
|
+
return False
|
22
|
+
|
23
|
+
|
24
|
+
UNSET = Unset()
|
25
|
+
UNSET_SENTINEL = "~?~unset~?~sentinel~?~"
|
26
|
+
|
27
|
+
|
28
|
+
T = TypeVar("T")
|
29
|
+
if TYPE_CHECKING:
|
30
|
+
Nullable: TypeAlias = Union[T, None]
|
31
|
+
OptionalNullable: TypeAlias = Union[Optional[Nullable[T]], Unset]
|
32
|
+
else:
|
33
|
+
Nullable = TypeAliasType("Nullable", Union[T, None], type_params=(T,))
|
34
|
+
OptionalNullable = TypeAliasType(
|
35
|
+
"OptionalNullable", Union[Optional[Nullable[T]], Unset], type_params=(T,)
|
36
|
+
)
|
37
|
+
|
38
|
+
UnrecognizedInt: TypeAlias = int
|
39
|
+
UnrecognizedStr: TypeAlias = str
|
@@ -0,0 +1,219 @@
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
2
|
+
|
3
|
+
from .basesdk import BaseSDK
|
4
|
+
from egain_api_python import errors, models, utils
|
5
|
+
from egain_api_python._hooks import HookContext
|
6
|
+
from egain_api_python.types import OptionalNullable, UNSET
|
7
|
+
from egain_api_python.utils import get_security_from_env
|
8
|
+
from egain_api_python.utils.unmarshal_json_response import unmarshal_json_response
|
9
|
+
from typing import Any, Mapping, Optional
|
10
|
+
|
11
|
+
|
12
|
+
class Usermilestones(BaseSDK):
|
13
|
+
def get_user_milestones(
|
14
|
+
self,
|
15
|
+
*,
|
16
|
+
accept_language: models.AcceptLanguage,
|
17
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
18
|
+
server_url: Optional[str] = None,
|
19
|
+
timeout_ms: Optional[int] = None,
|
20
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
21
|
+
) -> Optional[models.Milestones]:
|
22
|
+
r"""Get User Milestones
|
23
|
+
|
24
|
+
## Overview
|
25
|
+
The User Milestones API provides information about the milestones of an agent within the article workflow.
|
26
|
+
This API helps track the progress of articles by grouping them into relevant milestones based on their current stage.
|
27
|
+
|
28
|
+
For example, an article might go through Knowledge Workflow Stages like Draft, Initial Review, Staging, Final Review and Publish.
|
29
|
+
Articles in the Draft and Initial Review stages are part of the \"authoring milestone\", while articles in the Staging and Final Review stages are part of the \"staging milestone\".
|
30
|
+
|
31
|
+
|
32
|
+
:param accept_language: The Language locale accepted by the client (used for locale specific fields in resource representation and in error responses).
|
33
|
+
:param retries: Override the default retry configuration for this method
|
34
|
+
:param server_url: Override the default server URL for this method
|
35
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
36
|
+
:param http_headers: Additional headers to set or replace on requests.
|
37
|
+
"""
|
38
|
+
base_url = None
|
39
|
+
url_variables = None
|
40
|
+
if timeout_ms is None:
|
41
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
42
|
+
|
43
|
+
if server_url is not None:
|
44
|
+
base_url = server_url
|
45
|
+
else:
|
46
|
+
base_url = self._get_url(base_url, url_variables)
|
47
|
+
|
48
|
+
request = models.GetUserMilestonesRequest(
|
49
|
+
accept_language=accept_language,
|
50
|
+
)
|
51
|
+
|
52
|
+
req = self._build_request(
|
53
|
+
method="GET",
|
54
|
+
path="/portals/user/milestones",
|
55
|
+
base_url=base_url,
|
56
|
+
url_variables=url_variables,
|
57
|
+
request=request,
|
58
|
+
request_body_required=False,
|
59
|
+
request_has_path_params=False,
|
60
|
+
request_has_query_params=True,
|
61
|
+
user_agent_header="user-agent",
|
62
|
+
accept_header_value="application/json",
|
63
|
+
http_headers=http_headers,
|
64
|
+
security=self.sdk_configuration.security,
|
65
|
+
timeout_ms=timeout_ms,
|
66
|
+
)
|
67
|
+
|
68
|
+
if retries == UNSET:
|
69
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
70
|
+
retries = self.sdk_configuration.retry_config
|
71
|
+
|
72
|
+
retry_config = None
|
73
|
+
if isinstance(retries, utils.RetryConfig):
|
74
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
75
|
+
|
76
|
+
http_res = self.do_request(
|
77
|
+
hook_ctx=HookContext(
|
78
|
+
config=self.sdk_configuration,
|
79
|
+
base_url=base_url or "",
|
80
|
+
operation_id="getUserMilestones",
|
81
|
+
oauth2_scopes=[],
|
82
|
+
security_source=get_security_from_env(
|
83
|
+
self.sdk_configuration.security, models.Security
|
84
|
+
),
|
85
|
+
),
|
86
|
+
request=req,
|
87
|
+
error_status_codes=["400", "401", "403", "406", "4XX", "500", "5XX"],
|
88
|
+
retry_config=retry_config,
|
89
|
+
)
|
90
|
+
|
91
|
+
response_data: Any = None
|
92
|
+
if utils.match_response(http_res, "200", "application/json"):
|
93
|
+
return unmarshal_json_response(models.Milestones, http_res)
|
94
|
+
if utils.match_response(http_res, "204", "*"):
|
95
|
+
return None
|
96
|
+
if utils.match_response(
|
97
|
+
http_res, ["400", "401", "403", "406"], "application/json"
|
98
|
+
):
|
99
|
+
response_data = unmarshal_json_response(errors.WSErrorCommonData, http_res)
|
100
|
+
raise errors.WSErrorCommon(response_data, http_res)
|
101
|
+
if utils.match_response(http_res, "500", "application/json"):
|
102
|
+
response_data = unmarshal_json_response(errors.WSErrorCommonData, http_res)
|
103
|
+
raise errors.WSErrorCommon(response_data, http_res)
|
104
|
+
if utils.match_response(http_res, "4XX", "*"):
|
105
|
+
http_res_text = utils.stream_to_text(http_res)
|
106
|
+
raise errors.EgainDefaultError(
|
107
|
+
"API error occurred", http_res, http_res_text
|
108
|
+
)
|
109
|
+
if utils.match_response(http_res, "5XX", "*"):
|
110
|
+
http_res_text = utils.stream_to_text(http_res)
|
111
|
+
raise errors.EgainDefaultError(
|
112
|
+
"API error occurred", http_res, http_res_text
|
113
|
+
)
|
114
|
+
|
115
|
+
raise errors.EgainDefaultError("Unexpected response received", http_res)
|
116
|
+
|
117
|
+
async def get_user_milestones_async(
|
118
|
+
self,
|
119
|
+
*,
|
120
|
+
accept_language: models.AcceptLanguage,
|
121
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
122
|
+
server_url: Optional[str] = None,
|
123
|
+
timeout_ms: Optional[int] = None,
|
124
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
125
|
+
) -> Optional[models.Milestones]:
|
126
|
+
r"""Get User Milestones
|
127
|
+
|
128
|
+
## Overview
|
129
|
+
The User Milestones API provides information about the milestones of an agent within the article workflow.
|
130
|
+
This API helps track the progress of articles by grouping them into relevant milestones based on their current stage.
|
131
|
+
|
132
|
+
For example, an article might go through Knowledge Workflow Stages like Draft, Initial Review, Staging, Final Review and Publish.
|
133
|
+
Articles in the Draft and Initial Review stages are part of the \"authoring milestone\", while articles in the Staging and Final Review stages are part of the \"staging milestone\".
|
134
|
+
|
135
|
+
|
136
|
+
:param accept_language: The Language locale accepted by the client (used for locale specific fields in resource representation and in error responses).
|
137
|
+
:param retries: Override the default retry configuration for this method
|
138
|
+
:param server_url: Override the default server URL for this method
|
139
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
140
|
+
:param http_headers: Additional headers to set or replace on requests.
|
141
|
+
"""
|
142
|
+
base_url = None
|
143
|
+
url_variables = None
|
144
|
+
if timeout_ms is None:
|
145
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
146
|
+
|
147
|
+
if server_url is not None:
|
148
|
+
base_url = server_url
|
149
|
+
else:
|
150
|
+
base_url = self._get_url(base_url, url_variables)
|
151
|
+
|
152
|
+
request = models.GetUserMilestonesRequest(
|
153
|
+
accept_language=accept_language,
|
154
|
+
)
|
155
|
+
|
156
|
+
req = self._build_request_async(
|
157
|
+
method="GET",
|
158
|
+
path="/portals/user/milestones",
|
159
|
+
base_url=base_url,
|
160
|
+
url_variables=url_variables,
|
161
|
+
request=request,
|
162
|
+
request_body_required=False,
|
163
|
+
request_has_path_params=False,
|
164
|
+
request_has_query_params=True,
|
165
|
+
user_agent_header="user-agent",
|
166
|
+
accept_header_value="application/json",
|
167
|
+
http_headers=http_headers,
|
168
|
+
security=self.sdk_configuration.security,
|
169
|
+
timeout_ms=timeout_ms,
|
170
|
+
)
|
171
|
+
|
172
|
+
if retries == UNSET:
|
173
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
174
|
+
retries = self.sdk_configuration.retry_config
|
175
|
+
|
176
|
+
retry_config = None
|
177
|
+
if isinstance(retries, utils.RetryConfig):
|
178
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
179
|
+
|
180
|
+
http_res = await self.do_request_async(
|
181
|
+
hook_ctx=HookContext(
|
182
|
+
config=self.sdk_configuration,
|
183
|
+
base_url=base_url or "",
|
184
|
+
operation_id="getUserMilestones",
|
185
|
+
oauth2_scopes=[],
|
186
|
+
security_source=get_security_from_env(
|
187
|
+
self.sdk_configuration.security, models.Security
|
188
|
+
),
|
189
|
+
),
|
190
|
+
request=req,
|
191
|
+
error_status_codes=["400", "401", "403", "406", "4XX", "500", "5XX"],
|
192
|
+
retry_config=retry_config,
|
193
|
+
)
|
194
|
+
|
195
|
+
response_data: Any = None
|
196
|
+
if utils.match_response(http_res, "200", "application/json"):
|
197
|
+
return unmarshal_json_response(models.Milestones, http_res)
|
198
|
+
if utils.match_response(http_res, "204", "*"):
|
199
|
+
return None
|
200
|
+
if utils.match_response(
|
201
|
+
http_res, ["400", "401", "403", "406"], "application/json"
|
202
|
+
):
|
203
|
+
response_data = unmarshal_json_response(errors.WSErrorCommonData, http_res)
|
204
|
+
raise errors.WSErrorCommon(response_data, http_res)
|
205
|
+
if utils.match_response(http_res, "500", "application/json"):
|
206
|
+
response_data = unmarshal_json_response(errors.WSErrorCommonData, http_res)
|
207
|
+
raise errors.WSErrorCommon(response_data, http_res)
|
208
|
+
if utils.match_response(http_res, "4XX", "*"):
|
209
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
210
|
+
raise errors.EgainDefaultError(
|
211
|
+
"API error occurred", http_res, http_res_text
|
212
|
+
)
|
213
|
+
if utils.match_response(http_res, "5XX", "*"):
|
214
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
215
|
+
raise errors.EgainDefaultError(
|
216
|
+
"API error occurred", http_res, http_res_text
|
217
|
+
)
|
218
|
+
|
219
|
+
raise errors.EgainDefaultError("Unexpected response received", http_res)
|