glean-api-client 0.1.0b2__tar.gz

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 (450) hide show
  1. glean_api_client-0.1.0b2/PKG-INFO +939 -0
  2. glean_api_client-0.1.0b2/README-PYPI.md +922 -0
  3. glean_api_client-0.1.0b2/py.typed +1 -0
  4. glean_api_client-0.1.0b2/pyproject.toml +48 -0
  5. glean_api_client-0.1.0b2/src/glean/__init__.py +17 -0
  6. glean_api_client-0.1.0b2/src/glean/_hooks/__init__.py +5 -0
  7. glean_api_client-0.1.0b2/src/glean/_hooks/registration.py +13 -0
  8. glean_api_client-0.1.0b2/src/glean/_hooks/sdkhooks.py +76 -0
  9. glean_api_client-0.1.0b2/src/glean/_hooks/types.py +106 -0
  10. glean_api_client-0.1.0b2/src/glean/_version.py +15 -0
  11. glean_api_client-0.1.0b2/src/glean/agents.py +632 -0
  12. glean_api_client-0.1.0b2/src/glean/announcements.py +773 -0
  13. glean_api_client-0.1.0b2/src/glean/answers.py +1140 -0
  14. glean_api_client-0.1.0b2/src/glean/basesdk.py +358 -0
  15. glean_api_client-0.1.0b2/src/glean/client.py +59 -0
  16. glean_api_client-0.1.0b2/src/glean/client_activity.py +400 -0
  17. glean_api_client-0.1.0b2/src/glean/client_authentication.py +182 -0
  18. glean_api_client-0.1.0b2/src/glean/client_chat.py +2186 -0
  19. glean_api_client-0.1.0b2/src/glean/client_documents.py +845 -0
  20. glean_api_client-0.1.0b2/src/glean/client_shortcuts.py +1100 -0
  21. glean_api_client-0.1.0b2/src/glean/client_verification.py +604 -0
  22. glean_api_client-0.1.0b2/src/glean/collections.py +1872 -0
  23. glean_api_client-0.1.0b2/src/glean/datasources.py +600 -0
  24. glean_api_client-0.1.0b2/src/glean/entities.py +402 -0
  25. glean_api_client-0.1.0b2/src/glean/errors/__init__.py +14 -0
  26. glean_api_client-0.1.0b2/src/glean/errors/collectionerror.py +25 -0
  27. glean_api_client-0.1.0b2/src/glean/errors/gleandataerror.py +45 -0
  28. glean_api_client-0.1.0b2/src/glean/errors/gleanerror.py +22 -0
  29. glean_api_client-0.1.0b2/src/glean/httpclient.py +136 -0
  30. glean_api_client-0.1.0b2/src/glean/indexing.py +35 -0
  31. glean_api_client-0.1.0b2/src/glean/indexing_authentication.py +182 -0
  32. glean_api_client-0.1.0b2/src/glean/indexing_datasource.py +206 -0
  33. glean_api_client-0.1.0b2/src/glean/indexing_documents.py +2191 -0
  34. glean_api_client-0.1.0b2/src/glean/indexing_permissions.py +2616 -0
  35. glean_api_client-0.1.0b2/src/glean/indexing_shortcuts.py +458 -0
  36. glean_api_client-0.1.0b2/src/glean/insights.py +266 -0
  37. glean_api_client-0.1.0b2/src/glean/messages.py +244 -0
  38. glean_api_client-0.1.0b2/src/glean/models/__init__.py +1835 -0
  39. glean_api_client-0.1.0b2/src/glean/models/activity.py +15 -0
  40. glean_api_client-0.1.0b2/src/glean/models/activityevent.py +49 -0
  41. glean_api_client-0.1.0b2/src/glean/models/activityeventparams.py +61 -0
  42. glean_api_client-0.1.0b2/src/glean/models/addcollectionitemserror.py +22 -0
  43. glean_api_client-0.1.0b2/src/glean/models/addcollectionitemsrequest.py +31 -0
  44. glean_api_client-0.1.0b2/src/glean/models/addcollectionitemsresponse.py +22 -0
  45. glean_api_client-0.1.0b2/src/glean/models/additionalfielddefinition.py +65 -0
  46. glean_api_client-0.1.0b2/src/glean/models/agent.py +49 -0
  47. glean_api_client-0.1.0b2/src/glean/models/agentconfig.py +40 -0
  48. glean_api_client-0.1.0b2/src/glean/models/agentresult.py +14 -0
  49. glean_api_client-0.1.0b2/src/glean/models/aiappactioncounts.py +70 -0
  50. glean_api_client-0.1.0b2/src/glean/models/aiappsinsightsresponse.py +45 -0
  51. glean_api_client-0.1.0b2/src/glean/models/aiinsightsresponse.py +91 -0
  52. glean_api_client-0.1.0b2/src/glean/models/announcement.py +171 -0
  53. glean_api_client-0.1.0b2/src/glean/models/anonymousevent.py +35 -0
  54. glean_api_client-0.1.0b2/src/glean/models/answer.py +155 -0
  55. glean_api_client-0.1.0b2/src/glean/models/answerboard.py +87 -0
  56. glean_api_client-0.1.0b2/src/glean/models/answercreationdata.py +94 -0
  57. glean_api_client-0.1.0b2/src/glean/models/answerlike.py +26 -0
  58. glean_api_client-0.1.0b2/src/glean/models/answerlikes.py +28 -0
  59. glean_api_client-0.1.0b2/src/glean/models/answerresult.py +23 -0
  60. glean_api_client-0.1.0b2/src/glean/models/appresult.py +32 -0
  61. glean_api_client-0.1.0b2/src/glean/models/authconfig.py +115 -0
  62. glean_api_client-0.1.0b2/src/glean/models/authtoken.py +34 -0
  63. glean_api_client-0.1.0b2/src/glean/models/autocompleterequest.py +82 -0
  64. glean_api_client-0.1.0b2/src/glean/models/autocompleteresponse.py +58 -0
  65. glean_api_client-0.1.0b2/src/glean/models/autocompleteresult.py +87 -0
  66. glean_api_client-0.1.0b2/src/glean/models/autocompleteresultgroup.py +31 -0
  67. glean_api_client-0.1.0b2/src/glean/models/badge.py +39 -0
  68. glean_api_client-0.1.0b2/src/glean/models/bulkindexdocumentsrequest.py +56 -0
  69. glean_api_client-0.1.0b2/src/glean/models/bulkindexemployeesrequest.py +54 -0
  70. glean_api_client-0.1.0b2/src/glean/models/bulkindexgroupsrequest.py +59 -0
  71. glean_api_client-0.1.0b2/src/glean/models/bulkindexmembershipsrequest.py +57 -0
  72. glean_api_client-0.1.0b2/src/glean/models/bulkindexshortcutsrequest.py +44 -0
  73. glean_api_client-0.1.0b2/src/glean/models/bulkindexteamsrequest.py +44 -0
  74. glean_api_client-0.1.0b2/src/glean/models/bulkindexusersrequest.py +59 -0
  75. glean_api_client-0.1.0b2/src/glean/models/bulkuploadhistoryevent.py +62 -0
  76. glean_api_client-0.1.0b2/src/glean/models/calendarattendee.py +48 -0
  77. glean_api_client-0.1.0b2/src/glean/models/calendarattendees.py +52 -0
  78. glean_api_client-0.1.0b2/src/glean/models/calendarevent.py +88 -0
  79. glean_api_client-0.1.0b2/src/glean/models/canonicalizingregextype.py +26 -0
  80. glean_api_client-0.1.0b2/src/glean/models/channelinviteinfo.py +48 -0
  81. glean_api_client-0.1.0b2/src/glean/models/chat.py +66 -0
  82. glean_api_client-0.1.0b2/src/glean/models/chatfile.py +36 -0
  83. glean_api_client-0.1.0b2/src/glean/models/chatfilefailurereason.py +16 -0
  84. glean_api_client-0.1.0b2/src/glean/models/chatfilemetadata.py +47 -0
  85. glean_api_client-0.1.0b2/src/glean/models/chatfilestatus.py +13 -0
  86. glean_api_client-0.1.0b2/src/glean/models/chatmessage.py +100 -0
  87. glean_api_client-0.1.0b2/src/glean/models/chatmessagecitation.py +51 -0
  88. glean_api_client-0.1.0b2/src/glean/models/chatmessagefragment.py +50 -0
  89. glean_api_client-0.1.0b2/src/glean/models/chatmetadata.py +60 -0
  90. glean_api_client-0.1.0b2/src/glean/models/chatmetadataresult.py +25 -0
  91. glean_api_client-0.1.0b2/src/glean/models/chatop.py +31 -0
  92. glean_api_client-0.1.0b2/src/glean/models/chatrequest.py +65 -0
  93. glean_api_client-0.1.0b2/src/glean/models/chatresponse.py +46 -0
  94. glean_api_client-0.1.0b2/src/glean/models/chatrestrictionfilters.py +30 -0
  95. glean_api_client-0.1.0b2/src/glean/models/chatresult.py +25 -0
  96. glean_api_client-0.1.0b2/src/glean/models/chatstreamop.py +31 -0
  97. glean_api_client-0.1.0b2/src/glean/models/chatzerostatesuggestionoptions.py +19 -0
  98. glean_api_client-0.1.0b2/src/glean/models/checkdocumentaccessrequest.py +35 -0
  99. glean_api_client-0.1.0b2/src/glean/models/checkdocumentaccessresponse.py +21 -0
  100. glean_api_client-0.1.0b2/src/glean/models/clustergroup.py +35 -0
  101. glean_api_client-0.1.0b2/src/glean/models/clustertypeenum.py +18 -0
  102. glean_api_client-0.1.0b2/src/glean/models/code.py +32 -0
  103. glean_api_client-0.1.0b2/src/glean/models/codeline.py +26 -0
  104. glean_api_client-0.1.0b2/src/glean/models/collection.py +143 -0
  105. glean_api_client-0.1.0b2/src/glean/models/collectionerror.py +25 -0
  106. glean_api_client-0.1.0b2/src/glean/models/collectionitem.py +82 -0
  107. glean_api_client-0.1.0b2/src/glean/models/collectionitemdescriptor.py +56 -0
  108. glean_api_client-0.1.0b2/src/glean/models/collectionpinmetadata.py +19 -0
  109. glean_api_client-0.1.0b2/src/glean/models/collectionpinnablecategories.py +12 -0
  110. glean_api_client-0.1.0b2/src/glean/models/collectionpinnabletargets.py +11 -0
  111. glean_api_client-0.1.0b2/src/glean/models/collectionpinnedmetadata.py +28 -0
  112. glean_api_client-0.1.0b2/src/glean/models/collectionpintarget.py +28 -0
  113. glean_api_client-0.1.0b2/src/glean/models/commentdefinition.py +53 -0
  114. glean_api_client-0.1.0b2/src/glean/models/communicationchannel.py +9 -0
  115. glean_api_client-0.1.0b2/src/glean/models/company.py +84 -0
  116. glean_api_client-0.1.0b2/src/glean/models/conferencedata.py +34 -0
  117. glean_api_client-0.1.0b2/src/glean/models/connectortype.py +17 -0
  118. glean_api_client-0.1.0b2/src/glean/models/contentdefinition.py +31 -0
  119. glean_api_client-0.1.0b2/src/glean/models/contentinsightsresponse.py +46 -0
  120. glean_api_client-0.1.0b2/src/glean/models/countinfo.py +25 -0
  121. glean_api_client-0.1.0b2/src/glean/models/createannouncementrequest.py +105 -0
  122. glean_api_client-0.1.0b2/src/glean/models/createanswerrequest.py +14 -0
  123. glean_api_client-0.1.0b2/src/glean/models/createauthtokenresponse.py +21 -0
  124. glean_api_client-0.1.0b2/src/glean/models/createcollectionrequest.py +78 -0
  125. glean_api_client-0.1.0b2/src/glean/models/createcollectionresponse.py +162 -0
  126. glean_api_client-0.1.0b2/src/glean/models/createshortcutrequest.py +17 -0
  127. glean_api_client-0.1.0b2/src/glean/models/createshortcutresponse.py +19 -0
  128. glean_api_client-0.1.0b2/src/glean/models/customdatasourceconfig.py +237 -0
  129. glean_api_client-0.1.0b2/src/glean/models/customdatavalue.py +33 -0
  130. glean_api_client-0.1.0b2/src/glean/models/customentity.py +51 -0
  131. glean_api_client-0.1.0b2/src/glean/models/customentitymetadata.py +20 -0
  132. glean_api_client-0.1.0b2/src/glean/models/customer.py +70 -0
  133. glean_api_client-0.1.0b2/src/glean/models/customermetadata.py +25 -0
  134. glean_api_client-0.1.0b2/src/glean/models/customfielddata.py +27 -0
  135. glean_api_client-0.1.0b2/src/glean/models/customfieldvalue.py +32 -0
  136. glean_api_client-0.1.0b2/src/glean/models/customfieldvaluehyperlink.py +22 -0
  137. glean_api_client-0.1.0b2/src/glean/models/customfieldvalueperson.py +17 -0
  138. glean_api_client-0.1.0b2/src/glean/models/customfieldvaluestr.py +17 -0
  139. glean_api_client-0.1.0b2/src/glean/models/customproperty.py +23 -0
  140. glean_api_client-0.1.0b2/src/glean/models/datasourcebulkmembershipdefinition.py +30 -0
  141. glean_api_client-0.1.0b2/src/glean/models/datasourcegroupdefinition.py +19 -0
  142. glean_api_client-0.1.0b2/src/glean/models/datasourcemembershipdefinition.py +35 -0
  143. glean_api_client-0.1.0b2/src/glean/models/datasourceobjecttypedocumentcountentry.py +22 -0
  144. glean_api_client-0.1.0b2/src/glean/models/datasourceprofile.py +41 -0
  145. glean_api_client-0.1.0b2/src/glean/models/datasourceuserdefinition.py +32 -0
  146. glean_api_client-0.1.0b2/src/glean/models/debugdatasourcestatusidentityresponsecomponent.py +37 -0
  147. glean_api_client-0.1.0b2/src/glean/models/debugdatasourcestatusresponse.py +115 -0
  148. glean_api_client-0.1.0b2/src/glean/models/debugdocumentrequest.py +25 -0
  149. glean_api_client-0.1.0b2/src/glean/models/debugdocumentresponse.py +37 -0
  150. glean_api_client-0.1.0b2/src/glean/models/debugdocumentsrequest.py +24 -0
  151. glean_api_client-0.1.0b2/src/glean/models/debugdocumentsresponse.py +28 -0
  152. glean_api_client-0.1.0b2/src/glean/models/debugdocumentsresponseitem.py +34 -0
  153. glean_api_client-0.1.0b2/src/glean/models/debuguserrequest.py +19 -0
  154. glean_api_client-0.1.0b2/src/glean/models/debuguserresponse.py +34 -0
  155. glean_api_client-0.1.0b2/src/glean/models/deleteallchatsop.py +22 -0
  156. glean_api_client-0.1.0b2/src/glean/models/deleteannouncementrequest.py +15 -0
  157. glean_api_client-0.1.0b2/src/glean/models/deleteanswerrequest.py +22 -0
  158. glean_api_client-0.1.0b2/src/glean/models/deletechatfilesop.py +32 -0
  159. glean_api_client-0.1.0b2/src/glean/models/deletechatfilesrequest.py +17 -0
  160. glean_api_client-0.1.0b2/src/glean/models/deletechatsop.py +29 -0
  161. glean_api_client-0.1.0b2/src/glean/models/deletechatsrequest.py +16 -0
  162. glean_api_client-0.1.0b2/src/glean/models/deletecollectionitemrequest.py +27 -0
  163. glean_api_client-0.1.0b2/src/glean/models/deletecollectionitemresponse.py +15 -0
  164. glean_api_client-0.1.0b2/src/glean/models/deletecollectionrequest.py +24 -0
  165. glean_api_client-0.1.0b2/src/glean/models/deletedocumentrequest.py +36 -0
  166. glean_api_client-0.1.0b2/src/glean/models/deleteemployeerequest.py +26 -0
  167. glean_api_client-0.1.0b2/src/glean/models/deletegrouprequest.py +31 -0
  168. glean_api_client-0.1.0b2/src/glean/models/deletemembershiprequest.py +34 -0
  169. glean_api_client-0.1.0b2/src/glean/models/deleteshortcutrequest.py +15 -0
  170. glean_api_client-0.1.0b2/src/glean/models/deleteteamrequest.py +19 -0
  171. glean_api_client-0.1.0b2/src/glean/models/deleteuserrequest.py +30 -0
  172. glean_api_client-0.1.0b2/src/glean/models/disambiguation.py +31 -0
  173. glean_api_client-0.1.0b2/src/glean/models/displayablelistitemuiconfig.py +23 -0
  174. glean_api_client-0.1.0b2/src/glean/models/document.py +71 -0
  175. glean_api_client-0.1.0b2/src/glean/models/documentcontent.py +19 -0
  176. glean_api_client-0.1.0b2/src/glean/models/documentdefinition.py +156 -0
  177. glean_api_client-0.1.0b2/src/glean/models/documentinsight.py +25 -0
  178. glean_api_client-0.1.0b2/src/glean/models/documentinteractions.py +50 -0
  179. glean_api_client-0.1.0b2/src/glean/models/documentinteractionsdefinition.py +25 -0
  180. glean_api_client-0.1.0b2/src/glean/models/documentmetadata.py +228 -0
  181. glean_api_client-0.1.0b2/src/glean/models/documentorerror_union.py +27 -0
  182. glean_api_client-0.1.0b2/src/glean/models/documentpermissionsdefinition.py +62 -0
  183. glean_api_client-0.1.0b2/src/glean/models/documentsection.py +21 -0
  184. glean_api_client-0.1.0b2/src/glean/models/documentspec_union.py +70 -0
  185. glean_api_client-0.1.0b2/src/glean/models/documentstatusresponse.py +49 -0
  186. glean_api_client-0.1.0b2/src/glean/models/documentvisibility.py +15 -0
  187. glean_api_client-0.1.0b2/src/glean/models/editanswerrequest.py +111 -0
  188. glean_api_client-0.1.0b2/src/glean/models/editcollectionitemrequest.py +37 -0
  189. glean_api_client-0.1.0b2/src/glean/models/editcollectionitemresponse.py +15 -0
  190. glean_api_client-0.1.0b2/src/glean/models/editcollectionrequest.py +76 -0
  191. glean_api_client-0.1.0b2/src/glean/models/editcollectionresponse.py +162 -0
  192. glean_api_client-0.1.0b2/src/glean/models/editpinrequest.py +30 -0
  193. glean_api_client-0.1.0b2/src/glean/models/employeeinfodefinition.py +198 -0
  194. glean_api_client-0.1.0b2/src/glean/models/employeeteaminfo.py +30 -0
  195. glean_api_client-0.1.0b2/src/glean/models/entitiessortorder.py +16 -0
  196. glean_api_client-0.1.0b2/src/glean/models/entityrelationship.py +24 -0
  197. glean_api_client-0.1.0b2/src/glean/models/entitytype.py +12 -0
  198. glean_api_client-0.1.0b2/src/glean/models/errormessage.py +20 -0
  199. glean_api_client-0.1.0b2/src/glean/models/eventclassification.py +25 -0
  200. glean_api_client-0.1.0b2/src/glean/models/eventclassificationname.py +10 -0
  201. glean_api_client-0.1.0b2/src/glean/models/eventstrategyname.py +18 -0
  202. glean_api_client-0.1.0b2/src/glean/models/externalshortcut.py +69 -0
  203. glean_api_client-0.1.0b2/src/glean/models/extractedqna.py +30 -0
  204. glean_api_client-0.1.0b2/src/glean/models/facetbucket.py +30 -0
  205. glean_api_client-0.1.0b2/src/glean/models/facetbucketfilter.py +21 -0
  206. glean_api_client-0.1.0b2/src/glean/models/facetfilter.py +26 -0
  207. glean_api_client-0.1.0b2/src/glean/models/facetfilterset.py +19 -0
  208. glean_api_client-0.1.0b2/src/glean/models/facetfiltervalue.py +39 -0
  209. glean_api_client-0.1.0b2/src/glean/models/facetresult.py +40 -0
  210. glean_api_client-0.1.0b2/src/glean/models/facetvalue.py +33 -0
  211. glean_api_client-0.1.0b2/src/glean/models/favoriteinfo.py +33 -0
  212. glean_api_client-0.1.0b2/src/glean/models/feedback.py +175 -0
  213. glean_api_client-0.1.0b2/src/glean/models/feedbackchatexchange.py +53 -0
  214. glean_api_client-0.1.0b2/src/glean/models/feedbackop.py +29 -0
  215. glean_api_client-0.1.0b2/src/glean/models/feedentry.py +173 -0
  216. glean_api_client-0.1.0b2/src/glean/models/feedrequest.py +61 -0
  217. glean_api_client-0.1.0b2/src/glean/models/feedrequestoptions.py +59 -0
  218. glean_api_client-0.1.0b2/src/glean/models/feedresponse.py +50 -0
  219. glean_api_client-0.1.0b2/src/glean/models/feedresult.py +61 -0
  220. glean_api_client-0.1.0b2/src/glean/models/followupaction.py +52 -0
  221. glean_api_client-0.1.0b2/src/glean/models/generatedattachment.py +51 -0
  222. glean_api_client-0.1.0b2/src/glean/models/generatedattachmentcontent.py +28 -0
  223. glean_api_client-0.1.0b2/src/glean/models/generatedqna.py +74 -0
  224. glean_api_client-0.1.0b2/src/glean/models/getagentinputsop.py +29 -0
  225. glean_api_client-0.1.0b2/src/glean/models/getagentinputsrequest.py +17 -0
  226. glean_api_client-0.1.0b2/src/glean/models/getagentinputsresponse.py +17 -0
  227. glean_api_client-0.1.0b2/src/glean/models/getanswererror.py +29 -0
  228. glean_api_client-0.1.0b2/src/glean/models/getanswerrequest.py +22 -0
  229. glean_api_client-0.1.0b2/src/glean/models/getanswerresponse.py +22 -0
  230. glean_api_client-0.1.0b2/src/glean/models/getchatapplicationop.py +32 -0
  231. glean_api_client-0.1.0b2/src/glean/models/getchatapplicationrequest.py +15 -0
  232. glean_api_client-0.1.0b2/src/glean/models/getchatapplicationresponse.py +14 -0
  233. glean_api_client-0.1.0b2/src/glean/models/getchatfilesop.py +29 -0
  234. glean_api_client-0.1.0b2/src/glean/models/getchatfilesrequest.py +17 -0
  235. glean_api_client-0.1.0b2/src/glean/models/getchatfilesresponse.py +17 -0
  236. glean_api_client-0.1.0b2/src/glean/models/getchatop.py +29 -0
  237. glean_api_client-0.1.0b2/src/glean/models/getchatrequest.py +15 -0
  238. glean_api_client-0.1.0b2/src/glean/models/getchatresponse.py +18 -0
  239. glean_api_client-0.1.0b2/src/glean/models/getcollectionrequest.py +36 -0
  240. glean_api_client-0.1.0b2/src/glean/models/getcollectionresponse.py +32 -0
  241. glean_api_client-0.1.0b2/src/glean/models/getdatasourceconfigrequest.py +19 -0
  242. glean_api_client-0.1.0b2/src/glean/models/getdocpermissionsrequest.py +17 -0
  243. glean_api_client-0.1.0b2/src/glean/models/getdocpermissionsresponse.py +19 -0
  244. glean_api_client-0.1.0b2/src/glean/models/getdocumentcountrequest.py +19 -0
  245. glean_api_client-0.1.0b2/src/glean/models/getdocumentcountresponse.py +23 -0
  246. glean_api_client-0.1.0b2/src/glean/models/getdocumentsbyfacetsrequest.py +30 -0
  247. glean_api_client-0.1.0b2/src/glean/models/getdocumentsbyfacetsresponse.py +30 -0
  248. glean_api_client-0.1.0b2/src/glean/models/getdocumentsrequest.py +36 -0
  249. glean_api_client-0.1.0b2/src/glean/models/getdocumentsresponse.py +17 -0
  250. glean_api_client-0.1.0b2/src/glean/models/getdocumentstatusrequest.py +30 -0
  251. glean_api_client-0.1.0b2/src/glean/models/getdocumentstatusresponse.py +42 -0
  252. glean_api_client-0.1.0b2/src/glean/models/getpinrequest.py +16 -0
  253. glean_api_client-0.1.0b2/src/glean/models/getpinresponse.py +15 -0
  254. glean_api_client-0.1.0b2/src/glean/models/getshortcutrequest_union.py +31 -0
  255. glean_api_client-0.1.0b2/src/glean/models/getshortcutresponse.py +19 -0
  256. glean_api_client-0.1.0b2/src/glean/models/getusercountrequest.py +19 -0
  257. glean_api_client-0.1.0b2/src/glean/models/getusercountresponse.py +21 -0
  258. glean_api_client-0.1.0b2/src/glean/models/gleanassistinsightsresponse.py +46 -0
  259. glean_api_client-0.1.0b2/src/glean/models/gleandataerror.py +44 -0
  260. glean_api_client-0.1.0b2/src/glean/models/grantpermission.py +22 -0
  261. glean_api_client-0.1.0b2/src/glean/models/greenlistusersrequest.py +25 -0
  262. glean_api_client-0.1.0b2/src/glean/models/group.py +27 -0
  263. glean_api_client-0.1.0b2/src/glean/models/grouptype.py +17 -0
  264. glean_api_client-0.1.0b2/src/glean/models/iconconfig.py +67 -0
  265. glean_api_client-0.1.0b2/src/glean/models/indexdocumentrequest.py +26 -0
  266. glean_api_client-0.1.0b2/src/glean/models/indexdocumentsrequest.py +32 -0
  267. glean_api_client-0.1.0b2/src/glean/models/indexemployeerequest.py +29 -0
  268. glean_api_client-0.1.0b2/src/glean/models/indexgrouprequest.py +34 -0
  269. glean_api_client-0.1.0b2/src/glean/models/indexingshortcut.py +57 -0
  270. glean_api_client-0.1.0b2/src/glean/models/indexmembershiprequest.py +34 -0
  271. glean_api_client-0.1.0b2/src/glean/models/indexstatus.py +27 -0
  272. glean_api_client-0.1.0b2/src/glean/models/indexteamrequest.py +26 -0
  273. glean_api_client-0.1.0b2/src/glean/models/indexuserrequest.py +34 -0
  274. glean_api_client-0.1.0b2/src/glean/models/insightsagentsrequestoptions.py +17 -0
  275. glean_api_client-0.1.0b2/src/glean/models/insightsaiapprequestoptions.py +17 -0
  276. glean_api_client-0.1.0b2/src/glean/models/insightsrequest.py +83 -0
  277. glean_api_client-0.1.0b2/src/glean/models/insightsresponse.py +81 -0
  278. glean_api_client-0.1.0b2/src/glean/models/invalidoperatorvalueerror.py +21 -0
  279. glean_api_client-0.1.0b2/src/glean/models/inviteinfo.py +58 -0
  280. glean_api_client-0.1.0b2/src/glean/models/labeledcountinfo.py +25 -0
  281. glean_api_client-0.1.0b2/src/glean/models/listagentsop.py +28 -0
  282. glean_api_client-0.1.0b2/src/glean/models/listagentsresponse.py +19 -0
  283. glean_api_client-0.1.0b2/src/glean/models/listanswersrequest.py +17 -0
  284. glean_api_client-0.1.0b2/src/glean/models/listanswersresponse.py +18 -0
  285. glean_api_client-0.1.0b2/src/glean/models/listchatsop.py +22 -0
  286. glean_api_client-0.1.0b2/src/glean/models/listchatsresponse.py +18 -0
  287. glean_api_client-0.1.0b2/src/glean/models/listcollectionsrequest.py +37 -0
  288. glean_api_client-0.1.0b2/src/glean/models/listcollectionsresponse.py +17 -0
  289. glean_api_client-0.1.0b2/src/glean/models/listentitiesrequest.py +81 -0
  290. glean_api_client-0.1.0b2/src/glean/models/listentitiesresponse.py +66 -0
  291. glean_api_client-0.1.0b2/src/glean/models/listpinsop.py +13 -0
  292. glean_api_client-0.1.0b2/src/glean/models/listpinsresponse.py +17 -0
  293. glean_api_client-0.1.0b2/src/glean/models/listshortcutspaginatedrequest.py +49 -0
  294. glean_api_client-0.1.0b2/src/glean/models/listshortcutspaginatedresponse.py +31 -0
  295. glean_api_client-0.1.0b2/src/glean/models/listverificationsop.py +20 -0
  296. glean_api_client-0.1.0b2/src/glean/models/manualfeedbackinfo.py +159 -0
  297. glean_api_client-0.1.0b2/src/glean/models/meeting.py +37 -0
  298. glean_api_client-0.1.0b2/src/glean/models/messagesrequest.py +82 -0
  299. glean_api_client-0.1.0b2/src/glean/models/messagesresponse.py +29 -0
  300. glean_api_client-0.1.0b2/src/glean/models/objectdefinition.py +75 -0
  301. glean_api_client-0.1.0b2/src/glean/models/objectpermissions.py +17 -0
  302. glean_api_client-0.1.0b2/src/glean/models/operatormetadata.py +50 -0
  303. glean_api_client-0.1.0b2/src/glean/models/operatorscope.py +18 -0
  304. glean_api_client-0.1.0b2/src/glean/models/peoplerequest.py +69 -0
  305. glean_api_client-0.1.0b2/src/glean/models/peopleresponse.py +31 -0
  306. glean_api_client-0.1.0b2/src/glean/models/period.py +41 -0
  307. glean_api_client-0.1.0b2/src/glean/models/permissions.py +67 -0
  308. glean_api_client-0.1.0b2/src/glean/models/permissionsgroupintersectiondefinition.py +21 -0
  309. glean_api_client-0.1.0b2/src/glean/models/person.py +36 -0
  310. glean_api_client-0.1.0b2/src/glean/models/persondistance.py +26 -0
  311. glean_api_client-0.1.0b2/src/glean/models/personmetadata.py +291 -0
  312. glean_api_client-0.1.0b2/src/glean/models/personobject.py +21 -0
  313. glean_api_client-0.1.0b2/src/glean/models/personteam.py +53 -0
  314. glean_api_client-0.1.0b2/src/glean/models/persontoteamrelationship.py +53 -0
  315. glean_api_client-0.1.0b2/src/glean/models/pindocument.py +55 -0
  316. glean_api_client-0.1.0b2/src/glean/models/pinrequest.py +30 -0
  317. glean_api_client-0.1.0b2/src/glean/models/possiblevalue.py +25 -0
  318. glean_api_client-0.1.0b2/src/glean/models/post_api_index_v1_debug_datasource_documentop.py +25 -0
  319. glean_api_client-0.1.0b2/src/glean/models/post_api_index_v1_debug_datasource_documentsop.py +25 -0
  320. glean_api_client-0.1.0b2/src/glean/models/post_api_index_v1_debug_datasource_statusop.py +18 -0
  321. glean_api_client-0.1.0b2/src/glean/models/post_api_index_v1_debug_datasource_userop.py +25 -0
  322. glean_api_client-0.1.0b2/src/glean/models/processalldocumentsrequest.py +20 -0
  323. glean_api_client-0.1.0b2/src/glean/models/processallmembershipsrequest.py +20 -0
  324. glean_api_client-0.1.0b2/src/glean/models/processinghistoryevent.py +26 -0
  325. glean_api_client-0.1.0b2/src/glean/models/prompttemplate.py +88 -0
  326. glean_api_client-0.1.0b2/src/glean/models/prompttemplateresult.py +35 -0
  327. glean_api_client-0.1.0b2/src/glean/models/propertydefinition.py +82 -0
  328. glean_api_client-0.1.0b2/src/glean/models/propertygroup.py +26 -0
  329. glean_api_client-0.1.0b2/src/glean/models/queryinsight.py +45 -0
  330. glean_api_client-0.1.0b2/src/glean/models/queryinsightsresponse.py +46 -0
  331. glean_api_client-0.1.0b2/src/glean/models/querysuggestion.py +61 -0
  332. glean_api_client-0.1.0b2/src/glean/models/querysuggestionlist.py +21 -0
  333. glean_api_client-0.1.0b2/src/glean/models/quicklink.py +58 -0
  334. glean_api_client-0.1.0b2/src/glean/models/reaction.py +33 -0
  335. glean_api_client-0.1.0b2/src/glean/models/readpermission.py +22 -0
  336. glean_api_client-0.1.0b2/src/glean/models/recommendationsrequest.py +64 -0
  337. glean_api_client-0.1.0b2/src/glean/models/recommendationsrequestoptions.py +47 -0
  338. glean_api_client-0.1.0b2/src/glean/models/referencerange.py +26 -0
  339. glean_api_client-0.1.0b2/src/glean/models/relateddocuments.py +69 -0
  340. glean_api_client-0.1.0b2/src/glean/models/relatedobject.py +35 -0
  341. glean_api_client-0.1.0b2/src/glean/models/relatedobjectedge.py +15 -0
  342. glean_api_client-0.1.0b2/src/glean/models/relatedquestion.py +29 -0
  343. glean_api_client-0.1.0b2/src/glean/models/reminder.py +36 -0
  344. glean_api_client-0.1.0b2/src/glean/models/reminderrequest.py +34 -0
  345. glean_api_client-0.1.0b2/src/glean/models/restrictionfilters.py +20 -0
  346. glean_api_client-0.1.0b2/src/glean/models/resultsdescription.py +25 -0
  347. glean_api_client-0.1.0b2/src/glean/models/resultsresponse.py +59 -0
  348. glean_api_client-0.1.0b2/src/glean/models/resulttab.py +34 -0
  349. glean_api_client-0.1.0b2/src/glean/models/rotatetokenresponse.py +33 -0
  350. glean_api_client-0.1.0b2/src/glean/models/runagentop.py +29 -0
  351. glean_api_client-0.1.0b2/src/glean/models/runagentrequest.py +27 -0
  352. glean_api_client-0.1.0b2/src/glean/models/scopetype.py +11 -0
  353. glean_api_client-0.1.0b2/src/glean/models/searchproviderinfo.py +29 -0
  354. glean_api_client-0.1.0b2/src/glean/models/searchrequest.py +101 -0
  355. glean_api_client-0.1.0b2/src/glean/models/searchrequestinputdetails.py +19 -0
  356. glean_api_client-0.1.0b2/src/glean/models/searchrequestoptions.py +135 -0
  357. glean_api_client-0.1.0b2/src/glean/models/searchresponse.py +120 -0
  358. glean_api_client-0.1.0b2/src/glean/models/searchresponsemetadata.py +95 -0
  359. glean_api_client-0.1.0b2/src/glean/models/searchresult.py +149 -0
  360. glean_api_client-0.1.0b2/src/glean/models/searchresultprominenceenum.py +12 -0
  361. glean_api_client-0.1.0b2/src/glean/models/searchresultsnippet.py +47 -0
  362. glean_api_client-0.1.0b2/src/glean/models/searchwarning.py +50 -0
  363. glean_api_client-0.1.0b2/src/glean/models/security.py +25 -0
  364. glean_api_client-0.1.0b2/src/glean/models/seenfeedbackinfo.py +17 -0
  365. glean_api_client-0.1.0b2/src/glean/models/sessioninfo.py +35 -0
  366. glean_api_client-0.1.0b2/src/glean/models/share.py +33 -0
  367. glean_api_client-0.1.0b2/src/glean/models/shortcut.py +140 -0
  368. glean_api_client-0.1.0b2/src/glean/models/shortcuterror.py +25 -0
  369. glean_api_client-0.1.0b2/src/glean/models/shortcutinsight.py +27 -0
  370. glean_api_client-0.1.0b2/src/glean/models/shortcutinsightsresponse.py +39 -0
  371. glean_api_client-0.1.0b2/src/glean/models/shortcutmutableproperties.py +61 -0
  372. glean_api_client-0.1.0b2/src/glean/models/shortcutspaginationmetadata.py +25 -0
  373. glean_api_client-0.1.0b2/src/glean/models/socialnetwork.py +27 -0
  374. glean_api_client-0.1.0b2/src/glean/models/socialnetworkdefinition.py +31 -0
  375. glean_api_client-0.1.0b2/src/glean/models/sortoptions.py +24 -0
  376. glean_api_client-0.1.0b2/src/glean/models/structuredlink.py +34 -0
  377. glean_api_client-0.1.0b2/src/glean/models/structuredlocation.py +61 -0
  378. glean_api_client-0.1.0b2/src/glean/models/structuredresult.py +141 -0
  379. glean_api_client-0.1.0b2/src/glean/models/structuredtext.py +25 -0
  380. glean_api_client-0.1.0b2/src/glean/models/structuredtextitem.py +23 -0
  381. glean_api_client-0.1.0b2/src/glean/models/structuredtextmutableproperties.py +13 -0
  382. glean_api_client-0.1.0b2/src/glean/models/summarizerequest.py +49 -0
  383. glean_api_client-0.1.0b2/src/glean/models/summarizeresponse.py +34 -0
  384. glean_api_client-0.1.0b2/src/glean/models/summary.py +22 -0
  385. glean_api_client-0.1.0b2/src/glean/models/team.py +146 -0
  386. glean_api_client-0.1.0b2/src/glean/models/teamemail.py +25 -0
  387. glean_api_client-0.1.0b2/src/glean/models/teaminfodefinition.py +87 -0
  388. glean_api_client-0.1.0b2/src/glean/models/teammember.py +31 -0
  389. glean_api_client-0.1.0b2/src/glean/models/textrange.py +47 -0
  390. glean_api_client-0.1.0b2/src/glean/models/thumbnail.py +22 -0
  391. glean_api_client-0.1.0b2/src/glean/models/timeinterval.py +20 -0
  392. glean_api_client-0.1.0b2/src/glean/models/timepoint.py +22 -0
  393. glean_api_client-0.1.0b2/src/glean/models/toolinfo.py +23 -0
  394. glean_api_client-0.1.0b2/src/glean/models/toolmetadata.py +170 -0
  395. glean_api_client-0.1.0b2/src/glean/models/ugctype.py +13 -0
  396. glean_api_client-0.1.0b2/src/glean/models/unpin.py +16 -0
  397. glean_api_client-0.1.0b2/src/glean/models/updateannouncementrequest.py +110 -0
  398. glean_api_client-0.1.0b2/src/glean/models/updatepermissionsrequest.py +47 -0
  399. glean_api_client-0.1.0b2/src/glean/models/updateshortcutrequest.py +66 -0
  400. glean_api_client-0.1.0b2/src/glean/models/updateshortcutresponse.py +19 -0
  401. glean_api_client-0.1.0b2/src/glean/models/uploadchatfilesop.py +32 -0
  402. glean_api_client-0.1.0b2/src/glean/models/uploadchatfilesrequest.py +43 -0
  403. glean_api_client-0.1.0b2/src/glean/models/uploadchatfilesresponse.py +17 -0
  404. glean_api_client-0.1.0b2/src/glean/models/uploadshortcutsrequest.py +44 -0
  405. glean_api_client-0.1.0b2/src/glean/models/uploadstatusenum.py +12 -0
  406. glean_api_client-0.1.0b2/src/glean/models/user.py +22 -0
  407. glean_api_client-0.1.0b2/src/glean/models/useractivity.py +52 -0
  408. glean_api_client-0.1.0b2/src/glean/models/useractivityinsight.py +47 -0
  409. glean_api_client-0.1.0b2/src/glean/models/usergeneratedcontentid.py +16 -0
  410. glean_api_client-0.1.0b2/src/glean/models/userinsightsresponse.py +53 -0
  411. glean_api_client-0.1.0b2/src/glean/models/userreferencedefinition.py +29 -0
  412. glean_api_client-0.1.0b2/src/glean/models/userrole.py +14 -0
  413. glean_api_client-0.1.0b2/src/glean/models/userrolespecification.py +34 -0
  414. glean_api_client-0.1.0b2/src/glean/models/userstatusresponse.py +38 -0
  415. glean_api_client-0.1.0b2/src/glean/models/userviewinfo.py +27 -0
  416. glean_api_client-0.1.0b2/src/glean/models/verification.py +34 -0
  417. glean_api_client-0.1.0b2/src/glean/models/verificationfeed.py +17 -0
  418. glean_api_client-0.1.0b2/src/glean/models/verificationmetadata.py +62 -0
  419. glean_api_client-0.1.0b2/src/glean/models/verifyrequest.py +31 -0
  420. glean_api_client-0.1.0b2/src/glean/models/viewerinfo.py +40 -0
  421. glean_api_client-0.1.0b2/src/glean/models/workflow.py +49 -0
  422. glean_api_client-0.1.0b2/src/glean/models/workflowfeedbackinfo.py +25 -0
  423. glean_api_client-0.1.0b2/src/glean/models/workflowinputfield.py +16 -0
  424. glean_api_client-0.1.0b2/src/glean/models/workflowresult.py +14 -0
  425. glean_api_client-0.1.0b2/src/glean/models/writeactionparameter.py +55 -0
  426. glean_api_client-0.1.0b2/src/glean/models/writepermission.py +37 -0
  427. glean_api_client-0.1.0b2/src/glean/people.py +1847 -0
  428. glean_api_client-0.1.0b2/src/glean/pins.py +986 -0
  429. glean_api_client-0.1.0b2/src/glean/py.typed +1 -0
  430. glean_api_client-0.1.0b2/src/glean/sdk.py +168 -0
  431. glean_api_client-0.1.0b2/src/glean/sdkconfiguration.py +56 -0
  432. glean_api_client-0.1.0b2/src/glean/search.py +1018 -0
  433. glean_api_client-0.1.0b2/src/glean/types/__init__.py +21 -0
  434. glean_api_client-0.1.0b2/src/glean/types/basemodel.py +39 -0
  435. glean_api_client-0.1.0b2/src/glean/utils/__init__.py +102 -0
  436. glean_api_client-0.1.0b2/src/glean/utils/annotations.py +55 -0
  437. glean_api_client-0.1.0b2/src/glean/utils/datetimes.py +23 -0
  438. glean_api_client-0.1.0b2/src/glean/utils/enums.py +74 -0
  439. glean_api_client-0.1.0b2/src/glean/utils/eventstreaming.py +238 -0
  440. glean_api_client-0.1.0b2/src/glean/utils/forms.py +202 -0
  441. glean_api_client-0.1.0b2/src/glean/utils/headers.py +136 -0
  442. glean_api_client-0.1.0b2/src/glean/utils/logger.py +27 -0
  443. glean_api_client-0.1.0b2/src/glean/utils/metadata.py +118 -0
  444. glean_api_client-0.1.0b2/src/glean/utils/queryparams.py +205 -0
  445. glean_api_client-0.1.0b2/src/glean/utils/requestbodies.py +66 -0
  446. glean_api_client-0.1.0b2/src/glean/utils/retries.py +217 -0
  447. glean_api_client-0.1.0b2/src/glean/utils/security.py +192 -0
  448. glean_api_client-0.1.0b2/src/glean/utils/serializers.py +248 -0
  449. glean_api_client-0.1.0b2/src/glean/utils/url.py +155 -0
  450. glean_api_client-0.1.0b2/src/glean/utils/values.py +137 -0
