Spaces:
Running on T4
Running on T4
Download backend/app/modules/billing/schemas.py from modventures/baseball-engine: direct link, hf CLI and curl.
- Browser
- Download file 1.12 kB
-
https://huggingface.co/spaces/modventures/baseball-engine/resolve/main/backend/app/modules/billing/schemas.py
- Command line
-
hf download hf://spaces/modventures/baseball-engine/backend/app/modules/billing/schemas.py
-
curl -L -o schemas.py https://huggingface.co/spaces/modventures/baseball-engine/resolve/main/backend/app/modules/billing/schemas.py
1.12 kB
| """Billing request and response bodies. Webhook bodies are the stores' own shapes, so they ignore unknown fields.""" | |
| from typing import Literal | |
| from pydantic import ConfigDict, Field | |
| from app.common.schemas import RequestModel, ResponseModel | |
| from app.modules.billing.entitlement import Entitlement | |
| class ReceiptIn(RequestModel): | |
| platform: Literal["ios", "android"] | |
| product_id: str = Field(min_length=1, max_length=64) | |
| signed_transaction: str | None = Field(default=None, max_length=32_000) | |
| purchase_token: str | None = Field(default=None, max_length=4_096) | |
| class ReceiptOut(ResponseModel): | |
| entitlement: Entitlement | |
| class AppleWebhookIn(RequestModel): | |
| model_config = ConfigDict(extra="ignore", populate_by_name=True) | |
| signed_payload: str = Field(alias="signedPayload", max_length=200_000) | |
| class PubSubMessage(RequestModel): | |
| model_config = ConfigDict(extra="ignore") | |
| data: str = Field(default="", max_length=100_000) | |
| class PubSubPushIn(RequestModel): | |
| model_config = ConfigDict(extra="ignore") | |
| message: PubSubMessage | |
| class WebhookAck(ResponseModel): | |
| pass | |