Skip to content

Commit e75adfb

Browse files
feat(api): update via SDK Studio
1 parent 8bd264b commit e75adfb

File tree

12 files changed

+652
-3
lines changed

12 files changed

+652
-3
lines changed

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 12
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/digitalocean%2Fdigitalocean-genai-sdk-2bbf73b1efbb5271e264d160d4d802781d18b94df56050565fb0579ba06147bd.yml
3-
openapi_spec_hash: 40cced684005d4713404e1c77f0d194f
1+
configured_endpoints: 14
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/digitalocean%2Fdigitalocean-genai-sdk-a98eb68f96d2983dda152d72f9dfe3722ac5dcb60759328fe72858d4e3d16821.yml
3+
openapi_spec_hash: 57506039c91b1054fdd65fe84988f1f0
44
config_hash: 69dc66269416b2e01e8852b5a6788b97

api.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ from gradientai.types.agents import (
3131
APIKeyUpdateResponse,
3232
APIKeyListResponse,
3333
APIKeyDeleteResponse,
34+
APIKeyRegenerateResponse,
3435
)
3536
```
3637

@@ -40,6 +41,19 @@ Methods:
4041
- <code title="put /v2/gen-ai/agents/{agent_uuid}/api_keys/{api_key_uuid}">client.agents.api_keys.<a href="./src/gradientai/resources/agents/api_keys.py">update</a>(path_api_key_uuid, \*, path_agent_uuid, \*\*<a href="src/gradientai/types/agents/api_key_update_params.py">params</a>) -> <a href="./src/gradientai/types/agents/api_key_update_response.py">APIKeyUpdateResponse</a></code>
4142
- <code title="get /v2/gen-ai/agents/{agent_uuid}/api_keys">client.agents.api_keys.<a href="./src/gradientai/resources/agents/api_keys.py">list</a>(agent_uuid, \*\*<a href="src/gradientai/types/agents/api_key_list_params.py">params</a>) -> <a href="./src/gradientai/types/agents/api_key_list_response.py">APIKeyListResponse</a></code>
4243
- <code title="delete /v2/gen-ai/agents/{agent_uuid}/api_keys/{api_key_uuid}">client.agents.api_keys.<a href="./src/gradientai/resources/agents/api_keys.py">delete</a>(api_key_uuid, \*, agent_uuid) -> <a href="./src/gradientai/types/agents/api_key_delete_response.py">APIKeyDeleteResponse</a></code>
44+
- <code title="put /v2/gen-ai/agents/{agent_uuid}/api_keys/{api_key_uuid}/regenerate">client.agents.api_keys.<a href="./src/gradientai/resources/agents/api_keys.py">regenerate</a>(api_key_uuid, \*, agent_uuid) -> <a href="./src/gradientai/types/agents/api_key_regenerate_response.py">APIKeyRegenerateResponse</a></code>
45+
46+
## Functions
47+
48+
Types:
49+
50+
```python
51+
from gradientai.types.agents import FunctionCreateResponse
52+
```
53+
54+
Methods:
55+
56+
- <code title="post /v2/gen-ai/agents/{agent_uuid}/functions">client.agents.functions.<a href="./src/gradientai/resources/agents/functions.py">create</a>(path_agent_uuid, \*\*<a href="src/gradientai/types/agents/function_create_params.py">params</a>) -> <a href="./src/gradientai/types/agents/function_create_response.py">FunctionCreateResponse</a></code>
4357

4458
## Versions
4559

src/gradientai/resources/agents/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@
2424
VersionsResourceWithStreamingResponse,
2525
AsyncVersionsResourceWithStreamingResponse,
2626
)
27+
from .functions import (
28+
FunctionsResource,
29+
AsyncFunctionsResource,
30+
FunctionsResourceWithRawResponse,
31+
AsyncFunctionsResourceWithRawResponse,
32+
FunctionsResourceWithStreamingResponse,
33+
AsyncFunctionsResourceWithStreamingResponse,
34+
)
2735

2836
__all__ = [
2937
"APIKeysResource",
@@ -32,6 +40,12 @@
3240
"AsyncAPIKeysResourceWithRawResponse",
3341
"APIKeysResourceWithStreamingResponse",
3442
"AsyncAPIKeysResourceWithStreamingResponse",
43+
"FunctionsResource",
44+
"AsyncFunctionsResource",
45+
"FunctionsResourceWithRawResponse",
46+
"AsyncFunctionsResourceWithRawResponse",
47+
"FunctionsResourceWithStreamingResponse",
48+
"AsyncFunctionsResourceWithStreamingResponse",
3549
"VersionsResource",
3650
"AsyncVersionsResource",
3751
"VersionsResourceWithRawResponse",

src/gradientai/resources/agents/agents.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@
2626
AsyncVersionsResourceWithStreamingResponse,
2727
)
2828
from ..._compat import cached_property
29+
from .functions import (
30+
FunctionsResource,
31+
AsyncFunctionsResource,
32+
FunctionsResourceWithRawResponse,
33+
AsyncFunctionsResourceWithRawResponse,
34+
FunctionsResourceWithStreamingResponse,
35+
AsyncFunctionsResourceWithStreamingResponse,
36+
)
2937
from ..._resource import SyncAPIResource, AsyncAPIResource
3038
from ..._response import (
3139
to_raw_response_wrapper,
@@ -45,6 +53,10 @@ class AgentsResource(SyncAPIResource):
4553
def api_keys(self) -> APIKeysResource:
4654
return APIKeysResource(self._client)
4755

56+
@cached_property
57+
def functions(self) -> FunctionsResource:
58+
return FunctionsResource(self._client)
59+
4860
@cached_property
4961
def versions(self) -> VersionsResource:
5062
return VersionsResource(self._client)
@@ -188,6 +200,10 @@ class AsyncAgentsResource(AsyncAPIResource):
188200
def api_keys(self) -> AsyncAPIKeysResource:
189201
return AsyncAPIKeysResource(self._client)
190202

203+
@cached_property
204+
def functions(self) -> AsyncFunctionsResource:
205+
return AsyncFunctionsResource(self._client)
206+
191207
@cached_property
192208
def versions(self) -> AsyncVersionsResource:
193209
return AsyncVersionsResource(self._client)
@@ -341,6 +357,10 @@ def __init__(self, agents: AgentsResource) -> None:
341357
def api_keys(self) -> APIKeysResourceWithRawResponse:
342358
return APIKeysResourceWithRawResponse(self._agents.api_keys)
343359

360+
@cached_property
361+
def functions(self) -> FunctionsResourceWithRawResponse:
362+
return FunctionsResourceWithRawResponse(self._agents.functions)
363+
344364
@cached_property
345365
def versions(self) -> VersionsResourceWithRawResponse:
346366
return VersionsResourceWithRawResponse(self._agents.versions)
@@ -361,6 +381,10 @@ def __init__(self, agents: AsyncAgentsResource) -> None:
361381
def api_keys(self) -> AsyncAPIKeysResourceWithRawResponse:
362382
return AsyncAPIKeysResourceWithRawResponse(self._agents.api_keys)
363383

384+
@cached_property
385+
def functions(self) -> AsyncFunctionsResourceWithRawResponse:
386+
return AsyncFunctionsResourceWithRawResponse(self._agents.functions)
387+
364388
@cached_property
365389
def versions(self) -> AsyncVersionsResourceWithRawResponse:
366390
return AsyncVersionsResourceWithRawResponse(self._agents.versions)
@@ -381,6 +405,10 @@ def __init__(self, agents: AgentsResource) -> None:
381405
def api_keys(self) -> APIKeysResourceWithStreamingResponse:
382406
return APIKeysResourceWithStreamingResponse(self._agents.api_keys)
383407

408+
@cached_property
409+
def functions(self) -> FunctionsResourceWithStreamingResponse:
410+
return FunctionsResourceWithStreamingResponse(self._agents.functions)
411+
384412
@cached_property
385413
def versions(self) -> VersionsResourceWithStreamingResponse:
386414
return VersionsResourceWithStreamingResponse(self._agents.versions)
@@ -401,6 +429,10 @@ def __init__(self, agents: AsyncAgentsResource) -> None:
401429
def api_keys(self) -> AsyncAPIKeysResourceWithStreamingResponse:
402430
return AsyncAPIKeysResourceWithStreamingResponse(self._agents.api_keys)
403431

432+
@cached_property
433+
def functions(self) -> AsyncFunctionsResourceWithStreamingResponse:
434+
return AsyncFunctionsResourceWithStreamingResponse(self._agents.functions)
435+
404436
@cached_property
405437
def versions(self) -> AsyncVersionsResourceWithStreamingResponse:
406438
return AsyncVersionsResourceWithStreamingResponse(self._agents.versions)

src/gradientai/resources/agents/api_keys.py

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
from ...types.agents.api_key_create_response import APIKeyCreateResponse
2121
from ...types.agents.api_key_delete_response import APIKeyDeleteResponse
2222
from ...types.agents.api_key_update_response import APIKeyUpdateResponse
23+
from ...types.agents.api_key_regenerate_response import APIKeyRegenerateResponse
2324

2425
__all__ = ["APIKeysResource", "AsyncAPIKeysResource"]
2526

@@ -222,6 +223,43 @@ def delete(
222223
cast_to=APIKeyDeleteResponse,
223224
)
224225

226+
def regenerate(
227+
self,
228+
api_key_uuid: str,
229+
*,
230+
agent_uuid: str,
231+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
232+
# The extra values given here take precedence over values defined on the client or passed to this method.
233+
extra_headers: Headers | None = None,
234+
extra_query: Query | None = None,
235+
extra_body: Body | None = None,
236+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
237+
) -> APIKeyRegenerateResponse:
238+
"""
239+
To regenerate an agent API key, send a PUT request to
240+
`/v2/gen-ai/agents/{agent_uuid}/api_keys/{api_key_uuid}/regenerate`.
241+
242+
Args:
243+
extra_headers: Send extra headers
244+
245+
extra_query: Add additional query parameters to the request
246+
247+
extra_body: Add additional JSON properties to the request
248+
249+
timeout: Override the client-level default timeout for this request, in seconds
250+
"""
251+
if not agent_uuid:
252+
raise ValueError(f"Expected a non-empty value for `agent_uuid` but received {agent_uuid!r}")
253+
if not api_key_uuid:
254+
raise ValueError(f"Expected a non-empty value for `api_key_uuid` but received {api_key_uuid!r}")
255+
return self._put(
256+
f"/v2/gen-ai/agents/{agent_uuid}/api_keys/{api_key_uuid}/regenerate",
257+
options=make_request_options(
258+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
259+
),
260+
cast_to=APIKeyRegenerateResponse,
261+
)
262+
225263

226264
class AsyncAPIKeysResource(AsyncAPIResource):
227265
@cached_property
@@ -421,6 +459,43 @@ async def delete(
421459
cast_to=APIKeyDeleteResponse,
422460
)
423461

462+
async def regenerate(
463+
self,
464+
api_key_uuid: str,
465+
*,
466+
agent_uuid: str,
467+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
468+
# The extra values given here take precedence over values defined on the client or passed to this method.
469+
extra_headers: Headers | None = None,
470+
extra_query: Query | None = None,
471+
extra_body: Body | None = None,
472+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
473+
) -> APIKeyRegenerateResponse:
474+
"""
475+
To regenerate an agent API key, send a PUT request to
476+
`/v2/gen-ai/agents/{agent_uuid}/api_keys/{api_key_uuid}/regenerate`.
477+
478+
Args:
479+
extra_headers: Send extra headers
480+
481+
extra_query: Add additional query parameters to the request
482+
483+
extra_body: Add additional JSON properties to the request
484+
485+
timeout: Override the client-level default timeout for this request, in seconds
486+
"""
487+
if not agent_uuid:
488+
raise ValueError(f"Expected a non-empty value for `agent_uuid` but received {agent_uuid!r}")
489+
if not api_key_uuid:
490+
raise ValueError(f"Expected a non-empty value for `api_key_uuid` but received {api_key_uuid!r}")
491+
return await self._put(
492+
f"/v2/gen-ai/agents/{agent_uuid}/api_keys/{api_key_uuid}/regenerate",
493+
options=make_request_options(
494+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
495+
),
496+
cast_to=APIKeyRegenerateResponse,
497+
)
498+
424499

425500
class APIKeysResourceWithRawResponse:
426501
def __init__(self, api_keys: APIKeysResource) -> None:
@@ -438,6 +513,9 @@ def __init__(self, api_keys: APIKeysResource) -> None:
438513
self.delete = to_raw_response_wrapper(
439514
api_keys.delete,
440515
)
516+
self.regenerate = to_raw_response_wrapper(
517+
api_keys.regenerate,
518+
)
441519

442520

443521
class AsyncAPIKeysResourceWithRawResponse:
@@ -456,6 +534,9 @@ def __init__(self, api_keys: AsyncAPIKeysResource) -> None:
456534
self.delete = async_to_raw_response_wrapper(
457535
api_keys.delete,
458536
)
537+
self.regenerate = async_to_raw_response_wrapper(
538+
api_keys.regenerate,
539+
)
459540

460541

461542
class APIKeysResourceWithStreamingResponse:
@@ -474,6 +555,9 @@ def __init__(self, api_keys: APIKeysResource) -> None:
474555
self.delete = to_streamed_response_wrapper(
475556
api_keys.delete,
476557
)
558+
self.regenerate = to_streamed_response_wrapper(
559+
api_keys.regenerate,
560+
)
477561

478562

479563
class AsyncAPIKeysResourceWithStreamingResponse:
@@ -492,3 +576,6 @@ def __init__(self, api_keys: AsyncAPIKeysResource) -> None:
492576
self.delete = async_to_streamed_response_wrapper(
493577
api_keys.delete,
494578
)
579+
self.regenerate = async_to_streamed_response_wrapper(
580+
api_keys.regenerate,
581+
)

0 commit comments

Comments
 (0)