@@ -0,0 +1,939 @@
1
+ Metadata-Version: 2.3
2
+ Name: glean-api-client
3
+ Version: 0.1.0b2
4
+ Summary: Python Client SDK Generated by Speakeasy.
5
+ Author: Glean Technologies, Inc.
6
+ Requires-Python: >=3.9
7
+ Classifier: Programming Language :: Python :: 3
8
+ Classifier: Programming Language :: Python :: 3.9
9
+ Classifier: Programming Language :: Python :: 3.10
10
+ Classifier: Programming Language :: Python :: 3.11
11
+ Classifier: Programming Language :: Python :: 3.12
12
+ Classifier: Programming Language :: Python :: 3.13
13
+ Requires-Dist: httpx (>=0.28.1)
14
+ Requires-Dist: pydantic (>=2.11.2)
15
+ Description-Content-Type: text/markdown
16
+
17
+ # Glean Python API Client
18
+
19
+ The Glean Python SDK provides convenient access to the Glean REST API from any Python 3.8+ application. It includes type hints for all request parameters and response fields, and supports both synchronous and asynchronous usage via [httpx](https://www.python-httpx.org/).
20
+ <!-- No Summary [summary] -->
21
+
22
+ ## Unified SDK Architecture
23
+
24
+ This SDK combines both the Client and Indexing API namespaces into a single unified package:
25
+
26
+ - **Client API**: Used for search, retrieval, and end-user interactions with Glean content
27
+ - **Indexing API**: Used for indexing content, permissions, and other administrative operations
28
+
29
+ Each namespace has its own authentication requirements and access patterns. While they serve different purposes, having them in a single SDK provides a consistent developer experience across all Glean API interactions.
30
+
31
+ ```python
32
+ # Example of accessing Client namespace
33
+ from glean import Glean, models
34
+ import os
35
+
36
+ with Glean(bearer_auth="client-token") as glean:
37
+ search_response = glean.client.search.query(
38
+ search_request=models.SearchRequest(query="search term")
39
+ )
40
+ print(search_response)
41
+
42
+ # Example of accessing Indexing namespace
43
+ from glean import Glean, models
44
+ import os
45
+
46
+ with Glean(bearer_auth="indexing-token") as glean:
47
+ document_response = glean.indexing.documents.index(
48
+ document=models.Document(
49
+ id="doc-123",
50
+ title="Sample Document",
51
+ container_id="container-456",
52
+ datasource="confluence"
53
+ )
54
+ )
55
+ ```
56
+
57
+ Remember that each namespace requires its own authentication token type as described in the [Authentication Methods](https://github.com/gleanwork/api-client-python/blob/master/#authentication-methods) section.
58
+
59
+ <!-- Start Table of Contents [toc] -->
60
+ ## Table of Contents
61
+ <!-- $toc-max-depth=2 -->
62
+ * [Glean Python API Client](https://github.com/gleanwork/api-client-python/blob/master/#glean-python-api-client)
63
+ * [Unified SDK Architecture](https://github.com/gleanwork/api-client-python/blob/master/#unified-sdk-architecture)
64
+ * [SDK Installation](https://github.com/gleanwork/api-client-python/blob/master/#sdk-installation)
65
+ * [IDE Support](https://github.com/gleanwork/api-client-python/blob/master/#ide-support)
66
+ * [SDK Example Usage](https://github.com/gleanwork/api-client-python/blob/master/#sdk-example-usage)
67
+ * [Authentication](https://github.com/gleanwork/api-client-python/blob/master/#authentication)
68
+ * [Available Resources and Operations](https://github.com/gleanwork/api-client-python/blob/master/#available-resources-and-operations)
69
+ * [Retries](https://github.com/gleanwork/api-client-python/blob/master/#retries)
70
+ * [Error Handling](https://github.com/gleanwork/api-client-python/blob/master/#error-handling)
71
+ * [Server Selection](https://github.com/gleanwork/api-client-python/blob/master/#server-selection)
72
+ * [Custom HTTP Client](https://github.com/gleanwork/api-client-python/blob/master/#custom-http-client)
73
+ * [Resource Management](https://github.com/gleanwork/api-client-python/blob/master/#resource-management)
74
+ * [Debugging](https://github.com/gleanwork/api-client-python/blob/master/#debugging)
75
+ * [Development](https://github.com/gleanwork/api-client-python/blob/master/#development)
76
+ * [Maturity](https://github.com/gleanwork/api-client-python/blob/master/#maturity)
77
+ * [Contributions](https://github.com/gleanwork/api-client-python/blob/master/#contributions)
78
+
79
+ <!-- End Table of Contents [toc] -->
80
+
81
+ ## SDK Installation
82
+
83
+ > [!NOTE]
84
+ > **Python version upgrade policy**
85
+ >
86
+ > Once a Python version reaches its [official end of life date](https://devguide.python.org/versions/), a 3-month grace period is provided for users to upgrade. Following this grace period, the minimum python version supported in the SDK will be updated.
87
+
88
+ The SDK can be installed with either *pip* or *poetry* package managers.
89
+
90
+ ### PIP
91
+
92
+ *PIP* is the default package installer for Python, enabling easy installation and management of packages from PyPI via the command line.
93
+
94
+ ```bash
95
+ pip install api-client-glean
96
+ ```
97
+
98
+ ### Poetry
99
+
100
+ *Poetry* is a modern tool that simplifies dependency management and package publishing by using a single `pyproject.toml` file to handle project metadata and dependencies.
101
+
102
+ ```bash
103
+ poetry add api-client-glean
104
+ ```
105
+
106
+ ### Shell and script usage with `uv`
107
+
108
+ You can use this SDK in a Python shell with [uv](https://docs.astral.sh/uv/) and the `uvx` command that comes with it like so:
109
+
110
+ ```shell
111
+ uvx --from api-client-glean python
112
+ ```
113
+
114
+ It's also possible to write a standalone Python script without needing to set up a whole project like so:
115
+
116
+ ```python
117
+ #!/usr/bin/env -S uv run --script
118
+ # /// script
119
+ # requires-python = ">=3.9"
120
+ # dependencies = [
121
+ # "api-client-glean",
122
+ # ]
123
+ # ///
124
+
125
+ from glean import Glean
126
+
127
+ sdk = Glean(
128
+ # SDK arguments
129
+ )
130
+
131
+ # Rest of script here...
132
+ ```
133
+
134
+ Once that is saved to a file, you can run it with `uv run script.py` where
135
+ `script.py` can be replaced with the actual file name.
136
+ <!-- No SDK Installation [installation] -->
137
+
138
+ <!-- Start IDE Support [idesupport] -->
139
+ ## IDE Support
140
+
141
+ ### PyCharm
142
+
143
+ Generally, the SDK will work well with most IDEs out of the box. However, when using PyCharm, you can enjoy much better integration with Pydantic by installing an additional plugin.
144
+
145
+ - [PyCharm Pydantic Plugin](https://docs.pydantic.dev/latest/integrations/pycharm/)
146
+ <!-- End IDE Support [idesupport] -->
147
+
148
+ <!-- Start SDK Example Usage [usage] -->
149
+ ## SDK Example Usage
150
+
151
+ ### Example 1
152
+
153
+ ```python
154
+ # Synchronous Example
155
+ from glean import Glean, models
156
+ import os
157
+
158
+
159
+ with Glean(
160
+ api_token=os.getenv("GLEAN_API_TOKEN", ""),
161
+ ) as g_client:
162
+
163
+ res = g_client.client.chat.create(messages=[
164
+ {
165
+ "fragments": [
166
+ models.ChatMessageFragment(
167
+ text="What are the company holidays this year?",
168
+ ),
169
+ ],
170
+ },
171
+ ], timeout_millis=30000)
172
+
173
+ # Handle response
174
+ print(res)
175
+ ```
176
+
177
+ </br>
178
+
179
+ The same SDK client can also be used to make asychronous requests by importing asyncio.
180
+ ```python
181
+ # Asynchronous Example
182
+ import asyncio
183
+ from glean import Glean, models
184
+ import os
185
+
186
+ async def main():
187
+
188
+ async with Glean(
189
+ api_token=os.getenv("GLEAN_API_TOKEN", ""),
190
+ ) as g_client:
191
+
192
+ res = await g_client.client.chat.create_async(messages=[
193
+ {
194
+ "fragments": [
195
+ models.ChatMessageFragment(
196
+ text="What are the company holidays this year?",
197
+ ),
198
+ ],
199
+ },
200
+ ], timeout_millis=30000)
201
+
202
+ # Handle response
203
+ print(res)
204
+
205
+ asyncio.run(main())
206
+ ```
207
+
208
+ ### Example 2
209
+
210
+ ```python
211
+ # Synchronous Example
212
+ from glean import Glean, models
213
+ import os
214
+
215
+
216
+ with Glean(
217
+ api_token=os.getenv("GLEAN_API_TOKEN", ""),
218
+ ) as g_client:
219
+
220
+ res = g_client.client.chat.create_stream(messages=[
221
+ {
222
+ "fragments": [
223
+ models.ChatMessageFragment(
224
+ text="What are the company holidays this year?",
225
+ ),
226
+ ],
227
+ },
228
+ ], timeout_millis=30000)
229
+
230
+ # Handle response
231
+ print(res)
232
+ ```
233
+
234
+ </br>
235
+
236
+ The same SDK client can also be used to make asychronous requests by importing asyncio.
237
+ ```python
238
+ # Asynchronous Example
239
+ import asyncio
240
+ from glean import Glean, models
241
+ import os
242
+
243
+ async def main():
244
+
245
+ async with Glean(
246
+ api_token=os.getenv("GLEAN_API_TOKEN", ""),
247
+ ) as g_client:
248
+
249
+ res = await g_client.client.chat.create_stream_async(messages=[
250
+ {
251
+ "fragments": [
252
+ models.ChatMessageFragment(
253
+ text="What are the company holidays this year?",
254
+ ),
255
+ ],
256
+ },
257
+ ], timeout_millis=30000)
258
+
259
+ # Handle response
260
+ print(res)
261
+
262
+ asyncio.run(main())
263
+ ```
264
+ <!-- End SDK Example Usage [usage] -->
265
+
266
+ <!-- Start Authentication [security] -->
267
+ ## Authentication
268
+
269
+ ### Per-Client Security Schemes
270
+
271
+ This SDK supports the following security scheme globally:
272
+
273
+ | Name | Type | Scheme | Environment Variable |
274
+ | ----------- | ---- | ----------- | -------------------- |
275
+ | `api_token` | http | HTTP Bearer | `GLEAN_API_TOKEN` |
276
+
277
+ To authenticate with the API the `api_token` parameter must be set when initializing the SDK client instance. For example:
278
+ ```python
279
+ from glean import Glean, models
280
+ from glean.utils import parse_datetime
281
+ import os
282
+
283
+
284
+ with Glean(
285
+ api_token=os.getenv("GLEAN_API_TOKEN", ""),
286
+ ) as g_client:
287
+
288
+ g_client.client.activity.report(events=[
289
+ {
290
+ "action": models.ActivityEventAction.HISTORICAL_VIEW,
291
+ "timestamp": parse_datetime("2000-01-23T04:56:07.000Z"),
292
+ "url": "https://example.com/",
293
+ },
294
+ {
295
+ "action": models.ActivityEventAction.SEARCH,
296
+ "params": {
297
+ "query": "query",
298
+ },
299
+ "timestamp": parse_datetime("2000-01-23T04:56:07.000Z"),
300
+ "url": "https://example.com/search?q=query",
301
+ },
302
+ {
303
+ "action": models.ActivityEventAction.VIEW,
304
+ "params": {
305
+ "duration": 20,
306
+ "referrer": "https://example.com/document",
307
+ },
308
+ "timestamp": parse_datetime("2000-01-23T04:56:07.000Z"),
309
+ "url": "https://example.com/",
310
+ },
311
+ ])
312
+
313
+ # Use the SDK ...
314
+
315
+ ```
316
+ <!-- End Authentication [security] -->
317
+
318
+ ### Authentication Methods
319
+
320
+ Glean supports different authentication methods depending on which API namespace you're using:
321
+
322
+ #### Client Namespace
323
+
324
+ The Client namespace supports two authentication methods:
325
+
326
+ 1. **Manually Provisioned API Tokens**
327
+ - Can be created by an Admin or a user with the API Token Creator role
328
+ - Used for server-to-server integrations
329
+
330
+ 2. **OAuth**
331
+ - Requires OAuth setup to be completed by an Admin
332
+ - Used for user-based authentication flows
333
+
334
+ #### Indexing Namespace
335
+
336
+ The Indexing namespace supports only one authentication method:
337
+
338
+ 1. **Manually Provisioned API Tokens**
339
+ - Can be created by an Admin or a user with the API Token Creator role
340
+ - Used for secure document indexing operations
341
+
342
+ > [!IMPORTANT]
343
+ > Client tokens **will not work** for Indexing operations, and Indexing tokens **will not work** for Client operations. You must use the appropriate token type for the namespace you're accessing.
344
+
345
+ For more information on obtaining the appropriate token type, please contact your Glean administrator.
346
+
347
+ <!-- Start Available Resources and Operations [operations] -->
348
+ ## Available Resources and Operations
349
+
350
+ <details open>
351
+ <summary>Available methods</summary>
352
+
353
+ ### [client](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/client/README.md)
354
+
355
+
356
+ #### [client.activity](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/clientactivity/README.md)
357
+
358
+ * [report](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/clientactivity/README.md#report) - Report document activity
359
+ * [feedback](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/clientactivity/README.md#feedback) - Report client activity
360
+
361
+ #### [client.agents](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/agents/README.md)
362
+
363
+ * [run](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/agents/README.md#run) - Runs an Agent.
364
+ * [list](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/agents/README.md#list) - Lists all agents.
365
+ * [retrieve_inputs](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/agents/README.md#retrieve_inputs) - Gets the inputs to an agent.
366
+
367
+ #### [client.announcements](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/announcements/README.md)
368
+
369
+ * [create](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/announcements/README.md#create) - Create Announcement
370
+ * [delete](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/announcements/README.md#delete) - Delete Announcement
371
+ * [update](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/announcements/README.md#update) - Update Announcement
372
+
373
+ #### [client.answers](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/answers/README.md)
374
+
375
+ * [create](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/answers/README.md#create) - Create Answer
376
+ * [delete](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/answers/README.md#delete) - Delete Answer
377
+ * [update](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/answers/README.md#update) - Update Answer
378
+ * [retrieve](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/answers/README.md#retrieve) - Read Answer
379
+ * [list](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/answers/README.md#list) - List Answers
380
+
381
+ #### [client.authentication](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/clientauthentication/README.md)
382
+
383
+ * [create_token](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/clientauthentication/README.md#create_token) - Create authentication token
384
+
385
+ #### [client.chat](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/clientchat/README.md)
386
+
387
+ * [create](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/clientchat/README.md#create) - Chat
388
+ * [delete_all](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/clientchat/README.md#delete_all) - Deletes all saved Chats owned by a user
389
+ * [delete](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/clientchat/README.md#delete) - Deletes saved Chats
390
+ * [retrieve](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/clientchat/README.md#retrieve) - Retrieves a Chat
391
+ * [list](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/clientchat/README.md#list) - Retrieves all saved Chats
392
+ * [retrieve_application](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/clientchat/README.md#retrieve_application) - Gets the metadata for a custom Chat application
393
+ * [upload_files](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/clientchat/README.md#upload_files) - Upload files for Chat.
394
+ * [retrieve_files](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/clientchat/README.md#retrieve_files) - Get files uploaded by a user for Chat.
395
+ * [delete_files](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/clientchat/README.md#delete_files) - Delete files uploaded by a user for chat.
396
+ * [create_stream](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/clientchat/README.md#create_stream) - Chat
397
+
398
+ #### [client.collections](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/collections/README.md)
399
+
400
+ * [add_items](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/collections/README.md#add_items) - Add Collection item
401
+ * [create](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/collections/README.md#create) - Create Collection
402
+ * [delete](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/collections/README.md#delete) - Delete Collection
403
+ * [delete_item](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/collections/README.md#delete_item) - Delete Collection item
404
+ * [update](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/collections/README.md#update) - Update Collection
405
+ * [update_item](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/collections/README.md#update_item) - Update Collection item
406
+ * [retrieve](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/collections/README.md#retrieve) - Read Collection
407
+ * [list](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/collections/README.md#list) - List Collections
408
+
409
+ #### [client.documents](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/clientdocuments/README.md)
410
+
411
+ * [retrieve_permissions](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/clientdocuments/README.md#retrieve_permissions) - Read document permissions
412
+ * [retrieve](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/clientdocuments/README.md#retrieve) - Read documents
413
+ * [retrieve_by_facets](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/clientdocuments/README.md#retrieve_by_facets) - Read documents by facets
414
+ * [summarize](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/clientdocuments/README.md#summarize) - Summarize documents
415
+
416
+ #### [client.entities](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/entities/README.md)
417
+
418
+ * [list](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/entities/README.md#list) - List entities
419
+ * [read_people](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/entities/README.md#read_people) - Read people
420
+
421
+ #### [client.insights](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/insights/README.md)
422
+
423
+ * [retrieve](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/insights/README.md#retrieve) - Read insights
424
+
425
+ #### [client.messages](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/messages/README.md)
426
+
427
+ * [retrieve](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/messages/README.md#retrieve) - Read messages
428
+
429
+ #### [client.pins](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/pins/README.md)
430
+
431
+ * [update](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/pins/README.md#update) - Update pin
432
+ * [retrieve](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/pins/README.md#retrieve) - Read pin
433
+ * [list](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/pins/README.md#list) - List pins
434
+ * [create](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/pins/README.md#create) - Create pin
435
+ * [remove](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/pins/README.md#remove) - Delete pin
436
+
437
+ #### [client.search](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/search/README.md)
438
+
439
+ * [query_as_admin](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/search/README.md#query_as_admin) - Search the index (admin)
440
+ * [autocomplete](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/search/README.md#autocomplete) - Autocomplete
441
+ * [retrieve_feed](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/search/README.md#retrieve_feed) - Feed of documents and events
442
+ * [recommendations](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/search/README.md#recommendations) - Recommend documents
443
+ * [query](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/search/README.md#query) - Search
444
+
445
+ #### [client.shortcuts](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/clientshortcuts/README.md)
446
+
447
+ * [create](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/clientshortcuts/README.md#create) - Create shortcut
448
+ * [delete](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/clientshortcuts/README.md#delete) - Delete shortcut
449
+ * [retrieve](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/clientshortcuts/README.md#retrieve) - Read shortcut
450
+ * [list](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/clientshortcuts/README.md#list) - List shortcuts
451
+ * [update](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/clientshortcuts/README.md#update) - Update shortcut
452
+
453
+ #### [client.verification](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/clientverification/README.md)
454
+
455
+ * [add_reminder](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/clientverification/README.md#add_reminder) - Create verification
456
+ * [list](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/clientverification/README.md#list) - List verifications
457
+ * [verify](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/clientverification/README.md#verify) - Update verification
458
+
459
+
460
+ ### [indexing](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/indexing/README.md)
461
+
462
+
463
+ #### [indexing.authentication](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/indexingauthentication/README.md)
464
+
465
+ * [rotate_token](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/indexingauthentication/README.md#rotate_token) - Rotate token
466
+
467
+ #### [indexing.datasource](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/indexingdatasource/README.md)
468
+
469
+ * [status](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/indexingdatasource/README.md#status) - Beta: Get datasource status
470
+
471
+
472
+ #### [indexing.datasources](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/datasources/README.md)
473
+
474
+ * [add](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/datasources/README.md#add) - Add or update datasource
475
+ * [retrieve_config](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/datasources/README.md#retrieve_config) - Get datasource config
476
+
477
+ #### [indexing.documents](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/indexingdocuments/README.md)
478
+
479
+ * [add_or_update](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/indexingdocuments/README.md#add_or_update) - Index document
480
+ * [index](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/indexingdocuments/README.md#index) - Index documents
481
+ * [bulk_index](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/indexingdocuments/README.md#bulk_index) - Bulk index documents
482
+ * [process_all](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/indexingdocuments/README.md#process_all) - Schedules the processing of uploaded documents
483
+ * [delete](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/indexingdocuments/README.md#delete) - Delete document
484
+ * [debug](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/indexingdocuments/README.md#debug) - Beta: Get document information
485
+
486
+ * [debug_many](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/indexingdocuments/README.md#debug_many) - Beta: Get information of a batch of documents
487
+
488
+ * [check_access](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/indexingdocuments/README.md#check_access) - Check document access
489
+ * [~~status~~](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/indexingdocuments/README.md#status) - Get document upload and indexing status :warning: **Deprecated**
490
+ * [~~count~~](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/indexingdocuments/README.md#count) - Get document count :warning: **Deprecated**
491
+
492
+ #### [indexing.people](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/people/README.md)
493
+
494
+ * [debug](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/people/README.md#debug) - Beta: Get user information
495
+
496
+ * [~~count~~](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/people/README.md#count) - Get user count :warning: **Deprecated**
497
+ * [index](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/people/README.md#index) - Index employee
498
+ * [bulk_index](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/people/README.md#bulk_index) - Bulk index employees
499
+ * [process_all_employees_and_teams](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/people/README.md#process_all_employees_and_teams) - Schedules the processing of uploaded employees and teams
500
+ * [delete](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/people/README.md#delete) - Delete employee
501
+ * [index_team](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/people/README.md#index_team) - Index team
502
+ * [delete_team](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/people/README.md#delete_team) - Delete team
503
+ * [bulk_index_teams](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/people/README.md#bulk_index_teams) - Bulk index teams
504
+
505
+ #### [indexing.permissions](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/indexingpermissions/README.md)
506
+
507
+ * [update_permissions](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/indexingpermissions/README.md#update_permissions) - Update document permissions
508
+ * [index_user](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/indexingpermissions/README.md#index_user) - Index user
509
+ * [bulk_index_users](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/indexingpermissions/README.md#bulk_index_users) - Bulk index users
510
+ * [index_group](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/indexingpermissions/README.md#index_group) - Index group
511
+ * [bulk_index_groups](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/indexingpermissions/README.md#bulk_index_groups) - Bulk index groups
512
+ * [index_membership](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/indexingpermissions/README.md#index_membership) - Index membership
513
+ * [bulk_index_memberships](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/indexingpermissions/README.md#bulk_index_memberships) - Bulk index memberships for a group
514
+ * [process_memberships](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/indexingpermissions/README.md#process_memberships) - Schedules the processing of group memberships
515
+ * [delete_user](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/indexingpermissions/README.md#delete_user) - Delete user
516
+ * [delete_group](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/indexingpermissions/README.md#delete_group) - Delete group
517
+ * [delete_membership](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/indexingpermissions/README.md#delete_membership) - Delete membership
518
+ * [authorize_beta_users](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/indexingpermissions/README.md#authorize_beta_users) - Beta users
519
+
520
+ #### [indexing.shortcuts](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/indexingshortcuts/README.md)
521
+
522
+ * [bulk_index](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/indexingshortcuts/README.md#bulk_index) - Bulk index external shortcuts
523
+ * [upload](https://github.com/gleanwork/api-client-python/blob/master/docs/sdks/indexingshortcuts/README.md#upload) - Upload shortcuts
524
+
525
+ </details>
526
+ <!-- End Available Resources and Operations [operations] -->
527
+
528
+ <!-- Start Retries [retries] -->
529
+ ## Retries
530
+
531
+ Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK.
532
+
533
+ To change the default retry strategy for a single API call, simply provide a `RetryConfig` object to the call:
534
+ ```python
535
+ from glean import Glean, models
536
+ from glean.utils import BackoffStrategy, RetryConfig, parse_datetime
537
+ import os
538
+
539
+
540
+ with Glean(
541
+ api_token=os.getenv("GLEAN_API_TOKEN", ""),
542
+ ) as g_client:
543
+
544
+ g_client.client.activity.report(events=[
545
+ {
546
+ "action": models.ActivityEventAction.HISTORICAL_VIEW,
547
+ "timestamp": parse_datetime("2000-01-23T04:56:07.000Z"),
548
+ "url": "https://example.com/",
549
+ },
550
+ {
551
+ "action": models.ActivityEventAction.SEARCH,
552
+ "params": {
553
+ "query": "query",
554
+ },
555
+ "timestamp": parse_datetime("2000-01-23T04:56:07.000Z"),
556
+ "url": "https://example.com/search?q=query",
557
+ },
558
+ {
559
+ "action": models.ActivityEventAction.VIEW,
560
+ "params": {
561
+ "duration": 20,
562
+ "referrer": "https://example.com/document",
563
+ },
564
+ "timestamp": parse_datetime("2000-01-23T04:56:07.000Z"),
565
+ "url": "https://example.com/",
566
+ },
567
+ ],
568
+ RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False))
569
+
570
+ # Use the SDK ...
571
+
572
+ ```
573
+
574
+ If you'd like to override the default retry strategy for all operations that support retries, you can use the `retry_config` optional parameter when initializing the SDK:
575
+ ```python
576
+ from glean import Glean, models
577
+ from glean.utils import BackoffStrategy, RetryConfig, parse_datetime
578
+ import os
579
+
580
+
581
+ with Glean(
582
+ retry_config=RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False),
583
+ api_token=os.getenv("GLEAN_API_TOKEN", ""),
584
+ ) as g_client:
585
+
586
+ g_client.client.activity.report(events=[
587
+ {
588
+ "action": models.ActivityEventAction.HISTORICAL_VIEW,
589
+ "timestamp": parse_datetime("2000-01-23T04:56:07.000Z"),
590
+ "url": "https://example.com/",
591
+ },
592
+ {
593
+ "action": models.ActivityEventAction.SEARCH,
594
+ "params": {
595
+ "query": "query",
596
+ },
597
+ "timestamp": parse_datetime("2000-01-23T04:56:07.000Z"),
598
+ "url": "https://example.com/search?q=query",
599
+ },
600
+ {
601
+ "action": models.ActivityEventAction.VIEW,
602
+ "params": {
603
+ "duration": 20,
604
+ "referrer": "https://example.com/document",
605
+ },
606
+ "timestamp": parse_datetime("2000-01-23T04:56:07.000Z"),
607
+ "url": "https://example.com/",
608
+ },
609
+ ])
610
+
611
+ # Use the SDK ...
612
+
613
+ ```
614
+ <!-- End Retries [retries] -->
615
+
616
+ ## Error Handling
617
+
618
+ All operations return a response object or raise an exception:
619
+
620
+ | Status Code | Description | Error Type | Content Type |
621
+ | ----------- | ----------------------- | ---------------------- | ---------------- |
622
+ | 400 | Invalid Request | errors.GleanError | \*/\* |
623
+ | 401 | Not Authorized | errors.GleanError | \*/\* |
624
+ | 403 | Permission Denied | errors.GleanDataError | application/json |
625
+ | 408 | Request Timeout | errors.GleanError | \*/\* |
626
+ | 422 | Invalid Query | errors.GleanDataError | application/json |
627
+ | 429 | Too Many Requests | errors.GleanError | \*/\* |
628
+ | 4XX | Other Client Errors | errors.GleanError | \*/\* |
629
+ | 5XX | Internal Server Errors | errors.GleanError | \*/\* |
630
+
631
+
632
+ ### Example
633
+
634
+ ```python
635
+ from glean import Glean, errors, models
636
+ import os
637
+
638
+
639
+ with Glean(
640
+ bearer_auth=os.getenv("GLEAN_BEARER_AUTH", ""),
641
+ ) as g_client:
642
+ try:
643
+ res = g_client.client.search.execute(search_request=models.SearchRequest(
644
+ tracking_token="trackingToken",
645
+ page_size=10,
646
+ query="vacation policy",
647
+ request_options=models.SearchRequestOptions(
648
+ facet_filters=[
649
+ models.FacetFilter(
650
+ field_name="type",
651
+ values=[
652
+ models.FacetFilterValue(
653
+ value="article",
654
+ relation_type=models.RelationType.EQUALS,
655
+ ),
656
+ models.FacetFilterValue(
657
+ value="document",
658
+ relation_type=models.RelationType.EQUALS,
659
+ ),
660
+ ],
661
+ ),
662
+ models.FacetFilter(
663
+ field_name="department",
664
+ values=[
665
+ models.FacetFilterValue(
666
+ value="engineering",
667
+ relation_type=models.RelationType.EQUALS,
668
+ ),
669
+ ],
670
+ ),
671
+ ],
672
+ facet_bucket_size=246815,
673
+ ),
674
+ ))
675
+
676
+ # Handle response
677
+ print(res)
678
+ except errors.GleanError as e:
679
+ print(e.message)
680
+ print(e.status_code)
681
+ print(e.raw_response)
682
+ print(e.body)
683
+ # If the server returned structured data
684
+ except errors.GleanDataError as e:
685
+ print(e.data)
686
+ print(e.data.errorMessage)
687
+ ```
688
+
689
+ By default, an API error will raise a errors.GleanError exception, which has the following properties:
690
+
691
+ | Property | Type | Description |
692
+ |----------------------|------------------|-----------------------|
693
+ | `error.status_code` | *int* | The HTTP status code |
694
+ | `error.message` | *str* | The error message |
695
+ | `error.raw_response` | *httpx.Response* | The raw HTTP response |
696
+ | `error.body` | *str* | The response content |
697
+
698
+ <!-- No Error Handling [errors] -->
699
+
700
+ <!-- Start Server Selection [server] -->
701
+ ## Server Selection
702
+
703
+ ### Server Variables
704
+
705
+ The default server `https://{domain}-be.glean.com` contains variables and is set to `https://domain-be.glean.com` by default. To override default values, the following parameters are available when initializing the SDK client instance:
706
+
707
+ | Variable | Parameter | Default | Description |
708
+ | -------- | ------------- | ---------- | ------------------------------------------------------------------------ |
709
+ | `domain` | `domain: str` | `"domain"` | Email domain (without extension) that determines the deployment backend. |
710
+
711
+ #### Example
712
+
713
+ ```python
714
+ from glean import Glean, models
715
+ from glean.utils import parse_datetime
716
+ import os
717
+
718
+
719
+ with Glean(
720
+ domain="scared-pearl.biz"
721
+ api_token=os.getenv("GLEAN_API_TOKEN", ""),
722
+ ) as g_client:
723
+
724
+ g_client.client.activity.report(events=[
725
+ {
726
+ "action": models.ActivityEventAction.HISTORICAL_VIEW,
727
+ "timestamp": parse_datetime("2000-01-23T04:56:07.000Z"),
728
+ "url": "https://example.com/",
729
+ },
730
+ {
731
+ "action": models.ActivityEventAction.SEARCH,
732
+ "params": {
733
+ "query": "query",
734
+ },
735
+ "timestamp": parse_datetime("2000-01-23T04:56:07.000Z"),
736
+ "url": "https://example.com/search?q=query",
737
+ },
738
+ {
739
+ "action": models.ActivityEventAction.VIEW,
740
+ "params": {
741
+ "duration": 20,
742
+ "referrer": "https://example.com/document",
743
+ },
744
+ "timestamp": parse_datetime("2000-01-23T04:56:07.000Z"),
745
+ "url": "https://example.com/",
746
+ },
747
+ ])
748
+
749
+ # Use the SDK ...
750
+
751
+ ```
752
+
753
+ ### Override Server URL Per-Client
754
+
755
+ The default server can be overridden globally by passing a URL to the `server_url: str` optional parameter when initializing the SDK client instance. For example:
756
+ ```python
757
+ from glean import Glean, models
758
+ from glean.utils import parse_datetime
759
+ import os
760
+
761
+
762
+ with Glean(
763
+ server_url="https://domain-be.glean.com",
764
+ api_token=os.getenv("GLEAN_API_TOKEN", ""),
765
+ ) as g_client:
766
+
767
+ g_client.client.activity.report(events=[
768
+ {
769
+ "action": models.ActivityEventAction.HISTORICAL_VIEW,
770
+ "timestamp": parse_datetime("2000-01-23T04:56:07.000Z"),
771
+ "url": "https://example.com/",
772
+ },
773
+ {
774
+ "action": models.ActivityEventAction.SEARCH,
775
+ "params": {
776
+ "query": "query",
777
+ },
778
+ "timestamp": parse_datetime("2000-01-23T04:56:07.000Z"),
779
+ "url": "https://example.com/search?q=query",
780
+ },
781
+ {
782
+ "action": models.ActivityEventAction.VIEW,
783
+ "params": {
784
+ "duration": 20,
785
+ "referrer": "https://example.com/document",
786
+ },
787
+ "timestamp": parse_datetime("2000-01-23T04:56:07.000Z"),
788
+ "url": "https://example.com/",
789
+ },
790
+ ])
791
+
792
+ # Use the SDK ...
793
+
794
+ ```
795
+ <!-- End Server Selection [server] -->
796
+
797
+ <!-- Start Custom HTTP Client [http-client] -->
798
+ ## Custom HTTP Client
799
+
800
+ The Python SDK makes API calls using the [httpx](https://www.python-httpx.org/) HTTP library. In order to provide a convenient way to configure timeouts, cookies, proxies, custom headers, and other low-level configuration, you can initialize the SDK client with your own HTTP client instance.
801
+ Depending on whether you are using the sync or async version of the SDK, you can pass an instance of `HttpClient` or `AsyncHttpClient` respectively, which are Protocol's ensuring that the client has the necessary methods to make API calls.
802
+ This allows you to wrap the client with your own custom logic, such as adding custom headers, logging, or error handling, or you can just pass an instance of `httpx.Client` or `httpx.AsyncClient` directly.
803
+
804
+ For example, you could specify a header for every request that this sdk makes as follows:
805
+ ```python
806
+ from glean import Glean
807
+ import httpx
808
+
809
+ http_client = httpx.Client(headers={"x-custom-header": "someValue"})
810
+ s = Glean(client=http_client)
811
+ ```
812
+
813
+ or you could wrap the client with your own custom logic:
814
+ ```python
815
+ from glean import Glean
816
+ from glean.httpclient import AsyncHttpClient
817
+ import httpx
818
+
819
+ class CustomClient(AsyncHttpClient):
820
+ client: AsyncHttpClient
821
+
822
+ def __init__(self, client: AsyncHttpClient):
823
+ self.client = client
824
+
825
+ async def send(
826
+ self,
827
+ request: httpx.Request,
828
+ *,
829
+ stream: bool = False,
830
+ auth: Union[
831
+ httpx._types.AuthTypes, httpx._client.UseClientDefault, None
832
+ ] = httpx.USE_CLIENT_DEFAULT,
833
+ follow_redirects: Union[
834
+ bool, httpx._client.UseClientDefault
835
+ ] = httpx.USE_CLIENT_DEFAULT,
836
+ ) -> httpx.Response:
837
+ request.headers["Client-Level-Header"] = "added by client"
838
+
839
+ return await self.client.send(
840
+ request, stream=stream, auth=auth, follow_redirects=follow_redirects
841
+ )
842
+
843
+ def build_request(
844
+ self,
845
+ method: str,
846
+ url: httpx._types.URLTypes,
847
+ *,
848
+ content: Optional[httpx._types.RequestContent] = None,
849
+ data: Optional[httpx._types.RequestData] = None,
850
+ files: Optional[httpx._types.RequestFiles] = None,
851
+ json: Optional[Any] = None,
852
+ params: Optional[httpx._types.QueryParamTypes] = None,
853
+ headers: Optional[httpx._types.HeaderTypes] = None,
854
+ cookies: Optional[httpx._types.CookieTypes] = None,
855
+ timeout: Union[
856
+ httpx._types.TimeoutTypes, httpx._client.UseClientDefault
857
+ ] = httpx.USE_CLIENT_DEFAULT,
858
+ extensions: Optional[httpx._types.RequestExtensions] = None,
859
+ ) -> httpx.Request:
860
+ return self.client.build_request(
861
+ method,
862
+ url,
863
+ content=content,
864
+ data=data,
865
+ files=files,
866
+ json=json,
867
+ params=params,
868
+ headers=headers,
869
+ cookies=cookies,
870
+ timeout=timeout,
871
+ extensions=extensions,
872
+ )
873
+
874
+ s = Glean(async_client=CustomClient(httpx.AsyncClient()))
875
+ ```
876
+ <!-- End Custom HTTP Client [http-client] -->
877
+
878
+ <!-- Start Resource Management [resource-management] -->
879
+ ## Resource Management
880
+
881
+ The `Glean` class implements the context manager protocol and registers a finalizer function to close the underlying sync and async HTTPX clients it uses under the hood. This will close HTTP connections, release memory and free up other resources held by the SDK. In short-lived Python programs and notebooks that make a few SDK method calls, resource management may not be a concern. However, in longer-lived programs, it is beneficial to create a single SDK instance via a [context manager][context-manager] and reuse it across the application.
882
+
883
+ [context-manager]: https://docs.python.org/3/reference/datamodel.html#context-managers
884
+
885
+ ```python
886
+ from glean import Glean
887
+ import os
888
+ def main():
889
+
890
+ with Glean(
891
+ api_token=os.getenv("GLEAN_API_TOKEN", ""),
892
+ ) as g_client:
893
+ # Rest of application here...
894
+
895
+
896
+ # Or when using async:
897
+ async def amain():
898
+
899
+ async with Glean(
900
+ api_token=os.getenv("GLEAN_API_TOKEN", ""),
901
+ ) as g_client:
902
+ # Rest of application here...
903
+ ```
904
+ <!-- End Resource Management [resource-management] -->
905
+
906
+ <!-- Start Debugging [debug] -->
907
+ ## Debugging
908
+
909
+ You can setup your SDK to emit debug logs for SDK requests and responses.
910
+
911
+ You can pass your own logger class directly into your SDK.
912
+ ```python
913
+ from glean import Glean
914
+ import logging
915
+
916
+ logging.basicConfig(level=logging.DEBUG)
917
+ s = Glean(debug_logger=logging.getLogger("glean"))
918
+ ```
919
+
920
+ You can also enable a default debug logger by setting an environment variable `GLEAN_DEBUG` to true.
921
+ <!-- End Debugging [debug] -->
922
+
923
+ <!-- Placeholder for Future Speakeasy SDK Sections -->
924
+
925
+ # Development
926
+
927
+ ## Maturity
928
+
929
+ This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage
930
+ to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally
931
+ looking for the latest version.
932
+
933
+ ## Contributions
934
+
935
+ While we value open-source contributions to this SDK, this library is generated programmatically. Any manual changes added to internal files will be overwritten on the next generation.
936
+ We look forward to hearing your feedback. Feel free to open a PR or an issue with a proof of concept and we'll do our best to include it in a future release.
937
+
938
+ ### SDK Created by [Speakeasy](https://www.speakeasy.com/?utm_source=glean&utm_campaign=python)
939
+