diff --git a/src/apify_client/clients/resource_clients/build.py b/src/apify_client/clients/resource_clients/build.py index 41d7ac51..19e25fac 100644 --- a/src/apify_client/clients/resource_clients/build.py +++ b/src/apify_client/clients/resource_clients/build.py @@ -43,6 +43,23 @@ def abort(self) -> dict: """ return self._abort() + def get_open_api_specification(self) -> dict | None: + """Return OpenAPI specification of the Actor's build. + + https://docs.apify.com/api/v2/actor-build-openapi-specification-get + + Returns: + OpenAPI specification of the Actor's build. + """ + response = self.http_client.call( + url=self._url('openapi-specification'), + method='GET', + ) + + response_data: dict = response.json() + + return response_data + def wait_for_finish(self, *, wait_secs: int | None = None) -> dict | None: """Wait synchronously until the build finishes or the server times out. @@ -103,6 +120,23 @@ async def delete(self) -> None: """ return await self._delete() + async def get_open_api_specification(self) -> dict | None: + """Return OpenAPI specification of the Actor's build. + + https://docs.apify.com/api/v2/actor-build-openapi-specification-get + + Returns: + OpenAPI specification of the Actor's build. + """ + response = await self.http_client.call( + url=self._url('openapi-specification'), + method='GET', + ) + + response_data: dict = response.json() + + return response_data + async def wait_for_finish(self, *, wait_secs: int | None = None) -> dict | None: """Wait synchronously until the build finishes or the server times out.