From 21ca491deb5eb1ed74a18bbd8713178aec46f973 Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Wed, 25 Oct 2023 15:12:27 -0400 Subject: [PATCH 1/7] Document and expose new clicks/shares analytics metrics Requires https://github.com/WorldWideTelescope/wwt-constellations-backend/pull/37 . --- .../constellations/get-handle-_handle-sceneinfo.rst | 2 ++ docs/endpoints/constellations/get-handle-_handle-stats.rst | 2 ++ docs/endpoints/constellations/get-scene-_id.rst | 6 ++++-- wwt_api_client/constellations/data.py | 6 ++++++ 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/docs/endpoints/constellations/get-handle-_handle-sceneinfo.rst b/docs/endpoints/constellations/get-handle-_handle-sceneinfo.rst index 6cc1209..5a0a339 100644 --- a/docs/endpoints/constellations/get-handle-_handle-sceneinfo.rst +++ b/docs/endpoints/constellations/get-handle-_handle-sceneinfo.rst @@ -46,6 +46,8 @@ The response is as follows: "creation_date": $string[iso8601], // the creation date of this scene in ISO8601 format "impressions": $int, // the number of impressions this scene has received "likes": $int, // the number of likes this scene has received + "clicks": $int?, // the number of user clicks on the outgoing URL + "shares": $int?, // the number of times users have activated the share-link flow for this scene } ] } diff --git a/docs/endpoints/constellations/get-handle-_handle-stats.rst b/docs/endpoints/constellations/get-handle-_handle-stats.rst index 43c1dbf..bf804b5 100644 --- a/docs/endpoints/constellations/get-handle-_handle-stats.rst +++ b/docs/endpoints/constellations/get-handle-_handle-stats.rst @@ -38,5 +38,7 @@ The response is as follows: "count": $int, // the number of scenes owned by this handle "impressions": $int, // the total number of impressions received by this handle's scenes "likes": $int, // the total number of likes received by this handle's scenes + "clicks": $int?, // the total number of outgoing-URL user clicks for this handle's scenes + "shares": $int?, // the total number of link-share clicks for this handle's scenes }, } diff --git a/docs/endpoints/constellations/get-scene-_id.rst b/docs/endpoints/constellations/get-scene-_id.rst index 2daff64..bc55f53 100644 --- a/docs/endpoints/constellations/get-scene-_id.rst +++ b/docs/endpoints/constellations/get-scene-_id.rst @@ -30,9 +30,11 @@ The structure of the response is: "display_name": $string, // the handle's display name }, "creation_date": $string(iso8601), // the date this scene was created - "likes": $number, // the number of likes this scene has received + "likes": $int, // the number of likes this scene has received "liked": $bool, // whether the logged-in user has "liked" this scene - "impressions": $number, // the number of impressions this scene has received + "impressions": $int, // the number of impressions this scene has received + "clicks": $int?, // the number of user clicks on the outgoing URL + "shares": $int?, // the number of times users have activated the share-link flow for this scene "place": { // WWT camera information associated with this scene // See "POST /handle/:handle/scene" docs for descriptions: "ra_rad": $number, diff --git a/wwt_api_client/constellations/data.py b/wwt_api_client/constellations/data.py index b36cc19..5bca26c 100644 --- a/wwt_api_client/constellations/data.py +++ b/wwt_api_client/constellations/data.py @@ -118,6 +118,8 @@ class HandleSceneStats: count: int impressions: int likes: int + clicks: Optional[int] + shares: Optional[int] @dataclass_json(undefined="EXCLUDE") @@ -278,6 +280,8 @@ class SceneHydrated: likes: int liked: bool impressions: int + clicks: Optional[int] + shares: Optional[int] place: ScenePlace content: SceneContentHydrated text: str @@ -291,6 +295,8 @@ class SceneInfo: creation_date: str impressions: int likes: int + clicks: Optional[int] + shares: Optional[int] @dataclass_json(undefined="EXCLUDE") From f47bcea9b9ca290311ed6cbf0eb56e2746f79bde Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Wed, 25 Oct 2023 16:52:36 -0400 Subject: [PATCH 2/7] docs/api: update autogenerated docs --- ...ient.constellations.data.HandleImageStats.rst | 10 ++++++++++ ...api_client.constellations.data.HandleInfo.rst | 10 ++++++++++ ...ent.constellations.data.HandlePermissions.rst | 10 ++++++++++ ...ient.constellations.data.HandleSceneStats.rst | 10 ++++++++++ ...pi_client.constellations.data.HandleStats.rst | 10 ++++++++++ ...i_client.constellations.data.HandleUpdate.rst | 12 ++++++++++++ ...t.constellations.data.ImageApiPermissions.rst | 10 ++++++++++ ...nstellations.data.ImageContentPermissions.rst | 12 ++++++++++++ ...ient.constellations.data.ImageDisplayInfo.rst | 10 ++++++++++ ..._api_client.constellations.data.ImageInfo.rst | 10 ++++++++++ ...i_client.constellations.data.ImageStorage.rst | 12 ++++++++++++ ...i_client.constellations.data.ImageSummary.rst | 10 ++++++++++ ...pi_client.constellations.data.ImageUpdate.rst | 14 ++++++++++++++ ...t_api_client.constellations.data.ImageWwt.rst | 10 ++++++++++ ...i_client.constellations.data.SceneContent.rst | 12 ++++++++++++ ....constellations.data.SceneContentHydrated.rst | 14 ++++++++++++++ ..._client.constellations.data.SceneHydrated.rst | 10 ++++++++++ ...lient.constellations.data.SceneImageLayer.rst | 10 ++++++++++ ...nstellations.data.SceneImageLayerHydrated.rst | 10 ++++++++++ ..._api_client.constellations.data.SceneInfo.rst | 10 ++++++++++ ...ient.constellations.data.ScenePermissions.rst | 10 ++++++++++ ...api_client.constellations.data.ScenePlace.rst | 10 ++++++++++ ..._client.constellations.data.ScenePreviews.rst | 14 ++++++++++++++ ...pi_client.constellations.data.SceneUpdate.rst | 16 ++++++++++++++++ ...nt.constellations.handles.AddImageRequest.rst | 12 ++++++++++++ ...nt.constellations.handles.AddSceneRequest.rst | 12 ++++++++++++ 26 files changed, 290 insertions(+) diff --git a/docs/api/wwt_api_client.constellations.data.HandleImageStats.rst b/docs/api/wwt_api_client.constellations.data.HandleImageStats.rst index f6e1969..c818c57 100644 --- a/docs/api/wwt_api_client.constellations.data.HandleImageStats.rst +++ b/docs/api/wwt_api_client.constellations.data.HandleImageStats.rst @@ -6,6 +6,12 @@ HandleImageStats .. autoclass:: HandleImageStats :show-inheritance: + .. rubric:: Attributes Summary + + .. autosummary:: + + ~HandleImageStats.dataclass_json_config + .. rubric:: Methods Summary .. autosummary:: @@ -16,6 +22,10 @@ HandleImageStats ~HandleImageStats.to_dict ~HandleImageStats.to_json + .. rubric:: Attributes Documentation + + .. autoattribute:: dataclass_json_config + .. rubric:: Methods Documentation .. automethod:: from_dict diff --git a/docs/api/wwt_api_client.constellations.data.HandleInfo.rst b/docs/api/wwt_api_client.constellations.data.HandleInfo.rst index 1a1b2c8..fe2af41 100644 --- a/docs/api/wwt_api_client.constellations.data.HandleInfo.rst +++ b/docs/api/wwt_api_client.constellations.data.HandleInfo.rst @@ -6,6 +6,12 @@ HandleInfo .. autoclass:: HandleInfo :show-inheritance: + .. rubric:: Attributes Summary + + .. autosummary:: + + ~HandleInfo.dataclass_json_config + .. rubric:: Methods Summary .. autosummary:: @@ -16,6 +22,10 @@ HandleInfo ~HandleInfo.to_dict ~HandleInfo.to_json + .. rubric:: Attributes Documentation + + .. autoattribute:: dataclass_json_config + .. rubric:: Methods Documentation .. automethod:: from_dict diff --git a/docs/api/wwt_api_client.constellations.data.HandlePermissions.rst b/docs/api/wwt_api_client.constellations.data.HandlePermissions.rst index 828881e..eb4657c 100644 --- a/docs/api/wwt_api_client.constellations.data.HandlePermissions.rst +++ b/docs/api/wwt_api_client.constellations.data.HandlePermissions.rst @@ -6,6 +6,12 @@ HandlePermissions .. autoclass:: HandlePermissions :show-inheritance: + .. rubric:: Attributes Summary + + .. autosummary:: + + ~HandlePermissions.dataclass_json_config + .. rubric:: Methods Summary .. autosummary:: @@ -16,6 +22,10 @@ HandlePermissions ~HandlePermissions.to_dict ~HandlePermissions.to_json + .. rubric:: Attributes Documentation + + .. autoattribute:: dataclass_json_config + .. rubric:: Methods Documentation .. automethod:: from_dict diff --git a/docs/api/wwt_api_client.constellations.data.HandleSceneStats.rst b/docs/api/wwt_api_client.constellations.data.HandleSceneStats.rst index 00740c5..d610df0 100644 --- a/docs/api/wwt_api_client.constellations.data.HandleSceneStats.rst +++ b/docs/api/wwt_api_client.constellations.data.HandleSceneStats.rst @@ -6,6 +6,12 @@ HandleSceneStats .. autoclass:: HandleSceneStats :show-inheritance: + .. rubric:: Attributes Summary + + .. autosummary:: + + ~HandleSceneStats.dataclass_json_config + .. rubric:: Methods Summary .. autosummary:: @@ -16,6 +22,10 @@ HandleSceneStats ~HandleSceneStats.to_dict ~HandleSceneStats.to_json + .. rubric:: Attributes Documentation + + .. autoattribute:: dataclass_json_config + .. rubric:: Methods Documentation .. automethod:: from_dict diff --git a/docs/api/wwt_api_client.constellations.data.HandleStats.rst b/docs/api/wwt_api_client.constellations.data.HandleStats.rst index 05078e0..bb5ac4b 100644 --- a/docs/api/wwt_api_client.constellations.data.HandleStats.rst +++ b/docs/api/wwt_api_client.constellations.data.HandleStats.rst @@ -6,6 +6,12 @@ HandleStats .. autoclass:: HandleStats :show-inheritance: + .. rubric:: Attributes Summary + + .. autosummary:: + + ~HandleStats.dataclass_json_config + .. rubric:: Methods Summary .. autosummary:: @@ -16,6 +22,10 @@ HandleStats ~HandleStats.to_dict ~HandleStats.to_json + .. rubric:: Attributes Documentation + + .. autoattribute:: dataclass_json_config + .. rubric:: Methods Documentation .. automethod:: from_dict diff --git a/docs/api/wwt_api_client.constellations.data.HandleUpdate.rst b/docs/api/wwt_api_client.constellations.data.HandleUpdate.rst index 25859b2..7ef3518 100644 --- a/docs/api/wwt_api_client.constellations.data.HandleUpdate.rst +++ b/docs/api/wwt_api_client.constellations.data.HandleUpdate.rst @@ -6,6 +6,13 @@ HandleUpdate .. autoclass:: HandleUpdate :show-inheritance: + .. rubric:: Attributes Summary + + .. autosummary:: + + ~HandleUpdate.dataclass_json_config + ~HandleUpdate.display_name + .. rubric:: Methods Summary .. autosummary:: @@ -16,6 +23,11 @@ HandleUpdate ~HandleUpdate.to_dict ~HandleUpdate.to_json + .. rubric:: Attributes Documentation + + .. autoattribute:: dataclass_json_config + .. autoattribute:: display_name + .. rubric:: Methods Documentation .. automethod:: from_dict diff --git a/docs/api/wwt_api_client.constellations.data.ImageApiPermissions.rst b/docs/api/wwt_api_client.constellations.data.ImageApiPermissions.rst index 21ec3e7..64d0ee7 100644 --- a/docs/api/wwt_api_client.constellations.data.ImageApiPermissions.rst +++ b/docs/api/wwt_api_client.constellations.data.ImageApiPermissions.rst @@ -6,6 +6,12 @@ ImageApiPermissions .. autoclass:: ImageApiPermissions :show-inheritance: + .. rubric:: Attributes Summary + + .. autosummary:: + + ~ImageApiPermissions.dataclass_json_config + .. rubric:: Methods Summary .. autosummary:: @@ -16,6 +22,10 @@ ImageApiPermissions ~ImageApiPermissions.to_dict ~ImageApiPermissions.to_json + .. rubric:: Attributes Documentation + + .. autoattribute:: dataclass_json_config + .. rubric:: Methods Documentation .. automethod:: from_dict diff --git a/docs/api/wwt_api_client.constellations.data.ImageContentPermissions.rst b/docs/api/wwt_api_client.constellations.data.ImageContentPermissions.rst index c558d40..f336421 100644 --- a/docs/api/wwt_api_client.constellations.data.ImageContentPermissions.rst +++ b/docs/api/wwt_api_client.constellations.data.ImageContentPermissions.rst @@ -6,6 +6,13 @@ ImageContentPermissions .. autoclass:: ImageContentPermissions :show-inheritance: + .. rubric:: Attributes Summary + + .. autosummary:: + + ~ImageContentPermissions.credits + ~ImageContentPermissions.dataclass_json_config + .. rubric:: Methods Summary .. autosummary:: @@ -16,6 +23,11 @@ ImageContentPermissions ~ImageContentPermissions.to_dict ~ImageContentPermissions.to_json + .. rubric:: Attributes Documentation + + .. autoattribute:: credits + .. autoattribute:: dataclass_json_config + .. rubric:: Methods Documentation .. automethod:: from_dict diff --git a/docs/api/wwt_api_client.constellations.data.ImageDisplayInfo.rst b/docs/api/wwt_api_client.constellations.data.ImageDisplayInfo.rst index 7e31f5e..bc89754 100644 --- a/docs/api/wwt_api_client.constellations.data.ImageDisplayInfo.rst +++ b/docs/api/wwt_api_client.constellations.data.ImageDisplayInfo.rst @@ -6,6 +6,12 @@ ImageDisplayInfo .. autoclass:: ImageDisplayInfo :show-inheritance: + .. rubric:: Attributes Summary + + .. autosummary:: + + ~ImageDisplayInfo.dataclass_json_config + .. rubric:: Methods Summary .. autosummary:: @@ -16,6 +22,10 @@ ImageDisplayInfo ~ImageDisplayInfo.to_dict ~ImageDisplayInfo.to_json + .. rubric:: Attributes Documentation + + .. autoattribute:: dataclass_json_config + .. rubric:: Methods Documentation .. automethod:: from_dict diff --git a/docs/api/wwt_api_client.constellations.data.ImageInfo.rst b/docs/api/wwt_api_client.constellations.data.ImageInfo.rst index 175ffff..e529b85 100644 --- a/docs/api/wwt_api_client.constellations.data.ImageInfo.rst +++ b/docs/api/wwt_api_client.constellations.data.ImageInfo.rst @@ -6,6 +6,12 @@ ImageInfo .. autoclass:: ImageInfo :show-inheritance: + .. rubric:: Attributes Summary + + .. autosummary:: + + ~ImageInfo.dataclass_json_config + .. rubric:: Methods Summary .. autosummary:: @@ -16,6 +22,10 @@ ImageInfo ~ImageInfo.to_dict ~ImageInfo.to_json + .. rubric:: Attributes Documentation + + .. autoattribute:: dataclass_json_config + .. rubric:: Methods Documentation .. automethod:: from_dict diff --git a/docs/api/wwt_api_client.constellations.data.ImageStorage.rst b/docs/api/wwt_api_client.constellations.data.ImageStorage.rst index 6dbf992..ef64c38 100644 --- a/docs/api/wwt_api_client.constellations.data.ImageStorage.rst +++ b/docs/api/wwt_api_client.constellations.data.ImageStorage.rst @@ -6,6 +6,13 @@ ImageStorage .. autoclass:: ImageStorage :show-inheritance: + .. rubric:: Attributes Summary + + .. autosummary:: + + ~ImageStorage.dataclass_json_config + ~ImageStorage.legacy_url_template + .. rubric:: Methods Summary .. autosummary:: @@ -16,6 +23,11 @@ ImageStorage ~ImageStorage.to_dict ~ImageStorage.to_json + .. rubric:: Attributes Documentation + + .. autoattribute:: dataclass_json_config + .. autoattribute:: legacy_url_template + .. rubric:: Methods Documentation .. automethod:: from_dict diff --git a/docs/api/wwt_api_client.constellations.data.ImageSummary.rst b/docs/api/wwt_api_client.constellations.data.ImageSummary.rst index 266fa5f..fb2d62a 100644 --- a/docs/api/wwt_api_client.constellations.data.ImageSummary.rst +++ b/docs/api/wwt_api_client.constellations.data.ImageSummary.rst @@ -6,6 +6,12 @@ ImageSummary .. autoclass:: ImageSummary :show-inheritance: + .. rubric:: Attributes Summary + + .. autosummary:: + + ~ImageSummary.dataclass_json_config + .. rubric:: Methods Summary .. autosummary:: @@ -16,6 +22,10 @@ ImageSummary ~ImageSummary.to_dict ~ImageSummary.to_json + .. rubric:: Attributes Documentation + + .. autoattribute:: dataclass_json_config + .. rubric:: Methods Documentation .. automethod:: from_dict diff --git a/docs/api/wwt_api_client.constellations.data.ImageUpdate.rst b/docs/api/wwt_api_client.constellations.data.ImageUpdate.rst index 4d22231..cbdf68e 100644 --- a/docs/api/wwt_api_client.constellations.data.ImageUpdate.rst +++ b/docs/api/wwt_api_client.constellations.data.ImageUpdate.rst @@ -6,6 +6,14 @@ ImageUpdate .. autoclass:: ImageUpdate :show-inheritance: + .. rubric:: Attributes Summary + + .. autosummary:: + + ~ImageUpdate.dataclass_json_config + ~ImageUpdate.note + ~ImageUpdate.permissions + .. rubric:: Methods Summary .. autosummary:: @@ -16,6 +24,12 @@ ImageUpdate ~ImageUpdate.to_dict ~ImageUpdate.to_json + .. rubric:: Attributes Documentation + + .. autoattribute:: dataclass_json_config + .. autoattribute:: note + .. autoattribute:: permissions + .. rubric:: Methods Documentation .. automethod:: from_dict diff --git a/docs/api/wwt_api_client.constellations.data.ImageWwt.rst b/docs/api/wwt_api_client.constellations.data.ImageWwt.rst index 688bf9a..2b455e8 100644 --- a/docs/api/wwt_api_client.constellations.data.ImageWwt.rst +++ b/docs/api/wwt_api_client.constellations.data.ImageWwt.rst @@ -6,6 +6,12 @@ ImageWwt .. autoclass:: ImageWwt :show-inheritance: + .. rubric:: Attributes Summary + + .. autosummary:: + + ~ImageWwt.dataclass_json_config + .. rubric:: Methods Summary .. autosummary:: @@ -16,6 +22,10 @@ ImageWwt ~ImageWwt.to_dict ~ImageWwt.to_json + .. rubric:: Attributes Documentation + + .. autoattribute:: dataclass_json_config + .. rubric:: Methods Documentation .. automethod:: from_dict diff --git a/docs/api/wwt_api_client.constellations.data.SceneContent.rst b/docs/api/wwt_api_client.constellations.data.SceneContent.rst index e310d27..f6dcbc1 100644 --- a/docs/api/wwt_api_client.constellations.data.SceneContent.rst +++ b/docs/api/wwt_api_client.constellations.data.SceneContent.rst @@ -6,6 +6,13 @@ SceneContent .. autoclass:: SceneContent :show-inheritance: + .. rubric:: Attributes Summary + + .. autosummary:: + + ~SceneContent.dataclass_json_config + ~SceneContent.image_layers + .. rubric:: Methods Summary .. autosummary:: @@ -16,6 +23,11 @@ SceneContent ~SceneContent.to_dict ~SceneContent.to_json + .. rubric:: Attributes Documentation + + .. autoattribute:: dataclass_json_config + .. autoattribute:: image_layers + .. rubric:: Methods Documentation .. automethod:: from_dict diff --git a/docs/api/wwt_api_client.constellations.data.SceneContentHydrated.rst b/docs/api/wwt_api_client.constellations.data.SceneContentHydrated.rst index 7790494..b6031a8 100644 --- a/docs/api/wwt_api_client.constellations.data.SceneContentHydrated.rst +++ b/docs/api/wwt_api_client.constellations.data.SceneContentHydrated.rst @@ -6,6 +6,14 @@ SceneContentHydrated .. autoclass:: SceneContentHydrated :show-inheritance: + .. rubric:: Attributes Summary + + .. autosummary:: + + ~SceneContentHydrated.background + ~SceneContentHydrated.dataclass_json_config + ~SceneContentHydrated.image_layers + .. rubric:: Methods Summary .. autosummary:: @@ -16,6 +24,12 @@ SceneContentHydrated ~SceneContentHydrated.to_dict ~SceneContentHydrated.to_json + .. rubric:: Attributes Documentation + + .. autoattribute:: background + .. autoattribute:: dataclass_json_config + .. autoattribute:: image_layers + .. rubric:: Methods Documentation .. automethod:: from_dict diff --git a/docs/api/wwt_api_client.constellations.data.SceneHydrated.rst b/docs/api/wwt_api_client.constellations.data.SceneHydrated.rst index dedc70f..e067a09 100644 --- a/docs/api/wwt_api_client.constellations.data.SceneHydrated.rst +++ b/docs/api/wwt_api_client.constellations.data.SceneHydrated.rst @@ -6,6 +6,12 @@ SceneHydrated .. autoclass:: SceneHydrated :show-inheritance: + .. rubric:: Attributes Summary + + .. autosummary:: + + ~SceneHydrated.dataclass_json_config + .. rubric:: Methods Summary .. autosummary:: @@ -16,6 +22,10 @@ SceneHydrated ~SceneHydrated.to_dict ~SceneHydrated.to_json + .. rubric:: Attributes Documentation + + .. autoattribute:: dataclass_json_config + .. rubric:: Methods Documentation .. automethod:: from_dict diff --git a/docs/api/wwt_api_client.constellations.data.SceneImageLayer.rst b/docs/api/wwt_api_client.constellations.data.SceneImageLayer.rst index 0844af1..855fb25 100644 --- a/docs/api/wwt_api_client.constellations.data.SceneImageLayer.rst +++ b/docs/api/wwt_api_client.constellations.data.SceneImageLayer.rst @@ -6,6 +6,12 @@ SceneImageLayer .. autoclass:: SceneImageLayer :show-inheritance: + .. rubric:: Attributes Summary + + .. autosummary:: + + ~SceneImageLayer.dataclass_json_config + .. rubric:: Methods Summary .. autosummary:: @@ -16,6 +22,10 @@ SceneImageLayer ~SceneImageLayer.to_dict ~SceneImageLayer.to_json + .. rubric:: Attributes Documentation + + .. autoattribute:: dataclass_json_config + .. rubric:: Methods Documentation .. automethod:: from_dict diff --git a/docs/api/wwt_api_client.constellations.data.SceneImageLayerHydrated.rst b/docs/api/wwt_api_client.constellations.data.SceneImageLayerHydrated.rst index 43112f5..32b675b 100644 --- a/docs/api/wwt_api_client.constellations.data.SceneImageLayerHydrated.rst +++ b/docs/api/wwt_api_client.constellations.data.SceneImageLayerHydrated.rst @@ -6,6 +6,12 @@ SceneImageLayerHydrated .. autoclass:: SceneImageLayerHydrated :show-inheritance: + .. rubric:: Attributes Summary + + .. autosummary:: + + ~SceneImageLayerHydrated.dataclass_json_config + .. rubric:: Methods Summary .. autosummary:: @@ -16,6 +22,10 @@ SceneImageLayerHydrated ~SceneImageLayerHydrated.to_dict ~SceneImageLayerHydrated.to_json + .. rubric:: Attributes Documentation + + .. autoattribute:: dataclass_json_config + .. rubric:: Methods Documentation .. automethod:: from_dict diff --git a/docs/api/wwt_api_client.constellations.data.SceneInfo.rst b/docs/api/wwt_api_client.constellations.data.SceneInfo.rst index b3b2218..e5e39e5 100644 --- a/docs/api/wwt_api_client.constellations.data.SceneInfo.rst +++ b/docs/api/wwt_api_client.constellations.data.SceneInfo.rst @@ -6,6 +6,12 @@ SceneInfo .. autoclass:: SceneInfo :show-inheritance: + .. rubric:: Attributes Summary + + .. autosummary:: + + ~SceneInfo.dataclass_json_config + .. rubric:: Methods Summary .. autosummary:: @@ -16,6 +22,10 @@ SceneInfo ~SceneInfo.to_dict ~SceneInfo.to_json + .. rubric:: Attributes Documentation + + .. autoattribute:: dataclass_json_config + .. rubric:: Methods Documentation .. automethod:: from_dict diff --git a/docs/api/wwt_api_client.constellations.data.ScenePermissions.rst b/docs/api/wwt_api_client.constellations.data.ScenePermissions.rst index 8913768..c259158 100644 --- a/docs/api/wwt_api_client.constellations.data.ScenePermissions.rst +++ b/docs/api/wwt_api_client.constellations.data.ScenePermissions.rst @@ -6,6 +6,12 @@ ScenePermissions .. autoclass:: ScenePermissions :show-inheritance: + .. rubric:: Attributes Summary + + .. autosummary:: + + ~ScenePermissions.dataclass_json_config + .. rubric:: Methods Summary .. autosummary:: @@ -16,6 +22,10 @@ ScenePermissions ~ScenePermissions.to_dict ~ScenePermissions.to_json + .. rubric:: Attributes Documentation + + .. autoattribute:: dataclass_json_config + .. rubric:: Methods Documentation .. automethod:: from_dict diff --git a/docs/api/wwt_api_client.constellations.data.ScenePlace.rst b/docs/api/wwt_api_client.constellations.data.ScenePlace.rst index 8d1638d..b95b9b9 100644 --- a/docs/api/wwt_api_client.constellations.data.ScenePlace.rst +++ b/docs/api/wwt_api_client.constellations.data.ScenePlace.rst @@ -6,6 +6,12 @@ ScenePlace .. autoclass:: ScenePlace :show-inheritance: + .. rubric:: Attributes Summary + + .. autosummary:: + + ~ScenePlace.dataclass_json_config + .. rubric:: Methods Summary .. autosummary:: @@ -16,6 +22,10 @@ ScenePlace ~ScenePlace.to_dict ~ScenePlace.to_json + .. rubric:: Attributes Documentation + + .. autoattribute:: dataclass_json_config + .. rubric:: Methods Documentation .. automethod:: from_dict diff --git a/docs/api/wwt_api_client.constellations.data.ScenePreviews.rst b/docs/api/wwt_api_client.constellations.data.ScenePreviews.rst index aee1d4e..acea911 100644 --- a/docs/api/wwt_api_client.constellations.data.ScenePreviews.rst +++ b/docs/api/wwt_api_client.constellations.data.ScenePreviews.rst @@ -6,6 +6,14 @@ ScenePreviews .. autoclass:: ScenePreviews :show-inheritance: + .. rubric:: Attributes Summary + + .. autosummary:: + + ~ScenePreviews.dataclass_json_config + ~ScenePreviews.thumbnail + ~ScenePreviews.video + .. rubric:: Methods Summary .. autosummary:: @@ -16,6 +24,12 @@ ScenePreviews ~ScenePreviews.to_dict ~ScenePreviews.to_json + .. rubric:: Attributes Documentation + + .. autoattribute:: dataclass_json_config + .. autoattribute:: thumbnail + .. autoattribute:: video + .. rubric:: Methods Documentation .. automethod:: from_dict diff --git a/docs/api/wwt_api_client.constellations.data.SceneUpdate.rst b/docs/api/wwt_api_client.constellations.data.SceneUpdate.rst index c7d28cf..64b6518 100644 --- a/docs/api/wwt_api_client.constellations.data.SceneUpdate.rst +++ b/docs/api/wwt_api_client.constellations.data.SceneUpdate.rst @@ -6,6 +6,15 @@ SceneUpdate .. autoclass:: SceneUpdate :show-inheritance: + .. rubric:: Attributes Summary + + .. autosummary:: + + ~SceneUpdate.dataclass_json_config + ~SceneUpdate.outgoing_url + ~SceneUpdate.place + ~SceneUpdate.text + .. rubric:: Methods Summary .. autosummary:: @@ -16,6 +25,13 @@ SceneUpdate ~SceneUpdate.to_dict ~SceneUpdate.to_json + .. rubric:: Attributes Documentation + + .. autoattribute:: dataclass_json_config + .. autoattribute:: outgoing_url + .. autoattribute:: place + .. autoattribute:: text + .. rubric:: Methods Documentation .. automethod:: from_dict diff --git a/docs/api/wwt_api_client.constellations.handles.AddImageRequest.rst b/docs/api/wwt_api_client.constellations.handles.AddImageRequest.rst index 02e6d52..a984633 100644 --- a/docs/api/wwt_api_client.constellations.handles.AddImageRequest.rst +++ b/docs/api/wwt_api_client.constellations.handles.AddImageRequest.rst @@ -6,6 +6,13 @@ AddImageRequest .. autoclass:: AddImageRequest :show-inheritance: + .. rubric:: Attributes Summary + + .. autosummary:: + + ~AddImageRequest.alt_text + ~AddImageRequest.dataclass_json_config + .. rubric:: Methods Summary .. autosummary:: @@ -16,6 +23,11 @@ AddImageRequest ~AddImageRequest.to_dict ~AddImageRequest.to_json + .. rubric:: Attributes Documentation + + .. autoattribute:: alt_text + .. autoattribute:: dataclass_json_config + .. rubric:: Methods Documentation .. automethod:: from_dict diff --git a/docs/api/wwt_api_client.constellations.handles.AddSceneRequest.rst b/docs/api/wwt_api_client.constellations.handles.AddSceneRequest.rst index d3eba1c..52ad592 100644 --- a/docs/api/wwt_api_client.constellations.handles.AddSceneRequest.rst +++ b/docs/api/wwt_api_client.constellations.handles.AddSceneRequest.rst @@ -6,6 +6,13 @@ AddSceneRequest .. autoclass:: AddSceneRequest :show-inheritance: + .. rubric:: Attributes Summary + + .. autosummary:: + + ~AddSceneRequest.dataclass_json_config + ~AddSceneRequest.outgoing_url + .. rubric:: Methods Summary .. autosummary:: @@ -16,6 +23,11 @@ AddSceneRequest ~AddSceneRequest.to_dict ~AddSceneRequest.to_json + .. rubric:: Attributes Documentation + + .. autoattribute:: dataclass_json_config + .. autoattribute:: outgoing_url + .. rubric:: Methods Documentation .. automethod:: from_dict From 473c2ca082888b49213a7260f17484b7b2369cef Mon Sep 17 00:00:00 2001 From: Carifio24 Date: Wed, 15 Nov 2023 16:23:10 -0500 Subject: [PATCH 3/7] Update data structures and scene creation to account for backend publishing update. --- wwt_api_client/constellations/data.py | 11 +++++++++++ wwt_api_client/constellations/handles.py | 4 +++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/wwt_api_client/constellations/data.py b/wwt_api_client/constellations/data.py index 5bca26c..9c08d2c 100644 --- a/wwt_api_client/constellations/data.py +++ b/wwt_api_client/constellations/data.py @@ -286,6 +286,7 @@ class SceneHydrated: content: SceneContentHydrated text: str previews: ScenePreviews + published: bool @dataclass_json(undefined="EXCLUDE") @@ -297,6 +298,8 @@ class SceneInfo: likes: int clicks: Optional[int] shares: Optional[int] + text: str + published: bool @dataclass_json(undefined="EXCLUDE") @@ -306,9 +309,17 @@ class ScenePermissions: edit: bool +@dataclass_json(undefined="EXCLUDE") +@dataclass +class SceneContentUpdate: + background_id: Optional[str] = None + + @dataclass_json(undefined="EXCLUDE") @dataclass class SceneUpdate: outgoing_url: Optional[str] = None place: Optional[ScenePlace] = None text: Optional[str] = None + content: Optional[SceneContentUpdate] = None + publish: Optional[bool] = None diff --git a/wwt_api_client/constellations/handles.py b/wwt_api_client/constellations/handles.py index 8ce8cf2..49da280 100644 --- a/wwt_api_client/constellations/handles.py +++ b/wwt_api_client/constellations/handles.py @@ -70,6 +70,7 @@ class AddSceneRequest: place: ScenePlace content: SceneContent text: str + publish: bool outgoing_url: Optional[str] = None @@ -187,7 +188,7 @@ def scene_info( page_num : int Which page to retrieve. Page zero gives the most recently-created scenes, page one gives the next batch, etc. - page_size : optinal int, defaults to 10 + page_size : optional int, defaults to 10 The number of items per page to retrieve. Valid values are between 1 and 100. @@ -532,6 +533,7 @@ def add_scene_from_place(self, place: Place) -> str: content=content, text=text, outgoing_url=outgoing_url, + publish=True, ) return self.add_scene(req) From e181c08fb685521274c83f8b1a1da7e93e706bac Mon Sep 17 00:00:00 2001 From: Carifio24 Date: Thu, 16 Nov 2023 15:03:57 -0500 Subject: [PATCH 4/7] Add SceneContentUpdate to public exports. --- wwt_api_client/constellations/data.py | 1 + 1 file changed, 1 insertion(+) diff --git a/wwt_api_client/constellations/data.py b/wwt_api_client/constellations/data.py index 9c08d2c..63e604f 100644 --- a/wwt_api_client/constellations/data.py +++ b/wwt_api_client/constellations/data.py @@ -35,6 +35,7 @@ ImageWwt SceneContent SceneContentHydrated +SceneContentUpdate SceneHydrated SceneImageLayer SceneImageLayerHydrated From 25fc10ffa6e0bb219e9aa804c03c7bbac90dc04b Mon Sep 17 00:00:00 2001 From: Carifio24 Date: Mon, 27 Nov 2023 10:54:36 -0500 Subject: [PATCH 5/7] Update field name to account for backend change. Publish a newly-added scene by default. --- wwt_api_client/constellations/handles.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/wwt_api_client/constellations/handles.py b/wwt_api_client/constellations/handles.py index 49da280..4d4c84c 100644 --- a/wwt_api_client/constellations/handles.py +++ b/wwt_api_client/constellations/handles.py @@ -70,7 +70,7 @@ class AddSceneRequest: place: ScenePlace content: SceneContent text: str - publish: bool + published: bool outgoing_url: Optional[str] = None @@ -456,7 +456,7 @@ def add_scene(self, scene: AddSceneRequest) -> str: resp = AddSceneResponse.schema().load(resp) return resp.id - def add_scene_from_place(self, place: Place) -> str: + def add_scene_from_place(self, place: Place, publish=True) -> str: """ Add a new scene derived from a :class:`wwt_data_formats.place.Place` object. @@ -465,6 +465,8 @@ def add_scene_from_place(self, place: Place) -> str: ---------- place : :class:`wwt_data_formats.place.Place` The WWT place + publish: `bool` + Whether or not to publish the newly-created scene Returns ------- @@ -533,7 +535,7 @@ def add_scene_from_place(self, place: Place) -> str: content=content, text=text, outgoing_url=outgoing_url, - publish=True, + published=publish, ) return self.add_scene(req) From 243c4ffff8e7e97b1a56e62536cb05721fb9adc8 Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Mon, 4 Dec 2023 13:39:12 -0500 Subject: [PATCH 6/7] wwt_api_client/constellations/data.py: track backend API evolution --- wwt_api_client/constellations/data.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wwt_api_client/constellations/data.py b/wwt_api_client/constellations/data.py index 63e604f..c99feef 100644 --- a/wwt_api_client/constellations/data.py +++ b/wwt_api_client/constellations/data.py @@ -323,4 +323,4 @@ class SceneUpdate: place: Optional[ScenePlace] = None text: Optional[str] = None content: Optional[SceneContentUpdate] = None - publish: Optional[bool] = None + published: Optional[bool] = None From 886ba952e77b8e175100006c9c6e755b9a560a45 Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Mon, 4 Dec 2023 13:40:09 -0500 Subject: [PATCH 7/7] docs/api: update autogenerated files --- ...constellations.data.SceneContentUpdate.rst | 37 +++++++++++++++++++ ...client.constellations.data.SceneUpdate.rst | 4 ++ 2 files changed, 41 insertions(+) create mode 100644 docs/api/wwt_api_client.constellations.data.SceneContentUpdate.rst diff --git a/docs/api/wwt_api_client.constellations.data.SceneContentUpdate.rst b/docs/api/wwt_api_client.constellations.data.SceneContentUpdate.rst new file mode 100644 index 0000000..7ebdd35 --- /dev/null +++ b/docs/api/wwt_api_client.constellations.data.SceneContentUpdate.rst @@ -0,0 +1,37 @@ +SceneContentUpdate +================== + +.. currentmodule:: wwt_api_client.constellations.data + +.. autoclass:: SceneContentUpdate + :show-inheritance: + + .. rubric:: Attributes Summary + + .. autosummary:: + + ~SceneContentUpdate.background_id + ~SceneContentUpdate.dataclass_json_config + + .. rubric:: Methods Summary + + .. autosummary:: + + ~SceneContentUpdate.from_dict + ~SceneContentUpdate.from_json + ~SceneContentUpdate.schema + ~SceneContentUpdate.to_dict + ~SceneContentUpdate.to_json + + .. rubric:: Attributes Documentation + + .. autoattribute:: background_id + .. autoattribute:: dataclass_json_config + + .. rubric:: Methods Documentation + + .. automethod:: from_dict + .. automethod:: from_json + .. automethod:: schema + .. automethod:: to_dict + .. automethod:: to_json diff --git a/docs/api/wwt_api_client.constellations.data.SceneUpdate.rst b/docs/api/wwt_api_client.constellations.data.SceneUpdate.rst index 64b6518..a2cd577 100644 --- a/docs/api/wwt_api_client.constellations.data.SceneUpdate.rst +++ b/docs/api/wwt_api_client.constellations.data.SceneUpdate.rst @@ -10,9 +10,11 @@ SceneUpdate .. autosummary:: + ~SceneUpdate.content ~SceneUpdate.dataclass_json_config ~SceneUpdate.outgoing_url ~SceneUpdate.place + ~SceneUpdate.published ~SceneUpdate.text .. rubric:: Methods Summary @@ -27,9 +29,11 @@ SceneUpdate .. rubric:: Attributes Documentation + .. autoattribute:: content .. autoattribute:: dataclass_json_config .. autoattribute:: outgoing_url .. autoattribute:: place + .. autoattribute:: published .. autoattribute:: text .. rubric:: Methods Documentation