77
88import httpx
99
10- from ...types import application_create_params , application_retrieve_params
10+ from ...types import application_create_params , application_delete_params , application_retrieve_params
1111from ..._types import NOT_GIVEN , Body , Query , Headers , NotGiven
1212from ..._utils import (
1313 maybe_transform ,
4141from .production .production import ProductionResource , AsyncProductionResource
4242from .evaluations .evaluations import EvaluationsResource , AsyncEvaluationsResource
4343from ...types .application_create_response import ApplicationCreateResponse
44+ from ...types .application_delete_response import ApplicationDeleteResponse
4445from ...types .application_retrieve_response import ApplicationRetrieveResponse
4546
4647__all__ = ["ApplicationsResource" , "AsyncApplicationsResource" ]
@@ -166,6 +167,56 @@ def retrieve(
166167 cast_to = ApplicationRetrieveResponse ,
167168 )
168169
170+ def delete (
171+ self ,
172+ * ,
173+ name : str ,
174+ stage : str ,
175+ version : str ,
176+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
177+ # The extra values given here take precedence over values defined on the client or passed to this method.
178+ extra_headers : Headers | None = None ,
179+ extra_query : Query | None = None ,
180+ extra_body : Body | None = None ,
181+ timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
182+ ) -> ApplicationDeleteResponse :
183+ """
184+ Delete an application by name, stage, and version
185+
186+ Args:
187+ name: The name of the application to delete
188+
189+ stage: The stage of the application (e.g., production, evaluation)
190+
191+ version: The version of the application to delete
192+
193+ extra_headers: Send extra headers
194+
195+ extra_query: Add additional query parameters to the request
196+
197+ extra_body: Add additional JSON properties to the request
198+
199+ timeout: Override the client-level default timeout for this request, in seconds
200+ """
201+ return self ._delete (
202+ "/v1/application" ,
203+ options = make_request_options (
204+ extra_headers = extra_headers ,
205+ extra_query = extra_query ,
206+ extra_body = extra_body ,
207+ timeout = timeout ,
208+ query = maybe_transform (
209+ {
210+ "name" : name ,
211+ "stage" : stage ,
212+ "version" : version ,
213+ },
214+ application_delete_params .ApplicationDeleteParams ,
215+ ),
216+ ),
217+ cast_to = ApplicationDeleteResponse ,
218+ )
219+
169220
170221class AsyncApplicationsResource (AsyncAPIResource ):
171222 @cached_property
@@ -287,6 +338,56 @@ async def retrieve(
287338 cast_to = ApplicationRetrieveResponse ,
288339 )
289340
341+ async def delete (
342+ self ,
343+ * ,
344+ name : str ,
345+ stage : str ,
346+ version : str ,
347+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
348+ # The extra values given here take precedence over values defined on the client or passed to this method.
349+ extra_headers : Headers | None = None ,
350+ extra_query : Query | None = None ,
351+ extra_body : Body | None = None ,
352+ timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
353+ ) -> ApplicationDeleteResponse :
354+ """
355+ Delete an application by name, stage, and version
356+
357+ Args:
358+ name: The name of the application to delete
359+
360+ stage: The stage of the application (e.g., production, evaluation)
361+
362+ version: The version of the application to delete
363+
364+ extra_headers: Send extra headers
365+
366+ extra_query: Add additional query parameters to the request
367+
368+ extra_body: Add additional JSON properties to the request
369+
370+ timeout: Override the client-level default timeout for this request, in seconds
371+ """
372+ return await self ._delete (
373+ "/v1/application" ,
374+ options = make_request_options (
375+ extra_headers = extra_headers ,
376+ extra_query = extra_query ,
377+ extra_body = extra_body ,
378+ timeout = timeout ,
379+ query = await async_maybe_transform (
380+ {
381+ "name" : name ,
382+ "stage" : stage ,
383+ "version" : version ,
384+ },
385+ application_delete_params .ApplicationDeleteParams ,
386+ ),
387+ ),
388+ cast_to = ApplicationDeleteResponse ,
389+ )
390+
290391
291392class ApplicationsResourceWithRawResponse :
292393 def __init__ (self , applications : ApplicationsResource ) -> None :
@@ -298,6 +399,9 @@ def __init__(self, applications: ApplicationsResource) -> None:
298399 self .retrieve = to_raw_response_wrapper (
299400 applications .retrieve ,
300401 )
402+ self .delete = to_raw_response_wrapper (
403+ applications .delete ,
404+ )
301405
302406 @cached_property
303407 def evaluations (self ) -> EvaluationsResourceWithRawResponse :
@@ -318,6 +422,9 @@ def __init__(self, applications: AsyncApplicationsResource) -> None:
318422 self .retrieve = async_to_raw_response_wrapper (
319423 applications .retrieve ,
320424 )
425+ self .delete = async_to_raw_response_wrapper (
426+ applications .delete ,
427+ )
321428
322429 @cached_property
323430 def evaluations (self ) -> AsyncEvaluationsResourceWithRawResponse :
@@ -338,6 +445,9 @@ def __init__(self, applications: ApplicationsResource) -> None:
338445 self .retrieve = to_streamed_response_wrapper (
339446 applications .retrieve ,
340447 )
448+ self .delete = to_streamed_response_wrapper (
449+ applications .delete ,
450+ )
341451
342452 @cached_property
343453 def evaluations (self ) -> EvaluationsResourceWithStreamingResponse :
@@ -358,6 +468,9 @@ def __init__(self, applications: AsyncApplicationsResource) -> None:
358468 self .retrieve = async_to_streamed_response_wrapper (
359469 applications .retrieve ,
360470 )
471+ self .delete = async_to_streamed_response_wrapper (
472+ applications .delete ,
473+ )
361474
362475 @cached_property
363476 def evaluations (self ) -> AsyncEvaluationsResourceWithStreamingResponse :
0 commit comments