From 2bcc349e1519ad156d340c74eeea8f1a7c162f4f Mon Sep 17 00:00:00 2001 From: bwmac Date: Thu, 16 Jan 2025 17:19:28 -0500 Subject: [PATCH] reorganize documentation --- docs/reference/experimental/async/activity.md | 20 +++ docs/reference/experimental/async/agent.md | 2 + docs/reference/experimental/async/file.md | 23 +++ docs/reference/experimental/async/folder.md | 16 ++ docs/reference/experimental/async/project.md | 15 ++ docs/reference/experimental/async/table.md | 17 ++ docs/reference/experimental/async/team.md | 14 ++ .../experimental/async/user_profile.md | 11 ++ .../mixins/access_controllable.md | 3 + .../mixins/asynchronous_communicator.md | 3 + .../experimental/mixins/failure_strategy.md | 3 + .../experimental/mixins/storable_container.md | 3 + docs/reference/experimental/sync/activity.md | 30 ++++ docs/reference/experimental/sync/file.md | 33 ++++ docs/reference/experimental/sync/folder.md | 26 +++ docs/reference/experimental/sync/project.md | 25 +++ docs/reference/experimental/sync/table.md | 27 +++ docs/reference/experimental/sync/team.md | 24 +++ .../experimental/sync/user_profile.md | 13 ++ docs/reference/oop/models.md | 169 ------------------ docs/reference/oop/models_async.md | 100 ----------- mkdocs.yml | 21 ++- synapseclient/models/__init__.py | 2 +- 23 files changed, 328 insertions(+), 272 deletions(-) create mode 100644 docs/reference/experimental/async/activity.md create mode 100644 docs/reference/experimental/async/file.md create mode 100644 docs/reference/experimental/async/folder.md create mode 100644 docs/reference/experimental/async/project.md create mode 100644 docs/reference/experimental/async/table.md create mode 100644 docs/reference/experimental/async/team.md create mode 100644 docs/reference/experimental/async/user_profile.md create mode 100644 docs/reference/experimental/mixins/access_controllable.md create mode 100644 docs/reference/experimental/mixins/asynchronous_communicator.md create mode 100644 docs/reference/experimental/mixins/failure_strategy.md create mode 100644 docs/reference/experimental/mixins/storable_container.md create mode 100644 docs/reference/experimental/sync/activity.md create mode 100644 docs/reference/experimental/sync/file.md create mode 100644 docs/reference/experimental/sync/folder.md create mode 100644 docs/reference/experimental/sync/project.md create mode 100644 docs/reference/experimental/sync/table.md create mode 100644 docs/reference/experimental/sync/team.md create mode 100644 docs/reference/experimental/sync/user_profile.md delete mode 100644 docs/reference/oop/models.md delete mode 100644 docs/reference/oop/models_async.md diff --git a/docs/reference/experimental/async/activity.md b/docs/reference/experimental/async/activity.md new file mode 100644 index 000000000..6ec94b55f --- /dev/null +++ b/docs/reference/experimental/async/activity.md @@ -0,0 +1,20 @@ +# Activity + +## API Reference + +::: synapseclient.models.Activity + options: + members: + - from_parent_async + - store_async + - delete_async +--- +::: synapseclient.models.UsedEntity + options: + filters: + - "!" +--- +::: synapseclient.models.UsedURL + options: + filters: + - "!" diff --git a/docs/reference/experimental/async/agent.md b/docs/reference/experimental/async/agent.md index a16089b58..8d8a6581f 100644 --- a/docs/reference/experimental/async/agent.md +++ b/docs/reference/experimental/async/agent.md @@ -1,5 +1,7 @@ # Agent +## API reference + ::: synapseclient.models.Agent options: members: diff --git a/docs/reference/experimental/async/file.md b/docs/reference/experimental/async/file.md new file mode 100644 index 000000000..3cd2d60aa --- /dev/null +++ b/docs/reference/experimental/async/file.md @@ -0,0 +1,23 @@ +# File + +## API Reference + +::: synapseclient.models.File + options: + inherited_members: true + members: + - get_async + - store_async + - copy_async + - delete_async + - from_id_async + - from_path_async + - change_metadata_async + - get_permissions_async + - get_acl_async + - set_permissions_async +--- +::: synapseclient.models.file.FileHandle + options: + filters: + - "!" diff --git a/docs/reference/experimental/async/folder.md b/docs/reference/experimental/async/folder.md new file mode 100644 index 000000000..fa9e41a52 --- /dev/null +++ b/docs/reference/experimental/async/folder.md @@ -0,0 +1,16 @@ +# Folder + +## API Reference + +::: synapseclient.models.Folder + options: + inherited_members: true + members: + - get_async + - store_async + - delete_async + - copy_async + - sync_from_synapse_async + - get_permissions_async + - get_acl_async + - set_permissions_async diff --git a/docs/reference/experimental/async/project.md b/docs/reference/experimental/async/project.md new file mode 100644 index 000000000..d4fde2b15 --- /dev/null +++ b/docs/reference/experimental/async/project.md @@ -0,0 +1,15 @@ +# Project + +## API reference + +::: synapseclient.models.Project + options: + inherited_members: true + members: + - get_async + - store_async + - delete_async + - sync_from_synapse_async + - get_permissions_async + - get_acl_async + - set_permissions_async diff --git a/docs/reference/experimental/async/table.md b/docs/reference/experimental/async/table.md new file mode 100644 index 000000000..c314c37ba --- /dev/null +++ b/docs/reference/experimental/async/table.md @@ -0,0 +1,17 @@ +# Table + +## API Reference + +::: synapseclient.models.Table + options: + inherited_members: true + members: + - get_async + - store_schema_async + - store_rows_from_csv_async + - delete_rows_async + - query_async + - delete_async + - get_permissions_async + - get_acl_async + - set_permissions_async diff --git a/docs/reference/experimental/async/team.md b/docs/reference/experimental/async/team.md new file mode 100644 index 000000000..46a83c623 --- /dev/null +++ b/docs/reference/experimental/async/team.md @@ -0,0 +1,14 @@ +# Team + +## API Reference + +::: synapseclient.models.Team + options: + members: + - create_async + - delete_async + - from_id_async + - from_name_async + - members_async + - invite_async + - open_invitations_async diff --git a/docs/reference/experimental/async/user_profile.md b/docs/reference/experimental/async/user_profile.md new file mode 100644 index 000000000..1f7449255 --- /dev/null +++ b/docs/reference/experimental/async/user_profile.md @@ -0,0 +1,11 @@ +# UserProfile + +## API Reference + +::: synapseclient.models.UserProfile + options: + members: + - get_async + - from_id_async + - from_username_async + - is_certified_async diff --git a/docs/reference/experimental/mixins/access_controllable.md b/docs/reference/experimental/mixins/access_controllable.md new file mode 100644 index 000000000..96e7f70b9 --- /dev/null +++ b/docs/reference/experimental/mixins/access_controllable.md @@ -0,0 +1,3 @@ +# AccessControllable + +::: synapseclient.models.mixins.AccessControllable diff --git a/docs/reference/experimental/mixins/asynchronous_communicator.md b/docs/reference/experimental/mixins/asynchronous_communicator.md new file mode 100644 index 000000000..bfc081057 --- /dev/null +++ b/docs/reference/experimental/mixins/asynchronous_communicator.md @@ -0,0 +1,3 @@ +# AsynchronousCommunicator + +::: synapseclient.models.mixins.AsynchronousCommunicator diff --git a/docs/reference/experimental/mixins/failure_strategy.md b/docs/reference/experimental/mixins/failure_strategy.md new file mode 100644 index 000000000..3809b74f5 --- /dev/null +++ b/docs/reference/experimental/mixins/failure_strategy.md @@ -0,0 +1,3 @@ +# FailureStrategy + +::: synapseclient.models.FailureStrategy diff --git a/docs/reference/experimental/mixins/storable_container.md b/docs/reference/experimental/mixins/storable_container.md new file mode 100644 index 000000000..49e10a5e3 --- /dev/null +++ b/docs/reference/experimental/mixins/storable_container.md @@ -0,0 +1,3 @@ +# StorableContainer + +::: synapseclient.models.mixins.StorableContainer diff --git a/docs/reference/experimental/sync/activity.md b/docs/reference/experimental/sync/activity.md new file mode 100644 index 000000000..ed05409f9 --- /dev/null +++ b/docs/reference/experimental/sync/activity.md @@ -0,0 +1,30 @@ +# Activity + +## Example Script + +
+ Working with activities + +```python +{!docs/scripts/object_orientated_programming_poc/oop_poc_activity.py!} +``` +
+ +## API Reference + +::: synapseclient.models.Activity + options: + members: + - from_parent + - store + - delete +--- +::: synapseclient.models.UsedEntity + options: + filters: + - "!" +--- +::: synapseclient.models.UsedURL + options: + filters: + - "!" diff --git a/docs/reference/experimental/sync/file.md b/docs/reference/experimental/sync/file.md new file mode 100644 index 000000000..9f858a79d --- /dev/null +++ b/docs/reference/experimental/sync/file.md @@ -0,0 +1,33 @@ +# File + +## Example Script + +
+ Working with files + +```python +{!docs/scripts/object_orientated_programming_poc/oop_poc_file.py!} +``` +
+ +## API Reference + +::: synapseclient.models.File + options: + inherited_members: true + members: + - get + - store + - copy + - delete + - from_id + - from_path + - change_metadata + - get_permissions + - get_acl + - set_permissions +--- +::: synapseclient.models.file.FileHandle + options: + filters: + - "!" diff --git a/docs/reference/experimental/sync/folder.md b/docs/reference/experimental/sync/folder.md new file mode 100644 index 000000000..204ae7046 --- /dev/null +++ b/docs/reference/experimental/sync/folder.md @@ -0,0 +1,26 @@ +# Folder + +## Example Script + +
+ Working with folders + +```python +{!docs/scripts/object_orientated_programming_poc/oop_poc_folder.py!} +``` +
+ +## API Reference + +::: synapseclient.models.Folder + options: + inherited_members: true + members: + - get + - store + - delete + - copy + - sync_from_synapse + - get_permissions + - get_acl + - set_permissions diff --git a/docs/reference/experimental/sync/project.md b/docs/reference/experimental/sync/project.md new file mode 100644 index 000000000..953039a20 --- /dev/null +++ b/docs/reference/experimental/sync/project.md @@ -0,0 +1,25 @@ +# Project + +## Example Script + +
+ Working with a project + +```python +{!docs/scripts/object_orientated_programming_poc/oop_poc_project.py!} +``` +
+ +## API reference + +::: synapseclient.models.Project + options: + inherited_members: true + members: + - get + - store + - delete + - sync_from_synapse + - get_permissions + - get_acl + - set_permissions diff --git a/docs/reference/experimental/sync/table.md b/docs/reference/experimental/sync/table.md new file mode 100644 index 000000000..7b04af0cc --- /dev/null +++ b/docs/reference/experimental/sync/table.md @@ -0,0 +1,27 @@ +# Table + +## Example Script + +
+ Working with tables + +```python +{!docs/scripts/object_orientated_programming_poc/oop_poc_table.py!} +``` +
+ +## API Reference + +::: synapseclient.models.Table + options: + inherited_members: true + members: + - get + - store_schema + - store_rows_from_csv + - delete_rows + - query + - delete + - get_permissions + - get_acl + - set_permissions diff --git a/docs/reference/experimental/sync/team.md b/docs/reference/experimental/sync/team.md new file mode 100644 index 000000000..1af58f260 --- /dev/null +++ b/docs/reference/experimental/sync/team.md @@ -0,0 +1,24 @@ +# Team + +## Example Script + +
+ Working with teams + +```python +{!docs/scripts/object_orientated_programming_poc/oop_poc_team.py!} +``` +
+ +## API Reference + +::: synapseclient.models.Team + options: + members: + - create + - delete + - from_id + - from_name + - members + - invite + - open_invitations diff --git a/docs/reference/experimental/sync/user_profile.md b/docs/reference/experimental/sync/user_profile.md new file mode 100644 index 000000000..552532bcc --- /dev/null +++ b/docs/reference/experimental/sync/user_profile.md @@ -0,0 +1,13 @@ +# UserProfile + +## API Reference + +::: synapseclient.models.UserProfile + options: + members: + - get + - from_id + - from_username + - is_certified +--- +::: synapseclient.models.UserPreference diff --git a/docs/reference/oop/models.md b/docs/reference/oop/models.md deleted file mode 100644 index 2c7ebc153..000000000 --- a/docs/reference/oop/models.md +++ /dev/null @@ -1,169 +0,0 @@ -Contained within this file are experimental interfaces for working with the Synapse Python -Client. Unless otherwise noted these interfaces are subject to change at any time. Use -at your own risk. - -## Sample Scripts: - -
- Working with a project - -```python -{!docs/scripts/object_orientated_programming_poc/oop_poc_project.py!} -``` -
- -
- Working with folders - -```python -{!docs/scripts/object_orientated_programming_poc/oop_poc_folder.py!} -``` -
- -
- Working with files - -```python -{!docs/scripts/object_orientated_programming_poc/oop_poc_file.py!} -``` -
- -
- Working with tables - -```python -{!docs/scripts/object_orientated_programming_poc/oop_poc_table.py!} -``` -
- -
- Current Synapse interface for working with a project - -```python -{!docs/scripts/object_orientated_programming_poc/synapse_project.py!} -``` -
- -
- Working with activities - -```python -{!docs/scripts/object_orientated_programming_poc/oop_poc_activity.py!} -``` -
- -
- Working with teams - -```python -{!docs/scripts/object_orientated_programming_poc/oop_poc_team.py!} -``` -
- -## API reference - -::: synapseclient.models.Project - options: - inherited_members: true - members: - - get - - store - - delete - - sync_from_synapse - - get_permissions - - get_acl - - set_permissions ---- -::: synapseclient.models.Folder - options: - inherited_members: true - members: - - get - - store - - delete - - copy - - sync_from_synapse - - get_permissions - - get_acl - - set_permissions ---- -::: synapseclient.models.File - options: - inherited_members: true - members: - - get - - store - - copy - - delete - - from_id - - from_path - - change_metadata - - get_permissions - - get_acl - - set_permissions -::: synapseclient.models.file.FileHandle - options: - filters: - - "!" ---- -::: synapseclient.models.Table - options: - inherited_members: true - members: - - get - - store_schema - - store_rows_from_csv - - delete_rows - - query - - delete - - get_permissions - - get_acl - - set_permissions ---- -::: synapseclient.models.Activity - options: - members: - - from_parent - - store - - delete - -::: synapseclient.models.UsedEntity - options: - filters: - - "!" -::: synapseclient.models.UsedURL - options: - filters: - - "!" ---- -::: synapseclient.models.Team - options: - members: - - create - - delete - - from_id - - from_name - - members - - invite - - open_invitations ---- -::: synapseclient.models.UserProfile - options: - members: - - get - - from_id - - from_username - - is_certified -::: synapseclient.models.UserPreference ---- -::: synapseclient.models.Annotations - options: - members: - - from_dict ---- -::: synapseclient.models.mixins.AccessControllable ---- - -::: synapseclient.models.mixins.StorableContainer ---- -::: synapseclient.models.FailureStrategy diff --git a/docs/reference/oop/models_async.md b/docs/reference/oop/models_async.md deleted file mode 100644 index c61ce0df6..000000000 --- a/docs/reference/oop/models_async.md +++ /dev/null @@ -1,100 +0,0 @@ -Contained within this file are experimental interfaces for working with the Synapse Python -Client. Unless otherwise noted these interfaces are subject to change at any time. Use -at your own risk. - -These APIs also introduce [AsyncIO](https://docs.python.org/3/library/asyncio.html) to -the client. - -## Sample Scripts: -See [this page for sample scripts](models.md#sample-scripts). -The sample scripts are from a synchronous context, -replace any of the method calls with the async counter-party and they will be -functionally equivalent. - -## API reference - -::: synapseclient.models.Project - options: - inherited_members: true - members: - - get_async - - store_async - - delete_async - - sync_from_synapse_async - - get_permissions_async - - get_acl_async - - set_permissions_async ---- -::: synapseclient.models.Folder - options: - inherited_members: true - members: - - get_async - - store_async - - delete_async - - copy_async - - sync_from_synapse_async - - get_permissions_async - - get_acl_async - - set_permissions_async ---- -::: synapseclient.models.File - options: - inherited_members: true - members: - - get_async - - store_async - - copy_async - - delete_async - - from_id_async - - from_path_async - - change_metadata_async - - get_permissions_async - - get_acl_async - - set_permissions_async ---- -::: synapseclient.models.Table - options: - inherited_members: true - members: - - get_async - - store_schema_async - - store_rows_from_csv_async - - delete_rows_async - - query_async - - delete_async - - get_permissions_async - - get_acl_async - - set_permissions_async ---- -::: synapseclient.models.Activity - options: - members: - - from_parent_async - - store_async - - delete_async - ---- -::: synapseclient.models.Team - options: - members: - - create_async - - delete_async - - from_id_async - - from_name_async - - members_async - - invite_async - - open_invitations_async ---- -::: synapseclient.models.UserProfile - options: - members: - - get_async - - from_id_async - - from_username_async - - is_certified_async ---- -::: synapseclient.models.Annotations - options: - members: - - store_async diff --git a/mkdocs.yml b/mkdocs.yml index 516d4a2f0..da15fd324 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -75,12 +75,29 @@ nav: - Core: reference/core.md - REST Apis: reference/rest_apis.md - Experimental: + - Mixins: + - AccessControllable: reference/experimental/mixins/access_controllable.md + - StorableContainer: reference/experimental/mixins/storable_container.md + - AsynchronousCommunicator: reference/experimental/mixins/asynchronous_communicator.md + - FailureStrategy: reference/experimental/mixins/failure_strategy.md - Synchronous: - Agent: reference/experimental/sync/agent.md + - Project: reference/experimental/sync/project.md + - Folder: reference/experimental/sync/folder.md + - File: reference/experimental/sync/file.md + - Table: reference/experimental/sync/table.md + - Activity: reference/experimental/sync/activity.md + - Team: reference/experimental/sync/team.md + - UserProfile: reference/experimental/sync/user_profile.md - Asynchronous: - Agent: reference/experimental/async/agent.md - - Object-Orientated Models: reference/oop/models.md - - Async Object-Orientated Models: reference/oop/models_async.md + - Project: reference/experimental/async/project.md + - Folder: reference/experimental/async/folder.md + - File: reference/experimental/async/file.md + - Table: reference/experimental/async/table.md + - Activity: reference/experimental/async/activity.md + - Team: reference/experimental/async/team.md + - UserProfile: reference/experimental/async/user_profile.md - Further Reading: - Home: explanations/home.md - Domain Models of Synapse: explanations/domain_models_of_synapse.md diff --git a/synapseclient/models/__init__.py b/synapseclient/models/__init__.py index ed5d4f18d..1e2f686ed 100644 --- a/synapseclient/models/__init__.py +++ b/synapseclient/models/__init__.py @@ -2,9 +2,9 @@ from synapseclient.models.activity import Activity, UsedEntity, UsedURL from synapseclient.models.agent import ( Agent, + AgentPrompt, AgentSession, AgentSessionAccessLevel, - AgentPrompt, ) from synapseclient.models.annotations import Annotations from synapseclient.models.file import File, FileHandle