1515 TestsResourceWithStreamingResponse ,
1616 AsyncTestsResourceWithStreamingResponse ,
1717)
18- from ...types import project_list_params , project_create_params
18+ from ...types import project_list_params , project_create_params , project_update_params
1919from .commits import (
2020 CommitsResource ,
2121 AsyncCommitsResource ,
2424 CommitsResourceWithStreamingResponse ,
2525 AsyncCommitsResourceWithStreamingResponse ,
2626)
27- from ..._types import Body , Omit , Query , Headers , NoneType , NotGiven , omit , not_given
27+ from ..._types import Body , Omit , Query , Headers , NoneType , NotGiven , SequenceNotStr , omit , not_given
2828from ..._utils import path_template , maybe_transform , async_maybe_transform
2929from ..._compat import cached_property
3030from ..._resource import SyncAPIResource , AsyncAPIResource
4545)
4646from ...types .project_list_response import ProjectListResponse
4747from ...types .project_create_response import ProjectCreateResponse
48+ from ...types .project_update_response import ProjectUpdateResponse
4849
4950__all__ = ["ProjectsResource" , "AsyncProjectsResource" ]
5051
@@ -86,7 +87,11 @@ def create(
8687 * ,
8788 name : str ,
8889 task_type : Literal ["llm-base" , "tabular-classification" , "tabular-regression" , "text-classification" ],
90+ data_retention_days : Optional [int ] | Omit = omit ,
8991 description : Optional [str ] | Omit = omit ,
92+ model_developer : Optional [str ] | Omit = omit ,
93+ model_types : Optional [SequenceNotStr [str ]] | Omit = omit ,
94+ purpose : Optional [str ] | Omit = omit ,
9095 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
9196 # The extra values given here take precedence over values defined on the client or passed to this method.
9297 extra_headers : Headers | None = None ,
@@ -102,8 +107,17 @@ def create(
102107
103108 task_type: The task type of the project.
104109
110+ data_retention_days: Number of days to retain monitoring data for this project. Null means data is
111+ retained indefinitely.
112+
105113 description: The project description.
106114
115+ model_developer: Who developed the model used in this project.
116+
117+ model_types: The kinds of model used in this project.
118+
119+ purpose: What the system in this project is intended to do.
120+
107121 extra_headers: Send extra headers
108122
109123 extra_query: Add additional query parameters to the request
@@ -118,7 +132,11 @@ def create(
118132 {
119133 "name" : name ,
120134 "task_type" : task_type ,
135+ "data_retention_days" : data_retention_days ,
121136 "description" : description ,
137+ "model_developer" : model_developer ,
138+ "model_types" : model_types ,
139+ "purpose" : purpose ,
122140 },
123141 project_create_params .ProjectCreateParams ,
124142 ),
@@ -128,6 +146,69 @@ def create(
128146 cast_to = ProjectCreateResponse ,
129147 )
130148
149+ def update (
150+ self ,
151+ project_id : str ,
152+ * ,
153+ data_retention_days : Optional [int ] | Omit = omit ,
154+ description : Optional [str ] | Omit = omit ,
155+ model_developer : Optional [str ] | Omit = omit ,
156+ model_types : Optional [SequenceNotStr [str ]] | Omit = omit ,
157+ name : str | Omit = omit ,
158+ purpose : Optional [str ] | Omit = omit ,
159+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
160+ # The extra values given here take precedence over values defined on the client or passed to this method.
161+ extra_headers : Headers | None = None ,
162+ extra_query : Query | None = None ,
163+ extra_body : Body | None = None ,
164+ timeout : float | httpx .Timeout | None | NotGiven = not_given ,
165+ ) -> ProjectUpdateResponse :
166+ """
167+ Update a project's metadata.
168+
169+ Args:
170+ data_retention_days: Number of days to retain monitoring data for this project. Null means data is
171+ retained indefinitely.
172+
173+ description: The project description.
174+
175+ model_developer: Who developed the model used in this project.
176+
177+ model_types: The kinds of model used in this project.
178+
179+ name: The project name.
180+
181+ purpose: What the system in this project is intended to do.
182+
183+ extra_headers: Send extra headers
184+
185+ extra_query: Add additional query parameters to the request
186+
187+ extra_body: Add additional JSON properties to the request
188+
189+ timeout: Override the client-level default timeout for this request, in seconds
190+ """
191+ if not project_id :
192+ raise ValueError (f"Expected a non-empty value for `project_id` but received { project_id !r} " )
193+ return self ._patch (
194+ path_template ("/projects/{project_id}" , project_id = project_id ),
195+ body = maybe_transform (
196+ {
197+ "data_retention_days" : data_retention_days ,
198+ "description" : description ,
199+ "model_developer" : model_developer ,
200+ "model_types" : model_types ,
201+ "name" : name ,
202+ "purpose" : purpose ,
203+ },
204+ project_update_params .ProjectUpdateParams ,
205+ ),
206+ options = make_request_options (
207+ extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
208+ ),
209+ cast_to = ProjectUpdateResponse ,
210+ )
211+
131212 def list (
132213 self ,
133214 * ,
@@ -255,7 +336,11 @@ async def create(
255336 * ,
256337 name : str ,
257338 task_type : Literal ["llm-base" , "tabular-classification" , "tabular-regression" , "text-classification" ],
339+ data_retention_days : Optional [int ] | Omit = omit ,
258340 description : Optional [str ] | Omit = omit ,
341+ model_developer : Optional [str ] | Omit = omit ,
342+ model_types : Optional [SequenceNotStr [str ]] | Omit = omit ,
343+ purpose : Optional [str ] | Omit = omit ,
259344 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
260345 # The extra values given here take precedence over values defined on the client or passed to this method.
261346 extra_headers : Headers | None = None ,
@@ -271,8 +356,17 @@ async def create(
271356
272357 task_type: The task type of the project.
273358
359+ data_retention_days: Number of days to retain monitoring data for this project. Null means data is
360+ retained indefinitely.
361+
274362 description: The project description.
275363
364+ model_developer: Who developed the model used in this project.
365+
366+ model_types: The kinds of model used in this project.
367+
368+ purpose: What the system in this project is intended to do.
369+
276370 extra_headers: Send extra headers
277371
278372 extra_query: Add additional query parameters to the request
@@ -287,7 +381,11 @@ async def create(
287381 {
288382 "name" : name ,
289383 "task_type" : task_type ,
384+ "data_retention_days" : data_retention_days ,
290385 "description" : description ,
386+ "model_developer" : model_developer ,
387+ "model_types" : model_types ,
388+ "purpose" : purpose ,
291389 },
292390 project_create_params .ProjectCreateParams ,
293391 ),
@@ -297,6 +395,69 @@ async def create(
297395 cast_to = ProjectCreateResponse ,
298396 )
299397
398+ async def update (
399+ self ,
400+ project_id : str ,
401+ * ,
402+ data_retention_days : Optional [int ] | Omit = omit ,
403+ description : Optional [str ] | Omit = omit ,
404+ model_developer : Optional [str ] | Omit = omit ,
405+ model_types : Optional [SequenceNotStr [str ]] | Omit = omit ,
406+ name : str | Omit = omit ,
407+ purpose : Optional [str ] | Omit = omit ,
408+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
409+ # The extra values given here take precedence over values defined on the client or passed to this method.
410+ extra_headers : Headers | None = None ,
411+ extra_query : Query | None = None ,
412+ extra_body : Body | None = None ,
413+ timeout : float | httpx .Timeout | None | NotGiven = not_given ,
414+ ) -> ProjectUpdateResponse :
415+ """
416+ Update a project's metadata.
417+
418+ Args:
419+ data_retention_days: Number of days to retain monitoring data for this project. Null means data is
420+ retained indefinitely.
421+
422+ description: The project description.
423+
424+ model_developer: Who developed the model used in this project.
425+
426+ model_types: The kinds of model used in this project.
427+
428+ name: The project name.
429+
430+ purpose: What the system in this project is intended to do.
431+
432+ extra_headers: Send extra headers
433+
434+ extra_query: Add additional query parameters to the request
435+
436+ extra_body: Add additional JSON properties to the request
437+
438+ timeout: Override the client-level default timeout for this request, in seconds
439+ """
440+ if not project_id :
441+ raise ValueError (f"Expected a non-empty value for `project_id` but received { project_id !r} " )
442+ return await self ._patch (
443+ path_template ("/projects/{project_id}" , project_id = project_id ),
444+ body = await async_maybe_transform (
445+ {
446+ "data_retention_days" : data_retention_days ,
447+ "description" : description ,
448+ "model_developer" : model_developer ,
449+ "model_types" : model_types ,
450+ "name" : name ,
451+ "purpose" : purpose ,
452+ },
453+ project_update_params .ProjectUpdateParams ,
454+ ),
455+ options = make_request_options (
456+ extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
457+ ),
458+ cast_to = ProjectUpdateResponse ,
459+ )
460+
300461 async def list (
301462 self ,
302463 * ,
@@ -394,6 +555,9 @@ def __init__(self, projects: ProjectsResource) -> None:
394555 self .create = to_raw_response_wrapper (
395556 projects .create ,
396557 )
558+ self .update = to_raw_response_wrapper (
559+ projects .update ,
560+ )
397561 self .list = to_raw_response_wrapper (
398562 projects .list ,
399563 )
@@ -421,6 +585,9 @@ def __init__(self, projects: AsyncProjectsResource) -> None:
421585 self .create = async_to_raw_response_wrapper (
422586 projects .create ,
423587 )
588+ self .update = async_to_raw_response_wrapper (
589+ projects .update ,
590+ )
424591 self .list = async_to_raw_response_wrapper (
425592 projects .list ,
426593 )
@@ -448,6 +615,9 @@ def __init__(self, projects: ProjectsResource) -> None:
448615 self .create = to_streamed_response_wrapper (
449616 projects .create ,
450617 )
618+ self .update = to_streamed_response_wrapper (
619+ projects .update ,
620+ )
451621 self .list = to_streamed_response_wrapper (
452622 projects .list ,
453623 )
@@ -475,6 +645,9 @@ def __init__(self, projects: AsyncProjectsResource) -> None:
475645 self .create = async_to_streamed_response_wrapper (
476646 projects .create ,
477647 )
648+ self .update = async_to_streamed_response_wrapper (
649+ projects .update ,
650+ )
478651 self .list = async_to_streamed_response_wrapper (
479652 projects .list ,
480653 )
0 commit comments