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,537 @@
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 Connectorssearchevents(BaseSDK):
13
+ def create_search_result_event_for_connectors(
14
+ self,
15
+ *,
16
+ accept_language: models.AcceptLanguage,
17
+ portal_id: str,
18
+ language_code: models.KbLanguageCode,
19
+ q: str,
20
+ number_of_search_results: int,
21
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
22
+ server_url: Optional[str] = None,
23
+ timeout_ms: Optional[int] = None,
24
+ http_headers: Optional[Mapping[str, str]] = None,
25
+ ):
26
+ r"""Event for Search Using Connectors
27
+
28
+ ## Overview
29
+ The Event for Search Using Connectors API creates an event to initiate a search operation for retrieving content from external sources or integrations within the portal.
30
+ It allows users to set up search events based on specified criteria.
31
+
32
+
33
+ :param accept_language: The Language locale accepted by the client (used for locale specific fields in resource representation and in error responses).
34
+ :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.
35
+ :param language_code: A short language code. A list of codes can be found below: |Code|Description |----|----------- |en-US|English (United States) |en-GB|English (United Kingdom) |fr-FR|French (France) |es-ES|Spanish (Spain) |it-IT|Italian (Italy) |de-DE|German (Germany) |nl-NL|Dutch (Netherlands) |pt-BR|Portuguese (Brazil) |pt-PT|Portuguese (Portugal) |da-DK|Danish (Denmark) |sv-SE|Swedish (Sweden) |ru-RU|Russian (Russia) |fr-CA|French (Canada) |zh-CN|Chinese (Simplified, China) |ja-JP|Japanese (Japan) |ko-KR|Korean (South Korea) |nn-NO|Norwegian Nynorsk (Norway)
36
+ :param q: The string to use for the search.
37
+ :param number_of_search_results:
38
+ :param retries: Override the default retry configuration for this method
39
+ :param server_url: Override the default server URL for this method
40
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
41
+ :param http_headers: Additional headers to set or replace on requests.
42
+ """
43
+ base_url = None
44
+ url_variables = None
45
+ if timeout_ms is None:
46
+ timeout_ms = self.sdk_configuration.timeout_ms
47
+
48
+ if server_url is not None:
49
+ base_url = server_url
50
+ else:
51
+ base_url = self._get_url(base_url, url_variables)
52
+
53
+ request = models.CreateSearchResultEventForConnectorsRequest(
54
+ accept_language=accept_language,
55
+ portal_id=portal_id,
56
+ create_search_result_event_for_connectors=models.CreateSearchResultEventForConnectors(
57
+ language_code=language_code,
58
+ q=q,
59
+ number_of_search_results=number_of_search_results,
60
+ ),
61
+ )
62
+
63
+ req = self._build_request(
64
+ method="POST",
65
+ path="/portals/{portalID}/search/connectors/event",
66
+ base_url=base_url,
67
+ url_variables=url_variables,
68
+ request=request,
69
+ request_body_required=True,
70
+ request_has_path_params=True,
71
+ request_has_query_params=True,
72
+ user_agent_header="user-agent",
73
+ accept_header_value="application/json",
74
+ http_headers=http_headers,
75
+ security=self.sdk_configuration.security,
76
+ get_serialized_body=lambda: utils.serialize_request_body(
77
+ request.create_search_result_event_for_connectors,
78
+ False,
79
+ False,
80
+ "json",
81
+ models.CreateSearchResultEventForConnectors,
82
+ ),
83
+ timeout_ms=timeout_ms,
84
+ )
85
+
86
+ if retries == UNSET:
87
+ if self.sdk_configuration.retry_config is not UNSET:
88
+ retries = self.sdk_configuration.retry_config
89
+
90
+ retry_config = None
91
+ if isinstance(retries, utils.RetryConfig):
92
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
93
+
94
+ http_res = self.do_request(
95
+ hook_ctx=HookContext(
96
+ config=self.sdk_configuration,
97
+ base_url=base_url or "",
98
+ operation_id="createSearchResultEventForConnectors",
99
+ oauth2_scopes=[],
100
+ security_source=get_security_from_env(
101
+ self.sdk_configuration.security, models.Security
102
+ ),
103
+ ),
104
+ request=req,
105
+ error_status_codes=[
106
+ "400",
107
+ "401",
108
+ "403",
109
+ "404",
110
+ "406",
111
+ "415",
112
+ "4XX",
113
+ "500",
114
+ "5XX",
115
+ ],
116
+ retry_config=retry_config,
117
+ )
118
+
119
+ response_data: Any = None
120
+ if utils.match_response(http_res, "204", "*"):
121
+ return
122
+ if utils.match_response(
123
+ http_res, ["400", "401", "403", "404", "406"], "application/json"
124
+ ):
125
+ response_data = unmarshal_json_response(errors.WSErrorCommonData, http_res)
126
+ raise errors.WSErrorCommon(response_data, http_res)
127
+ if utils.match_response(http_res, "500", "application/json"):
128
+ response_data = unmarshal_json_response(errors.WSErrorCommonData, http_res)
129
+ raise errors.WSErrorCommon(response_data, http_res)
130
+ if utils.match_response(http_res, ["415", "4XX"], "*"):
131
+ http_res_text = utils.stream_to_text(http_res)
132
+ raise errors.EgainDefaultError(
133
+ "API error occurred", http_res, http_res_text
134
+ )
135
+ if utils.match_response(http_res, "5XX", "*"):
136
+ http_res_text = utils.stream_to_text(http_res)
137
+ raise errors.EgainDefaultError(
138
+ "API error occurred", http_res, http_res_text
139
+ )
140
+
141
+ raise errors.EgainDefaultError("Unexpected response received", http_res)
142
+
143
+ async def create_search_result_event_for_connectors_async(
144
+ self,
145
+ *,
146
+ accept_language: models.AcceptLanguage,
147
+ portal_id: str,
148
+ language_code: models.KbLanguageCode,
149
+ q: str,
150
+ number_of_search_results: int,
151
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
152
+ server_url: Optional[str] = None,
153
+ timeout_ms: Optional[int] = None,
154
+ http_headers: Optional[Mapping[str, str]] = None,
155
+ ):
156
+ r"""Event for Search Using Connectors
157
+
158
+ ## Overview
159
+ The Event for Search Using Connectors API creates an event to initiate a search operation for retrieving content from external sources or integrations within the portal.
160
+ It allows users to set up search events based on specified criteria.
161
+
162
+
163
+ :param accept_language: The Language locale accepted by the client (used for locale specific fields in resource representation and in error responses).
164
+ :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.
165
+ :param language_code: A short language code. A list of codes can be found below: |Code|Description |----|----------- |en-US|English (United States) |en-GB|English (United Kingdom) |fr-FR|French (France) |es-ES|Spanish (Spain) |it-IT|Italian (Italy) |de-DE|German (Germany) |nl-NL|Dutch (Netherlands) |pt-BR|Portuguese (Brazil) |pt-PT|Portuguese (Portugal) |da-DK|Danish (Denmark) |sv-SE|Swedish (Sweden) |ru-RU|Russian (Russia) |fr-CA|French (Canada) |zh-CN|Chinese (Simplified, China) |ja-JP|Japanese (Japan) |ko-KR|Korean (South Korea) |nn-NO|Norwegian Nynorsk (Norway)
166
+ :param q: The string to use for the search.
167
+ :param number_of_search_results:
168
+ :param retries: Override the default retry configuration for this method
169
+ :param server_url: Override the default server URL for this method
170
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
171
+ :param http_headers: Additional headers to set or replace on requests.
172
+ """
173
+ base_url = None
174
+ url_variables = None
175
+ if timeout_ms is None:
176
+ timeout_ms = self.sdk_configuration.timeout_ms
177
+
178
+ if server_url is not None:
179
+ base_url = server_url
180
+ else:
181
+ base_url = self._get_url(base_url, url_variables)
182
+
183
+ request = models.CreateSearchResultEventForConnectorsRequest(
184
+ accept_language=accept_language,
185
+ portal_id=portal_id,
186
+ create_search_result_event_for_connectors=models.CreateSearchResultEventForConnectors(
187
+ language_code=language_code,
188
+ q=q,
189
+ number_of_search_results=number_of_search_results,
190
+ ),
191
+ )
192
+
193
+ req = self._build_request_async(
194
+ method="POST",
195
+ path="/portals/{portalID}/search/connectors/event",
196
+ base_url=base_url,
197
+ url_variables=url_variables,
198
+ request=request,
199
+ request_body_required=True,
200
+ request_has_path_params=True,
201
+ request_has_query_params=True,
202
+ user_agent_header="user-agent",
203
+ accept_header_value="application/json",
204
+ http_headers=http_headers,
205
+ security=self.sdk_configuration.security,
206
+ get_serialized_body=lambda: utils.serialize_request_body(
207
+ request.create_search_result_event_for_connectors,
208
+ False,
209
+ False,
210
+ "json",
211
+ models.CreateSearchResultEventForConnectors,
212
+ ),
213
+ timeout_ms=timeout_ms,
214
+ )
215
+
216
+ if retries == UNSET:
217
+ if self.sdk_configuration.retry_config is not UNSET:
218
+ retries = self.sdk_configuration.retry_config
219
+
220
+ retry_config = None
221
+ if isinstance(retries, utils.RetryConfig):
222
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
223
+
224
+ http_res = await self.do_request_async(
225
+ hook_ctx=HookContext(
226
+ config=self.sdk_configuration,
227
+ base_url=base_url or "",
228
+ operation_id="createSearchResultEventForConnectors",
229
+ oauth2_scopes=[],
230
+ security_source=get_security_from_env(
231
+ self.sdk_configuration.security, models.Security
232
+ ),
233
+ ),
234
+ request=req,
235
+ error_status_codes=[
236
+ "400",
237
+ "401",
238
+ "403",
239
+ "404",
240
+ "406",
241
+ "415",
242
+ "4XX",
243
+ "500",
244
+ "5XX",
245
+ ],
246
+ retry_config=retry_config,
247
+ )
248
+
249
+ response_data: Any = None
250
+ if utils.match_response(http_res, "204", "*"):
251
+ return
252
+ if utils.match_response(
253
+ http_res, ["400", "401", "403", "404", "406"], "application/json"
254
+ ):
255
+ response_data = unmarshal_json_response(errors.WSErrorCommonData, http_res)
256
+ raise errors.WSErrorCommon(response_data, http_res)
257
+ if utils.match_response(http_res, "500", "application/json"):
258
+ response_data = unmarshal_json_response(errors.WSErrorCommonData, http_res)
259
+ raise errors.WSErrorCommon(response_data, http_res)
260
+ if utils.match_response(http_res, ["415", "4XX"], "*"):
261
+ http_res_text = await utils.stream_to_text_async(http_res)
262
+ raise errors.EgainDefaultError(
263
+ "API error occurred", http_res, http_res_text
264
+ )
265
+ if utils.match_response(http_res, "5XX", "*"):
266
+ http_res_text = await utils.stream_to_text_async(http_res)
267
+ raise errors.EgainDefaultError(
268
+ "API error occurred", http_res, http_res_text
269
+ )
270
+
271
+ raise errors.EgainDefaultError("Unexpected response received", http_res)
272
+
273
+ def create_viewed_search_results_event_for_connectors(
274
+ self,
275
+ *,
276
+ accept_language: models.AcceptLanguage,
277
+ portal_id: str,
278
+ language_code: models.KbLanguageCode,
279
+ q: str,
280
+ url: str,
281
+ title: str,
282
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
283
+ server_url: Optional[str] = None,
284
+ timeout_ms: Optional[int] = None,
285
+ http_headers: Optional[Mapping[str, str]] = None,
286
+ ):
287
+ r"""Event for Viewed Search Results Using Connectors
288
+
289
+ ## Overview
290
+ The Event for Viewed Search Results Using Connectors API creates an event to log when search results from external content are viewed.
291
+ This helps in tracking and analyzing user interactions with search results retrieved from various external sources.
292
+
293
+
294
+ :param accept_language: The Language locale accepted by the client (used for locale specific fields in resource representation and in error responses).
295
+ :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.
296
+ :param language_code: A short language code. A list of codes can be found below: |Code|Description |----|----------- |en-US|English (United States) |en-GB|English (United Kingdom) |fr-FR|French (France) |es-ES|Spanish (Spain) |it-IT|Italian (Italy) |de-DE|German (Germany) |nl-NL|Dutch (Netherlands) |pt-BR|Portuguese (Brazil) |pt-PT|Portuguese (Portugal) |da-DK|Danish (Denmark) |sv-SE|Swedish (Sweden) |ru-RU|Russian (Russia) |fr-CA|French (Canada) |zh-CN|Chinese (Simplified, China) |ja-JP|Japanese (Japan) |ko-KR|Korean (South Korea) |nn-NO|Norwegian Nynorsk (Norway)
297
+ :param q: The string to use for the search.
298
+ :param url: The URL of the search result.
299
+ :param title: The title of the search result.
300
+ :param retries: Override the default retry configuration for this method
301
+ :param server_url: Override the default server URL for this method
302
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
303
+ :param http_headers: Additional headers to set or replace on requests.
304
+ """
305
+ base_url = None
306
+ url_variables = None
307
+ if timeout_ms is None:
308
+ timeout_ms = self.sdk_configuration.timeout_ms
309
+
310
+ if server_url is not None:
311
+ base_url = server_url
312
+ else:
313
+ base_url = self._get_url(base_url, url_variables)
314
+
315
+ request = models.CreateViewedSearchResultsEventForConnectorsRequest(
316
+ accept_language=accept_language,
317
+ portal_id=portal_id,
318
+ create_viewed_search_result_event_for_connectors=models.CreateViewedSearchResultEventForConnectors(
319
+ language_code=language_code,
320
+ q=q,
321
+ url=url,
322
+ title=title,
323
+ ),
324
+ )
325
+
326
+ req = self._build_request(
327
+ method="POST",
328
+ path="/portals/{portalID}/view/searchresults/connectors/event",
329
+ base_url=base_url,
330
+ url_variables=url_variables,
331
+ request=request,
332
+ request_body_required=True,
333
+ request_has_path_params=True,
334
+ request_has_query_params=True,
335
+ user_agent_header="user-agent",
336
+ accept_header_value="application/json",
337
+ http_headers=http_headers,
338
+ security=self.sdk_configuration.security,
339
+ get_serialized_body=lambda: utils.serialize_request_body(
340
+ request.create_viewed_search_result_event_for_connectors,
341
+ False,
342
+ False,
343
+ "json",
344
+ models.CreateViewedSearchResultEventForConnectors,
345
+ ),
346
+ timeout_ms=timeout_ms,
347
+ )
348
+
349
+ if retries == UNSET:
350
+ if self.sdk_configuration.retry_config is not UNSET:
351
+ retries = self.sdk_configuration.retry_config
352
+
353
+ retry_config = None
354
+ if isinstance(retries, utils.RetryConfig):
355
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
356
+
357
+ http_res = self.do_request(
358
+ hook_ctx=HookContext(
359
+ config=self.sdk_configuration,
360
+ base_url=base_url or "",
361
+ operation_id="createViewedSearchResultsEventForConnectors",
362
+ oauth2_scopes=[],
363
+ security_source=get_security_from_env(
364
+ self.sdk_configuration.security, models.Security
365
+ ),
366
+ ),
367
+ request=req,
368
+ error_status_codes=[
369
+ "400",
370
+ "401",
371
+ "403",
372
+ "404",
373
+ "406",
374
+ "415",
375
+ "4XX",
376
+ "500",
377
+ "5XX",
378
+ ],
379
+ retry_config=retry_config,
380
+ )
381
+
382
+ response_data: Any = None
383
+ if utils.match_response(http_res, "204", "*"):
384
+ return
385
+ if utils.match_response(
386
+ http_res, ["400", "401", "403", "404", "406"], "application/json"
387
+ ):
388
+ response_data = unmarshal_json_response(errors.WSErrorCommonData, http_res)
389
+ raise errors.WSErrorCommon(response_data, http_res)
390
+ if utils.match_response(http_res, "500", "application/json"):
391
+ response_data = unmarshal_json_response(errors.WSErrorCommonData, http_res)
392
+ raise errors.WSErrorCommon(response_data, http_res)
393
+ if utils.match_response(http_res, ["415", "4XX"], "*"):
394
+ http_res_text = utils.stream_to_text(http_res)
395
+ raise errors.EgainDefaultError(
396
+ "API error occurred", http_res, http_res_text
397
+ )
398
+ if utils.match_response(http_res, "5XX", "*"):
399
+ http_res_text = utils.stream_to_text(http_res)
400
+ raise errors.EgainDefaultError(
401
+ "API error occurred", http_res, http_res_text
402
+ )
403
+
404
+ raise errors.EgainDefaultError("Unexpected response received", http_res)
405
+
406
+ async def create_viewed_search_results_event_for_connectors_async(
407
+ self,
408
+ *,
409
+ accept_language: models.AcceptLanguage,
410
+ portal_id: str,
411
+ language_code: models.KbLanguageCode,
412
+ q: str,
413
+ url: str,
414
+ title: str,
415
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
416
+ server_url: Optional[str] = None,
417
+ timeout_ms: Optional[int] = None,
418
+ http_headers: Optional[Mapping[str, str]] = None,
419
+ ):
420
+ r"""Event for Viewed Search Results Using Connectors
421
+
422
+ ## Overview
423
+ The Event for Viewed Search Results Using Connectors API creates an event to log when search results from external content are viewed.
424
+ This helps in tracking and analyzing user interactions with search results retrieved from various external sources.
425
+
426
+
427
+ :param accept_language: The Language locale accepted by the client (used for locale specific fields in resource representation and in error responses).
428
+ :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.
429
+ :param language_code: A short language code. A list of codes can be found below: |Code|Description |----|----------- |en-US|English (United States) |en-GB|English (United Kingdom) |fr-FR|French (France) |es-ES|Spanish (Spain) |it-IT|Italian (Italy) |de-DE|German (Germany) |nl-NL|Dutch (Netherlands) |pt-BR|Portuguese (Brazil) |pt-PT|Portuguese (Portugal) |da-DK|Danish (Denmark) |sv-SE|Swedish (Sweden) |ru-RU|Russian (Russia) |fr-CA|French (Canada) |zh-CN|Chinese (Simplified, China) |ja-JP|Japanese (Japan) |ko-KR|Korean (South Korea) |nn-NO|Norwegian Nynorsk (Norway)
430
+ :param q: The string to use for the search.
431
+ :param url: The URL of the search result.
432
+ :param title: The title of the search result.
433
+ :param retries: Override the default retry configuration for this method
434
+ :param server_url: Override the default server URL for this method
435
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
436
+ :param http_headers: Additional headers to set or replace on requests.
437
+ """
438
+ base_url = None
439
+ url_variables = None
440
+ if timeout_ms is None:
441
+ timeout_ms = self.sdk_configuration.timeout_ms
442
+
443
+ if server_url is not None:
444
+ base_url = server_url
445
+ else:
446
+ base_url = self._get_url(base_url, url_variables)
447
+
448
+ request = models.CreateViewedSearchResultsEventForConnectorsRequest(
449
+ accept_language=accept_language,
450
+ portal_id=portal_id,
451
+ create_viewed_search_result_event_for_connectors=models.CreateViewedSearchResultEventForConnectors(
452
+ language_code=language_code,
453
+ q=q,
454
+ url=url,
455
+ title=title,
456
+ ),
457
+ )
458
+
459
+ req = self._build_request_async(
460
+ method="POST",
461
+ path="/portals/{portalID}/view/searchresults/connectors/event",
462
+ base_url=base_url,
463
+ url_variables=url_variables,
464
+ request=request,
465
+ request_body_required=True,
466
+ request_has_path_params=True,
467
+ request_has_query_params=True,
468
+ user_agent_header="user-agent",
469
+ accept_header_value="application/json",
470
+ http_headers=http_headers,
471
+ security=self.sdk_configuration.security,
472
+ get_serialized_body=lambda: utils.serialize_request_body(
473
+ request.create_viewed_search_result_event_for_connectors,
474
+ False,
475
+ False,
476
+ "json",
477
+ models.CreateViewedSearchResultEventForConnectors,
478
+ ),
479
+ timeout_ms=timeout_ms,
480
+ )
481
+
482
+ if retries == UNSET:
483
+ if self.sdk_configuration.retry_config is not UNSET:
484
+ retries = self.sdk_configuration.retry_config
485
+
486
+ retry_config = None
487
+ if isinstance(retries, utils.RetryConfig):
488
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
489
+
490
+ http_res = await self.do_request_async(
491
+ hook_ctx=HookContext(
492
+ config=self.sdk_configuration,
493
+ base_url=base_url or "",
494
+ operation_id="createViewedSearchResultsEventForConnectors",
495
+ oauth2_scopes=[],
496
+ security_source=get_security_from_env(
497
+ self.sdk_configuration.security, models.Security
498
+ ),
499
+ ),
500
+ request=req,
501
+ error_status_codes=[
502
+ "400",
503
+ "401",
504
+ "403",
505
+ "404",
506
+ "406",
507
+ "415",
508
+ "4XX",
509
+ "500",
510
+ "5XX",
511
+ ],
512
+ retry_config=retry_config,
513
+ )
514
+
515
+ response_data: Any = None
516
+ if utils.match_response(http_res, "204", "*"):
517
+ return
518
+ if utils.match_response(
519
+ http_res, ["400", "401", "403", "404", "406"], "application/json"
520
+ ):
521
+ response_data = unmarshal_json_response(errors.WSErrorCommonData, http_res)
522
+ raise errors.WSErrorCommon(response_data, http_res)
523
+ if utils.match_response(http_res, "500", "application/json"):
524
+ response_data = unmarshal_json_response(errors.WSErrorCommonData, http_res)
525
+ raise errors.WSErrorCommon(response_data, http_res)
526
+ if utils.match_response(http_res, ["415", "4XX"], "*"):
527
+ http_res_text = await utils.stream_to_text_async(http_res)
528
+ raise errors.EgainDefaultError(
529
+ "API error occurred", http_res, http_res_text
530
+ )
531
+ if utils.match_response(http_res, "5XX", "*"):
532
+ http_res_text = await utils.stream_to_text_async(http_res)
533
+ raise errors.EgainDefaultError(
534
+ "API error occurred", http_res, http_res_text
535
+ )
536
+
537
+ raise errors.EgainDefaultError("Unexpected response received", http_res)
@@ -0,0 +1,23 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from .basesdk import BaseSDK
4
+ from .sdkconfiguration import SDKConfiguration
5
+ from egain_api_python.health import Health
6
+ from egain_api_python.import_ import Import
7
+ from typing import Optional
8
+
9
+
10
+ class Content(BaseSDK):
11
+ import_: Import
12
+ health: Health
13
+
14
+ def __init__(
15
+ self, sdk_config: SDKConfiguration, parent_ref: Optional[object] = None
16
+ ) -> None:
17
+ BaseSDK.__init__(self, sdk_config, parent_ref=parent_ref)
18
+ self.sdk_configuration = sdk_config
19
+ self._init_sdks()
20
+
21
+ def _init_sdks(self):
22
+ self.import_ = Import(self.sdk_configuration, parent_ref=self.parent_ref)
23
+ self.health = Health(self.sdk_configuration, parent_ref=self.parent_ref)
@@ -0,0 +1,78 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from .egainerror import EgainError
4
+ from typing import TYPE_CHECKING
5
+ from importlib import import_module
6
+ import builtins
7
+ import sys
8
+
9
+ if TYPE_CHECKING:
10
+ from .egaindefaulterror import EgainDefaultError
11
+ from .gethealthop import ServiceUnavailableError, ServiceUnavailableErrorData
12
+ from .no_response_error import NoResponseError
13
+ from .responsevalidationerror import ResponseValidationError
14
+ from .schemas_wserrorcommon import SchemasWSErrorCommon, SchemasWSErrorCommonData
15
+ from .wserrorcommon import WSErrorCommon, WSErrorCommonData
16
+
17
+ __all__ = [
18
+ "EgainDefaultError",
19
+ "EgainError",
20
+ "NoResponseError",
21
+ "ResponseValidationError",
22
+ "SchemasWSErrorCommon",
23
+ "SchemasWSErrorCommonData",
24
+ "ServiceUnavailableError",
25
+ "ServiceUnavailableErrorData",
26
+ "WSErrorCommon",
27
+ "WSErrorCommonData",
28
+ ]
29
+
30
+ _dynamic_imports: dict[str, str] = {
31
+ "EgainDefaultError": ".egaindefaulterror",
32
+ "ServiceUnavailableError": ".gethealthop",
33
+ "ServiceUnavailableErrorData": ".gethealthop",
34
+ "NoResponseError": ".no_response_error",
35
+ "ResponseValidationError": ".responsevalidationerror",
36
+ "SchemasWSErrorCommon": ".schemas_wserrorcommon",
37
+ "SchemasWSErrorCommonData": ".schemas_wserrorcommon",
38
+ "WSErrorCommon": ".wserrorcommon",
39
+ "WSErrorCommonData": ".wserrorcommon",
40
+ }
41
+
42
+
43
+ def dynamic_import(modname, retries=3):
44
+ for attempt in range(retries):
45
+ try:
46
+ return import_module(modname, __package__)
47
+ except KeyError:
48
+ # Clear any half-initialized module and retry
49
+ sys.modules.pop(modname, None)
50
+ if attempt == retries - 1:
51
+ break
52
+ raise KeyError(f"Failed to import module '{modname}' after {retries} attempts")
53
+
54
+
55
+ def __getattr__(attr_name: str) -> object:
56
+ module_name = _dynamic_imports.get(attr_name)
57
+ if module_name is None:
58
+ raise AttributeError(
59
+ f"No {attr_name} found in _dynamic_imports for module name -> {__name__} "
60
+ )
61
+
62
+ try:
63
+ module = dynamic_import(module_name)
64
+ result = getattr(module, attr_name)
65
+ return result
66
+ except ImportError as e:
67
+ raise ImportError(
68
+ f"Failed to import {attr_name} from {module_name}: {e}"
69
+ ) from e
70
+ except AttributeError as e:
71
+ raise AttributeError(
72
+ f"Failed to get {attr_name} from {module_name}: {e}"
73
+ ) from e
74
+
75
+
76
+ def __dir__():
77
+ lazy_attrs = builtins.list(_dynamic_imports.keys())
78
+ return builtins.sorted(lazy_attrs)
@@ -0,0 +1,40 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ import httpx
4
+ from typing import Optional
5
+ from dataclasses import dataclass
6
+
7
+ from egain_api_python.errors import EgainError
8
+
9
+ MAX_MESSAGE_LEN = 10_000
10
+
11
+
12
+ @dataclass(frozen=True)
13
+ class EgainDefaultError(EgainError):
14
+ """The fallback error class if no more specific error class is matched."""
15
+
16
+ def __init__(
17
+ self, message: str, raw_response: httpx.Response, body: Optional[str] = None
18
+ ):
19
+ body_display = body or raw_response.text or '""'
20
+
21
+ if message:
22
+ message += ": "
23
+ message += f"Status {raw_response.status_code}"
24
+
25
+ headers = raw_response.headers
26
+ content_type = headers.get("content-type", '""')
27
+ if content_type != "application/json":
28
+ if " " in content_type:
29
+ content_type = f'"{content_type}"'
30
+ message += f" Content-Type {content_type}"
31
+
32
+ if len(body_display) > MAX_MESSAGE_LEN:
33
+ truncated = body_display[:MAX_MESSAGE_LEN]
34
+ remaining = len(body_display) - MAX_MESSAGE_LEN
35
+ body_display = f"{truncated}...and {remaining} more chars"
36
+
37
+ message += f". Body: {body_display}"
38
+ message = message.strip()
39
+
40
+ super().__init__(message, raw_response, body)