diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eefc48e..7234cce 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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/**' diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 09a565d..3d2ac0b 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.0.34" + ".": "0.1.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index d46615a..aaf77fe 100644 --- a/.stats.yml +++ b/.stats.yml @@ -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 diff --git a/CHANGELOG.md b/CHANGELOG.md index 763b2f1..0ea3e09 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/pyproject.toml b/pyproject.toml index 6d34f6e..7774c89 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" @@ -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", diff --git a/src/whop_sdk/_compat.py b/src/whop_sdk/_compat.py index 786ff42..e6690a4 100644 --- a/src/whop_sdk/_compat.py +++ b/src/whop_sdk/_compat.py @@ -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 @@ -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, *, @@ -142,6 +146,9 @@ 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, @@ -149,7 +156,7 @@ def model_dump( 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]", diff --git a/src/whop_sdk/_version.py b/src/whop_sdk/_version.py index 75c990c..162053b 100644 --- a/src/whop_sdk/_version.py +++ b/src/whop_sdk/_version.py @@ -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 diff --git a/src/whop_sdk/resources/ai_chats.py b/src/whop_sdk/resources/ai_chats.py index 4eff698..ef15a86 100644 --- a/src/whop_sdk/resources/ai_chats.py +++ b/src/whop_sdk/resources/ai_chats.py @@ -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. @@ -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: @@ -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 @@ -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, @@ -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. @@ -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: @@ -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 @@ -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, diff --git a/src/whop_sdk/types/ai_chat.py b/src/whop_sdk/types/ai_chat.py index 2ddbc6e..87c8d48 100644 --- a/src/whop_sdk/types/ai_chat.py +++ b/src/whop_sdk/types/ai_chat.py @@ -2,6 +2,7 @@ from typing import Optional from datetime import datetime +from typing_extensions import Literal from .._models import BaseModel @@ -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. diff --git a/src/whop_sdk/types/ai_chat_list_response.py b/src/whop_sdk/types/ai_chat_list_response.py index af211b4..dbee060 100644 --- a/src/whop_sdk/types/ai_chat_list_response.py +++ b/src/whop_sdk/types/ai_chat_list_response.py @@ -2,6 +2,7 @@ from typing import Optional from datetime import datetime +from typing_extensions import Literal from .._models import BaseModel @@ -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. diff --git a/src/whop_sdk/types/ai_chat_update_params.py b/src/whop_sdk/types/ai_chat_update_params.py index f3fc9bc..e6b9c52 100644 --- a/src/whop_sdk/types/ai_chat_update_params.py +++ b/src/whop_sdk/types/ai_chat_update_params.py @@ -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"] @@ -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").""" diff --git a/src/whop_sdk/types/card_brands.py b/src/whop_sdk/types/card_brands.py index 9d8c7c1..1243eea 100644 --- a/src/whop_sdk/types/card_brands.py +++ b/src/whop_sdk/types/card_brands.py @@ -42,5 +42,6 @@ "codensa", "cabal", "hipercard", + "jcblankapay", "unknown", ] diff --git a/src/whop_sdk/types/setup_intent.py b/src/whop_sdk/types/setup_intent.py index 6c3f3ac..a79a2b7 100644 --- a/src/whop_sdk/types/setup_intent.py +++ b/src/whop_sdk/types/setup_intent.py @@ -16,6 +16,7 @@ "MemberUser", "PaymentMethod", "PaymentMethodCard", + "PaymentMethodMailingAddress", ] @@ -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. @@ -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""" diff --git a/src/whop_sdk/types/setup_intent_list_response.py b/src/whop_sdk/types/setup_intent_list_response.py index cd30204..93d409a 100644 --- a/src/whop_sdk/types/setup_intent_list_response.py +++ b/src/whop_sdk/types/setup_intent_list_response.py @@ -16,6 +16,7 @@ "MemberUser", "PaymentMethod", "PaymentMethodCard", + "PaymentMethodMailingAddress", ] @@ -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. @@ -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""" diff --git a/src/whop_sdk/types/shared/payment.py b/src/whop_sdk/types/shared/payment.py index c9403c4..009f035 100644 --- a/src/whop_sdk/types/shared/payment.py +++ b/src/whop_sdk/types/shared/payment.py @@ -166,6 +166,7 @@ class FinancingTransaction(BaseModel): "cancel", "verify", "chargeback", + "pre_chargeback", "three_d_secure", "fraud_screening", "authorization", diff --git a/tests/api_resources/test_ai_chats.py b/tests/api_resources/test_ai_chats.py index 6de8558..d4d6bc2 100644 --- a/tests/api_resources/test_ai_chats.py +++ b/tests/api_resources/test_ai_chats.py @@ -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"]) @@ -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"])