Skip to content

Commit de02ef4

Browse files
Update client for API v1.0.0-beta.51
Auto-generated from devgraph@d97e158e53a2d605a59ecc604b1581d49d0ba9e4 Spec URL: https://github.com/arctir/devgraph-api/tree/v1.0.0-beta.51
1 parent 2f11912 commit de02ef4

12 files changed

Lines changed: 867 additions & 2 deletions
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: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
from http import HTTPStatus
2+
from typing import Any, cast
3+
4+
import httpx
5+
6+
from ... import errors
7+
from ...client import AuthenticatedClient, Client
8+
from ...models.scopes_response import ScopesResponse
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/auth/scopes",
16+
}
17+
18+
return _kwargs
19+
20+
21+
def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | ScopesResponse | None:
22+
if response.status_code == 200:
23+
response_200 = ScopesResponse.from_dict(response.json())
24+
25+
return response_200
26+
27+
if response.status_code == 404:
28+
response_404 = cast(Any, None)
29+
return response_404
30+
31+
if client.raise_on_unexpected_status:
32+
raise errors.UnexpectedStatus(response.status_code, response.content)
33+
else:
34+
return None
35+
36+
37+
def _build_response(
38+
*, client: AuthenticatedClient | Client, response: httpx.Response
39+
) -> Response[Any | ScopesResponse]:
40+
return Response(
41+
status_code=HTTPStatus(response.status_code),
42+
content=response.content,
43+
headers=response.headers,
44+
parsed=_parse_response(client=client, response=response),
45+
)
46+
47+
48+
def sync_detailed(
49+
*,
50+
client: AuthenticatedClient | Client,
51+
) -> Response[Any | ScopesResponse]:
52+
"""Get API Scopes Metadata
53+
54+
Get metadata about available API scopes and permissions (public endpoint, no authentication
55+
required)
56+
57+
Raises:
58+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
59+
httpx.TimeoutException: If the request takes longer than Client.timeout.
60+
61+
Returns:
62+
Response[Any | ScopesResponse]
63+
"""
64+
65+
kwargs = _get_kwargs()
66+
67+
response = client.get_httpx_client().request(
68+
**kwargs,
69+
)
70+
71+
return _build_response(client=client, response=response)
72+
73+
74+
def sync(
75+
*,
76+
client: AuthenticatedClient | Client,
77+
) -> Any | ScopesResponse | None:
78+
"""Get API Scopes Metadata
79+
80+
Get metadata about available API scopes and permissions (public endpoint, no authentication
81+
required)
82+
83+
Raises:
84+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
85+
httpx.TimeoutException: If the request takes longer than Client.timeout.
86+
87+
Returns:
88+
Any | ScopesResponse
89+
"""
90+
91+
return sync_detailed(
92+
client=client,
93+
).parsed
94+
95+
96+
async def asyncio_detailed(
97+
*,
98+
client: AuthenticatedClient | Client,
99+
) -> Response[Any | ScopesResponse]:
100+
"""Get API Scopes Metadata
101+
102+
Get metadata about available API scopes and permissions (public endpoint, no authentication
103+
required)
104+
105+
Raises:
106+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
107+
httpx.TimeoutException: If the request takes longer than Client.timeout.
108+
109+
Returns:
110+
Response[Any | ScopesResponse]
111+
"""
112+
113+
kwargs = _get_kwargs()
114+
115+
response = await client.get_async_httpx_client().request(**kwargs)
116+
117+
return _build_response(client=client, response=response)
118+
119+
120+
async def asyncio(
121+
*,
122+
client: AuthenticatedClient | Client,
123+
) -> Any | ScopesResponse | None:
124+
"""Get API Scopes Metadata
125+
126+
Get metadata about available API scopes and permissions (public endpoint, no authentication
127+
required)
128+
129+
Raises:
130+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
131+
httpx.TimeoutException: If the request takes longer than Client.timeout.
132+
133+
Returns:
134+
Any | ScopesResponse
135+
"""
136+
137+
return (
138+
await asyncio_detailed(
139+
client=client,
140+
)
141+
).parsed
Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
from http import HTTPStatus
2+
from typing import Any, cast
3+
4+
import httpx
5+
6+
from ... import errors
7+
from ...client import AuthenticatedClient, Client
8+
from ...models.token_introspection_response import TokenIntrospectionResponse
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/auth/token/introspect",
16+
}
17+
18+
return _kwargs
19+
20+
21+
def _parse_response(
22+
*, client: AuthenticatedClient | Client, response: httpx.Response
23+
) -> Any | TokenIntrospectionResponse | None:
24+
if response.status_code == 200:
25+
response_200 = TokenIntrospectionResponse.from_dict(response.json())
26+
27+
return response_200
28+
29+
if response.status_code == 404:
30+
response_404 = cast(Any, None)
31+
return response_404
32+
33+
if client.raise_on_unexpected_status:
34+
raise errors.UnexpectedStatus(response.status_code, response.content)
35+
else:
36+
return None
37+
38+
39+
def _build_response(
40+
*, client: AuthenticatedClient | Client, response: httpx.Response
41+
) -> Response[Any | TokenIntrospectionResponse]:
42+
return Response(
43+
status_code=HTTPStatus(response.status_code),
44+
content=response.content,
45+
headers=response.headers,
46+
parsed=_parse_response(client=client, response=response),
47+
)
48+
49+
50+
def sync_detailed(
51+
*,
52+
client: AuthenticatedClient,
53+
) -> Response[Any | TokenIntrospectionResponse]:
54+
"""Introspect Access Token
55+
56+
Introspect the current access token to see granted scopes and user information
57+
58+
Raises:
59+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
60+
httpx.TimeoutException: If the request takes longer than Client.timeout.
61+
62+
Returns:
63+
Response[Any | TokenIntrospectionResponse]
64+
"""
65+
66+
kwargs = _get_kwargs()
67+
68+
response = client.get_httpx_client().request(
69+
**kwargs,
70+
)
71+
72+
return _build_response(client=client, response=response)
73+
74+
75+
def sync(
76+
*,
77+
client: AuthenticatedClient,
78+
) -> Any | TokenIntrospectionResponse | None:
79+
"""Introspect Access Token
80+
81+
Introspect the current access token to see granted scopes and user information
82+
83+
Raises:
84+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
85+
httpx.TimeoutException: If the request takes longer than Client.timeout.
86+
87+
Returns:
88+
Any | TokenIntrospectionResponse
89+
"""
90+
91+
return sync_detailed(
92+
client=client,
93+
).parsed
94+
95+
96+
async def asyncio_detailed(
97+
*,
98+
client: AuthenticatedClient,
99+
) -> Response[Any | TokenIntrospectionResponse]:
100+
"""Introspect Access Token
101+
102+
Introspect the current access token to see granted scopes and user information
103+
104+
Raises:
105+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
106+
httpx.TimeoutException: If the request takes longer than Client.timeout.
107+
108+
Returns:
109+
Response[Any | TokenIntrospectionResponse]
110+
"""
111+
112+
kwargs = _get_kwargs()
113+
114+
response = await client.get_async_httpx_client().request(**kwargs)
115+
116+
return _build_response(client=client, response=response)
117+
118+
119+
async def asyncio(
120+
*,
121+
client: AuthenticatedClient,
122+
) -> Any | TokenIntrospectionResponse | None:
123+
"""Introspect Access Token
124+
125+
Introspect the current access token to see granted scopes and user information
126+
127+
Raises:
128+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
129+
httpx.TimeoutException: If the request takes longer than Client.timeout.
130+
131+
Returns:
132+
Any | TokenIntrospectionResponse
133+
"""
134+
135+
return (
136+
await asyncio_detailed(
137+
client=client,
138+
)
139+
).parsed

