From 9e2c78a3dcf0c5c4d04b21d5915d198c52e54963 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Wed, 26 Jun 2024 19:12:11 +0000 Subject: [PATCH] feat(api): OpenAPI spec update via Stainless API --- .stats.yml | 4 +- api.md | 4 - .../functions/invocations/__init__.py | 14 -- .../functions/invocations/invocations.py | 32 ---- .../resources/functions/invocations/spans.py | 147 ------------------ .../types/devboxes/devbox_logs_list_view.py | 9 ++ .../types/functions/invocations/__init__.py | 2 - .../invocations/invocation_span_list_view.py | 16 -- .../functions/invocations/test_spans.py | 98 ------------ 9 files changed, 11 insertions(+), 315 deletions(-) delete mode 100644 src/runloop_api_client/resources/functions/invocations/spans.py delete mode 100644 src/runloop_api_client/types/functions/invocations/invocation_span_list_view.py delete mode 100644 tests/api_resources/functions/invocations/test_spans.py diff --git a/.stats.yml b/.stats.yml index 2049e5bd1..11f149d6a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 15 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-e741833ec80041045f2b16ea82c2bd4c7b2d4b4bf0ec0f5698b20ece98763d00.yml +configured_endpoints: 14 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-1fdc9bae4fba7d365eca69915191a06ab5b0faec74f80404339e92cba37036f7.yml diff --git a/api.md b/api.md index 25022156b..bb7ee2079 100644 --- a/api.md +++ b/api.md @@ -68,10 +68,6 @@ Types: from runloop_api_client.types.functions.invocations import InvocationSpanListView ``` -Methods: - -- client.functions.invocations.spans.list(invocation_id) -> InvocationSpanListView - # Projects Types: diff --git a/src/runloop_api_client/resources/functions/invocations/__init__.py b/src/runloop_api_client/resources/functions/invocations/__init__.py index dafa50446..338f27980 100644 --- a/src/runloop_api_client/resources/functions/invocations/__init__.py +++ b/src/runloop_api_client/resources/functions/invocations/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .spans import ( - SpansResource, - AsyncSpansResource, - SpansResourceWithRawResponse, - AsyncSpansResourceWithRawResponse, - SpansResourceWithStreamingResponse, - AsyncSpansResourceWithStreamingResponse, -) from .invocations import ( InvocationsResource, AsyncInvocationsResource, @@ -18,12 +10,6 @@ ) __all__ = [ - "SpansResource", - "AsyncSpansResource", - "SpansResourceWithRawResponse", - "AsyncSpansResourceWithRawResponse", - "SpansResourceWithStreamingResponse", - "AsyncSpansResourceWithStreamingResponse", "InvocationsResource", "AsyncInvocationsResource", "InvocationsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/functions/invocations/invocations.py b/src/runloop_api_client/resources/functions/invocations/invocations.py index 66cd346b2..3130b0976 100644 --- a/src/runloop_api_client/resources/functions/invocations/invocations.py +++ b/src/runloop_api_client/resources/functions/invocations/invocations.py @@ -4,14 +4,6 @@ import httpx -from .spans import ( - SpansResource, - AsyncSpansResource, - SpansResourceWithRawResponse, - AsyncSpansResourceWithRawResponse, - SpansResourceWithStreamingResponse, - AsyncSpansResourceWithStreamingResponse, -) from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -31,10 +23,6 @@ class InvocationsResource(SyncAPIResource): - @cached_property - def spans(self) -> SpansResource: - return SpansResource(self._client) - @cached_property def with_raw_response(self) -> InvocationsResourceWithRawResponse: return InvocationsResourceWithRawResponse(self) @@ -133,10 +121,6 @@ def kill( class AsyncInvocationsResource(AsyncAPIResource): - @cached_property - def spans(self) -> AsyncSpansResource: - return AsyncSpansResource(self._client) - @cached_property def with_raw_response(self) -> AsyncInvocationsResourceWithRawResponse: return AsyncInvocationsResourceWithRawResponse(self) @@ -248,10 +232,6 @@ def __init__(self, invocations: InvocationsResource) -> None: invocations.kill, ) - @cached_property - def spans(self) -> SpansResourceWithRawResponse: - return SpansResourceWithRawResponse(self._invocations.spans) - class AsyncInvocationsResourceWithRawResponse: def __init__(self, invocations: AsyncInvocationsResource) -> None: @@ -267,10 +247,6 @@ def __init__(self, invocations: AsyncInvocationsResource) -> None: invocations.kill, ) - @cached_property - def spans(self) -> AsyncSpansResourceWithRawResponse: - return AsyncSpansResourceWithRawResponse(self._invocations.spans) - class InvocationsResourceWithStreamingResponse: def __init__(self, invocations: InvocationsResource) -> None: @@ -286,10 +262,6 @@ def __init__(self, invocations: InvocationsResource) -> None: invocations.kill, ) - @cached_property - def spans(self) -> SpansResourceWithStreamingResponse: - return SpansResourceWithStreamingResponse(self._invocations.spans) - class AsyncInvocationsResourceWithStreamingResponse: def __init__(self, invocations: AsyncInvocationsResource) -> None: @@ -304,7 +276,3 @@ def __init__(self, invocations: AsyncInvocationsResource) -> None: self.kill = async_to_streamed_response_wrapper( invocations.kill, ) - - @cached_property - def spans(self) -> AsyncSpansResourceWithStreamingResponse: - return AsyncSpansResourceWithStreamingResponse(self._invocations.spans) diff --git a/src/runloop_api_client/resources/functions/invocations/spans.py b/src/runloop_api_client/resources/functions/invocations/spans.py deleted file mode 100644 index 3abe920d9..000000000 --- a/src/runloop_api_client/resources/functions/invocations/spans.py +++ /dev/null @@ -1,147 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ...._compat import cached_property -from ...._resource import SyncAPIResource, AsyncAPIResource -from ...._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ...._base_client import ( - make_request_options, -) -from ....types.functions.invocations.invocation_span_list_view import InvocationSpanListView - -__all__ = ["SpansResource", "AsyncSpansResource"] - - -class SpansResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> SpansResourceWithRawResponse: - return SpansResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> SpansResourceWithStreamingResponse: - return SpansResourceWithStreamingResponse(self) - - def list( - self, - invocation_id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> InvocationSpanListView: - """Get the span points for the given invocation. - - This will return the span points - for the invocation. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not invocation_id: - raise ValueError(f"Expected a non-empty value for `invocation_id` but received {invocation_id!r}") - return self._get( - f"/v1/functions/invocations/{invocation_id}/spans", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=InvocationSpanListView, - ) - - -class AsyncSpansResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncSpansResourceWithRawResponse: - return AsyncSpansResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncSpansResourceWithStreamingResponse: - return AsyncSpansResourceWithStreamingResponse(self) - - async def list( - self, - invocation_id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> InvocationSpanListView: - """Get the span points for the given invocation. - - This will return the span points - for the invocation. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not invocation_id: - raise ValueError(f"Expected a non-empty value for `invocation_id` but received {invocation_id!r}") - return await self._get( - f"/v1/functions/invocations/{invocation_id}/spans", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=InvocationSpanListView, - ) - - -class SpansResourceWithRawResponse: - def __init__(self, spans: SpansResource) -> None: - self._spans = spans - - self.list = to_raw_response_wrapper( - spans.list, - ) - - -class AsyncSpansResourceWithRawResponse: - def __init__(self, spans: AsyncSpansResource) -> None: - self._spans = spans - - self.list = async_to_raw_response_wrapper( - spans.list, - ) - - -class SpansResourceWithStreamingResponse: - def __init__(self, spans: SpansResource) -> None: - self._spans = spans - - self.list = to_streamed_response_wrapper( - spans.list, - ) - - -class AsyncSpansResourceWithStreamingResponse: - def __init__(self, spans: AsyncSpansResource) -> None: - self._spans = spans - - self.list = async_to_streamed_response_wrapper( - spans.list, - ) diff --git a/src/runloop_api_client/types/devboxes/devbox_logs_list_view.py b/src/runloop_api_client/types/devboxes/devbox_logs_list_view.py index 94fafc41a..7ecff42c9 100644 --- a/src/runloop_api_client/types/devboxes/devbox_logs_list_view.py +++ b/src/runloop_api_client/types/devboxes/devbox_logs_list_view.py @@ -8,6 +8,15 @@ class Log(BaseModel): + cmd: Optional[str] = None + """The Command Executed""" + + cmd_id: Optional[str] = None + """Identifier of the associated command the log is sourced from.""" + + exit_code: Optional[int] = None + """The Exit Code of the command""" + level: Optional[str] = None """Log line severity level.""" diff --git a/src/runloop_api_client/types/functions/invocations/__init__.py b/src/runloop_api_client/types/functions/invocations/__init__.py index 4caaf4299..f8ee8b14b 100644 --- a/src/runloop_api_client/types/functions/invocations/__init__.py +++ b/src/runloop_api_client/types/functions/invocations/__init__.py @@ -1,5 +1,3 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from __future__ import annotations - -from .invocation_span_list_view import InvocationSpanListView as InvocationSpanListView diff --git a/src/runloop_api_client/types/functions/invocations/invocation_span_list_view.py b/src/runloop_api_client/types/functions/invocations/invocation_span_list_view.py deleted file mode 100644 index 786307ae8..000000000 --- a/src/runloop_api_client/types/functions/invocations/invocation_span_list_view.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ...._models import BaseModel - -__all__ = ["InvocationSpanListView"] - - -class InvocationSpanListView(BaseModel): - invocation_id: Optional[str] = FieldInfo(alias="invocationId", default=None) - - spans: Optional[object] = None - """List of spans matching given query.""" diff --git a/tests/api_resources/functions/invocations/test_spans.py b/tests/api_resources/functions/invocations/test_spans.py deleted file mode 100644 index a906a79e7..000000000 --- a/tests/api_resources/functions/invocations/test_spans.py +++ /dev/null @@ -1,98 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.functions.invocations import InvocationSpanListView - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestSpans: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_list(self, client: Runloop) -> None: - span = client.functions.invocations.spans.list( - "string", - ) - assert_matches_type(InvocationSpanListView, span, path=["response"]) - - @parametrize - def test_raw_response_list(self, client: Runloop) -> None: - response = client.functions.invocations.spans.with_raw_response.list( - "string", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - span = response.parse() - assert_matches_type(InvocationSpanListView, span, path=["response"]) - - @parametrize - def test_streaming_response_list(self, client: Runloop) -> None: - with client.functions.invocations.spans.with_streaming_response.list( - "string", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - span = response.parse() - assert_matches_type(InvocationSpanListView, span, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_list(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `invocation_id` but received ''"): - client.functions.invocations.spans.with_raw_response.list( - "", - ) - - -class TestAsyncSpans: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_list(self, async_client: AsyncRunloop) -> None: - span = await async_client.functions.invocations.spans.list( - "string", - ) - assert_matches_type(InvocationSpanListView, span, path=["response"]) - - @parametrize - async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: - response = await async_client.functions.invocations.spans.with_raw_response.list( - "string", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - span = await response.parse() - assert_matches_type(InvocationSpanListView, span, path=["response"]) - - @parametrize - async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None: - async with async_client.functions.invocations.spans.with_streaming_response.list( - "string", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - span = await response.parse() - assert_matches_type(InvocationSpanListView, span, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_list(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `invocation_id` but received ''"): - await async_client.functions.invocations.spans.with_raw_response.list( - "", - )