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
73 changes: 31 additions & 42 deletions .speakeasy/gen.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ generation:
generateNewTests: false
skipResponseBodyAssertions: false
python:
version: 0.22.7
version: 0.22.8
additionalDependencies:
dev:
pydantic-ai-slim: ^0.1.0
Expand Down
14 changes: 7 additions & 7 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
speakeasyVersion: 1.606.0
speakeasyVersion: 1.606.2
sources:
Polar-OAS:
sourceNamespace: polar-oas
sourceRevisionDigest: sha256:578ba1afc4207ccf7da46db9a2929f5cd30b4c38fa9dd42ace32bff88ab423f9
sourceBlobDigest: sha256:d9756d2aba3459fc339415043d8b72eb3dbfeccc9119058a625d61c7f5a9c3df
sourceRevisionDigest: sha256:13cfadb3890dcd4c14b2ef1f6b6442c71c72d76225592cf5aae0f3470b6f330f
sourceBlobDigest: sha256:384012381fe854ee1c2472895c5b5fbbb8bf1e4f5319cc1f97850489c8a3ab78
tags:
- latest
- speakeasy-sdk-regen-1755044075
- speakeasy-sdk-regen-1755735150
- 0.1.0
targets:
polar:
source: Polar-OAS
sourceNamespace: polar-oas
sourceRevisionDigest: sha256:578ba1afc4207ccf7da46db9a2929f5cd30b4c38fa9dd42ace32bff88ab423f9
sourceBlobDigest: sha256:d9756d2aba3459fc339415043d8b72eb3dbfeccc9119058a625d61c7f5a9c3df
sourceRevisionDigest: sha256:13cfadb3890dcd4c14b2ef1f6b6442c71c72d76225592cf5aae0f3470b6f330f
sourceBlobDigest: sha256:384012381fe854ee1c2472895c5b5fbbb8bf1e4f5319cc1f97850489c8a3ab78
codeSamplesNamespace: polar-oas-py-code-samples
codeSamplesRevisionDigest: sha256:2ec4d204f97e8e12ba3d3782113d8301cdc963de8e5ab876b6d49b6a4a4a15a0
codeSamplesRevisionDigest: sha256:6a377b7edae82a765088813beb3fa7855e1876d4025df471e5a93f6f7b1f427c
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest
Expand Down
12 changes: 11 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -863,4 +863,14 @@ Based on:
### Generated
- [python v0.22.7] .
### Releases
- [PyPI v0.22.7] https://pypi.org/project/polar-sdk/0.22.7 - .
- [PyPI v0.22.7] https://pypi.org/project/polar-sdk/0.22.7 - .

## 2025-08-22 12:35:22
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.606.2 (2.687.1) https://github.com/speakeasy-api/speakeasy
### Generated
- [python v0.22.8] .
### Releases
- [PyPI v0.22.8] https://pypi.org/project/polar-sdk/0.22.8 - .
8 changes: 4 additions & 4 deletions codeSamples.yaml

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions docs/models/aggregation.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,9 @@ value: models.PropertyAggregation = /* values here */
value: models.PropertyAggregation = /* values here */
```

### `models.UniqueAggregation`

```python
value: models.UniqueAggregation = /* values here */
```

5 changes: 3 additions & 2 deletions docs/models/customerorderconfirmpayment.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# CustomerOrderConfirmPayment

Schema to confirm a retry payment using a Stripe confirmation token.
Schema to confirm a retry payment using either a saved payment method or a new confirmation token.


## Fields

| Field | Type | Required | Description |
| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ |
| `confirmation_token_id` | *str* | :heavy_check_mark: | ID of the Stripe confirmation token. |
| `confirmation_token_id` | *OptionalNullable[str]* | :heavy_minus_sign: | ID of the Stripe confirmation token for new payment methods. |
| `payment_method_id` | *OptionalNullable[str]* | :heavy_minus_sign: | ID of an existing saved payment method. |
| `payment_processor` | [Optional[models.PaymentProcessor]](../models/paymentprocessor.md) | :heavy_minus_sign: | N/A |
1 change: 1 addition & 0 deletions docs/models/customerportalcustomer.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
| `email` | *str* | :heavy_check_mark: | N/A | |
| `email_verified` | *bool* | :heavy_check_mark: | N/A | |
| `name` | *Nullable[str]* | :heavy_check_mark: | N/A | |
| `billing_name` | *Nullable[str]* | :heavy_check_mark: | N/A | |
| `billing_address` | [Nullable[models.Address]](../models/address.md) | :heavy_check_mark: | N/A | |
| `tax_id` | List[[Nullable[models.CustomerPortalCustomerTaxID]](../models/customerportalcustomertaxid.md)] | :heavy_check_mark: | N/A | [<br/>"911144442",<br/>"us_ein"<br/>] |
| `oauth_accounts` | Dict[str, [models.CustomerPortalOAuthAccount](../models/customerportaloauthaccount.md)] | :heavy_check_mark: | N/A | |
Expand Down
3 changes: 1 addition & 2 deletions docs/models/customerportalcustomerupdate.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

| Field | Type | Required | Description |
| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- |
| `email` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
| `billing_name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
| `billing_address` | [OptionalNullable[models.Address]](../models/address.md) | :heavy_minus_sign: | N/A |
| `tax_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
6 changes: 6 additions & 0 deletions docs/models/meteraggregation.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,9 @@ value: models.PropertyAggregation = /* values here */
value: models.PropertyAggregation = /* values here */
```

