|
23 | 23 | project_validate_params, |
24 | 24 | project_invite_sme_params, |
25 | 25 | project_retrieve_analytics_params, |
| 26 | + project_create_from_template_params, |
26 | 27 | ) |
27 | 28 | from ..._types import Body, Omit, Query, Headers, NoneType, NotGiven, SequenceNotStr, omit, not_given |
28 | 29 | from ..._utils import maybe_transform, strip_not_given, async_maybe_transform |
@@ -316,6 +317,55 @@ def delete( |
316 | 317 | cast_to=NoneType, |
317 | 318 | ) |
318 | 319 |
|
| 320 | + def create_from_template( |
| 321 | + self, |
| 322 | + *, |
| 323 | + organization_id: str, |
| 324 | + template_project_id: str | Omit = omit, |
| 325 | + description: Optional[str] | Omit = omit, |
| 326 | + name: Optional[str] | Omit = omit, |
| 327 | + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. |
| 328 | + # The extra values given here take precedence over values defined on the client or passed to this method. |
| 329 | + extra_headers: Headers | None = None, |
| 330 | + extra_query: Query | None = None, |
| 331 | + extra_body: Body | None = None, |
| 332 | + timeout: float | httpx.Timeout | None | NotGiven = not_given, |
| 333 | + ) -> ProjectReturnSchema: |
| 334 | + """ |
| 335 | + Create a new project from a template project. |
| 336 | +
|
| 337 | + Args: |
| 338 | + extra_headers: Send extra headers |
| 339 | +
|
| 340 | + extra_query: Add additional query parameters to the request |
| 341 | +
|
| 342 | + extra_body: Add additional JSON properties to the request |
| 343 | +
|
| 344 | + timeout: Override the client-level default timeout for this request, in seconds |
| 345 | + """ |
| 346 | + return self._post( |
| 347 | + "/api/projects/create-from-template", |
| 348 | + body=maybe_transform( |
| 349 | + { |
| 350 | + "organization_id": organization_id, |
| 351 | + "description": description, |
| 352 | + "name": name, |
| 353 | + }, |
| 354 | + project_create_from_template_params.ProjectCreateFromTemplateParams, |
| 355 | + ), |
| 356 | + options=make_request_options( |
| 357 | + extra_headers=extra_headers, |
| 358 | + extra_query=extra_query, |
| 359 | + extra_body=extra_body, |
| 360 | + timeout=timeout, |
| 361 | + query=maybe_transform( |
| 362 | + {"template_project_id": template_project_id}, |
| 363 | + project_create_from_template_params.ProjectCreateFromTemplateParams, |
| 364 | + ), |
| 365 | + ), |
| 366 | + cast_to=ProjectReturnSchema, |
| 367 | + ) |
| 368 | + |
319 | 369 | def detect( |
320 | 370 | self, |
321 | 371 | project_id: str, |
@@ -1089,6 +1139,55 @@ async def delete( |
1089 | 1139 | cast_to=NoneType, |
1090 | 1140 | ) |
1091 | 1141 |
|
| 1142 | + async def create_from_template( |
| 1143 | + self, |
| 1144 | + *, |
| 1145 | + organization_id: str, |
| 1146 | + template_project_id: str | Omit = omit, |
| 1147 | + description: Optional[str] | Omit = omit, |
| 1148 | + name: Optional[str] | Omit = omit, |
| 1149 | + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. |
| 1150 | + # The extra values given here take precedence over values defined on the client or passed to this method. |
| 1151 | + extra_headers: Headers | None = None, |
| 1152 | + extra_query: Query | None = None, |
| 1153 | + extra_body: Body | None = None, |
| 1154 | + timeout: float | httpx.Timeout | None | NotGiven = not_given, |
| 1155 | + ) -> ProjectReturnSchema: |
| 1156 | + """ |
| 1157 | + Create a new project from a template project. |
| 1158 | +
|
| 1159 | + Args: |
| 1160 | + extra_headers: Send extra headers |
| 1161 | +
|
| 1162 | + extra_query: Add additional query parameters to the request |
| 1163 | +
|
| 1164 | + extra_body: Add additional JSON properties to the request |
| 1165 | +
|
| 1166 | + timeout: Override the client-level default timeout for this request, in seconds |
| 1167 | + """ |
| 1168 | + return await self._post( |
| 1169 | + "/api/projects/create-from-template", |
| 1170 | + body=await async_maybe_transform( |
| 1171 | + { |
| 1172 | + "organization_id": organization_id, |
| 1173 | + "description": description, |
| 1174 | + "name": name, |
| 1175 | + }, |
| 1176 | + project_create_from_template_params.ProjectCreateFromTemplateParams, |
| 1177 | + ), |
| 1178 | + options=make_request_options( |
| 1179 | + extra_headers=extra_headers, |
| 1180 | + extra_query=extra_query, |
| 1181 | + extra_body=extra_body, |
| 1182 | + timeout=timeout, |
| 1183 | + query=await async_maybe_transform( |
| 1184 | + {"template_project_id": template_project_id}, |
| 1185 | + project_create_from_template_params.ProjectCreateFromTemplateParams, |
| 1186 | + ), |
| 1187 | + ), |
| 1188 | + cast_to=ProjectReturnSchema, |
| 1189 | + ) |
| 1190 | + |
1092 | 1191 | async def detect( |
1093 | 1192 | self, |
1094 | 1193 | project_id: str, |
@@ -1635,6 +1734,9 @@ def __init__(self, projects: ProjectsResource) -> None: |
1635 | 1734 | self.delete = to_raw_response_wrapper( |
1636 | 1735 | projects.delete, |
1637 | 1736 | ) |
| 1737 | + self.create_from_template = to_raw_response_wrapper( |
| 1738 | + projects.create_from_template, |
| 1739 | + ) |
1638 | 1740 | self.detect = to_raw_response_wrapper( |
1639 | 1741 | projects.detect, |
1640 | 1742 | ) |
@@ -1687,6 +1789,9 @@ def __init__(self, projects: AsyncProjectsResource) -> None: |
1687 | 1789 | self.delete = async_to_raw_response_wrapper( |
1688 | 1790 | projects.delete, |
1689 | 1791 | ) |
| 1792 | + self.create_from_template = async_to_raw_response_wrapper( |
| 1793 | + projects.create_from_template, |
| 1794 | + ) |
1690 | 1795 | self.detect = async_to_raw_response_wrapper( |
1691 | 1796 | projects.detect, |
1692 | 1797 | ) |
@@ -1739,6 +1844,9 @@ def __init__(self, projects: ProjectsResource) -> None: |
1739 | 1844 | self.delete = to_streamed_response_wrapper( |
1740 | 1845 | projects.delete, |
1741 | 1846 | ) |
| 1847 | + self.create_from_template = to_streamed_response_wrapper( |
| 1848 | + projects.create_from_template, |
| 1849 | + ) |
1742 | 1850 | self.detect = to_streamed_response_wrapper( |
1743 | 1851 | projects.detect, |
1744 | 1852 | ) |
@@ -1791,6 +1899,9 @@ def __init__(self, projects: AsyncProjectsResource) -> None: |
1791 | 1899 | self.delete = async_to_streamed_response_wrapper( |
1792 | 1900 | projects.delete, |
1793 | 1901 | ) |
| 1902 | + self.create_from_template = async_to_streamed_response_wrapper( |
| 1903 | + projects.create_from_template, |
| 1904 | + ) |
1794 | 1905 | self.detect = async_to_streamed_response_wrapper( |
1795 | 1906 | projects.detect, |
1796 | 1907 | ) |
|
0 commit comments