casedev 0.3.0__py3-none-any.whl → 0.4.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (145) hide show
  1. casedev/_client.py +275 -1
  2. casedev/_version.py +1 -1
  3. casedev/resources/__init__.py +98 -0
  4. casedev/resources/applications/__init__.py +33 -0
  5. casedev/resources/applications/applications.py +102 -0
  6. casedev/resources/applications/v1/__init__.py +61 -0
  7. casedev/resources/applications/v1/deployments.py +867 -0
  8. casedev/resources/applications/v1/projects.py +1377 -0
  9. casedev/resources/applications/v1/v1.py +166 -0
  10. casedev/resources/applications/v1/workflows.py +182 -0
  11. casedev/resources/compute/v1/__init__.py +28 -0
  12. casedev/resources/compute/v1/instance_types.py +145 -0
  13. casedev/resources/compute/v1/instances.py +448 -0
  14. casedev/resources/compute/v1/v1.py +64 -0
  15. casedev/resources/database/__init__.py +33 -0
  16. casedev/resources/database/database.py +102 -0
  17. casedev/resources/database/v1/__init__.py +33 -0
  18. casedev/resources/database/v1/projects.py +771 -0
  19. casedev/resources/database/v1/v1.py +175 -0
  20. casedev/resources/legal/__init__.py +33 -0
  21. casedev/resources/legal/legal.py +102 -0
  22. casedev/resources/legal/v1.py +924 -0
  23. casedev/resources/memory/__init__.py +33 -0
  24. casedev/resources/memory/memory.py +102 -0
  25. casedev/resources/memory/v1.py +1100 -0
  26. casedev/resources/privilege/__init__.py +33 -0
  27. casedev/resources/privilege/privilege.py +102 -0
  28. casedev/resources/privilege/v1.py +260 -0
  29. casedev/resources/superdoc/__init__.py +33 -0
  30. casedev/resources/superdoc/superdoc.py +102 -0
  31. casedev/resources/superdoc/v1.py +349 -0
  32. casedev/resources/translate/__init__.py +33 -0
  33. casedev/resources/translate/translate.py +102 -0
  34. casedev/resources/translate/v1.py +418 -0
  35. casedev/resources/vault/__init__.py +14 -0
  36. casedev/resources/vault/graphrag.py +91 -0
  37. casedev/resources/vault/multipart.py +549 -0
  38. casedev/resources/vault/objects.py +475 -5
  39. casedev/resources/vault/vault.py +262 -5
  40. casedev/types/__init__.py +4 -0
  41. casedev/types/applications/v1/__init__.py +20 -0
  42. casedev/types/applications/v1/deployment_cancel_params.py +14 -0
  43. casedev/types/applications/v1/deployment_create_params.py +20 -0
  44. casedev/types/applications/v1/deployment_get_logs_params.py +14 -0
  45. casedev/types/applications/v1/deployment_list_params.py +23 -0
  46. casedev/types/applications/v1/deployment_retrieve_params.py +17 -0
  47. casedev/types/applications/v1/deployment_stream_params.py +17 -0
  48. casedev/types/applications/v1/project_create_deployment_params.py +29 -0
  49. casedev/types/applications/v1/project_create_domain_params.py +17 -0
  50. casedev/types/applications/v1/project_create_env_params.py +27 -0
  51. casedev/types/applications/v1/project_create_params.py +53 -0
  52. casedev/types/applications/v1/project_delete_params.py +14 -0
  53. casedev/types/applications/v1/project_get_runtime_logs_params.py +12 -0
  54. casedev/types/applications/v1/project_list_deployments_params.py +18 -0
  55. casedev/types/applications/v1/project_list_env_params.py +12 -0
  56. casedev/types/applications/v1/project_list_response.py +45 -0
  57. casedev/types/applications/v1/workflow_get_status_params.py +14 -0
  58. casedev/types/compute/v1/__init__.py +6 -0
  59. casedev/types/compute/v1/instance_create_params.py +28 -0
  60. casedev/types/compute/v1/instance_create_response.py +35 -0
  61. casedev/types/compute/v1/instance_delete_response.py +23 -0
  62. casedev/types/compute/v1/instance_list_response.py +45 -0
  63. casedev/types/compute/v1/instance_retrieve_response.py +55 -0
  64. casedev/types/compute/v1/instance_type_list_response.py +46 -0
  65. casedev/types/database/__init__.py +5 -0
  66. casedev/types/database/v1/__init__.py +14 -0
  67. casedev/types/database/v1/project_create_branch_params.py +17 -0
  68. casedev/types/database/v1/project_create_branch_response.py +30 -0
  69. casedev/types/database/v1/project_create_params.py +27 -0
  70. casedev/types/database/v1/project_create_response.py +47 -0
  71. casedev/types/database/v1/project_delete_response.py +13 -0
  72. casedev/types/database/v1/project_get_connection_params.py +15 -0
  73. casedev/types/database/v1/project_get_connection_response.py +18 -0
  74. casedev/types/database/v1/project_list_branches_response.py +37 -0
  75. casedev/types/database/v1/project_list_response.py +64 -0
  76. casedev/types/database/v1/project_retrieve_response.py +100 -0
  77. casedev/types/database/v1_get_usage_response.py +116 -0
  78. casedev/types/legal/__init__.py +20 -0
  79. casedev/types/legal/v1_find_params.py +23 -0
  80. casedev/types/legal/v1_find_response.py +37 -0
  81. casedev/types/legal/v1_get_citations_from_url_params.py +12 -0
  82. casedev/types/legal/v1_get_citations_from_url_response.py +69 -0
  83. casedev/types/legal/v1_get_citations_params.py +16 -0
  84. casedev/types/legal/v1_get_citations_response.py +60 -0
  85. casedev/types/legal/v1_get_full_text_params.py +23 -0
  86. casedev/types/legal/v1_get_full_text_response.py +35 -0
  87. casedev/types/legal/v1_list_jurisdictions_params.py +12 -0
  88. casedev/types/legal/v1_list_jurisdictions_response.py +35 -0
  89. casedev/types/legal/v1_research_params.py +27 -0
  90. casedev/types/legal/v1_research_response.py +51 -0
  91. casedev/types/legal/v1_similar_params.py +25 -0
  92. casedev/types/legal/v1_similar_response.py +42 -0
  93. casedev/types/legal/v1_verify_params.py +16 -0
  94. casedev/types/legal/v1_verify_response.py +92 -0
  95. casedev/types/memory/__init__.py +14 -0
  96. casedev/types/memory/v1_create_params.py +69 -0
  97. casedev/types/memory/v1_create_response.py +23 -0
  98. casedev/types/memory/v1_delete_all_params.py +45 -0
  99. casedev/types/memory/v1_delete_all_response.py +12 -0
  100. casedev/types/memory/v1_delete_response.py +13 -0
  101. casedev/types/memory/v1_list_params.py +54 -0
  102. casedev/types/memory/v1_list_response.py +29 -0
  103. casedev/types/memory/v1_retrieve_response.py +23 -0
  104. casedev/types/memory/v1_search_params.py +54 -0
  105. casedev/types/memory/v1_search_response.py +61 -0
  106. casedev/types/privilege/__init__.py +6 -0
  107. casedev/types/privilege/v1_detect_params.py +34 -0
  108. casedev/types/privilege/v1_detect_response.py +41 -0
  109. casedev/types/superdoc/__init__.py +6 -0
  110. casedev/types/superdoc/v1_annotate_params.py +56 -0
  111. casedev/types/superdoc/v1_convert_params.py +23 -0
  112. casedev/types/translate/__init__.py +10 -0
  113. casedev/types/translate/v1_detect_params.py +18 -0
  114. casedev/types/translate/v1_detect_response.py +28 -0
  115. casedev/types/translate/v1_list_languages_params.py +18 -0
  116. casedev/types/translate/v1_list_languages_response.py +23 -0
  117. casedev/types/translate/v1_translate_params.py +30 -0
  118. casedev/types/translate/v1_translate_response.py +28 -0
  119. casedev/types/vault/__init__.py +14 -0
  120. casedev/types/vault/graphrag_process_object_response.py +45 -0
  121. casedev/types/vault/multipart_abort_params.py +15 -0
  122. casedev/types/vault/multipart_complete_params.py +26 -0
  123. casedev/types/vault/multipart_get_part_urls_params.py +24 -0
  124. casedev/types/vault/multipart_get_part_urls_response.py +19 -0
  125. casedev/types/vault/multipart_init_params.py +32 -0
  126. casedev/types/vault/multipart_init_response.py +23 -0
  127. casedev/types/vault/object_create_presigned_url_params.py +1 -1
  128. casedev/types/vault/object_delete_params.py +17 -0
  129. casedev/types/vault/object_delete_response.py +29 -0
  130. casedev/types/vault/object_get_ocr_words_params.py +28 -0
  131. casedev/types/vault/object_get_ocr_words_response.py +48 -0
  132. casedev/types/vault/object_get_summarize_job_response.py +40 -0
  133. casedev/types/vault/object_update_params.py +24 -0
  134. casedev/types/vault/object_update_response.py +39 -0
  135. casedev/types/vault_delete_params.py +17 -0
  136. casedev/types/vault_delete_response.py +30 -0
  137. casedev/types/vault_update_params.py +21 -0
  138. casedev/types/vault_update_response.py +60 -0
  139. casedev/types/vault_upload_params.py +1 -1
  140. {casedev-0.3.0.dist-info → casedev-0.4.0.dist-info}/METADATA +1 -1
  141. casedev-0.4.0.dist-info/RECORD +275 -0
  142. casedev-0.3.0.dist-info/RECORD +0 -150
  143. /casedev/types/{webhooks → applications}/__init__.py +0 -0
  144. {casedev-0.3.0.dist-info → casedev-0.4.0.dist-info}/WHEEL +0 -0
  145. {casedev-0.3.0.dist-info → casedev-0.4.0.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,448 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import Optional
6
+
7
+ import httpx
8
+
9
+ from ...._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
10
+ from ...._utils import maybe_transform, async_maybe_transform
11
+ from ...._compat import cached_property
12
+ from ...._resource import SyncAPIResource, AsyncAPIResource
13
+ from ...._response import (
14
+ to_raw_response_wrapper,
15
+ to_streamed_response_wrapper,
16
+ async_to_raw_response_wrapper,
17
+ async_to_streamed_response_wrapper,
18
+ )
19
+ from ...._base_client import make_request_options
20
+ from ....types.compute.v1 import instance_create_params
21
+ from ....types.compute.v1.instance_list_response import InstanceListResponse
22
+ from ....types.compute.v1.instance_create_response import InstanceCreateResponse
23
+ from ....types.compute.v1.instance_delete_response import InstanceDeleteResponse
24
+ from ....types.compute.v1.instance_retrieve_response import InstanceRetrieveResponse
25
+
26
+ __all__ = ["InstancesResource", "AsyncInstancesResource"]
27
+
28
+
29
+ class InstancesResource(SyncAPIResource):
30
+ @cached_property
31
+ def with_raw_response(self) -> InstancesResourceWithRawResponse:
32
+ """
33
+ This property can be used as a prefix for any HTTP method call to return
34
+ the raw response object instead of the parsed content.
35
+
36
+ For more information, see https://www.github.com/CaseMark/casedev-python#accessing-raw-response-data-eg-headers
37
+ """
38
+ return InstancesResourceWithRawResponse(self)
39
+
40
+ @cached_property
41
+ def with_streaming_response(self) -> InstancesResourceWithStreamingResponse:
42
+ """
43
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
44
+
45
+ For more information, see https://www.github.com/CaseMark/casedev-python#with_streaming_response
46
+ """
47
+ return InstancesResourceWithStreamingResponse(self)
48
+
49
+ def create(
50
+ self,
51
+ *,
52
+ instance_type: str,
53
+ name: str,
54
+ region: str,
55
+ auto_shutdown_minutes: Optional[int] | Omit = omit,
56
+ vault_ids: SequenceNotStr[str] | Omit = omit,
57
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
58
+ # The extra values given here take precedence over values defined on the client or passed to this method.
59
+ extra_headers: Headers | None = None,
60
+ extra_query: Query | None = None,
61
+ extra_body: Body | None = None,
62
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
63
+ ) -> InstanceCreateResponse:
64
+ """Launches a new GPU compute instance with automatic SSH key generation.
65
+
66
+ Supports
67
+ mounting Case.dev Vaults as filesystems and configurable auto-shutdown. Instance
68
+ boots in ~2-5 minutes. Perfect for batch OCR processing, AI model training, and
69
+ intensive document analysis workloads.
70
+
71
+ Args:
72
+ instance_type: GPU type (e.g., 'gpu_1x_h100_sxm5')
73
+
74
+ name: Instance name
75
+
76
+ region: Region (e.g., 'us-west-1')
77
+
78
+ auto_shutdown_minutes: Auto-shutdown timer (null = never)
79
+
80
+ vault_ids: Vault IDs to mount
81
+
82
+ extra_headers: Send extra headers
83
+
84
+ extra_query: Add additional query parameters to the request
85
+
86
+ extra_body: Add additional JSON properties to the request
87
+
88
+ timeout: Override the client-level default timeout for this request, in seconds
89
+ """
90
+ return self._post(
91
+ "/compute/v1/instances",
92
+ body=maybe_transform(
93
+ {
94
+ "instance_type": instance_type,
95
+ "name": name,
96
+ "region": region,
97
+ "auto_shutdown_minutes": auto_shutdown_minutes,
98
+ "vault_ids": vault_ids,
99
+ },
100
+ instance_create_params.InstanceCreateParams,
101
+ ),
102
+ options=make_request_options(
103
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
104
+ ),
105
+ cast_to=InstanceCreateResponse,
106
+ )
107
+
108
+ def retrieve(
109
+ self,
110
+ id: str,
111
+ *,
112
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
113
+ # The extra values given here take precedence over values defined on the client or passed to this method.
114
+ extra_headers: Headers | None = None,
115
+ extra_query: Query | None = None,
116
+ extra_body: Body | None = None,
117
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
118
+ ) -> InstanceRetrieveResponse:
119
+ """
120
+ Retrieves detailed information about a GPU instance including SSH connection
121
+ details, vault mount scripts, real-time cost tracking, and current status. SSH
122
+ private key included for secure access.
123
+
124
+ Args:
125
+ extra_headers: Send extra headers
126
+
127
+ extra_query: Add additional query parameters to the request
128
+
129
+ extra_body: Add additional JSON properties to the request
130
+
131
+ timeout: Override the client-level default timeout for this request, in seconds
132
+ """
133
+ if not id:
134
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
135
+ return self._get(
136
+ f"/compute/v1/instances/{id}",
137
+ options=make_request_options(
138
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
139
+ ),
140
+ cast_to=InstanceRetrieveResponse,
141
+ )
142
+
143
+ def list(
144
+ self,
145
+ *,
146
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
147
+ # The extra values given here take precedence over values defined on the client or passed to this method.
148
+ extra_headers: Headers | None = None,
149
+ extra_query: Query | None = None,
150
+ extra_body: Body | None = None,
151
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
152
+ ) -> InstanceListResponse:
153
+ """
154
+ Retrieves all GPU compute instances for your organization with real-time status
155
+ updates from Lambda Labs. Includes pricing, runtime metrics, and auto-shutdown
156
+ configuration. Perfect for monitoring AI workloads, document processing jobs,
157
+ and cost tracking.
158
+ """
159
+ return self._get(
160
+ "/compute/v1/instances",
161
+ options=make_request_options(
162
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
163
+ ),
164
+ cast_to=InstanceListResponse,
165
+ )
166
+
167
+ def delete(
168
+ self,
169
+ id: str,
170
+ *,
171
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
172
+ # The extra values given here take precedence over values defined on the client or passed to this method.
173
+ extra_headers: Headers | None = None,
174
+ extra_query: Query | None = None,
175
+ extra_body: Body | None = None,
176
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
177
+ ) -> InstanceDeleteResponse:
178
+ """Terminates a running GPU instance, calculates final cost, and cleans up SSH
179
+ keys.
180
+
181
+ This action is permanent and cannot be undone. All data on the instance
182
+ will be lost.
183
+
184
+ Args:
185
+ extra_headers: Send extra headers
186
+
187
+ extra_query: Add additional query parameters to the request
188
+
189
+ extra_body: Add additional JSON properties to the request
190
+
191
+ timeout: Override the client-level default timeout for this request, in seconds
192
+ """
193
+ if not id:
194
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
195
+ return self._delete(
196
+ f"/compute/v1/instances/{id}",
197
+ options=make_request_options(
198
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
199
+ ),
200
+ cast_to=InstanceDeleteResponse,
201
+ )
202
+
203
+
204
+ class AsyncInstancesResource(AsyncAPIResource):
205
+ @cached_property
206
+ def with_raw_response(self) -> AsyncInstancesResourceWithRawResponse:
207
+ """
208
+ This property can be used as a prefix for any HTTP method call to return
209
+ the raw response object instead of the parsed content.
210
+
211
+ For more information, see https://www.github.com/CaseMark/casedev-python#accessing-raw-response-data-eg-headers
212
+ """
213
+ return AsyncInstancesResourceWithRawResponse(self)
214
+
215
+ @cached_property
216
+ def with_streaming_response(self) -> AsyncInstancesResourceWithStreamingResponse:
217
+ """
218
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
219
+
220
+ For more information, see https://www.github.com/CaseMark/casedev-python#with_streaming_response
221
+ """
222
+ return AsyncInstancesResourceWithStreamingResponse(self)
223
+
224
+ async def create(
225
+ self,
226
+ *,
227
+ instance_type: str,
228
+ name: str,
229
+ region: str,
230
+ auto_shutdown_minutes: Optional[int] | Omit = omit,
231
+ vault_ids: SequenceNotStr[str] | Omit = omit,
232
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
233
+ # The extra values given here take precedence over values defined on the client or passed to this method.
234
+ extra_headers: Headers | None = None,
235
+ extra_query: Query | None = None,
236
+ extra_body: Body | None = None,
237
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
238
+ ) -> InstanceCreateResponse:
239
+ """Launches a new GPU compute instance with automatic SSH key generation.
240
+
241
+ Supports
242
+ mounting Case.dev Vaults as filesystems and configurable auto-shutdown. Instance
243
+ boots in ~2-5 minutes. Perfect for batch OCR processing, AI model training, and
244
+ intensive document analysis workloads.
245
+
246
+ Args:
247
+ instance_type: GPU type (e.g., 'gpu_1x_h100_sxm5')
248
+
249
+ name: Instance name
250
+
251
+ region: Region (e.g., 'us-west-1')
252
+
253
+ auto_shutdown_minutes: Auto-shutdown timer (null = never)
254
+
255
+ vault_ids: Vault IDs to mount
256
+
257
+ extra_headers: Send extra headers
258
+
259
+ extra_query: Add additional query parameters to the request
260
+
261
+ extra_body: Add additional JSON properties to the request
262
+
263
+ timeout: Override the client-level default timeout for this request, in seconds
264
+ """
265
+ return await self._post(
266
+ "/compute/v1/instances",
267
+ body=await async_maybe_transform(
268
+ {
269
+ "instance_type": instance_type,
270
+ "name": name,
271
+ "region": region,
272
+ "auto_shutdown_minutes": auto_shutdown_minutes,
273
+ "vault_ids": vault_ids,
274
+ },
275
+ instance_create_params.InstanceCreateParams,
276
+ ),
277
+ options=make_request_options(
278
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
279
+ ),
280
+ cast_to=InstanceCreateResponse,
281
+ )
282
+
283
+ async def retrieve(
284
+ self,
285
+ id: str,
286
+ *,
287
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
288
+ # The extra values given here take precedence over values defined on the client or passed to this method.
289
+ extra_headers: Headers | None = None,
290
+ extra_query: Query | None = None,
291
+ extra_body: Body | None = None,
292
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
293
+ ) -> InstanceRetrieveResponse:
294
+ """
295
+ Retrieves detailed information about a GPU instance including SSH connection
296
+ details, vault mount scripts, real-time cost tracking, and current status. SSH
297
+ private key included for secure access.
298
+
299
+ Args:
300
+ extra_headers: Send extra headers
301
+
302
+ extra_query: Add additional query parameters to the request
303
+
304
+ extra_body: Add additional JSON properties to the request
305
+
306
+ timeout: Override the client-level default timeout for this request, in seconds
307
+ """
308
+ if not id:
309
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
310
+ return await self._get(
311
+ f"/compute/v1/instances/{id}",
312
+ options=make_request_options(
313
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
314
+ ),
315
+ cast_to=InstanceRetrieveResponse,
316
+ )
317
+
318
+ async def list(
319
+ self,
320
+ *,
321
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
322
+ # The extra values given here take precedence over values defined on the client or passed to this method.
323
+ extra_headers: Headers | None = None,
324
+ extra_query: Query | None = None,
325
+ extra_body: Body | None = None,
326
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
327
+ ) -> InstanceListResponse:
328
+ """
329
+ Retrieves all GPU compute instances for your organization with real-time status
330
+ updates from Lambda Labs. Includes pricing, runtime metrics, and auto-shutdown
331
+ configuration. Perfect for monitoring AI workloads, document processing jobs,
332
+ and cost tracking.
333
+ """
334
+ return await self._get(
335
+ "/compute/v1/instances",
336
+ options=make_request_options(
337
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
338
+ ),
339
+ cast_to=InstanceListResponse,
340
+ )
341
+
342
+ async def delete(
343
+ self,
344
+ id: str,
345
+ *,
346
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
347
+ # The extra values given here take precedence over values defined on the client or passed to this method.
348
+ extra_headers: Headers | None = None,
349
+ extra_query: Query | None = None,
350
+ extra_body: Body | None = None,
351
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
352
+ ) -> InstanceDeleteResponse:
353
+ """Terminates a running GPU instance, calculates final cost, and cleans up SSH
354
+ keys.
355
+
356
+ This action is permanent and cannot be undone. All data on the instance
357
+ will be lost.
358
+
359
+ Args:
360
+ extra_headers: Send extra headers
361
+
362
+ extra_query: Add additional query parameters to the request
363
+
364
+ extra_body: Add additional JSON properties to the request
365
+
366
+ timeout: Override the client-level default timeout for this request, in seconds
367
+ """
368
+ if not id:
369
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
370
+ return await self._delete(
371
+ f"/compute/v1/instances/{id}",
372
+ options=make_request_options(
373
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
374
+ ),
375
+ cast_to=InstanceDeleteResponse,
376
+ )
377
+
378
+
379
+ class InstancesResourceWithRawResponse:
380
+ def __init__(self, instances: InstancesResource) -> None:
381
+ self._instances = instances
382
+
383
+ self.create = to_raw_response_wrapper(
384
+ instances.create,
385
+ )
386
+ self.retrieve = to_raw_response_wrapper(
387
+ instances.retrieve,
388
+ )
389
+ self.list = to_raw_response_wrapper(
390
+ instances.list,
391
+ )
392
+ self.delete = to_raw_response_wrapper(
393
+ instances.delete,
394
+ )
395
+
396
+
397
+ class AsyncInstancesResourceWithRawResponse:
398
+ def __init__(self, instances: AsyncInstancesResource) -> None:
399
+ self._instances = instances
400
+
401
+ self.create = async_to_raw_response_wrapper(
402
+ instances.create,
403
+ )
404
+ self.retrieve = async_to_raw_response_wrapper(
405
+ instances.retrieve,
406
+ )
407
+ self.list = async_to_raw_response_wrapper(
408
+ instances.list,
409
+ )
410
+ self.delete = async_to_raw_response_wrapper(
411
+ instances.delete,
412
+ )
413
+
414
+
415
+ class InstancesResourceWithStreamingResponse:
416
+ def __init__(self, instances: InstancesResource) -> None:
417
+ self._instances = instances
418
+
419
+ self.create = to_streamed_response_wrapper(
420
+ instances.create,
421
+ )
422
+ self.retrieve = to_streamed_response_wrapper(
423
+ instances.retrieve,
424
+ )
425
+ self.list = to_streamed_response_wrapper(
426
+ instances.list,
427
+ )
428
+ self.delete = to_streamed_response_wrapper(
429
+ instances.delete,
430
+ )
431
+
432
+
433
+ class AsyncInstancesResourceWithStreamingResponse:
434
+ def __init__(self, instances: AsyncInstancesResource) -> None:
435
+ self._instances = instances
436
+
437
+ self.create = async_to_streamed_response_wrapper(
438
+ instances.create,
439
+ )
440
+ self.retrieve = async_to_streamed_response_wrapper(
441
+ instances.retrieve,
442
+ )
443
+ self.list = async_to_streamed_response_wrapper(
444
+ instances.list,
445
+ )
446
+ self.delete = async_to_streamed_response_wrapper(
447
+ instances.delete,
448
+ )
@@ -14,6 +14,14 @@ from .secrets import (
14
14
  )
15
15
  from ...._types import Body, Omit, Query, Headers, NoneType, NotGiven, omit, not_given
16
16
  from ...._utils import maybe_transform, async_maybe_transform
17
+ from .instances import (
18
+ InstancesResource,
19
+ AsyncInstancesResource,
20
+ InstancesResourceWithRawResponse,
21
+ AsyncInstancesResourceWithRawResponse,
22
+ InstancesResourceWithStreamingResponse,
23
+ AsyncInstancesResourceWithStreamingResponse,
24
+ )
17
25
  from ...._compat import cached_property
18
26
  from ...._resource import SyncAPIResource, AsyncAPIResource
19
27
  from ...._response import (
@@ -30,6 +38,14 @@ from .environments import (
30
38
  EnvironmentsResourceWithStreamingResponse,
31
39
  AsyncEnvironmentsResourceWithStreamingResponse,
32
40
  )
41
+ from .instance_types import (
42
+ InstanceTypesResource,
43
+ AsyncInstanceTypesResource,
44
+ InstanceTypesResourceWithRawResponse,
45
+ AsyncInstanceTypesResourceWithRawResponse,
46
+ InstanceTypesResourceWithStreamingResponse,
47
+ AsyncInstanceTypesResourceWithStreamingResponse,
48
+ )
33
49
  from ...._base_client import make_request_options
34
50
  from ....types.compute import v1_get_usage_params
35
51
  from ....types.compute.v1_get_usage_response import V1GetUsageResponse
@@ -42,6 +58,14 @@ class V1Resource(SyncAPIResource):
42
58
  def environments(self) -> EnvironmentsResource:
43
59
  return EnvironmentsResource(self._client)
44
60
 
61
+ @cached_property
62
+ def instance_types(self) -> InstanceTypesResource:
63
+ return InstanceTypesResource(self._client)
64
+
65
+ @cached_property
66
+ def instances(self) -> InstancesResource:
67
+ return InstancesResource(self._client)
68
+
45
69
  @cached_property
46
70
  def secrets(self) -> SecretsResource:
47
71
  return SecretsResource(self._client)
@@ -144,6 +168,14 @@ class AsyncV1Resource(AsyncAPIResource):
144
168
  def environments(self) -> AsyncEnvironmentsResource:
145
169
  return AsyncEnvironmentsResource(self._client)
146
170
 
171
+ @cached_property
172
+ def instance_types(self) -> AsyncInstanceTypesResource:
173
+ return AsyncInstanceTypesResource(self._client)
174
+
175
+ @cached_property
176
+ def instances(self) -> AsyncInstancesResource:
177
+ return AsyncInstancesResource(self._client)
178
+
147
179
  @cached_property
148
180
  def secrets(self) -> AsyncSecretsResource:
149
181
  return AsyncSecretsResource(self._client)
@@ -256,6 +288,14 @@ class V1ResourceWithRawResponse:
256
288
  def environments(self) -> EnvironmentsResourceWithRawResponse:
257
289
  return EnvironmentsResourceWithRawResponse(self._v1.environments)
258
290
 
291
+ @cached_property
292
+ def instance_types(self) -> InstanceTypesResourceWithRawResponse:
293
+ return InstanceTypesResourceWithRawResponse(self._v1.instance_types)
294
+
295
+ @cached_property
296
+ def instances(self) -> InstancesResourceWithRawResponse:
297
+ return InstancesResourceWithRawResponse(self._v1.instances)
298
+
259
299
  @cached_property
260
300
  def secrets(self) -> SecretsResourceWithRawResponse:
261
301
  return SecretsResourceWithRawResponse(self._v1.secrets)
@@ -276,6 +316,14 @@ class AsyncV1ResourceWithRawResponse:
276
316
  def environments(self) -> AsyncEnvironmentsResourceWithRawResponse:
277
317
  return AsyncEnvironmentsResourceWithRawResponse(self._v1.environments)
278
318
 
319
+ @cached_property
320
+ def instance_types(self) -> AsyncInstanceTypesResourceWithRawResponse:
321
+ return AsyncInstanceTypesResourceWithRawResponse(self._v1.instance_types)
322
+
323
+ @cached_property
324
+ def instances(self) -> AsyncInstancesResourceWithRawResponse:
325
+ return AsyncInstancesResourceWithRawResponse(self._v1.instances)
326
+
279
327
  @cached_property
280
328
  def secrets(self) -> AsyncSecretsResourceWithRawResponse:
281
329
  return AsyncSecretsResourceWithRawResponse(self._v1.secrets)
@@ -296,6 +344,14 @@ class V1ResourceWithStreamingResponse:
296
344
  def environments(self) -> EnvironmentsResourceWithStreamingResponse:
297
345
  return EnvironmentsResourceWithStreamingResponse(self._v1.environments)
298
346
 
347
+ @cached_property
348
+ def instance_types(self) -> InstanceTypesResourceWithStreamingResponse:
349
+ return InstanceTypesResourceWithStreamingResponse(self._v1.instance_types)
350
+
351
+ @cached_property
352
+ def instances(self) -> InstancesResourceWithStreamingResponse:
353
+ return InstancesResourceWithStreamingResponse(self._v1.instances)
354
+
299
355
  @cached_property
300
356
  def secrets(self) -> SecretsResourceWithStreamingResponse:
301
357
  return SecretsResourceWithStreamingResponse(self._v1.secrets)
@@ -316,6 +372,14 @@ class AsyncV1ResourceWithStreamingResponse:
316
372
  def environments(self) -> AsyncEnvironmentsResourceWithStreamingResponse:
317
373
  return AsyncEnvironmentsResourceWithStreamingResponse(self._v1.environments)
318
374
 
375
+ @cached_property
376
+ def instance_types(self) -> AsyncInstanceTypesResourceWithStreamingResponse:
377
+ return AsyncInstanceTypesResourceWithStreamingResponse(self._v1.instance_types)
378
+
379
+ @cached_property
380
+ def instances(self) -> AsyncInstancesResourceWithStreamingResponse:
381
+ return AsyncInstancesResourceWithStreamingResponse(self._v1.instances)
382
+
319
383
  @cached_property
320
384
  def secrets(self) -> AsyncSecretsResourceWithStreamingResponse:
321
385
  return AsyncSecretsResourceWithStreamingResponse(self._v1.secrets)
@@ -0,0 +1,33 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from .v1 import (
4
+ V1Resource,
5
+ AsyncV1Resource,
6
+ V1ResourceWithRawResponse,
7
+ AsyncV1ResourceWithRawResponse,
8
+ V1ResourceWithStreamingResponse,
9
+ AsyncV1ResourceWithStreamingResponse,
10
+ )
11
+ from .database import (
12
+ DatabaseResource,
13
+ AsyncDatabaseResource,
14
+ DatabaseResourceWithRawResponse,
15
+ AsyncDatabaseResourceWithRawResponse,
16
+ DatabaseResourceWithStreamingResponse,
17
+ AsyncDatabaseResourceWithStreamingResponse,
18
+ )
19
+
20
+ __all__ = [
21
+ "V1Resource",
22
+ "AsyncV1Resource",
23
+ "V1ResourceWithRawResponse",
24
+ "AsyncV1ResourceWithRawResponse",
25
+ "V1ResourceWithStreamingResponse",
26
+ "AsyncV1ResourceWithStreamingResponse",
27
+ "DatabaseResource",
28
+ "AsyncDatabaseResource",
29
+ "DatabaseResourceWithRawResponse",
30
+ "AsyncDatabaseResourceWithRawResponse",
31
+ "DatabaseResourceWithStreamingResponse",
32
+ "AsyncDatabaseResourceWithStreamingResponse",
33
+ ]
@@ -0,0 +1,102 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from .v1.v1 import (
6
+ V1Resource,
7
+ AsyncV1Resource,
8
+ V1ResourceWithRawResponse,
9
+ AsyncV1ResourceWithRawResponse,
10
+ V1ResourceWithStreamingResponse,
11
+ AsyncV1ResourceWithStreamingResponse,
12
+ )
13
+ from ..._compat import cached_property
14
+ from ..._resource import SyncAPIResource, AsyncAPIResource
15
+
16
+ __all__ = ["DatabaseResource", "AsyncDatabaseResource"]
17
+
18
+
19
+ class DatabaseResource(SyncAPIResource):
20
+ @cached_property
21
+ def v1(self) -> V1Resource:
22
+ return V1Resource(self._client)
23
+
24
+ @cached_property
25
+ def with_raw_response(self) -> DatabaseResourceWithRawResponse:
26
+ """
27
+ This property can be used as a prefix for any HTTP method call to return
28
+ the raw response object instead of the parsed content.
29
+
30
+ For more information, see https://www.github.com/CaseMark/casedev-python#accessing-raw-response-data-eg-headers
31
+ """
32
+ return DatabaseResourceWithRawResponse(self)
33
+
34
+ @cached_property
35
+ def with_streaming_response(self) -> DatabaseResourceWithStreamingResponse:
36
+ """
37
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
38
+
39
+ For more information, see https://www.github.com/CaseMark/casedev-python#with_streaming_response
40
+ """
41
+ return DatabaseResourceWithStreamingResponse(self)
42
+
43
+
44
+ class AsyncDatabaseResource(AsyncAPIResource):
45
+ @cached_property
46
+ def v1(self) -> AsyncV1Resource:
47
+ return AsyncV1Resource(self._client)
48
+
49
+ @cached_property
50
+ def with_raw_response(self) -> AsyncDatabaseResourceWithRawResponse:
51
+ """
52
+ This property can be used as a prefix for any HTTP method call to return
53
+ the raw response object instead of the parsed content.
54
+
55
+ For more information, see https://www.github.com/CaseMark/casedev-python#accessing-raw-response-data-eg-headers
56
+ """
57
+ return AsyncDatabaseResourceWithRawResponse(self)
58
+
59
+ @cached_property
60
+ def with_streaming_response(self) -> AsyncDatabaseResourceWithStreamingResponse:
61
+ """
62
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
63
+
64
+ For more information, see https://www.github.com/CaseMark/casedev-python#with_streaming_response
65
+ """
66
+ return AsyncDatabaseResourceWithStreamingResponse(self)
67
+
68
+
69
+ class DatabaseResourceWithRawResponse:
70
+ def __init__(self, database: DatabaseResource) -> None:
71
+ self._database = database
72
+
73
+ @cached_property
74
+ def v1(self) -> V1ResourceWithRawResponse:
75
+ return V1ResourceWithRawResponse(self._database.v1)
76
+
77
+
78
+ class AsyncDatabaseResourceWithRawResponse:
79
+ def __init__(self, database: AsyncDatabaseResource) -> None:
80
+ self._database = database
81
+
82
+ @cached_property
83
+ def v1(self) -> AsyncV1ResourceWithRawResponse:
84
+ return AsyncV1ResourceWithRawResponse(self._database.v1)
85
+
86
+
87
+ class DatabaseResourceWithStreamingResponse:
88
+ def __init__(self, database: DatabaseResource) -> None:
89
+ self._database = database
90
+
91
+ @cached_property
92
+ def v1(self) -> V1ResourceWithStreamingResponse:
93
+ return V1ResourceWithStreamingResponse(self._database.v1)
94
+
95
+
96
+ class AsyncDatabaseResourceWithStreamingResponse:
97
+ def __init__(self, database: AsyncDatabaseResource) -> None:
98
+ self._database = database
99
+
100
+ @cached_property
101
+ def v1(self) -> AsyncV1ResourceWithStreamingResponse:
102
+ return AsyncV1ResourceWithStreamingResponse(self._database.v1)