devgraph_client/models/__init__.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,16 @@
134134
from .renderer_manifest import RendererManifest
135135
from .response_format import ResponseFormat
136136
from .response_format_type import ResponseFormatType
137+
from .scope_info import ScopeInfo
138+
from .scopes_response import ScopesResponse
139+
from .scopes_response_resource_groups import ScopesResponseResourceGroups
140+
from .scopes_response_roles import ScopesResponseRoles
141+
from .scopes_response_scopes import ScopesResponseScopes
137142
from .subscription_response import SubscriptionResponse
138143
from .text_block import TextBlock
139144
from .thinking_block import ThinkingBlock
140145
from .thinking_block_additional_information import ThinkingBlockAdditionalInformation
146+
from .token_introspection_response import TokenIntrospectionResponse
141147
from .tool_call_block import ToolCallBlock
142148
from .tool_call_block_tool_kwargs_type_0 import ToolCallBlockToolKwargsType0
143149
from .typed_chat_message_content import TypedChatMessageContent
@@ -284,10 +290,16 @@
284290
"RendererManifest",
285291
"ResponseFormat",
286292
"ResponseFormatType",
293+
"ScopeInfo",
294+
"ScopesResponse",
295+
"ScopesResponseResourceGroups",
296+
"ScopesResponseRoles",
297+
"ScopesResponseScopes",
287298
"SubscriptionResponse",
288299
"TextBlock",
289300
"ThinkingBlock",
290301
"ThinkingBlockAdditionalInformation",
302+
"TokenIntrospectionResponse",
291303
"ToolCallBlock",
292304
"ToolCallBlockToolKwargsType0",
293305
"TypedChatMessageContent",

0 commit comments

Comments
 (0)