diff --git a/.gitignore b/.gitignore index d0663a4..e242abb 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ venv/ build/ .DS_Store +**/_autosummary/* diff --git a/requirements.txt b/requirements.txt index 2c21fd7..8a47382 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,4 +4,5 @@ pydata_sphinx_theme sphinx-copybutton sphinxcontrib-mermaid sphinx-autobuild +autodoc_pydantic git+https://github.com/edutap-eu/edutap.wallet_google.git@main \ No newline at end of file diff --git a/source/conf.py b/source/conf.py index bde0fe5..15b23dd 100644 --- a/source/conf.py +++ b/source/conf.py @@ -38,6 +38,8 @@ "sphinxcontrib.mermaid", "sphinx.ext.todo", "sphinx.ext.autodoc", + "sphinx.ext.autosummary", + "sphinxcontrib.autodoc_pydantic", ] # Add any paths that contain templates here, relative to this directory. diff --git a/source/packages/edutap_wallet_google/reference.md b/source/packages/edutap_wallet_google/reference.md index 0393b3d..760eb2b 100644 --- a/source/packages/edutap_wallet_google/reference.md +++ b/source/packages/edutap_wallet_google/reference.md @@ -1,8 +1,6 @@ # Reference -## API Documentation - -## Overview +## API Functions Most tasks are done by import and using the sole `api` module: @@ -10,62 +8,325 @@ Most tasks are done by import and using the sole `api` module: from edutap.wallet_google import api ``` -The `api` module has the functions: - -- [`api.create`](#edutap.wallet_google.api.create) -- [`api.read`](#edutap.wallet_google.api.read) -- [`api.update`](#edutap.wallet_google.api.update) -- [`api.disable`](#edutap.wallet_google.api.disable) -- [`api.message`](#edutap.wallet_google.api.message) -- [`api.listing`](#edutap.wallet_google.api.listing) -- [`api.save_link`](#edutap.wallet_google.api.save_link) - To tell the API functions what kind of item to deal with, the first parameter is the registered name of the model (except for `save_link`). +Models can be the different top-level wallet-classes or -objects, but also issuers, permissions and such (see section models below). -Models can be the different wallet-classes or -objects, but also issuers, permissions and such (see section models below). +```{eval-rst} +.. currentmodule:: edutap.wallet_google.api -## API Functions +.. autosummary:: + :toctree: _autosummary -```{eval-rst} -.. autofunction:: edutap.wallet_google.api.create + create + read + update + disable + message + listing + save_link ``` -```{eval-rst} -.. autofunction:: edutap.wallet_google.api.read -``` +## Models -```{eval-rst} -.. autofunction:: edutap.wallet_google.api.update -``` +### Top Level Models ```{eval-rst} -.. autofunction:: edutap.wallet_google.api.disable -``` -```{eval-rst} -.. autofunction:: edutap.wallet_google.api.message -``` +.. rubric:: Generic + +`edutap.wallet_google.models.generic` + +.. currentmodule:: edutap.wallet_google.models.generic + +.. autosummary:: + :toctree: _autosummary + + GenericClass + GenericObject + + +.. rubric:: Retail + +`edutap.wallet_google.models.retail` + +.. currentmodule:: edutap.wallet_google.models.retail + +.. autosummary:: + :toctree: _autosummary + + GiftCardClass + GiftCardObject + LoyaltyClass + LoyaltyObject + OfferClass + OfferObject + +.. rubric:: Ticket and Transit + +`edutap.wallet_google.models.tickets_and_transit` + +.. currentmodule:: edutap.wallet_google.models.tickets_and_transit + +.. autosummary:: + :toctree: _autosummary + + EventTicketClass + EventTicketObject + + +.. rubric:: Issuer + +`edutap.wallet_google.models.issuer` + +.. currentmodule:: edutap.wallet_google.models.issuer + +.. autosummary:: + :toctree: _autosummary + + Issuer + Permissions + SmartTap + +.. rubric:: JWT + +`edutap.wallet_google.models.jwt` + +.. currentmodule:: edutap.wallet_google.models.jwt + +.. autosummary:: + :toctree: _autosummary + + JwtResource + JwtResponse + Resources -```{eval-rst} -.. autofunction:: edutap.wallet_google.api.listing ``` +### Data-Types + ```{eval-rst} -.. autofunction:: edutap.wallet_google.api.save_link -``` -## Models +.. currentmodule:: edutap.wallet_google.models.retail -```{todo} +.. rubric:: Retail -Create a Sphinx plugin to document the pydantic models of `edutap.wallet_google`. +`edutap.wallet_google.models.retail` -``` +.. autosummary:: + :toctree: _autosummary -### Top Level Models + LoyaltyPointsBalance + LoyaltyPoints + +.. rubric:: Ticket and Transit + +`edutap.wallet_google.models.tickets_and_transit` + +.. currentmodule:: edutap.wallet_google.models.tickets_and_transit + +.. autosummary:: + :toctree: _autosummary + + EventSeat + EventReservationInfo + +.. rubric:: Primitives: Enumerations + +`edutap.wallet_google.models.primitives.enums` + +.. currentmodule:: edutap.wallet_google.models.primitives.enums + +.. autosummary:: + :toctree: _autosummary + + Action + AnimationType + BarcodeRenderEncoding + BarcodeType + ConfirmationCodeLabel + DateFormat + DoorsOpenLabel + GateLabel + GenericType + MessageType + MultipleDevicesAndHoldersAllowedStatus + NfcConstraint + PredefinedItem + RedemptionChannel + ReviewStatus + Role + RowLabel + ScreenshotEligibility + SeatLabel + SectionLabel + SharedDataType + State + RetailState + TotpAlgorithm + TransitOption + ViewUnlockRequirement + +.. rubric:: Primitives: Barcode + +`edutap.wallet_google.models.primitives.barcode` + +.. currentmodule:: edutap.wallet_google.models.primitives.barcode + +.. autosummary:: + :toctree: _autosummary + + Barcode + TotpParameters + TotpDetails + RotatingBarcode + +.. rubric:: Primitives: Class Template Info + +`edutap.wallet_google.models.primitives.class_template_info` + +.. currentmodule:: edutap.wallet_google.models.primitives.class_template_info + +.. autosummary:: + :toctree: _autosummary + + FieldReference + FieldSelector + TemplateItem + BarcodeSectionDetail + CardBarcodeSectionDetails + CardRowOneItem + CardRowTwoItems + CardRowThreeItems + CardRowTemplateInfo + CardTemplateOverride + DetailsItemInfo + DetailsTemplateOverride + FirstRowOption + ListTemplateOverride + ClassTemplateInfo + + +.. rubric:: Primitives: Data + +`edutap.wallet_google.models.primitives.data` + +.. currentmodule:: edutap.wallet_google.models.primitives.data + +.. autosummary:: + :toctree: _autosummary + + TextModuleData + LabelValue + LabelValueRow + LinksModuleData + ImageModuleData + InfoModuleData + AppTarget + AppLinkInfo + AppLinkData + +.. rubric:: Primitives: Datetime + +`edutap.wallet_google.models.primitives.datetime` + +.. currentmodule:: edutap.wallet_google.models.primitives.datetime + +.. autosummary:: + :toctree: _autosummary + + DateTime + EventDateTime + TimeInterval + +.. rubric:: Primitives: Localized String + +`edutap.wallet_google.models.primitives.localized_string` + +.. currentmodule:: edutap.wallet_google.models.primitives.localized_string + +.. autosummary:: + :toctree: _autosummary + + TranslatedString + LocalizedString + +.. rubric:: Primitives: Location + +`edutap.wallet_google.models.primitives.location` + +.. currentmodule:: edutap.wallet_google.models.primitives.location + +.. autosummary:: + :toctree: _autosummary + + LatLongPoint + EventVenue + +.. rubric:: Primitives: Money + +`edutap.wallet_google.models.primitives.money` + +.. currentmodule:: edutap.wallet_google.models.primitives.money + +.. autosummary:: + :toctree: _autosummary + + Money + +.. rubric:: Primitives: Notification + +`edutap.wallet_google.models.primitives.notification` + +.. currentmodule:: edutap.wallet_google.models.primitives.notification + +.. autosummary:: + :toctree: _autosummary + + ExpiryNotification + UpcomingNotification + Notifications + Message + AddMessageRequest + +.. rubric:: Primitives: Retail + +`edutap.wallet_google.models.primitives.retail` + +.. currentmodule:: edutap.wallet_google.models.primitives.retail + +.. autosummary:: + :toctree: _autosummary + + DiscoverableProgramMerchantSignupInfo + DiscoverableProgramMerchantSigninInfo + DiscoverableProgram + +.. rubric:: Primitives: Reviews + +`edutap.wallet_google.models.primitives.review` + +.. currentmodule:: edutap.wallet_google.models.primitives.review + +.. autosummary:: + :toctree: _autosummary + + Review + +.. rubric:: Primitives: Smarttap + +`edutap.wallet_google.models.primitives.smarttap` -### Datatypes and Enums +.. currentmodule:: edutap.wallet_google.models.primitives.smarttap +.. autosummary:: + :toctree: _autosummary + Permission + AuthenticationKey + SignUpInfo + IssuerToUserInfo + IssuerContactInfo + SmartTapMerchantData +``` \ No newline at end of file