### `models.UniqueAggregation`

```python
value: models.UniqueAggregation = /* values here */
```

6 changes: 6 additions & 0 deletions docs/models/metercreateaggregation.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,9 @@ value: models.PropertyAggregation = /* values here */
value: models.PropertyAggregation = /* values here */
```

### `models.UniqueAggregation`

```python
value: models.UniqueAggregation = /* values here */
```

1 change: 1 addition & 0 deletions docs/models/organization.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
| `email` | *Nullable[str]* | :heavy_check_mark: | Public support email. | |
| `website` | *Nullable[str]* | :heavy_check_mark: | Official website of the organization. | |
| `socials` | List[[models.OrganizationSocialLink](../models/organizationsociallink.md)] | :heavy_check_mark: | Links to social profiles. | |
| `status` | [models.Status](../models/status.md) | :heavy_check_mark: | N/A | |
| `details_submitted_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | When the business details were submitted. | |
| `feature_settings` | [Nullable[models.OrganizationFeatureSettings]](../models/organizationfeaturesettings.md) | :heavy_check_mark: | Organization feature settings | |
| `subscription_settings` | [models.OrganizationSubscriptionSettings](../models/organizationsubscriptionsettings.md) | :heavy_check_mark: | N/A | |
Expand Down
12 changes: 12 additions & 0 deletions docs/models/status.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Status


## Values

| Name | Value |
| -------------------- | -------------------- |
| `CREATED` | created |
| `ONBOARDING_STARTED` | onboarding_started |
| `UNDER_REVIEW` | under_review |
| `DENIED` | denied |
| `ACTIVE` | active |
9 changes: 9 additions & 0 deletions docs/models/uniqueaggregation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# UniqueAggregation


## Fields

| Field | Type | Required | Description |
| ----------------------------- | ----------------------------- | ----------------------------- | ----------------------------- |
| `func` | *Optional[Literal["unique"]]* | :heavy_minus_sign: | N/A |
| `property` | *str* | :heavy_check_mark: | N/A |
4 changes: 1 addition & 3 deletions docs/sdks/polarorders/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,7 @@ with Polar() as polar:

res = polar.customer_portal.orders.confirm_retry_payment(security=polar_sdk.CustomerPortalOrdersConfirmRetryPaymentSecurity(
customer_session="<YOUR_BEARER_TOKEN_HERE>",
), id="<value>", customer_order_confirm_payment={
"confirmation_token_id": "<id>",
})
), id="<value>", customer_order_confirm_payment={})

# Handle response
print(res)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

[project]
name = "polar-sdk"
version = "0.22.7"
version = "0.22.8"
description = "Polar SDK for Python"
authors = [{ name = "Polar" },]
readme = "README-PYPI.md"
Expand Down
6 changes: 3 additions & 3 deletions src/polar_sdk/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import importlib.metadata

__title__: str = "polar-sdk"
__version__: str = "0.22.7"
__version__: str = "0.22.8"
__openapi_doc_version__: str = "0.1.0"
__gen_version__: str = "2.686.7"
__user_agent__: str = "speakeasy-sdk/python 0.22.7 2.686.7 0.1.0 polar-sdk"
__gen_version__: str = "2.687.1"
__user_agent__: str = "speakeasy-sdk/python 0.22.8 2.687.1 0.1.0 polar-sdk"

