MCPcopy Create free account
hub / github.com/anomalyco/opencode-sdk-python / AsyncEventResource

Class AsyncEventResource

src/opencode_ai/resources/event.py:67–106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65
66
67class AsyncEventResource(AsyncAPIResource):
68 @cached_property
69 def with_raw_response(self) -> AsyncEventResourceWithRawResponse:
70 """
71 This property can be used as a prefix for any HTTP method call to return
72 the raw response object instead of the parsed content.
73
74 For more information, see https://www.github.com/sst/opencode-sdk-python#accessing-raw-response-data-eg-headers
75 """
76 return AsyncEventResourceWithRawResponse(self)
77
78 @cached_property
79 def with_streaming_response(self) -> AsyncEventResourceWithStreamingResponse:
80 """
81 An alternative to `.with_raw_response` that doesn't eagerly read the response body.
82
83 For more information, see https://www.github.com/sst/opencode-sdk-python#with_streaming_response
84 """
85 return AsyncEventResourceWithStreamingResponse(self)
86
87 async def list(
88 self,
89 *,
90 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
91 # The extra values given here take precedence over values defined on the client or passed to this method.
92 extra_headers: Headers | None = None,
93 extra_query: Query | None = None,
94 extra_body: Body | None = None,
95 timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
96 ) -> AsyncStream[EventListResponse]:
97 """Get events"""
98 return await self._get(
99 "/event",
100 options=make_request_options(
101 extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
102 ),
103 cast_to=cast(Any, EventListResponse), # Union types cannot be passed in as arguments in the type system
104 stream=True,
105 stream_cls=AsyncStream[EventListResponse],
106 )
107
108
109class EventResourceWithRawResponse:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected