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.
Files changed (332) hide show
  1. egain_api_python/__init__.py +17 -0
  2. egain_api_python/_hooks/__init__.py +5 -0
  3. egain_api_python/_hooks/registration.py +13 -0
  4. egain_api_python/_hooks/sdkhooks.py +76 -0
  5. egain_api_python/_hooks/types.py +112 -0
  6. egain_api_python/_version.py +15 -0
  7. egain_api_python/aiservices.py +23 -0
  8. egain_api_python/answers.py +281 -0
  9. egain_api_python/articlelists.py +469 -0
  10. egain_api_python/basesdk.py +368 -0
  11. egain_api_python/connectorssearchevents.py +537 -0
  12. egain_api_python/content.py +23 -0
  13. egain_api_python/errors/__init__.py +78 -0
  14. egain_api_python/errors/egaindefaulterror.py +40 -0
  15. egain_api_python/errors/egainerror.py +30 -0
  16. egain_api_python/errors/gethealthop.py +74 -0
  17. egain_api_python/errors/no_response_error.py +17 -0
  18. egain_api_python/errors/responsevalidationerror.py +27 -0
  19. egain_api_python/errors/schemas_wserrorcommon.py +51 -0
  20. egain_api_python/errors/wserrorcommon.py +49 -0
  21. egain_api_python/escalation.py +955 -0
  22. egain_api_python/export.py +487 -0
  23. egain_api_python/federatedsearchevent.py +287 -0
  24. egain_api_python/general.py +925 -0
  25. egain_api_python/guidedhelp.py +3373 -0
  26. egain_api_python/health.py +253 -0
  27. egain_api_python/httpclient.py +125 -0
  28. egain_api_python/import_.py +1161 -0
  29. egain_api_python/models/__init__.py +2136 -0
  30. egain_api_python/models/acceptghsolutionop.py +52 -0
  31. egain_api_python/models/acceptlanguage.py +23 -0
  32. egain_api_python/models/accessibleportal.py +37 -0
  33. egain_api_python/models/action.py +56 -0
  34. egain_api_python/models/actionsearch.py +92 -0
  35. egain_api_python/models/addasreferenceop.py +52 -0
  36. egain_api_python/models/addbookmarkop.py +43 -0
  37. egain_api_python/models/additionalsnippets.py +57 -0
  38. egain_api_python/models/addtoreplyop.py +52 -0
  39. egain_api_python/models/aisearchop.py +131 -0
  40. egain_api_python/models/aisearchresponse.py +67 -0
  41. egain_api_python/models/allaccessibleportals.py +28 -0
  42. egain_api_python/models/answer.py +21 -0
  43. egain_api_python/models/answeredquestion.py +125 -0
  44. egain_api_python/models/answerrange.py +41 -0
  45. egain_api_python/models/answersrequest.py +78 -0
  46. egain_api_python/models/answersresponse.py +93 -0
  47. egain_api_python/models/article.py +241 -0
  48. egain_api_python/models/articleactivitylink.py +62 -0
  49. egain_api_python/models/articleadditionalattributes.py +23 -0
  50. egain_api_python/models/articleaisearchresult.py +254 -0
  51. egain_api_python/models/articleattachment.py +44 -0
  52. egain_api_python/models/articlelist.py +48 -0
  53. egain_api_python/models/articlelistresult.py +38 -0
  54. egain_api_python/models/articlelistsresult.py +22 -0
  55. egain_api_python/models/articlepermissions.py +25 -0
  56. egain_api_python/models/articlepermissionsresult.py +27 -0
  57. egain_api_python/models/articlerating.py +51 -0
  58. egain_api_python/models/articleratingsresponse.py +28 -0
  59. egain_api_python/models/articleresult.py +159 -0
  60. egain_api_python/models/articleresultadditionalattributes.py +22 -0
  61. egain_api_python/models/articleresults.py +32 -0
  62. egain_api_python/models/articlesearchresult.py +243 -0
  63. egain_api_python/models/articlesearchresults.py +32 -0
  64. egain_api_python/models/articlesort.py +11 -0
  65. egain_api_python/models/articlesortorder.py +11 -0
  66. egain_api_python/models/articletype.py +56 -0
  67. egain_api_python/models/articlewitheditions.py +227 -0
  68. egain_api_python/models/attachment.py +31 -0
  69. egain_api_python/models/attachmentadditionalattributes.py +10 -0
  70. egain_api_python/models/attachmentcontent.py +57 -0
  71. egain_api_python/models/attachmentcontentresult.py +22 -0
  72. egain_api_python/models/attachmentforcreatesuggestion.py +25 -0
  73. egain_api_python/models/attachments.py +35 -0
  74. egain_api_python/models/attachmentsummary.py +37 -0
  75. egain_api_python/models/attachmentupload.py +20 -0
  76. egain_api_python/models/avertcustomerescalationop.py +44 -0
  77. egain_api_python/models/bookmark.py +57 -0
  78. egain_api_python/models/bookmarkresult.py +26 -0
  79. egain_api_python/models/bookmarkstatus.py +34 -0
  80. egain_api_python/models/case.py +158 -0
  81. egain_api_python/models/caseadditionalattributes.py +11 -0
  82. egain_api_python/models/caseanswer.py +21 -0
  83. egain_api_python/models/casebase.py +67 -0
  84. egain_api_python/models/casebaseresult.py +28 -0
  85. egain_api_python/models/casebasesearchsettings.py +26 -0
  86. egain_api_python/models/caselistresult.py +74 -0
  87. egain_api_python/models/caselistresults.py +28 -0
  88. egain_api_python/models/casequestion.py +16 -0
  89. egain_api_python/models/casequestiondetail.py +29 -0
  90. egain_api_python/models/casesearch.py +80 -0
  91. egain_api_python/models/clusterid.py +16 -0
  92. egain_api_python/models/clusterresult.py +37 -0
  93. egain_api_python/models/clusterresults.py +28 -0
  94. egain_api_python/models/comment.py +33 -0
  95. egain_api_python/models/comments.py +26 -0
  96. egain_api_python/models/completecustomerescalationop.py +44 -0
  97. egain_api_python/models/compliancearticleresult.py +166 -0
  98. egain_api_python/models/compliancearticleresultadditionalattributes.py +22 -0
  99. egain_api_python/models/compliancearticleresults.py +35 -0
  100. egain_api_python/models/complianceforarticle.py +59 -0
  101. egain_api_python/models/complyarticleop.py +40 -0
  102. egain_api_python/models/components_schemas_tag.py +25 -0
  103. egain_api_python/models/components_schemas_tagcategory.py +39 -0
  104. egain_api_python/models/components_schemas_taggroup.py +25 -0
  105. egain_api_python/models/configurableattribute.py +25 -0
  106. egain_api_python/models/configurableattributes.py +15 -0
  107. egain_api_python/models/contactperson.py +43 -0
  108. egain_api_python/models/contacts.py +21 -0
  109. egain_api_python/models/createbookmark.py +64 -0
  110. egain_api_python/models/createdby.py +37 -0
  111. egain_api_python/models/createfederatedsearchevent.py +85 -0
  112. egain_api_python/models/createfederatedsearchresulteventop.py +46 -0
  113. egain_api_python/models/createimportop.py +20 -0
  114. egain_api_python/models/createimportvalidationop.py +20 -0
  115. egain_api_python/models/createquickpick.py +34 -0
  116. egain_api_python/models/createquickpickop.py +55 -0
  117. egain_api_python/models/createsearchresulteventforconnectors.py +71 -0
  118. egain_api_python/models/createsearchresulteventforconnectorsop.py +48 -0
  119. egain_api_python/models/createsignedurlop.py +29 -0
  120. egain_api_python/models/createsuggestion.py +126 -0
  121. egain_api_python/models/createviewedsearchresulteventforconnectors.py +76 -0
  122. egain_api_python/models/createviewedsearchresultseventforconnectorsop.py +48 -0
  123. egain_api_python/models/customattribute.py +35 -0
  124. egain_api_python/models/deletebookmarkop.py +40 -0
  125. egain_api_python/models/deletesuggestionop.py +40 -0
  126. egain_api_python/models/department.py +21 -0
  127. egain_api_python/models/detailfield.py +32 -0
  128. egain_api_python/models/displayfield.py +27 -0
  129. egain_api_python/models/dynamiccluster.py +21 -0
  130. egain_api_python/models/dynamicsearch.py +40 -0
  131. egain_api_python/models/edition.py +79 -0
  132. egain_api_python/models/editionwithcontent.py +68 -0
  133. egain_api_python/models/email.py +21 -0
  134. egain_api_python/models/exportcontentop.py +14 -0
  135. egain_api_python/models/exportstatus.py +106 -0
  136. egain_api_python/models/exportstatusop.py +31 -0
  137. egain_api_python/models/feedbackarticleforsuggestion.py +34 -0
  138. egain_api_python/models/folderbreadcrumb.py +24 -0
  139. egain_api_python/models/foldersummary.py +29 -0
  140. egain_api_python/models/getacknowledgedcompliancearticlesop.py +119 -0
  141. egain_api_python/models/getallarticlelistsop.py +47 -0
  142. egain_api_python/models/getallcasebasesreleasesop.py +65 -0
  143. egain_api_python/models/getallcasesop.py +83 -0
  144. egain_api_python/models/getallportalsop.py +60 -0
  145. egain_api_python/models/getallprofilesinportalop.py +64 -0
  146. egain_api_python/models/getallquickpicksop.py +83 -0
  147. egain_api_python/models/getalltopicsop.py +132 -0
  148. egain_api_python/models/getalluserprofilesop.py +47 -0
  149. egain_api_python/models/getancestortopicsop.py +133 -0
  150. egain_api_python/models/getannouncementarticlesop.py +134 -0
  151. egain_api_python/models/getarticleattachmentbyidop.py +31 -0
  152. egain_api_python/models/getarticlebyidop.py +257 -0
  153. egain_api_python/models/getarticlebyidwitheditionsop.py +46 -0
  154. egain_api_python/models/getarticleeditiondetailsop.py +55 -0
  155. egain_api_python/models/getarticlelistdetailsop.py +115 -0
  156. egain_api_python/models/getarticlepermissionsbyidop.py +40 -0
  157. egain_api_python/models/getarticlepersonalizationop.py +73 -0
  158. egain_api_python/models/getarticleratingsop.py +74 -0
  159. egain_api_python/models/getarticlesintopicop.py +172 -0
  160. egain_api_python/models/getattachmentbyidinportalop.py +56 -0
  161. egain_api_python/models/getbookmarkop.py +31 -0
  162. egain_api_python/models/getcasebasereleasebyidop.py +64 -0
  163. egain_api_python/models/getcasebyidop.py +75 -0
  164. egain_api_python/models/getchildtopicsop.py +150 -0
  165. egain_api_python/models/getclusterbycasebasereleaseidop.py +74 -0
  166. egain_api_python/models/gethealthop.py +130 -0
  167. egain_api_python/models/getimportcontentop.py +46 -0
  168. egain_api_python/models/getmyportalsop.py +97 -0
  169. egain_api_python/models/getmysubscriptionop.py +115 -0
  170. egain_api_python/models/getpendingcompliancearticlesop.py +119 -0
  171. egain_api_python/models/getpopulararticlesop.py +133 -0
  172. egain_api_python/models/getportaldetailsbyidop.py +47 -0
  173. egain_api_python/models/getrelatedarticlesforsuggestionop.py +96 -0
  174. egain_api_python/models/getrelatedarticlesop.py +143 -0
  175. egain_api_python/models/getsuggestionattachmentbyidop.py +76 -0
  176. egain_api_python/models/getsuggestionattachmentsop.py +40 -0
  177. egain_api_python/models/getsuggestioncommentsop.py +40 -0
  178. egain_api_python/models/getsuggestionop.py +107 -0
  179. egain_api_python/models/gettagcategoriesforinterestforportalop.py +46 -0
  180. egain_api_python/models/gettopicbreadcrumbforarticleop.py +55 -0
  181. egain_api_python/models/getuserdetailsop.py +22 -0
  182. egain_api_python/models/getusermilestonesop.py +22 -0
  183. egain_api_python/models/ghsearchrequest.py +67 -0
  184. egain_api_python/models/ghsearchresult.py +75 -0
  185. egain_api_python/models/ghstepsearchrequest.py +64 -0
  186. egain_api_python/models/image.py +17 -0
  187. egain_api_python/models/importcontent.py +79 -0
  188. egain_api_python/models/importstatus.py +29 -0
  189. egain_api_python/models/kblanguage.py +63 -0
  190. egain_api_python/models/kblanguagecode.py +48 -0
  191. egain_api_python/models/kblanguages.py +22 -0
  192. egain_api_python/models/knowledgeexport.py +237 -0
  193. egain_api_python/models/l10nstring.py +22 -0
  194. egain_api_python/models/languagecode.py +39 -0
  195. egain_api_python/models/languagecode_parameter.py +39 -0
  196. egain_api_python/models/languagequeryparameter.py +39 -0
  197. egain_api_python/models/link.py +25 -0
  198. egain_api_python/models/makesuggestionop.py +44 -0
  199. egain_api_python/models/mandatorylanguagequeryparameter.py +38 -0
  200. egain_api_python/models/metadata.py +29 -0
  201. egain_api_python/models/milestone.py +21 -0
  202. egain_api_python/models/milestonename.py +26 -0
  203. egain_api_python/models/milestones.py +21 -0
  204. egain_api_python/models/modifiedby.py +37 -0
  205. egain_api_python/models/modifysuggestion.py +78 -0
  206. egain_api_python/models/modifysuggestionsop.py +44 -0
  207. egain_api_python/models/optionalarticleattributes.py +20 -0
  208. egain_api_python/models/order.py +10 -0
  209. egain_api_python/models/ownedby.py +37 -0
  210. egain_api_python/models/paginationinfo.py +32 -0
  211. egain_api_python/models/patchimportcontentvalidationop.py +46 -0
  212. egain_api_python/models/personalization.py +67 -0
  213. egain_api_python/models/phone.py +21 -0
  214. egain_api_python/models/portal.py +102 -0
  215. egain_api_python/models/portalresult.py +28 -0
  216. egain_api_python/models/portalsettings.py +398 -0
  217. egain_api_python/models/post_portalid_answersop.py +88 -0
  218. egain_api_python/models/post_portalid_retrieveop.py +88 -0
  219. egain_api_python/models/profile.py +26 -0
  220. egain_api_python/models/profileresult.py +24 -0
  221. egain_api_python/models/publishprofile.py +30 -0
  222. egain_api_python/models/publishview.py +38 -0
  223. egain_api_python/models/question.py +101 -0
  224. egain_api_python/models/questionandanswer.py +26 -0
  225. egain_api_python/models/quickpickrating.py +32 -0
  226. egain_api_python/models/quickpickresult.py +38 -0
  227. egain_api_python/models/quickpickresults.py +28 -0
  228. egain_api_python/models/ratearticleop.py +71 -0
  229. egain_api_python/models/referenceresponse.py +80 -0
  230. egain_api_python/models/rejectghsolutionop.py +52 -0
  231. egain_api_python/models/relatedquestions.py +28 -0
  232. egain_api_python/models/resourcetype_parameter.py +10 -0
  233. egain_api_python/models/restorequickpickop.py +63 -0
  234. egain_api_python/models/retrieverequest.py +47 -0
  235. egain_api_python/models/retrieveresponse.py +96 -0
  236. egain_api_python/models/role.py +26 -0
  237. egain_api_python/models/roletemplate.py +25 -0
  238. egain_api_python/models/schemas_answer.py +94 -0
  239. egain_api_python/models/schemas_customattribute.py +35 -0
  240. egain_api_python/models/schemas_link.py +27 -0
  241. egain_api_python/models/schemas_tag.py +21 -0
  242. egain_api_python/models/schemas_tagcategory.py +75 -0
  243. egain_api_python/models/schemas_taggroup.py +31 -0
  244. egain_api_python/models/schemas_tags.py +19 -0
  245. egain_api_python/models/schemas_wserrorcommon.py +17 -0
  246. egain_api_python/models/searchfilterattribute.py +61 -0
  247. egain_api_python/models/searchpriortoescalationop.py +108 -0
  248. egain_api_python/models/searchresult.py +101 -0
  249. egain_api_python/models/searchsuggestionop.py +93 -0
  250. egain_api_python/models/security.py +25 -0
  251. egain_api_python/models/selectuserprofileop.py +44 -0
  252. egain_api_python/models/sessioncontextvariable.py +17 -0
  253. egain_api_python/models/shorturl.py +32 -0
  254. egain_api_python/models/sortidname.py +10 -0
  255. egain_api_python/models/sortidnamedepartment.py +11 -0
  256. egain_api_python/models/stage.py +26 -0
  257. egain_api_python/models/startcustomerescalationop.py +66 -0
  258. egain_api_python/models/startescalationrequest.py +94 -0
  259. egain_api_python/models/startghsearchop.py +74 -0
  260. egain_api_python/models/startquestionandanswer.py +26 -0
  261. egain_api_python/models/stepghsearchop.py +62 -0
  262. egain_api_python/models/stringattributevalue.py +30 -0
  263. egain_api_python/models/structuredauthoringfields.py +33 -0
  264. egain_api_python/models/subscribearticleop.py +40 -0
  265. egain_api_python/models/suggestion.py +190 -0
  266. egain_api_python/models/suggestionadditionalattributes.py +11 -0
  267. egain_api_python/models/suggestionattachment.py +46 -0
  268. egain_api_python/models/suggestions.py +28 -0
  269. egain_api_python/models/tag.py +17 -0
  270. egain_api_python/models/tagcategoriesforinterest.py +22 -0
  271. egain_api_python/models/tagcategory.py +34 -0
  272. egain_api_python/models/taggroup.py +17 -0
  273. egain_api_python/models/taggroups.py +20 -0
  274. egain_api_python/models/tags.py +17 -0
  275. egain_api_python/models/topic.py +113 -0
  276. egain_api_python/models/topicadditionalattributes.py +20 -0
  277. egain_api_python/models/topicaisearchresult.py +67 -0
  278. egain_api_python/models/topicbreadcrumb.py +24 -0
  279. egain_api_python/models/topicresult.py +26 -0
  280. egain_api_python/models/topicsummary.py +31 -0
  281. egain_api_python/models/topictreenode.py +27 -0
  282. egain_api_python/models/topictreeresult.py +28 -0
  283. egain_api_python/models/unsubscribearticleop.py +55 -0
  284. egain_api_python/models/uploadattachmentop.py +36 -0
  285. egain_api_python/models/userdetails.py +44 -0
  286. egain_api_python/models/userprofile.py +33 -0
  287. egain_api_python/models/userprofiles.py +21 -0
  288. egain_api_python/models/userview.py +33 -0
  289. egain_api_python/models/validateimportcontent.py +58 -0
  290. egain_api_python/models/virtualcase.py +52 -0
  291. egain_api_python/models/workflow.py +21 -0
  292. egain_api_python/models/workflowmilestone.py +11 -0
  293. egain_api_python/models/wserrorcommon.py +17 -0
  294. egain_api_python/populararticles.py +287 -0
  295. egain_api_python/portal_article.py +4935 -0
  296. egain_api_python/portal_attachment.py +494 -0
  297. egain_api_python/portal_bookmark.py +707 -0
  298. egain_api_python/portal_sdk.py +88 -0
  299. egain_api_python/portal_suggestion.py +2283 -0
  300. egain_api_python/portal_topic.py +975 -0
  301. egain_api_python/portal_userdetails.py +211 -0
  302. egain_api_python/portal_userprofile.py +431 -0
  303. egain_api_python/py.typed +1 -0
  304. egain_api_python/retrieve.py +265 -0
  305. egain_api_python/sdk.py +216 -0
  306. egain_api_python/sdkconfiguration.py +50 -0
  307. egain_api_python/search.py +251 -0
  308. egain_api_python/types/__init__.py +21 -0
  309. egain_api_python/types/basemodel.py +39 -0
  310. egain_api_python/usermilestones.py +219 -0
  311. egain_api_python/utils/__init__.py +200 -0
  312. egain_api_python/utils/annotations.py +79 -0
  313. egain_api_python/utils/datetimes.py +23 -0
  314. egain_api_python/utils/enums.py +74 -0
  315. egain_api_python/utils/eventstreaming.py +248 -0
  316. egain_api_python/utils/forms.py +223 -0
  317. egain_api_python/utils/headers.py +136 -0
  318. egain_api_python/utils/logger.py +27 -0
  319. egain_api_python/utils/metadata.py +118 -0
  320. egain_api_python/utils/queryparams.py +205 -0
  321. egain_api_python/utils/requestbodies.py +66 -0
  322. egain_api_python/utils/retries.py +217 -0
  323. egain_api_python/utils/security.py +192 -0
  324. egain_api_python/utils/serializers.py +249 -0
  325. egain_api_python/utils/unmarshal_json_response.py +24 -0
  326. egain_api_python/utils/url.py +155 -0
  327. egain_api_python/utils/values.py +137 -0
  328. egain_api_python-0.1.1.dist-info/METADATA +827 -0
  329. egain_api_python-0.1.1.dist-info/RECORD +332 -0
  330. egain_api_python-0.1.1.dist-info/WHEEL +5 -0
  331. egain_api_python-0.1.1.dist-info/licenses/LICENSE +21 -0
  332. egain_api_python-0.1.1.dist-info/top_level.txt +1 -0
