diff --git a/src/graphn/_generated/api/connections/__init__.py b/src/graphn/_generated/api/connections/__init__.py new file mode 100644 index 0000000..2d7c0b2 --- /dev/null +++ b/src/graphn/_generated/api/connections/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/src/graphn/_generated/api/connections/authorize_connection.py b/src/graphn/_generated/api/connections/authorize_connection.py new file mode 100644 index 0000000..8641d50 --- /dev/null +++ b/src/graphn/_generated/api/connections/authorize_connection.py @@ -0,0 +1,218 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.connection_authorization_challenge import ( + ConnectionAuthorizationChallenge, +) +from ...models.connection_authorization_start import ConnectionAuthorizationStart +from ...models.error import Error +from ...types import Response + + +def _get_kwargs( + workspace_id: str, + connection_id: str, + *, + body: ConnectionAuthorizationStart, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/v1/{workspace_id}/connections/{connection_id}/authorize".format( + workspace_id=quote(str(workspace_id), safe=""), + connection_id=quote(str(connection_id), safe=""), + ), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ConnectionAuthorizationChallenge | Error | None: + if response.status_code == 200: + response_200 = ConnectionAuthorizationChallenge.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + return response_404 + + if response.status_code == 503: + response_503 = Error.from_dict(response.json()) + + return response_503 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ConnectionAuthorizationChallenge | Error]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + workspace_id: str, + connection_id: str, + *, + client: AuthenticatedClient | Client, + body: ConnectionAuthorizationStart, +) -> Response[ConnectionAuthorizationChallenge | Error]: + """Start or restart provider authorization + + Args: + workspace_id (str): + connection_id (str): + body (ConnectionAuthorizationStart): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ConnectionAuthorizationChallenge | Error] + """ + + kwargs = _get_kwargs( + workspace_id=workspace_id, + connection_id=connection_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + workspace_id: str, + connection_id: str, + *, + client: AuthenticatedClient | Client, + body: ConnectionAuthorizationStart, +) -> ConnectionAuthorizationChallenge | Error | None: + """Start or restart provider authorization + + Args: + workspace_id (str): + connection_id (str): + body (ConnectionAuthorizationStart): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ConnectionAuthorizationChallenge | Error + """ + + return sync_detailed( + workspace_id=workspace_id, + connection_id=connection_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + workspace_id: str, + connection_id: str, + *, + client: AuthenticatedClient | Client, + body: ConnectionAuthorizationStart, +) -> Response[ConnectionAuthorizationChallenge | Error]: + """Start or restart provider authorization + + Args: + workspace_id (str): + connection_id (str): + body (ConnectionAuthorizationStart): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ConnectionAuthorizationChallenge | Error] + """ + + kwargs = _get_kwargs( + workspace_id=workspace_id, + connection_id=connection_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + workspace_id: str, + connection_id: str, + *, + client: AuthenticatedClient | Client, + body: ConnectionAuthorizationStart, +) -> ConnectionAuthorizationChallenge | Error | None: + """Start or restart provider authorization + + Args: + workspace_id (str): + connection_id (str): + body (ConnectionAuthorizationStart): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ConnectionAuthorizationChallenge | Error + """ + + return ( + await asyncio_detailed( + workspace_id=workspace_id, + connection_id=connection_id, + client=client, + body=body, + ) + ).parsed diff --git a/src/graphn/_generated/api/connections/call_managed_connection_tool.py b/src/graphn/_generated/api/connections/call_managed_connection_tool.py new file mode 100644 index 0000000..212c96d --- /dev/null +++ b/src/graphn/_generated/api/connections/call_managed_connection_tool.py @@ -0,0 +1,238 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error import Error +from ...models.managed_connection_tool_call import ManagedConnectionToolCall +from ...models.managed_connection_tool_result import ManagedConnectionToolResult +from ...types import Response + + +def _get_kwargs( + workspace_id: str, + connection_id: str, + tool_name: str, + *, + body: ManagedConnectionToolCall, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/v1/internal/workspaces/{workspace_id}/connections/{connection_id}/tools/{tool_name}/call".format( + workspace_id=quote(str(workspace_id), safe=""), + connection_id=quote(str(connection_id), safe=""), + tool_name=quote(str(tool_name), safe=""), + ), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Error | ManagedConnectionToolResult | None: + if response.status_code == 200: + response_200 = ManagedConnectionToolResult.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + return response_404 + + if response.status_code == 409: + response_409 = Error.from_dict(response.json()) + + return response_409 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Error | ManagedConnectionToolResult]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + workspace_id: str, + connection_id: str, + tool_name: str, + *, + client: AuthenticatedClient, + body: ManagedConnectionToolCall, +) -> Response[Error | ManagedConnectionToolResult]: + """Invoke a GraphN-managed MCP tool + + Internal service-to-service endpoint used by Agent Foundry. + + Args: + workspace_id (str): + connection_id (str): + tool_name (str): + body (ManagedConnectionToolCall): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | ManagedConnectionToolResult] + """ + + kwargs = _get_kwargs( + workspace_id=workspace_id, + connection_id=connection_id, + tool_name=tool_name, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + workspace_id: str, + connection_id: str, + tool_name: str, + *, + client: AuthenticatedClient, + body: ManagedConnectionToolCall, +) -> Error | ManagedConnectionToolResult | None: + """Invoke a GraphN-managed MCP tool + + Internal service-to-service endpoint used by Agent Foundry. + + Args: + workspace_id (str): + connection_id (str): + tool_name (str): + body (ManagedConnectionToolCall): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | ManagedConnectionToolResult + """ + + return sync_detailed( + workspace_id=workspace_id, + connection_id=connection_id, + tool_name=tool_name, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + workspace_id: str, + connection_id: str, + tool_name: str, + *, + client: AuthenticatedClient, + body: ManagedConnectionToolCall, +) -> Response[Error | ManagedConnectionToolResult]: + """Invoke a GraphN-managed MCP tool + + Internal service-to-service endpoint used by Agent Foundry. + + Args: + workspace_id (str): + connection_id (str): + tool_name (str): + body (ManagedConnectionToolCall): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | ManagedConnectionToolResult] + """ + + kwargs = _get_kwargs( + workspace_id=workspace_id, + connection_id=connection_id, + tool_name=tool_name, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + workspace_id: str, + connection_id: str, + tool_name: str, + *, + client: AuthenticatedClient, + body: ManagedConnectionToolCall, +) -> Error | ManagedConnectionToolResult | None: + """Invoke a GraphN-managed MCP tool + + Internal service-to-service endpoint used by Agent Foundry. + + Args: + workspace_id (str): + connection_id (str): + tool_name (str): + body (ManagedConnectionToolCall): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | ManagedConnectionToolResult + """ + + return ( + await asyncio_detailed( + workspace_id=workspace_id, + connection_id=connection_id, + tool_name=tool_name, + client=client, + body=body, + ) + ).parsed diff --git a/src/graphn/_generated/api/connections/complete_connection_authorization.py b/src/graphn/_generated/api/connections/complete_connection_authorization.py new file mode 100644 index 0000000..0e666b5 --- /dev/null +++ b/src/graphn/_generated/api/connections/complete_connection_authorization.py @@ -0,0 +1,237 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error import Error +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + provider_id: str, + *, + state: str, + code: str | Unset = UNSET, + error: str | Unset = UNSET, + error_description: str | Unset = UNSET, +) -> dict[str, Any]: + + params: dict[str, Any] = {} + + params["state"] = state + + params["code"] = code + + params["error"] = error + + params["error_description"] = error_description + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/v1/oauth/connections/{provider_id}/callback".format( + provider_id=quote(str(provider_id), safe=""), + ), + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | Error | None: + if response.status_code == 303: + response_303 = cast(Any, None) + return response_303 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + return response_400 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | Error]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + provider_id: str, + *, + client: AuthenticatedClient | Client, + state: str, + code: str | Unset = UNSET, + error: str | Unset = UNSET, + error_description: str | Unset = UNSET, +) -> Response[Any | Error]: + """Complete a provider OAuth authorization + + Public OAuth callback. Tenant identity, PKCE data, and the final redirect + are recovered exclusively from one-time encrypted state. + + Args: + provider_id (str): + state (str): + code (str | Unset): + error (str | Unset): + error_description (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | Error] + """ + + kwargs = _get_kwargs( + provider_id=provider_id, + state=state, + code=code, + error=error, + error_description=error_description, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + provider_id: str, + *, + client: AuthenticatedClient | Client, + state: str, + code: str | Unset = UNSET, + error: str | Unset = UNSET, + error_description: str | Unset = UNSET, +) -> Any | Error | None: + """Complete a provider OAuth authorization + + Public OAuth callback. Tenant identity, PKCE data, and the final redirect + are recovered exclusively from one-time encrypted state. + + Args: + provider_id (str): + state (str): + code (str | Unset): + error (str | Unset): + error_description (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | Error + """ + + return sync_detailed( + provider_id=provider_id, + client=client, + state=state, + code=code, + error=error, + error_description=error_description, + ).parsed + + +async def asyncio_detailed( + provider_id: str, + *, + client: AuthenticatedClient | Client, + state: str, + code: str | Unset = UNSET, + error: str | Unset = UNSET, + error_description: str | Unset = UNSET, +) -> Response[Any | Error]: + """Complete a provider OAuth authorization + + Public OAuth callback. Tenant identity, PKCE data, and the final redirect + are recovered exclusively from one-time encrypted state. + + Args: + provider_id (str): + state (str): + code (str | Unset): + error (str | Unset): + error_description (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | Error] + """ + + kwargs = _get_kwargs( + provider_id=provider_id, + state=state, + code=code, + error=error, + error_description=error_description, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + provider_id: str, + *, + client: AuthenticatedClient | Client, + state: str, + code: str | Unset = UNSET, + error: str | Unset = UNSET, + error_description: str | Unset = UNSET, +) -> Any | Error | None: + """Complete a provider OAuth authorization + + Public OAuth callback. Tenant identity, PKCE data, and the final redirect + are recovered exclusively from one-time encrypted state. + + Args: + provider_id (str): + state (str): + code (str | Unset): + error (str | Unset): + error_description (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | Error + """ + + return ( + await asyncio_detailed( + provider_id=provider_id, + client=client, + state=state, + code=code, + error=error, + error_description=error_description, + ) + ).parsed diff --git a/src/graphn/_generated/api/connections/create_connection.py b/src/graphn/_generated/api/connections/create_connection.py new file mode 100644 index 0000000..69a250b --- /dev/null +++ b/src/graphn/_generated/api/connections/create_connection.py @@ -0,0 +1,197 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.connection import Connection +from ...models.connection_create import ConnectionCreate +from ...models.error import Error +from ...types import Response + + +def _get_kwargs( + workspace_id: str, + *, + body: ConnectionCreate, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/v1/{workspace_id}/connections".format( + workspace_id=quote(str(workspace_id), safe=""), + ), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Connection | Error | None: + if response.status_code == 201: + response_201 = Connection.from_dict(response.json()) + + return response_201 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + return response_403 + + if response.status_code == 409: + response_409 = Error.from_dict(response.json()) + + return response_409 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Connection | Error]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + workspace_id: str, + *, + client: AuthenticatedClient | Client, + body: ConnectionCreate, +) -> Response[Connection | Error]: + """Create a pending workspace connection + + Args: + workspace_id (str): + body (ConnectionCreate): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Connection | Error] + """ + + kwargs = _get_kwargs( + workspace_id=workspace_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + workspace_id: str, + *, + client: AuthenticatedClient | Client, + body: ConnectionCreate, +) -> Connection | Error | None: + """Create a pending workspace connection + + Args: + workspace_id (str): + body (ConnectionCreate): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Connection | Error + """ + + return sync_detailed( + workspace_id=workspace_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + workspace_id: str, + *, + client: AuthenticatedClient | Client, + body: ConnectionCreate, +) -> Response[Connection | Error]: + """Create a pending workspace connection + + Args: + workspace_id (str): + body (ConnectionCreate): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Connection | Error] + """ + + kwargs = _get_kwargs( + workspace_id=workspace_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + workspace_id: str, + *, + client: AuthenticatedClient | Client, + body: ConnectionCreate, +) -> Connection | Error | None: + """Create a pending workspace connection + + Args: + workspace_id (str): + body (ConnectionCreate): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Connection | Error + """ + + return ( + await asyncio_detailed( + workspace_id=workspace_id, + client=client, + body=body, + ) + ).parsed diff --git a/src/graphn/_generated/api/connections/disconnect_connection.py b/src/graphn/_generated/api/connections/disconnect_connection.py new file mode 100644 index 0000000..d028d75 --- /dev/null +++ b/src/graphn/_generated/api/connections/disconnect_connection.py @@ -0,0 +1,195 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error import Error +from ...types import Response + + +def _get_kwargs( + workspace_id: str, + connection_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/v1/{workspace_id}/connections/{connection_id}".format( + workspace_id=quote(str(workspace_id), safe=""), + connection_id=quote(str(connection_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | Error | None: + if response.status_code == 204: + response_204 = cast(Any, None) + return response_204 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | Error]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + workspace_id: str, + connection_id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[Any | Error]: + """Revoke and disconnect a connection + + Clears the stored credential while retaining the opaque connection ID + so dependent resources can be reconnected without rebinding. + + Args: + workspace_id (str): + connection_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | Error] + """ + + kwargs = _get_kwargs( + workspace_id=workspace_id, + connection_id=connection_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + workspace_id: str, + connection_id: str, + *, + client: AuthenticatedClient | Client, +) -> Any | Error | None: + """Revoke and disconnect a connection + + Clears the stored credential while retaining the opaque connection ID + so dependent resources can be reconnected without rebinding. + + Args: + workspace_id (str): + connection_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | Error + """ + + return sync_detailed( + workspace_id=workspace_id, + connection_id=connection_id, + client=client, + ).parsed + + +async def asyncio_detailed( + workspace_id: str, + connection_id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[Any | Error]: + """Revoke and disconnect a connection + + Clears the stored credential while retaining the opaque connection ID + so dependent resources can be reconnected without rebinding. + + Args: + workspace_id (str): + connection_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | Error] + """ + + kwargs = _get_kwargs( + workspace_id=workspace_id, + connection_id=connection_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + workspace_id: str, + connection_id: str, + *, + client: AuthenticatedClient | Client, +) -> Any | Error | None: + """Revoke and disconnect a connection + + Clears the stored credential while retaining the opaque connection ID + so dependent resources can be reconnected without rebinding. + + Args: + workspace_id (str): + connection_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | Error + """ + + return ( + await asyncio_detailed( + workspace_id=workspace_id, + connection_id=connection_id, + client=client, + ) + ).parsed diff --git a/src/graphn/_generated/api/connections/get_connection.py b/src/graphn/_generated/api/connections/get_connection.py new file mode 100644 index 0000000..9002c56 --- /dev/null +++ b/src/graphn/_generated/api/connections/get_connection.py @@ -0,0 +1,185 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.connection import Connection +from ...models.error import Error +from ...types import Response + + +def _get_kwargs( + workspace_id: str, + connection_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/v1/{workspace_id}/connections/{connection_id}".format( + workspace_id=quote(str(workspace_id), safe=""), + connection_id=quote(str(connection_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Connection | Error | None: + if response.status_code == 200: + response_200 = Connection.from_dict(response.json()) + + return response_200 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Connection | Error]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + workspace_id: str, + connection_id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[Connection | Error]: + """Get connection metadata + + Args: + workspace_id (str): + connection_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Connection | Error] + """ + + kwargs = _get_kwargs( + workspace_id=workspace_id, + connection_id=connection_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + workspace_id: str, + connection_id: str, + *, + client: AuthenticatedClient | Client, +) -> Connection | Error | None: + """Get connection metadata + + Args: + workspace_id (str): + connection_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Connection | Error + """ + + return sync_detailed( + workspace_id=workspace_id, + connection_id=connection_id, + client=client, + ).parsed + + +async def asyncio_detailed( + workspace_id: str, + connection_id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[Connection | Error]: + """Get connection metadata + + Args: + workspace_id (str): + connection_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Connection | Error] + """ + + kwargs = _get_kwargs( + workspace_id=workspace_id, + connection_id=connection_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + workspace_id: str, + connection_id: str, + *, + client: AuthenticatedClient | Client, +) -> Connection | Error | None: + """Get connection metadata + + Args: + workspace_id (str): + connection_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Connection | Error + """ + + return ( + await asyncio_detailed( + workspace_id=workspace_id, + connection_id=connection_id, + client=client, + ) + ).parsed diff --git a/src/graphn/_generated/api/connections/list_connections.py b/src/graphn/_generated/api/connections/list_connections.py new file mode 100644 index 0000000..3ab5b53 --- /dev/null +++ b/src/graphn/_generated/api/connections/list_connections.py @@ -0,0 +1,202 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.connection_list import ConnectionList +from ...models.error import Error +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + workspace_id: str, + *, + limit: int | Unset = 50, + continue_token: str | Unset = UNSET, +) -> dict[str, Any]: + + params: dict[str, Any] = {} + + params["limit"] = limit + + params["continue_token"] = continue_token + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/v1/{workspace_id}/connections".format( + workspace_id=quote(str(workspace_id), safe=""), + ), + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ConnectionList | Error | None: + if response.status_code == 200: + response_200 = ConnectionList.from_dict(response.json()) + + return response_200 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + return response_403 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ConnectionList | Error]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + workspace_id: str, + *, + client: AuthenticatedClient | Client, + limit: int | Unset = 50, + continue_token: str | Unset = UNSET, +) -> Response[ConnectionList | Error]: + """List workspace connections + + Args: + workspace_id (str): + limit (int | Unset): Default: 50. + continue_token (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ConnectionList | Error] + """ + + kwargs = _get_kwargs( + workspace_id=workspace_id, + limit=limit, + continue_token=continue_token, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + workspace_id: str, + *, + client: AuthenticatedClient | Client, + limit: int | Unset = 50, + continue_token: str | Unset = UNSET, +) -> ConnectionList | Error | None: + """List workspace connections + + Args: + workspace_id (str): + limit (int | Unset): Default: 50. + continue_token (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ConnectionList | Error + """ + + return sync_detailed( + workspace_id=workspace_id, + client=client, + limit=limit, + continue_token=continue_token, + ).parsed + + +async def asyncio_detailed( + workspace_id: str, + *, + client: AuthenticatedClient | Client, + limit: int | Unset = 50, + continue_token: str | Unset = UNSET, +) -> Response[ConnectionList | Error]: + """List workspace connections + + Args: + workspace_id (str): + limit (int | Unset): Default: 50. + continue_token (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ConnectionList | Error] + """ + + kwargs = _get_kwargs( + workspace_id=workspace_id, + limit=limit, + continue_token=continue_token, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + workspace_id: str, + *, + client: AuthenticatedClient | Client, + limit: int | Unset = 50, + continue_token: str | Unset = UNSET, +) -> ConnectionList | Error | None: + """List workspace connections + + Args: + workspace_id (str): + limit (int | Unset): Default: 50. + continue_token (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ConnectionList | Error + """ + + return ( + await asyncio_detailed( + workspace_id=workspace_id, + client=client, + limit=limit, + continue_token=continue_token, + ) + ).parsed diff --git a/src/graphn/_generated/api/connections/list_integrations.py b/src/graphn/_generated/api/connections/list_integrations.py new file mode 100644 index 0000000..41024b2 --- /dev/null +++ b/src/graphn/_generated/api/connections/list_integrations.py @@ -0,0 +1,134 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error import Error +from ...models.integration_list import IntegrationList +from ...types import Response + + +def _get_kwargs() -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/v1/integrations", + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Error | IntegrationList | None: + if response.status_code == 200: + response_200 = IntegrationList.from_dict(response.json()) + + return response_200 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + return response_401 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Error | IntegrationList]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, +) -> Response[Error | IntegrationList]: + """List GraphN-managed integration definitions + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | IntegrationList] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, +) -> Error | IntegrationList | None: + """List GraphN-managed integration definitions + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | IntegrationList + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, +) -> Response[Error | IntegrationList]: + """List GraphN-managed integration definitions + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | IntegrationList] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, +) -> Error | IntegrationList | None: + """List GraphN-managed integration definitions + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | IntegrationList + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/src/graphn/_generated/api/connections/receive_gmail_pub_sub_event.py b/src/graphn/_generated/api/connections/receive_gmail_pub_sub_event.py new file mode 100644 index 0000000..96dbba3 --- /dev/null +++ b/src/graphn/_generated/api/connections/receive_gmail_pub_sub_event.py @@ -0,0 +1,191 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error import Error +from ...models.google_pub_sub_envelope import GooglePubSubEnvelope +from ...types import Response + + +def _get_kwargs( + *, + body: GooglePubSubEnvelope, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/v1/connections/events/gmail", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | Error | None: + if response.status_code == 204: + response_204 = cast(Any, None) + return response_204 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + return response_401 + + if response.status_code == 500: + response_500 = Error.from_dict(response.json()) + + return response_500 + + if response.status_code == 503: + response_503 = Error.from_dict(response.json()) + + return response_503 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | Error]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: GooglePubSubEnvelope, +) -> Response[Any | Error]: + """Receive a Google Pub/Sub push for Gmail watches + + Provider callback authenticated with the configured Google Pub/Sub + push-service-account OIDC token and exact audience. + + Args: + body (GooglePubSubEnvelope): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | Error] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: GooglePubSubEnvelope, +) -> Any | Error | None: + """Receive a Google Pub/Sub push for Gmail watches + + Provider callback authenticated with the configured Google Pub/Sub + push-service-account OIDC token and exact audience. + + Args: + body (GooglePubSubEnvelope): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | Error + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: GooglePubSubEnvelope, +) -> Response[Any | Error]: + """Receive a Google Pub/Sub push for Gmail watches + + Provider callback authenticated with the configured Google Pub/Sub + push-service-account OIDC token and exact audience. + + Args: + body (GooglePubSubEnvelope): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | Error] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: GooglePubSubEnvelope, +) -> Any | Error | None: + """Receive a Google Pub/Sub push for Gmail watches + + Provider callback authenticated with the configured Google Pub/Sub + push-service-account OIDC token and exact audience. + + Args: + body (GooglePubSubEnvelope): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | Error + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/src/graphn/_generated/api/custom_models/create_custom_model.py b/src/graphn/_generated/api/custom_models/create_custom_model.py index 62cdbf3..80b6822 100644 --- a/src/graphn/_generated/api/custom_models/create_custom_model.py +++ b/src/graphn/_generated/api/custom_models/create_custom_model.py @@ -85,10 +85,10 @@ def sync_detailed( client: AuthenticatedClient | Client, body: CustomModelCreate, ) -> Response[CustomModel | Error]: - r"""Register a new custom model + """Register a new custom model Begin import + deployment of a custom model. The response returns - immediately with `status: \"deploying\"`. Poll `getCustomModel` + immediately with `status: "deploying"`. Poll `getCustomModel` (or use the SDK's `wait_until_ready`) until the status reaches `ready` or `failed`. @@ -122,10 +122,10 @@ def sync( client: AuthenticatedClient | Client, body: CustomModelCreate, ) -> CustomModel | Error | None: - r"""Register a new custom model + """Register a new custom model Begin import + deployment of a custom model. The response returns - immediately with `status: \"deploying\"`. Poll `getCustomModel` + immediately with `status: "deploying"`. Poll `getCustomModel` (or use the SDK's `wait_until_ready`) until the status reaches `ready` or `failed`. @@ -154,10 +154,10 @@ async def asyncio_detailed( client: AuthenticatedClient | Client, body: CustomModelCreate, ) -> Response[CustomModel | Error]: - r"""Register a new custom model + """Register a new custom model Begin import + deployment of a custom model. The response returns - immediately with `status: \"deploying\"`. Poll `getCustomModel` + immediately with `status: "deploying"`. Poll `getCustomModel` (or use the SDK's `wait_until_ready`) until the status reaches `ready` or `failed`. @@ -189,10 +189,10 @@ async def asyncio( client: AuthenticatedClient | Client, body: CustomModelCreate, ) -> CustomModel | Error | None: - r"""Register a new custom model + """Register a new custom model Begin import + deployment of a custom model. The response returns - immediately with `status: \"deploying\"`. Poll `getCustomModel` + immediately with `status: "deploying"`. Poll `getCustomModel` (or use the SDK's `wait_until_ready`) until the status reaches `ready` or `failed`. diff --git a/src/graphn/_generated/api/custom_models/wake_custom_model.py b/src/graphn/_generated/api/custom_models/wake_custom_model.py index e16da94..d7f353b 100644 --- a/src/graphn/_generated/api/custom_models/wake_custom_model.py +++ b/src/graphn/_generated/api/custom_models/wake_custom_model.py @@ -78,12 +78,12 @@ def sync_detailed( *, client: AuthenticatedClient | Client, ) -> Response[CustomModel | Error]: - r"""Wake a scaled-to-zero custom model + """Wake a scaled-to-zero custom model Custom models scale to zero replicas after `cooldown_seconds` of inactivity. Calling `wake` brings the deployment back up to its configured `min_replicas` (or 1 if `min_replicas` is 0). Returns - immediately; poll `getCustomModel` until `status: \"ready\"` and a + immediately; poll `getCustomModel` until `status: "ready"` and a non-empty `endpoint`. Args: @@ -116,12 +116,12 @@ def sync( *, client: AuthenticatedClient | Client, ) -> CustomModel | Error | None: - r"""Wake a scaled-to-zero custom model + """Wake a scaled-to-zero custom model Custom models scale to zero replicas after `cooldown_seconds` of inactivity. Calling `wake` brings the deployment back up to its configured `min_replicas` (or 1 if `min_replicas` is 0). Returns - immediately; poll `getCustomModel` until `status: \"ready\"` and a + immediately; poll `getCustomModel` until `status: "ready"` and a non-empty `endpoint`. Args: @@ -149,12 +149,12 @@ async def asyncio_detailed( *, client: AuthenticatedClient | Client, ) -> Response[CustomModel | Error]: - r"""Wake a scaled-to-zero custom model + """Wake a scaled-to-zero custom model Custom models scale to zero replicas after `cooldown_seconds` of inactivity. Calling `wake` brings the deployment back up to its configured `min_replicas` (or 1 if `min_replicas` is 0). Returns - immediately; poll `getCustomModel` until `status: \"ready\"` and a + immediately; poll `getCustomModel` until `status: "ready"` and a non-empty `endpoint`. Args: @@ -185,12 +185,12 @@ async def asyncio( *, client: AuthenticatedClient | Client, ) -> CustomModel | Error | None: - r"""Wake a scaled-to-zero custom model + """Wake a scaled-to-zero custom model Custom models scale to zero replicas after `cooldown_seconds` of inactivity. Calling `wake` brings the deployment back up to its configured `min_replicas` (or 1 if `min_replicas` is 0). Returns - immediately; poll `getCustomModel` until `status: \"ready\"` and a + immediately; poll `getCustomModel` until `status: "ready"` and a non-empty `endpoint`. Args: diff --git a/src/graphn/_generated/api/knowledgebases/get_knowledgebase_document_media.py b/src/graphn/_generated/api/knowledgebases/get_knowledgebase_document_media.py new file mode 100644 index 0000000..0539707 --- /dev/null +++ b/src/graphn/_generated/api/knowledgebases/get_knowledgebase_document_media.py @@ -0,0 +1,225 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.document_media import DocumentMedia +from ...models.error import Error +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + workspace_id: str, + kb_id: str, + doc_id: str, + *, + index: int | Unset = 0, +) -> dict[str, Any]: + + params: dict[str, Any] = {} + + params["index"] = index + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/v1/{workspace_id}/knowledgebases/{kb_id}/documents/{doc_id}/media".format( + workspace_id=quote(str(workspace_id), safe=""), + kb_id=quote(str(kb_id), safe=""), + doc_id=quote(str(doc_id), safe=""), + ), + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> DocumentMedia | Error | None: + if response.status_code == 200: + response_200 = DocumentMedia.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[DocumentMedia | Error]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + workspace_id: str, + kb_id: str, + doc_id: str, + *, + client: AuthenticatedClient | Client, + index: int | Unset = 0, +) -> Response[DocumentMedia | Error]: + """Mint a fresh playable URL for document media + + Args: + workspace_id (str): + kb_id (str): + doc_id (str): + index (int | Unset): Default: 0. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DocumentMedia | Error] + """ + + kwargs = _get_kwargs( + workspace_id=workspace_id, + kb_id=kb_id, + doc_id=doc_id, + index=index, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + workspace_id: str, + kb_id: str, + doc_id: str, + *, + client: AuthenticatedClient | Client, + index: int | Unset = 0, +) -> DocumentMedia | Error | None: + """Mint a fresh playable URL for document media + + Args: + workspace_id (str): + kb_id (str): + doc_id (str): + index (int | Unset): Default: 0. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DocumentMedia | Error + """ + + return sync_detailed( + workspace_id=workspace_id, + kb_id=kb_id, + doc_id=doc_id, + client=client, + index=index, + ).parsed + + +async def asyncio_detailed( + workspace_id: str, + kb_id: str, + doc_id: str, + *, + client: AuthenticatedClient | Client, + index: int | Unset = 0, +) -> Response[DocumentMedia | Error]: + """Mint a fresh playable URL for document media + + Args: + workspace_id (str): + kb_id (str): + doc_id (str): + index (int | Unset): Default: 0. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DocumentMedia | Error] + """ + + kwargs = _get_kwargs( + workspace_id=workspace_id, + kb_id=kb_id, + doc_id=doc_id, + index=index, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + workspace_id: str, + kb_id: str, + doc_id: str, + *, + client: AuthenticatedClient | Client, + index: int | Unset = 0, +) -> DocumentMedia | Error | None: + """Mint a fresh playable URL for document media + + Args: + workspace_id (str): + kb_id (str): + doc_id (str): + index (int | Unset): Default: 0. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DocumentMedia | Error + """ + + return ( + await asyncio_detailed( + workspace_id=workspace_id, + kb_id=kb_id, + doc_id=doc_id, + client=client, + index=index, + ) + ).parsed diff --git a/src/graphn/_generated/api/objects/post_object.py b/src/graphn/_generated/api/objects/post_object.py index fcdd9e9..d156891 100644 --- a/src/graphn/_generated/api/objects/post_object.py +++ b/src/graphn/_generated/api/objects/post_object.py @@ -125,12 +125,12 @@ def sync_detailed( upload_id: str | Unset = UNSET, part_number: int | Unset = UNSET, ) -> Response[Error | StoragePostResult]: - r"""MPU init/complete or mint a presigned URL + """MPU init/complete or mint a presigned URL Query-string dispatch: - `?uploads` — initiate multipart upload. - - `?uploadId=` — complete MPU. Body `{ \"parts\":[{\"part_number\":N,\"etag\":\"...\"}] }`. + - `?uploadId=` — complete MPU. Body `{ "parts":[{"part_number":N,"etag":"..."}] }`. - `?type=download&expires=SEC` — presigned GET. - `?type=upload&expires=&max-size=&content-type=` — presigned PUT. - `?type=upload_part&upload_id=&part_number=` — presigned MPU part. @@ -192,12 +192,12 @@ def sync( upload_id: str | Unset = UNSET, part_number: int | Unset = UNSET, ) -> Error | StoragePostResult | None: - r"""MPU init/complete or mint a presigned URL + """MPU init/complete or mint a presigned URL Query-string dispatch: - `?uploads` — initiate multipart upload. - - `?uploadId=` — complete MPU. Body `{ \"parts\":[{\"part_number\":N,\"etag\":\"...\"}] }`. + - `?uploadId=` — complete MPU. Body `{ "parts":[{"part_number":N,"etag":"..."}] }`. - `?type=download&expires=SEC` — presigned GET. - `?type=upload&expires=&max-size=&content-type=` — presigned PUT. - `?type=upload_part&upload_id=&part_number=` — presigned MPU part. @@ -254,12 +254,12 @@ async def asyncio_detailed( upload_id: str | Unset = UNSET, part_number: int | Unset = UNSET, ) -> Response[Error | StoragePostResult]: - r"""MPU init/complete or mint a presigned URL + """MPU init/complete or mint a presigned URL Query-string dispatch: - `?uploads` — initiate multipart upload. - - `?uploadId=` — complete MPU. Body `{ \"parts\":[{\"part_number\":N,\"etag\":\"...\"}] }`. + - `?uploadId=` — complete MPU. Body `{ "parts":[{"part_number":N,"etag":"..."}] }`. - `?type=download&expires=SEC` — presigned GET. - `?type=upload&expires=&max-size=&content-type=` — presigned PUT. - `?type=upload_part&upload_id=&part_number=` — presigned MPU part. @@ -319,12 +319,12 @@ async def asyncio( upload_id: str | Unset = UNSET, part_number: int | Unset = UNSET, ) -> Error | StoragePostResult | None: - r"""MPU init/complete or mint a presigned URL + """MPU init/complete or mint a presigned URL Query-string dispatch: - `?uploads` — initiate multipart upload. - - `?uploadId=` — complete MPU. Body `{ \"parts\":[{\"part_number\":N,\"etag\":\"...\"}] }`. + - `?uploadId=` — complete MPU. Body `{ "parts":[{"part_number":N,"etag":"..."}] }`. - `?type=download&expires=SEC` — presigned GET. - `?type=upload&expires=&max-size=&content-type=` — presigned PUT. - `?type=upload_part&upload_id=&part_number=` — presigned MPU part. diff --git a/src/graphn/_generated/client.py b/src/graphn/_generated/client.py index a5f74f6..08206ec 100644 --- a/src/graphn/_generated/client.py +++ b/src/graphn/_generated/client.py @@ -1,5 +1,5 @@ import ssl -from typing import Any +from typing import Any, Self import httpx from attrs import define, evolve, field @@ -73,7 +73,7 @@ def with_timeout(self, timeout: httpx.Timeout) -> "Client": self._async_client.timeout = timeout return evolve(self, timeout=timeout) - def set_httpx_client(self, client: httpx.Client) -> "Client": + def set_httpx_client(self, client: httpx.Client) -> Self: """Manually set the underlying httpx.Client **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. @@ -95,7 +95,7 @@ def get_httpx_client(self) -> httpx.Client: ) return self._client - def __enter__(self) -> "Client": + def __enter__(self) -> Self: """Enter a context manager for self.client—you cannot enter twice (see httpx docs)""" self.get_httpx_client().__enter__() return self @@ -104,7 +104,7 @@ def __exit__(self, *args: object, **kwargs: Any) -> None: """Exit a context manager for internal httpx.Client (see httpx docs)""" self.get_httpx_client().__exit__(*args, **kwargs) - def set_async_httpx_client(self, async_client: httpx.AsyncClient) -> "Client": + def set_async_httpx_client(self, async_client: httpx.AsyncClient) -> Self: """Manually set the underlying httpx.AsyncClient **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. @@ -126,7 +126,7 @@ def get_async_httpx_client(self) -> httpx.AsyncClient: ) return self._async_client - async def __aenter__(self) -> "Client": + async def __aenter__(self) -> Self: """Enter a context manager for underlying httpx.AsyncClient—you cannot enter twice (see httpx docs)""" await self.get_async_httpx_client().__aenter__() return self @@ -211,7 +211,7 @@ def with_timeout(self, timeout: httpx.Timeout) -> "AuthenticatedClient": self._async_client.timeout = timeout return evolve(self, timeout=timeout) - def set_httpx_client(self, client: httpx.Client) -> "AuthenticatedClient": + def set_httpx_client(self, client: httpx.Client) -> Self: """Manually set the underlying httpx.Client **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. @@ -236,7 +236,7 @@ def get_httpx_client(self) -> httpx.Client: ) return self._client - def __enter__(self) -> "AuthenticatedClient": + def __enter__(self) -> Self: """Enter a context manager for self.client—you cannot enter twice (see httpx docs)""" self.get_httpx_client().__enter__() return self @@ -245,9 +245,7 @@ def __exit__(self, *args: object, **kwargs: Any) -> None: """Exit a context manager for internal httpx.Client (see httpx docs)""" self.get_httpx_client().__exit__(*args, **kwargs) - def set_async_httpx_client( - self, async_client: httpx.AsyncClient - ) -> "AuthenticatedClient": + def set_async_httpx_client(self, async_client: httpx.AsyncClient) -> Self: """Manually set the underlying httpx.AsyncClient **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. @@ -272,7 +270,7 @@ def get_async_httpx_client(self) -> httpx.AsyncClient: ) return self._async_client - async def __aenter__(self) -> "AuthenticatedClient": + async def __aenter__(self) -> Self: """Enter a context manager for underlying httpx.AsyncClient—you cannot enter twice (see httpx docs)""" await self.get_async_httpx_client().__aenter__() return self diff --git a/src/graphn/_generated/models/__init__.py b/src/graphn/_generated/models/__init__.py index 891a795..c186ff6 100644 --- a/src/graphn/_generated/models/__init__.py +++ b/src/graphn/_generated/models/__init__.py @@ -58,6 +58,7 @@ from .blueprint import Blueprint from .blueprint_agents_item import BlueprintAgentsItem from .blueprint_deploy_request import BlueprintDeployRequest +from .blueprint_deploy_resource_i_ds import BlueprintDeployResourceIDs from .blueprint_deploy_response import BlueprintDeployResponse from .blueprint_functions_item import BlueprintFunctionsItem from .blueprint_list import BlueprintList @@ -83,6 +84,16 @@ from .chat_message import ChatMessage from .chat_message_role import ChatMessageRole from .chat_message_tool_calls_item import ChatMessageToolCallsItem +from .connection import Connection +from .connection_account_metadata import ConnectionAccountMetadata +from .connection_authorization_challenge import ConnectionAuthorizationChallenge +from .connection_authorization_start import ConnectionAuthorizationStart +from .connection_create import ConnectionCreate +from .connection_create_kind import ConnectionCreateKind +from .connection_kind import ConnectionKind +from .connection_list import ConnectionList +from .connection_status import ConnectionStatus +from .connection_watch_status import ConnectionWatchStatus from .create_billing_setup_intent_response_200 import ( CreateBillingSetupIntentResponse200, ) @@ -98,6 +109,7 @@ from .discover_imported_models_request import DiscoverImportedModelsRequest from .discover_imported_models_response import DiscoverImportedModelsResponse from .discovered_imported_model import DiscoveredImportedModel +from .document_media import DocumentMedia from .embed_request import EmbedRequest from .embed_response import EmbedResponse from .embedding_model import EmbeddingModel @@ -109,6 +121,7 @@ from .function_create import FunctionCreate from .function_create_files import FunctionCreateFiles from .function_create_parameters_schema import FunctionCreateParametersSchema +from .function_create_type import FunctionCreateType from .function_dry_run_request import FunctionDryRunRequest from .function_dry_run_request_files import FunctionDryRunRequestFiles from .function_dry_run_request_input import FunctionDryRunRequestInput @@ -116,6 +129,7 @@ from .function_spec import FunctionSpec from .function_spec_files import FunctionSpecFiles from .function_spec_parameters_schema import FunctionSpecParametersSchema +from .function_spec_type import FunctionSpecType from .function_test_request import FunctionTestRequest from .function_test_request_input import FunctionTestRequestInput from .function_test_response import FunctionTestResponse @@ -124,6 +138,8 @@ from .function_update_parameters_schema import FunctionUpdateParametersSchema from .get_billing_invoice_response_200 import GetBillingInvoiceResponse200 from .get_billing_usage_filter import GetBillingUsageFilter +from .google_pub_sub_envelope import GooglePubSubEnvelope +from .google_pub_sub_envelope_message import GooglePubSubEnvelopeMessage from .gpu_hours_response import GpuHoursResponse from .id_list_request import IdListRequest from .imported_model import ImportedModel @@ -139,6 +155,12 @@ from .ingest_job import IngestJob from .ingest_job_list import IngestJobList from .ingest_job_summary import IngestJobSummary +from .integration import Integration +from .integration_auth_mode import IntegrationAuthMode +from .integration_capability import IntegrationCapability +from .integration_event import IntegrationEvent +from .integration_kind import IntegrationKind +from .integration_list import IntegrationList from .invitation import Invitation from .invitation_accept_result import InvitationAcceptResult from .invitation_create import InvitationCreate @@ -164,6 +186,9 @@ ListBillingPaymentMethodsResponse200, ) from .list_tts_voices_response_200 import ListTtsVoicesResponse200 +from .managed_connection_tool_call import ManagedConnectionToolCall +from .managed_connection_tool_call_arguments import ManagedConnectionToolCallArguments +from .managed_connection_tool_result import ManagedConnectionToolResult from .mcp_discover_tools_request import McpDiscoverToolsRequest from .mcp_discover_tools_request_files import McpDiscoverToolsRequestFiles from .mcp_discover_tools_response import McpDiscoverToolsResponse @@ -176,10 +201,13 @@ from .mcp_server_create import McpServerCreate from .mcp_server_create_files import McpServerCreateFiles from .mcp_server_create_secrets import McpServerCreateSecrets +from .mcp_server_create_type import McpServerCreateType from .mcp_server_list import McpServerList from .mcp_server_spec import McpServerSpec from .mcp_server_spec_files import McpServerSpecFiles from .mcp_server_spec_secrets import McpServerSpecSecrets +from .mcp_server_spec_tool_capabilities import McpServerSpecToolCapabilities +from .mcp_server_spec_type import McpServerSpecType from .mcp_server_status import McpServerStatus from .mcp_server_update import McpServerUpdate from .mcp_server_update_files import McpServerUpdateFiles @@ -257,6 +285,7 @@ UploadKnowledgebaseDocumentFilesBody, ) from .upload_storage_file_body import UploadStorageFileBody +from .usage_day import UsageDay from .validate_model_request import ValidateModelRequest from .validate_model_request_quantization import ValidateModelRequestQuantization from .validate_model_request_weight_source import ValidateModelRequestWeightSource @@ -378,6 +407,7 @@ "Blueprint", "BlueprintAgentsItem", "BlueprintDeployRequest", + "BlueprintDeployResourceIDs", "BlueprintDeployResponse", "BlueprintFunctionsItem", "BlueprintList", @@ -401,6 +431,16 @@ "ChatMessage", "ChatMessageRole", "ChatMessageToolCallsItem", + "Connection", + "ConnectionAccountMetadata", + "ConnectionAuthorizationChallenge", + "ConnectionAuthorizationStart", + "ConnectionCreate", + "ConnectionCreateKind", + "ConnectionKind", + "ConnectionList", + "ConnectionStatus", + "ConnectionWatchStatus", "CreateBillingSetupIntentResponse200", "CustomModel", "CustomModelAccess", @@ -414,6 +454,7 @@ "DiscoverImportedModelsRequest", "DiscoverImportedModelsResponse", "DiscoveredImportedModel", + "DocumentMedia", "EmbedRequest", "EmbedResponse", "EmbeddingModel", @@ -425,6 +466,7 @@ "FunctionCreate", "FunctionCreateFiles", "FunctionCreateParametersSchema", + "FunctionCreateType", "FunctionDryRunRequest", "FunctionDryRunRequestFiles", "FunctionDryRunRequestInput", @@ -432,6 +474,7 @@ "FunctionSpec", "FunctionSpecFiles", "FunctionSpecParametersSchema", + "FunctionSpecType", "FunctionTestRequest", "FunctionTestRequestInput", "FunctionTestResponse", @@ -440,6 +483,8 @@ "FunctionUpdateParametersSchema", "GetBillingInvoiceResponse200", "GetBillingUsageFilter", + "GooglePubSubEnvelope", + "GooglePubSubEnvelopeMessage", "GpuHoursResponse", "IdListRequest", "ImportedModel", @@ -455,6 +500,12 @@ "IngestJob", "IngestJobList", "IngestJobSummary", + "Integration", + "IntegrationAuthMode", + "IntegrationCapability", + "IntegrationEvent", + "IntegrationKind", + "IntegrationList", "Invitation", "InvitationAcceptResult", "InvitationCreate", @@ -476,6 +527,9 @@ "ListBillingInvoicesResponse200EmptyReason", "ListBillingPaymentMethodsResponse200", "ListTtsVoicesResponse200", + "ManagedConnectionToolCall", + "ManagedConnectionToolCallArguments", + "ManagedConnectionToolResult", "McpDiscoverToolsRequest", "McpDiscoverToolsRequestFiles", "McpDiscoverToolsResponse", @@ -488,10 +542,13 @@ "McpServerCreate", "McpServerCreateFiles", "McpServerCreateSecrets", + "McpServerCreateType", "McpServerList", "McpServerSpec", "McpServerSpecFiles", "McpServerSpecSecrets", + "McpServerSpecToolCapabilities", + "McpServerSpecType", "McpServerStatus", "McpServerUpdate", "McpServerUpdateFiles", @@ -565,6 +622,7 @@ "UploadDocumentFromURLRequestMetadata", "UploadKnowledgebaseDocumentFilesBody", "UploadStorageFileBody", + "UsageDay", "ValidateModelRequest", "ValidateModelRequestQuantization", "ValidateModelRequestWeightSource", diff --git a/src/graphn/_generated/models/agent_spec.py b/src/graphn/_generated/models/agent_spec.py index 2a9f3e1..cc1cd04 100644 --- a/src/graphn/_generated/models/agent_spec.py +++ b/src/graphn/_generated/models/agent_spec.py @@ -92,7 +92,9 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - from ..models.agent_spec_output_schema import AgentSpecOutputSchema + from ..models.agent_spec_output_schema import ( + AgentSpecOutputSchema, + ) from ..models.model_settings import ModelSettings from ..models.tool_reference import ToolReference diff --git a/src/graphn/_generated/models/agent_spec_output_schema.py b/src/graphn/_generated/models/agent_spec_output_schema.py index 9517ee4..64c94d2 100644 --- a/src/graphn/_generated/models/agent_spec_output_schema.py +++ b/src/graphn/_generated/models/agent_spec_output_schema.py @@ -12,8 +12,6 @@ @_attrs_define class AgentSpecOutputSchema: - """ """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/async_run_error.py b/src/graphn/_generated/models/async_run_error.py index fa5a603..9ef8e9a 100644 --- a/src/graphn/_generated/models/async_run_error.py +++ b/src/graphn/_generated/models/async_run_error.py @@ -12,8 +12,6 @@ @_attrs_define class AsyncRunError: - """ """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/async_run_metadata.py b/src/graphn/_generated/models/async_run_metadata.py index a73e059..8c55cb6 100644 --- a/src/graphn/_generated/models/async_run_metadata.py +++ b/src/graphn/_generated/models/async_run_metadata.py @@ -12,8 +12,6 @@ @_attrs_define class AsyncRunMetadata: - """ """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/async_run_output.py b/src/graphn/_generated/models/async_run_output.py index 8d2cbf1..ae270b5 100644 --- a/src/graphn/_generated/models/async_run_output.py +++ b/src/graphn/_generated/models/async_run_output.py @@ -12,8 +12,6 @@ @_attrs_define class AsyncRunOutput: - """ """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/async_run_result_error.py b/src/graphn/_generated/models/async_run_result_error.py index 542e8e9..ef76563 100644 --- a/src/graphn/_generated/models/async_run_result_error.py +++ b/src/graphn/_generated/models/async_run_result_error.py @@ -12,8 +12,6 @@ @_attrs_define class AsyncRunResultError: - """ """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/async_run_usage.py b/src/graphn/_generated/models/async_run_usage.py index 204abe9..4a719d7 100644 --- a/src/graphn/_generated/models/async_run_usage.py +++ b/src/graphn/_generated/models/async_run_usage.py @@ -12,8 +12,6 @@ @_attrs_define class AsyncRunUsage: - """ """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/async_submit_request.py b/src/graphn/_generated/models/async_submit_request.py index 8463369..20012b6 100644 --- a/src/graphn/_generated/models/async_submit_request.py +++ b/src/graphn/_generated/models/async_submit_request.py @@ -59,8 +59,12 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - from ..models.async_submit_request_input import AsyncSubmitRequestInput - from ..models.async_submit_request_metadata import AsyncSubmitRequestMetadata + from ..models.async_submit_request_input import ( + AsyncSubmitRequestInput, + ) + from ..models.async_submit_request_metadata import ( + AsyncSubmitRequestMetadata, + ) from ..models.async_submit_request_parameters import ( AsyncSubmitRequestParameters, ) diff --git a/src/graphn/_generated/models/async_submit_request_input.py b/src/graphn/_generated/models/async_submit_request_input.py index ea18600..816543f 100644 --- a/src/graphn/_generated/models/async_submit_request_input.py +++ b/src/graphn/_generated/models/async_submit_request_input.py @@ -12,8 +12,6 @@ @_attrs_define class AsyncSubmitRequestInput: - """ """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/async_submit_request_metadata.py b/src/graphn/_generated/models/async_submit_request_metadata.py index 5de2c7e..e35fa63 100644 --- a/src/graphn/_generated/models/async_submit_request_metadata.py +++ b/src/graphn/_generated/models/async_submit_request_metadata.py @@ -12,8 +12,6 @@ @_attrs_define class AsyncSubmitRequestMetadata: - """ """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/async_submit_request_parameters.py b/src/graphn/_generated/models/async_submit_request_parameters.py index 004db9b..bd5b1ac 100644 --- a/src/graphn/_generated/models/async_submit_request_parameters.py +++ b/src/graphn/_generated/models/async_submit_request_parameters.py @@ -12,8 +12,6 @@ @_attrs_define class AsyncSubmitRequestParameters: - """ """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/batch_input_item_input.py b/src/graphn/_generated/models/batch_input_item_input.py index 01a1b2d..bd5d801 100644 --- a/src/graphn/_generated/models/batch_input_item_input.py +++ b/src/graphn/_generated/models/batch_input_item_input.py @@ -12,8 +12,6 @@ @_attrs_define class BatchInputItemInput: - """ """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/batch_item_error.py b/src/graphn/_generated/models/batch_item_error.py index 0f20295..e57208c 100644 --- a/src/graphn/_generated/models/batch_item_error.py +++ b/src/graphn/_generated/models/batch_item_error.py @@ -12,8 +12,6 @@ @_attrs_define class BatchItemError: - """ """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/batch_item_output.py b/src/graphn/_generated/models/batch_item_output.py index 60f8842..a031008 100644 --- a/src/graphn/_generated/models/batch_item_output.py +++ b/src/graphn/_generated/models/batch_item_output.py @@ -12,8 +12,6 @@ @_attrs_define class BatchItemOutput: - """ """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/batch_knowledgebases_response.py b/src/graphn/_generated/models/batch_knowledgebases_response.py index 82636d2..25b6c0e 100644 --- a/src/graphn/_generated/models/batch_knowledgebases_response.py +++ b/src/graphn/_generated/models/batch_knowledgebases_response.py @@ -57,7 +57,9 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - from ..models.batch_knowledgebase_result import BatchKnowledgebaseResult + from ..models.batch_knowledgebase_result import ( + BatchKnowledgebaseResult, + ) d = dict(src_dict) total = d.pop("total") diff --git a/src/graphn/_generated/models/batch_submit_request.py b/src/graphn/_generated/models/batch_submit_request.py index 6e8f018..bbfa8bd 100644 --- a/src/graphn/_generated/models/batch_submit_request.py +++ b/src/graphn/_generated/models/batch_submit_request.py @@ -71,7 +71,9 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.batch_file_ref import BatchFileRef from ..models.batch_input_item import BatchInputItem - from ..models.batch_submit_request_metadata import BatchSubmitRequestMetadata + from ..models.batch_submit_request_metadata import ( + BatchSubmitRequestMetadata, + ) from ..models.batch_submit_request_parameters import ( BatchSubmitRequestParameters, ) diff --git a/src/graphn/_generated/models/batch_submit_request_metadata.py b/src/graphn/_generated/models/batch_submit_request_metadata.py index 16f8c71..aa2f13d 100644 --- a/src/graphn/_generated/models/batch_submit_request_metadata.py +++ b/src/graphn/_generated/models/batch_submit_request_metadata.py @@ -12,8 +12,6 @@ @_attrs_define class BatchSubmitRequestMetadata: - """ """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/batch_submit_request_parameters.py b/src/graphn/_generated/models/batch_submit_request_parameters.py index fdf8018..a7a3ed3 100644 --- a/src/graphn/_generated/models/batch_submit_request_parameters.py +++ b/src/graphn/_generated/models/batch_submit_request_parameters.py @@ -12,8 +12,6 @@ @_attrs_define class BatchSubmitRequestParameters: - """ """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/billing_grant_result_new_status.py b/src/graphn/_generated/models/billing_grant_result_new_status.py index 1718f72..3836dff 100644 --- a/src/graphn/_generated/models/billing_grant_result_new_status.py +++ b/src/graphn/_generated/models/billing_grant_result_new_status.py @@ -1,7 +1,7 @@ -from enum import Enum +from enum import StrEnum -class BillingGrantResultNewStatus(str, Enum): +class BillingGrantResultNewStatus(StrEnum): LOW = "low" OK = "ok" OUT_OF_BALANCE = "out_of_balance" diff --git a/src/graphn/_generated/models/billing_usage.py b/src/graphn/_generated/models/billing_usage.py index c6ffdcc..1ef52fa 100644 --- a/src/graphn/_generated/models/billing_usage.py +++ b/src/graphn/_generated/models/billing_usage.py @@ -63,7 +63,9 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - from ..models.billing_usage_time_series_item import BillingUsageTimeSeriesItem + from ..models.billing_usage_time_series_item import ( + BillingUsageTimeSeriesItem, + ) d = dict(src_dict) total_spend_cents = d.pop("totalSpendCents") diff --git a/src/graphn/_generated/models/blueprint.py b/src/graphn/_generated/models/blueprint.py index f327f10..ac4e412 100644 --- a/src/graphn/_generated/models/blueprint.py +++ b/src/graphn/_generated/models/blueprint.py @@ -105,8 +105,12 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.blueprint_agents_item import BlueprintAgentsItem - from ..models.blueprint_functions_item import BlueprintFunctionsItem - from ..models.blueprint_mcp_servers_item import BlueprintMcpServersItem + from ..models.blueprint_functions_item import ( + BlueprintFunctionsItem, + ) + from ..models.blueprint_mcp_servers_item import ( + BlueprintMcpServersItem, + ) d = dict(src_dict) id = d.pop("id") diff --git a/src/graphn/_generated/models/blueprint_agents_item.py b/src/graphn/_generated/models/blueprint_agents_item.py index 80f04ba..2a17139 100644 --- a/src/graphn/_generated/models/blueprint_agents_item.py +++ b/src/graphn/_generated/models/blueprint_agents_item.py @@ -12,8 +12,6 @@ @_attrs_define class BlueprintAgentsItem: - """ """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/blueprint_deploy_resource_i_ds.py b/src/graphn/_generated/models/blueprint_deploy_resource_i_ds.py new file mode 100644 index 0000000..c9b17f5 --- /dev/null +++ b/src/graphn/_generated/models/blueprint_deploy_resource_i_ds.py @@ -0,0 +1,59 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from typing_extensions import Self + +T = TypeVar("T", bound="BlueprintDeployResourceIDs") + + +@_attrs_define +class BlueprintDeployResourceIDs: + """ + Attributes: + agents (list[str]): + functions (list[str]): + mcp_servers (list[str]): + """ + + agents: list[str] + functions: list[str] + mcp_servers: list[str] + + def to_dict(self) -> dict[str, Any]: + agents = self.agents + + functions = self.functions + + mcp_servers = self.mcp_servers + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "agents": agents, + "functions": functions, + "mcp_servers": mcp_servers, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + agents = cast(list[str], d.pop("agents")) + + functions = cast(list[str], d.pop("functions")) + + mcp_servers = cast(list[str], d.pop("mcp_servers")) + + blueprint_deploy_resource_i_ds = cls( + agents=agents, + functions=functions, + mcp_servers=mcp_servers, + ) + + return blueprint_deploy_resource_i_ds diff --git a/src/graphn/_generated/models/blueprint_deploy_response.py b/src/graphn/_generated/models/blueprint_deploy_response.py index da8ecd1..30e6075 100644 --- a/src/graphn/_generated/models/blueprint_deploy_response.py +++ b/src/graphn/_generated/models/blueprint_deploy_response.py @@ -1,11 +1,15 @@ from __future__ import annotations from collections.abc import Mapping -from typing import Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from typing_extensions import Self +if TYPE_CHECKING: + from ..models.blueprint_deploy_resource_i_ds import BlueprintDeployResourceIDs + + T = TypeVar("T", bound="BlueprintDeployResponse") @@ -15,22 +19,27 @@ class BlueprintDeployResponse: Attributes: workflow_id (str): name (str): + resource_ids (BlueprintDeployResourceIDs): """ workflow_id: str name: str + resource_ids: BlueprintDeployResourceIDs def to_dict(self) -> dict[str, Any]: workflow_id = self.workflow_id name = self.name + resource_ids = self.resource_ids.to_dict() + field_dict: dict[str, Any] = {} field_dict.update( { "workflow_id": workflow_id, "name": name, + "resource_ids": resource_ids, } ) @@ -38,14 +47,21 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + from ..models.blueprint_deploy_resource_i_ds import ( + BlueprintDeployResourceIDs, + ) + d = dict(src_dict) workflow_id = d.pop("workflow_id") name = d.pop("name") + resource_ids = BlueprintDeployResourceIDs.from_dict(d.pop("resource_ids")) + blueprint_deploy_response = cls( workflow_id=workflow_id, name=name, + resource_ids=resource_ids, ) return blueprint_deploy_response diff --git a/src/graphn/_generated/models/blueprint_functions_item.py b/src/graphn/_generated/models/blueprint_functions_item.py index 7825d4f..320e8e7 100644 --- a/src/graphn/_generated/models/blueprint_functions_item.py +++ b/src/graphn/_generated/models/blueprint_functions_item.py @@ -12,8 +12,6 @@ @_attrs_define class BlueprintFunctionsItem: - """ """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/blueprint_mcp_servers_item.py b/src/graphn/_generated/models/blueprint_mcp_servers_item.py index 77654eb..82337c5 100644 --- a/src/graphn/_generated/models/blueprint_mcp_servers_item.py +++ b/src/graphn/_generated/models/blueprint_mcp_servers_item.py @@ -12,8 +12,6 @@ @_attrs_define class BlueprintMcpServersItem: - """ """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/builtin_function_info_parameters_schema.py b/src/graphn/_generated/models/builtin_function_info_parameters_schema.py index 59c0ec0..1039e93 100644 --- a/src/graphn/_generated/models/builtin_function_info_parameters_schema.py +++ b/src/graphn/_generated/models/builtin_function_info_parameters_schema.py @@ -12,8 +12,6 @@ @_attrs_define class BuiltinFunctionInfoParametersSchema: - """ """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/builtin_function_list_functions.py b/src/graphn/_generated/models/builtin_function_list_functions.py index b04bf99..ef4f62f 100644 --- a/src/graphn/_generated/models/builtin_function_list_functions.py +++ b/src/graphn/_generated/models/builtin_function_list_functions.py @@ -16,8 +16,6 @@ @_attrs_define class BuiltinFunctionListFunctions: - """ """ - additional_properties: dict[str, BuiltinFunctionInfo] = _attrs_field( init=False, factory=dict ) diff --git a/src/graphn/_generated/models/bundle_resource_item.py b/src/graphn/_generated/models/bundle_resource_item.py index 8e756c7..58e13ef 100644 --- a/src/graphn/_generated/models/bundle_resource_item.py +++ b/src/graphn/_generated/models/bundle_resource_item.py @@ -55,7 +55,9 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - from ..models.bundle_resource_item_spec import BundleResourceItemSpec + from ..models.bundle_resource_item_spec import ( + BundleResourceItemSpec, + ) d = dict(src_dict) name = d.pop("name") diff --git a/src/graphn/_generated/models/bundle_resource_item_spec.py b/src/graphn/_generated/models/bundle_resource_item_spec.py index b4c7041..41c8d74 100644 --- a/src/graphn/_generated/models/bundle_resource_item_spec.py +++ b/src/graphn/_generated/models/bundle_resource_item_spec.py @@ -12,8 +12,6 @@ @_attrs_define class BundleResourceItemSpec: - """ """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/capability.py b/src/graphn/_generated/models/capability.py index 93d1bf1..8fbc55e 100644 --- a/src/graphn/_generated/models/capability.py +++ b/src/graphn/_generated/models/capability.py @@ -1,7 +1,7 @@ -from enum import Enum +from enum import StrEnum -class Capability(str, Enum): +class Capability(StrEnum): EMBEDDING = "embedding" REASONING = "reasoning" TOOL_CALLING = "tool_calling" diff --git a/src/graphn/_generated/models/chat_completion_request_response_format.py b/src/graphn/_generated/models/chat_completion_request_response_format.py index 410722a..9da6583 100644 --- a/src/graphn/_generated/models/chat_completion_request_response_format.py +++ b/src/graphn/_generated/models/chat_completion_request_response_format.py @@ -12,8 +12,6 @@ @_attrs_define class ChatCompletionRequestResponseFormat: - """ """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/chat_completion_request_tool_choice_type_1.py b/src/graphn/_generated/models/chat_completion_request_tool_choice_type_1.py index c18fd49..4f258c0 100644 --- a/src/graphn/_generated/models/chat_completion_request_tool_choice_type_1.py +++ b/src/graphn/_generated/models/chat_completion_request_tool_choice_type_1.py @@ -12,8 +12,6 @@ @_attrs_define class ChatCompletionRequestToolChoiceType1: - """ """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/chat_completion_request_tools_item.py b/src/graphn/_generated/models/chat_completion_request_tools_item.py index 45d7211..d1c017b 100644 --- a/src/graphn/_generated/models/chat_completion_request_tools_item.py +++ b/src/graphn/_generated/models/chat_completion_request_tools_item.py @@ -12,8 +12,6 @@ @_attrs_define class ChatCompletionRequestToolsItem: - """ """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/chat_completion_response.py b/src/graphn/_generated/models/chat_completion_response.py index ae53044..8dc1daa 100644 --- a/src/graphn/_generated/models/chat_completion_response.py +++ b/src/graphn/_generated/models/chat_completion_response.py @@ -81,7 +81,9 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.chat_completion_response_choices_item import ( ChatCompletionResponseChoicesItem, ) - from ..models.chat_completion_response_usage import ChatCompletionResponseUsage + from ..models.chat_completion_response_usage import ( + ChatCompletionResponseUsage, + ) d = dict(src_dict) id = d.pop("id") diff --git a/src/graphn/_generated/models/chat_completion_response_object.py b/src/graphn/_generated/models/chat_completion_response_object.py index 08946cc..f9fef28 100644 --- a/src/graphn/_generated/models/chat_completion_response_object.py +++ b/src/graphn/_generated/models/chat_completion_response_object.py @@ -1,7 +1,7 @@ -from enum import Enum +from enum import StrEnum -class ChatCompletionResponseObject(str, Enum): +class ChatCompletionResponseObject(StrEnum): CHAT_COMPLETION = "chat.completion" def __str__(self) -> str: diff --git a/src/graphn/_generated/models/chat_message.py b/src/graphn/_generated/models/chat_message.py index d1d4829..153a90f 100644 --- a/src/graphn/_generated/models/chat_message.py +++ b/src/graphn/_generated/models/chat_message.py @@ -69,7 +69,9 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - from ..models.chat_message_tool_calls_item import ChatMessageToolCallsItem + from ..models.chat_message_tool_calls_item import ( + ChatMessageToolCallsItem, + ) d = dict(src_dict) role = ChatMessageRole(d.pop("role")) diff --git a/src/graphn/_generated/models/chat_message_role.py b/src/graphn/_generated/models/chat_message_role.py index b9757ff..c08faf9 100644 --- a/src/graphn/_generated/models/chat_message_role.py +++ b/src/graphn/_generated/models/chat_message_role.py @@ -1,7 +1,7 @@ -from enum import Enum +from enum import StrEnum -class ChatMessageRole(str, Enum): +class ChatMessageRole(StrEnum): ASSISTANT = "assistant" SYSTEM = "system" TOOL = "tool" diff --git a/src/graphn/_generated/models/chat_message_tool_calls_item.py b/src/graphn/_generated/models/chat_message_tool_calls_item.py index 55417dc..bd46e71 100644 --- a/src/graphn/_generated/models/chat_message_tool_calls_item.py +++ b/src/graphn/_generated/models/chat_message_tool_calls_item.py @@ -12,8 +12,6 @@ @_attrs_define class ChatMessageToolCallsItem: - """ """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/connection.py b/src/graphn/_generated/models/connection.py new file mode 100644 index 0000000..0d3027d --- /dev/null +++ b/src/graphn/_generated/models/connection.py @@ -0,0 +1,257 @@ +from __future__ import annotations + +import datetime +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from typing_extensions import Self + +from ..models.connection_kind import ConnectionKind +from ..models.connection_status import ConnectionStatus +from ..models.connection_watch_status import ConnectionWatchStatus +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.connection_account_metadata import ConnectionAccountMetadata + + +T = TypeVar("T", bound="Connection") + + +@_attrs_define +class Connection: + """Workspace-owned authorization metadata. OAuth client secrets, access + tokens, refresh tokens, PKCE data, and account hashes are never returned. + + Attributes: + id (str): + workspace_id (str): + name (str): + kind (ConnectionKind): + provider_id (str): + status (ConnectionStatus): + granted_capabilities (list[str]): + granted_scopes (list[str]): + watch_status (ConnectionWatchStatus): + created_at (datetime.datetime): + updated_at (datetime.datetime): + resource_id (str | Unset): + account_label (str | Unset): + account_metadata (ConnectionAccountMetadata | Unset): + credential_expires_at (datetime.datetime | Unset): + last_validated_at (datetime.datetime | Unset): + last_error_code (str | Unset): + last_error_message (str | Unset): + watch_expires_at (datetime.datetime | Unset): + last_event_at (datetime.datetime | Unset): + """ + + id: str + workspace_id: str + name: str + kind: ConnectionKind + provider_id: str + status: ConnectionStatus + granted_capabilities: list[str] + granted_scopes: list[str] + watch_status: ConnectionWatchStatus + created_at: datetime.datetime + updated_at: datetime.datetime + resource_id: str | Unset = UNSET + account_label: str | Unset = UNSET + account_metadata: ConnectionAccountMetadata | Unset = UNSET + credential_expires_at: datetime.datetime | Unset = UNSET + last_validated_at: datetime.datetime | Unset = UNSET + last_error_code: str | Unset = UNSET + last_error_message: str | Unset = UNSET + watch_expires_at: datetime.datetime | Unset = UNSET + last_event_at: datetime.datetime | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + id = self.id + + workspace_id = self.workspace_id + + name = self.name + + kind = self.kind.value + + provider_id = self.provider_id + + status = self.status.value + + granted_capabilities = self.granted_capabilities + + granted_scopes = self.granted_scopes + + watch_status = self.watch_status.value + + created_at = self.created_at.isoformat() + + updated_at = self.updated_at.isoformat() + + resource_id = self.resource_id + + account_label = self.account_label + + account_metadata: dict[str, Any] | Unset = UNSET + if not isinstance(self.account_metadata, Unset): + account_metadata = self.account_metadata.to_dict() + + credential_expires_at: str | Unset = UNSET + if not isinstance(self.credential_expires_at, Unset): + credential_expires_at = self.credential_expires_at.isoformat() + + last_validated_at: str | Unset = UNSET + if not isinstance(self.last_validated_at, Unset): + last_validated_at = self.last_validated_at.isoformat() + + last_error_code = self.last_error_code + + last_error_message = self.last_error_message + + watch_expires_at: str | Unset = UNSET + if not isinstance(self.watch_expires_at, Unset): + watch_expires_at = self.watch_expires_at.isoformat() + + last_event_at: str | Unset = UNSET + if not isinstance(self.last_event_at, Unset): + last_event_at = self.last_event_at.isoformat() + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "id": id, + "workspace_id": workspace_id, + "name": name, + "kind": kind, + "provider_id": provider_id, + "status": status, + "granted_capabilities": granted_capabilities, + "granted_scopes": granted_scopes, + "watch_status": watch_status, + "created_at": created_at, + "updated_at": updated_at, + } + ) + if resource_id is not UNSET: + field_dict["resource_id"] = resource_id + if account_label is not UNSET: + field_dict["account_label"] = account_label + if account_metadata is not UNSET: + field_dict["account_metadata"] = account_metadata + if credential_expires_at is not UNSET: + field_dict["credential_expires_at"] = credential_expires_at + if last_validated_at is not UNSET: + field_dict["last_validated_at"] = last_validated_at + if last_error_code is not UNSET: + field_dict["last_error_code"] = last_error_code + if last_error_message is not UNSET: + field_dict["last_error_message"] = last_error_message + if watch_expires_at is not UNSET: + field_dict["watch_expires_at"] = watch_expires_at + if last_event_at is not UNSET: + field_dict["last_event_at"] = last_event_at + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + from ..models.connection_account_metadata import ( + ConnectionAccountMetadata, + ) + + d = dict(src_dict) + id = d.pop("id") + + workspace_id = d.pop("workspace_id") + + name = d.pop("name") + + kind = ConnectionKind(d.pop("kind")) + + provider_id = d.pop("provider_id") + + status = ConnectionStatus(d.pop("status")) + + granted_capabilities = cast(list[str], d.pop("granted_capabilities")) + + granted_scopes = cast(list[str], d.pop("granted_scopes")) + + watch_status = ConnectionWatchStatus(d.pop("watch_status")) + + created_at = datetime.datetime.fromisoformat(d.pop("created_at")) + + updated_at = datetime.datetime.fromisoformat(d.pop("updated_at")) + + resource_id = d.pop("resource_id", UNSET) + + account_label = d.pop("account_label", UNSET) + + _account_metadata = d.pop("account_metadata", UNSET) + account_metadata: ConnectionAccountMetadata | Unset + if isinstance(_account_metadata, Unset): + account_metadata = UNSET + else: + account_metadata = ConnectionAccountMetadata.from_dict(_account_metadata) + + _credential_expires_at = d.pop("credential_expires_at", UNSET) + credential_expires_at: datetime.datetime | Unset + if isinstance(_credential_expires_at, Unset): + credential_expires_at = UNSET + else: + credential_expires_at = datetime.datetime.fromisoformat( + _credential_expires_at + ) + + _last_validated_at = d.pop("last_validated_at", UNSET) + last_validated_at: datetime.datetime | Unset + if isinstance(_last_validated_at, Unset): + last_validated_at = UNSET + else: + last_validated_at = datetime.datetime.fromisoformat(_last_validated_at) + + last_error_code = d.pop("last_error_code", UNSET) + + last_error_message = d.pop("last_error_message", UNSET) + + _watch_expires_at = d.pop("watch_expires_at", UNSET) + watch_expires_at: datetime.datetime | Unset + if isinstance(_watch_expires_at, Unset): + watch_expires_at = UNSET + else: + watch_expires_at = datetime.datetime.fromisoformat(_watch_expires_at) + + _last_event_at = d.pop("last_event_at", UNSET) + last_event_at: datetime.datetime | Unset + if isinstance(_last_event_at, Unset): + last_event_at = UNSET + else: + last_event_at = datetime.datetime.fromisoformat(_last_event_at) + + connection = cls( + id=id, + workspace_id=workspace_id, + name=name, + kind=kind, + provider_id=provider_id, + status=status, + granted_capabilities=granted_capabilities, + granted_scopes=granted_scopes, + watch_status=watch_status, + created_at=created_at, + updated_at=updated_at, + resource_id=resource_id, + account_label=account_label, + account_metadata=account_metadata, + credential_expires_at=credential_expires_at, + last_validated_at=last_validated_at, + last_error_code=last_error_code, + last_error_message=last_error_message, + watch_expires_at=watch_expires_at, + last_event_at=last_event_at, + ) + + return connection diff --git a/src/graphn/_generated/models/connection_account_metadata.py b/src/graphn/_generated/models/connection_account_metadata.py new file mode 100644 index 0000000..addd482 --- /dev/null +++ b/src/graphn/_generated/models/connection_account_metadata.py @@ -0,0 +1,46 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from typing_extensions import Self + +T = TypeVar("T", bound="ConnectionAccountMetadata") + + +@_attrs_define +class ConnectionAccountMetadata: + additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + connection_account_metadata = cls() + + connection_account_metadata.additional_properties = d + return connection_account_metadata + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/graphn/_generated/models/connection_authorization_challenge.py b/src/graphn/_generated/models/connection_authorization_challenge.py new file mode 100644 index 0000000..1586bc6 --- /dev/null +++ b/src/graphn/_generated/models/connection_authorization_challenge.py @@ -0,0 +1,52 @@ +from __future__ import annotations + +import datetime +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from typing_extensions import Self + +T = TypeVar("T", bound="ConnectionAuthorizationChallenge") + + +@_attrs_define +class ConnectionAuthorizationChallenge: + """ + Attributes: + authorization_url (str): + expires_at (datetime.datetime): + """ + + authorization_url: str + expires_at: datetime.datetime + + def to_dict(self) -> dict[str, Any]: + authorization_url = self.authorization_url + + expires_at = self.expires_at.isoformat() + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "authorization_url": authorization_url, + "expires_at": expires_at, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + authorization_url = d.pop("authorization_url") + + expires_at = datetime.datetime.fromisoformat(d.pop("expires_at")) + + connection_authorization_challenge = cls( + authorization_url=authorization_url, + expires_at=expires_at, + ) + + return connection_authorization_challenge diff --git a/src/graphn/_generated/models/connection_authorization_start.py b/src/graphn/_generated/models/connection_authorization_start.py new file mode 100644 index 0000000..1519fee --- /dev/null +++ b/src/graphn/_generated/models/connection_authorization_start.py @@ -0,0 +1,54 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from typing_extensions import Self + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ConnectionAuthorizationStart") + + +@_attrs_define +class ConnectionAuthorizationStart: + """ + Attributes: + return_path (str | Unset): Relative path on the configured GraphN web origin. Default: '/settings/connections'. + requested_capabilities (list[str] | Unset): + """ + + return_path: str | Unset = "/settings/connections" + requested_capabilities: list[str] | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + return_path = self.return_path + + requested_capabilities: list[str] | Unset = UNSET + if not isinstance(self.requested_capabilities, Unset): + requested_capabilities = self.requested_capabilities + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if return_path is not UNSET: + field_dict["return_path"] = return_path + if requested_capabilities is not UNSET: + field_dict["requested_capabilities"] = requested_capabilities + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + return_path = d.pop("return_path", UNSET) + + requested_capabilities = cast(list[str], d.pop("requested_capabilities", UNSET)) + + connection_authorization_start = cls( + return_path=return_path, + requested_capabilities=requested_capabilities, + ) + + return connection_authorization_start diff --git a/src/graphn/_generated/models/connection_create.py b/src/graphn/_generated/models/connection_create.py new file mode 100644 index 0000000..e9668de --- /dev/null +++ b/src/graphn/_generated/models/connection_create.py @@ -0,0 +1,71 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from typing_extensions import Self + +from ..models.connection_create_kind import ConnectionCreateKind +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ConnectionCreate") + + +@_attrs_define +class ConnectionCreate: + """ + Attributes: + name (str): + kind (ConnectionCreateKind): + provider_id (str): + resource_id (str | Unset): Optional linked MCP resource ID. + """ + + name: str + kind: ConnectionCreateKind + provider_id: str + resource_id: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + name = self.name + + kind = self.kind.value + + provider_id = self.provider_id + + resource_id = self.resource_id + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "name": name, + "kind": kind, + "provider_id": provider_id, + } + ) + if resource_id is not UNSET: + field_dict["resource_id"] = resource_id + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + name = d.pop("name") + + kind = ConnectionCreateKind(d.pop("kind")) + + provider_id = d.pop("provider_id") + + resource_id = d.pop("resource_id", UNSET) + + connection_create = cls( + name=name, + kind=kind, + provider_id=provider_id, + resource_id=resource_id, + ) + + return connection_create diff --git a/src/graphn/_generated/models/connection_create_kind.py b/src/graphn/_generated/models/connection_create_kind.py new file mode 100644 index 0000000..aa6df55 --- /dev/null +++ b/src/graphn/_generated/models/connection_create_kind.py @@ -0,0 +1,9 @@ +from enum import StrEnum + + +class ConnectionCreateKind(StrEnum): + MCP = "mcp" + NATIVE = "native" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/graphn/_generated/models/connection_kind.py b/src/graphn/_generated/models/connection_kind.py new file mode 100644 index 0000000..2b710f9 --- /dev/null +++ b/src/graphn/_generated/models/connection_kind.py @@ -0,0 +1,9 @@ +from enum import StrEnum + + +class ConnectionKind(StrEnum): + MCP = "mcp" + NATIVE = "native" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/graphn/_generated/models/connection_list.py b/src/graphn/_generated/models/connection_list.py new file mode 100644 index 0000000..c270840 --- /dev/null +++ b/src/graphn/_generated/models/connection_list.py @@ -0,0 +1,76 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from typing_extensions import Self + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.connection import Connection + + +T = TypeVar("T", bound="ConnectionList") + + +@_attrs_define +class ConnectionList: + """ + Attributes: + items (list[Connection]): + count (int): + continue_token (str | Unset): + """ + + items: list[Connection] + count: int + continue_token: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + items = [] + for items_item_data in self.items: + items_item = items_item_data.to_dict() + items.append(items_item) + + count = self.count + + continue_token = self.continue_token + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "items": items, + "count": count, + } + ) + if continue_token is not UNSET: + field_dict["continue_token"] = continue_token + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + from ..models.connection import Connection + + d = dict(src_dict) + items = [] + _items = d.pop("items") + for items_item_data in _items: + items_item = Connection.from_dict(items_item_data) + + items.append(items_item) + + count = d.pop("count") + + continue_token = d.pop("continue_token", UNSET) + + connection_list = cls( + items=items, + count=count, + continue_token=continue_token, + ) + + return connection_list diff --git a/src/graphn/_generated/models/connection_status.py b/src/graphn/_generated/models/connection_status.py new file mode 100644 index 0000000..56ee362 --- /dev/null +++ b/src/graphn/_generated/models/connection_status.py @@ -0,0 +1,12 @@ +from enum import StrEnum + + +class ConnectionStatus(StrEnum): + ACTIVE = "active" + ERROR = "error" + NEEDS_REAUTH = "needs_reauth" + PENDING = "pending" + REVOKED = "revoked" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/graphn/_generated/models/connection_watch_status.py b/src/graphn/_generated/models/connection_watch_status.py new file mode 100644 index 0000000..425de99 --- /dev/null +++ b/src/graphn/_generated/models/connection_watch_status.py @@ -0,0 +1,11 @@ +from enum import StrEnum + + +class ConnectionWatchStatus(StrEnum): + ACTIVE = "active" + DISABLED = "disabled" + ERROR = "error" + PENDING = "pending" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/graphn/_generated/models/custom_model_artifact_type.py b/src/graphn/_generated/models/custom_model_artifact_type.py index f2adb23..4ed4f85 100644 --- a/src/graphn/_generated/models/custom_model_artifact_type.py +++ b/src/graphn/_generated/models/custom_model_artifact_type.py @@ -1,7 +1,7 @@ -from enum import Enum +from enum import StrEnum -class CustomModelArtifactType(str, Enum): +class CustomModelArtifactType(StrEnum): BASE = "base" LORA = "lora" diff --git a/src/graphn/_generated/models/custom_model_create_quantization.py b/src/graphn/_generated/models/custom_model_create_quantization.py index 03fc5cd..2981e0d 100644 --- a/src/graphn/_generated/models/custom_model_create_quantization.py +++ b/src/graphn/_generated/models/custom_model_create_quantization.py @@ -1,7 +1,7 @@ -from enum import Enum +from enum import StrEnum -class CustomModelCreateQuantization(str, Enum): +class CustomModelCreateQuantization(StrEnum): AWQ = "awq" FP8 = "fp8" GGUF = "gguf" diff --git a/src/graphn/_generated/models/custom_model_quantization.py b/src/graphn/_generated/models/custom_model_quantization.py index acf37b7..10b4c22 100644 --- a/src/graphn/_generated/models/custom_model_quantization.py +++ b/src/graphn/_generated/models/custom_model_quantization.py @@ -1,7 +1,7 @@ -from enum import Enum +from enum import StrEnum -class CustomModelQuantization(str, Enum): +class CustomModelQuantization(StrEnum): AWQ = "awq" FP8 = "fp8" GGUF = "gguf" diff --git a/src/graphn/_generated/models/custom_model_status.py b/src/graphn/_generated/models/custom_model_status.py index c870d51..f41dc5a 100644 --- a/src/graphn/_generated/models/custom_model_status.py +++ b/src/graphn/_generated/models/custom_model_status.py @@ -1,7 +1,7 @@ -from enum import Enum +from enum import StrEnum -class CustomModelStatus(str, Enum): +class CustomModelStatus(StrEnum): DELETING = "deleting" DEPLOYING = "deploying" FAILED = "failed" diff --git a/src/graphn/_generated/models/discover_imported_models_response.py b/src/graphn/_generated/models/discover_imported_models_response.py index b1397b5..e2d48f3 100644 --- a/src/graphn/_generated/models/discover_imported_models_response.py +++ b/src/graphn/_generated/models/discover_imported_models_response.py @@ -40,7 +40,9 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - from ..models.discovered_imported_model import DiscoveredImportedModel + from ..models.discovered_imported_model import ( + DiscoveredImportedModel, + ) d = dict(src_dict) models = [] diff --git a/src/graphn/_generated/models/document_media.py b/src/graphn/_generated/models/document_media.py new file mode 100644 index 0000000..a99fdef --- /dev/null +++ b/src/graphn/_generated/models/document_media.py @@ -0,0 +1,71 @@ +from __future__ import annotations + +import datetime +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from typing_extensions import Self + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="DocumentMedia") + + +@_attrs_define +class DocumentMedia: + """ + Attributes: + url (str): + expires_at (datetime.datetime): + expires_in (int): + content_type (str | Unset): + """ + + url: str + expires_at: datetime.datetime + expires_in: int + content_type: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + url = self.url + + expires_at = self.expires_at.isoformat() + + expires_in = self.expires_in + + content_type = self.content_type + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "url": url, + "expires_at": expires_at, + "expires_in": expires_in, + } + ) + if content_type is not UNSET: + field_dict["content_type"] = content_type + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + url = d.pop("url") + + expires_at = datetime.datetime.fromisoformat(d.pop("expires_at")) + + expires_in = d.pop("expires_in") + + content_type = d.pop("content_type", UNSET) + + document_media = cls( + url=url, + expires_at=expires_at, + expires_in=expires_in, + content_type=content_type, + ) + + return document_media diff --git a/src/graphn/_generated/models/function_create.py b/src/graphn/_generated/models/function_create.py index ec2c04b..0238ca7 100644 --- a/src/graphn/_generated/models/function_create.py +++ b/src/graphn/_generated/models/function_create.py @@ -6,6 +6,7 @@ from attrs import define as _attrs_define from typing_extensions import Self +from ..models.function_create_type import FunctionCreateType from ..types import UNSET, Unset if TYPE_CHECKING: @@ -23,7 +24,7 @@ class FunctionCreate: """ Attributes: name (str): - type_ (str | Unset): + type_ (FunctionCreateType | Unset): description (str | Unset): files (FunctionCreateFiles | Unset): parameters_schema (FunctionCreateParametersSchema | Unset): @@ -33,7 +34,7 @@ class FunctionCreate: """ name: str - type_: str | Unset = UNSET + type_: FunctionCreateType | Unset = UNSET description: str | Unset = UNSET files: FunctionCreateFiles | Unset = UNSET parameters_schema: FunctionCreateParametersSchema | Unset = UNSET @@ -44,7 +45,9 @@ class FunctionCreate: def to_dict(self) -> dict[str, Any]: name = self.name - type_ = self.type_ + type_: str | Unset = UNSET + if not isinstance(self.type_, Unset): + type_ = self.type_.value description = self.description @@ -96,7 +99,12 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: d = dict(src_dict) name = d.pop("name") - type_ = d.pop("type", UNSET) + _type_ = d.pop("type", UNSET) + type_: FunctionCreateType | Unset + if isinstance(_type_, Unset): + type_ = UNSET + else: + type_ = FunctionCreateType(_type_) description = d.pop("description", UNSET) diff --git a/src/graphn/_generated/models/function_create_files.py b/src/graphn/_generated/models/function_create_files.py index f66edcc..064e621 100644 --- a/src/graphn/_generated/models/function_create_files.py +++ b/src/graphn/_generated/models/function_create_files.py @@ -12,8 +12,6 @@ @_attrs_define class FunctionCreateFiles: - """ """ - additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/function_create_parameters_schema.py b/src/graphn/_generated/models/function_create_parameters_schema.py index 1a4ff0c..57b2e41 100644 --- a/src/graphn/_generated/models/function_create_parameters_schema.py +++ b/src/graphn/_generated/models/function_create_parameters_schema.py @@ -12,8 +12,6 @@ @_attrs_define class FunctionCreateParametersSchema: - """ """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/function_create_type.py b/src/graphn/_generated/models/function_create_type.py new file mode 100644 index 0000000..e04fa81 --- /dev/null +++ b/src/graphn/_generated/models/function_create_type.py @@ -0,0 +1,9 @@ +from enum import StrEnum + + +class FunctionCreateType(StrEnum): + BUILTIN = "builtin" + CUSTOM = "custom" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/graphn/_generated/models/function_dry_run_request.py b/src/graphn/_generated/models/function_dry_run_request.py index ca9aa20..881f9a5 100644 --- a/src/graphn/_generated/models/function_dry_run_request.py +++ b/src/graphn/_generated/models/function_dry_run_request.py @@ -66,8 +66,12 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - from ..models.function_dry_run_request_files import FunctionDryRunRequestFiles - from ..models.function_dry_run_request_input import FunctionDryRunRequestInput + from ..models.function_dry_run_request_files import ( + FunctionDryRunRequestFiles, + ) + from ..models.function_dry_run_request_input import ( + FunctionDryRunRequestInput, + ) d = dict(src_dict) _files = d.pop("files", UNSET) diff --git a/src/graphn/_generated/models/function_dry_run_request_files.py b/src/graphn/_generated/models/function_dry_run_request_files.py index 5272a3c..8987226 100644 --- a/src/graphn/_generated/models/function_dry_run_request_files.py +++ b/src/graphn/_generated/models/function_dry_run_request_files.py @@ -12,8 +12,6 @@ @_attrs_define class FunctionDryRunRequestFiles: - """ """ - additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/function_dry_run_request_input.py b/src/graphn/_generated/models/function_dry_run_request_input.py index fdbf446..403e760 100644 --- a/src/graphn/_generated/models/function_dry_run_request_input.py +++ b/src/graphn/_generated/models/function_dry_run_request_input.py @@ -12,8 +12,6 @@ @_attrs_define class FunctionDryRunRequestInput: - """ """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/function_spec.py b/src/graphn/_generated/models/function_spec.py index a602fcb..19e41e9 100644 --- a/src/graphn/_generated/models/function_spec.py +++ b/src/graphn/_generated/models/function_spec.py @@ -7,6 +7,7 @@ from attrs import field as _attrs_field from typing_extensions import Self +from ..models.function_spec_type import FunctionSpecType from ..types import UNSET, Unset if TYPE_CHECKING: @@ -21,7 +22,7 @@ class FunctionSpec: """ Attributes: - type_ (str | Unset): + type_ (FunctionSpecType | Unset): description (str | Unset): files (FunctionSpecFiles | Unset): parameters_schema (FunctionSpecParametersSchema | Unset): @@ -29,7 +30,7 @@ class FunctionSpec: memory_mb (int | Unset): """ - type_: str | Unset = UNSET + type_: FunctionSpecType | Unset = UNSET description: str | Unset = UNSET files: FunctionSpecFiles | Unset = UNSET parameters_schema: FunctionSpecParametersSchema | Unset = UNSET @@ -38,7 +39,9 @@ class FunctionSpec: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_ = self.type_ + type_: str | Unset = UNSET + if not isinstance(self.type_, Unset): + type_ = self.type_.value description = self.description @@ -80,7 +83,12 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: ) d = dict(src_dict) - type_ = d.pop("type", UNSET) + _type_ = d.pop("type", UNSET) + type_: FunctionSpecType | Unset + if isinstance(_type_, Unset): + type_ = UNSET + else: + type_ = FunctionSpecType(_type_) description = d.pop("description", UNSET) diff --git a/src/graphn/_generated/models/function_spec_files.py b/src/graphn/_generated/models/function_spec_files.py index e7a85f9..43a8069 100644 --- a/src/graphn/_generated/models/function_spec_files.py +++ b/src/graphn/_generated/models/function_spec_files.py @@ -12,8 +12,6 @@ @_attrs_define class FunctionSpecFiles: - """ """ - additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/function_spec_parameters_schema.py b/src/graphn/_generated/models/function_spec_parameters_schema.py index c047214..3298dd3 100644 --- a/src/graphn/_generated/models/function_spec_parameters_schema.py +++ b/src/graphn/_generated/models/function_spec_parameters_schema.py @@ -12,8 +12,6 @@ @_attrs_define class FunctionSpecParametersSchema: - """ """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/function_spec_type.py b/src/graphn/_generated/models/function_spec_type.py new file mode 100644 index 0000000..a89802d --- /dev/null +++ b/src/graphn/_generated/models/function_spec_type.py @@ -0,0 +1,9 @@ +from enum import StrEnum + + +class FunctionSpecType(StrEnum): + BUILTIN = "builtin" + CUSTOM = "custom" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/graphn/_generated/models/function_test_request.py b/src/graphn/_generated/models/function_test_request.py index 48661d1..088ac82 100644 --- a/src/graphn/_generated/models/function_test_request.py +++ b/src/graphn/_generated/models/function_test_request.py @@ -39,7 +39,9 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - from ..models.function_test_request_input import FunctionTestRequestInput + from ..models.function_test_request_input import ( + FunctionTestRequestInput, + ) d = dict(src_dict) _input_ = d.pop("input", UNSET) diff --git a/src/graphn/_generated/models/function_test_request_input.py b/src/graphn/_generated/models/function_test_request_input.py index 0f84f14..21f0f96 100644 --- a/src/graphn/_generated/models/function_test_request_input.py +++ b/src/graphn/_generated/models/function_test_request_input.py @@ -12,8 +12,6 @@ @_attrs_define class FunctionTestRequestInput: - """ """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/function_update_files.py b/src/graphn/_generated/models/function_update_files.py index 725c18b..53d68df 100644 --- a/src/graphn/_generated/models/function_update_files.py +++ b/src/graphn/_generated/models/function_update_files.py @@ -12,8 +12,6 @@ @_attrs_define class FunctionUpdateFiles: - """ """ - additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/function_update_parameters_schema.py b/src/graphn/_generated/models/function_update_parameters_schema.py index 723bf4e..e468ca5 100644 --- a/src/graphn/_generated/models/function_update_parameters_schema.py +++ b/src/graphn/_generated/models/function_update_parameters_schema.py @@ -12,8 +12,6 @@ @_attrs_define class FunctionUpdateParametersSchema: - """ """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/get_billing_usage_filter.py b/src/graphn/_generated/models/get_billing_usage_filter.py index 54e0ac0..4d01926 100644 --- a/src/graphn/_generated/models/get_billing_usage_filter.py +++ b/src/graphn/_generated/models/get_billing_usage_filter.py @@ -1,7 +1,7 @@ -from enum import Enum +from enum import StrEnum -class GetBillingUsageFilter(str, Enum): +class GetBillingUsageFilter(StrEnum): ONE_DAY = "ONE_DAY" ONE_YEAR = "ONE_YEAR" SEVEN_DAY = "SEVEN_DAY" diff --git a/src/graphn/_generated/models/google_pub_sub_envelope.py b/src/graphn/_generated/models/google_pub_sub_envelope.py new file mode 100644 index 0000000..3daf3ed --- /dev/null +++ b/src/graphn/_generated/models/google_pub_sub_envelope.py @@ -0,0 +1,78 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from typing_extensions import Self + +if TYPE_CHECKING: + from ..models.google_pub_sub_envelope_message import GooglePubSubEnvelopeMessage + + +T = TypeVar("T", bound="GooglePubSubEnvelope") + + +@_attrs_define +class GooglePubSubEnvelope: + """ + Attributes: + subscription (str): + message (GooglePubSubEnvelopeMessage): + """ + + subscription: str + message: GooglePubSubEnvelopeMessage + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + subscription = self.subscription + + message = self.message.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "subscription": subscription, + "message": message, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + from ..models.google_pub_sub_envelope_message import ( + GooglePubSubEnvelopeMessage, + ) + + d = dict(src_dict) + subscription = d.pop("subscription") + + message = GooglePubSubEnvelopeMessage.from_dict(d.pop("message")) + + google_pub_sub_envelope = cls( + subscription=subscription, + message=message, + ) + + google_pub_sub_envelope.additional_properties = d + return google_pub_sub_envelope + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/graphn/_generated/models/google_pub_sub_envelope_message.py b/src/graphn/_generated/models/google_pub_sub_envelope_message.py new file mode 100644 index 0000000..952b6d7 --- /dev/null +++ b/src/graphn/_generated/models/google_pub_sub_envelope_message.py @@ -0,0 +1,70 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from typing_extensions import Self + +T = TypeVar("T", bound="GooglePubSubEnvelopeMessage") + + +@_attrs_define +class GooglePubSubEnvelopeMessage: + """ + Attributes: + data (str): Base64-encoded Gmail notification JSON. + message_id (str): + """ + + data: str + message_id: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + data = self.data + + message_id = self.message_id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "data": data, + "messageId": message_id, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + data = d.pop("data") + + message_id = d.pop("messageId") + + google_pub_sub_envelope_message = cls( + data=data, + message_id=message_id, + ) + + google_pub_sub_envelope_message.additional_properties = d + return google_pub_sub_envelope_message + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/graphn/_generated/models/ingest_item_input.py b/src/graphn/_generated/models/ingest_item_input.py index 18f1c8c..e2fb0f2 100644 --- a/src/graphn/_generated/models/ingest_item_input.py +++ b/src/graphn/_generated/models/ingest_item_input.py @@ -65,7 +65,9 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - from ..models.ingest_item_input_metadata import IngestItemInputMetadata + from ..models.ingest_item_input_metadata import ( + IngestItemInputMetadata, + ) d = dict(src_dict) url = d.pop("url") diff --git a/src/graphn/_generated/models/ingest_item_input_metadata.py b/src/graphn/_generated/models/ingest_item_input_metadata.py index 76e7306..574cb82 100644 --- a/src/graphn/_generated/models/ingest_item_input_metadata.py +++ b/src/graphn/_generated/models/ingest_item_input_metadata.py @@ -12,8 +12,6 @@ @_attrs_define class IngestItemInputMetadata: - """ """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/integration.py b/src/graphn/_generated/models/integration.py new file mode 100644 index 0000000..3ede07d --- /dev/null +++ b/src/graphn/_generated/models/integration.py @@ -0,0 +1,122 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from typing_extensions import Self + +from ..models.integration_auth_mode import IntegrationAuthMode +from ..models.integration_kind import IntegrationKind +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.integration_capability import IntegrationCapability + from ..models.integration_event import IntegrationEvent + + +T = TypeVar("T", bound="Integration") + + +@_attrs_define +class Integration: + """ + Attributes: + id (str): + display_name (str): + kind (IntegrationKind): + auth_mode (IntegrationAuthMode): + capabilities (list[IntegrationCapability]): + events (list[IntegrationEvent]): + description (str | Unset): + """ + + id: str + display_name: str + kind: IntegrationKind + auth_mode: IntegrationAuthMode + capabilities: list[IntegrationCapability] + events: list[IntegrationEvent] + description: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + id = self.id + + display_name = self.display_name + + kind = self.kind.value + + auth_mode = self.auth_mode.value + + capabilities = [] + for capabilities_item_data in self.capabilities: + capabilities_item = capabilities_item_data.to_dict() + capabilities.append(capabilities_item) + + events = [] + for events_item_data in self.events: + events_item = events_item_data.to_dict() + events.append(events_item) + + description = self.description + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "id": id, + "display_name": display_name, + "kind": kind, + "auth_mode": auth_mode, + "capabilities": capabilities, + "events": events, + } + ) + if description is not UNSET: + field_dict["description"] = description + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + from ..models.integration_capability import ( + IntegrationCapability, + ) + from ..models.integration_event import IntegrationEvent + + d = dict(src_dict) + id = d.pop("id") + + display_name = d.pop("display_name") + + kind = IntegrationKind(d.pop("kind")) + + auth_mode = IntegrationAuthMode(d.pop("auth_mode")) + + capabilities = [] + _capabilities = d.pop("capabilities") + for capabilities_item_data in _capabilities: + capabilities_item = IntegrationCapability.from_dict(capabilities_item_data) + + capabilities.append(capabilities_item) + + events = [] + _events = d.pop("events") + for events_item_data in _events: + events_item = IntegrationEvent.from_dict(events_item_data) + + events.append(events_item) + + description = d.pop("description", UNSET) + + integration = cls( + id=id, + display_name=display_name, + kind=kind, + auth_mode=auth_mode, + capabilities=capabilities, + events=events, + description=description, + ) + + return integration diff --git a/src/graphn/_generated/models/integration_auth_mode.py b/src/graphn/_generated/models/integration_auth_mode.py new file mode 100644 index 0000000..28bc3c0 --- /dev/null +++ b/src/graphn/_generated/models/integration_auth_mode.py @@ -0,0 +1,8 @@ +from enum import StrEnum + + +class IntegrationAuthMode(StrEnum): + OAUTH2 = "oauth2" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/graphn/_generated/models/integration_capability.py b/src/graphn/_generated/models/integration_capability.py new file mode 100644 index 0000000..5aff72b --- /dev/null +++ b/src/graphn/_generated/models/integration_capability.py @@ -0,0 +1,62 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from typing_extensions import Self + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="IntegrationCapability") + + +@_attrs_define +class IntegrationCapability: + """ + Attributes: + id (str): + display_name (str): + description (str | Unset): + """ + + id: str + display_name: str + description: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + id = self.id + + display_name = self.display_name + + description = self.description + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "id": id, + "display_name": display_name, + } + ) + if description is not UNSET: + field_dict["description"] = description + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + id = d.pop("id") + + display_name = d.pop("display_name") + + description = d.pop("description", UNSET) + + integration_capability = cls( + id=id, + display_name=display_name, + description=description, + ) + + return integration_capability diff --git a/src/graphn/_generated/models/integration_event.py b/src/graphn/_generated/models/integration_event.py new file mode 100644 index 0000000..84ca66d --- /dev/null +++ b/src/graphn/_generated/models/integration_event.py @@ -0,0 +1,71 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from typing_extensions import Self + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="IntegrationEvent") + + +@_attrs_define +class IntegrationEvent: + """ + Attributes: + id (str): + display_name (str): + description (str | Unset): + capability (str | Unset): + """ + + id: str + display_name: str + description: str | Unset = UNSET + capability: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + id = self.id + + display_name = self.display_name + + description = self.description + + capability = self.capability + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "id": id, + "display_name": display_name, + } + ) + if description is not UNSET: + field_dict["description"] = description + if capability is not UNSET: + field_dict["capability"] = capability + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + id = d.pop("id") + + display_name = d.pop("display_name") + + description = d.pop("description", UNSET) + + capability = d.pop("capability", UNSET) + + integration_event = cls( + id=id, + display_name=display_name, + description=description, + capability=capability, + ) + + return integration_event diff --git a/src/graphn/_generated/models/integration_kind.py b/src/graphn/_generated/models/integration_kind.py new file mode 100644 index 0000000..ad216bd --- /dev/null +++ b/src/graphn/_generated/models/integration_kind.py @@ -0,0 +1,9 @@ +from enum import StrEnum + + +class IntegrationKind(StrEnum): + MCP = "mcp" + NATIVE = "native" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/graphn/_generated/models/integration_list.py b/src/graphn/_generated/models/integration_list.py new file mode 100644 index 0000000..2484714 --- /dev/null +++ b/src/graphn/_generated/models/integration_list.py @@ -0,0 +1,65 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from typing_extensions import Self + +if TYPE_CHECKING: + from ..models.integration import Integration + + +T = TypeVar("T", bound="IntegrationList") + + +@_attrs_define +class IntegrationList: + """ + Attributes: + items (list[Integration]): + count (int): + """ + + items: list[Integration] + count: int + + def to_dict(self) -> dict[str, Any]: + items = [] + for items_item_data in self.items: + items_item = items_item_data.to_dict() + items.append(items_item) + + count = self.count + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "items": items, + "count": count, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + from ..models.integration import Integration + + d = dict(src_dict) + items = [] + _items = d.pop("items") + for items_item_data in _items: + items_item = Integration.from_dict(items_item_data) + + items.append(items_item) + + count = d.pop("count") + + integration_list = cls( + items=items, + count=count, + ) + + return integration_list diff --git a/src/graphn/_generated/models/invitation_create_role.py b/src/graphn/_generated/models/invitation_create_role.py index c0e3494..bc247a6 100644 --- a/src/graphn/_generated/models/invitation_create_role.py +++ b/src/graphn/_generated/models/invitation_create_role.py @@ -1,7 +1,7 @@ -from enum import Enum +from enum import StrEnum -class InvitationCreateRole(str, Enum): +class InvitationCreateRole(StrEnum): ADMIN = "admin" MEMBER = "member" OWNER = "owner" diff --git a/src/graphn/_generated/models/invitation_role.py b/src/graphn/_generated/models/invitation_role.py index f6d46cb..e7ffe07 100644 --- a/src/graphn/_generated/models/invitation_role.py +++ b/src/graphn/_generated/models/invitation_role.py @@ -1,7 +1,7 @@ -from enum import Enum +from enum import StrEnum -class InvitationRole(str, Enum): +class InvitationRole(StrEnum): ADMIN = "admin" MEMBER = "member" OWNER = "owner" diff --git a/src/graphn/_generated/models/invitation_scope_type.py b/src/graphn/_generated/models/invitation_scope_type.py index 6c9feb8..0710ab4 100644 --- a/src/graphn/_generated/models/invitation_scope_type.py +++ b/src/graphn/_generated/models/invitation_scope_type.py @@ -1,7 +1,7 @@ -from enum import Enum +from enum import StrEnum -class InvitationScopeType(str, Enum): +class InvitationScopeType(StrEnum): ORG = "org" WORKSPACE = "workspace" diff --git a/src/graphn/_generated/models/invitation_status.py b/src/graphn/_generated/models/invitation_status.py index c9a945a..26713e8 100644 --- a/src/graphn/_generated/models/invitation_status.py +++ b/src/graphn/_generated/models/invitation_status.py @@ -1,7 +1,7 @@ -from enum import Enum +from enum import StrEnum -class InvitationStatus(str, Enum): +class InvitationStatus(StrEnum): ACCEPTED = "accepted" DECLINED = "declined" EXPIRED = "expired" diff --git a/src/graphn/_generated/models/invoice.py b/src/graphn/_generated/models/invoice.py index 8ecd2e5..c60011a 100644 --- a/src/graphn/_generated/models/invoice.py +++ b/src/graphn/_generated/models/invoice.py @@ -2,7 +2,7 @@ import datetime from collections.abc import Mapping -from typing import Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -11,6 +11,10 @@ from ..models.invoice_status import InvoiceStatus from ..types import UNSET, Unset +if TYPE_CHECKING: + from ..models.usage_day import UsageDay + + T = TypeVar("T", bound="Invoice") @@ -21,35 +25,46 @@ class Invoice: id (str): number (str): status (InvoiceStatus): - amount_due (int): currency (str): created (int): period_start (datetime.datetime): period_end (datetime.datetime): + amount_due (int | Unset): Compatibility field for legacy invoice clients. For prepaid statements this is + max(-closingCents, 0), not a collections balance with payment terms. It is omitted when statement figures could + not be read; an explicit 0 means the amount due is known to be zero. opening_cents (int | Unset): usage_cents (int | Unset): credits_cents (int | Unset): + credited_cents (int | Unset): + debited_cents (int | Unset): closing_cents (int | Unset): - hosted_invoice_url (str | Unset): + revision (int | Unset): + usage_by_day (list[UsageDay] | Unset): + hosted_invoice_url (str | Unset): Stripe-hosted invoice page URL. Statement-backed responses leave this empty. invoice_pdf (str | Unset): - invoice_document_url (str | Unset): + invoice_preview_url (str | Unset): Inline-renderable statement URL. For statement rows this is a separately + signed URL with inline content disposition; it may be empty when no preview artifact exists. """ id: str number: str status: InvoiceStatus - amount_due: int currency: str created: int period_start: datetime.datetime period_end: datetime.datetime + amount_due: int | Unset = UNSET opening_cents: int | Unset = UNSET usage_cents: int | Unset = UNSET credits_cents: int | Unset = UNSET + credited_cents: int | Unset = UNSET + debited_cents: int | Unset = UNSET closing_cents: int | Unset = UNSET + revision: int | Unset = UNSET + usage_by_day: list[UsageDay] | Unset = UNSET hosted_invoice_url: str | Unset = UNSET invoice_pdf: str | Unset = UNSET - invoice_document_url: str | Unset = UNSET + invoice_preview_url: str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -59,8 +74,6 @@ def to_dict(self) -> dict[str, Any]: status = self.status.value - amount_due = self.amount_due - currency = self.currency created = self.created @@ -69,19 +82,34 @@ def to_dict(self) -> dict[str, Any]: period_end = self.period_end.isoformat() + amount_due = self.amount_due + opening_cents = self.opening_cents usage_cents = self.usage_cents credits_cents = self.credits_cents + credited_cents = self.credited_cents + + debited_cents = self.debited_cents + closing_cents = self.closing_cents + revision = self.revision + + usage_by_day: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.usage_by_day, Unset): + usage_by_day = [] + for usage_by_day_item_data in self.usage_by_day: + usage_by_day_item = usage_by_day_item_data.to_dict() + usage_by_day.append(usage_by_day_item) + hosted_invoice_url = self.hosted_invoice_url invoice_pdf = self.invoice_pdf - invoice_document_url = self.invoice_document_url + invoice_preview_url = self.invoice_preview_url field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -90,32 +118,43 @@ def to_dict(self) -> dict[str, Any]: "id": id, "number": number, "status": status, - "amountDue": amount_due, "currency": currency, "created": created, "periodStart": period_start, "periodEnd": period_end, } ) + if amount_due is not UNSET: + field_dict["amountDue"] = amount_due if opening_cents is not UNSET: field_dict["openingCents"] = opening_cents if usage_cents is not UNSET: field_dict["usageCents"] = usage_cents if credits_cents is not UNSET: field_dict["creditsCents"] = credits_cents + if credited_cents is not UNSET: + field_dict["creditedCents"] = credited_cents + if debited_cents is not UNSET: + field_dict["debitedCents"] = debited_cents if closing_cents is not UNSET: field_dict["closingCents"] = closing_cents + if revision is not UNSET: + field_dict["revision"] = revision + if usage_by_day is not UNSET: + field_dict["usageByDay"] = usage_by_day if hosted_invoice_url is not UNSET: field_dict["hostedInvoiceUrl"] = hosted_invoice_url if invoice_pdf is not UNSET: field_dict["invoicePdf"] = invoice_pdf - if invoice_document_url is not UNSET: - field_dict["invoiceDocumentUrl"] = invoice_document_url + if invoice_preview_url is not UNSET: + field_dict["invoicePreviewUrl"] = invoice_preview_url return field_dict @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + from ..models.usage_day import UsageDay + d = dict(src_dict) id = d.pop("id") @@ -123,8 +162,6 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: status = InvoiceStatus(d.pop("status")) - amount_due = d.pop("amountDue") - currency = d.pop("currency") created = d.pop("created") @@ -133,36 +170,57 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: period_end = datetime.datetime.fromisoformat(d.pop("periodEnd")) + amount_due = d.pop("amountDue", UNSET) + opening_cents = d.pop("openingCents", UNSET) usage_cents = d.pop("usageCents", UNSET) credits_cents = d.pop("creditsCents", UNSET) + credited_cents = d.pop("creditedCents", UNSET) + + debited_cents = d.pop("debitedCents", UNSET) + closing_cents = d.pop("closingCents", UNSET) + revision = d.pop("revision", UNSET) + + _usage_by_day = d.pop("usageByDay", UNSET) + usage_by_day: list[UsageDay] | Unset = UNSET + if _usage_by_day is not UNSET: + usage_by_day = [] + for usage_by_day_item_data in _usage_by_day: + usage_by_day_item = UsageDay.from_dict(usage_by_day_item_data) + + usage_by_day.append(usage_by_day_item) + hosted_invoice_url = d.pop("hostedInvoiceUrl", UNSET) invoice_pdf = d.pop("invoicePdf", UNSET) - invoice_document_url = d.pop("invoiceDocumentUrl", UNSET) + invoice_preview_url = d.pop("invoicePreviewUrl", UNSET) invoice = cls( id=id, number=number, status=status, - amount_due=amount_due, currency=currency, created=created, period_start=period_start, period_end=period_end, + amount_due=amount_due, opening_cents=opening_cents, usage_cents=usage_cents, credits_cents=credits_cents, + credited_cents=credited_cents, + debited_cents=debited_cents, closing_cents=closing_cents, + revision=revision, + usage_by_day=usage_by_day, hosted_invoice_url=hosted_invoice_url, invoice_pdf=invoice_pdf, - invoice_document_url=invoice_document_url, + invoice_preview_url=invoice_preview_url, ) invoice.additional_properties = d diff --git a/src/graphn/_generated/models/invoice_status.py b/src/graphn/_generated/models/invoice_status.py index 21679ed..18c1f2f 100644 --- a/src/graphn/_generated/models/invoice_status.py +++ b/src/graphn/_generated/models/invoice_status.py @@ -1,7 +1,7 @@ -from enum import Enum +from enum import StrEnum -class InvoiceStatus(str, Enum): +class InvoiceStatus(StrEnum): CLOSED = "closed" CURRENT = "current" diff --git a/src/graphn/_generated/models/kb_document.py b/src/graphn/_generated/models/kb_document.py index cd86f2e..7026823 100644 --- a/src/graphn/_generated/models/kb_document.py +++ b/src/graphn/_generated/models/kb_document.py @@ -30,6 +30,9 @@ class KbDocument: document_type (str | Unset): image_url (str | Unset): video_url (str | Unset): + expires_at (datetime.datetime | Unset): + expires_in (int | Unset): + media_href (str | Unset): segment_seconds (int | Unset): metadata (KbDocumentMetadata | Unset): """ @@ -43,6 +46,9 @@ class KbDocument: document_type: str | Unset = UNSET image_url: str | Unset = UNSET video_url: str | Unset = UNSET + expires_at: datetime.datetime | Unset = UNSET + expires_in: int | Unset = UNSET + media_href: str | Unset = UNSET segment_seconds: int | Unset = UNSET metadata: KbDocumentMetadata | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -66,6 +72,14 @@ def to_dict(self) -> dict[str, Any]: video_url = self.video_url + expires_at: str | Unset = UNSET + if not isinstance(self.expires_at, Unset): + expires_at = self.expires_at.isoformat() + + expires_in = self.expires_in + + media_href = self.media_href + segment_seconds = self.segment_seconds metadata: dict[str, Any] | Unset = UNSET @@ -90,6 +104,12 @@ def to_dict(self) -> dict[str, Any]: field_dict["image_url"] = image_url if video_url is not UNSET: field_dict["video_url"] = video_url + if expires_at is not UNSET: + field_dict["expires_at"] = expires_at + if expires_in is not UNSET: + field_dict["expires_in"] = expires_in + if media_href is not UNSET: + field_dict["media_href"] = media_href if segment_seconds is not UNSET: field_dict["segment_seconds"] = segment_seconds if metadata is not UNSET: @@ -120,6 +140,17 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: video_url = d.pop("video_url", UNSET) + _expires_at = d.pop("expires_at", UNSET) + expires_at: datetime.datetime | Unset + if isinstance(_expires_at, Unset): + expires_at = UNSET + else: + expires_at = datetime.datetime.fromisoformat(_expires_at) + + expires_in = d.pop("expires_in", UNSET) + + media_href = d.pop("media_href", UNSET) + segment_seconds = d.pop("segment_seconds", UNSET) _metadata = d.pop("metadata", UNSET) @@ -139,6 +170,9 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: document_type=document_type, image_url=image_url, video_url=video_url, + expires_at=expires_at, + expires_in=expires_in, + media_href=media_href, segment_seconds=segment_seconds, metadata=metadata, ) diff --git a/src/graphn/_generated/models/kb_document_metadata.py b/src/graphn/_generated/models/kb_document_metadata.py index 1bd118f..3f4ed9b 100644 --- a/src/graphn/_generated/models/kb_document_metadata.py +++ b/src/graphn/_generated/models/kb_document_metadata.py @@ -12,8 +12,6 @@ @_attrs_define class KbDocumentMetadata: - """ """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/list_billing_invoices_response_200_empty_reason.py b/src/graphn/_generated/models/list_billing_invoices_response_200_empty_reason.py index 6f862e5..a1a7227 100644 --- a/src/graphn/_generated/models/list_billing_invoices_response_200_empty_reason.py +++ b/src/graphn/_generated/models/list_billing_invoices_response_200_empty_reason.py @@ -1,7 +1,7 @@ -from enum import Enum +from enum import StrEnum -class ListBillingInvoicesResponse200EmptyReason(str, Enum): +class ListBillingInvoicesResponse200EmptyReason(StrEnum): NO_BILLING_HISTORY = "no_billing_history" STATEMENTS_NOT_GENERATED_YET = "statements_not_generated_yet" diff --git a/src/graphn/_generated/models/list_tts_voices_response_200.py b/src/graphn/_generated/models/list_tts_voices_response_200.py index 15dba86..a716640 100644 --- a/src/graphn/_generated/models/list_tts_voices_response_200.py +++ b/src/graphn/_generated/models/list_tts_voices_response_200.py @@ -12,8 +12,6 @@ @_attrs_define class ListTtsVoicesResponse200: - """ """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/managed_connection_tool_call.py b/src/graphn/_generated/models/managed_connection_tool_call.py new file mode 100644 index 0000000..e9722f0 --- /dev/null +++ b/src/graphn/_generated/models/managed_connection_tool_call.py @@ -0,0 +1,69 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from typing_extensions import Self + +if TYPE_CHECKING: + from ..models.managed_connection_tool_call_arguments import ( + ManagedConnectionToolCallArguments, + ) + + +T = TypeVar("T", bound="ManagedConnectionToolCall") + + +@_attrs_define +class ManagedConnectionToolCall: + """ + Attributes: + resource_id (str): + version_id (str): + arguments (ManagedConnectionToolCallArguments): + """ + + resource_id: str + version_id: str + arguments: ManagedConnectionToolCallArguments + + def to_dict(self) -> dict[str, Any]: + resource_id = self.resource_id + + version_id = self.version_id + + arguments = self.arguments.to_dict() + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "resource_id": resource_id, + "version_id": version_id, + "arguments": arguments, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + from ..models.managed_connection_tool_call_arguments import ( + ManagedConnectionToolCallArguments, + ) + + d = dict(src_dict) + resource_id = d.pop("resource_id") + + version_id = d.pop("version_id") + + arguments = ManagedConnectionToolCallArguments.from_dict(d.pop("arguments")) + + managed_connection_tool_call = cls( + resource_id=resource_id, + version_id=version_id, + arguments=arguments, + ) + + return managed_connection_tool_call diff --git a/src/graphn/_generated/models/managed_connection_tool_call_arguments.py b/src/graphn/_generated/models/managed_connection_tool_call_arguments.py new file mode 100644 index 0000000..1550389 --- /dev/null +++ b/src/graphn/_generated/models/managed_connection_tool_call_arguments.py @@ -0,0 +1,46 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from typing_extensions import Self + +T = TypeVar("T", bound="ManagedConnectionToolCallArguments") + + +@_attrs_define +class ManagedConnectionToolCallArguments: + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + managed_connection_tool_call_arguments = cls() + + managed_connection_tool_call_arguments.additional_properties = d + return managed_connection_tool_call_arguments + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/graphn/_generated/models/managed_connection_tool_result.py b/src/graphn/_generated/models/managed_connection_tool_result.py new file mode 100644 index 0000000..576e219 --- /dev/null +++ b/src/graphn/_generated/models/managed_connection_tool_result.py @@ -0,0 +1,54 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from typing_extensions import Self + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ManagedConnectionToolResult") + + +@_attrs_define +class ManagedConnectionToolResult: + """ + Attributes: + success (bool): + output (Any | Unset): + """ + + success: bool + output: Any | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + success = self.success + + output = self.output + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "success": success, + } + ) + if output is not UNSET: + field_dict["output"] = output + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + success = d.pop("success") + + output = d.pop("output", UNSET) + + managed_connection_tool_result = cls( + success=success, + output=output, + ) + + return managed_connection_tool_result diff --git a/src/graphn/_generated/models/mcp_discover_tools_request_files.py b/src/graphn/_generated/models/mcp_discover_tools_request_files.py index c68edd2..7b13187 100644 --- a/src/graphn/_generated/models/mcp_discover_tools_request_files.py +++ b/src/graphn/_generated/models/mcp_discover_tools_request_files.py @@ -12,8 +12,6 @@ @_attrs_define class McpDiscoverToolsRequestFiles: - """ """ - additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/mcp_dry_run_test_request.py b/src/graphn/_generated/models/mcp_dry_run_test_request.py index c503065..7f2f39a 100644 --- a/src/graphn/_generated/models/mcp_dry_run_test_request.py +++ b/src/graphn/_generated/models/mcp_dry_run_test_request.py @@ -54,8 +54,12 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - from ..models.mcp_dry_run_test_request_files import McpDryRunTestRequestFiles - from ..models.mcp_dry_run_test_request_input import McpDryRunTestRequestInput + from ..models.mcp_dry_run_test_request_files import ( + McpDryRunTestRequestFiles, + ) + from ..models.mcp_dry_run_test_request_input import ( + McpDryRunTestRequestInput, + ) d = dict(src_dict) _files = d.pop("files", UNSET) diff --git a/src/graphn/_generated/models/mcp_dry_run_test_request_files.py b/src/graphn/_generated/models/mcp_dry_run_test_request_files.py index 2eaad83..ff69412 100644 --- a/src/graphn/_generated/models/mcp_dry_run_test_request_files.py +++ b/src/graphn/_generated/models/mcp_dry_run_test_request_files.py @@ -12,8 +12,6 @@ @_attrs_define class McpDryRunTestRequestFiles: - """ """ - additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/mcp_dry_run_test_request_input.py b/src/graphn/_generated/models/mcp_dry_run_test_request_input.py index 0ed19b3..7af4668 100644 --- a/src/graphn/_generated/models/mcp_dry_run_test_request_input.py +++ b/src/graphn/_generated/models/mcp_dry_run_test_request_input.py @@ -12,8 +12,6 @@ @_attrs_define class McpDryRunTestRequestInput: - """ """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/mcp_save_version_request.py b/src/graphn/_generated/models/mcp_save_version_request.py index ff46b8a..3fe16bf 100644 --- a/src/graphn/_generated/models/mcp_save_version_request.py +++ b/src/graphn/_generated/models/mcp_save_version_request.py @@ -45,7 +45,9 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - from ..models.mcp_save_version_request_files import McpSaveVersionRequestFiles + from ..models.mcp_save_version_request_files import ( + McpSaveVersionRequestFiles, + ) d = dict(src_dict) _files = d.pop("files", UNSET) diff --git a/src/graphn/_generated/models/mcp_save_version_request_files.py b/src/graphn/_generated/models/mcp_save_version_request_files.py index a9bd398..0ac0e55 100644 --- a/src/graphn/_generated/models/mcp_save_version_request_files.py +++ b/src/graphn/_generated/models/mcp_save_version_request_files.py @@ -12,8 +12,6 @@ @_attrs_define class McpSaveVersionRequestFiles: - """ """ - additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/mcp_server_create.py b/src/graphn/_generated/models/mcp_server_create.py index 08a6d86..78d63d6 100644 --- a/src/graphn/_generated/models/mcp_server_create.py +++ b/src/graphn/_generated/models/mcp_server_create.py @@ -6,6 +6,7 @@ from attrs import define as _attrs_define from typing_extensions import Self +from ..models.mcp_server_create_type import McpServerCreateType from ..types import UNSET, Unset if TYPE_CHECKING: @@ -22,7 +23,7 @@ class McpServerCreate: """ Attributes: name (str): - type_ (str | Unset): + type_ (McpServerCreateType | Unset): files (McpServerCreateFiles | Unset): endpoint_url (str | Unset): workflow_id (str | Unset): @@ -31,7 +32,7 @@ class McpServerCreate: """ name: str - type_: str | Unset = UNSET + type_: McpServerCreateType | Unset = UNSET files: McpServerCreateFiles | Unset = UNSET endpoint_url: str | Unset = UNSET workflow_id: str | Unset = UNSET @@ -41,7 +42,9 @@ class McpServerCreate: def to_dict(self) -> dict[str, Any]: name = self.name - type_ = self.type_ + type_: str | Unset = UNSET + if not isinstance(self.type_, Unset): + type_ = self.type_.value files: dict[str, Any] | Unset = UNSET if not isinstance(self.files, Unset): @@ -83,14 +86,23 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - from ..models.mcp_server_create_files import McpServerCreateFiles - from ..models.mcp_server_create_secrets import McpServerCreateSecrets + from ..models.mcp_server_create_files import ( + McpServerCreateFiles, + ) + from ..models.mcp_server_create_secrets import ( + McpServerCreateSecrets, + ) from ..models.mcp_server_spec import McpServerSpec d = dict(src_dict) name = d.pop("name") - type_ = d.pop("type", UNSET) + _type_ = d.pop("type", UNSET) + type_: McpServerCreateType | Unset + if isinstance(_type_, Unset): + type_ = UNSET + else: + type_ = McpServerCreateType(_type_) _files = d.pop("files", UNSET) files: McpServerCreateFiles | Unset diff --git a/src/graphn/_generated/models/mcp_server_create_files.py b/src/graphn/_generated/models/mcp_server_create_files.py index eb36cfa..77647b2 100644 --- a/src/graphn/_generated/models/mcp_server_create_files.py +++ b/src/graphn/_generated/models/mcp_server_create_files.py @@ -12,8 +12,6 @@ @_attrs_define class McpServerCreateFiles: - """ """ - additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/mcp_server_create_secrets.py b/src/graphn/_generated/models/mcp_server_create_secrets.py index 7a45c46..9c43593 100644 --- a/src/graphn/_generated/models/mcp_server_create_secrets.py +++ b/src/graphn/_generated/models/mcp_server_create_secrets.py @@ -12,8 +12,6 @@ @_attrs_define class McpServerCreateSecrets: - """ """ - additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/mcp_server_create_type.py b/src/graphn/_generated/models/mcp_server_create_type.py new file mode 100644 index 0000000..071d6e3 --- /dev/null +++ b/src/graphn/_generated/models/mcp_server_create_type.py @@ -0,0 +1,9 @@ +from enum import StrEnum + + +class McpServerCreateType(StrEnum): + HOSTED = "hosted" + REMOTE = "remote" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/graphn/_generated/models/mcp_server_spec.py b/src/graphn/_generated/models/mcp_server_spec.py index 413bb06..5f45f45 100644 --- a/src/graphn/_generated/models/mcp_server_spec.py +++ b/src/graphn/_generated/models/mcp_server_spec.py @@ -7,11 +7,13 @@ from attrs import field as _attrs_field from typing_extensions import Self +from ..models.mcp_server_spec_type import McpServerSpecType from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.mcp_server_spec_files import McpServerSpecFiles from ..models.mcp_server_spec_secrets import McpServerSpecSecrets + from ..models.mcp_server_spec_tool_capabilities import McpServerSpecToolCapabilities T = TypeVar("T", bound="McpServerSpec") @@ -21,20 +23,28 @@ class McpServerSpec: """ Attributes: - type_ (str | Unset): + type_ (McpServerSpecType | Unset): files (McpServerSpecFiles | Unset): endpoint_url (str | Unset): secrets (McpServerSpecSecrets | Unset): + provider_id (str | Unset): + connection_id (str | Unset): + tool_capabilities (McpServerSpecToolCapabilities | Unset): """ - type_: str | Unset = UNSET + type_: McpServerSpecType | Unset = UNSET files: McpServerSpecFiles | Unset = UNSET endpoint_url: str | Unset = UNSET secrets: McpServerSpecSecrets | Unset = UNSET + provider_id: str | Unset = UNSET + connection_id: str | Unset = UNSET + tool_capabilities: McpServerSpecToolCapabilities | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_ = self.type_ + type_: str | Unset = UNSET + if not isinstance(self.type_, Unset): + type_ = self.type_.value files: dict[str, Any] | Unset = UNSET if not isinstance(self.files, Unset): @@ -46,6 +56,14 @@ def to_dict(self) -> dict[str, Any]: if not isinstance(self.secrets, Unset): secrets = self.secrets.to_dict() + provider_id = self.provider_id + + connection_id = self.connection_id + + tool_capabilities: dict[str, Any] | Unset = UNSET + if not isinstance(self.tool_capabilities, Unset): + tool_capabilities = self.tool_capabilities.to_dict() + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({}) @@ -57,16 +75,32 @@ def to_dict(self) -> dict[str, Any]: field_dict["endpoint_url"] = endpoint_url if secrets is not UNSET: field_dict["secrets"] = secrets + if provider_id is not UNSET: + field_dict["provider_id"] = provider_id + if connection_id is not UNSET: + field_dict["connection_id"] = connection_id + if tool_capabilities is not UNSET: + field_dict["tool_capabilities"] = tool_capabilities return field_dict @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.mcp_server_spec_files import McpServerSpecFiles - from ..models.mcp_server_spec_secrets import McpServerSpecSecrets + from ..models.mcp_server_spec_secrets import ( + McpServerSpecSecrets, + ) + from ..models.mcp_server_spec_tool_capabilities import ( + McpServerSpecToolCapabilities, + ) d = dict(src_dict) - type_ = d.pop("type", UNSET) + _type_ = d.pop("type", UNSET) + type_: McpServerSpecType | Unset + if isinstance(_type_, Unset): + type_ = UNSET + else: + type_ = McpServerSpecType(_type_) _files = d.pop("files", UNSET) files: McpServerSpecFiles | Unset @@ -84,11 +118,27 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: else: secrets = McpServerSpecSecrets.from_dict(_secrets) + provider_id = d.pop("provider_id", UNSET) + + connection_id = d.pop("connection_id", UNSET) + + _tool_capabilities = d.pop("tool_capabilities", UNSET) + tool_capabilities: McpServerSpecToolCapabilities | Unset + if isinstance(_tool_capabilities, Unset): + tool_capabilities = UNSET + else: + tool_capabilities = McpServerSpecToolCapabilities.from_dict( + _tool_capabilities + ) + mcp_server_spec = cls( type_=type_, files=files, endpoint_url=endpoint_url, secrets=secrets, + provider_id=provider_id, + connection_id=connection_id, + tool_capabilities=tool_capabilities, ) mcp_server_spec.additional_properties = d diff --git a/src/graphn/_generated/models/mcp_server_spec_files.py b/src/graphn/_generated/models/mcp_server_spec_files.py index 3915ec9..d741381 100644 --- a/src/graphn/_generated/models/mcp_server_spec_files.py +++ b/src/graphn/_generated/models/mcp_server_spec_files.py @@ -12,8 +12,6 @@ @_attrs_define class McpServerSpecFiles: - """ """ - additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/mcp_server_spec_secrets.py b/src/graphn/_generated/models/mcp_server_spec_secrets.py index af0ddc7..c739b16 100644 --- a/src/graphn/_generated/models/mcp_server_spec_secrets.py +++ b/src/graphn/_generated/models/mcp_server_spec_secrets.py @@ -12,8 +12,6 @@ @_attrs_define class McpServerSpecSecrets: - """ """ - additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/mcp_server_spec_tool_capabilities.py b/src/graphn/_generated/models/mcp_server_spec_tool_capabilities.py new file mode 100644 index 0000000..15733b2 --- /dev/null +++ b/src/graphn/_generated/models/mcp_server_spec_tool_capabilities.py @@ -0,0 +1,53 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from typing_extensions import Self + +T = TypeVar("T", bound="McpServerSpecToolCapabilities") + + +@_attrs_define +class McpServerSpecToolCapabilities: + additional_properties: dict[str, list[str]] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + mcp_server_spec_tool_capabilities = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + additional_property = cast(list[str], prop_dict) + + additional_properties[prop_name] = additional_property + + mcp_server_spec_tool_capabilities.additional_properties = additional_properties + return mcp_server_spec_tool_capabilities + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> list[str]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: list[str]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/graphn/_generated/models/mcp_server_spec_type.py b/src/graphn/_generated/models/mcp_server_spec_type.py new file mode 100644 index 0000000..f8be16c --- /dev/null +++ b/src/graphn/_generated/models/mcp_server_spec_type.py @@ -0,0 +1,10 @@ +from enum import StrEnum + + +class McpServerSpecType(StrEnum): + HOSTED = "hosted" + MANAGED = "managed" + REMOTE = "remote" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/graphn/_generated/models/mcp_server_update.py b/src/graphn/_generated/models/mcp_server_update.py index 2d55919..ec8bd68 100644 --- a/src/graphn/_generated/models/mcp_server_update.py +++ b/src/graphn/_generated/models/mcp_server_update.py @@ -76,8 +76,12 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.mcp_server_spec import McpServerSpec - from ..models.mcp_server_update_files import McpServerUpdateFiles - from ..models.mcp_server_update_secrets import McpServerUpdateSecrets + from ..models.mcp_server_update_files import ( + McpServerUpdateFiles, + ) + from ..models.mcp_server_update_secrets import ( + McpServerUpdateSecrets, + ) d = dict(src_dict) name = d.pop("name", UNSET) diff --git a/src/graphn/_generated/models/mcp_server_update_files.py b/src/graphn/_generated/models/mcp_server_update_files.py index 3d3fb34..0dda4f7 100644 --- a/src/graphn/_generated/models/mcp_server_update_files.py +++ b/src/graphn/_generated/models/mcp_server_update_files.py @@ -12,8 +12,6 @@ @_attrs_define class McpServerUpdateFiles: - """ """ - additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/mcp_server_update_secrets.py b/src/graphn/_generated/models/mcp_server_update_secrets.py index c51c30e..5bda4ff 100644 --- a/src/graphn/_generated/models/mcp_server_update_secrets.py +++ b/src/graphn/_generated/models/mcp_server_update_secrets.py @@ -12,8 +12,6 @@ @_attrs_define class McpServerUpdateSecrets: - """ """ - additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/member_role.py b/src/graphn/_generated/models/member_role.py index d67391d..572f862 100644 --- a/src/graphn/_generated/models/member_role.py +++ b/src/graphn/_generated/models/member_role.py @@ -1,7 +1,7 @@ -from enum import Enum +from enum import StrEnum -class MemberRole(str, Enum): +class MemberRole(StrEnum): ADMIN = "admin" MEMBER = "member" OWNER = "owner" diff --git a/src/graphn/_generated/models/member_role_update_role.py b/src/graphn/_generated/models/member_role_update_role.py index a4db1e4..521bbc5 100644 --- a/src/graphn/_generated/models/member_role_update_role.py +++ b/src/graphn/_generated/models/member_role_update_role.py @@ -1,7 +1,7 @@ -from enum import Enum +from enum import StrEnum -class MemberRoleUpdateRole(str, Enum): +class MemberRoleUpdateRole(StrEnum): ADMIN = "admin" MEMBER = "member" OWNER = "owner" diff --git a/src/graphn/_generated/models/model_list_object.py b/src/graphn/_generated/models/model_list_object.py index 2c8dc96..5d054e6 100644 --- a/src/graphn/_generated/models/model_list_object.py +++ b/src/graphn/_generated/models/model_list_object.py @@ -1,7 +1,7 @@ -from enum import Enum +from enum import StrEnum -class ModelListObject(str, Enum): +class ModelListObject(StrEnum): LIST = "list" def __str__(self) -> str: diff --git a/src/graphn/_generated/models/model_object.py b/src/graphn/_generated/models/model_object.py index d4fa554..5baeaa4 100644 --- a/src/graphn/_generated/models/model_object.py +++ b/src/graphn/_generated/models/model_object.py @@ -1,7 +1,7 @@ -from enum import Enum +from enum import StrEnum -class ModelObject(str, Enum): +class ModelObject(StrEnum): MODEL = "model" def __str__(self) -> str: diff --git a/src/graphn/_generated/models/model_owned_by.py b/src/graphn/_generated/models/model_owned_by.py index 98b5948..f031e75 100644 --- a/src/graphn/_generated/models/model_owned_by.py +++ b/src/graphn/_generated/models/model_owned_by.py @@ -1,7 +1,7 @@ -from enum import Enum +from enum import StrEnum -class ModelOwnedBy(str, Enum): +class ModelOwnedBy(StrEnum): BUILT_IN = "built-in" CUSTOM = "custom" IMPORTED = "imported" diff --git a/src/graphn/_generated/models/organization_create_type.py b/src/graphn/_generated/models/organization_create_type.py index fe8d27c..16a46e0 100644 --- a/src/graphn/_generated/models/organization_create_type.py +++ b/src/graphn/_generated/models/organization_create_type.py @@ -1,7 +1,7 @@ -from enum import Enum +from enum import StrEnum -class OrganizationCreateType(str, Enum): +class OrganizationCreateType(StrEnum): PERSONAL = "personal" TEAM = "team" diff --git a/src/graphn/_generated/models/organization_type.py b/src/graphn/_generated/models/organization_type.py index 7b93b42..5d94861 100644 --- a/src/graphn/_generated/models/organization_type.py +++ b/src/graphn/_generated/models/organization_type.py @@ -1,7 +1,7 @@ -from enum import Enum +from enum import StrEnum -class OrganizationType(str, Enum): +class OrganizationType(StrEnum): PERSONAL = "personal" TEAM = "team" diff --git a/src/graphn/_generated/models/post_object_type.py b/src/graphn/_generated/models/post_object_type.py index 1e5f505..448fcbb 100644 --- a/src/graphn/_generated/models/post_object_type.py +++ b/src/graphn/_generated/models/post_object_type.py @@ -1,7 +1,7 @@ -from enum import Enum +from enum import StrEnum -class PostObjectType(str, Enum): +class PostObjectType(StrEnum): DOWNLOAD = "download" UPLOAD = "upload" UPLOAD_PART = "upload_part" diff --git a/src/graphn/_generated/models/search_request.py b/src/graphn/_generated/models/search_request.py index 7148136..4eabe92 100644 --- a/src/graphn/_generated/models/search_request.py +++ b/src/graphn/_generated/models/search_request.py @@ -21,7 +21,9 @@ class SearchRequest: Attributes: query (str): top_k (int | Unset): - rerank (bool | Unset): + rerank (bool | Unset): Requests result reranking. When the vector top-K contains a video + hit, the batch remains in vector order and returned scores are + vector-similarity scores. reranker_model (str | Unset): score_threshold (float | Unset): metadata_filter (SearchRequestMetadataFilter | Unset): @@ -71,7 +73,9 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - from ..models.search_request_metadata_filter import SearchRequestMetadataFilter + from ..models.search_request_metadata_filter import ( + SearchRequestMetadataFilter, + ) d = dict(src_dict) query = d.pop("query") diff --git a/src/graphn/_generated/models/search_request_metadata_filter.py b/src/graphn/_generated/models/search_request_metadata_filter.py index f9fdfbe..5f7810e 100644 --- a/src/graphn/_generated/models/search_request_metadata_filter.py +++ b/src/graphn/_generated/models/search_request_metadata_filter.py @@ -12,8 +12,6 @@ @_attrs_define class SearchRequestMetadataFilter: - """ """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/search_result.py b/src/graphn/_generated/models/search_result.py index 6a138c8..b022925 100644 --- a/src/graphn/_generated/models/search_result.py +++ b/src/graphn/_generated/models/search_result.py @@ -1,5 +1,6 @@ from __future__ import annotations +import datetime from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -28,6 +29,9 @@ class SearchResult: document_type (str | Unset): image_url (str | Unset): video_url (str | Unset): + expires_at (datetime.datetime | Unset): + expires_in (int | Unset): + media_href (str | Unset): segment_start_sec (float | Unset): segment_end_sec (float | Unset): metadata (SearchResultMetadata | Unset): @@ -41,6 +45,9 @@ class SearchResult: document_type: str | Unset = UNSET image_url: str | Unset = UNSET video_url: str | Unset = UNSET + expires_at: datetime.datetime | Unset = UNSET + expires_in: int | Unset = UNSET + media_href: str | Unset = UNSET segment_start_sec: float | Unset = UNSET segment_end_sec: float | Unset = UNSET metadata: SearchResultMetadata | Unset = UNSET @@ -63,6 +70,14 @@ def to_dict(self) -> dict[str, Any]: video_url = self.video_url + expires_at: str | Unset = UNSET + if not isinstance(self.expires_at, Unset): + expires_at = self.expires_at.isoformat() + + expires_in = self.expires_in + + media_href = self.media_href + segment_start_sec = self.segment_start_sec segment_end_sec = self.segment_end_sec @@ -88,6 +103,12 @@ def to_dict(self) -> dict[str, Any]: field_dict["image_url"] = image_url if video_url is not UNSET: field_dict["video_url"] = video_url + if expires_at is not UNSET: + field_dict["expires_at"] = expires_at + if expires_in is not UNSET: + field_dict["expires_in"] = expires_in + if media_href is not UNSET: + field_dict["media_href"] = media_href if segment_start_sec is not UNSET: field_dict["segment_start_sec"] = segment_start_sec if segment_end_sec is not UNSET: @@ -99,7 +120,9 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - from ..models.search_result_metadata import SearchResultMetadata + from ..models.search_result_metadata import ( + SearchResultMetadata, + ) d = dict(src_dict) id = d.pop("id") @@ -118,6 +141,17 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: video_url = d.pop("video_url", UNSET) + _expires_at = d.pop("expires_at", UNSET) + expires_at: datetime.datetime | Unset + if isinstance(_expires_at, Unset): + expires_at = UNSET + else: + expires_at = datetime.datetime.fromisoformat(_expires_at) + + expires_in = d.pop("expires_in", UNSET) + + media_href = d.pop("media_href", UNSET) + segment_start_sec = d.pop("segment_start_sec", UNSET) segment_end_sec = d.pop("segment_end_sec", UNSET) @@ -138,6 +172,9 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: document_type=document_type, image_url=image_url, video_url=video_url, + expires_at=expires_at, + expires_in=expires_in, + media_href=media_href, segment_start_sec=segment_start_sec, segment_end_sec=segment_end_sec, metadata=metadata, diff --git a/src/graphn/_generated/models/search_result_metadata.py b/src/graphn/_generated/models/search_result_metadata.py index 822a035..70587da 100644 --- a/src/graphn/_generated/models/search_result_metadata.py +++ b/src/graphn/_generated/models/search_result_metadata.py @@ -12,8 +12,6 @@ @_attrs_define class SearchResultMetadata: - """ """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/test_connection_response.py b/src/graphn/_generated/models/test_connection_response.py index b547880..798044f 100644 --- a/src/graphn/_generated/models/test_connection_response.py +++ b/src/graphn/_generated/models/test_connection_response.py @@ -52,7 +52,9 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - from ..models.test_connection_response_usage import TestConnectionResponseUsage + from ..models.test_connection_response_usage import ( + TestConnectionResponseUsage, + ) d = dict(src_dict) response = d.pop("response") diff --git a/src/graphn/_generated/models/tool_definition.py b/src/graphn/_generated/models/tool_definition.py index 7f6903c..c2d826b 100644 --- a/src/graphn/_generated/models/tool_definition.py +++ b/src/graphn/_generated/models/tool_definition.py @@ -55,7 +55,9 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - from ..models.tool_definition_input_schema import ToolDefinitionInputSchema + from ..models.tool_definition_input_schema import ( + ToolDefinitionInputSchema, + ) d = dict(src_dict) name = d.pop("name") diff --git a/src/graphn/_generated/models/tool_definition_input_schema.py b/src/graphn/_generated/models/tool_definition_input_schema.py index e25313c..b7a7bc3 100644 --- a/src/graphn/_generated/models/tool_definition_input_schema.py +++ b/src/graphn/_generated/models/tool_definition_input_schema.py @@ -12,8 +12,6 @@ @_attrs_define class ToolDefinitionInputSchema: - """ """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/tool_test_request.py b/src/graphn/_generated/models/tool_test_request.py index c808290..6d5872a 100644 --- a/src/graphn/_generated/models/tool_test_request.py +++ b/src/graphn/_generated/models/tool_test_request.py @@ -39,7 +39,9 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - from ..models.tool_test_request_input import ToolTestRequestInput + from ..models.tool_test_request_input import ( + ToolTestRequestInput, + ) d = dict(src_dict) _input_ = d.pop("input", UNSET) diff --git a/src/graphn/_generated/models/tool_test_request_input.py b/src/graphn/_generated/models/tool_test_request_input.py index 7075426..f3b665d 100644 --- a/src/graphn/_generated/models/tool_test_request_input.py +++ b/src/graphn/_generated/models/tool_test_request_input.py @@ -12,8 +12,6 @@ @_attrs_define class ToolTestRequestInput: - """ """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/trigger.py b/src/graphn/_generated/models/trigger.py index 795f7a6..f2de518 100644 --- a/src/graphn/_generated/models/trigger.py +++ b/src/graphn/_generated/models/trigger.py @@ -30,6 +30,8 @@ class Trigger: updated_at (datetime.datetime): cron_schedule (str | Unset): input_ (TriggerInput | Unset): + connection_id (str | Unset): + event_type (str | Unset): temporal_schedule_id (str | Unset): schedule_synced (bool | Unset): schedule_status (str | Unset): @@ -52,6 +54,8 @@ class Trigger: updated_at: datetime.datetime cron_schedule: str | Unset = UNSET input_: TriggerInput | Unset = UNSET + connection_id: str | Unset = UNSET + event_type: str | Unset = UNSET temporal_schedule_id: str | Unset = UNSET schedule_synced: bool | Unset = UNSET schedule_status: str | Unset = UNSET @@ -86,6 +90,10 @@ def to_dict(self) -> dict[str, Any]: if not isinstance(self.input_, Unset): input_ = self.input_.to_dict() + connection_id = self.connection_id + + event_type = self.event_type + temporal_schedule_id = self.temporal_schedule_id schedule_synced = self.schedule_synced @@ -125,6 +133,10 @@ def to_dict(self) -> dict[str, Any]: field_dict["cron_schedule"] = cron_schedule if input_ is not UNSET: field_dict["input"] = input_ + if connection_id is not UNSET: + field_dict["connection_id"] = connection_id + if event_type is not UNSET: + field_dict["event_type"] = event_type if temporal_schedule_id is not UNSET: field_dict["temporal_schedule_id"] = temporal_schedule_id if schedule_synced is not UNSET: @@ -178,6 +190,10 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: else: input_ = TriggerInput.from_dict(_input_) + connection_id = d.pop("connection_id", UNSET) + + event_type = d.pop("event_type", UNSET) + temporal_schedule_id = d.pop("temporal_schedule_id", UNSET) schedule_synced = d.pop("schedule_synced", UNSET) @@ -210,6 +226,8 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: updated_at=updated_at, cron_schedule=cron_schedule, input_=input_, + connection_id=connection_id, + event_type=event_type, temporal_schedule_id=temporal_schedule_id, schedule_synced=schedule_synced, schedule_status=schedule_status, diff --git a/src/graphn/_generated/models/trigger_create.py b/src/graphn/_generated/models/trigger_create.py index 36b6f6b..6548f19 100644 --- a/src/graphn/_generated/models/trigger_create.py +++ b/src/graphn/_generated/models/trigger_create.py @@ -21,9 +21,11 @@ class TriggerCreate: Attributes: name (str): workflow_id (str): - cron_schedule (str): + cron_schedule (str | Unset): input_ (TriggerCreateInput | Unset): enabled (bool | Unset): + connection_id (str | Unset): + event_type (str | Unset): webhook_auth (str | Unset): hmac_secret_id (str | Unset): hmac_algorithm (str | Unset): @@ -33,9 +35,11 @@ class TriggerCreate: name: str workflow_id: str - cron_schedule: str + cron_schedule: str | Unset = UNSET input_: TriggerCreateInput | Unset = UNSET enabled: bool | Unset = UNSET + connection_id: str | Unset = UNSET + event_type: str | Unset = UNSET webhook_auth: str | Unset = UNSET hmac_secret_id: str | Unset = UNSET hmac_algorithm: str | Unset = UNSET @@ -55,6 +59,10 @@ def to_dict(self) -> dict[str, Any]: enabled = self.enabled + connection_id = self.connection_id + + event_type = self.event_type + webhook_auth = self.webhook_auth hmac_secret_id = self.hmac_secret_id @@ -71,13 +79,18 @@ def to_dict(self) -> dict[str, Any]: { "name": name, "workflow_id": workflow_id, - "cron_schedule": cron_schedule, } ) + if cron_schedule is not UNSET: + field_dict["cron_schedule"] = cron_schedule if input_ is not UNSET: field_dict["input"] = input_ if enabled is not UNSET: field_dict["enabled"] = enabled + if connection_id is not UNSET: + field_dict["connection_id"] = connection_id + if event_type is not UNSET: + field_dict["event_type"] = event_type if webhook_auth is not UNSET: field_dict["webhook_auth"] = webhook_auth if hmac_secret_id is not UNSET: @@ -100,7 +113,7 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: workflow_id = d.pop("workflow_id") - cron_schedule = d.pop("cron_schedule") + cron_schedule = d.pop("cron_schedule", UNSET) _input_ = d.pop("input", UNSET) input_: TriggerCreateInput | Unset @@ -111,6 +124,10 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: enabled = d.pop("enabled", UNSET) + connection_id = d.pop("connection_id", UNSET) + + event_type = d.pop("event_type", UNSET) + webhook_auth = d.pop("webhook_auth", UNSET) hmac_secret_id = d.pop("hmac_secret_id", UNSET) @@ -127,6 +144,8 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: cron_schedule=cron_schedule, input_=input_, enabled=enabled, + connection_id=connection_id, + event_type=event_type, webhook_auth=webhook_auth, hmac_secret_id=hmac_secret_id, hmac_algorithm=hmac_algorithm, diff --git a/src/graphn/_generated/models/trigger_create_input.py b/src/graphn/_generated/models/trigger_create_input.py index 84c8d52..747f381 100644 --- a/src/graphn/_generated/models/trigger_create_input.py +++ b/src/graphn/_generated/models/trigger_create_input.py @@ -12,8 +12,6 @@ @_attrs_define class TriggerCreateInput: - """ """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/trigger_create_nested.py b/src/graphn/_generated/models/trigger_create_nested.py index d6dad2b..3d63595 100644 --- a/src/graphn/_generated/models/trigger_create_nested.py +++ b/src/graphn/_generated/models/trigger_create_nested.py @@ -20,9 +20,11 @@ class TriggerCreateNested: """ Attributes: name (str): - cron_schedule (str): + cron_schedule (str | Unset): input_ (TriggerCreateNestedInput | Unset): enabled (bool | Unset): + connection_id (str | Unset): + event_type (str | Unset): webhook_auth (str | Unset): hmac_secret_id (str | Unset): hmac_algorithm (str | Unset): @@ -31,9 +33,11 @@ class TriggerCreateNested: """ name: str - cron_schedule: str + cron_schedule: str | Unset = UNSET input_: TriggerCreateNestedInput | Unset = UNSET enabled: bool | Unset = UNSET + connection_id: str | Unset = UNSET + event_type: str | Unset = UNSET webhook_auth: str | Unset = UNSET hmac_secret_id: str | Unset = UNSET hmac_algorithm: str | Unset = UNSET @@ -51,6 +55,10 @@ def to_dict(self) -> dict[str, Any]: enabled = self.enabled + connection_id = self.connection_id + + event_type = self.event_type + webhook_auth = self.webhook_auth hmac_secret_id = self.hmac_secret_id @@ -66,13 +74,18 @@ def to_dict(self) -> dict[str, Any]: field_dict.update( { "name": name, - "cron_schedule": cron_schedule, } ) + if cron_schedule is not UNSET: + field_dict["cron_schedule"] = cron_schedule if input_ is not UNSET: field_dict["input"] = input_ if enabled is not UNSET: field_dict["enabled"] = enabled + if connection_id is not UNSET: + field_dict["connection_id"] = connection_id + if event_type is not UNSET: + field_dict["event_type"] = event_type if webhook_auth is not UNSET: field_dict["webhook_auth"] = webhook_auth if hmac_secret_id is not UNSET: @@ -88,12 +101,14 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - from ..models.trigger_create_nested_input import TriggerCreateNestedInput + from ..models.trigger_create_nested_input import ( + TriggerCreateNestedInput, + ) d = dict(src_dict) name = d.pop("name") - cron_schedule = d.pop("cron_schedule") + cron_schedule = d.pop("cron_schedule", UNSET) _input_ = d.pop("input", UNSET) input_: TriggerCreateNestedInput | Unset @@ -104,6 +119,10 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: enabled = d.pop("enabled", UNSET) + connection_id = d.pop("connection_id", UNSET) + + event_type = d.pop("event_type", UNSET) + webhook_auth = d.pop("webhook_auth", UNSET) hmac_secret_id = d.pop("hmac_secret_id", UNSET) @@ -119,6 +138,8 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: cron_schedule=cron_schedule, input_=input_, enabled=enabled, + connection_id=connection_id, + event_type=event_type, webhook_auth=webhook_auth, hmac_secret_id=hmac_secret_id, hmac_algorithm=hmac_algorithm, diff --git a/src/graphn/_generated/models/trigger_create_nested_input.py b/src/graphn/_generated/models/trigger_create_nested_input.py index 4cf0d94..f2670da 100644 --- a/src/graphn/_generated/models/trigger_create_nested_input.py +++ b/src/graphn/_generated/models/trigger_create_nested_input.py @@ -12,8 +12,6 @@ @_attrs_define class TriggerCreateNestedInput: - """ """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/trigger_input.py b/src/graphn/_generated/models/trigger_input.py index 4498bc1..e2cadc0 100644 --- a/src/graphn/_generated/models/trigger_input.py +++ b/src/graphn/_generated/models/trigger_input.py @@ -12,8 +12,6 @@ @_attrs_define class TriggerInput: - """ """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/trigger_update.py b/src/graphn/_generated/models/trigger_update.py index c9116d8..44603ca 100644 --- a/src/graphn/_generated/models/trigger_update.py +++ b/src/graphn/_generated/models/trigger_update.py @@ -23,6 +23,8 @@ class TriggerUpdate: cron_schedule (str | Unset): input_ (TriggerUpdateInput | Unset): enabled (bool | Unset): + connection_id (str | Unset): + event_type (str | Unset): webhook_auth (str | Unset): hmac_secret_id (str | Unset): hmac_algorithm (str | Unset): @@ -34,6 +36,8 @@ class TriggerUpdate: cron_schedule: str | Unset = UNSET input_: TriggerUpdateInput | Unset = UNSET enabled: bool | Unset = UNSET + connection_id: str | Unset = UNSET + event_type: str | Unset = UNSET webhook_auth: str | Unset = UNSET hmac_secret_id: str | Unset = UNSET hmac_algorithm: str | Unset = UNSET @@ -51,6 +55,10 @@ def to_dict(self) -> dict[str, Any]: enabled = self.enabled + connection_id = self.connection_id + + event_type = self.event_type + webhook_auth = self.webhook_auth hmac_secret_id = self.hmac_secret_id @@ -72,6 +80,10 @@ def to_dict(self) -> dict[str, Any]: field_dict["input"] = input_ if enabled is not UNSET: field_dict["enabled"] = enabled + if connection_id is not UNSET: + field_dict["connection_id"] = connection_id + if event_type is not UNSET: + field_dict["event_type"] = event_type if webhook_auth is not UNSET: field_dict["webhook_auth"] = webhook_auth if hmac_secret_id is not UNSET: @@ -103,6 +115,10 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: enabled = d.pop("enabled", UNSET) + connection_id = d.pop("connection_id", UNSET) + + event_type = d.pop("event_type", UNSET) + webhook_auth = d.pop("webhook_auth", UNSET) hmac_secret_id = d.pop("hmac_secret_id", UNSET) @@ -118,6 +134,8 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: cron_schedule=cron_schedule, input_=input_, enabled=enabled, + connection_id=connection_id, + event_type=event_type, webhook_auth=webhook_auth, hmac_secret_id=hmac_secret_id, hmac_algorithm=hmac_algorithm, diff --git a/src/graphn/_generated/models/trigger_update_input.py b/src/graphn/_generated/models/trigger_update_input.py index 9198e60..70296ac 100644 --- a/src/graphn/_generated/models/trigger_update_input.py +++ b/src/graphn/_generated/models/trigger_update_input.py @@ -12,8 +12,6 @@ @_attrs_define class TriggerUpdateInput: - """ """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/tts_request_response_format.py b/src/graphn/_generated/models/tts_request_response_format.py index 114cae2..46a34d3 100644 --- a/src/graphn/_generated/models/tts_request_response_format.py +++ b/src/graphn/_generated/models/tts_request_response_format.py @@ -1,7 +1,7 @@ -from enum import Enum +from enum import StrEnum -class TTSRequestResponseFormat(str, Enum): +class TTSRequestResponseFormat(StrEnum): FLAC = "flac" MP3 = "mp3" OPUS = "opus" diff --git a/src/graphn/_generated/models/upload_document_from_url_request_metadata.py b/src/graphn/_generated/models/upload_document_from_url_request_metadata.py index bf89716..ab4de84 100644 --- a/src/graphn/_generated/models/upload_document_from_url_request_metadata.py +++ b/src/graphn/_generated/models/upload_document_from_url_request_metadata.py @@ -12,8 +12,6 @@ @_attrs_define class UploadDocumentFromURLRequestMetadata: - """ """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/usage_day.py b/src/graphn/_generated/models/usage_day.py new file mode 100644 index 0000000..d30739a --- /dev/null +++ b/src/graphn/_generated/models/usage_day.py @@ -0,0 +1,71 @@ +from __future__ import annotations + +import datetime +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from typing_extensions import Self + +T = TypeVar("T", bound="UsageDay") + + +@_attrs_define +class UsageDay: + """ + Attributes: + date (datetime.date): + amount_cents (int): + """ + + date: datetime.date + amount_cents: int + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + date = self.date.isoformat() + + amount_cents = self.amount_cents + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "date": date, + "amountCents": amount_cents, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + date = datetime.date.fromisoformat(d.pop("date")) + + amount_cents = d.pop("amountCents") + + usage_day = cls( + date=date, + amount_cents=amount_cents, + ) + + usage_day.additional_properties = d + return usage_day + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/graphn/_generated/models/validate_model_request_quantization.py b/src/graphn/_generated/models/validate_model_request_quantization.py index 1e132cc..f2939ff 100644 --- a/src/graphn/_generated/models/validate_model_request_quantization.py +++ b/src/graphn/_generated/models/validate_model_request_quantization.py @@ -1,7 +1,7 @@ -from enum import Enum +from enum import StrEnum -class ValidateModelRequestQuantization(str, Enum): +class ValidateModelRequestQuantization(StrEnum): AWQ = "awq" FP8 = "fp8" GGUF = "gguf" diff --git a/src/graphn/_generated/models/validate_model_request_weight_source.py b/src/graphn/_generated/models/validate_model_request_weight_source.py index 8b29625..5b514ed 100644 --- a/src/graphn/_generated/models/validate_model_request_weight_source.py +++ b/src/graphn/_generated/models/validate_model_request_weight_source.py @@ -1,7 +1,7 @@ -from enum import Enum +from enum import StrEnum -class ValidateModelRequestWeightSource(str, Enum): +class ValidateModelRequestWeightSource(StrEnum): HUGGINGFACE = "huggingface" S3_ASSUME_ROLE = "s3_assume_role" diff --git a/src/graphn/_generated/models/validate_model_response_artifact_type.py b/src/graphn/_generated/models/validate_model_response_artifact_type.py index 07adb92..eb62adf 100644 --- a/src/graphn/_generated/models/validate_model_response_artifact_type.py +++ b/src/graphn/_generated/models/validate_model_response_artifact_type.py @@ -1,7 +1,7 @@ -from enum import Enum +from enum import StrEnum -class ValidateModelResponseArtifactType(str, Enum): +class ValidateModelResponseArtifactType(StrEnum): BASE = "base" LORA = "lora" diff --git a/src/graphn/_generated/models/weight_source.py b/src/graphn/_generated/models/weight_source.py index c60e9ad..b87eebd 100644 --- a/src/graphn/_generated/models/weight_source.py +++ b/src/graphn/_generated/models/weight_source.py @@ -1,7 +1,7 @@ -from enum import Enum +from enum import StrEnum -class WeightSource(str, Enum): +class WeightSource(StrEnum): HUGGINGFACE = "huggingface" S3_ASSUME_ROLE = "s3_assume_role" S3_PRESIGNED = "s3_presigned" diff --git a/src/graphn/_generated/models/workflow.py b/src/graphn/_generated/models/workflow.py index 48cc891..12967ac 100644 --- a/src/graphn/_generated/models/workflow.py +++ b/src/graphn/_generated/models/workflow.py @@ -156,7 +156,9 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.resource_version_ref import ResourceVersionRef from ..models.workflow_input_schema import WorkflowInputSchema from ..models.workflow_layout import WorkflowLayout - from ..models.workflow_output_schema import WorkflowOutputSchema + from ..models.workflow_output_schema import ( + WorkflowOutputSchema, + ) from ..models.workflow_source import WorkflowSource d = dict(src_dict) diff --git a/src/graphn/_generated/models/workflow_bundle.py b/src/graphn/_generated/models/workflow_bundle.py index a5c3779..2716ddf 100644 --- a/src/graphn/_generated/models/workflow_bundle.py +++ b/src/graphn/_generated/models/workflow_bundle.py @@ -78,8 +78,12 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.workflow import Workflow - from ..models.workflow_bundle_agents_item import WorkflowBundleAgentsItem - from ..models.workflow_bundle_functions_item import WorkflowBundleFunctionsItem + from ..models.workflow_bundle_agents_item import ( + WorkflowBundleAgentsItem, + ) + from ..models.workflow_bundle_functions_item import ( + WorkflowBundleFunctionsItem, + ) from ..models.workflow_bundle_mcp_servers_item import ( WorkflowBundleMcpServersItem, ) diff --git a/src/graphn/_generated/models/workflow_bundle_agents_item.py b/src/graphn/_generated/models/workflow_bundle_agents_item.py index 0764935..2f47ad6 100644 --- a/src/graphn/_generated/models/workflow_bundle_agents_item.py +++ b/src/graphn/_generated/models/workflow_bundle_agents_item.py @@ -12,8 +12,6 @@ @_attrs_define class WorkflowBundleAgentsItem: - """ """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/workflow_bundle_functions_item.py b/src/graphn/_generated/models/workflow_bundle_functions_item.py index 11fddfc..3f60913 100644 --- a/src/graphn/_generated/models/workflow_bundle_functions_item.py +++ b/src/graphn/_generated/models/workflow_bundle_functions_item.py @@ -12,8 +12,6 @@ @_attrs_define class WorkflowBundleFunctionsItem: - """ """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/workflow_bundle_mcp_servers_item.py b/src/graphn/_generated/models/workflow_bundle_mcp_servers_item.py index fbf8f31..6497264 100644 --- a/src/graphn/_generated/models/workflow_bundle_mcp_servers_item.py +++ b/src/graphn/_generated/models/workflow_bundle_mcp_servers_item.py @@ -12,8 +12,6 @@ @_attrs_define class WorkflowBundleMcpServersItem: - """ """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/workflow_bundle_save_response_agents_item.py b/src/graphn/_generated/models/workflow_bundle_save_response_agents_item.py index 51e5199..558c5c6 100644 --- a/src/graphn/_generated/models/workflow_bundle_save_response_agents_item.py +++ b/src/graphn/_generated/models/workflow_bundle_save_response_agents_item.py @@ -12,8 +12,6 @@ @_attrs_define class WorkflowBundleSaveResponseAgentsItem: - """ """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/workflow_bundle_save_response_functions_item.py b/src/graphn/_generated/models/workflow_bundle_save_response_functions_item.py index 9de4977..64d726d 100644 --- a/src/graphn/_generated/models/workflow_bundle_save_response_functions_item.py +++ b/src/graphn/_generated/models/workflow_bundle_save_response_functions_item.py @@ -12,8 +12,6 @@ @_attrs_define class WorkflowBundleSaveResponseFunctionsItem: - """ """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/workflow_bundle_save_response_mcp_servers_item.py b/src/graphn/_generated/models/workflow_bundle_save_response_mcp_servers_item.py index 43dc70d..e2c4106 100644 --- a/src/graphn/_generated/models/workflow_bundle_save_response_mcp_servers_item.py +++ b/src/graphn/_generated/models/workflow_bundle_save_response_mcp_servers_item.py @@ -12,8 +12,6 @@ @_attrs_define class WorkflowBundleSaveResponseMcpServersItem: - """ """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/workflow_bundle_save_response_validation_errors_item.py b/src/graphn/_generated/models/workflow_bundle_save_response_validation_errors_item.py index 596ae2e..ffd4466 100644 --- a/src/graphn/_generated/models/workflow_bundle_save_response_validation_errors_item.py +++ b/src/graphn/_generated/models/workflow_bundle_save_response_validation_errors_item.py @@ -12,8 +12,6 @@ @_attrs_define class WorkflowBundleSaveResponseValidationErrorsItem: - """ """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/workflow_create.py b/src/graphn/_generated/models/workflow_create.py index 3fa2382..c65e8f7 100644 --- a/src/graphn/_generated/models/workflow_create.py +++ b/src/graphn/_generated/models/workflow_create.py @@ -94,10 +94,18 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - from ..models.workflow_create_input_schema import WorkflowCreateInputSchema - from ..models.workflow_create_layout import WorkflowCreateLayout - from ..models.workflow_create_output_schema import WorkflowCreateOutputSchema - from ..models.workflow_create_source import WorkflowCreateSource + from ..models.workflow_create_input_schema import ( + WorkflowCreateInputSchema, + ) + from ..models.workflow_create_layout import ( + WorkflowCreateLayout, + ) + from ..models.workflow_create_output_schema import ( + WorkflowCreateOutputSchema, + ) + from ..models.workflow_create_source import ( + WorkflowCreateSource, + ) d = dict(src_dict) name = d.pop("name") diff --git a/src/graphn/_generated/models/workflow_create_input_schema.py b/src/graphn/_generated/models/workflow_create_input_schema.py index c2ca5d1..97d03e6 100644 --- a/src/graphn/_generated/models/workflow_create_input_schema.py +++ b/src/graphn/_generated/models/workflow_create_input_schema.py @@ -12,8 +12,6 @@ @_attrs_define class WorkflowCreateInputSchema: - """ """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/workflow_create_layout.py b/src/graphn/_generated/models/workflow_create_layout.py index ebee208..2a618fb 100644 --- a/src/graphn/_generated/models/workflow_create_layout.py +++ b/src/graphn/_generated/models/workflow_create_layout.py @@ -12,8 +12,6 @@ @_attrs_define class WorkflowCreateLayout: - """ """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/workflow_create_output_schema.py b/src/graphn/_generated/models/workflow_create_output_schema.py index 7f1812e..9da7d15 100644 --- a/src/graphn/_generated/models/workflow_create_output_schema.py +++ b/src/graphn/_generated/models/workflow_create_output_schema.py @@ -12,8 +12,6 @@ @_attrs_define class WorkflowCreateOutputSchema: - """ """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/workflow_create_source.py b/src/graphn/_generated/models/workflow_create_source.py index 534effd..b3ac030 100644 --- a/src/graphn/_generated/models/workflow_create_source.py +++ b/src/graphn/_generated/models/workflow_create_source.py @@ -12,8 +12,6 @@ @_attrs_define class WorkflowCreateSource: - """ """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/workflow_input_schema.py b/src/graphn/_generated/models/workflow_input_schema.py index d7d6d42..c520add 100644 --- a/src/graphn/_generated/models/workflow_input_schema.py +++ b/src/graphn/_generated/models/workflow_input_schema.py @@ -12,8 +12,6 @@ @_attrs_define class WorkflowInputSchema: - """ """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/workflow_layout.py b/src/graphn/_generated/models/workflow_layout.py index 098c680..da42781 100644 --- a/src/graphn/_generated/models/workflow_layout.py +++ b/src/graphn/_generated/models/workflow_layout.py @@ -12,8 +12,6 @@ @_attrs_define class WorkflowLayout: - """ """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/workflow_output_schema.py b/src/graphn/_generated/models/workflow_output_schema.py index 345b18d..cf55a9e 100644 --- a/src/graphn/_generated/models/workflow_output_schema.py +++ b/src/graphn/_generated/models/workflow_output_schema.py @@ -12,8 +12,6 @@ @_attrs_define class WorkflowOutputSchema: - """ """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/workflow_run_request.py b/src/graphn/_generated/models/workflow_run_request.py index 273ce3f..83ff023 100644 --- a/src/graphn/_generated/models/workflow_run_request.py +++ b/src/graphn/_generated/models/workflow_run_request.py @@ -45,7 +45,9 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - from ..models.workflow_run_request_input import WorkflowRunRequestInput + from ..models.workflow_run_request_input import ( + WorkflowRunRequestInput, + ) d = dict(src_dict) _input_ = d.pop("input", UNSET) diff --git a/src/graphn/_generated/models/workflow_run_request_input.py b/src/graphn/_generated/models/workflow_run_request_input.py index fe769af..4d8ac22 100644 --- a/src/graphn/_generated/models/workflow_run_request_input.py +++ b/src/graphn/_generated/models/workflow_run_request_input.py @@ -12,8 +12,6 @@ @_attrs_define class WorkflowRunRequestInput: - """ """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/workflow_run_result.py b/src/graphn/_generated/models/workflow_run_result.py index 6893aad..8dff74f 100644 --- a/src/graphn/_generated/models/workflow_run_result.py +++ b/src/graphn/_generated/models/workflow_run_result.py @@ -105,7 +105,9 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.workflow_run_result_resources_accessed_item import ( WorkflowRunResultResourcesAccessedItem, ) - from ..models.workflow_run_result_trace import WorkflowRunResultTrace + from ..models.workflow_run_result_trace import ( + WorkflowRunResultTrace, + ) d = dict(src_dict) execution_id = d.pop("execution_id", UNSET) diff --git a/src/graphn/_generated/models/workflow_run_result_node_results_item.py b/src/graphn/_generated/models/workflow_run_result_node_results_item.py index 7f662a6..44f2adc 100644 --- a/src/graphn/_generated/models/workflow_run_result_node_results_item.py +++ b/src/graphn/_generated/models/workflow_run_result_node_results_item.py @@ -12,8 +12,6 @@ @_attrs_define class WorkflowRunResultNodeResultsItem: - """ """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/workflow_run_result_resources_accessed_item.py b/src/graphn/_generated/models/workflow_run_result_resources_accessed_item.py index 3db5e5c..7ffc295 100644 --- a/src/graphn/_generated/models/workflow_run_result_resources_accessed_item.py +++ b/src/graphn/_generated/models/workflow_run_result_resources_accessed_item.py @@ -12,8 +12,6 @@ @_attrs_define class WorkflowRunResultResourcesAccessedItem: - """ """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/workflow_run_result_trace.py b/src/graphn/_generated/models/workflow_run_result_trace.py index c25770f..cc353e9 100644 --- a/src/graphn/_generated/models/workflow_run_result_trace.py +++ b/src/graphn/_generated/models/workflow_run_result_trace.py @@ -12,8 +12,6 @@ @_attrs_define class WorkflowRunResultTrace: - """ """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/workflow_source.py b/src/graphn/_generated/models/workflow_source.py index 0b59b8a..80d5ca9 100644 --- a/src/graphn/_generated/models/workflow_source.py +++ b/src/graphn/_generated/models/workflow_source.py @@ -12,8 +12,6 @@ @_attrs_define class WorkflowSource: - """ """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/workflow_update.py b/src/graphn/_generated/models/workflow_update.py index b432efa..2932f91 100644 --- a/src/graphn/_generated/models/workflow_update.py +++ b/src/graphn/_generated/models/workflow_update.py @@ -83,9 +83,15 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - from ..models.workflow_update_input_schema import WorkflowUpdateInputSchema - from ..models.workflow_update_layout import WorkflowUpdateLayout - from ..models.workflow_update_output_schema import WorkflowUpdateOutputSchema + from ..models.workflow_update_input_schema import ( + WorkflowUpdateInputSchema, + ) + from ..models.workflow_update_layout import ( + WorkflowUpdateLayout, + ) + from ..models.workflow_update_output_schema import ( + WorkflowUpdateOutputSchema, + ) d = dict(src_dict) name = d.pop("name", UNSET) diff --git a/src/graphn/_generated/models/workflow_update_input_schema.py b/src/graphn/_generated/models/workflow_update_input_schema.py index 6689a45..07914fe 100644 --- a/src/graphn/_generated/models/workflow_update_input_schema.py +++ b/src/graphn/_generated/models/workflow_update_input_schema.py @@ -12,8 +12,6 @@ @_attrs_define class WorkflowUpdateInputSchema: - """ """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/workflow_update_layout.py b/src/graphn/_generated/models/workflow_update_layout.py index f49fff9..1de7062 100644 --- a/src/graphn/_generated/models/workflow_update_layout.py +++ b/src/graphn/_generated/models/workflow_update_layout.py @@ -12,8 +12,6 @@ @_attrs_define class WorkflowUpdateLayout: - """ """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/workflow_update_output_schema.py b/src/graphn/_generated/models/workflow_update_output_schema.py index d1930ac..cbfe45c 100644 --- a/src/graphn/_generated/models/workflow_update_output_schema.py +++ b/src/graphn/_generated/models/workflow_update_output_schema.py @@ -12,8 +12,6 @@ @_attrs_define class WorkflowUpdateOutputSchema: - """ """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/workflow_version_detail_resource_pins.py b/src/graphn/_generated/models/workflow_version_detail_resource_pins.py index 06c2b5a..b4b8181 100644 --- a/src/graphn/_generated/models/workflow_version_detail_resource_pins.py +++ b/src/graphn/_generated/models/workflow_version_detail_resource_pins.py @@ -12,8 +12,6 @@ @_attrs_define class WorkflowVersionDetailResourcePins: - """ """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/graphn/_generated/models/workflow_version_detail_resource_snapshots.py b/src/graphn/_generated/models/workflow_version_detail_resource_snapshots.py index 243c387..112187c 100644 --- a/src/graphn/_generated/models/workflow_version_detail_resource_snapshots.py +++ b/src/graphn/_generated/models/workflow_version_detail_resource_snapshots.py @@ -12,8 +12,6 @@ @_attrs_define class WorkflowVersionDetailResourceSnapshots: - """ """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: