pyegeria 0.2.4__py3-none-any.whl → 5.3.0.dev3__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 (239) hide show
  1. pyegeria/README.md +35 -0
  2. pyegeria/__init__.py +345 -14
  3. pyegeria/_client.py +376 -126
  4. pyegeria/_deprecated_gov_engine.py +451 -0
  5. pyegeria/_exceptions.py +6 -6
  6. pyegeria/_globals.py +7 -1
  7. pyegeria/_validators.py +9 -6
  8. pyegeria/asset_catalog_omvs.py +807 -0
  9. pyegeria/automated_curation_omvs.py +3760 -0
  10. pyegeria/classification_manager_omvs.py +5238 -0
  11. pyegeria/collection_manager_omvs.py +2727 -0
  12. pyegeria/commands/README.md +47 -0
  13. pyegeria/commands/__init__.py +22 -0
  14. pyegeria/commands/cat/README.md +16 -0
  15. pyegeria/commands/cat/__init__.py +1 -0
  16. pyegeria/commands/cat/exp_list_glossaries.py +156 -0
  17. pyegeria/commands/cat/get_asset_graph.py +319 -0
  18. pyegeria/commands/cat/get_collection.py +148 -0
  19. pyegeria/commands/cat/get_project_dependencies.py +168 -0
  20. pyegeria/commands/cat/get_project_structure.py +168 -0
  21. pyegeria/commands/cat/get_tech_type_elements.py +174 -0
  22. pyegeria/commands/cat/glossary_actions.py +362 -0
  23. pyegeria/commands/cat/list_assets.py +176 -0
  24. pyegeria/commands/cat/list_cert_types.py +194 -0
  25. pyegeria/commands/cat/list_collections.py +162 -0
  26. pyegeria/commands/cat/list_deployed_catalogs.py +217 -0
  27. pyegeria/commands/cat/list_deployed_database_schemas.py +251 -0
  28. pyegeria/commands/cat/list_deployed_databases.py +202 -0
  29. pyegeria/commands/cat/list_glossaries.py +150 -0
  30. pyegeria/commands/cat/list_projects.py +221 -0
  31. pyegeria/commands/cat/list_servers_deployed_imp.py +158 -0
  32. pyegeria/commands/cat/list_tech_type_elements.py +190 -0
  33. pyegeria/commands/cat/list_tech_types.py +140 -0
  34. pyegeria/commands/cat/list_terms.py +242 -0
  35. pyegeria/commands/cat/list_todos.py +189 -0
  36. pyegeria/commands/cat/list_user_ids.py +145 -0
  37. pyegeria/commands/cli/__init__.py +13 -0
  38. pyegeria/commands/cli/egeria.py +1844 -0
  39. pyegeria/commands/cli/egeria_cat.py +638 -0
  40. pyegeria/commands/cli/egeria_login_tui.py +313 -0
  41. pyegeria/commands/cli/egeria_my.py +248 -0
  42. pyegeria/commands/cli/egeria_ops.py +502 -0
  43. pyegeria/commands/cli/egeria_tech.py +618 -0
  44. pyegeria/commands/cli/ops_config.py +45 -0
  45. pyegeria/commands/cli/txt_custom_v2.tcss +19 -0
  46. pyegeria/commands/doc/README.md +145 -0
  47. pyegeria/commands/doc/Visual Command Reference/README.md +511 -0
  48. pyegeria/commands/doc/Visual Command Reference/cat/show/assets/asset-graph 2024-11-20 at 15.56.42.png +0 -0
  49. pyegeria/commands/doc/Visual Command Reference/cat/show/assets/assets-in-domain 2024-11-20 at 15.49.55@2x.png +0 -0
  50. pyegeria/commands/doc/Visual Command Reference/cat/show/assets/elements-of-type 2024-11-20 at 16.01.35.png +0 -0
  51. pyegeria/commands/doc/Visual Command Reference/cat/show/assets/tech-type-elements 2024-11-20 at 16.05.05.png +0 -0
  52. pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/deployed-data-catalogs 2024-12-17 at 15.43.27@2x.png +0 -0
  53. pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/deployed-data-catalogs-2024-11-20 at 16.17.43@2x.png +0 -0
  54. pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/deployed-schemas 2024-11-25 at 20.14.50@2x.png +0 -0
  55. pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/deployed-schemas 2024-12-17 at 15.48.38@2x.png +0 -0
  56. pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/deployed-servers 2024-11-25 at 20.21.25@2x.png +0 -0
  57. pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/deployed-servers 2024-12-17 at 15.52.16@2x.png +0 -0
  58. pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/deployed_databases 2024-12-16 at 16.40.31@2x.png +0 -0
  59. pyegeria/commands/doc/Visual Command Reference/cat/show/glossary/list-glossaries 2024-11-25 at 20.30.02.png +0 -0
  60. pyegeria/commands/doc/Visual Command Reference/cat/show/glossary/list-terms 2024-11-25 at 20.32.11.png +0 -0
  61. pyegeria/commands/doc/Visual Command Reference/cat/show/info/asset-types 2024-11-25 at 20.34.19@2x.png +0 -0
  62. pyegeria/commands/doc/Visual Command Reference/cat/show/info/certification-types 2024-11-25 at 20.37.07.png +0 -0
  63. pyegeria/commands/doc/Visual Command Reference/cat/show/info/collection-graph 2024-12-12 at 11.33.18@2x.png +0 -0
  64. pyegeria/commands/doc/Visual Command Reference/cat/show/info/list-collections 2024-12-10 at 14.25.51@2x.png +0 -0
  65. pyegeria/commands/doc/Visual Command Reference/cat/show/info/list-todos 2024-12-12 at 11.46.30@2x.png +0 -0
  66. pyegeria/commands/doc/Visual Command Reference/cat/show/info/list-user-ids 2024-12-12 at 11.51.09@2x.png +0 -0
  67. pyegeria/commands/doc/Visual Command Reference/cat/show/info/tech-types 2024-12-12 at 11.37.20@2x.png +0 -0
  68. pyegeria/commands/doc/Visual Command Reference/cat/show/projects/project_dependencies 2024-12-14 at 16.24.39@2x.png +0 -0
  69. pyegeria/commands/doc/Visual Command Reference/cat/show/projects/project_structure 2024-12-14 at 16.21.35@2x.png +0 -0
  70. pyegeria/commands/doc/Visual Command Reference/cat/show/projects/projects 2024-12-14 at 16.18.10@2x.png +0 -0
  71. pyegeria/commands/doc/Visual Command Reference/hey_egeria tui 2024-12-16 at 16.58.22@2x.png +0 -0
  72. pyegeria/commands/doc/Visual Command Reference/my/show/my_profile 2024-12-14 at 16.29.27@2x.png +0 -0
  73. pyegeria/commands/doc/Visual Command Reference/my/show/my_roles 2024-12-14 at 16.32.10@2x.png +0 -0
  74. pyegeria/commands/doc/Visual Command Reference/my/show/my_todos 2024-12-15 at 16.24.13@2x.png +0 -0
  75. pyegeria/commands/doc/Visual Command Reference/my/show/open_todos 2024-12-14 at 16.36.12@2x.png +0 -0
  76. pyegeria/commands/doc/Visual Command Reference/ops/show/engines/list_engine_activity compressed 2024-12-15 at 16.48.48@2x.png +0 -0
  77. pyegeria/commands/doc/Visual Command Reference/ops/show/engines/monitor_engine_activity 2024-12-15 at 16.32.55@2x.png +0 -0
  78. pyegeria/commands/doc/Visual Command Reference/ops/show/engines/monitor_engine_activity compressed 2024-12-15 at 16.38.29@2x.png +0 -0
  79. pyegeria/commands/doc/Visual Command Reference/ops/show/engines/monitor_engine_status 2024-12-15 at 16.51.26.jpeg +0 -0
  80. pyegeria/commands/doc/Visual Command Reference/ops/show/integrations/monitor_integration_daemon_status 2024-12-15 at 16.57.12@2x.png +0 -0
  81. pyegeria/commands/doc/Visual Command Reference/ops/show/integrations/monitor_integration_targets 2024-12-15 at 17.02.19@2x.png +0 -0
  82. pyegeria/commands/doc/Visual Command Reference/ops/show/platforms/monitor_platform_status 2024-12-15 at 19.53.18@2x.png +0 -0
  83. pyegeria/commands/doc/Visual Command Reference/ops/show/servers/monitor_server_status 2024-12-15 at 19.59.39@2x.png +0 -0
  84. pyegeria/commands/doc/Visual Command Reference/ops/show/servers/monitor_server_status full 2024-12-15 at 20.01.57@2x.png +0 -0
  85. pyegeria/commands/doc/Visual Command Reference/ops/show/servers/monitor_startup_servers 2024-12-15 at 19.56.07@2x.png +0 -0
  86. pyegeria/commands/doc/Visual Command Reference/tech/show/elements/get_anchored_elements 2024-12-15 at 21.25.41@2x.png +0 -0
  87. pyegeria/commands/doc/Visual Command Reference/tech/show/elements/get_elements_of_om_type 2024-12-16 at 14.39.59@2x.png +0 -0
  88. pyegeria/commands/doc/Visual Command Reference/tech/show/elements/info_for_guid 2024-12-16 at 11.35.29@2x.png +0 -0
  89. pyegeria/commands/doc/Visual Command Reference/tech/show/elements/list_elements_by_om-type 2024-12-16 at 14.24.18@2x.png +0 -0
  90. pyegeria/commands/doc/Visual Command Reference/tech/show/elements/list_elements_by_om-type extended 2024-12-16 at 14.28.46@2x.png +0 -0
  91. pyegeria/commands/doc/Visual Command Reference/tech/show/elements/list_elements_of_om_type_by_classification 2024-12-16 at 14.35.26@2x.png +0 -0
  92. pyegeria/commands/doc/Visual Command Reference/tech/show/elements/related_elements 2024-12-16 at 14.55.01@2x.png +0 -0
  93. pyegeria/commands/doc/Visual Command Reference/tech/show/elements/show_related_specifications 2024-12-16 at 15.04.55@2x.png +0 -0
  94. pyegeria/commands/doc/Visual Command Reference/tech/show/tech-info/asset_types 2024-12-16 at 15.10.16@2x.png +0 -0
  95. pyegeria/commands/doc/Visual Command Reference/tech/show/tech-info/detailed_governance_action_processes 2024-12-16 at 15.16.26@2x.png +0 -0
  96. pyegeria/commands/doc/Visual Command Reference/tech/show/tech-info/governance_action_processes 2024-12-16 at 15.13.01@2x.png +0 -0
  97. pyegeria/commands/doc/Visual Command Reference/tech/show/tech-info/registered_services 2024-12-16 at 16.44.54@2x.png +0 -0
  98. pyegeria/commands/doc/Visual Command Reference/tech/show/tech-info/relationship_types 2024-12-16 at 16.20.34@2x.png +0 -0
  99. pyegeria/commands/doc/Visual Command Reference/tech/show/tech-info/relationship_types 2024-12-19 at 10.51.54@2x.png +0 -0
  100. pyegeria/commands/doc/Visual Command Reference/tech/show/tech-info/valid_metadata_values 2024-12-16 at 15.31.56@2x.png +0 -0
  101. pyegeria/commands/doc/Visual Command Reference/tech/show/tech-types/list_tech_type_template_specs 2024-12-16 at 16.03.22@2x.png +0 -0
  102. pyegeria/commands/doc/Visual Command Reference/tech/show/tech-types/list_technology_types 2024-12-16 at 15.39.20@2x.png +0 -0
  103. pyegeria/commands/doc/Visual Command Reference/tech/show/tech-types/tech_type_details 2024-12-16 at 15.37.21@2x.png +0 -0
  104. pyegeria/commands/doc/Visual Command Reference/tech/show/tech-types/tech_type_templates 2024-12-16 at 16.11.48@2x.png +0 -0
  105. pyegeria/commands/doc/glossary/basic-glossary-tui.md +109 -0
  106. pyegeria/commands/doc/glossary/images/delete-glossary-step1 2024-11-06 at 15.47.23@2x.png +0 -0
  107. pyegeria/commands/doc/glossary/images/delete-glossary-step2 2024-11-06 at 15.51.29@2x.png +0 -0
  108. pyegeria/commands/doc/glossary/images/delete-glossary-step3 2024-11-06 at 15.53.19@2x.png +0 -0
  109. pyegeria/commands/doc/glossary/images/delete-glossary-step4 2024-11-06 at 15.55.11@2x.png +0 -0
  110. pyegeria/commands/doc/glossary/images/out-create-glossary example 2024-11-05 at 20.38.04@2x.png +0 -0
  111. pyegeria/commands/doc/glossary/images/out-create-term 2024-11-06 at 20.48.29.png +0 -0
  112. pyegeria/commands/doc/glossary/images/out-delete-term 2024-11-07 at 03.57.25.png +0 -0
  113. pyegeria/commands/doc/glossary/images/out-display-terms-for-glossary-test 2024-11-06 at 20.51.28.png +0 -0
  114. pyegeria/commands/doc/glossary/images/out-export-example 2024-11-07 at 09.54.57.png +0 -0
  115. pyegeria/commands/doc/glossary/images/out-exported-terms 2024-11-06 at 21.06.32.png +0 -0
  116. pyegeria/commands/doc/glossary/images/out-glossary-list example 2024-11-05 at 20.41.02@2x.png +0 -0
  117. pyegeria/commands/doc/glossary/images/out-import-terms 2024-11-07 at 08.15.18.png +0 -0
  118. pyegeria/commands/doc/glossary/images/out-list-all-terms 2024-11-06 at 16.22.20@2x.png +0 -0
  119. pyegeria/commands/doc/glossary/images/out-list-terms-for-example 2024-11-06 at 16.40.12.png +0 -0
  120. pyegeria/commands/doc/glossary/images/out-list-terms-second 2024-11-06 at 16.45.13.png +0 -0
  121. pyegeria/commands/doc/glossary/images/out-pipx install pyegeria 2024-11-10 at 18.12.21.png +0 -0
  122. pyegeria/commands/doc/glossary/images/out-server-status-full 2024-11-10 at 18.25.14.png +0 -0
  123. pyegeria/commands/doc/glossary/images/out-servers-status 2024-11-10 at 18.15.42.png +0 -0
  124. pyegeria/commands/doc/glossary/images/out-upsert-import 2024-11-07 at 19.37.00.png +0 -0
  125. pyegeria/commands/doc/glossary/images/tui-2024-11-10 at 18.26.29.png +0 -0
  126. pyegeria/commands/doc/glossary/images/tui-create-glossary example 2024-11-05 at 20.34.24@2x.png +0 -0
  127. pyegeria/commands/doc/glossary/images/tui-create-term 2024-11-06 at 20.46.35.png +0 -0
  128. pyegeria/commands/doc/glossary/images/tui-delete-term 2024-11-07 at 03.51.57.png +0 -0
  129. pyegeria/commands/doc/glossary/images/tui-display-terms-for-example 2024-11-06 at 20.56.49.png +0 -0
  130. pyegeria/commands/doc/glossary/images/tui-export-example 2024-11-07 at 09.52.59.png +0 -0
  131. pyegeria/commands/doc/glossary/images/tui-hey-egeria 2024-11-10 at 18.31.01.png +0 -0
  132. pyegeria/commands/doc/glossary/images/tui-import-upsert-example 2024-11-07 at 10.08.37.png +0 -0
  133. pyegeria/commands/doc/glossary/images/tui-list-terms-second 2024-11-06 at 16.46.34.png +0 -0
  134. pyegeria/commands/doc/glossary/images/tui-load-archive.png +0 -0
  135. pyegeria/commands/doc/glossary/images/tui-server-status-full 2024-11-10 at 19.14.36.png +0 -0
  136. pyegeria/commands/doc/glossary/images/tui-show-glossaries 2024-11-07 at 20.00.05.png +0 -0
  137. pyegeria/commands/doc/glossary/images/tui-show-glossary-terms 2024-11-05 at 19.37.53@2x.png +0 -0
  138. pyegeria/commands/doc/glossary/images/tui-upsert 2024-11-07 at 11.49.04.png +0 -0
  139. pyegeria/commands/doc/glossary/images/upsert-example.om-terms 2024-11-07 at 11.44.05.png +0 -0
  140. pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/README.md +346 -0
  141. pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/images/CleanShot 2024-11-18 at 21.32.03@2x.png +0 -0
  142. pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/images/Xmind 1731421782704.png +0 -0
  143. pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/images/Xmind 1731422134920.png +0 -0
  144. pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/images/hey_egeria 2024-11-12 at 20.38.43.png +0 -0
  145. pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/images/hey_egeria cat 2024-11-12 at 21.41.43.png +0 -0
  146. pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/images/out-integ-status-list 2024-11-12 at 16.45.26.png +0 -0
  147. pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/images/out-integ-status-live 2024-11-12 at 16.44.12@2x.png +0 -0
  148. pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/images/out-server-status 2024-11-10 at 18.15.42@2x.png +0 -0
  149. pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/images/out-server-status-full 2024-11-10 at 18.25.14@2x.png +0 -0
  150. pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/images/short-cut commands 2024-11-12 at 22.22.13.png +0 -0
  151. pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/images/tui-hey-egeria.png +0 -0
  152. pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/images/tui-integration-status-paging.png +0 -0
  153. pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/images/tui-load-archive 2024-11-10 at 19.19.09@2x.png +0 -0
  154. pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/images/tui-show-server-status 2024-11-10 at 18.52.01@2x.png +0 -0
  155. pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/images/tui-show-server-status-full 2024-11-10.png +0 -0
  156. pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/images/tui-status-paging 2024-11-12 at 16.26.14@2x.png +0 -0
  157. pyegeria/commands/my/README.md +17 -0
  158. pyegeria/commands/my/__init__.py +0 -0
  159. pyegeria/commands/my/list_my_profile.py +163 -0
  160. pyegeria/commands/my/list_my_roles.py +151 -0
  161. pyegeria/commands/my/monitor_my_todos.py +205 -0
  162. pyegeria/commands/my/monitor_open_todos.py +175 -0
  163. pyegeria/commands/my/todo_actions.py +242 -0
  164. pyegeria/commands/ops/README.md +24 -0
  165. pyegeria/commands/ops/__init__.py +22 -0
  166. pyegeria/commands/ops/gov_server_actions.py +177 -0
  167. pyegeria/commands/ops/list_archives.py +161 -0
  168. pyegeria/commands/ops/list_catalog_targets.py +203 -0
  169. pyegeria/commands/ops/load_archive.py +75 -0
  170. pyegeria/commands/ops/monitor_asset_events.py +107 -0
  171. pyegeria/commands/ops/monitor_engine_activity.py +270 -0
  172. pyegeria/commands/ops/monitor_engine_activity_c.py +286 -0
  173. pyegeria/commands/ops/monitor_gov_eng_status.py +288 -0
  174. pyegeria/commands/ops/monitor_integ_daemon_status.py +321 -0
  175. pyegeria/commands/ops/monitor_platform_status.py +188 -0
  176. pyegeria/commands/ops/monitor_server_startup.py +117 -0
  177. pyegeria/commands/ops/monitor_server_status.py +182 -0
  178. pyegeria/commands/ops/orig_monitor_server_list.py +140 -0
  179. pyegeria/commands/ops/orig_monitor_server_status.py +124 -0
  180. pyegeria/commands/ops/refresh_integration_daemon.py +83 -0
  181. pyegeria/commands/ops/restart_integration_daemon.py +82 -0
  182. pyegeria/commands/ops/table_integ_daemon_status.py +237 -0
  183. pyegeria/commands/ops/x_engine_actions.py +76 -0
  184. pyegeria/commands/tech/README.md +24 -0
  185. pyegeria/commands/tech/__init__.py +0 -0
  186. pyegeria/commands/tech/get_element_info.py +144 -0
  187. pyegeria/commands/tech/get_guid_info.py +134 -0
  188. pyegeria/commands/tech/get_tech_details.py +173 -0
  189. pyegeria/commands/tech/get_tech_type_template.py +166 -0
  190. pyegeria/commands/tech/list_anchored_elements.py +205 -0
  191. pyegeria/commands/tech/list_asset_types.py +123 -0
  192. pyegeria/commands/tech/list_elements.py +168 -0
  193. pyegeria/commands/tech/list_elements_for_classification.py +171 -0
  194. pyegeria/commands/tech/list_elements_x.py +191 -0
  195. pyegeria/commands/tech/list_gov_action_processes.py +139 -0
  196. pyegeria/commands/tech/list_registered_services.py +180 -0
  197. pyegeria/commands/tech/list_related_elements.py +207 -0
  198. pyegeria/commands/tech/list_related_specification.py +169 -0
  199. pyegeria/commands/tech/list_relationship_types.py +164 -0
  200. pyegeria/commands/tech/list_relationships.py +179 -0
  201. pyegeria/commands/tech/list_tech_templates.py +360 -0
  202. pyegeria/commands/tech/list_valid_metadata_values.py +178 -0
  203. pyegeria/commands/tech/table_tech_templates.py +238 -0
  204. pyegeria/commands/tech/x_list_related_elements.py +165 -0
  205. pyegeria/core_omag_server_config.py +550 -313
  206. pyegeria/create_tech_guid_lists.py +105 -0
  207. pyegeria/egeria_cat_client.py +78 -0
  208. pyegeria/egeria_client.py +117 -0
  209. pyegeria/egeria_config_client.py +45 -0
  210. pyegeria/egeria_my_client.py +56 -0
  211. pyegeria/egeria_tech_client.py +93 -0
  212. pyegeria/feedback_manager_omvs.py +4573 -0
  213. pyegeria/full_omag_server_config.py +1337 -0
  214. pyegeria/glossary_browser_omvs.py +2507 -0
  215. pyegeria/glossary_manager_omvs.py +3597 -0
  216. pyegeria/mermaid_utilities.py +218 -0
  217. pyegeria/metadata_explorer_omvs.py +2371 -0
  218. pyegeria/my_profile_omvs.py +1021 -0
  219. pyegeria/platform_services.py +259 -218
  220. pyegeria/project_manager_omvs.py +1854 -0
  221. pyegeria/registered_info.py +111 -108
  222. pyegeria/runtime_manager_omvs.py +2299 -0
  223. pyegeria/server_operations.py +178 -71
  224. pyegeria/template_manager_omvs.py +1414 -0
  225. pyegeria/utils.py +75 -85
  226. pyegeria/valid_metadata_omvs.py +1911 -0
  227. pyegeria/x_action_author_omvs.py +200 -0
  228. pyegeria-5.3.0.dev3.dist-info/METADATA +70 -0
  229. pyegeria-5.3.0.dev3.dist-info/RECORD +232 -0
  230. {pyegeria-0.2.4.dist-info → pyegeria-5.3.0.dev3.dist-info}/WHEEL +1 -1
  231. pyegeria-5.3.0.dev3.dist-info/entry_points.txt +81 -0
  232. pyegeria/config.toml +0 -11
  233. pyegeria/curation_omvs.py +0 -458
  234. pyegeria/exceptions.py +0 -382
  235. pyegeria/glossary_omvs.py +0 -639
  236. pyegeria/gov_engine.py +0 -573
  237. pyegeria-0.2.4.dist-info/METADATA +0 -57
  238. pyegeria-0.2.4.dist-info/RECORD +0 -19
  239. {pyegeria-0.2.4.dist-info/licenses → pyegeria-5.3.0.dev3.dist-info}/LICENSE +0 -0
