Debian Codegraph @

stripe/issuing/_physical_bundle_service.py

raw
1 # -*- coding: utf-8 -*-
2 # File generated from our OpenAPI spec
3 from stripe._stripe_service import StripeService
4 from stripe._util import sanitize_id
5 from typing import Optional, cast
6 from typing_extensions import TYPE_CHECKING
7
8 if TYPE_CHECKING:
9 from stripe._list_object import ListObject
10 from stripe._request_options import RequestOptions
11 from stripe.issuing._physical_bundle import PhysicalBundle
12 from stripe.params.issuing._physical_bundle_list_params import (
13 PhysicalBundleListParams,
14 )
15 from stripe.params.issuing._physical_bundle_retrieve_params import (
16 PhysicalBundleRetrieveParams,
17 )
18
19
20 class PhysicalBundleService(StripeService):
21 def list(
22 self,
23 params: Optional["PhysicalBundleListParams"] = None,
24 options: Optional["RequestOptions"] = None,
25 ) -> "ListObject[PhysicalBundle]":
26 """
27 Returns a list of physical bundle objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first.
28 """
29 return cast(
30 "ListObject[PhysicalBundle]",
31 self._request(
32 "get",
33 "/v1/issuing/physical_bundles",
34 base_address="api",
35 params=params,
36 options=options,
37 ),
38 )
39
40 async def list_async(
41 self,
42 params: Optional["PhysicalBundleListParams"] = None,
43 options: Optional["RequestOptions"] = None,
44 ) -> "ListObject[PhysicalBundle]":
45 """
46 Returns a list of physical bundle objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first.
47 """
48 return cast(
49 "ListObject[PhysicalBundle]",
50 await self._request_async(
51 "get",
52 "/v1/issuing/physical_bundles",
53 base_address="api",
54 params=params,
55 options=options,
56 ),
57 )
58
59 def retrieve(
60 self,
61 physical_bundle: str,
62 params: Optional["PhysicalBundleRetrieveParams"] = None,
63 options: Optional["RequestOptions"] = None,
64 ) -> "PhysicalBundle":
65 """
66 Retrieves a physical bundle object.
67 """
68 return cast(
69 "PhysicalBundle",
70 self._request(
71 "get",
72 "/v1/issuing/physical_bundles/{physical_bundle}".format(
73 physical_bundle=sanitize_id(physical_bundle),
74 ),
75 base_address="api",
76 params=params,
77 options=options,
78 ),
79 )
80
81 async def retrieve_async(
82 self,
83 physical_bundle: str,
84 params: Optional["PhysicalBundleRetrieveParams"] = None,
85 options: Optional["RequestOptions"] = None,
86 ) -> "PhysicalBundle":
87 """
88 Retrieves a physical bundle object.
89 """
90 return cast(
91 "PhysicalBundle",
92 await self._request_async(
93 "get",
94 "/v1/issuing/physical_bundles/{physical_bundle}".format(
95 physical_bundle=sanitize_id(physical_bundle),
96 ),
97 base_address="api",
98 params=params,
99 options=options,
100 ),
101 )