Skip to content

Commit f89f45e

Browse files
Merge pull request #1807 from stripe/latest-codegen-private-preview
Update generated code for private-preview
2 parents c88f28d + 93e5088 commit f89f45e

91 files changed

Lines changed: 2970 additions & 181 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CODEGEN_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6b817716b60b32636770d4c1bd7863bbdb6f5f7a
1+
6a1eb046657923602071d7707e99ce8a004a8216

OPENAPI_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v2256
1+
v2261

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ client = StripeClient("sk_test_...", http_client=stripe.UrllibClient())
127127
```
128128

129129
Without a configured client, by default the library will attempt to load
130-
libraries in the order above (i.e. `urlfetch` is preferred with `urllib2` used
130+
libraries in the order above (i.e. `urlfetch` is preferred with `urllib` used
131131
as a last resort). We usually recommend that people use `requests`.
132132

133133
### Configuring a Proxy

stripe/_event_notification_handler.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1011,6 +1011,12 @@
10111011
from stripe.events._v2_money_management_financial_account_created_event import (
10121012
V2MoneyManagementFinancialAccountCreatedEventNotification,
10131013
)
1014+
from stripe.events._v2_money_management_financial_account_statement_created_event import (
1015+
V2MoneyManagementFinancialAccountStatementCreatedEventNotification,
1016+
)
1017+
from stripe.events._v2_money_management_financial_account_statement_restated_event import (
1018+
V2MoneyManagementFinancialAccountStatementRestatedEventNotification,
1019+
)
10141020
from stripe.events._v2_money_management_financial_account_updated_event import (
10151021
V2MoneyManagementFinancialAccountUpdatedEventNotification,
10161022
)
@@ -5637,6 +5643,32 @@ def on_v2_money_management_financial_account_created(
56375643
)
56385644
return func
56395645

5646+
def on_v2_money_management_financial_account_statement_created(
5647+
self,
5648+
func: "Callable[[V2MoneyManagementFinancialAccountStatementCreatedEventNotification, StripeClient], None]",
5649+
):
5650+
"""
5651+
Registers a callback for the `V2MoneyManagementFinancialAccountStatementCreatedEvent` (`v2.money_management.financial_account_statement.created`) event notification.
5652+
"""
5653+
self._register(
5654+
"v2.money_management.financial_account_statement.created",
5655+
func,
5656+
)
5657+
return func
5658+
5659+
def on_v2_money_management_financial_account_statement_restated(
5660+
self,
5661+
func: "Callable[[V2MoneyManagementFinancialAccountStatementRestatedEventNotification, StripeClient], None]",
5662+
):
5663+
"""
5664+
Registers a callback for the `V2MoneyManagementFinancialAccountStatementRestatedEvent` (`v2.money_management.financial_account_statement.restated`) event notification.
5665+
"""
5666+
self._register(
5667+
"v2.money_management.financial_account_statement.restated",
5668+
func,
5669+
)
5670+
return func
5671+
56405672
def on_v2_money_management_financial_account_updated(
56415673
self,
56425674
func: "Callable[[V2MoneyManagementFinancialAccountUpdatedEventNotification, StripeClient], None]",

stripe/_http_client.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,9 @@ def _request_internal(
678678
).request(
679679
method,
680680
url,
681-
headers=headers,
681+
headers=cast(
682+
"MutableMapping[str, str | bytes] | None", headers
683+
), # https://jira.corp.stripe.com/browse/RUN_DEVSDK-2417
682684
data=post_data,
683685
timeout=self._timeout,
684686
**kwargs,

stripe/_invoice.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -876,18 +876,7 @@ class Installments(StripeObject):
876876
_inner_class_types = {"installments": Installments}
877877

878878
class CheckScan(StripeObject):
879-
class CheckDepositAddress(StripeObject):
880-
city: Optional[str]
881-
country: Optional[str]
882-
line1: Optional[str]
883-
line2: Optional[str]
884-
postal_code: Optional[str]
885-
state: Optional[str]
886-
887-
check_deposit_address: Optional[CheckDepositAddress]
888-
_inner_class_types = {
889-
"check_deposit_address": CheckDepositAddress,
890-
}
879+
pass
891880

892881
class CustomerBalance(StripeObject):
893882
class BankTransfer(StripeObject):

stripe/_object_classes.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,8 @@
582582
"stripe.v2.core._event_destination",
583583
"EventDestination",
584584
),
585+
"v2.core.fee_batch": ("stripe.v2.core._fee_batch", "FeeBatch"),
586+
"v2.core.fee_entry": ("stripe.v2.core._fee_entry", "FeeEntry"),
585587
"v2.core.vault.gb_bank_account": (
586588
"stripe.v2.core.vault._gb_bank_account",
587589
"GbBankAccount",
@@ -621,10 +623,18 @@
621623
"stripe.v2.money_management._currency_conversion",
622624
"CurrencyConversion",
623625
),
626+
"v2.money_management.debit_dispute": (
627+
"stripe.v2.money_management._debit_dispute",
628+
"DebitDispute",
629+
),
624630
"v2.money_management.financial_account": (
625631
"stripe.v2.money_management._financial_account",
626632
"FinancialAccount",
627633
),
634+
"v2.money_management.financial_account_statement": (
635+
"stripe.v2.money_management._financial_account_statement",
636+
"FinancialAccountStatement",
637+
),
628638
"v2.money_management.financial_address": (
629639
"stripe.v2.money_management._financial_address",
630640
"FinancialAddress",

stripe/_payment_location.py

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
# File generated from our OpenAPI spec
33
from stripe._createable_api_resource import CreateableAPIResource
44
from stripe._deletable_api_resource import DeletableAPIResource
5+
from stripe._list_object import ListObject
6+
from stripe._listable_api_resource import ListableAPIResource
57
from stripe._stripe_object import StripeObject
68
from stripe._updateable_api_resource import UpdateableAPIResource
79
from stripe._util import class_method_variant, sanitize_id
@@ -15,6 +17,9 @@
1517
from stripe.params._payment_location_delete_params import (
1618
PaymentLocationDeleteParams,
1719
)
20+
from stripe.params._payment_location_list_params import (
21+
PaymentLocationListParams,
22+
)
1823
from stripe.params._payment_location_modify_params import (
1924
PaymentLocationModifyParams,
2025
)
@@ -26,6 +31,7 @@
2631
class PaymentLocation(
2732
CreateableAPIResource["PaymentLocation"],
2833
DeletableAPIResource["PaymentLocation"],
34+
ListableAPIResource["PaymentLocation"],
2935
UpdateableAPIResource["PaymentLocation"],
3036
):
3137
"""
@@ -258,6 +264,46 @@ async def delete_async( # pyright: ignore[reportGeneralTypeIssues]
258264
params=params,
259265
)
260266

267+
@classmethod
268+
def list(
269+
cls, **params: Unpack["PaymentLocationListParams"]
270+
) -> ListObject["PaymentLocation"]:
271+
"""
272+
List all Payment Locations.
273+
"""
274+
result = cls._static_request(
275+
"get",
276+
cls.class_url(),
277+
params=params,
278+
)
279+
if not isinstance(result, ListObject):
280+
raise TypeError(
281+
"Expected list object from API, got %s"
282+
% (type(result).__name__)
283+
)
284+
285+
return result
286+
287+
@classmethod
288+
async def list_async(
289+
cls, **params: Unpack["PaymentLocationListParams"]
290+
) -> ListObject["PaymentLocation"]:
291+
"""
292+
List all Payment Locations.
293+
"""
294+
result = await cls._static_request_async(
295+
"get",
296+
cls.class_url(),
297+
params=params,
298+
)
299+
if not isinstance(result, ListObject):
300+
raise TypeError(
301+
"Expected list object from API, got %s"
302+
% (type(result).__name__)
303+
)
304+
305+
return result
306+
261307
@classmethod
262308
def modify(
263309
cls, id: str, **params: Unpack["PaymentLocationModifyParams"]

stripe/_payment_location_service.py

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from typing_extensions import TYPE_CHECKING
77

88
if TYPE_CHECKING:
9+
from stripe._list_object import ListObject
910
from stripe._payment_location import PaymentLocation
1011
from stripe._request_options import RequestOptions
1112
from stripe.params._payment_location_create_params import (
@@ -14,6 +15,9 @@
1415
from stripe.params._payment_location_delete_params import (
1516
PaymentLocationDeleteParams,
1617
)
18+
from stripe.params._payment_location_list_params import (
19+
PaymentLocationListParams,
20+
)
1721
from stripe.params._payment_location_retrieve_params import (
1822
PaymentLocationRetrieveParams,
1923
)
@@ -143,6 +147,44 @@ async def update_async(
143147
),
144148
)
145149

150+
def list(
151+
self,
152+
params: Optional["PaymentLocationListParams"] = None,
153+
options: Optional["RequestOptions"] = None,
154+
) -> "ListObject[PaymentLocation]":
155+
"""
156+
List all Payment Locations.
157+
"""
158+
return cast(
159+
"ListObject[PaymentLocation]",
160+
self._request(
161+
"get",
162+
"/v1/payment_locations",
163+
base_address="api",
164+
params=params,
165+
options=options,
166+
),
167+
)
168+
169+
async def list_async(
170+
self,
171+
params: Optional["PaymentLocationListParams"] = None,
172+
options: Optional["RequestOptions"] = None,
173+
) -> "ListObject[PaymentLocation]":
174+
"""
175+
List all Payment Locations.
176+
"""
177+
return cast(
178+
"ListObject[PaymentLocation]",
179+
await self._request_async(
180+
"get",
181+
"/v1/payment_locations",
182+
base_address="api",
183+
params=params,
184+
options=options,
185+
),
186+
)
187+
146188
def create(
147189
self,
148190
params: "PaymentLocationCreateParams",

stripe/_quote_preview_invoice.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -832,18 +832,7 @@ class Installments(StripeObject):
832832
_inner_class_types = {"installments": Installments}
833833

834834
class CheckScan(StripeObject):
835-
class CheckDepositAddress(StripeObject):
836-
city: Optional[str]
837-
country: Optional[str]
838-
line1: Optional[str]
839-
line2: Optional[str]
840-
postal_code: Optional[str]
841-
state: Optional[str]
842-
843-
check_deposit_address: Optional[CheckDepositAddress]
844-
_inner_class_types = {
845-
"check_deposit_address": CheckDepositAddress,
846-
}
835+
pass
847836

848837
class CustomerBalance(StripeObject):
849838
class BankTransfer(StripeObject):

0 commit comments

Comments
 (0)