Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion api.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ A list method returns its first page, such as a `AddOnsListPage`: a subclass of
model (`AddOnListResponse`) with the paging members `items`, `has_next_page()`, `get_next_page()`,
`iter_pages()` and `body`, which iterates every item. The page classes are in `meteroid.api`.

[Add ons](#add-ons) · [Add ons entitlements](#add-ons-entitlements) · [Batch jobs](#batch-jobs) · [Budgets](#budgets) · [Checkout sessions](#checkout-sessions) · [Checks](#checks) · [Connect](#connect) · [Coupons](#coupons) · [Credit notes](#credit-notes) · [Credit units](#credit-units) · [Credit units prices](#credit-units-prices) · [Credits](#credits) · [Credits grants](#credits-grants) · [Credits wallets](#credits-wallets) · [Custom properties](#custom-properties) · [Customers](#customers) · [Entitlements](#entitlements) · [Events](#events) · [Features](#features) · [Invoices](#invoices) · [Metrics](#metrics) · [Oauth](#oauth) · [Oauth apps](#oauth-apps) · [Plans](#plans) · [Plans versions](#plans-versions) · [Product families](#product-families) · [Products](#products) · [Products entitlements](#products-entitlements) · [Subscriptions](#subscriptions) · [Usage](#usage) · [Usage customer](#usage-customer) · [Usage costs](#usage-costs) · [Usage costs customer](#usage-costs-customer) · [Usage costs subscription](#usage-costs-subscription) · [Webhook endpoints](#webhook-endpoints) · [Webhook endpoints endpoints](#webhook-endpoints-endpoints)
[Add ons](#add-ons) · [Add ons entitlements](#add-ons-entitlements) · [Batch jobs](#batch-jobs) · [Budgets](#budgets) · [Checkout sessions](#checkout-sessions) · [Checks](#checks) · [Connect](#connect) · [Coupons](#coupons) · [Credit notes](#credit-notes) · [Credit units](#credit-units) · [Credit units prices](#credit-units-prices) · [Credits](#credits) · [Credits grants](#credits-grants) · [Credits wallets](#credits-wallets) · [Custom properties](#custom-properties) · [Customers](#customers) · [Entitlements](#entitlements) · [Events](#events) · [Features](#features) · [Invoices](#invoices) · [Licenses](#licenses) · [Metrics](#metrics) · [Oauth](#oauth) · [Oauth apps](#oauth-apps) · [Plans](#plans) · [Plans versions](#plans-versions) · [Product families](#product-families) · [Products](#products) · [Products entitlements](#products-entitlements) · [Subscriptions](#subscriptions) · [Usage](#usage) · [Usage customer](#usage-customer) · [Usage costs](#usage-costs) · [Usage costs customer](#usage-costs-customer) · [Usage costs subscription](#usage-costs-subscription) · [Webhook endpoints](#webhook-endpoints) · [Webhook endpoints endpoints](#webhook-endpoints-endpoints)

## Add ons

Expand Down Expand Up @@ -234,6 +234,20 @@ model (`AddOnListResponse`) with the paging members `items`, `has_next_page()`,
| `client.invoices.refresh(invoice_id: str) -> Invoice` | `POST /api/v1/invoices/{invoice_id}/refresh` | [`Invoice`](meteroid/models/invoice.py) |
| `client.invoices.download_xml(invoice_id: str) -> bytes` | `GET /api/v1/invoices/{invoice_id}/xml` | bytes |

## Licenses

[`client.licenses`](meteroid/api/licenses.py)

| Method | Request | Returns |
| --- | --- | --- |
| `client.licenses.list(*, customer_id=..., subscription_id=..., include_revoked=...) -> LicenseListResponse` | `GET /api/v1/licenses` | [`LicenseListResponse`](meteroid/models/license_list_response.py) |
| `client.licenses.create(*, customer_id: str, instance_id=..., offline=..., subscription_id=..., validity_days=...) -> IssueLicenseResponse` | `POST /api/v1/licenses` | [`IssueLicenseResponse`](meteroid/models/issue_license_response.py) |
| `client.licenses.retrieve(license_id: str) -> License` | `GET /api/v1/licenses/{license_id}` | [`License`](meteroid/models/license.py) |
| `client.licenses.retrieve_activation_code(license_id: str) -> LicenseActivationCode` | `GET /api/v1/licenses/{license_id}/activation-code` | [`LicenseActivationCode`](meteroid/models/license_activation_code.py) |
| `client.licenses.offline(license_id: str, *, valid_days: int, instance_id=...) -> OfflineLicense` | `POST /api/v1/licenses/{license_id}/offline` | [`OfflineLicense`](meteroid/models/offline_license.py) |
| `client.licenses.revoke(license_id: str, *, immediately=...) -> License` | `POST /api/v1/licenses/{license_id}/revoke` | [`License`](meteroid/models/license.py) |
| `client.licenses.list_licensing_signing_keys() -> LicenseSigningKeysResponse` | `GET /api/v1/licensing/signing-keys` | [`LicenseSigningKeysResponse`](meteroid/models/license_signing_keys_response.py) |

## Metrics

[`client.metrics`](meteroid/api/metrics.py)
Expand Down
5 changes: 5 additions & 0 deletions meteroid/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
from .events import AsyncEvents, Events
from .features import AsyncFeatures, Features
from .invoices import AsyncInvoices, Invoices
from .licenses import AsyncLicenses, Licenses
from .metrics import AsyncMetrics, Metrics
from .oauth import AsyncOauth, Oauth
from .oauth_apps import AsyncOauthApps, OauthApps
Expand Down Expand Up @@ -163,6 +164,8 @@
"Features": "features",
"AsyncInvoices": "invoices",
"Invoices": "invoices",
"AsyncLicenses": "licenses",
"Licenses": "licenses",
"AsyncMetrics": "metrics",
"Metrics": "metrics",
"AsyncOauth": "oauth",
Expand Down Expand Up @@ -317,6 +320,8 @@ def __dir__() -> list[str]:
"Features",
"AsyncInvoices",
"Invoices",
"AsyncLicenses",
"Licenses",
"AsyncMetrics",
"Metrics",
"AsyncOauth",
Expand Down
34 changes: 34 additions & 0 deletions meteroid/api/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,12 @@
Invoices,
InvoicesWithRawResponse,
)
from .licenses import (
AsyncLicenses,
AsyncLicensesWithRawResponse,
Licenses,
LicensesWithRawResponse,
)
from .metrics import (
AsyncMetrics,
AsyncMetricsWithRawResponse,
Expand Down Expand Up @@ -432,6 +438,13 @@ def invoices(self) -> Invoices:

return Invoices(self._cfg, self._httpx_client)

@functools.cached_property
def licenses(self) -> Licenses:
"""The licenses API."""
from .licenses import Licenses

return Licenses(self._cfg, self._httpx_client)

@functools.cached_property
def metrics(self) -> Metrics:
"""The metrics API."""
Expand Down Expand Up @@ -621,6 +634,13 @@ def invoices(self) -> InvoicesWithRawResponse:

return InvoicesWithRawResponse(self._client.invoices)

@property
def licenses(self) -> LicensesWithRawResponse:
"""The licenses API."""
from .licenses import LicensesWithRawResponse

return LicensesWithRawResponse(self._client.licenses)

@property
def metrics(self) -> MetricsWithRawResponse:
"""The metrics API."""
Expand Down Expand Up @@ -910,6 +930,13 @@ def invoices(self) -> AsyncInvoices:

return AsyncInvoices(self._cfg, self._httpx_client)

@functools.cached_property
def licenses(self) -> AsyncLicenses:
"""The licenses API."""
from .licenses import AsyncLicenses

return AsyncLicenses(self._cfg, self._httpx_client)

@functools.cached_property
def metrics(self) -> AsyncMetrics:
"""The metrics API."""
Expand Down Expand Up @@ -1099,6 +1126,13 @@ def invoices(self) -> AsyncInvoicesWithRawResponse:

return AsyncInvoicesWithRawResponse(self._client.invoices)

@property
def licenses(self) -> AsyncLicensesWithRawResponse:
"""The licenses API."""
from .licenses import AsyncLicensesWithRawResponse

return AsyncLicensesWithRawResponse(self._client.licenses)

@property
def metrics(self) -> AsyncMetricsWithRawResponse:
"""The metrics API."""
Expand Down
Loading
Loading