|
2 | 2 | # File generated from our OpenAPI spec |
3 | 3 | from stripe._createable_api_resource import CreateableAPIResource |
4 | 4 | from stripe._deletable_api_resource import DeletableAPIResource |
| 5 | +from stripe._list_object import ListObject |
| 6 | +from stripe._listable_api_resource import ListableAPIResource |
5 | 7 | from stripe._stripe_object import StripeObject |
6 | 8 | from stripe._updateable_api_resource import UpdateableAPIResource |
7 | 9 | from stripe._util import class_method_variant, sanitize_id |
|
15 | 17 | from stripe.params._payment_location_delete_params import ( |
16 | 18 | PaymentLocationDeleteParams, |
17 | 19 | ) |
| 20 | + from stripe.params._payment_location_list_params import ( |
| 21 | + PaymentLocationListParams, |
| 22 | + ) |
18 | 23 | from stripe.params._payment_location_modify_params import ( |
19 | 24 | PaymentLocationModifyParams, |
20 | 25 | ) |
|
26 | 31 | class PaymentLocation( |
27 | 32 | CreateableAPIResource["PaymentLocation"], |
28 | 33 | DeletableAPIResource["PaymentLocation"], |
| 34 | + ListableAPIResource["PaymentLocation"], |
29 | 35 | UpdateableAPIResource["PaymentLocation"], |
30 | 36 | ): |
31 | 37 | """ |
@@ -258,6 +264,46 @@ async def delete_async( # pyright: ignore[reportGeneralTypeIssues] |
258 | 264 | params=params, |
259 | 265 | ) |
260 | 266 |
|
| 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 | + |
261 | 307 | @classmethod |
262 | 308 | def modify( |
263 | 309 | cls, id: str, **params: Unpack["PaymentLocationModifyParams"] |
|
0 commit comments