Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update generated code #1317

Merged
merged 11 commits into from May 2, 2024
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
@@ -1 +1 @@
v992
v1008
3 changes: 3 additions & 0 deletions stripe/_charge.py
Expand Up @@ -1300,6 +1300,9 @@ class Card(StripeObject):
"""

card: Optional[Card]
"""
Internal card details
"""
_inner_class_types = {"card": Card}

class Multibanco(StripeObject):
Expand Down
15 changes: 13 additions & 2 deletions stripe/_dispute.py
Expand Up @@ -175,12 +175,23 @@ class Card(StripeObject):
The card network's specific dispute reason code, which maps to one of Stripe's primary dispute categories to simplify response guidance. The [Network code map](https://stripe.com/docs/disputes/categories#network-code-map) lists all available dispute reason codes by network.
"""

class Paypal(StripeObject):
case_id: Optional[str]
"""
The ID of the dispute in PayPal.
"""
reason_code: Optional[str]
"""
The reason for the dispute as defined by PayPal
"""

card: Optional[Card]
type: Literal["card"]
paypal: Optional[Paypal]
type: Literal["card", "paypal"]
"""
Payment method type.
"""
_inner_class_types = {"card": Card}
_inner_class_types = {"card": Card, "paypal": Paypal}

class CloseParams(RequestOptions):
expand: NotRequired[List[str]]
Expand Down
13 changes: 11 additions & 2 deletions stripe/_invoice.py
Expand Up @@ -465,6 +465,7 @@ class LastFinalizationError(StripeObject):
"setup_intent_mandate_invalid",
"setup_intent_setup_attempt_expired",
"setup_intent_unexpected_state",
"shipping_address_invalid",
"shipping_calculation_failed",
"sku_inactive",
"state_unsupported",
Expand Down Expand Up @@ -5792,11 +5793,11 @@ class VoidInvoiceParams(RequestOptions):
payment_settings: PaymentSettings
period_end: int
"""
End of the usage period during which invoice items were added to this invoice.
End of the usage period during which invoice items were added to this invoice. This looks back one period for a subscription invoice. Use the [line item period](https://stripe.com/api/invoices/line_item#invoice_line_item_object-period) to get the service period for each price.
"""
period_start: int
"""
Start of the usage period during which invoice items were added to this invoice.
Start of the usage period during which invoice items were added to this invoice. This looks back one period for a subscription invoice. Use the [line item period](https://stripe.com/api/invoices/line_item#invoice_line_item_object-period) to get the service period for each price.
"""
post_payment_credit_notes_amount: int
"""
Expand Down Expand Up @@ -5937,6 +5938,8 @@ def create_preview(
Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount.
You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_details.proration_date value passed in the request.
Note: Currency conversion calculations use the latest exchange rates. Exchange rates may vary between the time of the preview and the time of the actual invoice creation. [Learn more](https://docs.stripe.com/currencies/conversions)
"""
return cast(
"Invoice",
Expand All @@ -5957,6 +5960,8 @@ async def create_preview_async(
Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount.
You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_details.proration_date value passed in the request.
Note: Currency conversion calculations use the latest exchange rates. Exchange rates may vary between the time of the preview and the time of the actual invoice creation. [Learn more](https://docs.stripe.com/currencies/conversions)
"""
return cast(
"Invoice",
Expand Down Expand Up @@ -6631,6 +6636,8 @@ def upcoming(cls, **params: Unpack["Invoice.UpcomingParams"]) -> "Invoice":
Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount.
You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_details.proration_date value passed in the request.
Note: Currency conversion calculations use the latest exchange rates. Exchange rates may vary between the time of the preview and the time of the actual invoice creation. [Learn more](https://docs.stripe.com/currencies/conversions)
"""
return cast(
"Invoice",
Expand All @@ -6651,6 +6658,8 @@ async def upcoming_async(
Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount.
You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_details.proration_date value passed in the request.
Note: Currency conversion calculations use the latest exchange rates. Exchange rates may vary between the time of the preview and the time of the actual invoice creation. [Learn more](https://docs.stripe.com/currencies/conversions)
"""
return cast(
"Invoice",
Expand Down
8 changes: 8 additions & 0 deletions stripe/_invoice_service.py
Expand Up @@ -3743,6 +3743,8 @@ def upcoming(
Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount.
You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_details.proration_date value passed in the request.
Note: Currency conversion calculations use the latest exchange rates. Exchange rates may vary between the time of the preview and the time of the actual invoice creation. [Learn more](https://docs.stripe.com/currencies/conversions)
"""
return cast(
Invoice,
Expand All @@ -3767,6 +3769,8 @@ async def upcoming_async(
Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount.
You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_details.proration_date value passed in the request.
Note: Currency conversion calculations use the latest exchange rates. Exchange rates may vary between the time of the preview and the time of the actual invoice creation. [Learn more](https://docs.stripe.com/currencies/conversions)
"""
return cast(
Invoice,
Expand Down Expand Up @@ -4029,6 +4033,8 @@ def create_preview(
Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount.
You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_details.proration_date value passed in the request.
Note: Currency conversion calculations use the latest exchange rates. Exchange rates may vary between the time of the preview and the time of the actual invoice creation. [Learn more](https://docs.stripe.com/currencies/conversions)
"""
return cast(
Invoice,
Expand All @@ -4053,6 +4059,8 @@ async def create_preview_async(
Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount.
You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_details.proration_date value passed in the request.
Note: Currency conversion calculations use the latest exchange rates. Exchange rates may vary between the time of the preview and the time of the actual invoice creation. [Learn more](https://docs.stripe.com/currencies/conversions)
"""
return cast(
Invoice,
Expand Down
5 changes: 5 additions & 0 deletions stripe/_payment_intent.py
Expand Up @@ -246,6 +246,7 @@ class LastPaymentError(StripeObject):
"setup_intent_mandate_invalid",
"setup_intent_setup_attempt_expired",
"setup_intent_unexpected_state",
"shipping_address_invalid",
"shipping_calculation_failed",
"sku_inactive",
"state_unsupported",
Expand Down Expand Up @@ -2005,6 +2006,10 @@ class ConfirmParams(RequestOptions):
"""
Payment method-specific configuration for this PaymentIntent.
"""
payment_method_types: NotRequired[List[str]]
"""
The list of payment method types (for example, a card) that this PaymentIntent can use. Use `automatic_payment_methods` to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods).
"""
radar_options: NotRequired["PaymentIntent.ConfirmParamsRadarOptions"]
"""
Options to configure Radar. Learn more about [Radar Sessions](https://stripe.com/docs/radar/radar-session).
Expand Down
4 changes: 4 additions & 0 deletions stripe/_payment_intent_service.py
Expand Up @@ -138,6 +138,10 @@ class ConfirmParams(TypedDict):
"""
Payment method-specific configuration for this PaymentIntent.
"""
payment_method_types: NotRequired[List[str]]
"""
The list of payment method types (for example, a card) that this PaymentIntent can use. Use `automatic_payment_methods` to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods).
"""
radar_options: NotRequired[
"PaymentIntentService.ConfirmParamsRadarOptions"
]
Expand Down
1 change: 1 addition & 0 deletions stripe/_setup_attempt.py
Expand Up @@ -578,6 +578,7 @@ class SetupError(StripeObject):
"setup_intent_mandate_invalid",
"setup_intent_setup_attempt_expired",
"setup_intent_unexpected_state",
"shipping_address_invalid",
"shipping_calculation_failed",
"sku_inactive",
"state_unsupported",
Expand Down
1 change: 1 addition & 0 deletions stripe/_setup_intent.py
Expand Up @@ -231,6 +231,7 @@ class LastSetupError(StripeObject):
"setup_intent_mandate_invalid",
"setup_intent_setup_attempt_expired",
"setup_intent_unexpected_state",
"shipping_address_invalid",
"shipping_calculation_failed",
"sku_inactive",
"state_unsupported",
Expand Down
2 changes: 1 addition & 1 deletion stripe/entitlements/_feature.py
Expand Up @@ -69,7 +69,7 @@ class ModifyParams(RequestOptions):
"""
Specifies which fields in the response should be expanded.
"""
metadata: NotRequired[Dict[str, str]]
metadata: NotRequired["Literal['']|Dict[str, str]"]
"""
Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
"""
Expand Down
4 changes: 2 additions & 2 deletions stripe/entitlements/_feature_service.py
Expand Up @@ -6,7 +6,7 @@
from stripe._util import sanitize_id
from stripe.entitlements._feature import Feature
from typing import Dict, List, cast
from typing_extensions import NotRequired, TypedDict
from typing_extensions import Literal, NotRequired, TypedDict


class FeatureService(StripeService):
Expand Down Expand Up @@ -61,7 +61,7 @@ class UpdateParams(TypedDict):
"""
Specifies which fields in the response should be expanded.
"""
metadata: NotRequired[Dict[str, str]]
metadata: NotRequired["Literal['']|Dict[str, str]"]
"""
Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
"""
Expand Down