Skip to content

Commit c63f011

Browse files
feat(axon): add registry delete endpoint (#10769)
1 parent 518301e commit c63f011

4 files changed

Lines changed: 173 additions & 4 deletions

File tree

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 120
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai/runloop-3dc3735bd6dde301483f325e9be5cbae2aabdf9988b7e5a1da920d41e8bb380f.yml
3-
openapi_spec_hash: 70e2f6ccb848ff142fbfa020329951aa
4-
config_hash: 6d102da8b9fcc3d0deb42d7a707e78c6
1+
configured_endpoints: 121
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai/runloop-a9327279b1ba17f0983d92a3065b04a2bc1b5e5e830cf099aef4f79072fe4075.yml
3+
openapi_spec_hash: b63815af36cf18c8cc70be416f9c0f71
4+
config_hash: 2b0535779b180339d10766ba74a96700

api.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ Methods:
131131
- <code title="post /v1/axons">client.axons.<a href="./src/runloop_api_client/resources/axons/axons.py">create</a>(\*\*<a href="src/runloop_api_client/types/axon_create_params.py">params</a>) -> <a href="./src/runloop_api_client/types/axon_view.py">AxonView</a></code>
132132
- <code title="get /v1/axons/{id}">client.axons.<a href="./src/runloop_api_client/resources/axons/axons.py">retrieve</a>(id) -> <a href="./src/runloop_api_client/types/axon_view.py">AxonView</a></code>
133133
- <code title="get /v1/axons">client.axons.<a href="./src/runloop_api_client/resources/axons/axons.py">list</a>(\*\*<a href="src/runloop_api_client/types/axon_list_params.py">params</a>) -> <a href="./src/runloop_api_client/types/axon_view.py">SyncAxonsCursorIDPage[AxonView]</a></code>
134+
- <code title="delete /v1/axons/{id}">client.axons.<a href="./src/runloop_api_client/resources/axons/axons.py">delete</a>(id) -> object</code>
134135
- <code title="post /v1/axons/{id}/publish">client.axons.<a href="./src/runloop_api_client/resources/axons/axons.py">publish</a>(id, \*\*<a href="src/runloop_api_client/types/axon_publish_params.py">params</a>) -> <a href="./src/runloop_api_client/types/publish_result_view.py">PublishResultView</a></code>
135136
- <code title="get /v1/axons/{id}/subscribe/sse">client.axons.<a href="./src/runloop_api_client/resources/axons/axons.py">subscribe_sse</a>(id, \*\*<a href="src/runloop_api_client/types/axon_subscribe_sse_params.py">params</a>) -> <a href="./src/runloop_api_client/types/axon_event_view.py">AxonEventView</a></code>
136137

src/runloop_api_client/resources/axons/axons.py

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,46 @@ def list(
210210
model=AxonView,
211211
)
212212

213+
def delete(
214+
self,
215+
id: str,
216+
*,
217+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
218+
# The extra values given here take precedence over values defined on the client or passed to this method.
219+
extra_headers: Headers | None = None,
220+
extra_query: Query | None = None,
221+
extra_body: Body | None = None,
222+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
223+
idempotency_key: str | None = None,
224+
) -> object:
225+
"""
226+
[Beta] Mark an axon deleted.
227+
228+
Args:
229+
extra_headers: Send extra headers
230+
231+
extra_query: Add additional query parameters to the request
232+
233+
extra_body: Add additional JSON properties to the request
234+
235+
timeout: Override the client-level default timeout for this request, in seconds
236+
237+
idempotency_key: Specify a custom idempotency key for this request
238+
"""
239+
if not id:
240+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
241+
return self._delete(
242+
path_template("/v1/axons/{id}", id=id),
243+
options=make_request_options(
244+
extra_headers=extra_headers,
245+
extra_query=extra_query,
246+
extra_body=extra_body,
247+
timeout=timeout,
248+
idempotency_key=idempotency_key,
249+
),
250+
cast_to=object,
251+
)
252+
213253
def publish(
214254
self,
215255
id: str,
@@ -485,6 +525,46 @@ def list(
485525
model=AxonView,
486526
)
487527

528+
async def delete(
529+
self,
530+
id: str,
531+
*,
532+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
533+
# The extra values given here take precedence over values defined on the client or passed to this method.
534+
extra_headers: Headers | None = None,
535+
extra_query: Query | None = None,
536+
extra_body: Body | None = None,
537+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
538+
idempotency_key: str | None = None,
539+
) -> object:
540+
"""
541+
[Beta] Mark an axon deleted.
542+
543+
Args:
544+
extra_headers: Send extra headers
545+
546+
extra_query: Add additional query parameters to the request
547+
548+
extra_body: Add additional JSON properties to the request
549+
550+
timeout: Override the client-level default timeout for this request, in seconds
551+
552+
idempotency_key: Specify a custom idempotency key for this request
553+
"""
554+
if not id:
555+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
556+
return await self._delete(
557+
path_template("/v1/axons/{id}", id=id),
558+
options=make_request_options(
559+
extra_headers=extra_headers,
560+
extra_query=extra_query,
561+
extra_body=extra_body,
562+
timeout=timeout,
563+
idempotency_key=idempotency_key,
564+
),
565+
cast_to=object,
566+
)
567+
488568
async def publish(
489569
self,
490570
id: str,
@@ -607,6 +687,9 @@ def __init__(self, axons: AxonsResource) -> None:
607687
self.list = to_raw_response_wrapper(
608688
axons.list,
609689
)
690+
self.delete = to_raw_response_wrapper(
691+
axons.delete,
692+
)
610693
self.publish = to_raw_response_wrapper(
611694
axons.publish,
612695
)
@@ -636,6 +719,9 @@ def __init__(self, axons: AsyncAxonsResource) -> None:
636719
self.list = async_to_raw_response_wrapper(
637720
axons.list,
638721
)
722+
self.delete = async_to_raw_response_wrapper(
723+
axons.delete,
724+
)
639725
self.publish = async_to_raw_response_wrapper(
640726
axons.publish,
641727
)
@@ -665,6 +751,9 @@ def __init__(self, axons: AxonsResource) -> None:
665751
self.list = to_streamed_response_wrapper(
666752
axons.list,
667753
)
754+
self.delete = to_streamed_response_wrapper(
755+
axons.delete,
756+
)
668757
self.publish = to_streamed_response_wrapper(
669758
axons.publish,
670759
)
@@ -694,6 +783,9 @@ def __init__(self, axons: AsyncAxonsResource) -> None:
694783
self.list = async_to_streamed_response_wrapper(
695784
axons.list,
696785
)
786+
self.delete = async_to_streamed_response_wrapper(
787+
axons.delete,
788+
)
697789
self.publish = async_to_streamed_response_wrapper(
698790
axons.publish,
699791
)

tests/api_resources/test_axons.py

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,44 @@ def test_streaming_response_list(self, client: Runloop) -> None:
128128

129129
assert cast(Any, response.is_closed) is True
130130

131+
@parametrize
132+
def test_method_delete(self, client: Runloop) -> None:
133+
axon = client.axons.delete(
134+
"id",
135+
)
136+
assert_matches_type(object, axon, path=["response"])
137+
138+
@parametrize
139+
def test_raw_response_delete(self, client: Runloop) -> None:
140+
response = client.axons.with_raw_response.delete(
141+
"id",
142+
)
143+
144+
assert response.is_closed is True
145+
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
146+
axon = response.parse()
147+
assert_matches_type(object, axon, path=["response"])
148+
149+
@parametrize
150+
def test_streaming_response_delete(self, client: Runloop) -> None:
151+
with client.axons.with_streaming_response.delete(
152+
"id",
153+
) as response:
154+
assert not response.is_closed
155+
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
156+
157+
axon = response.parse()
158+
assert_matches_type(object, axon, path=["response"])
159+
160+
assert cast(Any, response.is_closed) is True
161+
162+
@parametrize
163+
def test_path_params_delete(self, client: Runloop) -> None:
164+
with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"):
165+
client.axons.with_raw_response.delete(
166+
"",
167+
)
168+
131169
@parametrize
132170
def test_method_publish(self, client: Runloop) -> None:
133171
axon = client.axons.publish(
@@ -340,6 +378,44 @@ async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None
340378

341379
assert cast(Any, response.is_closed) is True
342380

381+
@parametrize
382+
async def test_method_delete(self, async_client: AsyncRunloop) -> None:
383+
axon = await async_client.axons.delete(
384+
"id",
385+
)
386+
assert_matches_type(object, axon, path=["response"])
387+
388+
@parametrize
389+
async def test_raw_response_delete(self, async_client: AsyncRunloop) -> None:
390+
response = await async_client.axons.with_raw_response.delete(
391+
"id",
392+
)
393+
394+
assert response.is_closed is True
395+
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
396+
axon = await response.parse()
397+
assert_matches_type(object, axon, path=["response"])
398+
399+
@parametrize
400+
async def test_streaming_response_delete(self, async_client: AsyncRunloop) -> None:
401+
async with async_client.axons.with_streaming_response.delete(
402+
"id",
403+
) as response:
404+
assert not response.is_closed
405+
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
406+
407+
axon = await response.parse()
408+
assert_matches_type(object, axon, path=["response"])
409+
410+
assert cast(Any, response.is_closed) is True
411+
412+
@parametrize
413+
async def test_path_params_delete(self, async_client: AsyncRunloop) -> None:
414+
with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"):
415+
await async_client.axons.with_raw_response.delete(
416+
"",
417+
)
418+
343419
@parametrize
344420
async def test_method_publish(self, async_client: AsyncRunloop) -> None:
345421
axon = await async_client.axons.publish(

0 commit comments

Comments
 (0)