Skip to content
Open
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
14 changes: 8 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
name: CI
on:
push:
branches-ignore:
- 'generated'
- 'codegen/**'
- 'integrated/**'
- 'stl-preview-head/**'
- 'stl-preview-base/**'
branches:
- '**'
- '!integrated/**'
- '!stl-preview-head/**'
- '!stl-preview-base/**'
- '!generated'
- '!codegen/**'
- 'codegen/stl/**'
pull_request:
branches-ignore:
- 'stl-preview-head/**'
Expand Down
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.0.34"
".": "0.1.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 181
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/frostedinc%2Fwhopsdk-b6e1387ac58f903f887eae989de30273824663a9a752e7834b82b1036950c3d2.yml
openapi_spec_hash: 0bea29a304f3d57c44cc186478bef054
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/frostedinc%2Fwhopsdk-7f93e43332a2af6e92fec487446e4f8afef27be239763689838b85e0f2d64b5e.yml
openapi_spec_hash: 0240dc8a4d84e0941c2fa7f3e23a2038
config_hash: 7e9d4f2abf58b7918a0e103387d2a2e9
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# Changelog

## 0.1.0 (2026-03-16)

Full Changelog: [v0.0.34...v0.1.0](https://github.com/whopio/whopsdk-python/compare/v0.0.34...v0.1.0)

### Features

* **api:** api update ([8a74bd2](https://github.com/whopio/whopsdk-python/commit/8a74bd28a45ae766a17d696a405ec2dcd5f4918a))
* **api:** api update ([c9dd73f](https://github.com/whopio/whopsdk-python/commit/c9dd73fece709c673b37575a2e1e82ca9643f7d9))
* **api:** api update ([41811c0](https://github.com/whopio/whopsdk-python/commit/41811c0aec1d7d07b0e7450c810a2b2e5ca03fcb))


### Bug Fixes

* **deps:** bump minimum typing-extensions version ([52face0](https://github.com/whopio/whopsdk-python/commit/52face04bba526f4c009caa1dcc390d84da60840))
* **pydantic:** do not pass `by_alias` unless set ([23cb493](https://github.com/whopio/whopsdk-python/commit/23cb4936ab4f00829d98f0a910e26f2ae26e5398))


### Chores

* **internal:** tweak CI branches ([ca6b4cd](https://github.com/whopio/whopsdk-python/commit/ca6b4cd8b46e7de115b37c833da3c40f87ca779a))

## 0.0.34 (2026-03-13)

Full Changelog: [v0.0.33...v0.0.34](https://github.com/whopio/whopsdk-python/compare/v0.0.33...v0.0.34)
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "whop-sdk"
version = "0.0.34"
version = "0.1.0"
description = "The official Python library for the Whop API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand All @@ -11,7 +11,7 @@ authors = [
dependencies = [
"httpx>=0.23.0, <1",
"pydantic>=1.9.0, <3",
"typing-extensions>=4.10, <5",
"typing-extensions>=4.14, <5",
"anyio>=3.5.0, <5",
"distro>=1.7.0, <2",
"sniffio",
Expand Down
11 changes: 9 additions & 2 deletions src/whop_sdk/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from typing import TYPE_CHECKING, Any, Union, Generic, TypeVar, Callable, cast, overload
from datetime import date, datetime
from typing_extensions import Self, Literal
from typing_extensions import Self, Literal, TypedDict

import pydantic
from pydantic.fields import FieldInfo
Expand Down Expand Up @@ -131,6 +131,10 @@ def model_json(model: pydantic.BaseModel, *, indent: int | None = None) -> str:
return model.model_dump_json(indent=indent)


class _ModelDumpKwargs(TypedDict, total=False):
by_alias: bool


def model_dump(
model: pydantic.BaseModel,
*,
Expand All @@ -142,14 +146,17 @@ def model_dump(
by_alias: bool | None = None,
) -> dict[str, Any]:
if (not PYDANTIC_V1) or hasattr(model, "model_dump"):
kwargs: _ModelDumpKwargs = {}
if by_alias is not None:
kwargs["by_alias"] = by_alias
return model.model_dump(
mode=mode,
exclude=exclude,
exclude_unset=exclude_unset,
exclude_defaults=exclude_defaults,
# warnings are not supported in Pydantic v1
warnings=True if PYDANTIC_V1 else warnings,
by_alias=by_alias,
**kwargs,
)
return cast(
"dict[str, Any]",
Expand Down
2 changes: 1 addition & 1 deletion src/whop_sdk/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "whop_sdk"
__version__ = "0.0.34" # x-release-please-version
__version__ = "0.1.0" # x-release-please-version
14 changes: 12 additions & 2 deletions src/whop_sdk/resources/ai_chats.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ def update(
id: str,
*,
current_company_id: Optional[str] | Omit = omit,
notification_preference: Optional[Literal["all", "none"]] | Omit = omit,
title: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
Expand All @@ -155,7 +156,8 @@ def update(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> AIChat:
"""
Update an AI chat's title or associated company context.
Update an AI chat's title, notification preferences, or associated company
context.

Required permissions:

Expand All @@ -165,6 +167,8 @@ def update(
current_company_id: The unique identifier of the company to set as context for the AI chat (e.g.,
"biz_XXXXX").

notification_preference: The notification preference for an AI chat

title: The new display title for the AI chat thread (e.g., "Help with billing").

extra_headers: Send extra headers
Expand All @@ -182,6 +186,7 @@ def update(
body=maybe_transform(
{
"current_company_id": current_company_id,
"notification_preference": notification_preference,
"title": title,
},
ai_chat_update_params.AIChatUpdateParams,
Expand Down Expand Up @@ -408,6 +413,7 @@ async def update(
id: str,
*,
current_company_id: Optional[str] | Omit = omit,
notification_preference: Optional[Literal["all", "none"]] | Omit = omit,
title: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
Expand All @@ -417,7 +423,8 @@ async def update(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> AIChat:
"""
Update an AI chat's title or associated company context.
Update an AI chat's title, notification preferences, or associated company
context.

Required permissions:

Expand All @@ -427,6 +434,8 @@ async def update(
current_company_id: The unique identifier of the company to set as context for the AI chat (e.g.,
"biz_XXXXX").

notification_preference: The notification preference for an AI chat

title: The new display title for the AI chat thread (e.g., "Help with billing").

extra_headers: Send extra headers
Expand All @@ -444,6 +453,7 @@ async def update(
body=await async_maybe_transform(
{
"current_company_id": current_company_id,
"notification_preference": notification_preference,
"title": title,
},
ai_chat_update_params.AIChatUpdateParams,
Expand Down
7 changes: 7 additions & 0 deletions src/whop_sdk/types/ai_chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from typing import Optional
from datetime import datetime
from typing_extensions import Literal

from .._models import BaseModel

Expand Down Expand Up @@ -38,6 +39,12 @@ class AIChat(BaseModel):
message_count: int
"""The total number of messages exchanged in this conversation."""

notification_preference: Literal["all", "none"]
"""The notification preference for this AI chat.

`all` delivers AI chat notifications and badges, while `none` mutes them.
"""

title: Optional[str] = None
"""A short descriptive title for this AI chat conversation.

Expand Down
7 changes: 7 additions & 0 deletions src/whop_sdk/types/ai_chat_list_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from typing import Optional
from datetime import datetime
from typing_extensions import Literal

from .._models import BaseModel

Expand Down Expand Up @@ -38,6 +39,12 @@ class AIChatListResponse(BaseModel):
message_count: int
"""The total number of messages exchanged in this conversation."""

notification_preference: Literal["all", "none"]
"""The notification preference for this AI chat.

`all` delivers AI chat notifications and badges, while `none` mutes them.
"""

title: Optional[str] = None
"""A short descriptive title for this AI chat conversation.

Expand Down
5 changes: 4 additions & 1 deletion src/whop_sdk/types/ai_chat_update_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from __future__ import annotations

from typing import Optional
from typing_extensions import TypedDict
from typing_extensions import Literal, TypedDict

__all__ = ["AIChatUpdateParams"]

Expand All @@ -15,5 +15,8 @@ class AIChatUpdateParams(TypedDict, total=False):
"biz_XXXXX").
"""

notification_preference: Optional[Literal["all", "none"]]
"""The notification preference for an AI chat"""

title: Optional[str]
"""The new display title for the AI chat thread (e.g., "Help with billing")."""
1 change: 1 addition & 0 deletions src/whop_sdk/types/card_brands.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,6 @@
"codensa",
"cabal",
"hipercard",
"jcblankapay",
"unknown",
]
29 changes: 29 additions & 0 deletions src/whop_sdk/types/setup_intent.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"MemberUser",
"PaymentMethod",
"PaymentMethodCard",
"PaymentMethodMailingAddress",
]


Expand Down Expand Up @@ -89,6 +90,31 @@ class PaymentMethodCard(BaseModel):
"""The last four digits of the card number. Null if not available."""


class PaymentMethodMailingAddress(BaseModel):
"""The mailing address associated with the payment method's user"""

city: Optional[str] = None
"""The city of the address."""

country: Optional[str] = None
"""The country of the address."""

line1: Optional[str] = None
"""The line 1 of the address."""

line2: Optional[str] = None
"""The line 2 of the address."""

name: Optional[str] = None
"""The name of the customer."""

postal_code: Optional[str] = None
"""The postal code of the address."""

state: Optional[str] = None
"""The state of the address."""


class PaymentMethod(BaseModel):
"""The saved payment method created by this setup intent.

Expand All @@ -106,6 +132,9 @@ class PaymentMethod(BaseModel):
created_at: datetime
"""The datetime the payment token was created."""

mailing_address: Optional[PaymentMethodMailingAddress] = None
"""The mailing address associated with the payment method's user"""

payment_method_type: PaymentMethodTypes
"""The payment method type of the payment method"""

Expand Down
29 changes: 29 additions & 0 deletions src/whop_sdk/types/setup_intent_list_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"MemberUser",
"PaymentMethod",
"PaymentMethodCard",
"PaymentMethodMailingAddress",
]


Expand Down Expand Up @@ -89,6 +90,31 @@ class PaymentMethodCard(BaseModel):
"""The last four digits of the card number. Null if not available."""


class PaymentMethodMailingAddress(BaseModel):
"""The mailing address associated with the payment method's user"""

city: Optional[str] = None
"""The city of the address."""

country: Optional[str] = None
"""The country of the address."""

line1: Optional[str] = None
"""The line 1 of the address."""

line2: Optional[str] = None
"""The line 2 of the address."""

name: Optional[str] = None
"""The name of the customer."""

postal_code: Optional[str] = None
"""The postal code of the address."""

state: Optional[str] = None
"""The state of the address."""


class PaymentMethod(BaseModel):
"""The saved payment method created by this setup intent.

Expand All @@ -106,6 +132,9 @@ class PaymentMethod(BaseModel):
created_at: datetime
"""The datetime the payment token was created."""

mailing_address: Optional[PaymentMethodMailingAddress] = None
"""The mailing address associated with the payment method's user"""

payment_method_type: PaymentMethodTypes
"""The payment method type of the payment method"""

Expand Down
1 change: 1 addition & 0 deletions src/whop_sdk/types/shared/payment.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ class FinancingTransaction(BaseModel):
"cancel",
"verify",
"chargeback",
"pre_chargeback",
"three_d_secure",
"fraud_screening",
"authorization",
Expand Down
2 changes: 2 additions & 0 deletions tests/api_resources/test_ai_chats.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ def test_method_update_with_all_params(self, client: Whop) -> None:
ai_chat = client.ai_chats.update(
id="aich_xxxxxxxxxxxxx",
current_company_id="current_company_id",
notification_preference="all",
title="title",
)
assert_matches_type(AIChat, ai_chat, path=["response"])
Expand Down Expand Up @@ -352,6 +353,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncWhop) -> N
ai_chat = await async_client.ai_chats.update(
id="aich_xxxxxxxxxxxxx",
current_company_id="current_company_id",
notification_preference="all",
title="title",
)
assert_matches_type(AIChat, ai_chat, path=["response"])
Expand Down