@@ -32,6 +32,7 @@ customer = client.customers.create(
32
32
33
33
name = " My Customer" ,
34
34
)
35
+ print (customer.id)
35
36
```
36
37
37
38
While you can provide an ` api_key ` keyword argument,
@@ -44,6 +45,7 @@ so that your API Key is not stored in source control.
44
45
Simply import ` AsyncOrb ` instead of ` Orb ` and use ` await ` with each API call:
45
46
46
47
``` python
48
+ import asyncio
47
49
from orb import AsyncOrb
48
50
49
51
client = AsyncOrb(
@@ -52,12 +54,12 @@ client = AsyncOrb(
52
54
)
53
55
54
56
55
- async def main ():
57
+ async def main () -> None :
56
58
customer = await client.customers.create(
57
59
58
60
name = " My Customer" ,
59
61
)
60
- print (customer)
62
+ print (customer.id )
61
63
62
64
63
65
asyncio.run(main())
@@ -145,7 +147,7 @@ from orb import Orb
145
147
146
148
client = Orb()
147
149
148
- client.customers.create(
150
+ customer = client.customers.create(
149
151
150
152
name = " My Customer" ,
151
153
billing_address = {
@@ -154,6 +156,7 @@ client.customers.create(
154
156
" line1" : " 123 Example Street" ,
155
157
},
156
158
)
159
+ print (customer.id)
157
160
```
158
161
159
162
## Handling errors
@@ -287,10 +290,9 @@ from orb import Orb
287
290
288
291
client = Orb()
289
292
response = client.customers.with_raw_response.create(
290
- email = " string " ,
291
- name = " string " ,
293
+
294
+ name = " My Customer " ,
292
295
)
293
-
294
296
print (response.headers.get(' X-My-Header' ))
295
297
296
298
customer = response.parse() # get the object that `customers.create()` would have returned
0 commit comments