Debian Codegraph @

stripe/issuing/_physical_bundle.py

raw
1 # -*- coding: utf-8 -*-
2 # File generated from our OpenAPI spec
3 from stripe._list_object import ListObject
4 from stripe._listable_api_resource import ListableAPIResource
5 from stripe._stripe_object import StripeObject
6 from typing import ClassVar
7 from typing_extensions import Literal, Unpack, TYPE_CHECKING
8
9 if TYPE_CHECKING:
10 from stripe.params.issuing._physical_bundle_list_params import (
11 PhysicalBundleListParams,
12 )
13 from stripe.params.issuing._physical_bundle_retrieve_params import (
14 PhysicalBundleRetrieveParams,
15 )
16
17
18 class PhysicalBundle(ListableAPIResource["PhysicalBundle"]):
19 """
20 A Physical Bundle represents the bundle of physical items - card stock, carrier letter, and envelope - that is shipped to a cardholder when you create a physical card.
21 """
22
23 OBJECT_NAME: ClassVar[Literal["issuing.physical_bundle"]] = (
24 "issuing.physical_bundle"
25 )
26
27 class Features(StripeObject):
28 card_logo: Literal["optional", "required", "unsupported"]
29 """
30 The policy for how to use card logo images in a card design with this physical bundle.
31 """
32 carrier_text: Literal["optional", "required", "unsupported"]
33 """
34 The policy for how to use carrier letter text in a card design with this physical bundle.
35 """
36 second_line: Literal["optional", "required", "unsupported"]
37 """
38 The policy for how to use a second line on a card with this physical bundle.
39 """
40
41 features: Features
42 id: str
43 """
44 Unique identifier for the object.
45 """
46 livemode: bool
47 """
48 Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
49 """
50 name: str
51 """
52 Friendly display name.
53 """
54 object: Literal["issuing.physical_bundle"]
55 """
56 String representing the object's type. Objects of the same type share the same value.
57 """
58 status: Literal["active", "inactive", "review"]
59 """
60 Whether this physical bundle can be used to create cards.
61 """
62 type: Literal["custom", "standard"]
63 """
64 Whether this physical bundle is a standard Stripe offering or custom-made for you.
65 """
66
67 @classmethod
68 def list(
69 cls, **params: Unpack["PhysicalBundleListParams"]
70 ) -> ListObject["PhysicalBundle"]:
71 """
72 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.
73 """
74 result = cls._static_request(
75 "get",
76 cls.class_url(),
77 params=params,
78 )
79 if not isinstance(result, ListObject):
80 raise TypeError(
81 "Expected list object from API, got %s"
82 % (type(result).__name__)
83 )
84
85 return result
86
87 @classmethod
88 async def list_async(
89 cls, **params: Unpack["PhysicalBundleListParams"]
90 ) -> ListObject["PhysicalBundle"]:
91 """
92 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.
93 """
94 result = await cls._static_request_async(
95 "get",
96 cls.class_url(),
97 params=params,
98 )
99 if not isinstance(result, ListObject):
100 raise TypeError(
101 "Expected list object from API, got %s"
102 % (type(result).__name__)
103 )
104
105 return result
106
107 @classmethod
108 def retrieve(
109 cls, id: str, **params: Unpack["PhysicalBundleRetrieveParams"]
110 ) -> "PhysicalBundle":
111 """
112 Retrieves a physical bundle object.
113 """
114 instance = cls(id, **params)
115 instance.refresh()
116 return instance
117
118 @classmethod
119 async def retrieve_async(
120 cls, id: str, **params: Unpack["PhysicalBundleRetrieveParams"]
121 ) -> "PhysicalBundle":
122 """
123 Retrieves a physical bundle object.
124 """
125 instance = cls(id, **params)
126 await instance.refresh_async()
127 return instance
128
129 _inner_class_types = {"features": Features}