@@ -0,0 +1,1021 @@
1
+ """
2
+
3
+ This module contains the MyProfile class and its methods.
4
+
5
+ """
6
+ import asyncio
7
+ import json
8
+
9
+ from pyegeria import body_slimmer
10
+ from pyegeria._client import Client
11
+ from pyegeria._validators import validate_name, validate_search_string
12
+
13
+
14
+ class MyProfile(Client):
15
+ """A class representing the profile of a user.
16
+
17
+ This class provides methods for retrieving the profile details
18
+ of a user associated with a token.
19
+
20
+ Parameters
21
+ ----------
22
+ view_server : str
23
+ The name of the view server to configure.
24
+ platform_url : str
25
+ The URL of the platform.
26
+ token : str, optional
27
+ The token associated with the user. Default is None.
28
+ user_id : str, optional
29
+ The user ID. Default is None.
30
+ user_pwd : str, optional
31
+ The user password. Default is None.
32
+
33
+ """
34
+
35
+ def __init__(
36
+ self,
37
+ view_server: str,
38
+ platform_url: str,
39
+ user_id: str = None,
40
+ user_pwd: str = None,
41
+ token: str = None,
42
+ ):
43
+ Client.__init__(
44
+ self,
45
+ view_server,
46
+ platform_url,
47
+ user_id=user_id,
48
+ user_pwd=user_pwd,
49
+ token=token,
50
+ )
51
+ self.view_server = view_server
52
+ self.platform_url = platform_url
53
+ self.user_id = user_id
54
+ self.user_pwd = user_pwd
55
+
56
+ self.my_profile_command_root: str = f"{platform_url}/servers"
57
+
58
+ #
59
+ # MyProfile
60
+ #
61
+
62
+ async def _async_get_my_profile(self) -> dict | str:
63
+ """Get the profile of the user associated with the token used.
64
+
65
+ Parameters
66
+ ----------
67
+
68
+ Returns
69
+ -------
70
+ List | str
71
+
72
+ Profile details as a dict.
73
+
74
+ Raises
75
+ ------
76
+
77
+ InvalidParameterException
78
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
79
+ PropertyServerException
80
+ Raised by the server when an issue arises in processing a valid request
81
+ NotAuthorizedException
82
+ The principle specified by the user_id does not have authorization for the requested action
83
+ """
84
+
85
+ url = f"{self.my_profile_command_root}/{self.view_server}/api/open-metadata/my-profile"
86
+
87
+ response = await self._async_make_request("GET", url)
88
+ return response
89
+
90
+ def get_my_profile(self) -> dict | str:
91
+ """Get the profile of the user associated with the token used.
92
+
93
+ Parameters
94
+ ----------
95
+
96
+
97
+ Returns
98
+ -------
99
+ List | str
100
+
101
+ Profile details as a dict.
102
+
103
+ Raises
104
+ ------
105
+
106
+ InvalidParameterException
107
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
108
+ PropertyServerException
109
+ Raised by the server when an issue arises in processing a valid request
110
+ NotAuthorizedException
111
+ The principle specified by the user_id does not have authorization for the requested action
112
+ """
113
+ loop = asyncio.get_event_loop()
114
+ response = loop.run_until_complete(self._async_get_my_profile())
115
+
116
+ return response.json().get("personalProfile", "No one found")
117
+
118
+ async def _async_get_assigned_actions(
119
+ self,
120
+ actor_guid: str,
121
+ status: str = "OPEN",
122
+ start_from: int = 0,
123
+ page_size: int = 100,
124
+ ) -> list | str:
125
+ """Get assigned actions for the actor. Async version.
126
+
127
+ Parameters
128
+ ----------
129
+ actor_guid: str
130
+ The GUID of the actor whose assigned actions are to be retrieved.
131
+ status: str
132
+ The status of teh action to filter on. Default value is "OPEN".
133
+
134
+ start_from: int, optional
135
+ The index from which to start retrieving the assigned actions. Default is 0.
136
+ page_size: int, optional
137
+ The number of assigned actions to retrieve per page. Default is 100.
138
+
139
+ Returns
140
+ -------
141
+ list or str
142
+ A list of assigned actions is returned. If there aren't any, a string is returned indicating that.
143
+
144
+ Raises
145
+ ------
146
+ InvalidParameterException
147
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
148
+ PropertyServerException
149
+ Raised by the server when an issue arises in processing a valid request
150
+ NotAuthorizedException
151
+ The principle specified by the user_id does not have authorization for the requested action
152
+ """
153
+
154
+ if page_size is None:
155
+ page_size = self.page_size
156
+
157
+ body = {"status": status}
158
+
159
+ url = (
160
+ f"{self.my_profile_command_root}/{self.view_server}/api/open-metadata/my-profile/actors/{actor_guid}"
161
+ f"/assigned/to-dos?startFrom={start_from}&pageSize={page_size}&"
162
+ )
163
+
164
+ response = await self._async_make_request("POST", url, body)
165
+
166
+ return response.json().get("elements", "No entries found")
167
+
168
+ def get_assigned_actions(
169
+ self,
170
+ actor_guid: str,
171
+ status: str = "OPEN",
172
+ start_from: int = 0,
173
+ page_size: int = 100,
174
+ ) -> list | str:
175
+ """Get assigned actions for the actor.
176
+ Parameters
177
+ ----------
178
+ actor_guid: str
179
+ The GUID of the actor whose assigned actions are to be retrieved.
180
+ status: str
181
+ The status of teh action to filter on. Default value is "OPEN".
182
+
183
+ start_from: int, optional
184
+ The index from which to start retrieving the assigned actions. Default is 0.
185
+ page_size: int, optional
186
+ The number of assigned actions to retrieve per page. Default is 100.
187
+
188
+ Returns
189
+ -------
190
+ list or str
191
+ A list of assigned actions is returned. If there aren't any, a string is returned indicating that.
192
+
193
+ Raises
194
+ ------
195
+ InvalidParameterException
196
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
197
+ PropertyServerException
198
+ Raised by the server when an issue arises in processing a valid request
199
+ NotAuthorizedException
200
+ The principle specified by the user_id does not have authorization for the requested action
201
+ """
202
+ loop = asyncio.get_event_loop()
203
+ response = loop.run_until_complete(
204
+ self._async_get_assigned_actions(actor_guid, status, start_from, page_size)
205
+ )
206
+
207
+ return response
208
+
209
+ async def _async_get_actions_for_action_target(
210
+ self,
211
+ element_guid: str,
212
+ status: str = "OPEN",
213
+ start_from: int = 0,
214
+ page_size: int = 100,
215
+ ) -> list | str:
216
+ """Get actions assigned to the action target. Async version.
217
+
218
+ Parameters
219
+ ----------
220
+ element_guid: str
221
+ The GUID of the target whose assigned actions are to be retrieved.
222
+ status: str
223
+ The status of teh action to filter on. Default value is "OPEN".
224
+
225
+ start_from: int, optional
226
+ The index from which to start retrieving the assigned actions. Default is 0.
227
+ page_size: int, optional
228
+ The number of assigned actions to retrieve per page. Default is 100.
229
+
230
+ Returns
231
+ -------
232
+ list or str
233
+ A list of assigned actions is returned. If there aren't any, a string is returned indicating that.
234
+
235
+ Raises
236
+ ------
237
+ InvalidParameterException
238
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
239
+ PropertyServerException
240
+ Raised by the server when an issue arises in processing a valid request
241
+ NotAuthorizedException
242
+ The principle specified by the user_id does not have authorization for the requested action
243
+ """
244
+
245
+ validate_name(element_guid)
246
+
247
+ body = {"status": status}
248
+
249
+ url = (
250
+ f"{self.my_profile_command_root}/{self.view_server}/api/open-metadata/my-profile/elements/{element_guid}"
251
+ f"/action-targets/to-dos?start-from={start_from}&page-size={page_size}"
252
+ )
253
+
254
+ response = await self._async_make_request("POST", url, body)
255
+ return response.json() if response is not None else "No Results"
256
+
257
+ def get_actions_for_action_target(
258
+ self,
259
+ element_guid: str,
260
+ status: str = "OPEN",
261
+ start_from: int = 0,
262
+ page_size: int = 100,
263
+ ) -> list | str:
264
+ """Get actions assigned to the action target.
265
+
266
+ Parameters
267
+ ----------
268
+ element_guid: str
269
+ The GUID of the target whose assigned actions are to be retrieved.
270
+ status: str
271
+ The status of teh action to filter on. Default value is "OPEN"
272
+
273
+ start_from: int, optional
274
+ The index from which to start retrieving the assigned actions. Default is 0.
275
+ page_size: int, optional
276
+ The number of assigned actions to retrieve per page. Default is 100.
277
+
278
+ Returns
279
+ -------
280
+ list or str
281
+ A list of assigned actions is returned. If there aren't any, a string is returned indicating that.
282
+
283
+ Raises
284
+ ------
285
+ InvalidParameterException
286
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
287
+ PropertyServerException
288
+ Raised by the server when an issue arises in processing a valid request
289
+ NotAuthorizedException
290
+ The principle specified by the user_id does not have authorization for the requested action
291
+ """
292
+ loop = asyncio.get_event_loop()
293
+ response = loop.run_until_complete(
294
+ self._async_get_actions_for_action_target(
295
+ element_guid, status, start_from, page_size
296
+ )
297
+ )
298
+
299
+ return response
300
+
301
+ async def _async_get_actions_for_sponsor(
302
+ self,
303
+ element_guid: str,
304
+ status: str = "",
305
+ start_from: int = 0,
306
+ page_size: int = 100,
307
+ ) -> list | str:
308
+ """Get actions assigned to an owner. Async version.
309
+
310
+ Parameters
311
+ ----------
312
+ element_guid: str
313
+ The GUID of the target whose assigned actions are to be retrieved.
314
+ status: str
315
+ The status of the action to filter on. Default value is "OPEN".
316
+
317
+ start_from: int, optional
318
+ The index from which to start retrieving the assigned actions. Default is 0.
319
+ page_size: int, optional
320
+ The number of assigned actions to retrieve per page. Default is 100.
321
+
322
+ Returns
323
+ -------
324
+ list or str
325
+ A list of assigned actions is returned. If there aren't any, a string is returned indicating that.
326
+
327
+ Raises
328
+ ------
329
+ InvalidParameterException
330
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
331
+ PropertyServerException
332
+ Raised by the server when an issue arises in processing a valid request
333
+ NotAuthorizedException
334
+ The principle specified by the user_id does not have authorization for the requested action
335
+ """
336
+
337
+ validate_name(element_guid)
338
+
339
+ body = {"status": status}
340
+
341
+ url = (
342
+ f"{self.my_profile_command_root}/{self.view_server}/api/open-metadata/my-profile/elements/{element_guid}"
343
+ f"/sponsored/to-dos?startFrom={start_from}&pageSize={page_size}"
344
+ )
345
+
346
+ response = await self._async_make_request("POST", url, body)
347
+ return response.json() if response is not None else "No Results"
348
+
349
+ def get_actions_for_sponsor(
350
+ self,
351
+ element_guid: str,
352
+ status: str = "OPEN",
353
+ start_from: int = 0,
354
+ page_size: int = 100,
355
+ ) -> list | str:
356
+ """Get actions assigned to an owner.
357
+ Parameters
358
+ ----------
359
+ element_guid: str
360
+ The GUID of the target whose assigned actions are to be retrieved.
361
+ status: str
362
+ The status of teh action to filter on. Default value is "OPEN".
363
+
364
+ start_from: int, optional
365
+ The index from which to start retrieving the assigned actions. Default is 0.
366
+ page_size: int, optional
367
+ The number of assigned actions to retrieve per page. Default is 100.
368
+
369
+ Returns
370
+ -------
371
+ list or str
372
+ A list of assigned actions is returned. If there aren't any, a string is returned indicating that.
373
+
374
+ Raises
375
+ ------
376
+ InvalidParameterException
377
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
378
+ PropertyServerException
379
+ Raised by the server when an issue arises in processing a valid request
380
+ NotAuthorizedException
381
+ The principle specified by the user_id does not have authorization for the requested action
382
+ """
383
+ loop = asyncio.get_event_loop()
384
+ response = loop.run_until_complete(
385
+ self._async_get_actions_for_sponsor(
386
+ element_guid, status, start_from, page_size
387
+ )
388
+ )
389
+ return response
390
+
391
+ async def _async_create_to_do(self, body: dict) -> str:
392
+ """Create a To-Do item. Async version.
393
+ Parameters
394
+ ----------
395
+ body : dict
396
+ The dictionary containing the details of the to-do item.
397
+
398
+
399
+ Returns
400
+ -------
401
+ None
402
+ This method does not return any value.
403
+
404
+ Raises
405
+ ------
406
+ InvalidParameterException
407
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
408
+ PropertyServerException
409
+ Raised by the server when an issue arises in processing a valid request
410
+ NotAuthorizedException
411
+ The principle specified by the user_id does not have authorization for the requested action
412
+ """
413
+
414
+ url = f"{self.my_profile_command_root}/{self.view_server}/api/open-metadata/my-profile/to-dos"
415
+ response = await self._async_make_request("POST", url, body)
416
+ return response.json().get("guid", "No guid returned")
417
+
418
+ def create_to_do(self, body: dict) -> str:
419
+ """Create a To-Do item.
420
+ Parameters
421
+ ----------
422
+ body : dict
423
+ The dictionary containing the details of the to-do item.
424
+
425
+ Returns
426
+ -------
427
+ None
428
+ This method does not return any value.
429
+
430
+ Raises
431
+ ------
432
+ InvalidParameterException
433
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
434
+ PropertyServerException
435
+ Raised by the server when an issue arises in processing a valid request
436
+ NotAuthorizedException
437
+ The principle specified by the user_id does not have authorization for the requested action
438
+
439
+ Notes
440
+ -----
441
+
442
+ Here is a typical body:
443
+ body = {
444
+ "properties": {
445
+ "class" : "ToDoProperties",
446
+ "qualifiedName": f"Test-To-Do-{time.asctime()}",
447
+ "name": to_do,
448
+ "description": to_do_desc,
449
+ "toDoType": to_do_type,
450
+ "priority": 0,
451
+ "dueTime": "2024-03-11T15:42:11.307Z",
452
+ "status": "OPEN"
453
+ },
454
+ "assignToActorGUID": erins_guid
455
+ }
456
+ """
457
+ loop = asyncio.get_event_loop()
458
+ response = loop.run_until_complete(self._async_create_to_do(body))
459
+ return response
460
+
461
+ async def _async_get_to_do(self, todo_guid: str) -> dict | str:
462
+ """Get a To-Do item. Async version.
463
+ Parameters
464
+ ----------
465
+ todo_guid: str
466
+ Identifier of the To-Do item.
467
+
468
+
469
+ Returns
470
+ -------
471
+ None
472
+ This method does not return any value.
473
+
474
+ Raises
475
+ ------
476
+ InvalidParameterException
477
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
478
+ PropertyServerException
479
+ Raised by the server when an issue arises in processing a valid request
480
+ NotAuthorizedException
481
+ The principle specified by the user_id does not have authorization for the requested action
482
+ """
483
+
484
+ validate_name(todo_guid)
485
+
486
+ url = f"{self.my_profile_command_root}/{self.view_server}/api/open-metadata/my-profile/to-dos/{todo_guid}"
487
+
488
+ response = await self._async_make_request("GET", url)
489
+ # return response.text if response is not None else "No Results"
490
+ return json.loads(response.text).get("elements", "No TODO returned")
491
+
492
+ def get_to_do(self, todo_guid: str) -> dict | str:
493
+ """Get a To-Do item. Async version.
494
+ Parameters
495
+ ----------
496
+ todo_guid: str
497
+ Identifier of the To-Do item.
498
+
499
+
500
+ Returns
501
+ -------
502
+ None
503
+ This method does not return any value.
504
+
505
+ Raises
506
+ ------
507
+ InvalidParameterException
508
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
509
+ PropertyServerException
510
+ Raised by the server when an issue arises in processing a valid request
511
+ NotAuthorizedException
512
+ The principle specified by the user_id does not have authorization for the requested action
513
+ """
514
+ loop = asyncio.get_event_loop()
515
+ response = loop.run_until_complete(self._async_get_to_do(todo_guid))
516
+
517
+ return response
518
+
519
+ async def _async_update_to_do(
520
+ self,
521
+ todo_guid: str,
522
+ body: dict,
523
+ is_merge_update: bool = True,
524
+ ) -> None:
525
+ """Update a To-Do item. Async version.
526
+ Parameters
527
+ ----------
528
+ todo_guid: str
529
+ Identifier of the To-Do item.
530
+ body: str
531
+ The details to update the to-do item with.
532
+
533
+
534
+ Returns
535
+ -------
536
+ None
537
+ This method does not return any value.
538
+
539
+ Raises
540
+ ------
541
+ InvalidParameterException
542
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
543
+ PropertyServerException
544
+ Raised by the server when an issue arises in processing a valid request
545
+ NotAuthorizedException
546
+ The principle specified by the user_id does not have authorization for the requested action
547
+ """
548
+
549
+ is_merge_update_t = str(is_merge_update).lower()
550
+
551
+ validate_name(todo_guid)
552
+
553
+ url = (
554
+ f"{self.my_profile_command_root}/{self.view_server}/api/open-metadata/my-profile/to-dos/"
555
+ f"{todo_guid}?isMergeUpdate={is_merge_update_t}"
556
+ )
557
+
558
+ await self._async_make_request("POST", url, body)
559
+ return
560
+
561
+ def update_to_do(
562
+ self,
563
+ todo_guid: str,
564
+ body: dict,
565
+ is_merge_update: bool = True,
566
+ ) -> None:
567
+ """Update a To-Do item.
568
+ Parameters
569
+ ----------
570
+ todo_guid: str
571
+ Identifier of the To-Do item.
572
+ body: str
573
+ The details to update the to-do item with.
574
+ is_merge_update: bool [default: True]
575
+ If true then merges the updated information, otherwise replace the existing information.
576
+
577
+
578
+ Returns
579
+ -------
580
+ None
581
+ This method does not return any value.
582
+
583
+ Raises
584
+ ------
585
+ InvalidParameterException
586
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
587
+ PropertyServerException
588
+ Raised by the server when an issue arises in processing a valid request
589
+ NotAuthorizedException
590
+ The principle specified by the user_id does not have authorization for the requested action
591
+ """
592
+
593
+ loop = asyncio.get_event_loop()
594
+ loop.run_until_complete(
595
+ self._async_update_to_do(todo_guid, body, is_merge_update)
596
+ )
597
+ return
598
+
599
+ async def _async_delete_to_do(self, todo_guid: str) -> None:
600
+ """Delete a To-Do item. Async version.
601
+ Parameters
602
+ ----------
603
+ todo_guid: str
604
+ Identifier of the To-Do item.
605
+
606
+
607
+ Returns
608
+ -------
609
+ None
610
+ This method does not return any value.
611
+
612
+ Raises
613
+ ------
614
+ InvalidParameterException
615
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
616
+ PropertyServerException
617
+ Raised by the server when an issue arises in processing a valid request
618
+ NotAuthorizedException
619
+ The principle specified by the user_id does not have authorization for the requested action
620
+ """
621
+
622
+ validate_name(todo_guid)
623
+
624
+ url = f"{self.my_profile_command_root}/{self.view_server}/api/open-metadata/my-profile/to-dos/{todo_guid}/delete"
625
+
626
+ await self._async_make_request("POST", url)
627
+ return
628
+
629
+ def delete_to_do(self, todo_guid: str) -> None:
630
+ """Delete a To-Do item.
631
+ Parameters
632
+ ----------
633
+ todo_guid: str
634
+ Identifier of the To-Do item.
635
+
636
+
637
+ Returns
638
+ -------
639
+ None
640
+ This method does not return any value.
641
+
642
+ Raises
643
+ ------
644
+ InvalidParameterException
645
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
646
+ PropertyServerException
647
+ Raised by the server when an issue arises in processing a valid request
648
+ NotAuthorizedException
649
+ The principle specified by the user_id does not have authorization for the requested action
650
+ """
651
+ loop = asyncio.get_event_loop()
652
+ loop.run_until_complete(self._async_delete_to_do(todo_guid))
653
+ return
654
+
655
+ async def _async_reassign_to_do(
656
+ self,
657
+ todo_guid: str,
658
+ actor_guid: str,
659
+ status: str = "OPEN",
660
+ ) -> None:
661
+ """Reassign a To-Do item. Async version.
662
+ Parameters
663
+ ----------
664
+ todo_guid: str
665
+ Identifier of the To-Do item.
666
+ actor_guid: str
667
+ The actor to receive the reassigned to-do item.
668
+ status: str [default = "OPEN"]
669
+ Filter items to match this status.
670
+
671
+ Returns
672
+ -------
673
+ None
674
+ This method does not return any value.
675
+
676
+ Raises
677
+ ------
678
+ InvalidParameterException
679
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
680
+ PropertyServerException
681
+ Raised by the server when an issue arises in processing a valid request
682
+ NotAuthorizedException
683
+ The principle specified by the user_id does not have authorization for the requested action
684
+ """
685
+
686
+ validate_name(todo_guid)
687
+ validate_name(actor_guid)
688
+ body = {"status": status}
689
+
690
+ url = (
691
+ f"{self.my_profile_command_root}/{self.view_server}/api/open-metadata/my-profile/to-dos/"
692
+ f"{todo_guid}/reassign/{actor_guid}"
693
+ )
694
+
695
+ await self._async_make_request("POST", url, body)
696
+ return
697
+
698
+ def reassign_to_do(
699
+ self,
700
+ todo_guid: str,
701
+ actor_guid: str,
702
+ status: str = "OPEN",
703
+ ) -> None:
704
+ """Reassign a To-Do item.
705
+ Parameters
706
+ ----------
707
+ todo_guid: str
708
+ Identifier of the To-Do item.
709
+ actor_guid: str
710
+ The actor to receive the reassigned to-do item.
711
+ status: str [default = "OPEN"]
712
+ Filter items to match this status.
713
+
714
+ Returns
715
+ -------
716
+ None
717
+ This method does not return any value.
718
+
719
+ Raises
720
+ ------
721
+ InvalidParameterException
722
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
723
+ PropertyServerException
724
+ Raised by the server when an issue arises in processing a valid request
725
+ NotAuthorizedException
726
+ The principle specified by the user_id does not have authorization for the requested action
727
+ """
728
+ loop = asyncio.get_event_loop()
729
+ loop.run_until_complete(
730
+ self._async_reassign_to_do(todo_guid, actor_guid, status)
731
+ )
732
+ return
733
+
734
+ async def _async_find_to_do(
735
+ self,
736
+ search_string: str = "*",
737
+ status: str = None,
738
+ starts_with: bool = False,
739
+ ends_with: bool = False,
740
+ ignore_case: bool = True,
741
+ start_from: int = 0,
742
+ page_size: int = 100,
743
+ ) -> list | str:
744
+ """find To-Do items. Async version.
745
+ Parameters
746
+ ----------
747
+ search_string: str
748
+ String to search against. If '*' then all to-do items will match.
749
+ status: str
750
+ Filter items to match this status. Defaults to "OPEN"
751
+ starts_with : bool, [default=False], optional
752
+ Starts with the supplied string.
753
+ ends_with : bool, [default=False], optional
754
+ Ends with the supplied string
755
+ ignore_case : bool, [default=False], optional
756
+ Ignore case when searching
757
+ Returns
758
+ -------
759
+ None
760
+ List of To-Do items that match the criteria
761
+
762
+ Raises
763
+ ------
764
+ InvalidParameterException
765
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
766
+ PropertyServerException
767
+ Raised by the server when an issue arises in processing a valid request
768
+ NotAuthorizedException
769
+ The principle specified by the user_id does not have authorization for the requested action
770
+ """
771
+
772
+ starts_with_s = str(starts_with).lower()
773
+ ends_with_s = str(ends_with).lower()
774
+ ignore_case_s = str(ignore_case).lower()
775
+
776
+ if search_string == "*":
777
+ search_string = " "
778
+
779
+ body = {
780
+ "class": "ToDoStatusSearchString",
781
+ "toDoStatus": status,
782
+ "searchString": search_string,
783
+ }
784
+
785
+ validate_search_string(search_string)
786
+
787
+ url = (
788
+ f"{self.my_profile_command_root}/{self.view_server}/api/open-metadata/my-profile/to-dos/"
789
+ f"find-by-search-string?startFrom={start_from}&pageSize={page_size}&"
790
+ f"startsWith={starts_with_s}&endsWith={ends_with_s}&ignoreCase={ignore_case_s}"
791
+ )
792
+
793
+ response = await self._async_make_request("POST", url, body_slimmer(body))
794
+ # return response.text
795
+ return response.json().get("elements", "No ToDos found")
796
+
797
+ def find_to_do(
798
+ self,
799
+ search_string: str,
800
+ status: str = "OPEN",
801
+ starts_with: bool = False,
802
+ ends_with: bool = False,
803
+ ignore_case: bool = True,
804
+ start_from: int = 0,
805
+ page_size: int = 100,
806
+ ) -> list | str:
807
+ """find To-Do items.
808
+ Parameters
809
+ ----------
810
+ search_string: str
811
+ String to search against. If '*' then all to-do items will match.
812
+ view_server : str, optional
813
+ The name of the server where the to-do item will be created. If not provided,
814
+ the default server name associated with the instance of the class will be used.
815
+ status: str
816
+ Filter items to match this status. Defaults to "OPEN"
817
+ starts_with : bool, [default=False], optional
818
+ Starts with the supplied string.
819
+ ends_with : bool, [default=False], optional
820
+ Ends with the supplied string
821
+ ignore_case : bool, [default=False], optional
822
+ Ignore case when searching
823
+ start_from: int, [default=0], optional
824
+ When multiple pages of results are available, the page number to start from.
825
+ page_size: int, [default=None]
826
+ The number of items to return in a single page. If not specified, the default will be taken from
827
+ the class instance.
828
+ Returns
829
+ -------
830
+ None
831
+ List of To-Do items that match the criteria
832
+
833
+ Raises
834
+ ------
835
+ InvalidParameterException
836
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
837
+ PropertyServerException
838
+ Raised by the server when an issue arises in processing a valid request
839
+ NotAuthorizedException
840
+ The principle specified by the user_id does not have authorization for the requested action
841
+ """
842
+ loop = asyncio.get_event_loop()
843
+ response = loop.run_until_complete(
844
+ self._async_find_to_do(
845
+ search_string,
846
+ status,
847
+ starts_with,
848
+ ends_with,
849
+ ignore_case,
850
+ start_from,
851
+ page_size,
852
+ )
853
+ )
854
+ return response
855
+
856
+ async def _async_get_to_dos_by_type(
857
+ self,
858
+ todo_type: str,
859
+ status: str = "OPEN",
860
+ start_from: int = 0,
861
+ page_size: int = 100,
862
+ ) -> list | str:
863
+ """Get To-Do items by type. Async version
864
+ Parameters
865
+ ----------
866
+ todo_type: str
867
+ Type of to-do to find
868
+ status: str
869
+ Filter items to match this status. Defaults to "OPEN"
870
+ start_from: int, [default=0], optional
871
+ When multiple pages of results are available, the page number to start from.
872
+ page_size: int, [default=None]
873
+ The number of items to return in a single page. If not specified, the default will be taken from
874
+ the class instance.
875
+ Returns
876
+ -------
877
+ List of To-Do items that match the criteria
878
+
879
+ Raises
880
+ ------
881
+ InvalidParameterException
882
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
883
+ PropertyServerException
884
+ Raised by the server when an issue arises in processing a valid request
885
+ NotAuthorizedException
886
+ The principle specified by the user_id does not have authorization for the requested action
887
+ """
888
+
889
+ validate_name(todo_type)
890
+ body = {
891
+ "status": status,
892
+ }
893
+
894
+ url = (
895
+ f"{self.my_profile_command_root}/{self.view_server}/api/open-metadata/my-profile/to-dos/types/"
896
+ f"{todo_type}?startFrom={start_from}&pageSize={page_size}"
897
+ )
898
+
899
+ response = await self._async_make_request("POST", url, body)
900
+ return response.json().get("elements", "No ToDos found")
901
+
902
+ def get_to_dos_by_type(
903
+ self,
904
+ todo_type: str,
905
+ status: str = "OPEN",
906
+ start_from: int = 0,
907
+ page_size: int = 100,
908
+ ) -> list | str:
909
+ """Get To-Do items by type.
910
+ Parameters
911
+ ----------
912
+ todo_type: str
913
+ Type of to-do to find
914
+ status: str
915
+ Filter items to match this status. Defaults to "OPEN"
916
+ start_from: int, [default=0], optional
917
+ When multiple pages of results are available, the page number to start from.
918
+ page_size: int, [default=None]
919
+ The number of items to return in a single page. If not specified, the default will be taken from
920
+ the class instance.
921
+ Returns
922
+ -------
923
+ List of To-Do items that match the criteria
924
+
925
+ Raises
926
+ ------
927
+ InvalidParameterException
928
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
929
+ PropertyServerException
930
+ Raised by the server when an issue arises in processing a valid request
931
+ NotAuthorizedException
932
+ The principle specified by the user_id does not have authorization for the requested action
933
+ """
934
+ loop = asyncio.get_event_loop()
935
+ response = loop.run_until_complete(
936
+ self._async_get_to_dos_by_type(todo_type, status, start_from, page_size)
937
+ )
938
+ return response
939
+
940
+ async def _async_update_action_target_properties(
941
+ self,
942
+ action_target_guid: str,
943
+ body: dict,
944
+ is_merge_update: bool = True,
945
+ ) -> None:
946
+ """Get To-Do items by type. Async version
947
+ Parameters
948
+ ----------
949
+ action_target_guid: str
950
+ Identity of the action target to update.
951
+ body: dict
952
+ Details of the updates to make.
953
+ is_merge_update : bool, [default=True], optional
954
+ indicates if the update should be a merge or replacement.
955
+
956
+ Returns
957
+ -------
958
+ None
959
+
960
+ Raises
961
+ ------
962
+ InvalidParameterException
963
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
964
+ PropertyServerException
965
+ Raised by the server when an issue arises in processing a valid request
966
+ NotAuthorizedException
967
+ The principle specified by the user_id does not have authorization for the requested action
968
+ """
969
+
970
+ is_merge_update_t = str(is_merge_update).lower()
971
+
972
+ validate_name(action_target_guid)
973
+
974
+ url = (
975
+ f"{self.my_profile_command_root}/{self.view_server}/api/open-metadata/my-profile/to-dos/"
976
+ f"action-targets/{action_target_guid}?isMergeUpdate={is_merge_update_t}"
977
+ )
978
+
979
+ await self._async_make_request("POST", url, body)
980
+ return
981
+
982
+ def update_action_target_properties(
983
+ self,
984
+ action_target_guid: str,
985
+ body: dict,
986
+ is_merge_update: bool = True,
987
+ ) -> None:
988
+ """Get To-Do items by type.
989
+ Parameters
990
+ ----------
991
+ action_target_guid: str
992
+ Identity of the action target to update.
993
+ body: dict
994
+ Details of the updates to make.
995
+ is_merge_update : bool, [default=True], optional
996
+ indicates if the update should be a merge or replacement.
997
+
998
+ Returns
999
+ -------
1000
+ None
1001
+
1002
+ Raises
1003
+ ------
1004
+ InvalidParameterException
1005
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
1006
+ PropertyServerException
1007
+ Raised by the server when an issue arises in processing a valid request
1008
+ NotAuthorizedException
1009
+ The principle specified by the user_id does not have authorization for the requested action
1010
+ """
1011
+ loop = asyncio.get_event_loop()
1012
+ loop.run_until_complete(
1013
+ self._async_update_action_target_properties(
1014
+ action_target_guid, body, is_merge_update
1015
+ )
1016
+ )
1017
+ return
1018
+
1019
+
1020
+ if __name__ == "__main__":
1021
+ print("Main-My Profile")