try:
if __package__ is not None:
Expand Down
8 changes: 8 additions & 0 deletions src/polar_sdk/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1987,6 +1987,7 @@
from .scope import Scope
from .sdkerror import SDKError
from .security import Security, SecurityTypedDict
from .status import Status
from .subscription import (
CustomFieldData,
CustomFieldDataTypedDict,
Expand Down Expand Up @@ -2131,6 +2132,7 @@
from .timeinterval import TimeInterval
from .tokenresponse import TokenResponse, TokenResponseTypedDict
from .unauthorized import Unauthorized, UnauthorizedData
from .uniqueaggregation import UniqueAggregation, UniqueAggregationTypedDict
from .userevent import (
UserEvent,
UserEventMetadata,
Expand Down Expand Up @@ -3839,6 +3841,7 @@
"SecurityTypedDict",
"SourceFilter",
"SourceFilterTypedDict",
"Status",
"StatusFilter",
"StatusFilterTypedDict",
"SubType",
Expand Down Expand Up @@ -3898,6 +3901,8 @@
"TokenTypeHint",
"Unauthorized",
"UnauthorizedData",
"UniqueAggregation",
"UniqueAggregationTypedDict",
"UnitAmount",
"UnitAmountTypedDict",
"UserEvent",
Expand Down Expand Up @@ -5450,6 +5455,7 @@
"SDKError": ".sdkerror",
"Security": ".security",
"SecurityTypedDict": ".security",
"Status": ".status",
"CustomFieldData": ".subscription",
"CustomFieldDataTypedDict": ".subscription",
"Metadata": ".subscription",
Expand Down Expand Up @@ -5583,6 +5589,8 @@
"TokenResponseTypedDict": ".tokenresponse",
"Unauthorized": ".unauthorized",
"UnauthorizedData": ".unauthorized",
"UniqueAggregation": ".uniqueaggregation",
"UniqueAggregationTypedDict": ".uniqueaggregation",
"UserEvent": ".userevent",
"UserEventMetadata": ".userevent",
"UserEventMetadataTypedDict": ".userevent",
Expand Down
54 changes: 47 additions & 7 deletions src/polar_sdk/models/customerorderconfirmpayment.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,63 @@

from __future__ import annotations
from .paymentprocessor import PaymentProcessor
from polar_sdk.types import BaseModel
from polar_sdk.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
from pydantic import model_serializer
from typing import Optional
from typing_extensions import NotRequired, TypedDict


class CustomerOrderConfirmPaymentTypedDict(TypedDict):
r"""Schema to confirm a retry payment using a Stripe confirmation token."""
r"""Schema to confirm a retry payment using either a saved payment method or a new confirmation token."""

confirmation_token_id: str
r"""ID of the Stripe confirmation token."""
confirmation_token_id: NotRequired[Nullable[str]]
r"""ID of the Stripe confirmation token for new payment methods."""
payment_method_id: NotRequired[Nullable[str]]
r"""ID of an existing saved payment method."""
payment_processor: NotRequired[PaymentProcessor]


class CustomerOrderConfirmPayment(BaseModel):
r"""Schema to confirm a retry payment using a Stripe confirmation token."""
r"""Schema to confirm a retry payment using either a saved payment method or a new confirmation token."""

confirmation_token_id: str
r"""ID of the Stripe confirmation token."""
confirmation_token_id: OptionalNullable[str] = UNSET
r"""ID of the Stripe confirmation token for new payment methods."""

payment_method_id: OptionalNullable[str] = UNSET
r"""ID of an existing saved payment method."""

payment_processor: Optional[PaymentProcessor] = None

@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = [
"confirmation_token_id",
"payment_method_id",
"payment_processor",
]
nullable_fields = ["confirmation_token_id", "payment_method_id"]
null_default_fields = []

serialized = handler(self)

m = {}

for n, f in type(self).model_fields.items():
k = f.alias or n
val = serialized.get(k)
serialized.pop(k, None)

optional_nullable = k in optional_fields and k in nullable_fields
is_set = (
self.__pydantic_fields_set__.intersection({n})
or k in null_default_fields
) # pylint: disable=no-member

if val is not None and val != UNSET_SENTINEL:
m[k] = val
elif val != UNSET_SENTINEL and (
not k in optional_fields or (optional_nullable and is_set)
):
m[k] = val

return m
Loading