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
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.0.35"
}
8 changes: 4 additions & 4 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
config_hash: 7e9d4f2abf58b7918a0e103387d2a2e9
configured_endpoints: 191
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/frostedinc%2Fwhopsdk-97e920db587b07c064bef1bf31de5e110a3750ddfddc8fca26642e79e6b827f8.yml
openapi_spec_hash: 97ca16cc55271602443a4329d1e02895
config_hash: 1a836d20bb988f001cc66d1526f71306
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
# Changelog

## 0.0.35 (2026-03-18)

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

### 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))
* **api:** manual updates ([9506c84](https://github.com/whopio/whopsdk-python/commit/9506c84dd2836cf9b150e999840b79d82517046f))


### 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
51 changes: 50 additions & 1 deletion api.md
Original file line number Diff line number Diff line change
Expand Up @@ -849,7 +849,7 @@ Methods:
Types:

```python
from whop_sdk.types import AIChat, AIChatListResponse, AIChatDeleteResponse
from whop_sdk.types import AIChat, NotificationPreferences, AIChatListResponse, AIChatDeleteResponse
```

Methods:
Expand Down Expand Up @@ -921,3 +921,52 @@ from whop_sdk.types import PayoutAccountCalculatedStatuses, PayoutAccountRetriev
Methods:

- <code title="get /payout_accounts/{id}">client.payout_accounts.<a href="./src/whop_sdk/resources/payout_accounts.py">retrieve</a>(id) -> <a href="./src/whop_sdk/types/payout_account_retrieve_response.py">PayoutAccountRetrieveResponse</a></code>

# Affiliates

Types:

```python
from whop_sdk.types import (
Affiliate,
Status,
AffiliateListResponse,
AffiliateArchiveResponse,
AffiliateUnarchiveResponse,
)
```

Methods:

- <code title="post /affiliates">client.affiliates.<a href="./src/whop_sdk/resources/affiliates/affiliates.py">create</a>(\*\*<a href="src/whop_sdk/types/affiliate_create_params.py">params</a>) -> <a href="./src/whop_sdk/types/affiliate.py">Affiliate</a></code>
- <code title="get /affiliates/{id}">client.affiliates.<a href="./src/whop_sdk/resources/affiliates/affiliates.py">retrieve</a>(id) -> <a href="./src/whop_sdk/types/affiliate.py">Affiliate</a></code>
- <code title="get /affiliates">client.affiliates.<a href="./src/whop_sdk/resources/affiliates/affiliates.py">list</a>(\*\*<a href="src/whop_sdk/types/affiliate_list_params.py">params</a>) -> <a href="./src/whop_sdk/types/affiliate_list_response.py">SyncCursorPage[AffiliateListResponse]</a></code>
- <code title="post /affiliates/{id}/archive">client.affiliates.<a href="./src/whop_sdk/resources/affiliates/affiliates.py">archive</a>(id) -> <a href="./src/whop_sdk/types/affiliate_archive_response.py">AffiliateArchiveResponse</a></code>
- <code title="post /affiliates/{id}/unarchive">client.affiliates.<a href="./src/whop_sdk/resources/affiliates/affiliates.py">unarchive</a>(id) -> <a href="./src/whop_sdk/types/affiliate_unarchive_response.py">AffiliateUnarchiveResponse</a></code>

## Overrides

Types:

```python
from whop_sdk.types.affiliates import (
AffiliateAppliesToPayments,
AffiliateAppliesToProducts,
AffiliateOverrideRoles,
AffiliatePayoutTypes,
AffiliateRevenueBases,
OverrideCreateResponse,
OverrideRetrieveResponse,
OverrideUpdateResponse,
OverrideListResponse,
OverrideDeleteResponse,
)
```

Methods:

- <code title="post /affiliates/{id}/overrides">client.affiliates.overrides.<a href="./src/whop_sdk/resources/affiliates/overrides.py">create</a>(path_id, \*\*<a href="src/whop_sdk/types/affiliates/override_create_params.py">params</a>) -> <a href="./src/whop_sdk/types/affiliates/override_create_response.py">OverrideCreateResponse</a></code>
- <code title="get /affiliates/{id}/overrides/{override_id}">client.affiliates.overrides.<a href="./src/whop_sdk/resources/affiliates/overrides.py">retrieve</a>(override_id, \*, id) -> <a href="./src/whop_sdk/types/affiliates/override_retrieve_response.py">OverrideRetrieveResponse</a></code>
- <code title="patch /affiliates/{id}/overrides/{override_id}">client.affiliates.overrides.<a href="./src/whop_sdk/resources/affiliates/overrides.py">update</a>(override_id, \*, id, \*\*<a href="src/whop_sdk/types/affiliates/override_update_params.py">params</a>) -> <a href="./src/whop_sdk/types/affiliates/override_update_response.py">OverrideUpdateResponse</a></code>
- <code title="get /affiliates/{id}/overrides">client.affiliates.overrides.<a href="./src/whop_sdk/resources/affiliates/overrides.py">list</a>(id, \*\*<a href="src/whop_sdk/types/affiliates/override_list_params.py">params</a>) -> <a href="./src/whop_sdk/types/affiliates/override_list_response.py">SyncCursorPage[OverrideListResponse]</a></code>
- <code title="delete /affiliates/{id}/overrides/{override_id}">client.affiliates.overrides.<a href="./src/whop_sdk/resources/affiliates/overrides.py">delete</a>(override_id, \*, id) -> <a href="./src/whop_sdk/types/affiliates/override_delete_response.py">OverrideDeleteResponse</a></code>
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.0.35"
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
44 changes: 44 additions & 0 deletions src/whop_sdk/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
reactions,
shipments,
transfers,
affiliates,
app_builds,
dm_members,
dm_channels,
Expand Down Expand Up @@ -133,6 +134,7 @@
from .resources.payout_accounts import PayoutAccountsResource, AsyncPayoutAccountsResource
from .resources.authorized_users import AuthorizedUsersResource, AsyncAuthorizedUsersResource
from .resources.support_channels import SupportChannelsResource, AsyncSupportChannelsResource
from .resources.affiliates.affiliates import AffiliatesResource, AsyncAffiliatesResource
from .resources.checkout_configurations import CheckoutConfigurationsResource, AsyncCheckoutConfigurationsResource
from .resources.resolution_center_cases import ResolutionCenterCasesResource, AsyncResolutionCenterCasesResource
from .resources.company_token_transactions import (
Expand Down Expand Up @@ -531,6 +533,13 @@ def payout_accounts(self) -> PayoutAccountsResource:

return PayoutAccountsResource(self)

@cached_property
def affiliates(self) -> AffiliatesResource:
"""Affiliates"""
from .resources.affiliates import AffiliatesResource

return AffiliatesResource(self)

@cached_property
def with_raw_response(self) -> WhopWithRawResponse:
return WhopWithRawResponse(self)
Expand Down Expand Up @@ -1033,6 +1042,13 @@ def payout_accounts(self) -> AsyncPayoutAccountsResource:

return AsyncPayoutAccountsResource(self)

@cached_property
def affiliates(self) -> AsyncAffiliatesResource:
"""Affiliates"""
from .resources.affiliates import AsyncAffiliatesResource

return AsyncAffiliatesResource(self)

@cached_property
def with_raw_response(self) -> AsyncWhopWithRawResponse:
return AsyncWhopWithRawResponse(self)
Expand Down Expand Up @@ -1471,6 +1487,13 @@ def payout_accounts(self) -> payout_accounts.PayoutAccountsResourceWithRawRespon

return PayoutAccountsResourceWithRawResponse(self._client.payout_accounts)

@cached_property
def affiliates(self) -> affiliates.AffiliatesResourceWithRawResponse:
"""Affiliates"""
from .resources.affiliates import AffiliatesResourceWithRawResponse

return AffiliatesResourceWithRawResponse(self._client.affiliates)


class AsyncWhopWithRawResponse:
_client: AsyncWhop
Expand Down Expand Up @@ -1796,6 +1819,13 @@ def payout_accounts(self) -> payout_accounts.AsyncPayoutAccountsResourceWithRawR

return AsyncPayoutAccountsResourceWithRawResponse(self._client.payout_accounts)

@cached_property
def affiliates(self) -> affiliates.AsyncAffiliatesResourceWithRawResponse:
"""Affiliates"""
from .resources.affiliates import AsyncAffiliatesResourceWithRawResponse

return AsyncAffiliatesResourceWithRawResponse(self._client.affiliates)


class WhopWithStreamedResponse:
_client: Whop
Expand Down Expand Up @@ -2121,6 +2151,13 @@ def payout_accounts(self) -> payout_accounts.PayoutAccountsResourceWithStreaming

return PayoutAccountsResourceWithStreamingResponse(self._client.payout_accounts)

@cached_property
def affiliates(self) -> affiliates.AffiliatesResourceWithStreamingResponse:
"""Affiliates"""
from .resources.affiliates import AffiliatesResourceWithStreamingResponse

return AffiliatesResourceWithStreamingResponse(self._client.affiliates)


class AsyncWhopWithStreamedResponse:
_client: AsyncWhop
Expand Down Expand Up @@ -2450,6 +2487,13 @@ def payout_accounts(self) -> payout_accounts.AsyncPayoutAccountsResourceWithStre

return AsyncPayoutAccountsResourceWithStreamingResponse(self._client.payout_accounts)

@cached_property
def affiliates(self) -> affiliates.AsyncAffiliatesResourceWithStreamingResponse:
"""Affiliates"""
from .resources.affiliates import AsyncAffiliatesResourceWithStreamingResponse

return AsyncAffiliatesResourceWithStreamingResponse(self._client.affiliates)


Client = Whop

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.0.35" # x-release-please-version
14 changes: 14 additions & 0 deletions src/whop_sdk/resources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,14 @@
TransfersResourceWithStreamingResponse,
AsyncTransfersResourceWithStreamingResponse,
)
from .affiliates import (
AffiliatesResource,
AsyncAffiliatesResource,
AffiliatesResourceWithRawResponse,
AsyncAffiliatesResourceWithRawResponse,
AffiliatesResourceWithStreamingResponse,
AsyncAffiliatesResourceWithStreamingResponse,
)
from .app_builds import (
AppBuildsResource,
AsyncAppBuildsResource,
Expand Down Expand Up @@ -730,4 +738,10 @@
"AsyncPayoutAccountsResourceWithRawResponse",
"PayoutAccountsResourceWithStreamingResponse",
"AsyncPayoutAccountsResourceWithStreamingResponse",
"AffiliatesResource",
"AsyncAffiliatesResource",
"AffiliatesResourceWithRawResponse",
"AsyncAffiliatesResourceWithRawResponse",
"AffiliatesResourceWithStreamingResponse",
"AsyncAffiliatesResourceWithStreamingResponse",
]
33 changes: 33 additions & 0 deletions src/whop_sdk/resources/affiliates/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from .overrides import (
OverridesResource,
AsyncOverridesResource,
OverridesResourceWithRawResponse,
AsyncOverridesResourceWithRawResponse,
OverridesResourceWithStreamingResponse,
AsyncOverridesResourceWithStreamingResponse,
)
from .affiliates import (
AffiliatesResource,
AsyncAffiliatesResource,
AffiliatesResourceWithRawResponse,
AsyncAffiliatesResourceWithRawResponse,
AffiliatesResourceWithStreamingResponse,
AsyncAffiliatesResourceWithStreamingResponse,
)

__all__ = [
"OverridesResource",
"AsyncOverridesResource",
"OverridesResourceWithRawResponse",
"AsyncOverridesResourceWithRawResponse",
"OverridesResourceWithStreamingResponse",
"AsyncOverridesResourceWithStreamingResponse",
"AffiliatesResource",
"AsyncAffiliatesResource",
"AffiliatesResourceWithRawResponse",
"AsyncAffiliatesResourceWithRawResponse",
"AffiliatesResourceWithStreamingResponse",
"AsyncAffiliatesResourceWithStreamingResponse",
]
Loading