@@ -41,12 +41,12 @@ client = Dedalus(
4141 api_key = os.environ.get(" DEDALUS_API_KEY" ), # This is the default and can be omitted
4242)
4343
44- workspace = client.workspaces .create(
44+ machine = client.machines .create(
4545 memory_mib = 2048 ,
4646 storage_gib = 10 ,
4747 vcpu = 1 ,
4848)
49- print (workspace.workspace_id )
49+ print (machine.machine_id )
5050```
5151
5252While you can provide a ` x_api_key ` keyword argument,
@@ -69,12 +69,12 @@ client = AsyncDedalus(
6969
7070
7171async def main () -> None :
72- workspace = await client.workspaces .create(
72+ machine = await client.machines .create(
7373 memory_mib = 2048 ,
7474 storage_gib = 10 ,
7575 vcpu = 1 ,
7676 )
77- print (workspace.workspace_id )
77+ print (machine.machine_id )
7878
7979
8080asyncio.run(main())
@@ -107,12 +107,12 @@ async def main() -> None:
107107 api_key = os.environ.get(" DEDALUS_API_KEY" ), # This is the default and can be omitted
108108 http_client = DefaultAioHttpClient(),
109109 ) as client:
110- workspace = await client.workspaces .create(
110+ machine = await client.machines .create(
111111 memory_mib = 2048 ,
112112 storage_gib = 10 ,
113113 vcpu = 1 ,
114114 )
115- print (workspace.workspace_id )
115+ print (machine.machine_id )
116116
117117
118118asyncio.run(main())
@@ -127,11 +127,11 @@ from dedalus_sdk import Dedalus
127127
128128client = Dedalus()
129129
130- stream = client.workspaces .watch(
131- workspace_id = " workspace_id " ,
130+ stream = client.machines .watch(
131+ machine_id = " machine_id " ,
132132)
133- for workspace in stream:
134- print (workspace.workspace_id )
133+ for machine in stream:
134+ print (machine.machine_id )
135135```
136136
137137The async client uses the exact same interface.
@@ -141,11 +141,11 @@ from dedalus_sdk import AsyncDedalus
141141
142142client = AsyncDedalus()
143143
144- stream = await client.workspaces .watch(
145- workspace_id = " workspace_id " ,
144+ stream = await client.machines .watch(
145+ machine_id = " machine_id " ,
146146)
147- async for workspace in stream:
148- print (workspace.workspace_id )
147+ async for machine in stream:
148+ print (machine.machine_id )
149149```
150150
151151## Using types
@@ -168,12 +168,12 @@ from dedalus_sdk import Dedalus
168168
169169client = Dedalus()
170170
171- all_workspaces = []
171+ all_machines = []
172172# Automatically fetches more pages as needed.
173- for workspace in client.workspaces .list():
174- # Do something with workspace here
175- all_workspaces .append(workspace )
176- print (all_workspaces )
173+ for machine in client.machines .list():
174+ # Do something with machine here
175+ all_machines .append(machine )
176+ print (all_machines )
177177```
178178
179179Or, asynchronously:
@@ -186,11 +186,11 @@ client = AsyncDedalus()
186186
187187
188188async def main () -> None :
189- all_workspaces = []
189+ all_machines = []
190190 # Iterate through items across all pages, issuing requests as needed.
191- async for workspace in client.workspaces .list():
192- all_workspaces .append(workspace )
193- print (all_workspaces )
191+ async for machine in client.machines .list():
192+ all_machines .append(machine )
193+ print (all_machines )
194194
195195
196196asyncio.run(main())
@@ -199,7 +199,7 @@ asyncio.run(main())
199199Alternatively, you can use the ` .has_next_page() ` , ` .next_page_info() ` , or ` .get_next_page() ` methods for more granular control working with pages:
200200
201201``` python
202- first_page = await client.workspaces .list()
202+ first_page = await client.machines .list()
203203if first_page.has_next_page():
204204 print (f " will fetch next page using these details: { first_page.next_page_info()} " )
205205 next_page = await first_page.get_next_page()
@@ -211,11 +211,11 @@ if first_page.has_next_page():
211211Or just work directly with the returned data:
212212
213213``` python
214- first_page = await client.workspaces .list()
214+ first_page = await client.machines .list()
215215
216216print (f " next page cursor: { first_page.next_cursor} " ) # => "next page cursor: ..."
217- for workspace in first_page.items:
218- print (workspace.workspace_id )
217+ for machine in first_page.items:
218+ print (machine.machine_id )
219219
220220# Remove `await` for non-async usage.
221221```
@@ -236,7 +236,7 @@ from dedalus_sdk import Dedalus
236236client = Dedalus()
237237
238238try :
239- client.workspaces .create(
239+ client.machines .create(
240240 memory_mib = 2048 ,
241241 storage_gib = 10 ,
242242 vcpu = 1 ,
@@ -283,7 +283,7 @@ client = Dedalus(
283283)
284284
285285# Or, configure per-request:
286- client.with_options(max_retries = 5 ).workspaces .create(
286+ client.with_options(max_retries = 5 ).machines .create(
287287 memory_mib = 2048 ,
288288 storage_gib = 10 ,
289289 vcpu = 1 ,
@@ -310,7 +310,7 @@ client = Dedalus(
310310)
311311
312312# Override per-request:
313- client.with_options(timeout = 5.0 ).workspaces .create(
313+ client.with_options(timeout = 5.0 ).machines .create(
314314 memory_mib = 2048 ,
315315 storage_gib = 10 ,
316316 vcpu = 1 ,
@@ -355,15 +355,15 @@ The "raw" Response object can be accessed by prefixing `.with_raw_response.` to
355355from dedalus_sdk import Dedalus
356356
357357client = Dedalus()
358- response = client.workspaces .with_raw_response.create(
358+ response = client.machines .with_raw_response.create(
359359 memory_mib = 2048 ,
360360 storage_gib = 10 ,
361361 vcpu = 1 ,
362362)
363363print (response.headers.get(' X-My-Header' ))
364364
365- workspace = response.parse() # get the object that `workspaces .create()` would have returned
366- print (workspace.workspace_id )
365+ machine = response.parse() # get the object that `machines .create()` would have returned
366+ print (machine.machine_id )
367367```
368368
369369These methods return an [ ` APIResponse ` ] ( https://github.com/dedalus-labs/dedalus-python/tree/main/src/dedalus_sdk/_response.py ) object.
@@ -377,7 +377,7 @@ The above interface eagerly reads the full response body when you make the reque
377377To stream the response body, use ` .with_streaming_response ` instead, which requires a context manager and only reads the response body once you call ` .read() ` , ` .text() ` , ` .json() ` , ` .iter_bytes() ` , ` .iter_text() ` , ` .iter_lines() ` or ` .parse() ` . In the async client, these are async methods.
378378
379379``` python
380- with client.workspaces .with_streaming_response.create(
380+ with client.machines .with_streaming_response.create(
381381 memory_mib = 2048 ,
382382 storage_gib = 10 ,
383383 vcpu = 1 ,
0 commit comments