@@ -0,0 +1,1161 @@
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, Union
10
+
11
+
12
+ class Import(BaseSDK):
13
+ def create_import(
14
+ self,
15
+ *,
16
+ data_source: Union[
17
+ models.ImportContentDataSource, models.ImportContentDataSourceTypedDict
18
+ ],
19
+ operation: models.Operation,
20
+ schedule_time: Optional[
21
+ Union[models.ScheduleTime, models.ScheduleTimeTypedDict]
22
+ ] = None,
23
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
24
+ server_url: Optional[str] = None,
25
+ timeout_ms: Optional[int] = None,
26
+ http_headers: Optional[Mapping[str, str]] = None,
27
+ ) -> models.CreateImportResponse:
28
+ r"""Import content from external sources
29
+
30
+ # Import Content
31
+
32
+ ## Overview
33
+ This API initiates a bulk content import operation from Amazon S3 buckets. It creates an asynchronous import job that processes content in the background, allowing you to import large volumes of content without blocking your application.
34
+
35
+ ## How It Works
36
+ 1. **Job Creation**: The API creates an import job and returns a unique job ID
37
+ 2. **Content Processing**: Content is processed asynchronously in the background
38
+ 3. **Status Monitoring**: Use the job ID to monitor progress via the Status API
39
+ 4. **Completion**: Job completes when all content is processed or errors occur
40
+
41
+ ## Supported Operations
42
+ - **Import**: Add new content to the knowledge base
43
+ - **Update**: Modify existing content
44
+
45
+ ## Data Source Types
46
+ - AWS S3 bucket
47
+ - Shared file path
48
+
49
+ ## Best Practices
50
+ - **Scheduling**: Use scheduleTime for off-peak imports to minimize system impact
51
+ - **Monitoring**: Regularly check job status and logs for any issues
52
+ - **Error Handling**: Review failed items and retry with corrections
53
+
54
+ ## Permissions
55
+ | Actor | Permission |
56
+ | ------- | --------|
57
+ | User |<ul><li>User must be a department user.</li><li>Content can only be imported in user's home department.</li><li>User must have 'Author' role.</li><li>Content can only be imported if the user has all the required languages assigned.</li></ul>|
58
+
59
+
60
+ :param data_source:
61
+ :param operation:
62
+ :param schedule_time:
63
+ :param retries: Override the default retry configuration for this method
64
+ :param server_url: Override the default server URL for this method
65
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
66
+ :param http_headers: Additional headers to set or replace on requests.
67
+ """
68
+ base_url = None
69
+ url_variables = None
70
+ if timeout_ms is None:
71
+ timeout_ms = self.sdk_configuration.timeout_ms
72
+
73
+ if server_url is not None:
74
+ base_url = server_url
75
+ else:
76
+ base_url = models.CREATE_IMPORT_OP_SERVERS[0]
77
+ url_variables = {
78
+ "API_DOMAIN": "api.egain.cloud",
79
+ }
80
+
81
+ request = models.ImportContent(
82
+ data_source=utils.get_pydantic_model(
83
+ data_source, models.ImportContentDataSource
84
+ ),
85
+ operation=operation,
86
+ schedule_time=utils.get_pydantic_model(
87
+ schedule_time, Optional[models.ScheduleTime]
88
+ ),
89
+ )
90
+
91
+ req = self._build_request(
92
+ method="POST",
93
+ path="/import/content",
94
+ base_url=base_url,
95
+ url_variables=url_variables,
96
+ request=request,
97
+ request_body_required=True,
98
+ request_has_path_params=False,
99
+ request_has_query_params=True,
100
+ user_agent_header="user-agent",
101
+ accept_header_value="application/json",
102
+ http_headers=http_headers,
103
+ security=self.sdk_configuration.security,
104
+ get_serialized_body=lambda: utils.serialize_request_body(
105
+ request, False, False, "json", models.ImportContent
106
+ ),
107
+ timeout_ms=timeout_ms,
108
+ )
109
+
110
+ if retries == UNSET:
111
+ if self.sdk_configuration.retry_config is not UNSET:
112
+ retries = self.sdk_configuration.retry_config
113
+
114
+ retry_config = None
115
+ if isinstance(retries, utils.RetryConfig):
116
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
117
+
118
+ http_res = self.do_request(
119
+ hook_ctx=HookContext(
120
+ config=self.sdk_configuration,
121
+ base_url=base_url or "",
122
+ operation_id="createImport",
123
+ oauth2_scopes=[],
124
+ security_source=get_security_from_env(
125
+ self.sdk_configuration.security, models.Security
126
+ ),
127
+ ),
128
+ request=req,
129
+ error_status_codes=["400", "401", "403", "406", "412", "4XX", "500", "5XX"],
130
+ retry_config=retry_config,
131
+ )
132
+
133
+ response_data: Any = None
134
+ if utils.match_response(http_res, "202", "*"):
135
+ return models.CreateImportResponse(
136
+ headers=utils.get_response_headers(http_res.headers)
137
+ )
138
+ if utils.match_response(
139
+ http_res, ["400", "401", "403", "406"], "application/json"
140
+ ):
141
+ response_data = unmarshal_json_response(errors.WSErrorCommonData, http_res)
142
+ raise errors.WSErrorCommon(response_data, http_res)
143
+ if utils.match_response(http_res, "412", "application/json"):
144
+ response_data = unmarshal_json_response(
145
+ errors.SchemasWSErrorCommonData, http_res
146
+ )
147
+ raise errors.SchemasWSErrorCommon(response_data, http_res)
148
+ if utils.match_response(http_res, "500", "application/json"):
149
+ response_data = unmarshal_json_response(errors.WSErrorCommonData, http_res)
150
+ raise errors.WSErrorCommon(response_data, http_res)
151
+ if utils.match_response(http_res, "4XX", "*"):
152
+ http_res_text = utils.stream_to_text(http_res)
153
+ raise errors.EgainDefaultError(
154
+ "API error occurred", http_res, http_res_text
155
+ )
156
+ if utils.match_response(http_res, "5XX", "*"):
157
+ http_res_text = utils.stream_to_text(http_res)
158
+ raise errors.EgainDefaultError(
159
+ "API error occurred", http_res, http_res_text
160
+ )
161
+
162
+ raise errors.EgainDefaultError("Unexpected response received", http_res)
163
+
164
+ async def create_import_async(
165
+ self,
166
+ *,
167
+ data_source: Union[
168
+ models.ImportContentDataSource, models.ImportContentDataSourceTypedDict
169
+ ],
170
+ operation: models.Operation,
171
+ schedule_time: Optional[
172
+ Union[models.ScheduleTime, models.ScheduleTimeTypedDict]
173
+ ] = None,
174
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
175
+ server_url: Optional[str] = None,
176
+ timeout_ms: Optional[int] = None,
177
+ http_headers: Optional[Mapping[str, str]] = None,
178
+ ) -> models.CreateImportResponse:
179
+ r"""Import content from external sources
180
+
181
+ # Import Content
182
+
183
+ ## Overview
184
+ This API initiates a bulk content import operation from Amazon S3 buckets. It creates an asynchronous import job that processes content in the background, allowing you to import large volumes of content without blocking your application.
185
+
186
+ ## How It Works
187
+ 1. **Job Creation**: The API creates an import job and returns a unique job ID
188
+ 2. **Content Processing**: Content is processed asynchronously in the background
189
+ 3. **Status Monitoring**: Use the job ID to monitor progress via the Status API
190
+ 4. **Completion**: Job completes when all content is processed or errors occur
191
+
192
+ ## Supported Operations
193
+ - **Import**: Add new content to the knowledge base
194
+ - **Update**: Modify existing content
195
+
196
+ ## Data Source Types
197
+ - AWS S3 bucket
198
+ - Shared file path
199
+
200
+ ## Best Practices
201
+ - **Scheduling**: Use scheduleTime for off-peak imports to minimize system impact
202
+ - **Monitoring**: Regularly check job status and logs for any issues
203
+ - **Error Handling**: Review failed items and retry with corrections
204
+
205
+ ## Permissions
206
+ | Actor | Permission |
207
+ | ------- | --------|
208
+ | User |<ul><li>User must be a department user.</li><li>Content can only be imported in user's home department.</li><li>User must have 'Author' role.</li><li>Content can only be imported if the user has all the required languages assigned.</li></ul>|
209
+
210
+
211
+ :param data_source:
212
+ :param operation:
213
+ :param schedule_time:
214
+ :param retries: Override the default retry configuration for this method
215
+ :param server_url: Override the default server URL for this method
216
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
217
+ :param http_headers: Additional headers to set or replace on requests.
218
+ """
219
+ base_url = None
220
+ url_variables = None
221
+ if timeout_ms is None:
222
+ timeout_ms = self.sdk_configuration.timeout_ms
223
+
224
+ if server_url is not None:
225
+ base_url = server_url
226
+ else:
227
+ base_url = models.CREATE_IMPORT_OP_SERVERS[0]
228
+ url_variables = {
229
+ "API_DOMAIN": "api.egain.cloud",
230
+ }
231
+
232
+ request = models.ImportContent(
233
+ data_source=utils.get_pydantic_model(
234
+ data_source, models.ImportContentDataSource
235
+ ),
236
+ operation=operation,
237
+ schedule_time=utils.get_pydantic_model(
238
+ schedule_time, Optional[models.ScheduleTime]
239
+ ),
240
+ )
241
+
242
+ req = self._build_request_async(
243
+ method="POST",
244
+ path="/import/content",
245
+ base_url=base_url,
246
+ url_variables=url_variables,
247
+ request=request,
248
+ request_body_required=True,
249
+ request_has_path_params=False,
250
+ request_has_query_params=True,
251
+ user_agent_header="user-agent",
252
+ accept_header_value="application/json",
253
+ http_headers=http_headers,
254
+ security=self.sdk_configuration.security,
255
+ get_serialized_body=lambda: utils.serialize_request_body(
256
+ request, False, False, "json", models.ImportContent
257
+ ),
258
+ timeout_ms=timeout_ms,
259
+ )
260
+
261
+ if retries == UNSET:
262
+ if self.sdk_configuration.retry_config is not UNSET:
263
+ retries = self.sdk_configuration.retry_config
264
+
265
+ retry_config = None
266
+ if isinstance(retries, utils.RetryConfig):
267
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
268
+
269
+ http_res = await self.do_request_async(
270
+ hook_ctx=HookContext(
271
+ config=self.sdk_configuration,
272
+ base_url=base_url or "",
273
+ operation_id="createImport",
274
+ oauth2_scopes=[],
275
+ security_source=get_security_from_env(
276
+ self.sdk_configuration.security, models.Security
277
+ ),
278
+ ),
279
+ request=req,
280
+ error_status_codes=["400", "401", "403", "406", "412", "4XX", "500", "5XX"],
281
+ retry_config=retry_config,
282
+ )
283
+
284
+ response_data: Any = None
285
+ if utils.match_response(http_res, "202", "*"):
286
+ return models.CreateImportResponse(
287
+ headers=utils.get_response_headers(http_res.headers)
288
+ )
289
+ if utils.match_response(
290
+ http_res, ["400", "401", "403", "406"], "application/json"
291
+ ):
292
+ response_data = unmarshal_json_response(errors.WSErrorCommonData, http_res)
293
+ raise errors.WSErrorCommon(response_data, http_res)
294
+ if utils.match_response(http_res, "412", "application/json"):
295
+ response_data = unmarshal_json_response(
296
+ errors.SchemasWSErrorCommonData, http_res
297
+ )
298
+ raise errors.SchemasWSErrorCommon(response_data, http_res)
299
+ if utils.match_response(http_res, "500", "application/json"):
300
+ response_data = unmarshal_json_response(errors.WSErrorCommonData, http_res)
301
+ raise errors.WSErrorCommon(response_data, http_res)
302
+ if utils.match_response(http_res, "4XX", "*"):
303
+ http_res_text = await utils.stream_to_text_async(http_res)
304
+ raise errors.EgainDefaultError(
305
+ "API error occurred", http_res, http_res_text
306
+ )
307
+ if utils.match_response(http_res, "5XX", "*"):
308
+ http_res_text = await utils.stream_to_text_async(http_res)
309
+ raise errors.EgainDefaultError(
310
+ "API error occurred", http_res, http_res_text
311
+ )
312
+
313
+ raise errors.EgainDefaultError("Unexpected response received", http_res)
314
+
315
+ def get_import_content(
316
+ self,
317
+ *,
318
+ job_id: str,
319
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
320
+ server_url: Optional[str] = None,
321
+ timeout_ms: Optional[int] = None,
322
+ http_headers: Optional[Mapping[str, str]] = None,
323
+ ) -> models.ImportStatus:
324
+ r"""Get the current status of an import or validation job
325
+
326
+ # Get Import Job Status
327
+
328
+ ## Overview
329
+ This API provides real-time status information for content import and validation operations. Use this endpoint to monitor job progress, check completion status, and access detailed logs and error information.
330
+
331
+ ## Status Values
332
+ - **Scheduled**: Job is queued and waiting for scheduled execution time
333
+ - **In Progress**: Job is actively processing content
334
+ - **Completed**: Job finished successfully
335
+ - **Failed**: Job encountered errors and could not complete
336
+ - **Cancelled**: Job was manually cancelled by user
337
+
338
+ ## Response Information
339
+ - **Current Status**: Real-time job status
340
+ - **Progress Metrics**: Items processed, total items, completion percentage
341
+ - **Log Files**: Location of detailed operation logs
342
+ - **Error Details**: Specific errors encountered during processing
343
+ - **Timing Information**: Start time, estimated completion, actual completion
344
+
345
+ ## Log File Access
346
+ Log files contain detailed information about:
347
+ - Content processing steps
348
+ - Validation results
349
+ - Error details with context
350
+
351
+
352
+ ## Permissions
353
+ | Actor | Permission |
354
+ | ------- | --------|
355
+ | User |<ul><li>User must be a department user.</li><li>User must have 'Author' role.</li><li>The job must have been created by the logged in user, or the logged in user must have 'View' permissions on the user who created the job.</li></ul>|
356
+
357
+
358
+ :param job_id: **Job ID Parameter** The unique identifier for the import or validation job. This ID was returned when the job was created via the Import or Validate API. **Format:** UUID v4 (e.g., 7A84B875-6F75-4C7B-B137-0632B62DB0BD) **Example Usage:** ```bash GET /import/content/7A84B875-6F75-4C7B-B137-0632B62DB0BD/status ```
359
+ :param retries: Override the default retry configuration for this method
360
+ :param server_url: Override the default server URL for this method
361
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
362
+ :param http_headers: Additional headers to set or replace on requests.
363
+ """
364
+ base_url = None
365
+ url_variables = None
366
+ if timeout_ms is None:
367
+ timeout_ms = self.sdk_configuration.timeout_ms
368
+
369
+ if server_url is not None:
370
+ base_url = server_url
371
+ else:
372
+ base_url = models.GET_IMPORT_CONTENT_OP_SERVERS[0]
373
+ url_variables = {
374
+ "API_DOMAIN": "api.egain.cloud",
375
+ }
376
+
377
+ request = models.GetImportContentRequest(
378
+ job_id=job_id,
379
+ )
380
+
381
+ req = self._build_request(
382
+ method="GET",
383
+ path="/import/content/{job_id}/status",
384
+ base_url=base_url,
385
+ url_variables=url_variables,
386
+ request=request,
387
+ request_body_required=False,
388
+ request_has_path_params=True,
389
+ request_has_query_params=True,
390
+ user_agent_header="user-agent",
391
+ accept_header_value="application/json",
392
+ http_headers=http_headers,
393
+ security=self.sdk_configuration.security,
394
+ timeout_ms=timeout_ms,
395
+ )
396
+
397
+ if retries == UNSET:
398
+ if self.sdk_configuration.retry_config is not UNSET:
399
+ retries = self.sdk_configuration.retry_config
400
+
401
+ retry_config = None
402
+ if isinstance(retries, utils.RetryConfig):
403
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
404
+
405
+ http_res = self.do_request(
406
+ hook_ctx=HookContext(
407
+ config=self.sdk_configuration,
408
+ base_url=base_url or "",
409
+ operation_id="getImportContent",
410
+ oauth2_scopes=[],
411
+ security_source=get_security_from_env(
412
+ self.sdk_configuration.security, models.Security
413
+ ),
414
+ ),
415
+ request=req,
416
+ error_status_codes=["400", "401", "403", "404", "406", "4XX", "500", "5XX"],
417
+ retry_config=retry_config,
418
+ )
419
+
420
+ response_data: Any = None
421
+ if utils.match_response(http_res, "200", "application/json"):
422
+ return unmarshal_json_response(models.ImportStatus, http_res)
423
+ if utils.match_response(
424
+ http_res, ["400", "401", "403", "404", "406"], "application/json"
425
+ ):
426
+ response_data = unmarshal_json_response(errors.WSErrorCommonData, http_res)
427
+ raise errors.WSErrorCommon(response_data, http_res)
428
+ if utils.match_response(http_res, "500", "application/json"):
429
+ response_data = unmarshal_json_response(errors.WSErrorCommonData, http_res)
430
+ raise errors.WSErrorCommon(response_data, http_res)
431
+ if utils.match_response(http_res, "4XX", "*"):
432
+ http_res_text = utils.stream_to_text(http_res)
433
+ raise errors.EgainDefaultError(
434
+ "API error occurred", http_res, http_res_text
435
+ )
436
+ if utils.match_response(http_res, "5XX", "*"):
437
+ http_res_text = utils.stream_to_text(http_res)
438
+ raise errors.EgainDefaultError(
439
+ "API error occurred", http_res, http_res_text
440
+ )
441
+
442
+ raise errors.EgainDefaultError("Unexpected response received", http_res)
443
+
444
+ async def get_import_content_async(
445
+ self,
446
+ *,
447
+ job_id: str,
448
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
449
+ server_url: Optional[str] = None,
450
+ timeout_ms: Optional[int] = None,
451
+ http_headers: Optional[Mapping[str, str]] = None,
452
+ ) -> models.ImportStatus:
453
+ r"""Get the current status of an import or validation job
454
+
455
+ # Get Import Job Status
456
+
457
+ ## Overview
458
+ This API provides real-time status information for content import and validation operations. Use this endpoint to monitor job progress, check completion status, and access detailed logs and error information.
459
+
460
+ ## Status Values
461
+ - **Scheduled**: Job is queued and waiting for scheduled execution time
462
+ - **In Progress**: Job is actively processing content
463
+ - **Completed**: Job finished successfully
464
+ - **Failed**: Job encountered errors and could not complete
465
+ - **Cancelled**: Job was manually cancelled by user
466
+
467
+ ## Response Information
468
+ - **Current Status**: Real-time job status
469
+ - **Progress Metrics**: Items processed, total items, completion percentage
470
+ - **Log Files**: Location of detailed operation logs
471
+ - **Error Details**: Specific errors encountered during processing
472
+ - **Timing Information**: Start time, estimated completion, actual completion
473
+
474
+ ## Log File Access
475
+ Log files contain detailed information about:
476
+ - Content processing steps
477
+ - Validation results
478
+ - Error details with context
479
+
480
+
481
+ ## Permissions
482
+ | Actor | Permission |
483
+ | ------- | --------|
484
+ | User |<ul><li>User must be a department user.</li><li>User must have 'Author' role.</li><li>The job must have been created by the logged in user, or the logged in user must have 'View' permissions on the user who created the job.</li></ul>|
485
+
486
+
487
+ :param job_id: **Job ID Parameter** The unique identifier for the import or validation job. This ID was returned when the job was created via the Import or Validate API. **Format:** UUID v4 (e.g., 7A84B875-6F75-4C7B-B137-0632B62DB0BD) **Example Usage:** ```bash GET /import/content/7A84B875-6F75-4C7B-B137-0632B62DB0BD/status ```
488
+ :param retries: Override the default retry configuration for this method
489
+ :param server_url: Override the default server URL for this method
490
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
491
+ :param http_headers: Additional headers to set or replace on requests.
492
+ """
493
+ base_url = None
494
+ url_variables = None
495
+ if timeout_ms is None:
496
+ timeout_ms = self.sdk_configuration.timeout_ms
497
+
498
+ if server_url is not None:
499
+ base_url = server_url
500
+ else:
501
+ base_url = models.GET_IMPORT_CONTENT_OP_SERVERS[0]
502
+ url_variables = {
503
+ "API_DOMAIN": "api.egain.cloud",
504
+ }
505
+
506
+ request = models.GetImportContentRequest(
507
+ job_id=job_id,
508
+ )
509
+
510
+ req = self._build_request_async(
511
+ method="GET",
512
+ path="/import/content/{job_id}/status",
513
+ base_url=base_url,
514
+ url_variables=url_variables,
515
+ request=request,
516
+ request_body_required=False,
517
+ request_has_path_params=True,
518
+ request_has_query_params=True,
519
+ user_agent_header="user-agent",
520
+ accept_header_value="application/json",
521
+ http_headers=http_headers,
522
+ security=self.sdk_configuration.security,
523
+ timeout_ms=timeout_ms,
524
+ )
525
+
526
+ if retries == UNSET:
527
+ if self.sdk_configuration.retry_config is not UNSET:
528
+ retries = self.sdk_configuration.retry_config
529
+
530
+ retry_config = None
531
+ if isinstance(retries, utils.RetryConfig):
532
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
533
+
534
+ http_res = await self.do_request_async(
535
+ hook_ctx=HookContext(
536
+ config=self.sdk_configuration,
537
+ base_url=base_url or "",
538
+ operation_id="getImportContent",
539
+ oauth2_scopes=[],
540
+ security_source=get_security_from_env(
541
+ self.sdk_configuration.security, models.Security
542
+ ),
543
+ ),
544
+ request=req,
545
+ error_status_codes=["400", "401", "403", "404", "406", "4XX", "500", "5XX"],
546
+ retry_config=retry_config,
547
+ )
548
+
549
+ response_data: Any = None
550
+ if utils.match_response(http_res, "200", "application/json"):
551
+ return unmarshal_json_response(models.ImportStatus, http_res)
552
+ if utils.match_response(
553
+ http_res, ["400", "401", "403", "404", "406"], "application/json"
554
+ ):
555
+ response_data = unmarshal_json_response(errors.WSErrorCommonData, http_res)
556
+ raise errors.WSErrorCommon(response_data, http_res)
557
+ if utils.match_response(http_res, "500", "application/json"):
558
+ response_data = unmarshal_json_response(errors.WSErrorCommonData, http_res)
559
+ raise errors.WSErrorCommon(response_data, http_res)
560
+ if utils.match_response(http_res, "4XX", "*"):
561
+ http_res_text = await utils.stream_to_text_async(http_res)
562
+ raise errors.EgainDefaultError(
563
+ "API error occurred", http_res, http_res_text
564
+ )
565
+ if utils.match_response(http_res, "5XX", "*"):
566
+ http_res_text = await utils.stream_to_text_async(http_res)
567
+ raise errors.EgainDefaultError(
568
+ "API error occurred", http_res, http_res_text
569
+ )
570
+
571
+ raise errors.EgainDefaultError("Unexpected response received", http_res)
572
+
573
+ def create_import_validation(
574
+ self,
575
+ *,
576
+ data_source: Union[
577
+ models.ValidateImportContentDataSource,
578
+ models.ValidateImportContentDataSourceTypedDict,
579
+ ],
580
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
581
+ server_url: Optional[str] = None,
582
+ timeout_ms: Optional[int] = None,
583
+ http_headers: Optional[Mapping[str, str]] = None,
584
+ ) -> models.CreateImportValidationResponse:
585
+ r"""Validate content structure and format before import
586
+
587
+ # Validate Import Content
588
+
589
+ ## Overview
590
+ This API enables users to validate content structure, format, and compliance before importing it into the production knowledge base. Validation is a non-destructive operation that checks content without making any changes to your existing data.
591
+
592
+ ## What Validation Checks
593
+ - **Content Structure**: Verifies required fields and data types
594
+ - **Format Compliance**: Ensures content meets platform requirements
595
+ - **Language Support**: Validates content against supported languages
596
+ - **Metadata Mapping**: Checks field mappings and transformations
597
+ - **Business Rules**: Validates against department-specific rules
598
+
599
+ ## Validation Benefits
600
+ - **Risk Mitigation**: Identify issues before affecting production data
601
+ - **Quality Assurance**: Ensure content meets organizational standards
602
+ - **Cost Savings**: Avoid failed imports that waste processing time
603
+ - **Compliance**: Meet regulatory and internal content requirements
604
+
605
+ ## Validation Process
606
+ 1. **Content Analysis**: System analyzes content structure and format
607
+ 2. **Rule Validation**: Applies business rules and validation logic
608
+ 3. **Quality Assessment**: Evaluates content quality and completeness
609
+ 4. **Report Generation**: Creates detailed validation report
610
+ 5. **Issue Categorization**: Classifies issues by severity and type
611
+
612
+ ## Common Validation Issues
613
+ - **Missing Required Fields**: Title, description, category, etc.
614
+ - **Invalid Data Types**: Incorrect field formats (dates, numbers, etc.)
615
+ - **Language Mismatches**: Content language not supported by department
616
+
617
+ ## Best Practices
618
+ - **Always Validate First**: Run validation before any import operation
619
+ - **Review Reports**: Carefully examine validation results and warnings
620
+ - **Fix Issues**: Address validation errors before proceeding with import
621
+ - **Test Small Batches**: Validate with small content samples first
622
+ - **Iterate**: Use validation feedback to improve content quality
623
+
624
+ ## Permissions
625
+ | Actor | Permission |
626
+ | ------- | --------|
627
+ | User |<ul><li>User must be a department user.</li><li>User must have 'Author' role.</li><li>Content can only be imported if the user has all the required languages assigned.</li></ul>|
628
+
629
+
630
+ :param data_source:
631
+ :param retries: Override the default retry configuration for this method
632
+ :param server_url: Override the default server URL for this method
633
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
634
+ :param http_headers: Additional headers to set or replace on requests.
635
+ """
636
+ base_url = None
637
+ url_variables = None
638
+ if timeout_ms is None:
639
+ timeout_ms = self.sdk_configuration.timeout_ms
640
+
641
+ if server_url is not None:
642
+ base_url = server_url
643
+ else:
644
+ base_url = models.CREATE_IMPORT_VALIDATION_OP_SERVERS[0]
645
+ url_variables = {
646
+ "API_DOMAIN": "api.egain.cloud",
647
+ }
648
+
649
+ request = models.ValidateImportContent(
650
+ data_source=utils.get_pydantic_model(
651
+ data_source, models.ValidateImportContentDataSource
652
+ ),
653
+ )
654
+
655
+ req = self._build_request(
656
+ method="POST",
657
+ path="/import/content/validate",
658
+ base_url=base_url,
659
+ url_variables=url_variables,
660
+ request=request,
661
+ request_body_required=True,
662
+ request_has_path_params=False,
663
+ request_has_query_params=True,
664
+ user_agent_header="user-agent",
665
+ accept_header_value="application/json",
666
+ http_headers=http_headers,
667
+ security=self.sdk_configuration.security,
668
+ get_serialized_body=lambda: utils.serialize_request_body(
669
+ request, False, False, "json", models.ValidateImportContent
670
+ ),
671
+ timeout_ms=timeout_ms,
672
+ )
673
+
674
+ if retries == UNSET:
675
+ if self.sdk_configuration.retry_config is not UNSET:
676
+ retries = self.sdk_configuration.retry_config
677
+
678
+ retry_config = None
679
+ if isinstance(retries, utils.RetryConfig):
680
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
681
+
682
+ http_res = self.do_request(
683
+ hook_ctx=HookContext(
684
+ config=self.sdk_configuration,
685
+ base_url=base_url or "",
686
+ operation_id="createImportValidation",
687
+ oauth2_scopes=[],
688
+ security_source=get_security_from_env(
689
+ self.sdk_configuration.security, models.Security
690
+ ),
691
+ ),
692
+ request=req,
693
+ error_status_codes=["400", "401", "403", "406", "412", "4XX", "500", "5XX"],
694
+ retry_config=retry_config,
695
+ )
696
+
697
+ response_data: Any = None
698
+ if utils.match_response(http_res, "202", "*"):
699
+ return models.CreateImportValidationResponse(
700
+ headers=utils.get_response_headers(http_res.headers)
701
+ )
702
+ if utils.match_response(
703
+ http_res, ["400", "401", "403", "406"], "application/json"
704
+ ):
705
+ response_data = unmarshal_json_response(errors.WSErrorCommonData, http_res)
706
+ raise errors.WSErrorCommon(response_data, http_res)
707
+ if utils.match_response(http_res, "412", "application/json"):
708
+ response_data = unmarshal_json_response(
709
+ errors.SchemasWSErrorCommonData, http_res
710
+ )
711
+ raise errors.SchemasWSErrorCommon(response_data, http_res)
712
+ if utils.match_response(http_res, "500", "application/json"):
713
+ response_data = unmarshal_json_response(errors.WSErrorCommonData, http_res)
714
+ raise errors.WSErrorCommon(response_data, http_res)
715
+ if utils.match_response(http_res, "4XX", "*"):
716
+ http_res_text = utils.stream_to_text(http_res)
717
+ raise errors.EgainDefaultError(
718
+ "API error occurred", http_res, http_res_text
719
+ )
720
+ if utils.match_response(http_res, "5XX", "*"):
721
+ http_res_text = utils.stream_to_text(http_res)
722
+ raise errors.EgainDefaultError(
723
+ "API error occurred", http_res, http_res_text
724
+ )
725
+
726
+ raise errors.EgainDefaultError("Unexpected response received", http_res)
727
+
728
+ async def create_import_validation_async(
729
+ self,
730
+ *,
731
+ data_source: Union[
732
+ models.ValidateImportContentDataSource,
733
+ models.ValidateImportContentDataSourceTypedDict,
734
+ ],
735
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
736
+ server_url: Optional[str] = None,
737
+ timeout_ms: Optional[int] = None,
738
+ http_headers: Optional[Mapping[str, str]] = None,
739
+ ) -> models.CreateImportValidationResponse:
740
+ r"""Validate content structure and format before import
741
+
742
+ # Validate Import Content
743
+
744
+ ## Overview
745
+ This API enables users to validate content structure, format, and compliance before importing it into the production knowledge base. Validation is a non-destructive operation that checks content without making any changes to your existing data.
746
+
747
+ ## What Validation Checks
748
+ - **Content Structure**: Verifies required fields and data types
749
+ - **Format Compliance**: Ensures content meets platform requirements
750
+ - **Language Support**: Validates content against supported languages
751
+ - **Metadata Mapping**: Checks field mappings and transformations
752
+ - **Business Rules**: Validates against department-specific rules
753
+
754
+ ## Validation Benefits
755
+ - **Risk Mitigation**: Identify issues before affecting production data
756
+ - **Quality Assurance**: Ensure content meets organizational standards
757
+ - **Cost Savings**: Avoid failed imports that waste processing time
758
+ - **Compliance**: Meet regulatory and internal content requirements
759
+
760
+ ## Validation Process
761
+ 1. **Content Analysis**: System analyzes content structure and format
762
+ 2. **Rule Validation**: Applies business rules and validation logic
763
+ 3. **Quality Assessment**: Evaluates content quality and completeness
764
+ 4. **Report Generation**: Creates detailed validation report
765
+ 5. **Issue Categorization**: Classifies issues by severity and type
766
+
767
+ ## Common Validation Issues
768
+ - **Missing Required Fields**: Title, description, category, etc.
769
+ - **Invalid Data Types**: Incorrect field formats (dates, numbers, etc.)
770
+ - **Language Mismatches**: Content language not supported by department
771
+
772
+ ## Best Practices
773
+ - **Always Validate First**: Run validation before any import operation
774
+ - **Review Reports**: Carefully examine validation results and warnings
775
+ - **Fix Issues**: Address validation errors before proceeding with import
776
+ - **Test Small Batches**: Validate with small content samples first
777
+ - **Iterate**: Use validation feedback to improve content quality
778
+
779
+ ## Permissions
780
+ | Actor | Permission |
781
+ | ------- | --------|
782
+ | User |<ul><li>User must be a department user.</li><li>User must have 'Author' role.</li><li>Content can only be imported if the user has all the required languages assigned.</li></ul>|
783
+
784
+
785
+ :param data_source:
786
+ :param retries: Override the default retry configuration for this method
787
+ :param server_url: Override the default server URL for this method
788
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
789
+ :param http_headers: Additional headers to set or replace on requests.
790
+ """
791
+ base_url = None
792
+ url_variables = None
793
+ if timeout_ms is None:
794
+ timeout_ms = self.sdk_configuration.timeout_ms
795
+
796
+ if server_url is not None:
797
+ base_url = server_url
798
+ else:
799
+ base_url = models.CREATE_IMPORT_VALIDATION_OP_SERVERS[0]
800
+ url_variables = {
801
+ "API_DOMAIN": "api.egain.cloud",
802
+ }
803
+
804
+ request = models.ValidateImportContent(
805
+ data_source=utils.get_pydantic_model(
806
+ data_source, models.ValidateImportContentDataSource
807
+ ),
808
+ )
809
+
810
+ req = self._build_request_async(
811
+ method="POST",
812
+ path="/import/content/validate",
813
+ base_url=base_url,
814
+ url_variables=url_variables,
815
+ request=request,
816
+ request_body_required=True,
817
+ request_has_path_params=False,
818
+ request_has_query_params=True,
819
+ user_agent_header="user-agent",
820
+ accept_header_value="application/json",
821
+ http_headers=http_headers,
822
+ security=self.sdk_configuration.security,
823
+ get_serialized_body=lambda: utils.serialize_request_body(
824
+ request, False, False, "json", models.ValidateImportContent
825
+ ),
826
+ timeout_ms=timeout_ms,
827
+ )
828
+
829
+ if retries == UNSET:
830
+ if self.sdk_configuration.retry_config is not UNSET:
831
+ retries = self.sdk_configuration.retry_config
832
+
833
+ retry_config = None
834
+ if isinstance(retries, utils.RetryConfig):
835
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
836
+
837
+ http_res = await self.do_request_async(
838
+ hook_ctx=HookContext(
839
+ config=self.sdk_configuration,
840
+ base_url=base_url or "",
841
+ operation_id="createImportValidation",
842
+ oauth2_scopes=[],
843
+ security_source=get_security_from_env(
844
+ self.sdk_configuration.security, models.Security
845
+ ),
846
+ ),
847
+ request=req,
848
+ error_status_codes=["400", "401", "403", "406", "412", "4XX", "500", "5XX"],
849
+ retry_config=retry_config,
850
+ )
851
+
852
+ response_data: Any = None
853
+ if utils.match_response(http_res, "202", "*"):
854
+ return models.CreateImportValidationResponse(
855
+ headers=utils.get_response_headers(http_res.headers)
856
+ )
857
+ if utils.match_response(
858
+ http_res, ["400", "401", "403", "406"], "application/json"
859
+ ):
860
+ response_data = unmarshal_json_response(errors.WSErrorCommonData, http_res)
861
+ raise errors.WSErrorCommon(response_data, http_res)
862
+ if utils.match_response(http_res, "412", "application/json"):
863
+ response_data = unmarshal_json_response(
864
+ errors.SchemasWSErrorCommonData, http_res
865
+ )
866
+ raise errors.SchemasWSErrorCommon(response_data, http_res)
867
+ if utils.match_response(http_res, "500", "application/json"):
868
+ response_data = unmarshal_json_response(errors.WSErrorCommonData, http_res)
869
+ raise errors.WSErrorCommon(response_data, http_res)
870
+ if utils.match_response(http_res, "4XX", "*"):
871
+ http_res_text = await utils.stream_to_text_async(http_res)
872
+ raise errors.EgainDefaultError(
873
+ "API error occurred", http_res, http_res_text
874
+ )
875
+ if utils.match_response(http_res, "5XX", "*"):
876
+ http_res_text = await utils.stream_to_text_async(http_res)
877
+ raise errors.EgainDefaultError(
878
+ "API error occurred", http_res, http_res_text
879
+ )
880
+
881
+ raise errors.EgainDefaultError("Unexpected response received", http_res)
882
+
883
+ def patch_import_content_validation(
884
+ self,
885
+ *,
886
+ job_id: str,
887
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
888
+ server_url: Optional[str] = None,
889
+ timeout_ms: Optional[int] = None,
890
+ http_headers: Optional[Mapping[str, str]] = None,
891
+ ):
892
+ r"""Cancel an import or validation job
893
+
894
+ # Cancel Import or Validation Job
895
+
896
+ ## Overview
897
+ This API allows users to cancel import or validation operations that are currently in progress or scheduled for future execution. Cancellation is immediate for scheduled jobs and graceful for running jobs.
898
+
899
+ ## Cancellation Behavior
900
+ - **Scheduled Jobs**: Immediate cancellation, no processing occurs
901
+ - **In Progress Jobs**: Graceful shutdown, current item completes, no new items start
902
+ - **Completed Jobs**: Cannot be cancelled (returns error)
903
+ - **Failed Jobs**: Cannot be cancelled (already stopped)
904
+
905
+ ## When to Cancel
906
+ - **Content Issues**: Discover problems with source content
907
+ - **Timing Changes**: Need to reschedule for different time
908
+ - **Resource Constraints**: System resources are needed elsewhere
909
+ - **User Request**: Manual cancellation by authorized users
910
+ - **System Maintenance**: Planned maintenance windows
911
+
912
+ ## Cancellation Process
913
+ 1. **Request Received**: System receives cancellation request
914
+ 2. **Status Check**: Verifies current job status
915
+ 3. **Graceful Shutdown**: For running jobs, completes current item
916
+ 4. **Resource Cleanup**: Releases allocated system resources
917
+ 5. **Status Update**: Marks job as cancelled
918
+ 6. **Notification**: Updates job status and logs
919
+
920
+ ## Post-Cancellation
921
+ - **Job Status**: Changes to \"Cancelled\"
922
+ - **Partial Results**: Any completed items remain in system
923
+ - **Logs**: Cancellation reason and timing recorded
924
+ - **Resources**: System resources freed for other operations
925
+
926
+ ## Best Practices
927
+ - **Monitor Jobs**: Regularly check job status to identify candidates for cancellation
928
+ - **Plan Cancellations**: Schedule cancellations during low-usage periods
929
+ - **Resource Planning**: Consider resource impact before cancelling large jobs
930
+
931
+ ## Permissions
932
+ | Actor | Permission |
933
+ | ------- | --------|
934
+ | User |<li>User must be a department user.</li><li>Content can only be validated for user's home department.</li><li>User must have 'Author' role.</li><li>The job must have been created by the logged in user, or the logged in user must have 'Edit' permissions on the user who created the job.</li></ul>|
935
+
936
+
937
+ :param job_id: **Job ID Parameter** The unique identifier for the import or validation job. This ID was returned when the job was created via the Import or Validate API. **Format:** UUID v4 (e.g., 7A84B875-6F75-4C7B-B137-0632B62DB0BD) **Example Usage:** ```bash GET /import/content/7A84B875-6F75-4C7B-B137-0632B62DB0BD/status ```
938
+ :param retries: Override the default retry configuration for this method
939
+ :param server_url: Override the default server URL for this method
940
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
941
+ :param http_headers: Additional headers to set or replace on requests.
942
+ """
943
+ base_url = None
944
+ url_variables = None
945
+ if timeout_ms is None:
946
+ timeout_ms = self.sdk_configuration.timeout_ms
947
+
948
+ if server_url is not None:
949
+ base_url = server_url
950
+ else:
951
+ base_url = models.PATCH_IMPORT_CONTENT_VALIDATION_OP_SERVERS[0]
952
+ url_variables = {
953
+ "API_DOMAIN": "api.egain.cloud",
954
+ }
955
+
956
+ request = models.PatchImportContentValidationRequest(
957
+ job_id=job_id,
958
+ )
959
+
960
+ req = self._build_request(
961
+ method="POST",
962
+ path="/import/content/{job_id}/cancel",
963
+ base_url=base_url,
964
+ url_variables=url_variables,
965
+ request=request,
966
+ request_body_required=False,
967
+ request_has_path_params=True,
968
+ request_has_query_params=True,
969
+ user_agent_header="user-agent",
970
+ accept_header_value="application/json",
971
+ http_headers=http_headers,
972
+ security=self.sdk_configuration.security,
973
+ timeout_ms=timeout_ms,
974
+ )
975
+
976
+ if retries == UNSET:
977
+ if self.sdk_configuration.retry_config is not UNSET:
978
+ retries = self.sdk_configuration.retry_config
979
+
980
+ retry_config = None
981
+ if isinstance(retries, utils.RetryConfig):
982
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
983
+
984
+ http_res = self.do_request(
985
+ hook_ctx=HookContext(
986
+ config=self.sdk_configuration,
987
+ base_url=base_url or "",
988
+ operation_id="patchImportContentValidation",
989
+ oauth2_scopes=[],
990
+ security_source=get_security_from_env(
991
+ self.sdk_configuration.security, models.Security
992
+ ),
993
+ ),
994
+ request=req,
995
+ error_status_codes=["401", "403", "404", "406", "4XX", "500", "5XX"],
996
+ retry_config=retry_config,
997
+ )
998
+
999
+ response_data: Any = None
1000
+ if utils.match_response(http_res, "204", "*"):
1001
+ return
1002
+ if utils.match_response(
1003
+ http_res, ["401", "403", "404", "406"], "application/json"
1004
+ ):
1005
+ response_data = unmarshal_json_response(errors.WSErrorCommonData, http_res)
1006
+ raise errors.WSErrorCommon(response_data, http_res)
1007
+ if utils.match_response(http_res, "500", "application/json"):
1008
+ response_data = unmarshal_json_response(errors.WSErrorCommonData, http_res)
1009
+ raise errors.WSErrorCommon(response_data, http_res)
1010
+ if utils.match_response(http_res, "4XX", "*"):
1011
+ http_res_text = utils.stream_to_text(http_res)
1012
+ raise errors.EgainDefaultError(
1013
+ "API error occurred", http_res, http_res_text
1014
+ )
1015
+ if utils.match_response(http_res, "5XX", "*"):
1016
+ http_res_text = utils.stream_to_text(http_res)
1017
+ raise errors.EgainDefaultError(
1018
+ "API error occurred", http_res, http_res_text
1019
+ )
1020
+
1021
+ raise errors.EgainDefaultError("Unexpected response received", http_res)
1022
+
1023
+ async def patch_import_content_validation_async(
1024
+ self,
1025
+ *,
1026
+ job_id: str,
1027
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
1028
+ server_url: Optional[str] = None,
1029
+ timeout_ms: Optional[int] = None,
1030
+ http_headers: Optional[Mapping[str, str]] = None,
1031
+ ):
1032
+ r"""Cancel an import or validation job
1033
+
1034
+ # Cancel Import or Validation Job
1035
+
1036
+ ## Overview
1037
+ This API allows users to cancel import or validation operations that are currently in progress or scheduled for future execution. Cancellation is immediate for scheduled jobs and graceful for running jobs.
1038
+
1039
+ ## Cancellation Behavior
1040
+ - **Scheduled Jobs**: Immediate cancellation, no processing occurs
1041
+ - **In Progress Jobs**: Graceful shutdown, current item completes, no new items start
1042
+ - **Completed Jobs**: Cannot be cancelled (returns error)
1043
+ - **Failed Jobs**: Cannot be cancelled (already stopped)
1044
+
1045
+ ## When to Cancel
1046
+ - **Content Issues**: Discover problems with source content
1047
+ - **Timing Changes**: Need to reschedule for different time
1048
+ - **Resource Constraints**: System resources are needed elsewhere
1049
+ - **User Request**: Manual cancellation by authorized users
1050
+ - **System Maintenance**: Planned maintenance windows
1051
+
1052
+ ## Cancellation Process
1053
+ 1. **Request Received**: System receives cancellation request
1054
+ 2. **Status Check**: Verifies current job status
1055
+ 3. **Graceful Shutdown**: For running jobs, completes current item
1056
+ 4. **Resource Cleanup**: Releases allocated system resources
1057
+ 5. **Status Update**: Marks job as cancelled
1058
+ 6. **Notification**: Updates job status and logs
1059
+
1060
+ ## Post-Cancellation
1061
+ - **Job Status**: Changes to \"Cancelled\"
1062
+ - **Partial Results**: Any completed items remain in system
1063
+ - **Logs**: Cancellation reason and timing recorded
1064
+ - **Resources**: System resources freed for other operations
1065
+
1066
+ ## Best Practices
1067
+ - **Monitor Jobs**: Regularly check job status to identify candidates for cancellation
1068
+ - **Plan Cancellations**: Schedule cancellations during low-usage periods
1069
+ - **Resource Planning**: Consider resource impact before cancelling large jobs
1070
+
1071
+ ## Permissions
1072
+ | Actor | Permission |
1073
+ | ------- | --------|
1074
+ | User |<li>User must be a department user.</li><li>Content can only be validated for user's home department.</li><li>User must have 'Author' role.</li><li>The job must have been created by the logged in user, or the logged in user must have 'Edit' permissions on the user who created the job.</li></ul>|
1075
+
1076
+
1077
+ :param job_id: **Job ID Parameter** The unique identifier for the import or validation job. This ID was returned when the job was created via the Import or Validate API. **Format:** UUID v4 (e.g., 7A84B875-6F75-4C7B-B137-0632B62DB0BD) **Example Usage:** ```bash GET /import/content/7A84B875-6F75-4C7B-B137-0632B62DB0BD/status ```
1078
+ :param retries: Override the default retry configuration for this method
1079
+ :param server_url: Override the default server URL for this method
1080
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
1081
+ :param http_headers: Additional headers to set or replace on requests.
1082
+ """
1083
+ base_url = None
1084
+ url_variables = None
1085
+ if timeout_ms is None:
1086
+ timeout_ms = self.sdk_configuration.timeout_ms
1087
+
1088
+ if server_url is not None:
1089
+ base_url = server_url
1090
+ else:
1091
+ base_url = models.PATCH_IMPORT_CONTENT_VALIDATION_OP_SERVERS[0]
1092
+ url_variables = {
1093
+ "API_DOMAIN": "api.egain.cloud",
1094
+ }
1095
+
1096
+ request = models.PatchImportContentValidationRequest(
1097
+ job_id=job_id,
1098
+ )
1099
+
1100
+ req = self._build_request_async(
1101
+ method="POST",
1102
+ path="/import/content/{job_id}/cancel",
1103
+ base_url=base_url,
1104
+ url_variables=url_variables,
1105
+ request=request,
1106
+ request_body_required=False,
1107
+ request_has_path_params=True,
1108
+ request_has_query_params=True,
1109
+ user_agent_header="user-agent",
1110
+ accept_header_value="application/json",
1111
+ http_headers=http_headers,
1112
+ security=self.sdk_configuration.security,
1113
+ timeout_ms=timeout_ms,
1114
+ )
1115
+
1116
+ if retries == UNSET:
1117
+ if self.sdk_configuration.retry_config is not UNSET:
1118
+ retries = self.sdk_configuration.retry_config
1119
+
1120
+ retry_config = None
1121
+ if isinstance(retries, utils.RetryConfig):
1122
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
1123
+
1124
+ http_res = await self.do_request_async(
1125
+ hook_ctx=HookContext(
1126
+ config=self.sdk_configuration,
1127
+ base_url=base_url or "",
1128
+ operation_id="patchImportContentValidation",
1129
+ oauth2_scopes=[],
1130
+ security_source=get_security_from_env(
1131
+ self.sdk_configuration.security, models.Security
1132
+ ),
1133
+ ),
1134
+ request=req,
1135
+ error_status_codes=["401", "403", "404", "406", "4XX", "500", "5XX"],
1136
+ retry_config=retry_config,
1137
+ )
1138
+
1139
+ response_data: Any = None
1140
+ if utils.match_response(http_res, "204", "*"):
1141
+ return
1142
+ if utils.match_response(
1143
+ http_res, ["401", "403", "404", "406"], "application/json"
1144
+ ):
1145
+ response_data = unmarshal_json_response(errors.WSErrorCommonData, http_res)
1146
+ raise errors.WSErrorCommon(response_data, http_res)
1147
+ if utils.match_response(http_res, "500", "application/json"):
1148
+ response_data = unmarshal_json_response(errors.WSErrorCommonData, http_res)
1149
+ raise errors.WSErrorCommon(response_data, http_res)
1150
+ if utils.match_response(http_res, "4XX", "*"):
1151
+ http_res_text = await utils.stream_to_text_async(http_res)
1152
+ raise errors.EgainDefaultError(
1153
+ "API error occurred", http_res, http_res_text
1154
+ )
1155
+ if utils.match_response(http_res, "5XX", "*"):
1156
+ http_res_text = await utils.stream_to_text_async(http_res)
1157
+ raise errors.EgainDefaultError(
1158
+ "API error occurred", http_res, http_res_text
1159
+ )
1160
+
1161
+ raise errors.EgainDefaultError("Unexpected response received", http_res)