| 29 | |
| 30 | |
| 31 | class AppResource(SyncAPIResource): |
| 32 | @cached_property |
| 33 | def with_raw_response(self) -> AppResourceWithRawResponse: |
| 34 | """ |
| 35 | This property can be used as a prefix for any HTTP method call to return |
| 36 | the raw response object instead of the parsed content. |
| 37 | |
| 38 | For more information, see https://www.github.com/sst/opencode-sdk-python#accessing-raw-response-data-eg-headers |
| 39 | """ |
| 40 | return AppResourceWithRawResponse(self) |
| 41 | |
| 42 | @cached_property |
| 43 | def with_streaming_response(self) -> AppResourceWithStreamingResponse: |
| 44 | """ |
| 45 | An alternative to `.with_raw_response` that doesn't eagerly read the response body. |
| 46 | |
| 47 | For more information, see https://www.github.com/sst/opencode-sdk-python#with_streaming_response |
| 48 | """ |
| 49 | return AppResourceWithStreamingResponse(self) |
| 50 | |
| 51 | def get( |
| 52 | self, |
| 53 | *, |
| 54 | # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. |
| 55 | # The extra values given here take precedence over values defined on the client or passed to this method. |
| 56 | extra_headers: Headers | None = None, |
| 57 | extra_query: Query | None = None, |
| 58 | extra_body: Body | None = None, |
| 59 | timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, |
| 60 | ) -> App: |
| 61 | """Get app info""" |
| 62 | return self._get( |
| 63 | "/app", |
| 64 | options=make_request_options( |
| 65 | extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
| 66 | ), |
| 67 | cast_to=App, |
| 68 | ) |
| 69 | |
| 70 | def init( |
| 71 | self, |
| 72 | *, |
| 73 | # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. |
| 74 | # The extra values given here take precedence over values defined on the client or passed to this method. |
| 75 | extra_headers: Headers | None = None, |
| 76 | extra_query: Query | None = None, |
| 77 | extra_body: Body | None = None, |
| 78 | timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, |
| 79 | ) -> AppInitResponse: |
| 80 | """Initialize the app""" |
| 81 | return self._post( |
| 82 | "/app/init", |
| 83 | options=make_request_options( |
| 84 | extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
| 85 | ), |
| 86 | cast_to=AppInitResponse, |
| 87 | ) |
| 88 |
nothing calls this directly
no outgoing calls
no test coverage detected