Skip to content

Commit b901dd2

Browse files
Update client for API v1.0.0-beta.24
Auto-generated from devgraph@4fed9213a8751f100aea83ff784742d03a907637 Spec URL: https://github.com/arctir/devgraph-api/tree/v1.0.0-beta.24
1 parent afd3164 commit b901dd2

7 files changed

Lines changed: 367 additions & 2 deletions

File tree

‎devgraph_client/api/entities/get_entity_by_uid.py‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,14 @@ def _get_kwargs(
1414
uid: str,
1515
*,
1616
namespace: str | Unset = "default",
17+
depth: int | Unset = 1,
1718
) -> dict[str, Any]:
1819
params: dict[str, Any] = {}
1920

2021
params["namespace"] = namespace
2122

23+
params["depth"] = depth
24+
2225
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
2326

2427
_kwargs: dict[str, Any] = {
@@ -69,6 +72,7 @@ def sync_detailed(
6972
*,
7073
client: AuthenticatedClient,
7174
namespace: str | Unset = "default",
75+
depth: int | Unset = 1,
7276
) -> Response[Any | EntityWithRelationsResponse | HTTPValidationError]:
7377
"""Retrieve a specific entity by UID with its relations
7478
@@ -78,6 +82,8 @@ def sync_detailed(
7882
Args:
7983
uid (str):
8084
namespace (str | Unset): Default: 'default'.
85+
depth (int | Unset): Number of relationship hops to traverse (1-5). Higher values return
86+
more related entities but may be slower. Default: 1.
8187
8288
Raises:
8389
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -90,6 +96,7 @@ def sync_detailed(
9096
kwargs = _get_kwargs(
9197
uid=uid,
9298
namespace=namespace,
99+
depth=depth,
93100
)
94101

95102
response = client.get_httpx_client().request(
@@ -104,6 +111,7 @@ def sync(
104111
*,
105112
client: AuthenticatedClient,
106113
namespace: str | Unset = "default",
114+
depth: int | Unset = 1,
107115
) -> Any | EntityWithRelationsResponse | HTTPValidationError | None:
108116
"""Retrieve a specific entity by UID with its relations
109117
@@ -113,6 +121,8 @@ def sync(
113121
Args:
114122
uid (str):
115123
namespace (str | Unset): Default: 'default'.
124+
depth (int | Unset): Number of relationship hops to traverse (1-5). Higher values return
125+
more related entities but may be slower. Default: 1.
116126
117127
Raises:
118128
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -126,6 +136,7 @@ def sync(
126136
uid=uid,
127137
client=client,
128138
namespace=namespace,
139+
depth=depth,
129140
).parsed
130141

131142

@@ -134,6 +145,7 @@ async def asyncio_detailed(
134145
*,
135146
client: AuthenticatedClient,
136147
namespace: str | Unset = "default",
148+
depth: int | Unset = 1,
137149
) -> Response[Any | EntityWithRelationsResponse | HTTPValidationError]:
138150
"""Retrieve a specific entity by UID with its relations
139151
@@ -143,6 +155,8 @@ async def asyncio_detailed(
143155
Args:
144156
uid (str):
145157
namespace (str | Unset): Default: 'default'.
158+
depth (int | Unset): Number of relationship hops to traverse (1-5). Higher values return
159+
more related entities but may be slower. Default: 1.
146160
147161
Raises:
148162
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -155,6 +169,7 @@ async def asyncio_detailed(
155169
kwargs = _get_kwargs(
156170
uid=uid,
157171
namespace=namespace,
172+
depth=depth,
158173
)
159174

160175
response = await client.get_async_httpx_client().request(**kwargs)
@@ -167,6 +182,7 @@ async def asyncio(
167182
*,
168183
client: AuthenticatedClient,
169184
namespace: str | Unset = "default",
185+
depth: int | Unset = 1,
170186
) -> Any | EntityWithRelationsResponse | HTTPValidationError | None:
171187
"""Retrieve a specific entity by UID with its relations
172188
@@ -176,6 +192,8 @@ async def asyncio(
176192
Args:
177193
uid (str):
178194
namespace (str | Unset): Default: 'default'.
195+
depth (int | Unset): Number of relationship hops to traverse (1-5). Higher values return
196+
more related entities but may be slower. Default: 1.
179197
180198
Raises:
181199
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -190,5 +208,6 @@ async def asyncio(
190208
uid=uid,
191209
client=client,
192210
namespace=namespace,
211+
depth=depth,
193212
)
194213
).parsed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""Contains endpoint functions for accessing the API"""
Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
from http import HTTPStatus
2+
from typing import Any
3+
4+
import httpx
5+
6+
from ... import errors
7+
from ...client import AuthenticatedClient, Client
8+
from ...models.renderer_manifest import RendererManifest
9+
from ...types import Response
10+
11+
12+
def _get_kwargs() -> dict[str, Any]:
13+
_kwargs: dict[str, Any] = {
14+
"method": "get",
15+
"url": "/api/v1/renderers/allowlist",
16+
}
17+
18+
return _kwargs
19+
20+
21+
def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> list[RendererManifest] | None:
22+
if response.status_code == 200:
23+
response_200 = []
24+
_response_200 = response.json()
25+
for response_200_item_data in _response_200:
26+
response_200_item = RendererManifest.from_dict(response_200_item_data)
27+
28+
response_200.append(response_200_item)
29+
30+
return response_200
31+
32+
if client.raise_on_unexpected_status:
33+
raise errors.UnexpectedStatus(response.status_code, response.content)
34+
else:
35+
return None
36+
37+
38+
def _build_response(
39+
*, client: AuthenticatedClient | Client, response: httpx.Response
40+
) -> Response[list[RendererManifest]]:
41+
return Response(
42+
status_code=HTTPStatus(response.status_code),
43+
content=response.content,
44+
headers=response.headers,
45+
parsed=_parse_response(client=client, response=response),
46+
)
47+
48+
49+
def sync_detailed(
50+
*,
51+
client: AuthenticatedClient | Client,
52+
) -> Response[list[RendererManifest]]:
53+
"""Get Renderer Allowlist
54+
55+
Get the list of allowed renderer domains.
56+
57+
In production, this could be loaded from:
58+
- Database
59+
- Environment variables
60+
- External config service
61+
62+
Raises:
63+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
64+
httpx.TimeoutException: If the request takes longer than Client.timeout.
65+
66+
Returns:
67+
Response[list[RendererManifest]]
68+
"""
69+
70+
kwargs = _get_kwargs()
71+
72+
response = client.get_httpx_client().request(
73+
**kwargs,
74+
)
75+
76+
return _build_response(client=client, response=response)
77+
78+
79+
def sync(
80+
*,
81+
client: AuthenticatedClient | Client,
82+
) -> list[RendererManifest] | None:
83+
"""Get Renderer Allowlist
84+
85+
Get the list of allowed renderer domains.
86+
87+
In production, this could be loaded from:
88+
- Database
89+
- Environment variables
90+
- External config service
91+
92+
Raises:
93+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
94+
httpx.TimeoutException: If the request takes longer than Client.timeout.
95+
96+
Returns:
97+
list[RendererManifest]
98+
"""
99+
100+
return sync_detailed(
101+
client=client,
102+
).parsed
103+
104+
105+
async def asyncio_detailed(
106+
*,
107+
client: AuthenticatedClient | Client,
108+
) -> Response[list[RendererManifest]]:
109+
"""Get Renderer Allowlist
110+
111+
Get the list of allowed renderer domains.
112+
113+
In production, this could be loaded from:
114+
- Database
115+
- Environment variables
116+
- External config service
117+
118+
Raises:
119+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
120+
httpx.TimeoutException: If the request takes longer than Client.timeout.
121+
122+
Returns:
123+
Response[list[RendererManifest]]
124+
"""
125+
126+
kwargs = _get_kwargs()
127+
128+
response = await client.get_async_httpx_client().request(**kwargs)
129+
130+
return _build_response(client=client, response=response)
131+
132+
133+
async def asyncio(
134+
*,
135+
client: AuthenticatedClient | Client,
136+
) -> list[RendererManifest] | None:
137+
"""Get Renderer Allowlist
138+
139+
Get the list of allowed renderer domains.
140+
141+
In production, this could be loaded from:
142+
- Database
143+
- Environment variables
144+
- External config service
145+
146+
Raises:
147+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
148+
httpx.TimeoutException: If the request takes longer than Client.timeout.
149+
150+
Returns:
151+
list[RendererManifest]
152+
"""
153+
154+
return (
155+
await asyncio_detailed(
156+
client=client,
157+
)
158+
).parsed

‎devgraph_client/models/__init__.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@
116116
from .prompt_update import PromptUpdate
117117
from .provider_type_version_info import ProviderTypeVersionInfo
118118
from .provider_version_info import ProviderVersionInfo
119+
from .renderer_manifest import RendererManifest
119120
from .response_format import ResponseFormat
120121
from .response_format_type import ResponseFormatType
121122
from .subscription_response import SubscriptionResponse
@@ -250,6 +251,7 @@
250251
"PromptUpdate",
251252
"ProviderTypeVersionInfo",
252253
"ProviderVersionInfo",
254+
"RendererManifest",
253255
"ResponseFormat",
254256
"ResponseFormatType",
255257
"SubscriptionResponse",

0 commit comments

Comments
 (0)