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
2 changes: 1 addition & 1 deletion scripts/mock

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions src/dodopayments/resources/addons.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ def update(

description: Description of the Addon, optional and must be at most 1000 characters.

image_id: Addon image id after its uploaded to S3
image_id: Addon image id after its uploaded to S3. Pass `null` to remove the existing
image, omit to keep it unchanged.

name: Name of the Addon, optional and must be at most 100 characters.

Expand Down Expand Up @@ -395,7 +396,8 @@ async def update(

description: Description of the Addon, optional and must be at most 1000 characters.

image_id: Addon image id after its uploaded to S3
image_id: Addon image id after its uploaded to S3. Pass `null` to remove the existing
image, omit to keep it unchanged.

name: Name of the Addon, optional and must be at most 100 characters.

Expand Down
28 changes: 28 additions & 0 deletions src/dodopayments/resources/subscriptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

from ..types import (
Currency,
TimeInterval,
SubscriptionStatus,
CancellationFeedback,
subscription_list_params,
Expand All @@ -36,6 +37,7 @@
from .._base_client import AsyncPaginator, make_request_options
from ..types.currency import Currency
from ..types.subscription import Subscription
from ..types.time_interval import TimeInterval
from ..types.metadata_param import MetadataParam
from ..types.attach_addon_param import AttachAddonParam
from ..types.subscription_status import SubscriptionStatus
Expand Down Expand Up @@ -277,6 +279,8 @@ def update(
metadata: Optional[MetadataParam] | Omit = omit,
next_billing_date: Union[str, datetime, None] | Omit = omit,
status: Optional[SubscriptionStatus] | Omit = omit,
subscription_period_count: Optional[int] | Omit = omit,
subscription_period_interval: Optional[TimeInterval] | Omit = omit,
tax_id: 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 Down Expand Up @@ -304,6 +308,15 @@ def update(

metadata: Arbitrary key-value metadata. Values can be string, integer, number, or boolean.

subscription_period_count: New number of `subscription_period_interval` units the subscription entitlement
should span. Used together with `subscription_period_interval` to extend the
subscription period. The resulting period must not be shorter than the current
one (this endpoint only extends).

subscription_period_interval: New interval unit for the subscription period. When changing the period, this
may be supplied alongside `subscription_period_count`; if omitted the existing
interval is retained.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request
Expand All @@ -330,6 +343,8 @@ def update(
"metadata": metadata,
"next_billing_date": next_billing_date,
"status": status,
"subscription_period_count": subscription_period_count,
"subscription_period_interval": subscription_period_interval,
"tax_id": tax_id,
},
subscription_update_params.SubscriptionUpdateParams,
Expand Down Expand Up @@ -1088,6 +1103,8 @@ async def update(
metadata: Optional[MetadataParam] | Omit = omit,
next_billing_date: Union[str, datetime, None] | Omit = omit,
status: Optional[SubscriptionStatus] | Omit = omit,
subscription_period_count: Optional[int] | Omit = omit,
subscription_period_interval: Optional[TimeInterval] | Omit = omit,
tax_id: 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 Down Expand Up @@ -1115,6 +1132,15 @@ async def update(

metadata: Arbitrary key-value metadata. Values can be string, integer, number, or boolean.

subscription_period_count: New number of `subscription_period_interval` units the subscription entitlement
should span. Used together with `subscription_period_interval` to extend the
subscription period. The resulting period must not be shorter than the current
one (this endpoint only extends).

subscription_period_interval: New interval unit for the subscription period. When changing the period, this
may be supplied alongside `subscription_period_count`; if omitted the existing
interval is retained.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request
Expand All @@ -1141,6 +1167,8 @@ async def update(
"metadata": metadata,
"next_billing_date": next_billing_date,
"status": status,
"subscription_period_count": subscription_period_count,
"subscription_period_interval": subscription_period_interval,
"tax_id": tax_id,
},
subscription_update_params.SubscriptionUpdateParams,
Expand Down
5 changes: 4 additions & 1 deletion src/dodopayments/types/addon_update_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ class AddonUpdateParams(TypedDict, total=False):
"""Description of the Addon, optional and must be at most 1000 characters."""

image_id: Optional[str]
"""Addon image id after its uploaded to S3"""
"""
Addon image id after its uploaded to S3. Pass `null` to remove the existing
image, omit to keep it unchanged.
"""

name: Optional[str]
"""Name of the Addon, optional and must be at most 100 characters."""
Expand Down
15 changes: 15 additions & 0 deletions src/dodopayments/types/subscription_update_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,21 @@ class SubscriptionUpdateParams(TypedDict, total=False):

status: Optional[SubscriptionStatus]

subscription_period_count: Optional[int]
"""
New number of `subscription_period_interval` units the subscription entitlement
should span. Used together with `subscription_period_interval` to extend the
subscription period. The resulting period must not be shorter than the current
one (this endpoint only extends).
"""

subscription_period_interval: Optional[TimeInterval]
"""New interval unit for the subscription period.

When changing the period, this may be supplied alongside
`subscription_period_count`; if omitted the existing interval is retained.
"""

tax_id: Optional[str]


Expand Down
4 changes: 4 additions & 0 deletions tests/api_resources/test_subscriptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,8 @@ def test_method_update_with_all_params(self, client: DodoPayments) -> None:
metadata={"foo": "string"},
next_billing_date=parse_datetime("2019-12-27T18:11:19.117Z"),
status="pending",
subscription_period_count=0,
subscription_period_interval="Day",
tax_id="tax_id",
)
assert_matches_type(Subscription, subscription, path=["response"])
Expand Down Expand Up @@ -864,6 +866,8 @@ async def test_method_update_with_all_params(self, async_client: AsyncDodoPaymen
metadata={"foo": "string"},
next_billing_date=parse_datetime("2019-12-27T18:11:19.117Z"),
status="pending",
subscription_period_count=0,
subscription_period_interval="Day",
tax_id="tax_id",
)
assert_matches_type(Subscription, subscription, path=["response"])
Expand Down