Skip to content

feat: add get_open_api_specification method to BuildClient #336

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 27, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions src/apify_client/clients/resource_clients/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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.

Expand Down
Loading