Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9ebcedb

Browse filesBrowse files
authored
feat: add get_open_api_specification method to BuildClient (#336)
Recently we've introduced new endpoint: `/v2/actor-builds/:buildId/openapi-specification` **This PR adds this endpoint to BuildClient** P.S. The link to the documentation is correct, but docs are not yet merged into production. I'll merge this PR after the docs are merged.
1 parent 41b2391 commit 9ebcedb
Copy full SHA for 9ebcedb

1 file changed

+34Lines changed: 34 additions & 0 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src/apify_client/clients/resource_clients
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/apify_client/clients/resource_clients/build.py‎

Copy file name to clipboardExpand all lines: src/apify_client/clients/resource_clients/build.py
+34Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,23 @@ def abort(self) -> dict:
4343
"""
4444
return self._abort()
4545

46+
def get_open_api_specification(self) -> dict | None:
47+
"""Return OpenAPI specification of the Actor's build.
48+
49+
https://docs.apify.com/api/v2/actor-build-openapi-specification-get
50+
51+
Returns:
52+
OpenAPI specification of the Actor's build.
53+
"""
54+
response = self.http_client.call(
55+
url=self._url('openapi-specification'),
56+
method='GET',
57+
)
58+
59+
response_data: dict = response.json()
60+
61+
return response_data
62+
4663
def wait_for_finish(self, *, wait_secs: int | None = None) -> dict | None:
4764
"""Wait synchronously until the build finishes or the server times out.
4865
@@ -103,6 +120,23 @@ async def delete(self) -> None:
103120
"""
104121
return await self._delete()
105122

123+
async def get_open_api_specification(self) -> dict | None:
124+
"""Return OpenAPI specification of the Actor's build.
125+
126+
https://docs.apify.com/api/v2/actor-build-openapi-specification-get
127+
128+
Returns:
129+
OpenAPI specification of the Actor's build.
130+
"""
131+
response = await self.http_client.call(
132+
url=self._url('openapi-specification'),
133+
method='GET',
134+
)
135+
136+
response_data: dict = response.json()
137+
138+
return response_data
139+
106140
async def wait_for_finish(self, *, wait_secs: int | None = None) -> dict | None:
107141
"""Wait synchronously until the build finishes or the server times out.
108142

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.