diff --git a/Makefile b/Makefile index a3a0eaa..85ce977 100644 --- a/Makefile +++ b/Makefile @@ -29,7 +29,7 @@ lint: ## Lint project. .PHONY: format format: ## Format project. @uv run ruff format - @uv run mdformat . + @uv run mdformat .github *.md .PHONY: fix fix: ## Fix project. @@ -42,7 +42,7 @@ check: check/format check/lint check/types check/spell ## Run all checks. .PHONY: check/format check/format: @uv run ruff format --check - @uv run mdformat --check .github griptape_cloud_client *.md + @uv run mdformat --check .github *.md .PHONY: check/lint check/lint: diff --git a/griptape_cloud_client/api/api_keys/create_api_key.py b/griptape_cloud_client/api/api_keys/create_api_key.py index e2fd092..2268379 100644 --- a/griptape_cloud_client/api/api_keys/create_api_key.py +++ b/griptape_cloud_client/api/api_keys/create_api_key.py @@ -21,7 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": f"/users/{user_id}/api-keys", + "url": f"/api/users/{user_id}/api-keys", } _kwargs["json"] = body.to_dict() diff --git a/griptape_cloud_client/api/api_keys/create_organization_api_key.py b/griptape_cloud_client/api/api_keys/create_organization_api_key.py index a2e3829..110a698 100644 --- a/griptape_cloud_client/api/api_keys/create_organization_api_key.py +++ b/griptape_cloud_client/api/api_keys/create_organization_api_key.py @@ -21,7 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": f"/organizations/{organization_id}/api-keys", + "url": f"/api/organizations/{organization_id}/api-keys", } _kwargs["json"] = body.to_dict() diff --git a/griptape_cloud_client/api/api_keys/delete_api_key.py b/griptape_cloud_client/api/api_keys/delete_api_key.py index 44635ec..0c5d908 100644 --- a/griptape_cloud_client/api/api_keys/delete_api_key.py +++ b/griptape_cloud_client/api/api_keys/delete_api_key.py @@ -15,7 +15,7 @@ def _get_kwargs( ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/api-keys/{api_key_id}", + "url": f"/api/api-keys/{api_key_id}", } return _kwargs diff --git a/griptape_cloud_client/api/api_keys/get_api_key.py b/griptape_cloud_client/api/api_keys/get_api_key.py index 6888922..7a58a01 100644 --- a/griptape_cloud_client/api/api_keys/get_api_key.py +++ b/griptape_cloud_client/api/api_keys/get_api_key.py @@ -16,7 +16,7 @@ def _get_kwargs( ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", - "url": f"/api-keys/{api_key_id}", + "url": f"/api/api-keys/{api_key_id}", } return _kwargs diff --git a/griptape_cloud_client/api/api_keys/list_api_keys.py b/griptape_cloud_client/api/api_keys/list_api_keys.py index f634d5a..1572f9b 100644 --- a/griptape_cloud_client/api/api_keys/list_api_keys.py +++ b/griptape_cloud_client/api/api_keys/list_api_keys.py @@ -27,7 +27,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/users/{user_id}/api-keys", + "url": f"/api/users/{user_id}/api-keys", "params": params, } diff --git a/griptape_cloud_client/api/api_keys/list_organization_api_keys.py b/griptape_cloud_client/api/api_keys/list_organization_api_keys.py index ff6d7a9..6bba852 100644 --- a/griptape_cloud_client/api/api_keys/list_organization_api_keys.py +++ b/griptape_cloud_client/api/api_keys/list_organization_api_keys.py @@ -27,7 +27,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/organizations/{organization_id}/api-keys", + "url": f"/api/organizations/{organization_id}/api-keys", "params": params, } diff --git a/griptape_cloud_client/api/api_keys/update_api_key.py b/griptape_cloud_client/api/api_keys/update_api_key.py index b0a7771..2f6bb6e 100644 --- a/griptape_cloud_client/api/api_keys/update_api_key.py +++ b/griptape_cloud_client/api/api_keys/update_api_key.py @@ -21,7 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "patch", - "url": f"/api-keys/{api_key_id}", + "url": f"/api/api-keys/{api_key_id}", } _kwargs["json"] = body.to_dict() diff --git a/griptape_cloud_client/api/assets/create_asset.py b/griptape_cloud_client/api/assets/create_asset.py index 1213d59..9297932 100644 --- a/griptape_cloud_client/api/assets/create_asset.py +++ b/griptape_cloud_client/api/assets/create_asset.py @@ -21,7 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/buckets/{bucket_id}/assets", + "url": f"/api/buckets/{bucket_id}/assets", } _kwargs["json"] = body.to_dict() diff --git a/griptape_cloud_client/api/assets/create_asset_url.py b/griptape_cloud_client/api/assets/create_asset_url.py index a3ffa54..8d05c23 100644 --- a/griptape_cloud_client/api/assets/create_asset_url.py +++ b/griptape_cloud_client/api/assets/create_asset_url.py @@ -22,7 +22,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": f"/buckets/{bucket_id}/asset-urls/{name}", + "url": f"/api/buckets/{bucket_id}/asset-urls/{name}", } _kwargs["json"] = body.to_dict() diff --git a/griptape_cloud_client/api/assets/delete_asset.py b/griptape_cloud_client/api/assets/delete_asset.py index 9870270..d519726 100644 --- a/griptape_cloud_client/api/assets/delete_asset.py +++ b/griptape_cloud_client/api/assets/delete_asset.py @@ -16,7 +16,7 @@ def _get_kwargs( ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/buckets/{bucket_id}/assets/{name}", + "url": f"/api/buckets/{bucket_id}/assets/{name}", } return _kwargs diff --git a/griptape_cloud_client/api/assets/get_asset.py b/griptape_cloud_client/api/assets/get_asset.py index c4a1c63..8580919 100644 --- a/griptape_cloud_client/api/assets/get_asset.py +++ b/griptape_cloud_client/api/assets/get_asset.py @@ -25,7 +25,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/buckets/{bucket_id}/assets/{name}", + "url": f"/api/buckets/{bucket_id}/assets/{name}", "params": params, } diff --git a/griptape_cloud_client/api/assets/list_assets.py b/griptape_cloud_client/api/assets/list_assets.py index b3e16bb..9369930 100644 --- a/griptape_cloud_client/api/assets/list_assets.py +++ b/griptape_cloud_client/api/assets/list_assets.py @@ -33,7 +33,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/buckets/{bucket_id}/assets", + "url": f"/api/buckets/{bucket_id}/assets", "params": params, } diff --git a/griptape_cloud_client/api/assistant_runs/cancel_assistant_run.py b/griptape_cloud_client/api/assistant_runs/cancel_assistant_run.py index a108cc3..ab5a52c 100644 --- a/griptape_cloud_client/api/assistant_runs/cancel_assistant_run.py +++ b/griptape_cloud_client/api/assistant_runs/cancel_assistant_run.py @@ -16,7 +16,7 @@ def _get_kwargs( ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "post", - "url": f"/assistant-runs/{assistant_run_id}/cancel", + "url": f"/api/assistant-runs/{assistant_run_id}/cancel", } return _kwargs diff --git a/griptape_cloud_client/api/assistant_runs/create_assistant_run.py b/griptape_cloud_client/api/assistant_runs/create_assistant_run.py index 672f498..b2b0448 100644 --- a/griptape_cloud_client/api/assistant_runs/create_assistant_run.py +++ b/griptape_cloud_client/api/assistant_runs/create_assistant_run.py @@ -21,7 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": f"/assistants/{assistant_id}/runs", + "url": f"/api/assistants/{assistant_id}/runs", } _kwargs["json"] = body.to_dict() diff --git a/griptape_cloud_client/api/assistant_runs/get_assistant_run.py b/griptape_cloud_client/api/assistant_runs/get_assistant_run.py index 1277b71..3beec7d 100644 --- a/griptape_cloud_client/api/assistant_runs/get_assistant_run.py +++ b/griptape_cloud_client/api/assistant_runs/get_assistant_run.py @@ -16,7 +16,7 @@ def _get_kwargs( ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", - "url": f"/assistant-runs/{assistant_run_id}", + "url": f"/api/assistant-runs/{assistant_run_id}", } return _kwargs diff --git a/griptape_cloud_client/api/assistant_runs/list_assistant_runs.py b/griptape_cloud_client/api/assistant_runs/list_assistant_runs.py index 7e21403..05b61c1 100644 --- a/griptape_cloud_client/api/assistant_runs/list_assistant_runs.py +++ b/griptape_cloud_client/api/assistant_runs/list_assistant_runs.py @@ -38,7 +38,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/assistants/{assistant_id}/runs", + "url": f"/api/assistants/{assistant_id}/runs", "params": params, } diff --git a/griptape_cloud_client/api/assistants/create_assistant.py b/griptape_cloud_client/api/assistants/create_assistant.py index 4f56bb9..ff04eb2 100644 --- a/griptape_cloud_client/api/assistants/create_assistant.py +++ b/griptape_cloud_client/api/assistants/create_assistant.py @@ -20,7 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/assistants", + "url": "/api/assistants", } _kwargs["json"] = body.to_dict() diff --git a/griptape_cloud_client/api/assistants/delete_assistant.py b/griptape_cloud_client/api/assistants/delete_assistant.py index ec017ba..4e037d1 100644 --- a/griptape_cloud_client/api/assistants/delete_assistant.py +++ b/griptape_cloud_client/api/assistants/delete_assistant.py @@ -15,7 +15,7 @@ def _get_kwargs( ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/assistants/{assistant_id}", + "url": f"/api/assistants/{assistant_id}", } return _kwargs diff --git a/griptape_cloud_client/api/assistants/get_assistant.py b/griptape_cloud_client/api/assistants/get_assistant.py index 2d9ae67..2560199 100644 --- a/griptape_cloud_client/api/assistants/get_assistant.py +++ b/griptape_cloud_client/api/assistants/get_assistant.py @@ -16,7 +16,7 @@ def _get_kwargs( ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", - "url": f"/assistants/{assistant_id}", + "url": f"/api/assistants/{assistant_id}", } return _kwargs diff --git a/griptape_cloud_client/api/assistants/list_assistants.py b/griptape_cloud_client/api/assistants/list_assistants.py index 151722a..4750227 100644 --- a/griptape_cloud_client/api/assistants/list_assistants.py +++ b/griptape_cloud_client/api/assistants/list_assistants.py @@ -26,7 +26,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/assistants", + "url": "/api/assistants", "params": params, } diff --git a/griptape_cloud_client/api/assistants/update_assistant.py b/griptape_cloud_client/api/assistants/update_assistant.py index f0af20c..053442e 100644 --- a/griptape_cloud_client/api/assistants/update_assistant.py +++ b/griptape_cloud_client/api/assistants/update_assistant.py @@ -21,7 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "patch", - "url": f"/assistants/{assistant_id}", + "url": f"/api/assistants/{assistant_id}", } _kwargs["json"] = body.to_dict() diff --git a/griptape_cloud_client/api/billing/create_billing_management_url.py b/griptape_cloud_client/api/billing/create_billing_management_url.py index ee64665..5dc293e 100644 --- a/griptape_cloud_client/api/billing/create_billing_management_url.py +++ b/griptape_cloud_client/api/billing/create_billing_management_url.py @@ -14,7 +14,7 @@ def _get_kwargs() -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "post", - "url": "/billing/management-url", + "url": "/api/billing/management-url", } return _kwargs diff --git a/griptape_cloud_client/api/billing/create_checkout_session.py b/griptape_cloud_client/api/billing/create_checkout_session.py index 8595f38..3908e89 100644 --- a/griptape_cloud_client/api/billing/create_checkout_session.py +++ b/griptape_cloud_client/api/billing/create_checkout_session.py @@ -20,7 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/billing/checkout-session", + "url": "/api/billing/checkout-session", } _kwargs["json"] = body.to_dict() diff --git a/griptape_cloud_client/api/buckets/create_bucket.py b/griptape_cloud_client/api/buckets/create_bucket.py index b71112d..fe896a6 100644 --- a/griptape_cloud_client/api/buckets/create_bucket.py +++ b/griptape_cloud_client/api/buckets/create_bucket.py @@ -20,7 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/buckets", + "url": "/api/buckets", } _kwargs["json"] = body.to_dict() diff --git a/griptape_cloud_client/api/buckets/delete_bucket.py b/griptape_cloud_client/api/buckets/delete_bucket.py index feeed32..ceaa571 100644 --- a/griptape_cloud_client/api/buckets/delete_bucket.py +++ b/griptape_cloud_client/api/buckets/delete_bucket.py @@ -15,7 +15,7 @@ def _get_kwargs( ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/buckets/{bucket_id}", + "url": f"/api/buckets/{bucket_id}", } return _kwargs diff --git a/griptape_cloud_client/api/buckets/get_bucket.py b/griptape_cloud_client/api/buckets/get_bucket.py index dc97b7e..0556761 100644 --- a/griptape_cloud_client/api/buckets/get_bucket.py +++ b/griptape_cloud_client/api/buckets/get_bucket.py @@ -16,7 +16,7 @@ def _get_kwargs( ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", - "url": f"/buckets/{bucket_id}", + "url": f"/api/buckets/{bucket_id}", } return _kwargs diff --git a/griptape_cloud_client/api/buckets/list_buckets.py b/griptape_cloud_client/api/buckets/list_buckets.py index 01248c9..6da5c28 100644 --- a/griptape_cloud_client/api/buckets/list_buckets.py +++ b/griptape_cloud_client/api/buckets/list_buckets.py @@ -26,7 +26,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/buckets", + "url": "/api/buckets", "params": params, } diff --git a/griptape_cloud_client/api/buckets/update_bucket.py b/griptape_cloud_client/api/buckets/update_bucket.py index 8b45fa3..a21b265 100644 --- a/griptape_cloud_client/api/buckets/update_bucket.py +++ b/griptape_cloud_client/api/buckets/update_bucket.py @@ -21,7 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "patch", - "url": f"/buckets/{bucket_id}", + "url": f"/api/buckets/{bucket_id}", } _kwargs["json"] = body.to_dict() diff --git a/griptape_cloud_client/api/chat_messages/create_chat_message.py b/griptape_cloud_client/api/chat_messages/create_chat_message.py index 36f3d3d..b3d969b 100644 --- a/griptape_cloud_client/api/chat_messages/create_chat_message.py +++ b/griptape_cloud_client/api/chat_messages/create_chat_message.py @@ -20,7 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/chat/messages", + "url": "/api/chat/messages", } _kwargs["json"] = body.to_dict() diff --git a/griptape_cloud_client/api/chat_messages/create_chat_message_stream.py b/griptape_cloud_client/api/chat_messages/create_chat_message_stream.py index f1e4ab4..c0714c8 100644 --- a/griptape_cloud_client/api/chat_messages/create_chat_message_stream.py +++ b/griptape_cloud_client/api/chat_messages/create_chat_message_stream.py @@ -20,7 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/chat/messages/stream", + "url": "/api/chat/messages/stream", } _kwargs["json"] = body.to_dict() diff --git a/griptape_cloud_client/api/configs/get_config.py b/griptape_cloud_client/api/configs/get_config.py index 6c43eb0..acf22ec 100644 --- a/griptape_cloud_client/api/configs/get_config.py +++ b/griptape_cloud_client/api/configs/get_config.py @@ -14,7 +14,7 @@ def _get_kwargs() -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", - "url": "/config", + "url": "/api/config", } return _kwargs diff --git a/griptape_cloud_client/api/connections/create_connection.py b/griptape_cloud_client/api/connections/create_connection.py index b21354e..0025a56 100644 --- a/griptape_cloud_client/api/connections/create_connection.py +++ b/griptape_cloud_client/api/connections/create_connection.py @@ -20,7 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/connections", + "url": "/api/connections", } _kwargs["json"] = body.to_dict() diff --git a/griptape_cloud_client/api/connections/delete_connection.py b/griptape_cloud_client/api/connections/delete_connection.py index c6ad7af..3c94075 100644 --- a/griptape_cloud_client/api/connections/delete_connection.py +++ b/griptape_cloud_client/api/connections/delete_connection.py @@ -15,7 +15,7 @@ def _get_kwargs( ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/connections/{connection_id}", + "url": f"/api/connections/{connection_id}", } return _kwargs diff --git a/griptape_cloud_client/api/connections/get_token.py b/griptape_cloud_client/api/connections/get_token.py index 8979162..aea5d49 100644 --- a/griptape_cloud_client/api/connections/get_token.py +++ b/griptape_cloud_client/api/connections/get_token.py @@ -16,7 +16,7 @@ def _get_kwargs( ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", - "url": f"/connections/{connection_id}/access-token", + "url": f"/api/connections/{connection_id}/access-token", } return _kwargs diff --git a/griptape_cloud_client/api/connections/list_connections.py b/griptape_cloud_client/api/connections/list_connections.py index 44cbf84..c442625 100644 --- a/griptape_cloud_client/api/connections/list_connections.py +++ b/griptape_cloud_client/api/connections/list_connections.py @@ -29,7 +29,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/connections", + "url": "/api/connections", "params": params, } diff --git a/griptape_cloud_client/api/credits_/list_credit_transactions.py b/griptape_cloud_client/api/credits_/list_credit_transactions.py index 5f614bc..e371bd4 100644 --- a/griptape_cloud_client/api/credits_/list_credit_transactions.py +++ b/griptape_cloud_client/api/credits_/list_credit_transactions.py @@ -6,6 +6,7 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.client_error_response_content import ClientErrorResponseContent +from ...models.list_credit_transactions_response_content import ListCreditTransactionsResponseContent from ...models.service_error_response_content import ServiceErrorResponseContent from ...types import UNSET, Response, Unset @@ -34,7 +35,12 @@ def _get_kwargs( def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ClientErrorResponseContent, ServiceErrorResponseContent]]: +) -> Optional[Union[ClientErrorResponseContent, ListCreditTransactionsResponseContent, ServiceErrorResponseContent]]: + if response.status_code == 200: + response_200 = ListCreditTransactionsResponseContent.from_dict(response.json()) + + return response_200 + if response.status_code == 400: response_400 = ClientErrorResponseContent.from_dict(response.json()) @@ -83,7 +89,7 @@ def _parse_response( def _build_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ClientErrorResponseContent, ServiceErrorResponseContent]]: +) -> Response[Union[ClientErrorResponseContent, ListCreditTransactionsResponseContent, ServiceErrorResponseContent]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -97,7 +103,7 @@ def sync_detailed( client: Union[AuthenticatedClient, Client], page: Union[Unset, float] = UNSET, page_size: Union[Unset, float] = UNSET, -) -> Response[Union[ClientErrorResponseContent, ServiceErrorResponseContent]]: +) -> Response[Union[ClientErrorResponseContent, ListCreditTransactionsResponseContent, ServiceErrorResponseContent]]: """ Args: page (Union[Unset, float]): @@ -108,7 +114,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ClientErrorResponseContent, ServiceErrorResponseContent]] + Response[Union[ClientErrorResponseContent, ListCreditTransactionsResponseContent, ServiceErrorResponseContent]] """ kwargs = _get_kwargs( @@ -128,7 +134,7 @@ def sync( client: Union[AuthenticatedClient, Client], page: Union[Unset, float] = UNSET, page_size: Union[Unset, float] = UNSET, -) -> Optional[Union[ClientErrorResponseContent, ServiceErrorResponseContent]]: +) -> Optional[Union[ClientErrorResponseContent, ListCreditTransactionsResponseContent, ServiceErrorResponseContent]]: """ Args: page (Union[Unset, float]): @@ -139,7 +145,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ClientErrorResponseContent, ServiceErrorResponseContent] + Union[ClientErrorResponseContent, ListCreditTransactionsResponseContent, ServiceErrorResponseContent] """ return sync_detailed( @@ -154,7 +160,7 @@ async def asyncio_detailed( client: Union[AuthenticatedClient, Client], page: Union[Unset, float] = UNSET, page_size: Union[Unset, float] = UNSET, -) -> Response[Union[ClientErrorResponseContent, ServiceErrorResponseContent]]: +) -> Response[Union[ClientErrorResponseContent, ListCreditTransactionsResponseContent, ServiceErrorResponseContent]]: """ Args: page (Union[Unset, float]): @@ -165,7 +171,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ClientErrorResponseContent, ServiceErrorResponseContent]] + Response[Union[ClientErrorResponseContent, ListCreditTransactionsResponseContent, ServiceErrorResponseContent]] """ kwargs = _get_kwargs( @@ -183,7 +189,7 @@ async def asyncio( client: Union[AuthenticatedClient, Client], page: Union[Unset, float] = UNSET, page_size: Union[Unset, float] = UNSET, -) -> Optional[Union[ClientErrorResponseContent, ServiceErrorResponseContent]]: +) -> Optional[Union[ClientErrorResponseContent, ListCreditTransactionsResponseContent, ServiceErrorResponseContent]]: """ Args: page (Union[Unset, float]): @@ -194,7 +200,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ClientErrorResponseContent, ServiceErrorResponseContent] + Union[ClientErrorResponseContent, ListCreditTransactionsResponseContent, ServiceErrorResponseContent] """ return ( diff --git a/griptape_cloud_client/api/data_connectors/create_data_connector.py b/griptape_cloud_client/api/data_connectors/create_data_connector.py index 574d21a..b058cdb 100644 --- a/griptape_cloud_client/api/data_connectors/create_data_connector.py +++ b/griptape_cloud_client/api/data_connectors/create_data_connector.py @@ -20,7 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/data-connectors", + "url": "/api/data-connectors", } _kwargs["json"] = body.to_dict() diff --git a/griptape_cloud_client/api/data_connectors/delete_data_connector.py b/griptape_cloud_client/api/data_connectors/delete_data_connector.py index d087314..7c692f4 100644 --- a/griptape_cloud_client/api/data_connectors/delete_data_connector.py +++ b/griptape_cloud_client/api/data_connectors/delete_data_connector.py @@ -15,7 +15,7 @@ def _get_kwargs( ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/data-connectors/{data_connector_id}", + "url": f"/api/data-connectors/{data_connector_id}", } return _kwargs diff --git a/griptape_cloud_client/api/data_connectors/get_data_connector.py b/griptape_cloud_client/api/data_connectors/get_data_connector.py index 438ac7b..81fc9ee 100644 --- a/griptape_cloud_client/api/data_connectors/get_data_connector.py +++ b/griptape_cloud_client/api/data_connectors/get_data_connector.py @@ -16,7 +16,7 @@ def _get_kwargs( ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", - "url": f"/data-connectors/{data_connector_id}", + "url": f"/api/data-connectors/{data_connector_id}", } return _kwargs diff --git a/griptape_cloud_client/api/data_connectors/list_data_connectors.py b/griptape_cloud_client/api/data_connectors/list_data_connectors.py index d0811b3..6b6de47 100644 --- a/griptape_cloud_client/api/data_connectors/list_data_connectors.py +++ b/griptape_cloud_client/api/data_connectors/list_data_connectors.py @@ -26,7 +26,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/data-connectors", + "url": "/api/data-connectors", "params": params, } diff --git a/griptape_cloud_client/api/data_connectors/update_data_connector.py b/griptape_cloud_client/api/data_connectors/update_data_connector.py index c56c5a3..817e9f9 100644 --- a/griptape_cloud_client/api/data_connectors/update_data_connector.py +++ b/griptape_cloud_client/api/data_connectors/update_data_connector.py @@ -21,7 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "patch", - "url": f"/data-connectors/{data_connector_id}", + "url": f"/api/data-connectors/{data_connector_id}", } _kwargs["json"] = body.to_dict() diff --git a/griptape_cloud_client/api/data_jobs/cancel_data_job.py b/griptape_cloud_client/api/data_jobs/cancel_data_job.py index e0bc535..78f974f 100644 --- a/griptape_cloud_client/api/data_jobs/cancel_data_job.py +++ b/griptape_cloud_client/api/data_jobs/cancel_data_job.py @@ -16,7 +16,7 @@ def _get_kwargs( ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "post", - "url": f"/data-jobs/{data_job_id}/cancel", + "url": f"/api/data-jobs/{data_job_id}/cancel", } return _kwargs diff --git a/griptape_cloud_client/api/data_jobs/create_data_job.py b/griptape_cloud_client/api/data_jobs/create_data_job.py index 268d111..c7df11d 100644 --- a/griptape_cloud_client/api/data_jobs/create_data_job.py +++ b/griptape_cloud_client/api/data_jobs/create_data_job.py @@ -16,7 +16,7 @@ def _get_kwargs( ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "post", - "url": f"/data-connectors/{data_connector_id}/data-jobs", + "url": f"/api/data-connectors/{data_connector_id}/data-jobs", } return _kwargs diff --git a/griptape_cloud_client/api/data_jobs/get_data_job.py b/griptape_cloud_client/api/data_jobs/get_data_job.py index bff2a19..c1ae048 100644 --- a/griptape_cloud_client/api/data_jobs/get_data_job.py +++ b/griptape_cloud_client/api/data_jobs/get_data_job.py @@ -16,7 +16,7 @@ def _get_kwargs( ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", - "url": f"/data-jobs/{data_job_id}", + "url": f"/api/data-jobs/{data_job_id}", } return _kwargs diff --git a/griptape_cloud_client/api/data_jobs/list_data_jobs.py b/griptape_cloud_client/api/data_jobs/list_data_jobs.py index 30a283b..6d3da54 100644 --- a/griptape_cloud_client/api/data_jobs/list_data_jobs.py +++ b/griptape_cloud_client/api/data_jobs/list_data_jobs.py @@ -38,7 +38,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/data-connectors/{data_connector_id}/data-jobs", + "url": f"/api/data-connectors/{data_connector_id}/data-jobs", "params": params, } diff --git a/griptape_cloud_client/api/default/list_users.py b/griptape_cloud_client/api/default/list_users.py index 6a8f9c4..88f295f 100644 --- a/griptape_cloud_client/api/default/list_users.py +++ b/griptape_cloud_client/api/default/list_users.py @@ -14,7 +14,7 @@ def _get_kwargs() -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", - "url": "/users", + "url": "/api/users", } return _kwargs diff --git a/griptape_cloud_client/api/deployments/create_function_deployment.py b/griptape_cloud_client/api/deployments/create_function_deployment.py index 9821d54..d21a280 100644 --- a/griptape_cloud_client/api/deployments/create_function_deployment.py +++ b/griptape_cloud_client/api/deployments/create_function_deployment.py @@ -21,7 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": f"/functions/{function_id}/deployments", + "url": f"/api/functions/{function_id}/deployments", } _kwargs["json"] = body.to_dict() diff --git a/griptape_cloud_client/api/deployments/create_structure_deployment.py b/griptape_cloud_client/api/deployments/create_structure_deployment.py index 48eb3f3..8d3257a 100644 --- a/griptape_cloud_client/api/deployments/create_structure_deployment.py +++ b/griptape_cloud_client/api/deployments/create_structure_deployment.py @@ -21,7 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": f"/structures/{structure_id}/deployments", + "url": f"/api/structures/{structure_id}/deployments", } _kwargs["json"] = body.to_dict() diff --git a/griptape_cloud_client/api/deployments/create_tool_deployment.py b/griptape_cloud_client/api/deployments/create_tool_deployment.py index 535a4fb..22a15ed 100644 --- a/griptape_cloud_client/api/deployments/create_tool_deployment.py +++ b/griptape_cloud_client/api/deployments/create_tool_deployment.py @@ -21,7 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": f"/tools/{tool_id}/deployments", + "url": f"/api/tools/{tool_id}/deployments", } _kwargs["json"] = body.to_dict() diff --git a/griptape_cloud_client/api/deployments/get_deployment.py b/griptape_cloud_client/api/deployments/get_deployment.py index 3dedfea..c62bf7c 100644 --- a/griptape_cloud_client/api/deployments/get_deployment.py +++ b/griptape_cloud_client/api/deployments/get_deployment.py @@ -16,7 +16,7 @@ def _get_kwargs( ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", - "url": f"/deployments/{deployment_id}", + "url": f"/api/deployments/{deployment_id}", } return _kwargs diff --git a/griptape_cloud_client/api/deployments/list_function_deployments.py b/griptape_cloud_client/api/deployments/list_function_deployments.py index 9b43867..779e261 100644 --- a/griptape_cloud_client/api/deployments/list_function_deployments.py +++ b/griptape_cloud_client/api/deployments/list_function_deployments.py @@ -27,7 +27,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/functions/{function_id}/deployments", + "url": f"/api/functions/{function_id}/deployments", "params": params, } diff --git a/griptape_cloud_client/api/deployments/list_structure_deployments.py b/griptape_cloud_client/api/deployments/list_structure_deployments.py index fdbe396..b204f30 100644 --- a/griptape_cloud_client/api/deployments/list_structure_deployments.py +++ b/griptape_cloud_client/api/deployments/list_structure_deployments.py @@ -38,7 +38,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/structures/{structure_id}/deployments", + "url": f"/api/structures/{structure_id}/deployments", "params": params, } diff --git a/griptape_cloud_client/api/deployments/list_tool_deployments.py b/griptape_cloud_client/api/deployments/list_tool_deployments.py index 875b83e..3674b84 100644 --- a/griptape_cloud_client/api/deployments/list_tool_deployments.py +++ b/griptape_cloud_client/api/deployments/list_tool_deployments.py @@ -27,7 +27,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/tools/{tool_id}/deployments", + "url": f"/api/tools/{tool_id}/deployments", "params": params, } diff --git a/griptape_cloud_client/api/entitlement_policies/__init__.py b/griptape_cloud_client/api/entitlement_policies/__init__.py new file mode 100644 index 0000000..2d7c0b2 --- /dev/null +++ b/griptape_cloud_client/api/entitlement_policies/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/griptape_cloud_client/api/entitlement_policies/create_entitlement_policy.py b/griptape_cloud_client/api/entitlement_policies/create_entitlement_policy.py new file mode 100644 index 0000000..a6cabba --- /dev/null +++ b/griptape_cloud_client/api/entitlement_policies/create_entitlement_policy.py @@ -0,0 +1,198 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.client_error_response_content import ClientErrorResponseContent +from ...models.create_entitlement_policy_request_content import CreateEntitlementPolicyRequestContent +from ...models.create_entitlement_policy_response_content import CreateEntitlementPolicyResponseContent +from ...models.service_error_response_content import ServiceErrorResponseContent +from ...types import Response + + +def _get_kwargs( + *, + body: CreateEntitlementPolicyRequestContent, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/entitlement-policies", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ClientErrorResponseContent, CreateEntitlementPolicyResponseContent, ServiceErrorResponseContent]]: + if response.status_code == 201: + response_201 = CreateEntitlementPolicyResponseContent.from_dict(response.json()) + + return response_201 + + if response.status_code == 400: + response_400 = ClientErrorResponseContent.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = ClientErrorResponseContent.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = ClientErrorResponseContent.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = ClientErrorResponseContent.from_dict(response.json()) + + return response_404 + + if response.status_code == 406: + response_406 = ClientErrorResponseContent.from_dict(response.json()) + + return response_406 + + if response.status_code == 409: + response_409 = ClientErrorResponseContent.from_dict(response.json()) + + return response_409 + + if response.status_code == 422: + response_422 = ClientErrorResponseContent.from_dict(response.json()) + + return response_422 + + if response.status_code == 500: + response_500 = ServiceErrorResponseContent.from_dict(response.json()) + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ClientErrorResponseContent, CreateEntitlementPolicyResponseContent, ServiceErrorResponseContent]]: + 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: Union[AuthenticatedClient, Client], + body: CreateEntitlementPolicyRequestContent, +) -> Response[Union[ClientErrorResponseContent, CreateEntitlementPolicyResponseContent, ServiceErrorResponseContent]]: + """ + Args: + body (CreateEntitlementPolicyRequestContent): + + 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[Union[ClientErrorResponseContent, CreateEntitlementPolicyResponseContent, ServiceErrorResponseContent]] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: Union[AuthenticatedClient, Client], + body: CreateEntitlementPolicyRequestContent, +) -> Optional[Union[ClientErrorResponseContent, CreateEntitlementPolicyResponseContent, ServiceErrorResponseContent]]: + """ + Args: + body (CreateEntitlementPolicyRequestContent): + + 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: + Union[ClientErrorResponseContent, CreateEntitlementPolicyResponseContent, ServiceErrorResponseContent] + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: Union[AuthenticatedClient, Client], + body: CreateEntitlementPolicyRequestContent, +) -> Response[Union[ClientErrorResponseContent, CreateEntitlementPolicyResponseContent, ServiceErrorResponseContent]]: + """ + Args: + body (CreateEntitlementPolicyRequestContent): + + 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[Union[ClientErrorResponseContent, CreateEntitlementPolicyResponseContent, ServiceErrorResponseContent]] + """ + + 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: Union[AuthenticatedClient, Client], + body: CreateEntitlementPolicyRequestContent, +) -> Optional[Union[ClientErrorResponseContent, CreateEntitlementPolicyResponseContent, ServiceErrorResponseContent]]: + """ + Args: + body (CreateEntitlementPolicyRequestContent): + + 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: + Union[ClientErrorResponseContent, CreateEntitlementPolicyResponseContent, ServiceErrorResponseContent] + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/griptape_cloud_client/api/entitlement_policies/delete_entitlement_policy.py b/griptape_cloud_client/api/entitlement_policies/delete_entitlement_policy.py new file mode 100644 index 0000000..117be3b --- /dev/null +++ b/griptape_cloud_client/api/entitlement_policies/delete_entitlement_policy.py @@ -0,0 +1,187 @@ +from http import HTTPStatus +from typing import Any, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.client_error_response_content import ClientErrorResponseContent +from ...models.service_error_response_content import ServiceErrorResponseContent +from ...types import Response + + +def _get_kwargs( + entitlement_policy_id: str, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "delete", + "url": f"/api/entitlement-policies/{entitlement_policy_id}", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ClientErrorResponseContent, ServiceErrorResponseContent]]: + if response.status_code == 204: + response_204 = cast(Any, None) + return response_204 + + if response.status_code == 400: + response_400 = ClientErrorResponseContent.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = ClientErrorResponseContent.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = ClientErrorResponseContent.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = ClientErrorResponseContent.from_dict(response.json()) + + return response_404 + + if response.status_code == 406: + response_406 = ClientErrorResponseContent.from_dict(response.json()) + + return response_406 + + if response.status_code == 409: + response_409 = ClientErrorResponseContent.from_dict(response.json()) + + return response_409 + + if response.status_code == 422: + response_422 = ClientErrorResponseContent.from_dict(response.json()) + + return response_422 + + if response.status_code == 500: + response_500 = ServiceErrorResponseContent.from_dict(response.json()) + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ClientErrorResponseContent, ServiceErrorResponseContent]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + entitlement_policy_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ClientErrorResponseContent, ServiceErrorResponseContent]]: + """ + Args: + entitlement_policy_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[Union[Any, ClientErrorResponseContent, ServiceErrorResponseContent]] + """ + + kwargs = _get_kwargs( + entitlement_policy_id=entitlement_policy_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + entitlement_policy_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ClientErrorResponseContent, ServiceErrorResponseContent]]: + """ + Args: + entitlement_policy_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: + Union[Any, ClientErrorResponseContent, ServiceErrorResponseContent] + """ + + return sync_detailed( + entitlement_policy_id=entitlement_policy_id, + client=client, + ).parsed + + +async def asyncio_detailed( + entitlement_policy_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ClientErrorResponseContent, ServiceErrorResponseContent]]: + """ + Args: + entitlement_policy_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[Union[Any, ClientErrorResponseContent, ServiceErrorResponseContent]] + """ + + kwargs = _get_kwargs( + entitlement_policy_id=entitlement_policy_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + entitlement_policy_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ClientErrorResponseContent, ServiceErrorResponseContent]]: + """ + Args: + entitlement_policy_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: + Union[Any, ClientErrorResponseContent, ServiceErrorResponseContent] + """ + + return ( + await asyncio_detailed( + entitlement_policy_id=entitlement_policy_id, + client=client, + ) + ).parsed diff --git a/griptape_cloud_client/api/entitlement_policies/get_entitlement_policy.py b/griptape_cloud_client/api/entitlement_policies/get_entitlement_policy.py new file mode 100644 index 0000000..d4813f4 --- /dev/null +++ b/griptape_cloud_client/api/entitlement_policies/get_entitlement_policy.py @@ -0,0 +1,189 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.client_error_response_content import ClientErrorResponseContent +from ...models.get_entitlement_policy_response_content import GetEntitlementPolicyResponseContent +from ...models.service_error_response_content import ServiceErrorResponseContent +from ...types import Response + + +def _get_kwargs( + entitlement_policy_id: str, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/api/entitlement-policies/{entitlement_policy_id}", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ClientErrorResponseContent, GetEntitlementPolicyResponseContent, ServiceErrorResponseContent]]: + if response.status_code == 200: + response_200 = GetEntitlementPolicyResponseContent.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = ClientErrorResponseContent.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = ClientErrorResponseContent.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = ClientErrorResponseContent.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = ClientErrorResponseContent.from_dict(response.json()) + + return response_404 + + if response.status_code == 406: + response_406 = ClientErrorResponseContent.from_dict(response.json()) + + return response_406 + + if response.status_code == 409: + response_409 = ClientErrorResponseContent.from_dict(response.json()) + + return response_409 + + if response.status_code == 422: + response_422 = ClientErrorResponseContent.from_dict(response.json()) + + return response_422 + + if response.status_code == 500: + response_500 = ServiceErrorResponseContent.from_dict(response.json()) + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ClientErrorResponseContent, GetEntitlementPolicyResponseContent, ServiceErrorResponseContent]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + entitlement_policy_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[ClientErrorResponseContent, GetEntitlementPolicyResponseContent, ServiceErrorResponseContent]]: + """ + Args: + entitlement_policy_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[Union[ClientErrorResponseContent, GetEntitlementPolicyResponseContent, ServiceErrorResponseContent]] + """ + + kwargs = _get_kwargs( + entitlement_policy_id=entitlement_policy_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + entitlement_policy_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[ClientErrorResponseContent, GetEntitlementPolicyResponseContent, ServiceErrorResponseContent]]: + """ + Args: + entitlement_policy_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: + Union[ClientErrorResponseContent, GetEntitlementPolicyResponseContent, ServiceErrorResponseContent] + """ + + return sync_detailed( + entitlement_policy_id=entitlement_policy_id, + client=client, + ).parsed + + +async def asyncio_detailed( + entitlement_policy_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[ClientErrorResponseContent, GetEntitlementPolicyResponseContent, ServiceErrorResponseContent]]: + """ + Args: + entitlement_policy_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[Union[ClientErrorResponseContent, GetEntitlementPolicyResponseContent, ServiceErrorResponseContent]] + """ + + kwargs = _get_kwargs( + entitlement_policy_id=entitlement_policy_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + entitlement_policy_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[ClientErrorResponseContent, GetEntitlementPolicyResponseContent, ServiceErrorResponseContent]]: + """ + Args: + entitlement_policy_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: + Union[ClientErrorResponseContent, GetEntitlementPolicyResponseContent, ServiceErrorResponseContent] + """ + + return ( + await asyncio_detailed( + entitlement_policy_id=entitlement_policy_id, + client=client, + ) + ).parsed diff --git a/griptape_cloud_client/api/entitlement_policies/list_entitlement_policies.py b/griptape_cloud_client/api/entitlement_policies/list_entitlement_policies.py new file mode 100644 index 0000000..3e7e32a --- /dev/null +++ b/griptape_cloud_client/api/entitlement_policies/list_entitlement_policies.py @@ -0,0 +1,242 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.client_error_response_content import ClientErrorResponseContent +from ...models.list_entitlement_policies_response_content import ListEntitlementPoliciesResponseContent +from ...models.service_error_response_content import ServiceErrorResponseContent +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + page: Union[Unset, float] = UNSET, + page_size: Union[Unset, float] = UNSET, + metadata_key: Union[Unset, str] = UNSET, + metadata_value: Union[Unset, str] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["page"] = page + + params["page_size"] = page_size + + params["metadata_key"] = metadata_key + + params["metadata_value"] = metadata_value + + 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": "/api/entitlement-policies", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ClientErrorResponseContent, ListEntitlementPoliciesResponseContent, ServiceErrorResponseContent]]: + if response.status_code == 200: + response_200 = ListEntitlementPoliciesResponseContent.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = ClientErrorResponseContent.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = ClientErrorResponseContent.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = ClientErrorResponseContent.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = ClientErrorResponseContent.from_dict(response.json()) + + return response_404 + + if response.status_code == 406: + response_406 = ClientErrorResponseContent.from_dict(response.json()) + + return response_406 + + if response.status_code == 409: + response_409 = ClientErrorResponseContent.from_dict(response.json()) + + return response_409 + + if response.status_code == 422: + response_422 = ClientErrorResponseContent.from_dict(response.json()) + + return response_422 + + if response.status_code == 500: + response_500 = ServiceErrorResponseContent.from_dict(response.json()) + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ClientErrorResponseContent, ListEntitlementPoliciesResponseContent, ServiceErrorResponseContent]]: + 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: Union[AuthenticatedClient, Client], + page: Union[Unset, float] = UNSET, + page_size: Union[Unset, float] = UNSET, + metadata_key: Union[Unset, str] = UNSET, + metadata_value: Union[Unset, str] = UNSET, +) -> Response[Union[ClientErrorResponseContent, ListEntitlementPoliciesResponseContent, ServiceErrorResponseContent]]: + """ + Args: + page (Union[Unset, float]): + page_size (Union[Unset, float]): + metadata_key (Union[Unset, str]): + metadata_value (Union[Unset, 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[Union[ClientErrorResponseContent, ListEntitlementPoliciesResponseContent, ServiceErrorResponseContent]] + """ + + kwargs = _get_kwargs( + page=page, + page_size=page_size, + metadata_key=metadata_key, + metadata_value=metadata_value, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: Union[AuthenticatedClient, Client], + page: Union[Unset, float] = UNSET, + page_size: Union[Unset, float] = UNSET, + metadata_key: Union[Unset, str] = UNSET, + metadata_value: Union[Unset, str] = UNSET, +) -> Optional[Union[ClientErrorResponseContent, ListEntitlementPoliciesResponseContent, ServiceErrorResponseContent]]: + """ + Args: + page (Union[Unset, float]): + page_size (Union[Unset, float]): + metadata_key (Union[Unset, str]): + metadata_value (Union[Unset, 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: + Union[ClientErrorResponseContent, ListEntitlementPoliciesResponseContent, ServiceErrorResponseContent] + """ + + return sync_detailed( + client=client, + page=page, + page_size=page_size, + metadata_key=metadata_key, + metadata_value=metadata_value, + ).parsed + + +async def asyncio_detailed( + *, + client: Union[AuthenticatedClient, Client], + page: Union[Unset, float] = UNSET, + page_size: Union[Unset, float] = UNSET, + metadata_key: Union[Unset, str] = UNSET, + metadata_value: Union[Unset, str] = UNSET, +) -> Response[Union[ClientErrorResponseContent, ListEntitlementPoliciesResponseContent, ServiceErrorResponseContent]]: + """ + Args: + page (Union[Unset, float]): + page_size (Union[Unset, float]): + metadata_key (Union[Unset, str]): + metadata_value (Union[Unset, 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[Union[ClientErrorResponseContent, ListEntitlementPoliciesResponseContent, ServiceErrorResponseContent]] + """ + + kwargs = _get_kwargs( + page=page, + page_size=page_size, + metadata_key=metadata_key, + metadata_value=metadata_value, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: Union[AuthenticatedClient, Client], + page: Union[Unset, float] = UNSET, + page_size: Union[Unset, float] = UNSET, + metadata_key: Union[Unset, str] = UNSET, + metadata_value: Union[Unset, str] = UNSET, +) -> Optional[Union[ClientErrorResponseContent, ListEntitlementPoliciesResponseContent, ServiceErrorResponseContent]]: + """ + Args: + page (Union[Unset, float]): + page_size (Union[Unset, float]): + metadata_key (Union[Unset, str]): + metadata_value (Union[Unset, 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: + Union[ClientErrorResponseContent, ListEntitlementPoliciesResponseContent, ServiceErrorResponseContent] + """ + + return ( + await asyncio_detailed( + client=client, + page=page, + page_size=page_size, + metadata_key=metadata_key, + metadata_value=metadata_value, + ) + ).parsed diff --git a/griptape_cloud_client/api/entitlement_policies/update_entitlement_policy.py b/griptape_cloud_client/api/entitlement_policies/update_entitlement_policy.py new file mode 100644 index 0000000..6d3442d --- /dev/null +++ b/griptape_cloud_client/api/entitlement_policies/update_entitlement_policy.py @@ -0,0 +1,211 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.client_error_response_content import ClientErrorResponseContent +from ...models.service_error_response_content import ServiceErrorResponseContent +from ...models.update_entitlement_policy_request_content import UpdateEntitlementPolicyRequestContent +from ...models.update_entitlement_policy_response_content import UpdateEntitlementPolicyResponseContent +from ...types import Response + + +def _get_kwargs( + entitlement_policy_id: str, + *, + body: UpdateEntitlementPolicyRequestContent, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": f"/api/entitlement-policies/{entitlement_policy_id}", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ClientErrorResponseContent, ServiceErrorResponseContent, UpdateEntitlementPolicyResponseContent]]: + if response.status_code == 200: + response_200 = UpdateEntitlementPolicyResponseContent.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = ClientErrorResponseContent.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = ClientErrorResponseContent.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = ClientErrorResponseContent.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = ClientErrorResponseContent.from_dict(response.json()) + + return response_404 + + if response.status_code == 406: + response_406 = ClientErrorResponseContent.from_dict(response.json()) + + return response_406 + + if response.status_code == 409: + response_409 = ClientErrorResponseContent.from_dict(response.json()) + + return response_409 + + if response.status_code == 422: + response_422 = ClientErrorResponseContent.from_dict(response.json()) + + return response_422 + + if response.status_code == 500: + response_500 = ServiceErrorResponseContent.from_dict(response.json()) + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ClientErrorResponseContent, ServiceErrorResponseContent, UpdateEntitlementPolicyResponseContent]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + entitlement_policy_id: str, + *, + client: Union[AuthenticatedClient, Client], + body: UpdateEntitlementPolicyRequestContent, +) -> Response[Union[ClientErrorResponseContent, ServiceErrorResponseContent, UpdateEntitlementPolicyResponseContent]]: + """ + Args: + entitlement_policy_id (str): + body (UpdateEntitlementPolicyRequestContent): + + 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[Union[ClientErrorResponseContent, ServiceErrorResponseContent, UpdateEntitlementPolicyResponseContent]] + """ + + kwargs = _get_kwargs( + entitlement_policy_id=entitlement_policy_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + entitlement_policy_id: str, + *, + client: Union[AuthenticatedClient, Client], + body: UpdateEntitlementPolicyRequestContent, +) -> Optional[Union[ClientErrorResponseContent, ServiceErrorResponseContent, UpdateEntitlementPolicyResponseContent]]: + """ + Args: + entitlement_policy_id (str): + body (UpdateEntitlementPolicyRequestContent): + + 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: + Union[ClientErrorResponseContent, ServiceErrorResponseContent, UpdateEntitlementPolicyResponseContent] + """ + + return sync_detailed( + entitlement_policy_id=entitlement_policy_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + entitlement_policy_id: str, + *, + client: Union[AuthenticatedClient, Client], + body: UpdateEntitlementPolicyRequestContent, +) -> Response[Union[ClientErrorResponseContent, ServiceErrorResponseContent, UpdateEntitlementPolicyResponseContent]]: + """ + Args: + entitlement_policy_id (str): + body (UpdateEntitlementPolicyRequestContent): + + 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[Union[ClientErrorResponseContent, ServiceErrorResponseContent, UpdateEntitlementPolicyResponseContent]] + """ + + kwargs = _get_kwargs( + entitlement_policy_id=entitlement_policy_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + entitlement_policy_id: str, + *, + client: Union[AuthenticatedClient, Client], + body: UpdateEntitlementPolicyRequestContent, +) -> Optional[Union[ClientErrorResponseContent, ServiceErrorResponseContent, UpdateEntitlementPolicyResponseContent]]: + """ + Args: + entitlement_policy_id (str): + body (UpdateEntitlementPolicyRequestContent): + + 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: + Union[ClientErrorResponseContent, ServiceErrorResponseContent, UpdateEntitlementPolicyResponseContent] + """ + + return ( + await asyncio_detailed( + entitlement_policy_id=entitlement_policy_id, + client=client, + body=body, + ) + ).parsed diff --git a/griptape_cloud_client/api/events/create_events.py b/griptape_cloud_client/api/events/create_events.py index 135a824..af574d2 100644 --- a/griptape_cloud_client/api/events/create_events.py +++ b/griptape_cloud_client/api/events/create_events.py @@ -20,7 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": f"/structure-runs/{structure_run_id}/events", + "url": f"/api/structure-runs/{structure_run_id}/events", } _kwargs["json"] = body.to_dict() diff --git a/griptape_cloud_client/api/events/get_assistant_run_events_sse.py b/griptape_cloud_client/api/events/get_assistant_run_events_sse.py index 0c5f1ae..043fb0a 100644 --- a/griptape_cloud_client/api/events/get_assistant_run_events_sse.py +++ b/griptape_cloud_client/api/events/get_assistant_run_events_sse.py @@ -15,7 +15,7 @@ def _get_kwargs( ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", - "url": f"/assistant-runs/{assistant_run_id}/events/stream", + "url": f"/api/assistant-runs/{assistant_run_id}/events/stream", } return _kwargs diff --git a/griptape_cloud_client/api/events/get_event.py b/griptape_cloud_client/api/events/get_event.py index e15bdab..2bd1a91 100644 --- a/griptape_cloud_client/api/events/get_event.py +++ b/griptape_cloud_client/api/events/get_event.py @@ -16,7 +16,7 @@ def _get_kwargs( ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", - "url": f"/events/{event_id}", + "url": f"/api/events/{event_id}", } return _kwargs diff --git a/griptape_cloud_client/api/events/get_structure_run_events_sse.py b/griptape_cloud_client/api/events/get_structure_run_events_sse.py index e16c688..ae5f109 100644 --- a/griptape_cloud_client/api/events/get_structure_run_events_sse.py +++ b/griptape_cloud_client/api/events/get_structure_run_events_sse.py @@ -15,7 +15,7 @@ def _get_kwargs( ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", - "url": f"/structure-runs/{structure_run_id}/events/stream", + "url": f"/api/structure-runs/{structure_run_id}/events/stream", } return _kwargs diff --git a/griptape_cloud_client/api/events/list_assistant_events.py b/griptape_cloud_client/api/events/list_assistant_events.py index c82c75e..695bff4 100644 --- a/griptape_cloud_client/api/events/list_assistant_events.py +++ b/griptape_cloud_client/api/events/list_assistant_events.py @@ -27,7 +27,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/assistant-runs/{assistant_run_id}/events", + "url": f"/api/assistant-runs/{assistant_run_id}/events", "params": params, } diff --git a/griptape_cloud_client/api/events/list_events.py b/griptape_cloud_client/api/events/list_events.py index eb507a9..39e48fb 100644 --- a/griptape_cloud_client/api/events/list_events.py +++ b/griptape_cloud_client/api/events/list_events.py @@ -27,7 +27,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/structure-runs/{structure_run_id}/events", + "url": f"/api/structure-runs/{structure_run_id}/events", "params": params, } diff --git a/griptape_cloud_client/api/export_jobs/__init__.py b/griptape_cloud_client/api/export_jobs/__init__.py new file mode 100644 index 0000000..2d7c0b2 --- /dev/null +++ b/griptape_cloud_client/api/export_jobs/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/griptape_cloud_client/api/export_jobs/create_export_job.py b/griptape_cloud_client/api/export_jobs/create_export_job.py new file mode 100644 index 0000000..b3bea67 --- /dev/null +++ b/griptape_cloud_client/api/export_jobs/create_export_job.py @@ -0,0 +1,198 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.client_error_response_content import ClientErrorResponseContent +from ...models.create_export_job_request_content import CreateExportJobRequestContent +from ...models.create_export_job_response_content import CreateExportJobResponseContent +from ...models.service_error_response_content import ServiceErrorResponseContent +from ...types import Response + + +def _get_kwargs( + *, + body: CreateExportJobRequestContent, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/export-jobs", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ClientErrorResponseContent, CreateExportJobResponseContent, ServiceErrorResponseContent]]: + if response.status_code == 202: + response_202 = CreateExportJobResponseContent.from_dict(response.json()) + + return response_202 + + if response.status_code == 400: + response_400 = ClientErrorResponseContent.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = ClientErrorResponseContent.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = ClientErrorResponseContent.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = ClientErrorResponseContent.from_dict(response.json()) + + return response_404 + + if response.status_code == 406: + response_406 = ClientErrorResponseContent.from_dict(response.json()) + + return response_406 + + if response.status_code == 409: + response_409 = ClientErrorResponseContent.from_dict(response.json()) + + return response_409 + + if response.status_code == 422: + response_422 = ClientErrorResponseContent.from_dict(response.json()) + + return response_422 + + if response.status_code == 500: + response_500 = ServiceErrorResponseContent.from_dict(response.json()) + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ClientErrorResponseContent, CreateExportJobResponseContent, ServiceErrorResponseContent]]: + 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: Union[AuthenticatedClient, Client], + body: CreateExportJobRequestContent, +) -> Response[Union[ClientErrorResponseContent, CreateExportJobResponseContent, ServiceErrorResponseContent]]: + """ + Args: + body (CreateExportJobRequestContent): + + 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[Union[ClientErrorResponseContent, CreateExportJobResponseContent, ServiceErrorResponseContent]] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: Union[AuthenticatedClient, Client], + body: CreateExportJobRequestContent, +) -> Optional[Union[ClientErrorResponseContent, CreateExportJobResponseContent, ServiceErrorResponseContent]]: + """ + Args: + body (CreateExportJobRequestContent): + + 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: + Union[ClientErrorResponseContent, CreateExportJobResponseContent, ServiceErrorResponseContent] + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: Union[AuthenticatedClient, Client], + body: CreateExportJobRequestContent, +) -> Response[Union[ClientErrorResponseContent, CreateExportJobResponseContent, ServiceErrorResponseContent]]: + """ + Args: + body (CreateExportJobRequestContent): + + 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[Union[ClientErrorResponseContent, CreateExportJobResponseContent, ServiceErrorResponseContent]] + """ + + 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: Union[AuthenticatedClient, Client], + body: CreateExportJobRequestContent, +) -> Optional[Union[ClientErrorResponseContent, CreateExportJobResponseContent, ServiceErrorResponseContent]]: + """ + Args: + body (CreateExportJobRequestContent): + + 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: + Union[ClientErrorResponseContent, CreateExportJobResponseContent, ServiceErrorResponseContent] + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/griptape_cloud_client/api/export_jobs/get_export_job.py b/griptape_cloud_client/api/export_jobs/get_export_job.py new file mode 100644 index 0000000..2ff7dea --- /dev/null +++ b/griptape_cloud_client/api/export_jobs/get_export_job.py @@ -0,0 +1,189 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.client_error_response_content import ClientErrorResponseContent +from ...models.get_export_job_response_content import GetExportJobResponseContent +from ...models.service_error_response_content import ServiceErrorResponseContent +from ...types import Response + + +def _get_kwargs( + export_job_id: str, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/api/export-jobs/{export_job_id}", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ClientErrorResponseContent, GetExportJobResponseContent, ServiceErrorResponseContent]]: + if response.status_code == 200: + response_200 = GetExportJobResponseContent.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = ClientErrorResponseContent.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = ClientErrorResponseContent.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = ClientErrorResponseContent.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = ClientErrorResponseContent.from_dict(response.json()) + + return response_404 + + if response.status_code == 406: + response_406 = ClientErrorResponseContent.from_dict(response.json()) + + return response_406 + + if response.status_code == 409: + response_409 = ClientErrorResponseContent.from_dict(response.json()) + + return response_409 + + if response.status_code == 422: + response_422 = ClientErrorResponseContent.from_dict(response.json()) + + return response_422 + + if response.status_code == 500: + response_500 = ServiceErrorResponseContent.from_dict(response.json()) + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ClientErrorResponseContent, GetExportJobResponseContent, ServiceErrorResponseContent]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + export_job_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[ClientErrorResponseContent, GetExportJobResponseContent, ServiceErrorResponseContent]]: + """ + Args: + export_job_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[Union[ClientErrorResponseContent, GetExportJobResponseContent, ServiceErrorResponseContent]] + """ + + kwargs = _get_kwargs( + export_job_id=export_job_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + export_job_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[ClientErrorResponseContent, GetExportJobResponseContent, ServiceErrorResponseContent]]: + """ + Args: + export_job_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: + Union[ClientErrorResponseContent, GetExportJobResponseContent, ServiceErrorResponseContent] + """ + + return sync_detailed( + export_job_id=export_job_id, + client=client, + ).parsed + + +async def asyncio_detailed( + export_job_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[ClientErrorResponseContent, GetExportJobResponseContent, ServiceErrorResponseContent]]: + """ + Args: + export_job_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[Union[ClientErrorResponseContent, GetExportJobResponseContent, ServiceErrorResponseContent]] + """ + + kwargs = _get_kwargs( + export_job_id=export_job_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + export_job_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[ClientErrorResponseContent, GetExportJobResponseContent, ServiceErrorResponseContent]]: + """ + Args: + export_job_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: + Union[ClientErrorResponseContent, GetExportJobResponseContent, ServiceErrorResponseContent] + """ + + return ( + await asyncio_detailed( + export_job_id=export_job_id, + client=client, + ) + ).parsed diff --git a/griptape_cloud_client/api/export_jobs/list_export_jobs.py b/griptape_cloud_client/api/export_jobs/list_export_jobs.py new file mode 100644 index 0000000..2ecb3f5 --- /dev/null +++ b/griptape_cloud_client/api/export_jobs/list_export_jobs.py @@ -0,0 +1,239 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.client_error_response_content import ClientErrorResponseContent +from ...models.export_job_status import ExportJobStatus +from ...models.list_export_jobs_response_content import ListExportJobsResponseContent +from ...models.service_error_response_content import ServiceErrorResponseContent +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + page: Union[Unset, float] = UNSET, + page_size: Union[Unset, float] = UNSET, + status: Union[Unset, list[ExportJobStatus]] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["page"] = page + + params["page_size"] = page_size + + json_status: Union[Unset, list[str]] = UNSET + if not isinstance(status, Unset): + json_status = [] + for status_item_data in status: + status_item = status_item_data.value + json_status.append(status_item) + + params["status"] = json_status + + 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": "/api/export-jobs", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ClientErrorResponseContent, ListExportJobsResponseContent, ServiceErrorResponseContent]]: + if response.status_code == 200: + response_200 = ListExportJobsResponseContent.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = ClientErrorResponseContent.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = ClientErrorResponseContent.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = ClientErrorResponseContent.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = ClientErrorResponseContent.from_dict(response.json()) + + return response_404 + + if response.status_code == 406: + response_406 = ClientErrorResponseContent.from_dict(response.json()) + + return response_406 + + if response.status_code == 409: + response_409 = ClientErrorResponseContent.from_dict(response.json()) + + return response_409 + + if response.status_code == 422: + response_422 = ClientErrorResponseContent.from_dict(response.json()) + + return response_422 + + if response.status_code == 500: + response_500 = ServiceErrorResponseContent.from_dict(response.json()) + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ClientErrorResponseContent, ListExportJobsResponseContent, ServiceErrorResponseContent]]: + 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: Union[AuthenticatedClient, Client], + page: Union[Unset, float] = UNSET, + page_size: Union[Unset, float] = UNSET, + status: Union[Unset, list[ExportJobStatus]] = UNSET, +) -> Response[Union[ClientErrorResponseContent, ListExportJobsResponseContent, ServiceErrorResponseContent]]: + """ + Args: + page (Union[Unset, float]): + page_size (Union[Unset, float]): + status (Union[Unset, list[ExportJobStatus]]): Comma-separated list of statuses to filter + by. + + 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[Union[ClientErrorResponseContent, ListExportJobsResponseContent, ServiceErrorResponseContent]] + """ + + kwargs = _get_kwargs( + page=page, + page_size=page_size, + status=status, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: Union[AuthenticatedClient, Client], + page: Union[Unset, float] = UNSET, + page_size: Union[Unset, float] = UNSET, + status: Union[Unset, list[ExportJobStatus]] = UNSET, +) -> Optional[Union[ClientErrorResponseContent, ListExportJobsResponseContent, ServiceErrorResponseContent]]: + """ + Args: + page (Union[Unset, float]): + page_size (Union[Unset, float]): + status (Union[Unset, list[ExportJobStatus]]): Comma-separated list of statuses to filter + by. + + 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: + Union[ClientErrorResponseContent, ListExportJobsResponseContent, ServiceErrorResponseContent] + """ + + return sync_detailed( + client=client, + page=page, + page_size=page_size, + status=status, + ).parsed + + +async def asyncio_detailed( + *, + client: Union[AuthenticatedClient, Client], + page: Union[Unset, float] = UNSET, + page_size: Union[Unset, float] = UNSET, + status: Union[Unset, list[ExportJobStatus]] = UNSET, +) -> Response[Union[ClientErrorResponseContent, ListExportJobsResponseContent, ServiceErrorResponseContent]]: + """ + Args: + page (Union[Unset, float]): + page_size (Union[Unset, float]): + status (Union[Unset, list[ExportJobStatus]]): Comma-separated list of statuses to filter + by. + + 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[Union[ClientErrorResponseContent, ListExportJobsResponseContent, ServiceErrorResponseContent]] + """ + + kwargs = _get_kwargs( + page=page, + page_size=page_size, + status=status, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: Union[AuthenticatedClient, Client], + page: Union[Unset, float] = UNSET, + page_size: Union[Unset, float] = UNSET, + status: Union[Unset, list[ExportJobStatus]] = UNSET, +) -> Optional[Union[ClientErrorResponseContent, ListExportJobsResponseContent, ServiceErrorResponseContent]]: + """ + Args: + page (Union[Unset, float]): + page_size (Union[Unset, float]): + status (Union[Unset, list[ExportJobStatus]]): Comma-separated list of statuses to filter + by. + + 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: + Union[ClientErrorResponseContent, ListExportJobsResponseContent, ServiceErrorResponseContent] + """ + + return ( + await asyncio_detailed( + client=client, + page=page, + page_size=page_size, + status=status, + ) + ).parsed diff --git a/griptape_cloud_client/api/function_execute/create_function_execution_get.py b/griptape_cloud_client/api/function_execute/create_function_execution_get.py index d191ba5..e3b375a 100644 --- a/griptape_cloud_client/api/function_execute/create_function_execution_get.py +++ b/griptape_cloud_client/api/function_execute/create_function_execution_get.py @@ -15,7 +15,7 @@ def _get_kwargs( ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", - "url": f"/functions/{function_id}/execute", + "url": f"/api/functions/{function_id}/execute", } return _kwargs diff --git a/griptape_cloud_client/api/function_execute/create_function_execution_post.py b/griptape_cloud_client/api/function_execute/create_function_execution_post.py index 2cc5060..c341176 100644 --- a/griptape_cloud_client/api/function_execute/create_function_execution_post.py +++ b/griptape_cloud_client/api/function_execute/create_function_execution_post.py @@ -19,7 +19,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": f"/functions/{function_id}/execute", + "url": f"/api/functions/{function_id}/execute", } _kwargs["json"] = body diff --git a/griptape_cloud_client/api/function_runs/get_function_run.py b/griptape_cloud_client/api/function_runs/get_function_run.py index 1c14026..7974886 100644 --- a/griptape_cloud_client/api/function_runs/get_function_run.py +++ b/griptape_cloud_client/api/function_runs/get_function_run.py @@ -16,7 +16,7 @@ def _get_kwargs( ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", - "url": f"/function-runs/{function_run_id}", + "url": f"/api/function-runs/{function_run_id}", } return _kwargs diff --git a/griptape_cloud_client/api/function_runs/list_function_run_logs.py b/griptape_cloud_client/api/function_runs/list_function_run_logs.py index 226bcd7..be7a55b 100644 --- a/griptape_cloud_client/api/function_runs/list_function_run_logs.py +++ b/griptape_cloud_client/api/function_runs/list_function_run_logs.py @@ -16,7 +16,7 @@ def _get_kwargs( ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", - "url": f"/function-runs/{function_run_id}/logs", + "url": f"/api/function-runs/{function_run_id}/logs", } return _kwargs diff --git a/griptape_cloud_client/api/function_runs/list_function_runs.py b/griptape_cloud_client/api/function_runs/list_function_runs.py index 5653b93..e156af6 100644 --- a/griptape_cloud_client/api/function_runs/list_function_runs.py +++ b/griptape_cloud_client/api/function_runs/list_function_runs.py @@ -38,7 +38,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/functions/{function_id}/runs", + "url": f"/api/functions/{function_id}/runs", "params": params, } diff --git a/griptape_cloud_client/api/functions/create_function.py b/griptape_cloud_client/api/functions/create_function.py index c51f4d2..778773b 100644 --- a/griptape_cloud_client/api/functions/create_function.py +++ b/griptape_cloud_client/api/functions/create_function.py @@ -20,7 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/functions", + "url": "/api/functions", } _kwargs["json"] = body.to_dict() diff --git a/griptape_cloud_client/api/functions/delete_function.py b/griptape_cloud_client/api/functions/delete_function.py index e676e42..fcf733b 100644 --- a/griptape_cloud_client/api/functions/delete_function.py +++ b/griptape_cloud_client/api/functions/delete_function.py @@ -15,7 +15,7 @@ def _get_kwargs( ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/functions/{function_id}", + "url": f"/api/functions/{function_id}", } return _kwargs diff --git a/griptape_cloud_client/api/functions/get_function.py b/griptape_cloud_client/api/functions/get_function.py index 6708282..996d02b 100644 --- a/griptape_cloud_client/api/functions/get_function.py +++ b/griptape_cloud_client/api/functions/get_function.py @@ -16,7 +16,7 @@ def _get_kwargs( ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", - "url": f"/functions/{function_id}", + "url": f"/api/functions/{function_id}", } return _kwargs diff --git a/griptape_cloud_client/api/functions/list_functions.py b/griptape_cloud_client/api/functions/list_functions.py index fb9e3d3..d9c91d3 100644 --- a/griptape_cloud_client/api/functions/list_functions.py +++ b/griptape_cloud_client/api/functions/list_functions.py @@ -26,7 +26,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/functions", + "url": "/api/functions", "params": params, } diff --git a/griptape_cloud_client/api/functions/update_function.py b/griptape_cloud_client/api/functions/update_function.py index 35b1886..c2391be 100644 --- a/griptape_cloud_client/api/functions/update_function.py +++ b/griptape_cloud_client/api/functions/update_function.py @@ -21,7 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "patch", - "url": f"/functions/{function_id}", + "url": f"/api/functions/{function_id}", } _kwargs["json"] = body.to_dict() diff --git a/griptape_cloud_client/api/import_jobs/__init__.py b/griptape_cloud_client/api/import_jobs/__init__.py new file mode 100644 index 0000000..2d7c0b2 --- /dev/null +++ b/griptape_cloud_client/api/import_jobs/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/griptape_cloud_client/api/import_jobs/create_import_job.py b/griptape_cloud_client/api/import_jobs/create_import_job.py new file mode 100644 index 0000000..fbd3db5 --- /dev/null +++ b/griptape_cloud_client/api/import_jobs/create_import_job.py @@ -0,0 +1,198 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.client_error_response_content import ClientErrorResponseContent +from ...models.create_import_job_request_content import CreateImportJobRequestContent +from ...models.create_import_job_response_content import CreateImportJobResponseContent +from ...models.service_error_response_content import ServiceErrorResponseContent +from ...types import Response + + +def _get_kwargs( + *, + body: CreateImportJobRequestContent, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/import-jobs", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ClientErrorResponseContent, CreateImportJobResponseContent, ServiceErrorResponseContent]]: + if response.status_code == 201: + response_201 = CreateImportJobResponseContent.from_dict(response.json()) + + return response_201 + + if response.status_code == 400: + response_400 = ClientErrorResponseContent.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = ClientErrorResponseContent.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = ClientErrorResponseContent.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = ClientErrorResponseContent.from_dict(response.json()) + + return response_404 + + if response.status_code == 406: + response_406 = ClientErrorResponseContent.from_dict(response.json()) + + return response_406 + + if response.status_code == 409: + response_409 = ClientErrorResponseContent.from_dict(response.json()) + + return response_409 + + if response.status_code == 422: + response_422 = ClientErrorResponseContent.from_dict(response.json()) + + return response_422 + + if response.status_code == 500: + response_500 = ServiceErrorResponseContent.from_dict(response.json()) + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ClientErrorResponseContent, CreateImportJobResponseContent, ServiceErrorResponseContent]]: + 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: Union[AuthenticatedClient, Client], + body: CreateImportJobRequestContent, +) -> Response[Union[ClientErrorResponseContent, CreateImportJobResponseContent, ServiceErrorResponseContent]]: + """ + Args: + body (CreateImportJobRequestContent): + + 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[Union[ClientErrorResponseContent, CreateImportJobResponseContent, ServiceErrorResponseContent]] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: Union[AuthenticatedClient, Client], + body: CreateImportJobRequestContent, +) -> Optional[Union[ClientErrorResponseContent, CreateImportJobResponseContent, ServiceErrorResponseContent]]: + """ + Args: + body (CreateImportJobRequestContent): + + 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: + Union[ClientErrorResponseContent, CreateImportJobResponseContent, ServiceErrorResponseContent] + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: Union[AuthenticatedClient, Client], + body: CreateImportJobRequestContent, +) -> Response[Union[ClientErrorResponseContent, CreateImportJobResponseContent, ServiceErrorResponseContent]]: + """ + Args: + body (CreateImportJobRequestContent): + + 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[Union[ClientErrorResponseContent, CreateImportJobResponseContent, ServiceErrorResponseContent]] + """ + + 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: Union[AuthenticatedClient, Client], + body: CreateImportJobRequestContent, +) -> Optional[Union[ClientErrorResponseContent, CreateImportJobResponseContent, ServiceErrorResponseContent]]: + """ + Args: + body (CreateImportJobRequestContent): + + 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: + Union[ClientErrorResponseContent, CreateImportJobResponseContent, ServiceErrorResponseContent] + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/griptape_cloud_client/api/import_jobs/get_import_job.py b/griptape_cloud_client/api/import_jobs/get_import_job.py new file mode 100644 index 0000000..e187ce0 --- /dev/null +++ b/griptape_cloud_client/api/import_jobs/get_import_job.py @@ -0,0 +1,189 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.client_error_response_content import ClientErrorResponseContent +from ...models.get_import_job_response_content import GetImportJobResponseContent +from ...models.service_error_response_content import ServiceErrorResponseContent +from ...types import Response + + +def _get_kwargs( + import_job_id: str, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/api/import-jobs/{import_job_id}", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ClientErrorResponseContent, GetImportJobResponseContent, ServiceErrorResponseContent]]: + if response.status_code == 200: + response_200 = GetImportJobResponseContent.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = ClientErrorResponseContent.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = ClientErrorResponseContent.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = ClientErrorResponseContent.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = ClientErrorResponseContent.from_dict(response.json()) + + return response_404 + + if response.status_code == 406: + response_406 = ClientErrorResponseContent.from_dict(response.json()) + + return response_406 + + if response.status_code == 409: + response_409 = ClientErrorResponseContent.from_dict(response.json()) + + return response_409 + + if response.status_code == 422: + response_422 = ClientErrorResponseContent.from_dict(response.json()) + + return response_422 + + if response.status_code == 500: + response_500 = ServiceErrorResponseContent.from_dict(response.json()) + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ClientErrorResponseContent, GetImportJobResponseContent, ServiceErrorResponseContent]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + import_job_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[ClientErrorResponseContent, GetImportJobResponseContent, ServiceErrorResponseContent]]: + """ + Args: + import_job_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[Union[ClientErrorResponseContent, GetImportJobResponseContent, ServiceErrorResponseContent]] + """ + + kwargs = _get_kwargs( + import_job_id=import_job_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + import_job_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[ClientErrorResponseContent, GetImportJobResponseContent, ServiceErrorResponseContent]]: + """ + Args: + import_job_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: + Union[ClientErrorResponseContent, GetImportJobResponseContent, ServiceErrorResponseContent] + """ + + return sync_detailed( + import_job_id=import_job_id, + client=client, + ).parsed + + +async def asyncio_detailed( + import_job_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[ClientErrorResponseContent, GetImportJobResponseContent, ServiceErrorResponseContent]]: + """ + Args: + import_job_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[Union[ClientErrorResponseContent, GetImportJobResponseContent, ServiceErrorResponseContent]] + """ + + kwargs = _get_kwargs( + import_job_id=import_job_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + import_job_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[ClientErrorResponseContent, GetImportJobResponseContent, ServiceErrorResponseContent]]: + """ + Args: + import_job_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: + Union[ClientErrorResponseContent, GetImportJobResponseContent, ServiceErrorResponseContent] + """ + + return ( + await asyncio_detailed( + import_job_id=import_job_id, + client=client, + ) + ).parsed diff --git a/griptape_cloud_client/api/import_jobs/list_import_jobs.py b/griptape_cloud_client/api/import_jobs/list_import_jobs.py new file mode 100644 index 0000000..3fc0a79 --- /dev/null +++ b/griptape_cloud_client/api/import_jobs/list_import_jobs.py @@ -0,0 +1,239 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.client_error_response_content import ClientErrorResponseContent +from ...models.import_job_status import ImportJobStatus +from ...models.list_import_jobs_response_content import ListImportJobsResponseContent +from ...models.service_error_response_content import ServiceErrorResponseContent +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + page: Union[Unset, float] = UNSET, + page_size: Union[Unset, float] = UNSET, + status: Union[Unset, list[ImportJobStatus]] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["page"] = page + + params["page_size"] = page_size + + json_status: Union[Unset, list[str]] = UNSET + if not isinstance(status, Unset): + json_status = [] + for status_item_data in status: + status_item = status_item_data.value + json_status.append(status_item) + + params["status"] = json_status + + 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": "/api/import-jobs", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ClientErrorResponseContent, ListImportJobsResponseContent, ServiceErrorResponseContent]]: + if response.status_code == 200: + response_200 = ListImportJobsResponseContent.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = ClientErrorResponseContent.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = ClientErrorResponseContent.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = ClientErrorResponseContent.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = ClientErrorResponseContent.from_dict(response.json()) + + return response_404 + + if response.status_code == 406: + response_406 = ClientErrorResponseContent.from_dict(response.json()) + + return response_406 + + if response.status_code == 409: + response_409 = ClientErrorResponseContent.from_dict(response.json()) + + return response_409 + + if response.status_code == 422: + response_422 = ClientErrorResponseContent.from_dict(response.json()) + + return response_422 + + if response.status_code == 500: + response_500 = ServiceErrorResponseContent.from_dict(response.json()) + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ClientErrorResponseContent, ListImportJobsResponseContent, ServiceErrorResponseContent]]: + 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: Union[AuthenticatedClient, Client], + page: Union[Unset, float] = UNSET, + page_size: Union[Unset, float] = UNSET, + status: Union[Unset, list[ImportJobStatus]] = UNSET, +) -> Response[Union[ClientErrorResponseContent, ListImportJobsResponseContent, ServiceErrorResponseContent]]: + """ + Args: + page (Union[Unset, float]): + page_size (Union[Unset, float]): + status (Union[Unset, list[ImportJobStatus]]): Comma-separated list of statuses to filter + by. + + 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[Union[ClientErrorResponseContent, ListImportJobsResponseContent, ServiceErrorResponseContent]] + """ + + kwargs = _get_kwargs( + page=page, + page_size=page_size, + status=status, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: Union[AuthenticatedClient, Client], + page: Union[Unset, float] = UNSET, + page_size: Union[Unset, float] = UNSET, + status: Union[Unset, list[ImportJobStatus]] = UNSET, +) -> Optional[Union[ClientErrorResponseContent, ListImportJobsResponseContent, ServiceErrorResponseContent]]: + """ + Args: + page (Union[Unset, float]): + page_size (Union[Unset, float]): + status (Union[Unset, list[ImportJobStatus]]): Comma-separated list of statuses to filter + by. + + 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: + Union[ClientErrorResponseContent, ListImportJobsResponseContent, ServiceErrorResponseContent] + """ + + return sync_detailed( + client=client, + page=page, + page_size=page_size, + status=status, + ).parsed + + +async def asyncio_detailed( + *, + client: Union[AuthenticatedClient, Client], + page: Union[Unset, float] = UNSET, + page_size: Union[Unset, float] = UNSET, + status: Union[Unset, list[ImportJobStatus]] = UNSET, +) -> Response[Union[ClientErrorResponseContent, ListImportJobsResponseContent, ServiceErrorResponseContent]]: + """ + Args: + page (Union[Unset, float]): + page_size (Union[Unset, float]): + status (Union[Unset, list[ImportJobStatus]]): Comma-separated list of statuses to filter + by. + + 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[Union[ClientErrorResponseContent, ListImportJobsResponseContent, ServiceErrorResponseContent]] + """ + + kwargs = _get_kwargs( + page=page, + page_size=page_size, + status=status, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: Union[AuthenticatedClient, Client], + page: Union[Unset, float] = UNSET, + page_size: Union[Unset, float] = UNSET, + status: Union[Unset, list[ImportJobStatus]] = UNSET, +) -> Optional[Union[ClientErrorResponseContent, ListImportJobsResponseContent, ServiceErrorResponseContent]]: + """ + Args: + page (Union[Unset, float]): + page_size (Union[Unset, float]): + status (Union[Unset, list[ImportJobStatus]]): Comma-separated list of statuses to filter + by. + + 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: + Union[ClientErrorResponseContent, ListImportJobsResponseContent, ServiceErrorResponseContent] + """ + + return ( + await asyncio_detailed( + client=client, + page=page, + page_size=page_size, + status=status, + ) + ).parsed diff --git a/griptape_cloud_client/api/import_jobs/start_import_job.py b/griptape_cloud_client/api/import_jobs/start_import_job.py new file mode 100644 index 0000000..65169e3 --- /dev/null +++ b/griptape_cloud_client/api/import_jobs/start_import_job.py @@ -0,0 +1,189 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.client_error_response_content import ClientErrorResponseContent +from ...models.service_error_response_content import ServiceErrorResponseContent +from ...models.start_import_job_response_content import StartImportJobResponseContent +from ...types import Response + + +def _get_kwargs( + import_job_id: str, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "post", + "url": f"/api/import-jobs/{import_job_id}/start", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ClientErrorResponseContent, ServiceErrorResponseContent, StartImportJobResponseContent]]: + if response.status_code == 200: + response_200 = StartImportJobResponseContent.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = ClientErrorResponseContent.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = ClientErrorResponseContent.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = ClientErrorResponseContent.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = ClientErrorResponseContent.from_dict(response.json()) + + return response_404 + + if response.status_code == 406: + response_406 = ClientErrorResponseContent.from_dict(response.json()) + + return response_406 + + if response.status_code == 409: + response_409 = ClientErrorResponseContent.from_dict(response.json()) + + return response_409 + + if response.status_code == 422: + response_422 = ClientErrorResponseContent.from_dict(response.json()) + + return response_422 + + if response.status_code == 500: + response_500 = ServiceErrorResponseContent.from_dict(response.json()) + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ClientErrorResponseContent, ServiceErrorResponseContent, StartImportJobResponseContent]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + import_job_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[ClientErrorResponseContent, ServiceErrorResponseContent, StartImportJobResponseContent]]: + """ + Args: + import_job_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[Union[ClientErrorResponseContent, ServiceErrorResponseContent, StartImportJobResponseContent]] + """ + + kwargs = _get_kwargs( + import_job_id=import_job_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + import_job_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[ClientErrorResponseContent, ServiceErrorResponseContent, StartImportJobResponseContent]]: + """ + Args: + import_job_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: + Union[ClientErrorResponseContent, ServiceErrorResponseContent, StartImportJobResponseContent] + """ + + return sync_detailed( + import_job_id=import_job_id, + client=client, + ).parsed + + +async def asyncio_detailed( + import_job_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[ClientErrorResponseContent, ServiceErrorResponseContent, StartImportJobResponseContent]]: + """ + Args: + import_job_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[Union[ClientErrorResponseContent, ServiceErrorResponseContent, StartImportJobResponseContent]] + """ + + kwargs = _get_kwargs( + import_job_id=import_job_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + import_job_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[ClientErrorResponseContent, ServiceErrorResponseContent, StartImportJobResponseContent]]: + """ + Args: + import_job_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: + Union[ClientErrorResponseContent, ServiceErrorResponseContent, StartImportJobResponseContent] + """ + + return ( + await asyncio_detailed( + import_job_id=import_job_id, + client=client, + ) + ).parsed diff --git a/griptape_cloud_client/api/integrations/create_integration.py b/griptape_cloud_client/api/integrations/create_integration.py index f3b77b2..6f1cc8a 100644 --- a/griptape_cloud_client/api/integrations/create_integration.py +++ b/griptape_cloud_client/api/integrations/create_integration.py @@ -20,7 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/integrations", + "url": "/api/integrations", } _kwargs["json"] = body.to_dict() diff --git a/griptape_cloud_client/api/integrations/delete_integration.py b/griptape_cloud_client/api/integrations/delete_integration.py index 84be2bd..92b5cfb 100644 --- a/griptape_cloud_client/api/integrations/delete_integration.py +++ b/griptape_cloud_client/api/integrations/delete_integration.py @@ -15,7 +15,7 @@ def _get_kwargs( ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/integrations/{integration_id}", + "url": f"/api/integrations/{integration_id}", } return _kwargs diff --git a/griptape_cloud_client/api/integrations/get_integration.py b/griptape_cloud_client/api/integrations/get_integration.py index 9695570..fe0b1e7 100644 --- a/griptape_cloud_client/api/integrations/get_integration.py +++ b/griptape_cloud_client/api/integrations/get_integration.py @@ -16,7 +16,7 @@ def _get_kwargs( ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", - "url": f"/integrations/{integration_id}", + "url": f"/api/integrations/{integration_id}", } return _kwargs diff --git a/griptape_cloud_client/api/integrations/list_integrations.py b/griptape_cloud_client/api/integrations/list_integrations.py index ba7429b..6f79542 100644 --- a/griptape_cloud_client/api/integrations/list_integrations.py +++ b/griptape_cloud_client/api/integrations/list_integrations.py @@ -26,7 +26,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/integrations", + "url": "/api/integrations", "params": params, } diff --git a/griptape_cloud_client/api/integrations/update_integration.py b/griptape_cloud_client/api/integrations/update_integration.py index 40ab1c7..34dc7fc 100644 --- a/griptape_cloud_client/api/integrations/update_integration.py +++ b/griptape_cloud_client/api/integrations/update_integration.py @@ -21,7 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "patch", - "url": f"/integrations/{integration_id}", + "url": f"/api/integrations/{integration_id}", } _kwargs["json"] = body.to_dict() diff --git a/griptape_cloud_client/api/invites/create_invite.py b/griptape_cloud_client/api/invites/create_invite.py index bbdfc6b..f52f271 100644 --- a/griptape_cloud_client/api/invites/create_invite.py +++ b/griptape_cloud_client/api/invites/create_invite.py @@ -21,7 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": f"/organizations/{organization_id}/invites", + "url": f"/api/organizations/{organization_id}/invites", } _kwargs["json"] = body.to_dict() diff --git a/griptape_cloud_client/api/invites/delete_invite.py b/griptape_cloud_client/api/invites/delete_invite.py index e8afce3..4e9709d 100644 --- a/griptape_cloud_client/api/invites/delete_invite.py +++ b/griptape_cloud_client/api/invites/delete_invite.py @@ -15,7 +15,7 @@ def _get_kwargs( ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/invites/{invite_id}", + "url": f"/api/invites/{invite_id}", } return _kwargs diff --git a/griptape_cloud_client/api/invites/get_invite.py b/griptape_cloud_client/api/invites/get_invite.py index 797489b..7db8691 100644 --- a/griptape_cloud_client/api/invites/get_invite.py +++ b/griptape_cloud_client/api/invites/get_invite.py @@ -16,7 +16,7 @@ def _get_kwargs( ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", - "url": f"/invites/{invite_id}", + "url": f"/api/invites/{invite_id}", } return _kwargs diff --git a/griptape_cloud_client/api/invites/list_invites.py b/griptape_cloud_client/api/invites/list_invites.py index ea01165..332f61d 100644 --- a/griptape_cloud_client/api/invites/list_invites.py +++ b/griptape_cloud_client/api/invites/list_invites.py @@ -27,7 +27,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/organizations/{organization_id}/invites", + "url": f"/api/organizations/{organization_id}/invites", "params": params, } diff --git a/griptape_cloud_client/api/invites/list_user_invites.py b/griptape_cloud_client/api/invites/list_user_invites.py index b78e68a..08b23f7 100644 --- a/griptape_cloud_client/api/invites/list_user_invites.py +++ b/griptape_cloud_client/api/invites/list_user_invites.py @@ -26,7 +26,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/invites", + "url": "/api/invites", "params": params, } diff --git a/griptape_cloud_client/api/invites/respond_to_invite.py b/griptape_cloud_client/api/invites/respond_to_invite.py index 7e71a71..f56b4e9 100644 --- a/griptape_cloud_client/api/invites/respond_to_invite.py +++ b/griptape_cloud_client/api/invites/respond_to_invite.py @@ -20,7 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": f"/invites/{invite_id}/response", + "url": f"/api/invites/{invite_id}/response", } _kwargs["json"] = body.to_dict() diff --git a/griptape_cloud_client/api/knowledge_base_jobs/cancel_knowledge_base_job.py b/griptape_cloud_client/api/knowledge_base_jobs/cancel_knowledge_base_job.py index b324db3..b9ae61b 100644 --- a/griptape_cloud_client/api/knowledge_base_jobs/cancel_knowledge_base_job.py +++ b/griptape_cloud_client/api/knowledge_base_jobs/cancel_knowledge_base_job.py @@ -16,7 +16,7 @@ def _get_kwargs( ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "post", - "url": f"/knowledge-base-jobs/{knowledge_base_job_id}/cancel", + "url": f"/api/knowledge-base-jobs/{knowledge_base_job_id}/cancel", } return _kwargs diff --git a/griptape_cloud_client/api/knowledge_base_jobs/create_knowledge_base_job.py b/griptape_cloud_client/api/knowledge_base_jobs/create_knowledge_base_job.py index 7e5f08f..bc5be69 100644 --- a/griptape_cloud_client/api/knowledge_base_jobs/create_knowledge_base_job.py +++ b/griptape_cloud_client/api/knowledge_base_jobs/create_knowledge_base_job.py @@ -16,7 +16,7 @@ def _get_kwargs( ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "post", - "url": f"/knowledge-bases/{knowledge_base_id}/knowledge-base-jobs", + "url": f"/api/knowledge-bases/{knowledge_base_id}/knowledge-base-jobs", } return _kwargs diff --git a/griptape_cloud_client/api/knowledge_base_jobs/get_knowledge_base_job.py b/griptape_cloud_client/api/knowledge_base_jobs/get_knowledge_base_job.py index 0b9d433..42c55b9 100644 --- a/griptape_cloud_client/api/knowledge_base_jobs/get_knowledge_base_job.py +++ b/griptape_cloud_client/api/knowledge_base_jobs/get_knowledge_base_job.py @@ -16,7 +16,7 @@ def _get_kwargs( ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", - "url": f"/knowledge-base-jobs/{knowledge_base_job_id}", + "url": f"/api/knowledge-base-jobs/{knowledge_base_job_id}", } return _kwargs diff --git a/griptape_cloud_client/api/knowledge_base_jobs/list_knowledge_base_jobs.py b/griptape_cloud_client/api/knowledge_base_jobs/list_knowledge_base_jobs.py index 4a9a333..451235d 100644 --- a/griptape_cloud_client/api/knowledge_base_jobs/list_knowledge_base_jobs.py +++ b/griptape_cloud_client/api/knowledge_base_jobs/list_knowledge_base_jobs.py @@ -38,7 +38,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/knowledge-bases/{knowledge_base_id}/knowledge-base-jobs", + "url": f"/api/knowledge-bases/{knowledge_base_id}/knowledge-base-jobs", "params": params, } diff --git a/griptape_cloud_client/api/knowledge_bases/create_knowledge_base.py b/griptape_cloud_client/api/knowledge_bases/create_knowledge_base.py index bb9ca8e..239eaf6 100644 --- a/griptape_cloud_client/api/knowledge_bases/create_knowledge_base.py +++ b/griptape_cloud_client/api/knowledge_bases/create_knowledge_base.py @@ -20,7 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/knowledge-bases", + "url": "/api/knowledge-bases", } _kwargs["json"] = body.to_dict() diff --git a/griptape_cloud_client/api/knowledge_bases/delete_knowledge_base.py b/griptape_cloud_client/api/knowledge_bases/delete_knowledge_base.py index 3b4b3fb..0274957 100644 --- a/griptape_cloud_client/api/knowledge_bases/delete_knowledge_base.py +++ b/griptape_cloud_client/api/knowledge_bases/delete_knowledge_base.py @@ -15,7 +15,7 @@ def _get_kwargs( ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/knowledge-bases/{knowledge_base_id}", + "url": f"/api/knowledge-bases/{knowledge_base_id}", } return _kwargs diff --git a/griptape_cloud_client/api/knowledge_bases/get_knowledge_base.py b/griptape_cloud_client/api/knowledge_bases/get_knowledge_base.py index 9ca114a..4817ab8 100644 --- a/griptape_cloud_client/api/knowledge_bases/get_knowledge_base.py +++ b/griptape_cloud_client/api/knowledge_bases/get_knowledge_base.py @@ -16,7 +16,7 @@ def _get_kwargs( ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", - "url": f"/knowledge-bases/{knowledge_base_id}", + "url": f"/api/knowledge-bases/{knowledge_base_id}", } return _kwargs diff --git a/griptape_cloud_client/api/knowledge_bases/get_knowledge_base_query.py b/griptape_cloud_client/api/knowledge_bases/get_knowledge_base_query.py index 62dfee4..a0f5eaa 100644 --- a/griptape_cloud_client/api/knowledge_bases/get_knowledge_base_query.py +++ b/griptape_cloud_client/api/knowledge_bases/get_knowledge_base_query.py @@ -16,7 +16,7 @@ def _get_kwargs( ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", - "url": f"/knowledge-base-queries/{knowledge_base_query_id}", + "url": f"/api/knowledge-base-queries/{knowledge_base_query_id}", } return _kwargs diff --git a/griptape_cloud_client/api/knowledge_bases/get_knowledge_base_search.py b/griptape_cloud_client/api/knowledge_bases/get_knowledge_base_search.py index 88e548f..7973d21 100644 --- a/griptape_cloud_client/api/knowledge_bases/get_knowledge_base_search.py +++ b/griptape_cloud_client/api/knowledge_bases/get_knowledge_base_search.py @@ -16,7 +16,7 @@ def _get_kwargs( ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", - "url": f"/knowledge-base-searches/{knowledge_base_search_id}", + "url": f"/api/knowledge-base-searches/{knowledge_base_search_id}", } return _kwargs diff --git a/griptape_cloud_client/api/knowledge_bases/list_knowledge_base_queries.py b/griptape_cloud_client/api/knowledge_bases/list_knowledge_base_queries.py index 1f36f7c..f22fd1c 100644 --- a/griptape_cloud_client/api/knowledge_bases/list_knowledge_base_queries.py +++ b/griptape_cloud_client/api/knowledge_bases/list_knowledge_base_queries.py @@ -27,7 +27,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/knowledge-bases/{knowledge_base_id}/queries", + "url": f"/api/knowledge-bases/{knowledge_base_id}/queries", "params": params, } diff --git a/griptape_cloud_client/api/knowledge_bases/list_knowledge_base_searches.py b/griptape_cloud_client/api/knowledge_bases/list_knowledge_base_searches.py index c51486d..b36c632 100644 --- a/griptape_cloud_client/api/knowledge_bases/list_knowledge_base_searches.py +++ b/griptape_cloud_client/api/knowledge_bases/list_knowledge_base_searches.py @@ -27,7 +27,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/knowledge-bases/{knowledge_base_id}/searches", + "url": f"/api/knowledge-bases/{knowledge_base_id}/searches", "params": params, } diff --git a/griptape_cloud_client/api/knowledge_bases/list_knowledge_bases.py b/griptape_cloud_client/api/knowledge_bases/list_knowledge_bases.py index 7842017..6219dd3 100644 --- a/griptape_cloud_client/api/knowledge_bases/list_knowledge_bases.py +++ b/griptape_cloud_client/api/knowledge_bases/list_knowledge_bases.py @@ -26,7 +26,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/knowledge-bases", + "url": "/api/knowledge-bases", "params": params, } diff --git a/griptape_cloud_client/api/knowledge_bases/query_knowledge_base.py b/griptape_cloud_client/api/knowledge_bases/query_knowledge_base.py index b5a834a..afe6023 100644 --- a/griptape_cloud_client/api/knowledge_bases/query_knowledge_base.py +++ b/griptape_cloud_client/api/knowledge_bases/query_knowledge_base.py @@ -21,7 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": f"/knowledge-bases/{knowledge_base_id}/query", + "url": f"/api/knowledge-bases/{knowledge_base_id}/query", } _kwargs["json"] = body.to_dict() diff --git a/griptape_cloud_client/api/knowledge_bases/search_knowledge_base.py b/griptape_cloud_client/api/knowledge_bases/search_knowledge_base.py index ea2225e..7ad7c0d 100644 --- a/griptape_cloud_client/api/knowledge_bases/search_knowledge_base.py +++ b/griptape_cloud_client/api/knowledge_bases/search_knowledge_base.py @@ -21,7 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": f"/knowledge-bases/{knowledge_base_id}/search", + "url": f"/api/knowledge-bases/{knowledge_base_id}/search", } _kwargs["json"] = body.to_dict() diff --git a/griptape_cloud_client/api/knowledge_bases/update_knowledge_base.py b/griptape_cloud_client/api/knowledge_bases/update_knowledge_base.py index f83a312..085b6e6 100644 --- a/griptape_cloud_client/api/knowledge_bases/update_knowledge_base.py +++ b/griptape_cloud_client/api/knowledge_bases/update_knowledge_base.py @@ -21,7 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "patch", - "url": f"/knowledge-bases/{knowledge_base_id}", + "url": f"/api/knowledge-bases/{knowledge_base_id}", } _kwargs["json"] = body.to_dict() diff --git a/griptape_cloud_client/api/libraries/create_library.py b/griptape_cloud_client/api/libraries/create_library.py index 2254847..49bc4fe 100644 --- a/griptape_cloud_client/api/libraries/create_library.py +++ b/griptape_cloud_client/api/libraries/create_library.py @@ -20,7 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/libraries", + "url": "/api/libraries", } _kwargs["json"] = body.to_dict() diff --git a/griptape_cloud_client/api/libraries/delete_library.py b/griptape_cloud_client/api/libraries/delete_library.py index ec8cb27..0728ef6 100644 --- a/griptape_cloud_client/api/libraries/delete_library.py +++ b/griptape_cloud_client/api/libraries/delete_library.py @@ -15,7 +15,7 @@ def _get_kwargs( ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/libraries/{library_id}", + "url": f"/api/libraries/{library_id}", } return _kwargs diff --git a/griptape_cloud_client/api/libraries/get_library.py b/griptape_cloud_client/api/libraries/get_library.py index b8852d5..3fb28a1 100644 --- a/griptape_cloud_client/api/libraries/get_library.py +++ b/griptape_cloud_client/api/libraries/get_library.py @@ -16,7 +16,7 @@ def _get_kwargs( ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", - "url": f"/libraries/{library_id}", + "url": f"/api/libraries/{library_id}", } return _kwargs diff --git a/griptape_cloud_client/api/libraries/list_libraries.py b/griptape_cloud_client/api/libraries/list_libraries.py index 37bfae6..fae9dba 100644 --- a/griptape_cloud_client/api/libraries/list_libraries.py +++ b/griptape_cloud_client/api/libraries/list_libraries.py @@ -26,7 +26,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/libraries", + "url": "/api/libraries", "params": params, } diff --git a/griptape_cloud_client/api/libraries/update_library.py b/griptape_cloud_client/api/libraries/update_library.py index ad7b816..d36efdb 100644 --- a/griptape_cloud_client/api/libraries/update_library.py +++ b/griptape_cloud_client/api/libraries/update_library.py @@ -21,7 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "patch", - "url": f"/libraries/{library_id}", + "url": f"/api/libraries/{library_id}", } _kwargs["json"] = body.to_dict() diff --git a/griptape_cloud_client/api/license_groups/__init__.py b/griptape_cloud_client/api/license_groups/__init__.py new file mode 100644 index 0000000..2d7c0b2 --- /dev/null +++ b/griptape_cloud_client/api/license_groups/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/griptape_cloud_client/api/license_groups/create_license_group.py b/griptape_cloud_client/api/license_groups/create_license_group.py new file mode 100644 index 0000000..0fb1547 --- /dev/null +++ b/griptape_cloud_client/api/license_groups/create_license_group.py @@ -0,0 +1,198 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.client_error_response_content import ClientErrorResponseContent +from ...models.create_license_group_request_content import CreateLicenseGroupRequestContent +from ...models.create_license_group_response_content import CreateLicenseGroupResponseContent +from ...models.service_error_response_content import ServiceErrorResponseContent +from ...types import Response + + +def _get_kwargs( + *, + body: CreateLicenseGroupRequestContent, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/license-groups", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ClientErrorResponseContent, CreateLicenseGroupResponseContent, ServiceErrorResponseContent]]: + if response.status_code == 201: + response_201 = CreateLicenseGroupResponseContent.from_dict(response.json()) + + return response_201 + + if response.status_code == 400: + response_400 = ClientErrorResponseContent.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = ClientErrorResponseContent.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = ClientErrorResponseContent.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = ClientErrorResponseContent.from_dict(response.json()) + + return response_404 + + if response.status_code == 406: + response_406 = ClientErrorResponseContent.from_dict(response.json()) + + return response_406 + + if response.status_code == 409: + response_409 = ClientErrorResponseContent.from_dict(response.json()) + + return response_409 + + if response.status_code == 422: + response_422 = ClientErrorResponseContent.from_dict(response.json()) + + return response_422 + + if response.status_code == 500: + response_500 = ServiceErrorResponseContent.from_dict(response.json()) + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ClientErrorResponseContent, CreateLicenseGroupResponseContent, ServiceErrorResponseContent]]: + 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: Union[AuthenticatedClient, Client], + body: CreateLicenseGroupRequestContent, +) -> Response[Union[ClientErrorResponseContent, CreateLicenseGroupResponseContent, ServiceErrorResponseContent]]: + """ + Args: + body (CreateLicenseGroupRequestContent): + + 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[Union[ClientErrorResponseContent, CreateLicenseGroupResponseContent, ServiceErrorResponseContent]] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: Union[AuthenticatedClient, Client], + body: CreateLicenseGroupRequestContent, +) -> Optional[Union[ClientErrorResponseContent, CreateLicenseGroupResponseContent, ServiceErrorResponseContent]]: + """ + Args: + body (CreateLicenseGroupRequestContent): + + 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: + Union[ClientErrorResponseContent, CreateLicenseGroupResponseContent, ServiceErrorResponseContent] + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: Union[AuthenticatedClient, Client], + body: CreateLicenseGroupRequestContent, +) -> Response[Union[ClientErrorResponseContent, CreateLicenseGroupResponseContent, ServiceErrorResponseContent]]: + """ + Args: + body (CreateLicenseGroupRequestContent): + + 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[Union[ClientErrorResponseContent, CreateLicenseGroupResponseContent, ServiceErrorResponseContent]] + """ + + 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: Union[AuthenticatedClient, Client], + body: CreateLicenseGroupRequestContent, +) -> Optional[Union[ClientErrorResponseContent, CreateLicenseGroupResponseContent, ServiceErrorResponseContent]]: + """ + Args: + body (CreateLicenseGroupRequestContent): + + 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: + Union[ClientErrorResponseContent, CreateLicenseGroupResponseContent, ServiceErrorResponseContent] + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/griptape_cloud_client/api/license_groups/delete_license_group.py b/griptape_cloud_client/api/license_groups/delete_license_group.py new file mode 100644 index 0000000..47b5635 --- /dev/null +++ b/griptape_cloud_client/api/license_groups/delete_license_group.py @@ -0,0 +1,187 @@ +from http import HTTPStatus +from typing import Any, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.client_error_response_content import ClientErrorResponseContent +from ...models.service_error_response_content import ServiceErrorResponseContent +from ...types import Response + + +def _get_kwargs( + license_group_id: str, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "delete", + "url": f"/api/license-groups/{license_group_id}", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ClientErrorResponseContent, ServiceErrorResponseContent]]: + if response.status_code == 204: + response_204 = cast(Any, None) + return response_204 + + if response.status_code == 400: + response_400 = ClientErrorResponseContent.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = ClientErrorResponseContent.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = ClientErrorResponseContent.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = ClientErrorResponseContent.from_dict(response.json()) + + return response_404 + + if response.status_code == 406: + response_406 = ClientErrorResponseContent.from_dict(response.json()) + + return response_406 + + if response.status_code == 409: + response_409 = ClientErrorResponseContent.from_dict(response.json()) + + return response_409 + + if response.status_code == 422: + response_422 = ClientErrorResponseContent.from_dict(response.json()) + + return response_422 + + if response.status_code == 500: + response_500 = ServiceErrorResponseContent.from_dict(response.json()) + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ClientErrorResponseContent, ServiceErrorResponseContent]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + license_group_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ClientErrorResponseContent, ServiceErrorResponseContent]]: + """ + Args: + license_group_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[Union[Any, ClientErrorResponseContent, ServiceErrorResponseContent]] + """ + + kwargs = _get_kwargs( + license_group_id=license_group_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + license_group_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ClientErrorResponseContent, ServiceErrorResponseContent]]: + """ + Args: + license_group_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: + Union[Any, ClientErrorResponseContent, ServiceErrorResponseContent] + """ + + return sync_detailed( + license_group_id=license_group_id, + client=client, + ).parsed + + +async def asyncio_detailed( + license_group_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ClientErrorResponseContent, ServiceErrorResponseContent]]: + """ + Args: + license_group_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[Union[Any, ClientErrorResponseContent, ServiceErrorResponseContent]] + """ + + kwargs = _get_kwargs( + license_group_id=license_group_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + license_group_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ClientErrorResponseContent, ServiceErrorResponseContent]]: + """ + Args: + license_group_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: + Union[Any, ClientErrorResponseContent, ServiceErrorResponseContent] + """ + + return ( + await asyncio_detailed( + license_group_id=license_group_id, + client=client, + ) + ).parsed diff --git a/griptape_cloud_client/api/license_groups/get_license_group.py b/griptape_cloud_client/api/license_groups/get_license_group.py new file mode 100644 index 0000000..65e4b0d --- /dev/null +++ b/griptape_cloud_client/api/license_groups/get_license_group.py @@ -0,0 +1,189 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.client_error_response_content import ClientErrorResponseContent +from ...models.get_license_group_response_content import GetLicenseGroupResponseContent +from ...models.service_error_response_content import ServiceErrorResponseContent +from ...types import Response + + +def _get_kwargs( + license_group_id: str, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/api/license-groups/{license_group_id}", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ClientErrorResponseContent, GetLicenseGroupResponseContent, ServiceErrorResponseContent]]: + if response.status_code == 200: + response_200 = GetLicenseGroupResponseContent.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = ClientErrorResponseContent.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = ClientErrorResponseContent.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = ClientErrorResponseContent.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = ClientErrorResponseContent.from_dict(response.json()) + + return response_404 + + if response.status_code == 406: + response_406 = ClientErrorResponseContent.from_dict(response.json()) + + return response_406 + + if response.status_code == 409: + response_409 = ClientErrorResponseContent.from_dict(response.json()) + + return response_409 + + if response.status_code == 422: + response_422 = ClientErrorResponseContent.from_dict(response.json()) + + return response_422 + + if response.status_code == 500: + response_500 = ServiceErrorResponseContent.from_dict(response.json()) + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ClientErrorResponseContent, GetLicenseGroupResponseContent, ServiceErrorResponseContent]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + license_group_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[ClientErrorResponseContent, GetLicenseGroupResponseContent, ServiceErrorResponseContent]]: + """ + Args: + license_group_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[Union[ClientErrorResponseContent, GetLicenseGroupResponseContent, ServiceErrorResponseContent]] + """ + + kwargs = _get_kwargs( + license_group_id=license_group_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + license_group_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[ClientErrorResponseContent, GetLicenseGroupResponseContent, ServiceErrorResponseContent]]: + """ + Args: + license_group_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: + Union[ClientErrorResponseContent, GetLicenseGroupResponseContent, ServiceErrorResponseContent] + """ + + return sync_detailed( + license_group_id=license_group_id, + client=client, + ).parsed + + +async def asyncio_detailed( + license_group_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[ClientErrorResponseContent, GetLicenseGroupResponseContent, ServiceErrorResponseContent]]: + """ + Args: + license_group_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[Union[ClientErrorResponseContent, GetLicenseGroupResponseContent, ServiceErrorResponseContent]] + """ + + kwargs = _get_kwargs( + license_group_id=license_group_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + license_group_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[ClientErrorResponseContent, GetLicenseGroupResponseContent, ServiceErrorResponseContent]]: + """ + Args: + license_group_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: + Union[ClientErrorResponseContent, GetLicenseGroupResponseContent, ServiceErrorResponseContent] + """ + + return ( + await asyncio_detailed( + license_group_id=license_group_id, + client=client, + ) + ).parsed diff --git a/griptape_cloud_client/api/license_groups/list_license_groups.py b/griptape_cloud_client/api/license_groups/list_license_groups.py new file mode 100644 index 0000000..45c61c8 --- /dev/null +++ b/griptape_cloud_client/api/license_groups/list_license_groups.py @@ -0,0 +1,242 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.client_error_response_content import ClientErrorResponseContent +from ...models.list_license_groups_response_content import ListLicenseGroupsResponseContent +from ...models.service_error_response_content import ServiceErrorResponseContent +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + page: Union[Unset, float] = UNSET, + page_size: Union[Unset, float] = UNSET, + metadata_key: Union[Unset, str] = UNSET, + metadata_value: Union[Unset, str] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["page"] = page + + params["page_size"] = page_size + + params["metadata_key"] = metadata_key + + params["metadata_value"] = metadata_value + + 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": "/api/license-groups", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ClientErrorResponseContent, ListLicenseGroupsResponseContent, ServiceErrorResponseContent]]: + if response.status_code == 200: + response_200 = ListLicenseGroupsResponseContent.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = ClientErrorResponseContent.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = ClientErrorResponseContent.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = ClientErrorResponseContent.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = ClientErrorResponseContent.from_dict(response.json()) + + return response_404 + + if response.status_code == 406: + response_406 = ClientErrorResponseContent.from_dict(response.json()) + + return response_406 + + if response.status_code == 409: + response_409 = ClientErrorResponseContent.from_dict(response.json()) + + return response_409 + + if response.status_code == 422: + response_422 = ClientErrorResponseContent.from_dict(response.json()) + + return response_422 + + if response.status_code == 500: + response_500 = ServiceErrorResponseContent.from_dict(response.json()) + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ClientErrorResponseContent, ListLicenseGroupsResponseContent, ServiceErrorResponseContent]]: + 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: Union[AuthenticatedClient, Client], + page: Union[Unset, float] = UNSET, + page_size: Union[Unset, float] = UNSET, + metadata_key: Union[Unset, str] = UNSET, + metadata_value: Union[Unset, str] = UNSET, +) -> Response[Union[ClientErrorResponseContent, ListLicenseGroupsResponseContent, ServiceErrorResponseContent]]: + """ + Args: + page (Union[Unset, float]): + page_size (Union[Unset, float]): + metadata_key (Union[Unset, str]): + metadata_value (Union[Unset, 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[Union[ClientErrorResponseContent, ListLicenseGroupsResponseContent, ServiceErrorResponseContent]] + """ + + kwargs = _get_kwargs( + page=page, + page_size=page_size, + metadata_key=metadata_key, + metadata_value=metadata_value, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: Union[AuthenticatedClient, Client], + page: Union[Unset, float] = UNSET, + page_size: Union[Unset, float] = UNSET, + metadata_key: Union[Unset, str] = UNSET, + metadata_value: Union[Unset, str] = UNSET, +) -> Optional[Union[ClientErrorResponseContent, ListLicenseGroupsResponseContent, ServiceErrorResponseContent]]: + """ + Args: + page (Union[Unset, float]): + page_size (Union[Unset, float]): + metadata_key (Union[Unset, str]): + metadata_value (Union[Unset, 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: + Union[ClientErrorResponseContent, ListLicenseGroupsResponseContent, ServiceErrorResponseContent] + """ + + return sync_detailed( + client=client, + page=page, + page_size=page_size, + metadata_key=metadata_key, + metadata_value=metadata_value, + ).parsed + + +async def asyncio_detailed( + *, + client: Union[AuthenticatedClient, Client], + page: Union[Unset, float] = UNSET, + page_size: Union[Unset, float] = UNSET, + metadata_key: Union[Unset, str] = UNSET, + metadata_value: Union[Unset, str] = UNSET, +) -> Response[Union[ClientErrorResponseContent, ListLicenseGroupsResponseContent, ServiceErrorResponseContent]]: + """ + Args: + page (Union[Unset, float]): + page_size (Union[Unset, float]): + metadata_key (Union[Unset, str]): + metadata_value (Union[Unset, 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[Union[ClientErrorResponseContent, ListLicenseGroupsResponseContent, ServiceErrorResponseContent]] + """ + + kwargs = _get_kwargs( + page=page, + page_size=page_size, + metadata_key=metadata_key, + metadata_value=metadata_value, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: Union[AuthenticatedClient, Client], + page: Union[Unset, float] = UNSET, + page_size: Union[Unset, float] = UNSET, + metadata_key: Union[Unset, str] = UNSET, + metadata_value: Union[Unset, str] = UNSET, +) -> Optional[Union[ClientErrorResponseContent, ListLicenseGroupsResponseContent, ServiceErrorResponseContent]]: + """ + Args: + page (Union[Unset, float]): + page_size (Union[Unset, float]): + metadata_key (Union[Unset, str]): + metadata_value (Union[Unset, 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: + Union[ClientErrorResponseContent, ListLicenseGroupsResponseContent, ServiceErrorResponseContent] + """ + + return ( + await asyncio_detailed( + client=client, + page=page, + page_size=page_size, + metadata_key=metadata_key, + metadata_value=metadata_value, + ) + ).parsed diff --git a/griptape_cloud_client/api/license_groups/update_license_group.py b/griptape_cloud_client/api/license_groups/update_license_group.py new file mode 100644 index 0000000..69e2db4 --- /dev/null +++ b/griptape_cloud_client/api/license_groups/update_license_group.py @@ -0,0 +1,211 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.client_error_response_content import ClientErrorResponseContent +from ...models.service_error_response_content import ServiceErrorResponseContent +from ...models.update_license_group_request_content import UpdateLicenseGroupRequestContent +from ...models.update_license_group_response_content import UpdateLicenseGroupResponseContent +from ...types import Response + + +def _get_kwargs( + license_group_id: str, + *, + body: UpdateLicenseGroupRequestContent, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": f"/api/license-groups/{license_group_id}", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ClientErrorResponseContent, ServiceErrorResponseContent, UpdateLicenseGroupResponseContent]]: + if response.status_code == 200: + response_200 = UpdateLicenseGroupResponseContent.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = ClientErrorResponseContent.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = ClientErrorResponseContent.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = ClientErrorResponseContent.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = ClientErrorResponseContent.from_dict(response.json()) + + return response_404 + + if response.status_code == 406: + response_406 = ClientErrorResponseContent.from_dict(response.json()) + + return response_406 + + if response.status_code == 409: + response_409 = ClientErrorResponseContent.from_dict(response.json()) + + return response_409 + + if response.status_code == 422: + response_422 = ClientErrorResponseContent.from_dict(response.json()) + + return response_422 + + if response.status_code == 500: + response_500 = ServiceErrorResponseContent.from_dict(response.json()) + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ClientErrorResponseContent, ServiceErrorResponseContent, UpdateLicenseGroupResponseContent]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + license_group_id: str, + *, + client: Union[AuthenticatedClient, Client], + body: UpdateLicenseGroupRequestContent, +) -> Response[Union[ClientErrorResponseContent, ServiceErrorResponseContent, UpdateLicenseGroupResponseContent]]: + """ + Args: + license_group_id (str): + body (UpdateLicenseGroupRequestContent): + + 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[Union[ClientErrorResponseContent, ServiceErrorResponseContent, UpdateLicenseGroupResponseContent]] + """ + + kwargs = _get_kwargs( + license_group_id=license_group_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + license_group_id: str, + *, + client: Union[AuthenticatedClient, Client], + body: UpdateLicenseGroupRequestContent, +) -> Optional[Union[ClientErrorResponseContent, ServiceErrorResponseContent, UpdateLicenseGroupResponseContent]]: + """ + Args: + license_group_id (str): + body (UpdateLicenseGroupRequestContent): + + 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: + Union[ClientErrorResponseContent, ServiceErrorResponseContent, UpdateLicenseGroupResponseContent] + """ + + return sync_detailed( + license_group_id=license_group_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + license_group_id: str, + *, + client: Union[AuthenticatedClient, Client], + body: UpdateLicenseGroupRequestContent, +) -> Response[Union[ClientErrorResponseContent, ServiceErrorResponseContent, UpdateLicenseGroupResponseContent]]: + """ + Args: + license_group_id (str): + body (UpdateLicenseGroupRequestContent): + + 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[Union[ClientErrorResponseContent, ServiceErrorResponseContent, UpdateLicenseGroupResponseContent]] + """ + + kwargs = _get_kwargs( + license_group_id=license_group_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + license_group_id: str, + *, + client: Union[AuthenticatedClient, Client], + body: UpdateLicenseGroupRequestContent, +) -> Optional[Union[ClientErrorResponseContent, ServiceErrorResponseContent, UpdateLicenseGroupResponseContent]]: + """ + Args: + license_group_id (str): + body (UpdateLicenseGroupRequestContent): + + 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: + Union[ClientErrorResponseContent, ServiceErrorResponseContent, UpdateLicenseGroupResponseContent] + """ + + return ( + await asyncio_detailed( + license_group_id=license_group_id, + client=client, + body=body, + ) + ).parsed diff --git a/griptape_cloud_client/api/licenses/__init__.py b/griptape_cloud_client/api/licenses/__init__.py new file mode 100644 index 0000000..2d7c0b2 --- /dev/null +++ b/griptape_cloud_client/api/licenses/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/griptape_cloud_client/api/licenses/create_license.py b/griptape_cloud_client/api/licenses/create_license.py new file mode 100644 index 0000000..6484745 --- /dev/null +++ b/griptape_cloud_client/api/licenses/create_license.py @@ -0,0 +1,198 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.client_error_response_content import ClientErrorResponseContent +from ...models.create_license_request_content import CreateLicenseRequestContent +from ...models.create_license_response_content import CreateLicenseResponseContent +from ...models.service_error_response_content import ServiceErrorResponseContent +from ...types import Response + + +def _get_kwargs( + *, + body: CreateLicenseRequestContent, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/licenses", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ClientErrorResponseContent, CreateLicenseResponseContent, ServiceErrorResponseContent]]: + if response.status_code == 201: + response_201 = CreateLicenseResponseContent.from_dict(response.json()) + + return response_201 + + if response.status_code == 400: + response_400 = ClientErrorResponseContent.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = ClientErrorResponseContent.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = ClientErrorResponseContent.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = ClientErrorResponseContent.from_dict(response.json()) + + return response_404 + + if response.status_code == 406: + response_406 = ClientErrorResponseContent.from_dict(response.json()) + + return response_406 + + if response.status_code == 409: + response_409 = ClientErrorResponseContent.from_dict(response.json()) + + return response_409 + + if response.status_code == 422: + response_422 = ClientErrorResponseContent.from_dict(response.json()) + + return response_422 + + if response.status_code == 500: + response_500 = ServiceErrorResponseContent.from_dict(response.json()) + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ClientErrorResponseContent, CreateLicenseResponseContent, ServiceErrorResponseContent]]: + 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: Union[AuthenticatedClient, Client], + body: CreateLicenseRequestContent, +) -> Response[Union[ClientErrorResponseContent, CreateLicenseResponseContent, ServiceErrorResponseContent]]: + """ + Args: + body (CreateLicenseRequestContent): + + 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[Union[ClientErrorResponseContent, CreateLicenseResponseContent, ServiceErrorResponseContent]] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: Union[AuthenticatedClient, Client], + body: CreateLicenseRequestContent, +) -> Optional[Union[ClientErrorResponseContent, CreateLicenseResponseContent, ServiceErrorResponseContent]]: + """ + Args: + body (CreateLicenseRequestContent): + + 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: + Union[ClientErrorResponseContent, CreateLicenseResponseContent, ServiceErrorResponseContent] + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: Union[AuthenticatedClient, Client], + body: CreateLicenseRequestContent, +) -> Response[Union[ClientErrorResponseContent, CreateLicenseResponseContent, ServiceErrorResponseContent]]: + """ + Args: + body (CreateLicenseRequestContent): + + 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[Union[ClientErrorResponseContent, CreateLicenseResponseContent, ServiceErrorResponseContent]] + """ + + 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: Union[AuthenticatedClient, Client], + body: CreateLicenseRequestContent, +) -> Optional[Union[ClientErrorResponseContent, CreateLicenseResponseContent, ServiceErrorResponseContent]]: + """ + Args: + body (CreateLicenseRequestContent): + + 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: + Union[ClientErrorResponseContent, CreateLicenseResponseContent, ServiceErrorResponseContent] + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/griptape_cloud_client/api/licenses/delete_license.py b/griptape_cloud_client/api/licenses/delete_license.py new file mode 100644 index 0000000..6e248c1 --- /dev/null +++ b/griptape_cloud_client/api/licenses/delete_license.py @@ -0,0 +1,187 @@ +from http import HTTPStatus +from typing import Any, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.client_error_response_content import ClientErrorResponseContent +from ...models.service_error_response_content import ServiceErrorResponseContent +from ...types import Response + + +def _get_kwargs( + license_id: str, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "delete", + "url": f"/api/licenses/{license_id}", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ClientErrorResponseContent, ServiceErrorResponseContent]]: + if response.status_code == 204: + response_204 = cast(Any, None) + return response_204 + + if response.status_code == 400: + response_400 = ClientErrorResponseContent.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = ClientErrorResponseContent.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = ClientErrorResponseContent.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = ClientErrorResponseContent.from_dict(response.json()) + + return response_404 + + if response.status_code == 406: + response_406 = ClientErrorResponseContent.from_dict(response.json()) + + return response_406 + + if response.status_code == 409: + response_409 = ClientErrorResponseContent.from_dict(response.json()) + + return response_409 + + if response.status_code == 422: + response_422 = ClientErrorResponseContent.from_dict(response.json()) + + return response_422 + + if response.status_code == 500: + response_500 = ServiceErrorResponseContent.from_dict(response.json()) + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ClientErrorResponseContent, ServiceErrorResponseContent]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + license_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ClientErrorResponseContent, ServiceErrorResponseContent]]: + """ + Args: + license_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[Union[Any, ClientErrorResponseContent, ServiceErrorResponseContent]] + """ + + kwargs = _get_kwargs( + license_id=license_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + license_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ClientErrorResponseContent, ServiceErrorResponseContent]]: + """ + Args: + license_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: + Union[Any, ClientErrorResponseContent, ServiceErrorResponseContent] + """ + + return sync_detailed( + license_id=license_id, + client=client, + ).parsed + + +async def asyncio_detailed( + license_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ClientErrorResponseContent, ServiceErrorResponseContent]]: + """ + Args: + license_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[Union[Any, ClientErrorResponseContent, ServiceErrorResponseContent]] + """ + + kwargs = _get_kwargs( + license_id=license_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + license_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ClientErrorResponseContent, ServiceErrorResponseContent]]: + """ + Args: + license_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: + Union[Any, ClientErrorResponseContent, ServiceErrorResponseContent] + """ + + return ( + await asyncio_detailed( + license_id=license_id, + client=client, + ) + ).parsed diff --git a/griptape_cloud_client/api/licenses/get_license.py b/griptape_cloud_client/api/licenses/get_license.py new file mode 100644 index 0000000..d513951 --- /dev/null +++ b/griptape_cloud_client/api/licenses/get_license.py @@ -0,0 +1,189 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.client_error_response_content import ClientErrorResponseContent +from ...models.get_license_response_content import GetLicenseResponseContent +from ...models.service_error_response_content import ServiceErrorResponseContent +from ...types import Response + + +def _get_kwargs( + license_id: str, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/api/licenses/{license_id}", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ClientErrorResponseContent, GetLicenseResponseContent, ServiceErrorResponseContent]]: + if response.status_code == 200: + response_200 = GetLicenseResponseContent.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = ClientErrorResponseContent.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = ClientErrorResponseContent.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = ClientErrorResponseContent.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = ClientErrorResponseContent.from_dict(response.json()) + + return response_404 + + if response.status_code == 406: + response_406 = ClientErrorResponseContent.from_dict(response.json()) + + return response_406 + + if response.status_code == 409: + response_409 = ClientErrorResponseContent.from_dict(response.json()) + + return response_409 + + if response.status_code == 422: + response_422 = ClientErrorResponseContent.from_dict(response.json()) + + return response_422 + + if response.status_code == 500: + response_500 = ServiceErrorResponseContent.from_dict(response.json()) + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ClientErrorResponseContent, GetLicenseResponseContent, ServiceErrorResponseContent]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + license_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[ClientErrorResponseContent, GetLicenseResponseContent, ServiceErrorResponseContent]]: + """ + Args: + license_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[Union[ClientErrorResponseContent, GetLicenseResponseContent, ServiceErrorResponseContent]] + """ + + kwargs = _get_kwargs( + license_id=license_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + license_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[ClientErrorResponseContent, GetLicenseResponseContent, ServiceErrorResponseContent]]: + """ + Args: + license_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: + Union[ClientErrorResponseContent, GetLicenseResponseContent, ServiceErrorResponseContent] + """ + + return sync_detailed( + license_id=license_id, + client=client, + ).parsed + + +async def asyncio_detailed( + license_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[ClientErrorResponseContent, GetLicenseResponseContent, ServiceErrorResponseContent]]: + """ + Args: + license_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[Union[ClientErrorResponseContent, GetLicenseResponseContent, ServiceErrorResponseContent]] + """ + + kwargs = _get_kwargs( + license_id=license_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + license_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[ClientErrorResponseContent, GetLicenseResponseContent, ServiceErrorResponseContent]]: + """ + Args: + license_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: + Union[ClientErrorResponseContent, GetLicenseResponseContent, ServiceErrorResponseContent] + """ + + return ( + await asyncio_detailed( + license_id=license_id, + client=client, + ) + ).parsed diff --git a/griptape_cloud_client/api/licenses/list_licenses.py b/griptape_cloud_client/api/licenses/list_licenses.py new file mode 100644 index 0000000..0a61b84 --- /dev/null +++ b/griptape_cloud_client/api/licenses/list_licenses.py @@ -0,0 +1,277 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.client_error_response_content import ClientErrorResponseContent +from ...models.license_status import LicenseStatus +from ...models.list_licenses_response_content import ListLicensesResponseContent +from ...models.service_error_response_content import ServiceErrorResponseContent +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + page: Union[Unset, float] = UNSET, + page_size: Union[Unset, float] = UNSET, + user_id: Union[Unset, str] = UNSET, + status: Union[Unset, LicenseStatus] = UNSET, + metadata_key: Union[Unset, str] = UNSET, + metadata_value: Union[Unset, str] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["page"] = page + + params["page_size"] = page_size + + params["user_id"] = user_id + + json_status: Union[Unset, str] = UNSET + if not isinstance(status, Unset): + json_status = status.value + + params["status"] = json_status + + params["metadata_key"] = metadata_key + + params["metadata_value"] = metadata_value + + 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": "/api/licenses", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ClientErrorResponseContent, ListLicensesResponseContent, ServiceErrorResponseContent]]: + if response.status_code == 200: + response_200 = ListLicensesResponseContent.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = ClientErrorResponseContent.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = ClientErrorResponseContent.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = ClientErrorResponseContent.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = ClientErrorResponseContent.from_dict(response.json()) + + return response_404 + + if response.status_code == 406: + response_406 = ClientErrorResponseContent.from_dict(response.json()) + + return response_406 + + if response.status_code == 409: + response_409 = ClientErrorResponseContent.from_dict(response.json()) + + return response_409 + + if response.status_code == 422: + response_422 = ClientErrorResponseContent.from_dict(response.json()) + + return response_422 + + if response.status_code == 500: + response_500 = ServiceErrorResponseContent.from_dict(response.json()) + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ClientErrorResponseContent, ListLicensesResponseContent, ServiceErrorResponseContent]]: + 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: Union[AuthenticatedClient, Client], + page: Union[Unset, float] = UNSET, + page_size: Union[Unset, float] = UNSET, + user_id: Union[Unset, str] = UNSET, + status: Union[Unset, LicenseStatus] = UNSET, + metadata_key: Union[Unset, str] = UNSET, + metadata_value: Union[Unset, str] = UNSET, +) -> Response[Union[ClientErrorResponseContent, ListLicensesResponseContent, ServiceErrorResponseContent]]: + """ + Args: + page (Union[Unset, float]): + page_size (Union[Unset, float]): + user_id (Union[Unset, str]): + status (Union[Unset, LicenseStatus]): + metadata_key (Union[Unset, str]): + metadata_value (Union[Unset, 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[Union[ClientErrorResponseContent, ListLicensesResponseContent, ServiceErrorResponseContent]] + """ + + kwargs = _get_kwargs( + page=page, + page_size=page_size, + user_id=user_id, + status=status, + metadata_key=metadata_key, + metadata_value=metadata_value, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: Union[AuthenticatedClient, Client], + page: Union[Unset, float] = UNSET, + page_size: Union[Unset, float] = UNSET, + user_id: Union[Unset, str] = UNSET, + status: Union[Unset, LicenseStatus] = UNSET, + metadata_key: Union[Unset, str] = UNSET, + metadata_value: Union[Unset, str] = UNSET, +) -> Optional[Union[ClientErrorResponseContent, ListLicensesResponseContent, ServiceErrorResponseContent]]: + """ + Args: + page (Union[Unset, float]): + page_size (Union[Unset, float]): + user_id (Union[Unset, str]): + status (Union[Unset, LicenseStatus]): + metadata_key (Union[Unset, str]): + metadata_value (Union[Unset, 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: + Union[ClientErrorResponseContent, ListLicensesResponseContent, ServiceErrorResponseContent] + """ + + return sync_detailed( + client=client, + page=page, + page_size=page_size, + user_id=user_id, + status=status, + metadata_key=metadata_key, + metadata_value=metadata_value, + ).parsed + + +async def asyncio_detailed( + *, + client: Union[AuthenticatedClient, Client], + page: Union[Unset, float] = UNSET, + page_size: Union[Unset, float] = UNSET, + user_id: Union[Unset, str] = UNSET, + status: Union[Unset, LicenseStatus] = UNSET, + metadata_key: Union[Unset, str] = UNSET, + metadata_value: Union[Unset, str] = UNSET, +) -> Response[Union[ClientErrorResponseContent, ListLicensesResponseContent, ServiceErrorResponseContent]]: + """ + Args: + page (Union[Unset, float]): + page_size (Union[Unset, float]): + user_id (Union[Unset, str]): + status (Union[Unset, LicenseStatus]): + metadata_key (Union[Unset, str]): + metadata_value (Union[Unset, 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[Union[ClientErrorResponseContent, ListLicensesResponseContent, ServiceErrorResponseContent]] + """ + + kwargs = _get_kwargs( + page=page, + page_size=page_size, + user_id=user_id, + status=status, + metadata_key=metadata_key, + metadata_value=metadata_value, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: Union[AuthenticatedClient, Client], + page: Union[Unset, float] = UNSET, + page_size: Union[Unset, float] = UNSET, + user_id: Union[Unset, str] = UNSET, + status: Union[Unset, LicenseStatus] = UNSET, + metadata_key: Union[Unset, str] = UNSET, + metadata_value: Union[Unset, str] = UNSET, +) -> Optional[Union[ClientErrorResponseContent, ListLicensesResponseContent, ServiceErrorResponseContent]]: + """ + Args: + page (Union[Unset, float]): + page_size (Union[Unset, float]): + user_id (Union[Unset, str]): + status (Union[Unset, LicenseStatus]): + metadata_key (Union[Unset, str]): + metadata_value (Union[Unset, 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: + Union[ClientErrorResponseContent, ListLicensesResponseContent, ServiceErrorResponseContent] + """ + + return ( + await asyncio_detailed( + client=client, + page=page, + page_size=page_size, + user_id=user_id, + status=status, + metadata_key=metadata_key, + metadata_value=metadata_value, + ) + ).parsed diff --git a/griptape_cloud_client/api/licenses/reissue_license_token.py b/griptape_cloud_client/api/licenses/reissue_license_token.py new file mode 100644 index 0000000..887c76c --- /dev/null +++ b/griptape_cloud_client/api/licenses/reissue_license_token.py @@ -0,0 +1,211 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.client_error_response_content import ClientErrorResponseContent +from ...models.reissue_license_token_request_content import ReissueLicenseTokenRequestContent +from ...models.reissue_license_token_response_content import ReissueLicenseTokenResponseContent +from ...models.service_error_response_content import ServiceErrorResponseContent +from ...types import Response + + +def _get_kwargs( + license_id: str, + *, + body: ReissueLicenseTokenRequestContent, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": f"/api/licenses/{license_id}", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ClientErrorResponseContent, ReissueLicenseTokenResponseContent, ServiceErrorResponseContent]]: + if response.status_code == 200: + response_200 = ReissueLicenseTokenResponseContent.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = ClientErrorResponseContent.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = ClientErrorResponseContent.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = ClientErrorResponseContent.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = ClientErrorResponseContent.from_dict(response.json()) + + return response_404 + + if response.status_code == 406: + response_406 = ClientErrorResponseContent.from_dict(response.json()) + + return response_406 + + if response.status_code == 409: + response_409 = ClientErrorResponseContent.from_dict(response.json()) + + return response_409 + + if response.status_code == 422: + response_422 = ClientErrorResponseContent.from_dict(response.json()) + + return response_422 + + if response.status_code == 500: + response_500 = ServiceErrorResponseContent.from_dict(response.json()) + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ClientErrorResponseContent, ReissueLicenseTokenResponseContent, ServiceErrorResponseContent]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + license_id: str, + *, + client: Union[AuthenticatedClient, Client], + body: ReissueLicenseTokenRequestContent, +) -> Response[Union[ClientErrorResponseContent, ReissueLicenseTokenResponseContent, ServiceErrorResponseContent]]: + """ + Args: + license_id (str): + body (ReissueLicenseTokenRequestContent): + + 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[Union[ClientErrorResponseContent, ReissueLicenseTokenResponseContent, ServiceErrorResponseContent]] + """ + + kwargs = _get_kwargs( + license_id=license_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + license_id: str, + *, + client: Union[AuthenticatedClient, Client], + body: ReissueLicenseTokenRequestContent, +) -> Optional[Union[ClientErrorResponseContent, ReissueLicenseTokenResponseContent, ServiceErrorResponseContent]]: + """ + Args: + license_id (str): + body (ReissueLicenseTokenRequestContent): + + 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: + Union[ClientErrorResponseContent, ReissueLicenseTokenResponseContent, ServiceErrorResponseContent] + """ + + return sync_detailed( + license_id=license_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + license_id: str, + *, + client: Union[AuthenticatedClient, Client], + body: ReissueLicenseTokenRequestContent, +) -> Response[Union[ClientErrorResponseContent, ReissueLicenseTokenResponseContent, ServiceErrorResponseContent]]: + """ + Args: + license_id (str): + body (ReissueLicenseTokenRequestContent): + + 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[Union[ClientErrorResponseContent, ReissueLicenseTokenResponseContent, ServiceErrorResponseContent]] + """ + + kwargs = _get_kwargs( + license_id=license_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + license_id: str, + *, + client: Union[AuthenticatedClient, Client], + body: ReissueLicenseTokenRequestContent, +) -> Optional[Union[ClientErrorResponseContent, ReissueLicenseTokenResponseContent, ServiceErrorResponseContent]]: + """ + Args: + license_id (str): + body (ReissueLicenseTokenRequestContent): + + 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: + Union[ClientErrorResponseContent, ReissueLicenseTokenResponseContent, ServiceErrorResponseContent] + """ + + return ( + await asyncio_detailed( + license_id=license_id, + client=client, + body=body, + ) + ).parsed diff --git a/griptape_cloud_client/api/licenses/update_license.py b/griptape_cloud_client/api/licenses/update_license.py new file mode 100644 index 0000000..cd95fd6 --- /dev/null +++ b/griptape_cloud_client/api/licenses/update_license.py @@ -0,0 +1,211 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.client_error_response_content import ClientErrorResponseContent +from ...models.service_error_response_content import ServiceErrorResponseContent +from ...models.update_license_request_content import UpdateLicenseRequestContent +from ...models.update_license_response_content import UpdateLicenseResponseContent +from ...types import Response + + +def _get_kwargs( + license_id: str, + *, + body: UpdateLicenseRequestContent, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": f"/api/licenses/{license_id}", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ClientErrorResponseContent, ServiceErrorResponseContent, UpdateLicenseResponseContent]]: + if response.status_code == 200: + response_200 = UpdateLicenseResponseContent.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = ClientErrorResponseContent.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = ClientErrorResponseContent.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = ClientErrorResponseContent.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = ClientErrorResponseContent.from_dict(response.json()) + + return response_404 + + if response.status_code == 406: + response_406 = ClientErrorResponseContent.from_dict(response.json()) + + return response_406 + + if response.status_code == 409: + response_409 = ClientErrorResponseContent.from_dict(response.json()) + + return response_409 + + if response.status_code == 422: + response_422 = ClientErrorResponseContent.from_dict(response.json()) + + return response_422 + + if response.status_code == 500: + response_500 = ServiceErrorResponseContent.from_dict(response.json()) + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ClientErrorResponseContent, ServiceErrorResponseContent, UpdateLicenseResponseContent]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + license_id: str, + *, + client: Union[AuthenticatedClient, Client], + body: UpdateLicenseRequestContent, +) -> Response[Union[ClientErrorResponseContent, ServiceErrorResponseContent, UpdateLicenseResponseContent]]: + """ + Args: + license_id (str): + body (UpdateLicenseRequestContent): + + 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[Union[ClientErrorResponseContent, ServiceErrorResponseContent, UpdateLicenseResponseContent]] + """ + + kwargs = _get_kwargs( + license_id=license_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + license_id: str, + *, + client: Union[AuthenticatedClient, Client], + body: UpdateLicenseRequestContent, +) -> Optional[Union[ClientErrorResponseContent, ServiceErrorResponseContent, UpdateLicenseResponseContent]]: + """ + Args: + license_id (str): + body (UpdateLicenseRequestContent): + + 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: + Union[ClientErrorResponseContent, ServiceErrorResponseContent, UpdateLicenseResponseContent] + """ + + return sync_detailed( + license_id=license_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + license_id: str, + *, + client: Union[AuthenticatedClient, Client], + body: UpdateLicenseRequestContent, +) -> Response[Union[ClientErrorResponseContent, ServiceErrorResponseContent, UpdateLicenseResponseContent]]: + """ + Args: + license_id (str): + body (UpdateLicenseRequestContent): + + 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[Union[ClientErrorResponseContent, ServiceErrorResponseContent, UpdateLicenseResponseContent]] + """ + + kwargs = _get_kwargs( + license_id=license_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + license_id: str, + *, + client: Union[AuthenticatedClient, Client], + body: UpdateLicenseRequestContent, +) -> Optional[Union[ClientErrorResponseContent, ServiceErrorResponseContent, UpdateLicenseResponseContent]]: + """ + Args: + license_id (str): + body (UpdateLicenseRequestContent): + + 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: + Union[ClientErrorResponseContent, ServiceErrorResponseContent, UpdateLicenseResponseContent] + """ + + return ( + await asyncio_detailed( + license_id=license_id, + client=client, + body=body, + ) + ).parsed diff --git a/griptape_cloud_client/api/messages/create_message.py b/griptape_cloud_client/api/messages/create_message.py index ea99b6b..5b78a04 100644 --- a/griptape_cloud_client/api/messages/create_message.py +++ b/griptape_cloud_client/api/messages/create_message.py @@ -21,7 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": f"/threads/{thread_id}/messages", + "url": f"/api/threads/{thread_id}/messages", } _kwargs["json"] = body.to_dict() diff --git a/griptape_cloud_client/api/messages/delete_message.py b/griptape_cloud_client/api/messages/delete_message.py index c978a4f..9cc6403 100644 --- a/griptape_cloud_client/api/messages/delete_message.py +++ b/griptape_cloud_client/api/messages/delete_message.py @@ -15,7 +15,7 @@ def _get_kwargs( ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/messages/{message_id}", + "url": f"/api/messages/{message_id}", } return _kwargs diff --git a/griptape_cloud_client/api/messages/get_message.py b/griptape_cloud_client/api/messages/get_message.py index 41696f5..c062c78 100644 --- a/griptape_cloud_client/api/messages/get_message.py +++ b/griptape_cloud_client/api/messages/get_message.py @@ -16,7 +16,7 @@ def _get_kwargs( ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", - "url": f"/messages/{message_id}", + "url": f"/api/messages/{message_id}", } return _kwargs diff --git a/griptape_cloud_client/api/messages/list_messages.py b/griptape_cloud_client/api/messages/list_messages.py index 7e42c14..0bf5297 100644 --- a/griptape_cloud_client/api/messages/list_messages.py +++ b/griptape_cloud_client/api/messages/list_messages.py @@ -27,7 +27,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/threads/{thread_id}/messages", + "url": f"/api/threads/{thread_id}/messages", "params": params, } diff --git a/griptape_cloud_client/api/messages/update_message.py b/griptape_cloud_client/api/messages/update_message.py index cb3a6fc..a564fe4 100644 --- a/griptape_cloud_client/api/messages/update_message.py +++ b/griptape_cloud_client/api/messages/update_message.py @@ -21,7 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "patch", - "url": f"/messages/{message_id}", + "url": f"/api/messages/{message_id}", } _kwargs["json"] = body.to_dict() diff --git a/griptape_cloud_client/api/models/create_auth_config.py b/griptape_cloud_client/api/models/create_auth_config.py new file mode 100644 index 0000000..f65c665 --- /dev/null +++ b/griptape_cloud_client/api/models/create_auth_config.py @@ -0,0 +1,198 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.client_error_response_content import ClientErrorResponseContent +from ...models.create_auth_config_request_content import CreateAuthConfigRequestContent +from ...models.create_auth_config_response_content import CreateAuthConfigResponseContent +from ...models.service_error_response_content import ServiceErrorResponseContent +from ...types import Response + + +def _get_kwargs( + *, + body: CreateAuthConfigRequestContent, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/models/auth-configs", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ClientErrorResponseContent, CreateAuthConfigResponseContent, ServiceErrorResponseContent]]: + if response.status_code == 201: + response_201 = CreateAuthConfigResponseContent.from_dict(response.json()) + + return response_201 + + if response.status_code == 400: + response_400 = ClientErrorResponseContent.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = ClientErrorResponseContent.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = ClientErrorResponseContent.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = ClientErrorResponseContent.from_dict(response.json()) + + return response_404 + + if response.status_code == 406: + response_406 = ClientErrorResponseContent.from_dict(response.json()) + + return response_406 + + if response.status_code == 409: + response_409 = ClientErrorResponseContent.from_dict(response.json()) + + return response_409 + + if response.status_code == 422: + response_422 = ClientErrorResponseContent.from_dict(response.json()) + + return response_422 + + if response.status_code == 500: + response_500 = ServiceErrorResponseContent.from_dict(response.json()) + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ClientErrorResponseContent, CreateAuthConfigResponseContent, ServiceErrorResponseContent]]: + 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: Union[AuthenticatedClient, Client], + body: CreateAuthConfigRequestContent, +) -> Response[Union[ClientErrorResponseContent, CreateAuthConfigResponseContent, ServiceErrorResponseContent]]: + """ + Args: + body (CreateAuthConfigRequestContent): + + 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[Union[ClientErrorResponseContent, CreateAuthConfigResponseContent, ServiceErrorResponseContent]] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: Union[AuthenticatedClient, Client], + body: CreateAuthConfigRequestContent, +) -> Optional[Union[ClientErrorResponseContent, CreateAuthConfigResponseContent, ServiceErrorResponseContent]]: + """ + Args: + body (CreateAuthConfigRequestContent): + + 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: + Union[ClientErrorResponseContent, CreateAuthConfigResponseContent, ServiceErrorResponseContent] + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: Union[AuthenticatedClient, Client], + body: CreateAuthConfigRequestContent, +) -> Response[Union[ClientErrorResponseContent, CreateAuthConfigResponseContent, ServiceErrorResponseContent]]: + """ + Args: + body (CreateAuthConfigRequestContent): + + 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[Union[ClientErrorResponseContent, CreateAuthConfigResponseContent, ServiceErrorResponseContent]] + """ + + 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: Union[AuthenticatedClient, Client], + body: CreateAuthConfigRequestContent, +) -> Optional[Union[ClientErrorResponseContent, CreateAuthConfigResponseContent, ServiceErrorResponseContent]]: + """ + Args: + body (CreateAuthConfigRequestContent): + + 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: + Union[ClientErrorResponseContent, CreateAuthConfigResponseContent, ServiceErrorResponseContent] + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/griptape_cloud_client/api/models/create_model.py b/griptape_cloud_client/api/models/create_model.py new file mode 100644 index 0000000..056b731 --- /dev/null +++ b/griptape_cloud_client/api/models/create_model.py @@ -0,0 +1,198 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.client_error_response_content import ClientErrorResponseContent +from ...models.create_model_request_content import CreateModelRequestContent +from ...models.create_model_response_content import CreateModelResponseContent +from ...models.service_error_response_content import ServiceErrorResponseContent +from ...types import Response + + +def _get_kwargs( + *, + body: CreateModelRequestContent, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/models", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ClientErrorResponseContent, CreateModelResponseContent, ServiceErrorResponseContent]]: + if response.status_code == 201: + response_201 = CreateModelResponseContent.from_dict(response.json()) + + return response_201 + + if response.status_code == 400: + response_400 = ClientErrorResponseContent.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = ClientErrorResponseContent.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = ClientErrorResponseContent.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = ClientErrorResponseContent.from_dict(response.json()) + + return response_404 + + if response.status_code == 406: + response_406 = ClientErrorResponseContent.from_dict(response.json()) + + return response_406 + + if response.status_code == 409: + response_409 = ClientErrorResponseContent.from_dict(response.json()) + + return response_409 + + if response.status_code == 422: + response_422 = ClientErrorResponseContent.from_dict(response.json()) + + return response_422 + + if response.status_code == 500: + response_500 = ServiceErrorResponseContent.from_dict(response.json()) + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ClientErrorResponseContent, CreateModelResponseContent, ServiceErrorResponseContent]]: + 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: Union[AuthenticatedClient, Client], + body: CreateModelRequestContent, +) -> Response[Union[ClientErrorResponseContent, CreateModelResponseContent, ServiceErrorResponseContent]]: + """ + Args: + body (CreateModelRequestContent): + + 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[Union[ClientErrorResponseContent, CreateModelResponseContent, ServiceErrorResponseContent]] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: Union[AuthenticatedClient, Client], + body: CreateModelRequestContent, +) -> Optional[Union[ClientErrorResponseContent, CreateModelResponseContent, ServiceErrorResponseContent]]: + """ + Args: + body (CreateModelRequestContent): + + 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: + Union[ClientErrorResponseContent, CreateModelResponseContent, ServiceErrorResponseContent] + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: Union[AuthenticatedClient, Client], + body: CreateModelRequestContent, +) -> Response[Union[ClientErrorResponseContent, CreateModelResponseContent, ServiceErrorResponseContent]]: + """ + Args: + body (CreateModelRequestContent): + + 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[Union[ClientErrorResponseContent, CreateModelResponseContent, ServiceErrorResponseContent]] + """ + + 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: Union[AuthenticatedClient, Client], + body: CreateModelRequestContent, +) -> Optional[Union[ClientErrorResponseContent, CreateModelResponseContent, ServiceErrorResponseContent]]: + """ + Args: + body (CreateModelRequestContent): + + 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: + Union[ClientErrorResponseContent, CreateModelResponseContent, ServiceErrorResponseContent] + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/griptape_cloud_client/api/models/delete_auth_config.py b/griptape_cloud_client/api/models/delete_auth_config.py new file mode 100644 index 0000000..e6d9447 --- /dev/null +++ b/griptape_cloud_client/api/models/delete_auth_config.py @@ -0,0 +1,187 @@ +from http import HTTPStatus +from typing import Any, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.client_error_response_content import ClientErrorResponseContent +from ...models.service_error_response_content import ServiceErrorResponseContent +from ...types import Response + + +def _get_kwargs( + auth_config_id: str, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "delete", + "url": f"/api/models/auth-configs/{auth_config_id}", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ClientErrorResponseContent, ServiceErrorResponseContent]]: + if response.status_code == 204: + response_204 = cast(Any, None) + return response_204 + + if response.status_code == 400: + response_400 = ClientErrorResponseContent.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = ClientErrorResponseContent.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = ClientErrorResponseContent.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = ClientErrorResponseContent.from_dict(response.json()) + + return response_404 + + if response.status_code == 406: + response_406 = ClientErrorResponseContent.from_dict(response.json()) + + return response_406 + + if response.status_code == 409: + response_409 = ClientErrorResponseContent.from_dict(response.json()) + + return response_409 + + if response.status_code == 422: + response_422 = ClientErrorResponseContent.from_dict(response.json()) + + return response_422 + + if response.status_code == 500: + response_500 = ServiceErrorResponseContent.from_dict(response.json()) + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ClientErrorResponseContent, ServiceErrorResponseContent]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + auth_config_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ClientErrorResponseContent, ServiceErrorResponseContent]]: + """ + Args: + auth_config_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[Union[Any, ClientErrorResponseContent, ServiceErrorResponseContent]] + """ + + kwargs = _get_kwargs( + auth_config_id=auth_config_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + auth_config_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ClientErrorResponseContent, ServiceErrorResponseContent]]: + """ + Args: + auth_config_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: + Union[Any, ClientErrorResponseContent, ServiceErrorResponseContent] + """ + + return sync_detailed( + auth_config_id=auth_config_id, + client=client, + ).parsed + + +async def asyncio_detailed( + auth_config_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ClientErrorResponseContent, ServiceErrorResponseContent]]: + """ + Args: + auth_config_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[Union[Any, ClientErrorResponseContent, ServiceErrorResponseContent]] + """ + + kwargs = _get_kwargs( + auth_config_id=auth_config_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + auth_config_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ClientErrorResponseContent, ServiceErrorResponseContent]]: + """ + Args: + auth_config_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: + Union[Any, ClientErrorResponseContent, ServiceErrorResponseContent] + """ + + return ( + await asyncio_detailed( + auth_config_id=auth_config_id, + client=client, + ) + ).parsed diff --git a/griptape_cloud_client/api/models/delete_model.py b/griptape_cloud_client/api/models/delete_model.py new file mode 100644 index 0000000..5fe1853 --- /dev/null +++ b/griptape_cloud_client/api/models/delete_model.py @@ -0,0 +1,187 @@ +from http import HTTPStatus +from typing import Any, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.client_error_response_content import ClientErrorResponseContent +from ...models.service_error_response_content import ServiceErrorResponseContent +from ...types import Response + + +def _get_kwargs( + model_config_id: str, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "delete", + "url": f"/api/models/{model_config_id}", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ClientErrorResponseContent, ServiceErrorResponseContent]]: + if response.status_code == 204: + response_204 = cast(Any, None) + return response_204 + + if response.status_code == 400: + response_400 = ClientErrorResponseContent.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = ClientErrorResponseContent.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = ClientErrorResponseContent.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = ClientErrorResponseContent.from_dict(response.json()) + + return response_404 + + if response.status_code == 406: + response_406 = ClientErrorResponseContent.from_dict(response.json()) + + return response_406 + + if response.status_code == 409: + response_409 = ClientErrorResponseContent.from_dict(response.json()) + + return response_409 + + if response.status_code == 422: + response_422 = ClientErrorResponseContent.from_dict(response.json()) + + return response_422 + + if response.status_code == 500: + response_500 = ServiceErrorResponseContent.from_dict(response.json()) + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ClientErrorResponseContent, ServiceErrorResponseContent]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + model_config_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ClientErrorResponseContent, ServiceErrorResponseContent]]: + """ + Args: + model_config_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[Union[Any, ClientErrorResponseContent, ServiceErrorResponseContent]] + """ + + kwargs = _get_kwargs( + model_config_id=model_config_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + model_config_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ClientErrorResponseContent, ServiceErrorResponseContent]]: + """ + Args: + model_config_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: + Union[Any, ClientErrorResponseContent, ServiceErrorResponseContent] + """ + + return sync_detailed( + model_config_id=model_config_id, + client=client, + ).parsed + + +async def asyncio_detailed( + model_config_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ClientErrorResponseContent, ServiceErrorResponseContent]]: + """ + Args: + model_config_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[Union[Any, ClientErrorResponseContent, ServiceErrorResponseContent]] + """ + + kwargs = _get_kwargs( + model_config_id=model_config_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + model_config_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ClientErrorResponseContent, ServiceErrorResponseContent]]: + """ + Args: + model_config_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: + Union[Any, ClientErrorResponseContent, ServiceErrorResponseContent] + """ + + return ( + await asyncio_detailed( + model_config_id=model_config_id, + client=client, + ) + ).parsed diff --git a/griptape_cloud_client/api/models/get_auth_config.py b/griptape_cloud_client/api/models/get_auth_config.py new file mode 100644 index 0000000..c9a8d2b --- /dev/null +++ b/griptape_cloud_client/api/models/get_auth_config.py @@ -0,0 +1,189 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.client_error_response_content import ClientErrorResponseContent +from ...models.get_auth_config_response_content import GetAuthConfigResponseContent +from ...models.service_error_response_content import ServiceErrorResponseContent +from ...types import Response + + +def _get_kwargs( + auth_config_id: str, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/api/models/auth-configs/{auth_config_id}", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ClientErrorResponseContent, GetAuthConfigResponseContent, ServiceErrorResponseContent]]: + if response.status_code == 200: + response_200 = GetAuthConfigResponseContent.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = ClientErrorResponseContent.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = ClientErrorResponseContent.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = ClientErrorResponseContent.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = ClientErrorResponseContent.from_dict(response.json()) + + return response_404 + + if response.status_code == 406: + response_406 = ClientErrorResponseContent.from_dict(response.json()) + + return response_406 + + if response.status_code == 409: + response_409 = ClientErrorResponseContent.from_dict(response.json()) + + return response_409 + + if response.status_code == 422: + response_422 = ClientErrorResponseContent.from_dict(response.json()) + + return response_422 + + if response.status_code == 500: + response_500 = ServiceErrorResponseContent.from_dict(response.json()) + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ClientErrorResponseContent, GetAuthConfigResponseContent, ServiceErrorResponseContent]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + auth_config_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[ClientErrorResponseContent, GetAuthConfigResponseContent, ServiceErrorResponseContent]]: + """ + Args: + auth_config_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[Union[ClientErrorResponseContent, GetAuthConfigResponseContent, ServiceErrorResponseContent]] + """ + + kwargs = _get_kwargs( + auth_config_id=auth_config_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + auth_config_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[ClientErrorResponseContent, GetAuthConfigResponseContent, ServiceErrorResponseContent]]: + """ + Args: + auth_config_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: + Union[ClientErrorResponseContent, GetAuthConfigResponseContent, ServiceErrorResponseContent] + """ + + return sync_detailed( + auth_config_id=auth_config_id, + client=client, + ).parsed + + +async def asyncio_detailed( + auth_config_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[ClientErrorResponseContent, GetAuthConfigResponseContent, ServiceErrorResponseContent]]: + """ + Args: + auth_config_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[Union[ClientErrorResponseContent, GetAuthConfigResponseContent, ServiceErrorResponseContent]] + """ + + kwargs = _get_kwargs( + auth_config_id=auth_config_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + auth_config_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[ClientErrorResponseContent, GetAuthConfigResponseContent, ServiceErrorResponseContent]]: + """ + Args: + auth_config_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: + Union[ClientErrorResponseContent, GetAuthConfigResponseContent, ServiceErrorResponseContent] + """ + + return ( + await asyncio_detailed( + auth_config_id=auth_config_id, + client=client, + ) + ).parsed diff --git a/griptape_cloud_client/api/models/get_model.py b/griptape_cloud_client/api/models/get_model.py new file mode 100644 index 0000000..8b8627a --- /dev/null +++ b/griptape_cloud_client/api/models/get_model.py @@ -0,0 +1,189 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.client_error_response_content import ClientErrorResponseContent +from ...models.get_model_response_content import GetModelResponseContent +from ...models.service_error_response_content import ServiceErrorResponseContent +from ...types import Response + + +def _get_kwargs( + model_config_id: str, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/api/models/{model_config_id}", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ClientErrorResponseContent, GetModelResponseContent, ServiceErrorResponseContent]]: + if response.status_code == 200: + response_200 = GetModelResponseContent.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = ClientErrorResponseContent.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = ClientErrorResponseContent.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = ClientErrorResponseContent.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = ClientErrorResponseContent.from_dict(response.json()) + + return response_404 + + if response.status_code == 406: + response_406 = ClientErrorResponseContent.from_dict(response.json()) + + return response_406 + + if response.status_code == 409: + response_409 = ClientErrorResponseContent.from_dict(response.json()) + + return response_409 + + if response.status_code == 422: + response_422 = ClientErrorResponseContent.from_dict(response.json()) + + return response_422 + + if response.status_code == 500: + response_500 = ServiceErrorResponseContent.from_dict(response.json()) + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ClientErrorResponseContent, GetModelResponseContent, ServiceErrorResponseContent]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + model_config_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[ClientErrorResponseContent, GetModelResponseContent, ServiceErrorResponseContent]]: + """ + Args: + model_config_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[Union[ClientErrorResponseContent, GetModelResponseContent, ServiceErrorResponseContent]] + """ + + kwargs = _get_kwargs( + model_config_id=model_config_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + model_config_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[ClientErrorResponseContent, GetModelResponseContent, ServiceErrorResponseContent]]: + """ + Args: + model_config_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: + Union[ClientErrorResponseContent, GetModelResponseContent, ServiceErrorResponseContent] + """ + + return sync_detailed( + model_config_id=model_config_id, + client=client, + ).parsed + + +async def asyncio_detailed( + model_config_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[ClientErrorResponseContent, GetModelResponseContent, ServiceErrorResponseContent]]: + """ + Args: + model_config_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[Union[ClientErrorResponseContent, GetModelResponseContent, ServiceErrorResponseContent]] + """ + + kwargs = _get_kwargs( + model_config_id=model_config_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + model_config_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[ClientErrorResponseContent, GetModelResponseContent, ServiceErrorResponseContent]]: + """ + Args: + model_config_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: + Union[ClientErrorResponseContent, GetModelResponseContent, ServiceErrorResponseContent] + """ + + return ( + await asyncio_detailed( + model_config_id=model_config_id, + client=client, + ) + ).parsed diff --git a/griptape_cloud_client/api/models/list_auth_configs.py b/griptape_cloud_client/api/models/list_auth_configs.py new file mode 100644 index 0000000..782be6a --- /dev/null +++ b/griptape_cloud_client/api/models/list_auth_configs.py @@ -0,0 +1,212 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.client_error_response_content import ClientErrorResponseContent +from ...models.list_auth_configs_response_content import ListAuthConfigsResponseContent +from ...models.service_error_response_content import ServiceErrorResponseContent +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + page: Union[Unset, float] = UNSET, + page_size: Union[Unset, float] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["page"] = page + + params["page_size"] = page_size + + 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": "/api/models/auth-configs", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ClientErrorResponseContent, ListAuthConfigsResponseContent, ServiceErrorResponseContent]]: + if response.status_code == 200: + response_200 = ListAuthConfigsResponseContent.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = ClientErrorResponseContent.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = ClientErrorResponseContent.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = ClientErrorResponseContent.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = ClientErrorResponseContent.from_dict(response.json()) + + return response_404 + + if response.status_code == 406: + response_406 = ClientErrorResponseContent.from_dict(response.json()) + + return response_406 + + if response.status_code == 409: + response_409 = ClientErrorResponseContent.from_dict(response.json()) + + return response_409 + + if response.status_code == 422: + response_422 = ClientErrorResponseContent.from_dict(response.json()) + + return response_422 + + if response.status_code == 500: + response_500 = ServiceErrorResponseContent.from_dict(response.json()) + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ClientErrorResponseContent, ListAuthConfigsResponseContent, ServiceErrorResponseContent]]: + 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: Union[AuthenticatedClient, Client], + page: Union[Unset, float] = UNSET, + page_size: Union[Unset, float] = UNSET, +) -> Response[Union[ClientErrorResponseContent, ListAuthConfigsResponseContent, ServiceErrorResponseContent]]: + """ + Args: + page (Union[Unset, float]): + page_size (Union[Unset, float]): + + 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[Union[ClientErrorResponseContent, ListAuthConfigsResponseContent, ServiceErrorResponseContent]] + """ + + kwargs = _get_kwargs( + page=page, + page_size=page_size, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: Union[AuthenticatedClient, Client], + page: Union[Unset, float] = UNSET, + page_size: Union[Unset, float] = UNSET, +) -> Optional[Union[ClientErrorResponseContent, ListAuthConfigsResponseContent, ServiceErrorResponseContent]]: + """ + Args: + page (Union[Unset, float]): + page_size (Union[Unset, float]): + + 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: + Union[ClientErrorResponseContent, ListAuthConfigsResponseContent, ServiceErrorResponseContent] + """ + + return sync_detailed( + client=client, + page=page, + page_size=page_size, + ).parsed + + +async def asyncio_detailed( + *, + client: Union[AuthenticatedClient, Client], + page: Union[Unset, float] = UNSET, + page_size: Union[Unset, float] = UNSET, +) -> Response[Union[ClientErrorResponseContent, ListAuthConfigsResponseContent, ServiceErrorResponseContent]]: + """ + Args: + page (Union[Unset, float]): + page_size (Union[Unset, float]): + + 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[Union[ClientErrorResponseContent, ListAuthConfigsResponseContent, ServiceErrorResponseContent]] + """ + + kwargs = _get_kwargs( + page=page, + page_size=page_size, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: Union[AuthenticatedClient, Client], + page: Union[Unset, float] = UNSET, + page_size: Union[Unset, float] = UNSET, +) -> Optional[Union[ClientErrorResponseContent, ListAuthConfigsResponseContent, ServiceErrorResponseContent]]: + """ + Args: + page (Union[Unset, float]): + page_size (Union[Unset, float]): + + 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: + Union[ClientErrorResponseContent, ListAuthConfigsResponseContent, ServiceErrorResponseContent] + """ + + return ( + await asyncio_detailed( + client=client, + page=page, + page_size=page_size, + ) + ).parsed diff --git a/griptape_cloud_client/api/models/list_models.py b/griptape_cloud_client/api/models/list_models.py index f8af81b..d38ec34 100644 --- a/griptape_cloud_client/api/models/list_models.py +++ b/griptape_cloud_client/api/models/list_models.py @@ -32,7 +32,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/models", + "url": "/api/models", "params": params, } diff --git a/griptape_cloud_client/api/models/update_auth_config.py b/griptape_cloud_client/api/models/update_auth_config.py new file mode 100644 index 0000000..5111ee1 --- /dev/null +++ b/griptape_cloud_client/api/models/update_auth_config.py @@ -0,0 +1,211 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.client_error_response_content import ClientErrorResponseContent +from ...models.service_error_response_content import ServiceErrorResponseContent +from ...models.update_auth_config_request_content import UpdateAuthConfigRequestContent +from ...models.update_auth_config_response_content import UpdateAuthConfigResponseContent +from ...types import Response + + +def _get_kwargs( + auth_config_id: str, + *, + body: UpdateAuthConfigRequestContent, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": f"/api/models/auth-configs/{auth_config_id}", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ClientErrorResponseContent, ServiceErrorResponseContent, UpdateAuthConfigResponseContent]]: + if response.status_code == 200: + response_200 = UpdateAuthConfigResponseContent.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = ClientErrorResponseContent.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = ClientErrorResponseContent.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = ClientErrorResponseContent.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = ClientErrorResponseContent.from_dict(response.json()) + + return response_404 + + if response.status_code == 406: + response_406 = ClientErrorResponseContent.from_dict(response.json()) + + return response_406 + + if response.status_code == 409: + response_409 = ClientErrorResponseContent.from_dict(response.json()) + + return response_409 + + if response.status_code == 422: + response_422 = ClientErrorResponseContent.from_dict(response.json()) + + return response_422 + + if response.status_code == 500: + response_500 = ServiceErrorResponseContent.from_dict(response.json()) + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ClientErrorResponseContent, ServiceErrorResponseContent, UpdateAuthConfigResponseContent]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + auth_config_id: str, + *, + client: Union[AuthenticatedClient, Client], + body: UpdateAuthConfigRequestContent, +) -> Response[Union[ClientErrorResponseContent, ServiceErrorResponseContent, UpdateAuthConfigResponseContent]]: + """ + Args: + auth_config_id (str): + body (UpdateAuthConfigRequestContent): + + 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[Union[ClientErrorResponseContent, ServiceErrorResponseContent, UpdateAuthConfigResponseContent]] + """ + + kwargs = _get_kwargs( + auth_config_id=auth_config_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + auth_config_id: str, + *, + client: Union[AuthenticatedClient, Client], + body: UpdateAuthConfigRequestContent, +) -> Optional[Union[ClientErrorResponseContent, ServiceErrorResponseContent, UpdateAuthConfigResponseContent]]: + """ + Args: + auth_config_id (str): + body (UpdateAuthConfigRequestContent): + + 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: + Union[ClientErrorResponseContent, ServiceErrorResponseContent, UpdateAuthConfigResponseContent] + """ + + return sync_detailed( + auth_config_id=auth_config_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + auth_config_id: str, + *, + client: Union[AuthenticatedClient, Client], + body: UpdateAuthConfigRequestContent, +) -> Response[Union[ClientErrorResponseContent, ServiceErrorResponseContent, UpdateAuthConfigResponseContent]]: + """ + Args: + auth_config_id (str): + body (UpdateAuthConfigRequestContent): + + 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[Union[ClientErrorResponseContent, ServiceErrorResponseContent, UpdateAuthConfigResponseContent]] + """ + + kwargs = _get_kwargs( + auth_config_id=auth_config_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + auth_config_id: str, + *, + client: Union[AuthenticatedClient, Client], + body: UpdateAuthConfigRequestContent, +) -> Optional[Union[ClientErrorResponseContent, ServiceErrorResponseContent, UpdateAuthConfigResponseContent]]: + """ + Args: + auth_config_id (str): + body (UpdateAuthConfigRequestContent): + + 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: + Union[ClientErrorResponseContent, ServiceErrorResponseContent, UpdateAuthConfigResponseContent] + """ + + return ( + await asyncio_detailed( + auth_config_id=auth_config_id, + client=client, + body=body, + ) + ).parsed diff --git a/griptape_cloud_client/api/models/update_model.py b/griptape_cloud_client/api/models/update_model.py new file mode 100644 index 0000000..fc7eb88 --- /dev/null +++ b/griptape_cloud_client/api/models/update_model.py @@ -0,0 +1,211 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.client_error_response_content import ClientErrorResponseContent +from ...models.service_error_response_content import ServiceErrorResponseContent +from ...models.update_model_request_content import UpdateModelRequestContent +from ...models.update_model_response_content import UpdateModelResponseContent +from ...types import Response + + +def _get_kwargs( + model_config_id: str, + *, + body: UpdateModelRequestContent, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": f"/api/models/{model_config_id}", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ClientErrorResponseContent, ServiceErrorResponseContent, UpdateModelResponseContent]]: + if response.status_code == 200: + response_200 = UpdateModelResponseContent.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = ClientErrorResponseContent.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = ClientErrorResponseContent.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = ClientErrorResponseContent.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = ClientErrorResponseContent.from_dict(response.json()) + + return response_404 + + if response.status_code == 406: + response_406 = ClientErrorResponseContent.from_dict(response.json()) + + return response_406 + + if response.status_code == 409: + response_409 = ClientErrorResponseContent.from_dict(response.json()) + + return response_409 + + if response.status_code == 422: + response_422 = ClientErrorResponseContent.from_dict(response.json()) + + return response_422 + + if response.status_code == 500: + response_500 = ServiceErrorResponseContent.from_dict(response.json()) + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ClientErrorResponseContent, ServiceErrorResponseContent, UpdateModelResponseContent]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + model_config_id: str, + *, + client: Union[AuthenticatedClient, Client], + body: UpdateModelRequestContent, +) -> Response[Union[ClientErrorResponseContent, ServiceErrorResponseContent, UpdateModelResponseContent]]: + """ + Args: + model_config_id (str): + body (UpdateModelRequestContent): + + 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[Union[ClientErrorResponseContent, ServiceErrorResponseContent, UpdateModelResponseContent]] + """ + + kwargs = _get_kwargs( + model_config_id=model_config_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + model_config_id: str, + *, + client: Union[AuthenticatedClient, Client], + body: UpdateModelRequestContent, +) -> Optional[Union[ClientErrorResponseContent, ServiceErrorResponseContent, UpdateModelResponseContent]]: + """ + Args: + model_config_id (str): + body (UpdateModelRequestContent): + + 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: + Union[ClientErrorResponseContent, ServiceErrorResponseContent, UpdateModelResponseContent] + """ + + return sync_detailed( + model_config_id=model_config_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + model_config_id: str, + *, + client: Union[AuthenticatedClient, Client], + body: UpdateModelRequestContent, +) -> Response[Union[ClientErrorResponseContent, ServiceErrorResponseContent, UpdateModelResponseContent]]: + """ + Args: + model_config_id (str): + body (UpdateModelRequestContent): + + 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[Union[ClientErrorResponseContent, ServiceErrorResponseContent, UpdateModelResponseContent]] + """ + + kwargs = _get_kwargs( + model_config_id=model_config_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + model_config_id: str, + *, + client: Union[AuthenticatedClient, Client], + body: UpdateModelRequestContent, +) -> Optional[Union[ClientErrorResponseContent, ServiceErrorResponseContent, UpdateModelResponseContent]]: + """ + Args: + model_config_id (str): + body (UpdateModelRequestContent): + + 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: + Union[ClientErrorResponseContent, ServiceErrorResponseContent, UpdateModelResponseContent] + """ + + return ( + await asyncio_detailed( + model_config_id=model_config_id, + client=client, + body=body, + ) + ).parsed diff --git a/griptape_cloud_client/api/organizations/create_organization.py b/griptape_cloud_client/api/organizations/create_organization.py index 753dfcf..269d647 100644 --- a/griptape_cloud_client/api/organizations/create_organization.py +++ b/griptape_cloud_client/api/organizations/create_organization.py @@ -7,6 +7,7 @@ from ...client import AuthenticatedClient, Client from ...models.client_error_response_content import ClientErrorResponseContent from ...models.create_organization_request_content import CreateOrganizationRequestContent +from ...models.create_organization_response_content import CreateOrganizationResponseContent from ...models.service_error_response_content import ServiceErrorResponseContent from ...types import Response @@ -19,7 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/organizations", + "url": "/api/organizations", } _kwargs["json"] = body.to_dict() @@ -32,7 +33,12 @@ def _get_kwargs( def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ClientErrorResponseContent, ServiceErrorResponseContent]]: +) -> Optional[Union[ClientErrorResponseContent, CreateOrganizationResponseContent, ServiceErrorResponseContent]]: + if response.status_code == 201: + response_201 = CreateOrganizationResponseContent.from_dict(response.json()) + + return response_201 + if response.status_code == 400: response_400 = ClientErrorResponseContent.from_dict(response.json()) @@ -81,7 +87,7 @@ def _parse_response( def _build_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ClientErrorResponseContent, ServiceErrorResponseContent]]: +) -> Response[Union[ClientErrorResponseContent, CreateOrganizationResponseContent, ServiceErrorResponseContent]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -94,7 +100,7 @@ def sync_detailed( *, client: Union[AuthenticatedClient, Client], body: CreateOrganizationRequestContent, -) -> Response[Union[ClientErrorResponseContent, ServiceErrorResponseContent]]: +) -> Response[Union[ClientErrorResponseContent, CreateOrganizationResponseContent, ServiceErrorResponseContent]]: """ Args: body (CreateOrganizationRequestContent): @@ -104,7 +110,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ClientErrorResponseContent, ServiceErrorResponseContent]] + Response[Union[ClientErrorResponseContent, CreateOrganizationResponseContent, ServiceErrorResponseContent]] """ kwargs = _get_kwargs( @@ -122,7 +128,7 @@ def sync( *, client: Union[AuthenticatedClient, Client], body: CreateOrganizationRequestContent, -) -> Optional[Union[ClientErrorResponseContent, ServiceErrorResponseContent]]: +) -> Optional[Union[ClientErrorResponseContent, CreateOrganizationResponseContent, ServiceErrorResponseContent]]: """ Args: body (CreateOrganizationRequestContent): @@ -132,7 +138,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ClientErrorResponseContent, ServiceErrorResponseContent] + Union[ClientErrorResponseContent, CreateOrganizationResponseContent, ServiceErrorResponseContent] """ return sync_detailed( @@ -145,7 +151,7 @@ async def asyncio_detailed( *, client: Union[AuthenticatedClient, Client], body: CreateOrganizationRequestContent, -) -> Response[Union[ClientErrorResponseContent, ServiceErrorResponseContent]]: +) -> Response[Union[ClientErrorResponseContent, CreateOrganizationResponseContent, ServiceErrorResponseContent]]: """ Args: body (CreateOrganizationRequestContent): @@ -155,7 +161,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ClientErrorResponseContent, ServiceErrorResponseContent]] + Response[Union[ClientErrorResponseContent, CreateOrganizationResponseContent, ServiceErrorResponseContent]] """ kwargs = _get_kwargs( @@ -171,7 +177,7 @@ async def asyncio( *, client: Union[AuthenticatedClient, Client], body: CreateOrganizationRequestContent, -) -> Optional[Union[ClientErrorResponseContent, ServiceErrorResponseContent]]: +) -> Optional[Union[ClientErrorResponseContent, CreateOrganizationResponseContent, ServiceErrorResponseContent]]: """ Args: body (CreateOrganizationRequestContent): @@ -181,7 +187,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ClientErrorResponseContent, ServiceErrorResponseContent] + Union[ClientErrorResponseContent, CreateOrganizationResponseContent, ServiceErrorResponseContent] """ return ( diff --git a/griptape_cloud_client/api/organizations/delete_organization.py b/griptape_cloud_client/api/organizations/delete_organization.py index 6571413..6a2eef0 100644 --- a/griptape_cloud_client/api/organizations/delete_organization.py +++ b/griptape_cloud_client/api/organizations/delete_organization.py @@ -15,7 +15,7 @@ def _get_kwargs( ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/organizations/{organization_id}", + "url": f"/api/organizations/{organization_id}", } return _kwargs diff --git a/griptape_cloud_client/api/organizations/delete_organization_user.py b/griptape_cloud_client/api/organizations/delete_organization_user.py index ea5a3bd..c816d49 100644 --- a/griptape_cloud_client/api/organizations/delete_organization_user.py +++ b/griptape_cloud_client/api/organizations/delete_organization_user.py @@ -16,7 +16,7 @@ def _get_kwargs( ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/organizations/{organization_id}/users/{user_id}", + "url": f"/api/organizations/{organization_id}/users/{user_id}", } return _kwargs diff --git a/griptape_cloud_client/api/organizations/get_organization.py b/griptape_cloud_client/api/organizations/get_organization.py index 6ff5174..49aad4c 100644 --- a/griptape_cloud_client/api/organizations/get_organization.py +++ b/griptape_cloud_client/api/organizations/get_organization.py @@ -6,6 +6,7 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.client_error_response_content import ClientErrorResponseContent +from ...models.get_organization_response_content import GetOrganizationResponseContent from ...models.service_error_response_content import ServiceErrorResponseContent from ...types import Response @@ -15,7 +16,7 @@ def _get_kwargs( ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", - "url": f"/organizations/{organization_id}", + "url": f"/api/organizations/{organization_id}", } return _kwargs @@ -23,7 +24,12 @@ def _get_kwargs( def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ClientErrorResponseContent, ServiceErrorResponseContent]]: +) -> Optional[Union[ClientErrorResponseContent, GetOrganizationResponseContent, ServiceErrorResponseContent]]: + if response.status_code == 200: + response_200 = GetOrganizationResponseContent.from_dict(response.json()) + + return response_200 + if response.status_code == 400: response_400 = ClientErrorResponseContent.from_dict(response.json()) @@ -72,7 +78,7 @@ def _parse_response( def _build_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ClientErrorResponseContent, ServiceErrorResponseContent]]: +) -> Response[Union[ClientErrorResponseContent, GetOrganizationResponseContent, ServiceErrorResponseContent]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -85,7 +91,7 @@ def sync_detailed( organization_id: str, *, client: Union[AuthenticatedClient, Client], -) -> Response[Union[ClientErrorResponseContent, ServiceErrorResponseContent]]: +) -> Response[Union[ClientErrorResponseContent, GetOrganizationResponseContent, ServiceErrorResponseContent]]: """ Args: organization_id (str): @@ -95,7 +101,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ClientErrorResponseContent, ServiceErrorResponseContent]] + Response[Union[ClientErrorResponseContent, GetOrganizationResponseContent, ServiceErrorResponseContent]] """ kwargs = _get_kwargs( @@ -113,7 +119,7 @@ def sync( organization_id: str, *, client: Union[AuthenticatedClient, Client], -) -> Optional[Union[ClientErrorResponseContent, ServiceErrorResponseContent]]: +) -> Optional[Union[ClientErrorResponseContent, GetOrganizationResponseContent, ServiceErrorResponseContent]]: """ Args: organization_id (str): @@ -123,7 +129,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ClientErrorResponseContent, ServiceErrorResponseContent] + Union[ClientErrorResponseContent, GetOrganizationResponseContent, ServiceErrorResponseContent] """ return sync_detailed( @@ -136,7 +142,7 @@ async def asyncio_detailed( organization_id: str, *, client: Union[AuthenticatedClient, Client], -) -> Response[Union[ClientErrorResponseContent, ServiceErrorResponseContent]]: +) -> Response[Union[ClientErrorResponseContent, GetOrganizationResponseContent, ServiceErrorResponseContent]]: """ Args: organization_id (str): @@ -146,7 +152,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ClientErrorResponseContent, ServiceErrorResponseContent]] + Response[Union[ClientErrorResponseContent, GetOrganizationResponseContent, ServiceErrorResponseContent]] """ kwargs = _get_kwargs( @@ -162,7 +168,7 @@ async def asyncio( organization_id: str, *, client: Union[AuthenticatedClient, Client], -) -> Optional[Union[ClientErrorResponseContent, ServiceErrorResponseContent]]: +) -> Optional[Union[ClientErrorResponseContent, GetOrganizationResponseContent, ServiceErrorResponseContent]]: """ Args: organization_id (str): @@ -172,7 +178,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ClientErrorResponseContent, ServiceErrorResponseContent] + Union[ClientErrorResponseContent, GetOrganizationResponseContent, ServiceErrorResponseContent] """ return ( diff --git a/griptape_cloud_client/api/organizations/list_organization_users.py b/griptape_cloud_client/api/organizations/list_organization_users.py index 6daa179..8826d4a 100644 --- a/griptape_cloud_client/api/organizations/list_organization_users.py +++ b/griptape_cloud_client/api/organizations/list_organization_users.py @@ -27,7 +27,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/organizations/{organization_id}/users", + "url": f"/api/organizations/{organization_id}/users", "params": params, } diff --git a/griptape_cloud_client/api/organizations/list_organizations.py b/griptape_cloud_client/api/organizations/list_organizations.py index 4216766..a077728 100644 --- a/griptape_cloud_client/api/organizations/list_organizations.py +++ b/griptape_cloud_client/api/organizations/list_organizations.py @@ -6,6 +6,7 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.client_error_response_content import ClientErrorResponseContent +from ...models.list_organizations_response_content import ListOrganizationsResponseContent from ...models.service_error_response_content import ServiceErrorResponseContent from ...types import Response @@ -13,7 +14,7 @@ def _get_kwargs() -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", - "url": "/organizations", + "url": "/api/organizations", } return _kwargs @@ -21,7 +22,12 @@ def _get_kwargs() -> dict[str, Any]: def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ClientErrorResponseContent, ServiceErrorResponseContent]]: +) -> Optional[Union[ClientErrorResponseContent, ListOrganizationsResponseContent, ServiceErrorResponseContent]]: + if response.status_code == 200: + response_200 = ListOrganizationsResponseContent.from_dict(response.json()) + + return response_200 + if response.status_code == 400: response_400 = ClientErrorResponseContent.from_dict(response.json()) @@ -70,7 +76,7 @@ def _parse_response( def _build_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ClientErrorResponseContent, ServiceErrorResponseContent]]: +) -> Response[Union[ClientErrorResponseContent, ListOrganizationsResponseContent, ServiceErrorResponseContent]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -82,14 +88,14 @@ def _build_response( def sync_detailed( *, client: Union[AuthenticatedClient, Client], -) -> Response[Union[ClientErrorResponseContent, ServiceErrorResponseContent]]: +) -> Response[Union[ClientErrorResponseContent, ListOrganizationsResponseContent, ServiceErrorResponseContent]]: """ 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[Union[ClientErrorResponseContent, ServiceErrorResponseContent]] + Response[Union[ClientErrorResponseContent, ListOrganizationsResponseContent, ServiceErrorResponseContent]] """ kwargs = _get_kwargs() @@ -104,14 +110,14 @@ def sync_detailed( def sync( *, client: Union[AuthenticatedClient, Client], -) -> Optional[Union[ClientErrorResponseContent, ServiceErrorResponseContent]]: +) -> Optional[Union[ClientErrorResponseContent, ListOrganizationsResponseContent, ServiceErrorResponseContent]]: """ 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: - Union[ClientErrorResponseContent, ServiceErrorResponseContent] + Union[ClientErrorResponseContent, ListOrganizationsResponseContent, ServiceErrorResponseContent] """ return sync_detailed( @@ -122,14 +128,14 @@ def sync( async def asyncio_detailed( *, client: Union[AuthenticatedClient, Client], -) -> Response[Union[ClientErrorResponseContent, ServiceErrorResponseContent]]: +) -> Response[Union[ClientErrorResponseContent, ListOrganizationsResponseContent, ServiceErrorResponseContent]]: """ 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[Union[ClientErrorResponseContent, ServiceErrorResponseContent]] + Response[Union[ClientErrorResponseContent, ListOrganizationsResponseContent, ServiceErrorResponseContent]] """ kwargs = _get_kwargs() @@ -142,14 +148,14 @@ async def asyncio_detailed( async def asyncio( *, client: Union[AuthenticatedClient, Client], -) -> Optional[Union[ClientErrorResponseContent, ServiceErrorResponseContent]]: +) -> Optional[Union[ClientErrorResponseContent, ListOrganizationsResponseContent, ServiceErrorResponseContent]]: """ 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: - Union[ClientErrorResponseContent, ServiceErrorResponseContent] + Union[ClientErrorResponseContent, ListOrganizationsResponseContent, ServiceErrorResponseContent] """ return ( diff --git a/griptape_cloud_client/api/organizations/update_organization.py b/griptape_cloud_client/api/organizations/update_organization.py index 6a55231..2377031 100644 --- a/griptape_cloud_client/api/organizations/update_organization.py +++ b/griptape_cloud_client/api/organizations/update_organization.py @@ -8,6 +8,7 @@ from ...models.client_error_response_content import ClientErrorResponseContent from ...models.service_error_response_content import ServiceErrorResponseContent from ...models.update_organization_request_content import UpdateOrganizationRequestContent +from ...models.update_organization_response_content import UpdateOrganizationResponseContent from ...types import Response @@ -20,7 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "patch", - "url": f"/organizations/{organization_id}", + "url": f"/api/organizations/{organization_id}", } _kwargs["json"] = body.to_dict() @@ -33,7 +34,12 @@ def _get_kwargs( def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ClientErrorResponseContent, ServiceErrorResponseContent]]: +) -> Optional[Union[ClientErrorResponseContent, ServiceErrorResponseContent, UpdateOrganizationResponseContent]]: + if response.status_code == 200: + response_200 = UpdateOrganizationResponseContent.from_dict(response.json()) + + return response_200 + if response.status_code == 400: response_400 = ClientErrorResponseContent.from_dict(response.json()) @@ -82,7 +88,7 @@ def _parse_response( def _build_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ClientErrorResponseContent, ServiceErrorResponseContent]]: +) -> Response[Union[ClientErrorResponseContent, ServiceErrorResponseContent, UpdateOrganizationResponseContent]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -96,7 +102,7 @@ def sync_detailed( *, client: Union[AuthenticatedClient, Client], body: UpdateOrganizationRequestContent, -) -> Response[Union[ClientErrorResponseContent, ServiceErrorResponseContent]]: +) -> Response[Union[ClientErrorResponseContent, ServiceErrorResponseContent, UpdateOrganizationResponseContent]]: """ Args: organization_id (str): @@ -107,7 +113,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ClientErrorResponseContent, ServiceErrorResponseContent]] + Response[Union[ClientErrorResponseContent, ServiceErrorResponseContent, UpdateOrganizationResponseContent]] """ kwargs = _get_kwargs( @@ -127,7 +133,7 @@ def sync( *, client: Union[AuthenticatedClient, Client], body: UpdateOrganizationRequestContent, -) -> Optional[Union[ClientErrorResponseContent, ServiceErrorResponseContent]]: +) -> Optional[Union[ClientErrorResponseContent, ServiceErrorResponseContent, UpdateOrganizationResponseContent]]: """ Args: organization_id (str): @@ -138,7 +144,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ClientErrorResponseContent, ServiceErrorResponseContent] + Union[ClientErrorResponseContent, ServiceErrorResponseContent, UpdateOrganizationResponseContent] """ return sync_detailed( @@ -153,7 +159,7 @@ async def asyncio_detailed( *, client: Union[AuthenticatedClient, Client], body: UpdateOrganizationRequestContent, -) -> Response[Union[ClientErrorResponseContent, ServiceErrorResponseContent]]: +) -> Response[Union[ClientErrorResponseContent, ServiceErrorResponseContent, UpdateOrganizationResponseContent]]: """ Args: organization_id (str): @@ -164,7 +170,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ClientErrorResponseContent, ServiceErrorResponseContent]] + Response[Union[ClientErrorResponseContent, ServiceErrorResponseContent, UpdateOrganizationResponseContent]] """ kwargs = _get_kwargs( @@ -182,7 +188,7 @@ async def asyncio( *, client: Union[AuthenticatedClient, Client], body: UpdateOrganizationRequestContent, -) -> Optional[Union[ClientErrorResponseContent, ServiceErrorResponseContent]]: +) -> Optional[Union[ClientErrorResponseContent, ServiceErrorResponseContent, UpdateOrganizationResponseContent]]: """ Args: organization_id (str): @@ -193,7 +199,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ClientErrorResponseContent, ServiceErrorResponseContent] + Union[ClientErrorResponseContent, ServiceErrorResponseContent, UpdateOrganizationResponseContent] """ return ( diff --git a/griptape_cloud_client/api/retriever_components/create_retriever_component.py b/griptape_cloud_client/api/retriever_components/create_retriever_component.py index f7e1fe7..1c7e898 100644 --- a/griptape_cloud_client/api/retriever_components/create_retriever_component.py +++ b/griptape_cloud_client/api/retriever_components/create_retriever_component.py @@ -20,7 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/retriever-components", + "url": "/api/retriever-components", } _kwargs["json"] = body.to_dict() diff --git a/griptape_cloud_client/api/retriever_components/delete_retriever_component.py b/griptape_cloud_client/api/retriever_components/delete_retriever_component.py index fde2fd2..eda278f 100644 --- a/griptape_cloud_client/api/retriever_components/delete_retriever_component.py +++ b/griptape_cloud_client/api/retriever_components/delete_retriever_component.py @@ -15,7 +15,7 @@ def _get_kwargs( ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/retriever-components/{retriever_component_id}", + "url": f"/api/retriever-components/{retriever_component_id}", } return _kwargs diff --git a/griptape_cloud_client/api/retriever_components/get_retriever_component.py b/griptape_cloud_client/api/retriever_components/get_retriever_component.py index b8257ad..27a7d4f 100644 --- a/griptape_cloud_client/api/retriever_components/get_retriever_component.py +++ b/griptape_cloud_client/api/retriever_components/get_retriever_component.py @@ -16,7 +16,7 @@ def _get_kwargs( ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", - "url": f"/retriever-components/{retriever_component_id}", + "url": f"/api/retriever-components/{retriever_component_id}", } return _kwargs diff --git a/griptape_cloud_client/api/retriever_components/list_retriever_components.py b/griptape_cloud_client/api/retriever_components/list_retriever_components.py index 182bcc5..cf90456 100644 --- a/griptape_cloud_client/api/retriever_components/list_retriever_components.py +++ b/griptape_cloud_client/api/retriever_components/list_retriever_components.py @@ -26,7 +26,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/retriever-components", + "url": "/api/retriever-components", "params": params, } diff --git a/griptape_cloud_client/api/retriever_components/update_retriever_component.py b/griptape_cloud_client/api/retriever_components/update_retriever_component.py index 00775ec..64c22b4 100644 --- a/griptape_cloud_client/api/retriever_components/update_retriever_component.py +++ b/griptape_cloud_client/api/retriever_components/update_retriever_component.py @@ -21,7 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "patch", - "url": f"/retriever-components/{retriever_component_id}", + "url": f"/api/retriever-components/{retriever_component_id}", } _kwargs["json"] = body.to_dict() diff --git a/griptape_cloud_client/api/retrievers/create_retriever.py b/griptape_cloud_client/api/retrievers/create_retriever.py index f88c6ad..bb6f064 100644 --- a/griptape_cloud_client/api/retrievers/create_retriever.py +++ b/griptape_cloud_client/api/retrievers/create_retriever.py @@ -20,7 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/retrievers", + "url": "/api/retrievers", } _kwargs["json"] = body.to_dict() diff --git a/griptape_cloud_client/api/retrievers/delete_retriever.py b/griptape_cloud_client/api/retrievers/delete_retriever.py index df0d673..0d1901d 100644 --- a/griptape_cloud_client/api/retrievers/delete_retriever.py +++ b/griptape_cloud_client/api/retrievers/delete_retriever.py @@ -15,7 +15,7 @@ def _get_kwargs( ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/retrievers/{retriever_id}", + "url": f"/api/retrievers/{retriever_id}", } return _kwargs diff --git a/griptape_cloud_client/api/retrievers/get_retriever.py b/griptape_cloud_client/api/retrievers/get_retriever.py index 28395f1..1047f11 100644 --- a/griptape_cloud_client/api/retrievers/get_retriever.py +++ b/griptape_cloud_client/api/retrievers/get_retriever.py @@ -16,7 +16,7 @@ def _get_kwargs( ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", - "url": f"/retrievers/{retriever_id}", + "url": f"/api/retrievers/{retriever_id}", } return _kwargs diff --git a/griptape_cloud_client/api/retrievers/list_retrievers.py b/griptape_cloud_client/api/retrievers/list_retrievers.py index de336ec..f0c31a2 100644 --- a/griptape_cloud_client/api/retrievers/list_retrievers.py +++ b/griptape_cloud_client/api/retrievers/list_retrievers.py @@ -26,7 +26,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/retrievers", + "url": "/api/retrievers", "params": params, } diff --git a/griptape_cloud_client/api/retrievers/query_retriever.py b/griptape_cloud_client/api/retrievers/query_retriever.py index 1417810..d5ba1e5 100644 --- a/griptape_cloud_client/api/retrievers/query_retriever.py +++ b/griptape_cloud_client/api/retrievers/query_retriever.py @@ -21,7 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": f"/retrievers/{retriever_id}/query", + "url": f"/api/retrievers/{retriever_id}/query", } _kwargs["json"] = body.to_dict() diff --git a/griptape_cloud_client/api/retrievers/update_retriever.py b/griptape_cloud_client/api/retrievers/update_retriever.py index 62a93ca..f5674ed 100644 --- a/griptape_cloud_client/api/retrievers/update_retriever.py +++ b/griptape_cloud_client/api/retrievers/update_retriever.py @@ -21,7 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "patch", - "url": f"/retrievers/{retriever_id}", + "url": f"/api/retrievers/{retriever_id}", } _kwargs["json"] = body.to_dict() diff --git a/griptape_cloud_client/api/rules/create_rule.py b/griptape_cloud_client/api/rules/create_rule.py index e510c58..56fd246 100644 --- a/griptape_cloud_client/api/rules/create_rule.py +++ b/griptape_cloud_client/api/rules/create_rule.py @@ -20,7 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/rules", + "url": "/api/rules", } _kwargs["json"] = body.to_dict() diff --git a/griptape_cloud_client/api/rules/delete_rule.py b/griptape_cloud_client/api/rules/delete_rule.py index 5d24235..db619ab 100644 --- a/griptape_cloud_client/api/rules/delete_rule.py +++ b/griptape_cloud_client/api/rules/delete_rule.py @@ -15,7 +15,7 @@ def _get_kwargs( ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/rules/{rule_id}", + "url": f"/api/rules/{rule_id}", } return _kwargs diff --git a/griptape_cloud_client/api/rules/get_rule.py b/griptape_cloud_client/api/rules/get_rule.py index 6431d63..4d14aec 100644 --- a/griptape_cloud_client/api/rules/get_rule.py +++ b/griptape_cloud_client/api/rules/get_rule.py @@ -16,7 +16,7 @@ def _get_kwargs( ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", - "url": f"/rules/{rule_id}", + "url": f"/api/rules/{rule_id}", } return _kwargs diff --git a/griptape_cloud_client/api/rules/list_rules.py b/griptape_cloud_client/api/rules/list_rules.py index e831ebd..b2b378f 100644 --- a/griptape_cloud_client/api/rules/list_rules.py +++ b/griptape_cloud_client/api/rules/list_rules.py @@ -29,7 +29,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/rules", + "url": "/api/rules", "params": params, } diff --git a/griptape_cloud_client/api/rules/update_rule.py b/griptape_cloud_client/api/rules/update_rule.py index 54bd9b7..dfc0079 100644 --- a/griptape_cloud_client/api/rules/update_rule.py +++ b/griptape_cloud_client/api/rules/update_rule.py @@ -21,7 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "patch", - "url": f"/rules/{rule_id}", + "url": f"/api/rules/{rule_id}", } _kwargs["json"] = body.to_dict() diff --git a/griptape_cloud_client/api/rulesets/create_ruleset.py b/griptape_cloud_client/api/rulesets/create_ruleset.py index a1d472e..10a4325 100644 --- a/griptape_cloud_client/api/rulesets/create_ruleset.py +++ b/griptape_cloud_client/api/rulesets/create_ruleset.py @@ -20,7 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/rulesets", + "url": "/api/rulesets", } _kwargs["json"] = body.to_dict() diff --git a/griptape_cloud_client/api/rulesets/delete_ruleset.py b/griptape_cloud_client/api/rulesets/delete_ruleset.py index e473d49..48de55f 100644 --- a/griptape_cloud_client/api/rulesets/delete_ruleset.py +++ b/griptape_cloud_client/api/rulesets/delete_ruleset.py @@ -15,7 +15,7 @@ def _get_kwargs( ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/rulesets/{ruleset_id}", + "url": f"/api/rulesets/{ruleset_id}", } return _kwargs diff --git a/griptape_cloud_client/api/rulesets/get_ruleset.py b/griptape_cloud_client/api/rulesets/get_ruleset.py index 1db1dab..15162d1 100644 --- a/griptape_cloud_client/api/rulesets/get_ruleset.py +++ b/griptape_cloud_client/api/rulesets/get_ruleset.py @@ -16,7 +16,7 @@ def _get_kwargs( ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", - "url": f"/rulesets/{ruleset_id}", + "url": f"/api/rulesets/{ruleset_id}", } return _kwargs diff --git a/griptape_cloud_client/api/rulesets/list_rulesets.py b/griptape_cloud_client/api/rulesets/list_rulesets.py index dd7aa65..35c150a 100644 --- a/griptape_cloud_client/api/rulesets/list_rulesets.py +++ b/griptape_cloud_client/api/rulesets/list_rulesets.py @@ -29,7 +29,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/rulesets", + "url": "/api/rulesets", "params": params, } diff --git a/griptape_cloud_client/api/rulesets/update_ruleset.py b/griptape_cloud_client/api/rulesets/update_ruleset.py index e3a5048..f7e4b29 100644 --- a/griptape_cloud_client/api/rulesets/update_ruleset.py +++ b/griptape_cloud_client/api/rulesets/update_ruleset.py @@ -21,7 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "patch", - "url": f"/rulesets/{ruleset_id}", + "url": f"/api/rulesets/{ruleset_id}", } _kwargs["json"] = body.to_dict() diff --git a/griptape_cloud_client/api/secrets/create_secret.py b/griptape_cloud_client/api/secrets/create_secret.py index d3f1a24..c70d6ac 100644 --- a/griptape_cloud_client/api/secrets/create_secret.py +++ b/griptape_cloud_client/api/secrets/create_secret.py @@ -20,7 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/secrets", + "url": "/api/secrets", } _kwargs["json"] = body.to_dict() diff --git a/griptape_cloud_client/api/secrets/delete_secret.py b/griptape_cloud_client/api/secrets/delete_secret.py index 3bb2625..2225394 100644 --- a/griptape_cloud_client/api/secrets/delete_secret.py +++ b/griptape_cloud_client/api/secrets/delete_secret.py @@ -15,7 +15,7 @@ def _get_kwargs( ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/secrets/{secret_id}", + "url": f"/api/secrets/{secret_id}", } return _kwargs diff --git a/griptape_cloud_client/api/secrets/get_secret.py b/griptape_cloud_client/api/secrets/get_secret.py index ffcd6cf..7ff8fab 100644 --- a/griptape_cloud_client/api/secrets/get_secret.py +++ b/griptape_cloud_client/api/secrets/get_secret.py @@ -16,7 +16,7 @@ def _get_kwargs( ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", - "url": f"/secrets/{secret_id}", + "url": f"/api/secrets/{secret_id}", } return _kwargs diff --git a/griptape_cloud_client/api/secrets/list_secrets.py b/griptape_cloud_client/api/secrets/list_secrets.py index 5a66f43..3c05e76 100644 --- a/griptape_cloud_client/api/secrets/list_secrets.py +++ b/griptape_cloud_client/api/secrets/list_secrets.py @@ -26,7 +26,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/secrets", + "url": "/api/secrets", "params": params, } diff --git a/griptape_cloud_client/api/secrets/update_secret.py b/griptape_cloud_client/api/secrets/update_secret.py index 61c70df..d8b5b55 100644 --- a/griptape_cloud_client/api/secrets/update_secret.py +++ b/griptape_cloud_client/api/secrets/update_secret.py @@ -21,7 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "patch", - "url": f"/secrets/{secret_id}", + "url": f"/api/secrets/{secret_id}", } _kwargs["json"] = body.to_dict() diff --git a/griptape_cloud_client/api/session_pool/__init__.py b/griptape_cloud_client/api/session_pool/__init__.py new file mode 100644 index 0000000..2d7c0b2 --- /dev/null +++ b/griptape_cloud_client/api/session_pool/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/griptape_cloud_client/api/session_pool/get_session_pool.py b/griptape_cloud_client/api/session_pool/get_session_pool.py new file mode 100644 index 0000000..3991598 --- /dev/null +++ b/griptape_cloud_client/api/session_pool/get_session_pool.py @@ -0,0 +1,165 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.client_error_response_content import ClientErrorResponseContent +from ...models.get_session_pool_response_content import GetSessionPoolResponseContent +from ...models.service_error_response_content import ServiceErrorResponseContent +from ...types import Response + + +def _get_kwargs() -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/session-pools", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ClientErrorResponseContent, GetSessionPoolResponseContent, ServiceErrorResponseContent]]: + if response.status_code == 200: + response_200 = GetSessionPoolResponseContent.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = ClientErrorResponseContent.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = ClientErrorResponseContent.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = ClientErrorResponseContent.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = ClientErrorResponseContent.from_dict(response.json()) + + return response_404 + + if response.status_code == 406: + response_406 = ClientErrorResponseContent.from_dict(response.json()) + + return response_406 + + if response.status_code == 409: + response_409 = ClientErrorResponseContent.from_dict(response.json()) + + return response_409 + + if response.status_code == 422: + response_422 = ClientErrorResponseContent.from_dict(response.json()) + + return response_422 + + if response.status_code == 500: + response_500 = ServiceErrorResponseContent.from_dict(response.json()) + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ClientErrorResponseContent, GetSessionPoolResponseContent, ServiceErrorResponseContent]]: + 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: Union[AuthenticatedClient, Client], +) -> Response[Union[ClientErrorResponseContent, GetSessionPoolResponseContent, ServiceErrorResponseContent]]: + """ + 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[Union[ClientErrorResponseContent, GetSessionPoolResponseContent, ServiceErrorResponseContent]] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[ClientErrorResponseContent, GetSessionPoolResponseContent, ServiceErrorResponseContent]]: + """ + 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: + Union[ClientErrorResponseContent, GetSessionPoolResponseContent, ServiceErrorResponseContent] + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[ClientErrorResponseContent, GetSessionPoolResponseContent, ServiceErrorResponseContent]]: + """ + 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[Union[ClientErrorResponseContent, GetSessionPoolResponseContent, ServiceErrorResponseContent]] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[ClientErrorResponseContent, GetSessionPoolResponseContent, ServiceErrorResponseContent]]: + """ + 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: + Union[ClientErrorResponseContent, GetSessionPoolResponseContent, ServiceErrorResponseContent] + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/griptape_cloud_client/api/sessions/__init__.py b/griptape_cloud_client/api/sessions/__init__.py new file mode 100644 index 0000000..2d7c0b2 --- /dev/null +++ b/griptape_cloud_client/api/sessions/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/griptape_cloud_client/api/sessions/allocate_session.py b/griptape_cloud_client/api/sessions/allocate_session.py new file mode 100644 index 0000000..49baf3f --- /dev/null +++ b/griptape_cloud_client/api/sessions/allocate_session.py @@ -0,0 +1,198 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.allocate_session_request_content import AllocateSessionRequestContent +from ...models.allocate_session_response_content import AllocateSessionResponseContent +from ...models.client_error_response_content import ClientErrorResponseContent +from ...models.service_error_response_content import ServiceErrorResponseContent +from ...types import Response + + +def _get_kwargs( + *, + body: AllocateSessionRequestContent, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/sessions", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[AllocateSessionResponseContent, ClientErrorResponseContent, ServiceErrorResponseContent]]: + if response.status_code == 201: + response_201 = AllocateSessionResponseContent.from_dict(response.json()) + + return response_201 + + if response.status_code == 400: + response_400 = ClientErrorResponseContent.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = ClientErrorResponseContent.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = ClientErrorResponseContent.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = ClientErrorResponseContent.from_dict(response.json()) + + return response_404 + + if response.status_code == 406: + response_406 = ClientErrorResponseContent.from_dict(response.json()) + + return response_406 + + if response.status_code == 409: + response_409 = ClientErrorResponseContent.from_dict(response.json()) + + return response_409 + + if response.status_code == 422: + response_422 = ClientErrorResponseContent.from_dict(response.json()) + + return response_422 + + if response.status_code == 500: + response_500 = ServiceErrorResponseContent.from_dict(response.json()) + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[AllocateSessionResponseContent, ClientErrorResponseContent, ServiceErrorResponseContent]]: + 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: Union[AuthenticatedClient, Client], + body: AllocateSessionRequestContent, +) -> Response[Union[AllocateSessionResponseContent, ClientErrorResponseContent, ServiceErrorResponseContent]]: + """ + Args: + body (AllocateSessionRequestContent): + + 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[Union[AllocateSessionResponseContent, ClientErrorResponseContent, ServiceErrorResponseContent]] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: Union[AuthenticatedClient, Client], + body: AllocateSessionRequestContent, +) -> Optional[Union[AllocateSessionResponseContent, ClientErrorResponseContent, ServiceErrorResponseContent]]: + """ + Args: + body (AllocateSessionRequestContent): + + 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: + Union[AllocateSessionResponseContent, ClientErrorResponseContent, ServiceErrorResponseContent] + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: Union[AuthenticatedClient, Client], + body: AllocateSessionRequestContent, +) -> Response[Union[AllocateSessionResponseContent, ClientErrorResponseContent, ServiceErrorResponseContent]]: + """ + Args: + body (AllocateSessionRequestContent): + + 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[Union[AllocateSessionResponseContent, ClientErrorResponseContent, ServiceErrorResponseContent]] + """ + + 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: Union[AuthenticatedClient, Client], + body: AllocateSessionRequestContent, +) -> Optional[Union[AllocateSessionResponseContent, ClientErrorResponseContent, ServiceErrorResponseContent]]: + """ + Args: + body (AllocateSessionRequestContent): + + 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: + Union[AllocateSessionResponseContent, ClientErrorResponseContent, ServiceErrorResponseContent] + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/griptape_cloud_client/api/sessions/delete_session.py b/griptape_cloud_client/api/sessions/delete_session.py new file mode 100644 index 0000000..2de44d3 --- /dev/null +++ b/griptape_cloud_client/api/sessions/delete_session.py @@ -0,0 +1,187 @@ +from http import HTTPStatus +from typing import Any, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.client_error_response_content import ClientErrorResponseContent +from ...models.service_error_response_content import ServiceErrorResponseContent +from ...types import Response + + +def _get_kwargs( + session_id: str, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "delete", + "url": f"/api/sessions/{session_id}", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ClientErrorResponseContent, ServiceErrorResponseContent]]: + if response.status_code == 204: + response_204 = cast(Any, None) + return response_204 + + if response.status_code == 400: + response_400 = ClientErrorResponseContent.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = ClientErrorResponseContent.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = ClientErrorResponseContent.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = ClientErrorResponseContent.from_dict(response.json()) + + return response_404 + + if response.status_code == 406: + response_406 = ClientErrorResponseContent.from_dict(response.json()) + + return response_406 + + if response.status_code == 409: + response_409 = ClientErrorResponseContent.from_dict(response.json()) + + return response_409 + + if response.status_code == 422: + response_422 = ClientErrorResponseContent.from_dict(response.json()) + + return response_422 + + if response.status_code == 500: + response_500 = ServiceErrorResponseContent.from_dict(response.json()) + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ClientErrorResponseContent, ServiceErrorResponseContent]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + session_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ClientErrorResponseContent, ServiceErrorResponseContent]]: + """ + Args: + session_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[Union[Any, ClientErrorResponseContent, ServiceErrorResponseContent]] + """ + + kwargs = _get_kwargs( + session_id=session_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + session_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ClientErrorResponseContent, ServiceErrorResponseContent]]: + """ + Args: + session_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: + Union[Any, ClientErrorResponseContent, ServiceErrorResponseContent] + """ + + return sync_detailed( + session_id=session_id, + client=client, + ).parsed + + +async def asyncio_detailed( + session_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ClientErrorResponseContent, ServiceErrorResponseContent]]: + """ + Args: + session_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[Union[Any, ClientErrorResponseContent, ServiceErrorResponseContent]] + """ + + kwargs = _get_kwargs( + session_id=session_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + session_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ClientErrorResponseContent, ServiceErrorResponseContent]]: + """ + Args: + session_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: + Union[Any, ClientErrorResponseContent, ServiceErrorResponseContent] + """ + + return ( + await asyncio_detailed( + session_id=session_id, + client=client, + ) + ).parsed diff --git a/griptape_cloud_client/api/sessions/get_session.py b/griptape_cloud_client/api/sessions/get_session.py new file mode 100644 index 0000000..b71540e --- /dev/null +++ b/griptape_cloud_client/api/sessions/get_session.py @@ -0,0 +1,189 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.client_error_response_content import ClientErrorResponseContent +from ...models.get_session_response_content import GetSessionResponseContent +from ...models.service_error_response_content import ServiceErrorResponseContent +from ...types import Response + + +def _get_kwargs( + session_id: str, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/api/sessions/{session_id}", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ClientErrorResponseContent, GetSessionResponseContent, ServiceErrorResponseContent]]: + if response.status_code == 200: + response_200 = GetSessionResponseContent.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = ClientErrorResponseContent.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = ClientErrorResponseContent.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = ClientErrorResponseContent.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = ClientErrorResponseContent.from_dict(response.json()) + + return response_404 + + if response.status_code == 406: + response_406 = ClientErrorResponseContent.from_dict(response.json()) + + return response_406 + + if response.status_code == 409: + response_409 = ClientErrorResponseContent.from_dict(response.json()) + + return response_409 + + if response.status_code == 422: + response_422 = ClientErrorResponseContent.from_dict(response.json()) + + return response_422 + + if response.status_code == 500: + response_500 = ServiceErrorResponseContent.from_dict(response.json()) + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ClientErrorResponseContent, GetSessionResponseContent, ServiceErrorResponseContent]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + session_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[ClientErrorResponseContent, GetSessionResponseContent, ServiceErrorResponseContent]]: + """ + Args: + session_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[Union[ClientErrorResponseContent, GetSessionResponseContent, ServiceErrorResponseContent]] + """ + + kwargs = _get_kwargs( + session_id=session_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + session_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[ClientErrorResponseContent, GetSessionResponseContent, ServiceErrorResponseContent]]: + """ + Args: + session_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: + Union[ClientErrorResponseContent, GetSessionResponseContent, ServiceErrorResponseContent] + """ + + return sync_detailed( + session_id=session_id, + client=client, + ).parsed + + +async def asyncio_detailed( + session_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[ClientErrorResponseContent, GetSessionResponseContent, ServiceErrorResponseContent]]: + """ + Args: + session_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[Union[ClientErrorResponseContent, GetSessionResponseContent, ServiceErrorResponseContent]] + """ + + kwargs = _get_kwargs( + session_id=session_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + session_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[ClientErrorResponseContent, GetSessionResponseContent, ServiceErrorResponseContent]]: + """ + Args: + session_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: + Union[ClientErrorResponseContent, GetSessionResponseContent, ServiceErrorResponseContent] + """ + + return ( + await asyncio_detailed( + session_id=session_id, + client=client, + ) + ).parsed diff --git a/griptape_cloud_client/api/sessions/list_sessions.py b/griptape_cloud_client/api/sessions/list_sessions.py new file mode 100644 index 0000000..ce8726e --- /dev/null +++ b/griptape_cloud_client/api/sessions/list_sessions.py @@ -0,0 +1,247 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.client_error_response_content import ClientErrorResponseContent +from ...models.list_sessions_response_content import ListSessionsResponseContent +from ...models.service_error_response_content import ServiceErrorResponseContent +from ...models.session_status import SessionStatus +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + page: Union[Unset, float] = UNSET, + page_size: Union[Unset, float] = UNSET, + status: Union[Unset, SessionStatus] = UNSET, + license_id: Union[Unset, str] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["page"] = page + + params["page_size"] = page_size + + json_status: Union[Unset, str] = UNSET + if not isinstance(status, Unset): + json_status = status.value + + params["status"] = json_status + + params["license_id"] = license_id + + 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": "/api/sessions", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ClientErrorResponseContent, ListSessionsResponseContent, ServiceErrorResponseContent]]: + if response.status_code == 200: + response_200 = ListSessionsResponseContent.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = ClientErrorResponseContent.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = ClientErrorResponseContent.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = ClientErrorResponseContent.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = ClientErrorResponseContent.from_dict(response.json()) + + return response_404 + + if response.status_code == 406: + response_406 = ClientErrorResponseContent.from_dict(response.json()) + + return response_406 + + if response.status_code == 409: + response_409 = ClientErrorResponseContent.from_dict(response.json()) + + return response_409 + + if response.status_code == 422: + response_422 = ClientErrorResponseContent.from_dict(response.json()) + + return response_422 + + if response.status_code == 500: + response_500 = ServiceErrorResponseContent.from_dict(response.json()) + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ClientErrorResponseContent, ListSessionsResponseContent, ServiceErrorResponseContent]]: + 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: Union[AuthenticatedClient, Client], + page: Union[Unset, float] = UNSET, + page_size: Union[Unset, float] = UNSET, + status: Union[Unset, SessionStatus] = UNSET, + license_id: Union[Unset, str] = UNSET, +) -> Response[Union[ClientErrorResponseContent, ListSessionsResponseContent, ServiceErrorResponseContent]]: + """ + Args: + page (Union[Unset, float]): + page_size (Union[Unset, float]): + status (Union[Unset, SessionStatus]): + license_id (Union[Unset, 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[Union[ClientErrorResponseContent, ListSessionsResponseContent, ServiceErrorResponseContent]] + """ + + kwargs = _get_kwargs( + page=page, + page_size=page_size, + status=status, + license_id=license_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: Union[AuthenticatedClient, Client], + page: Union[Unset, float] = UNSET, + page_size: Union[Unset, float] = UNSET, + status: Union[Unset, SessionStatus] = UNSET, + license_id: Union[Unset, str] = UNSET, +) -> Optional[Union[ClientErrorResponseContent, ListSessionsResponseContent, ServiceErrorResponseContent]]: + """ + Args: + page (Union[Unset, float]): + page_size (Union[Unset, float]): + status (Union[Unset, SessionStatus]): + license_id (Union[Unset, 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: + Union[ClientErrorResponseContent, ListSessionsResponseContent, ServiceErrorResponseContent] + """ + + return sync_detailed( + client=client, + page=page, + page_size=page_size, + status=status, + license_id=license_id, + ).parsed + + +async def asyncio_detailed( + *, + client: Union[AuthenticatedClient, Client], + page: Union[Unset, float] = UNSET, + page_size: Union[Unset, float] = UNSET, + status: Union[Unset, SessionStatus] = UNSET, + license_id: Union[Unset, str] = UNSET, +) -> Response[Union[ClientErrorResponseContent, ListSessionsResponseContent, ServiceErrorResponseContent]]: + """ + Args: + page (Union[Unset, float]): + page_size (Union[Unset, float]): + status (Union[Unset, SessionStatus]): + license_id (Union[Unset, 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[Union[ClientErrorResponseContent, ListSessionsResponseContent, ServiceErrorResponseContent]] + """ + + kwargs = _get_kwargs( + page=page, + page_size=page_size, + status=status, + license_id=license_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: Union[AuthenticatedClient, Client], + page: Union[Unset, float] = UNSET, + page_size: Union[Unset, float] = UNSET, + status: Union[Unset, SessionStatus] = UNSET, + license_id: Union[Unset, str] = UNSET, +) -> Optional[Union[ClientErrorResponseContent, ListSessionsResponseContent, ServiceErrorResponseContent]]: + """ + Args: + page (Union[Unset, float]): + page_size (Union[Unset, float]): + status (Union[Unset, SessionStatus]): + license_id (Union[Unset, 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: + Union[ClientErrorResponseContent, ListSessionsResponseContent, ServiceErrorResponseContent] + """ + + return ( + await asyncio_detailed( + client=client, + page=page, + page_size=page_size, + status=status, + license_id=license_id, + ) + ).parsed diff --git a/griptape_cloud_client/api/sessions/release_session.py b/griptape_cloud_client/api/sessions/release_session.py new file mode 100644 index 0000000..56c3145 --- /dev/null +++ b/griptape_cloud_client/api/sessions/release_session.py @@ -0,0 +1,163 @@ +from http import HTTPStatus +from typing import Any, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.client_error_response_content import ClientErrorResponseContent +from ...models.service_error_response_content import ServiceErrorResponseContent +from ...types import Response + + +def _get_kwargs() -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/session-release", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ClientErrorResponseContent, ServiceErrorResponseContent]]: + if response.status_code == 204: + response_204 = cast(Any, None) + return response_204 + + if response.status_code == 400: + response_400 = ClientErrorResponseContent.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = ClientErrorResponseContent.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = ClientErrorResponseContent.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = ClientErrorResponseContent.from_dict(response.json()) + + return response_404 + + if response.status_code == 406: + response_406 = ClientErrorResponseContent.from_dict(response.json()) + + return response_406 + + if response.status_code == 409: + response_409 = ClientErrorResponseContent.from_dict(response.json()) + + return response_409 + + if response.status_code == 422: + response_422 = ClientErrorResponseContent.from_dict(response.json()) + + return response_422 + + if response.status_code == 500: + response_500 = ServiceErrorResponseContent.from_dict(response.json()) + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ClientErrorResponseContent, ServiceErrorResponseContent]]: + 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: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ClientErrorResponseContent, ServiceErrorResponseContent]]: + """ + 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[Union[Any, ClientErrorResponseContent, ServiceErrorResponseContent]] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ClientErrorResponseContent, ServiceErrorResponseContent]]: + """ + 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: + Union[Any, ClientErrorResponseContent, ServiceErrorResponseContent] + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ClientErrorResponseContent, ServiceErrorResponseContent]]: + """ + 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[Union[Any, ClientErrorResponseContent, ServiceErrorResponseContent]] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ClientErrorResponseContent, ServiceErrorResponseContent]]: + """ + 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: + Union[Any, ClientErrorResponseContent, ServiceErrorResponseContent] + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/griptape_cloud_client/api/sessions/renew_session.py b/griptape_cloud_client/api/sessions/renew_session.py new file mode 100644 index 0000000..9f12cca --- /dev/null +++ b/griptape_cloud_client/api/sessions/renew_session.py @@ -0,0 +1,165 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.client_error_response_content import ClientErrorResponseContent +from ...models.renew_session_response_content import RenewSessionResponseContent +from ...models.service_error_response_content import ServiceErrorResponseContent +from ...types import Response + + +def _get_kwargs() -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/session-renew", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ClientErrorResponseContent, RenewSessionResponseContent, ServiceErrorResponseContent]]: + if response.status_code == 200: + response_200 = RenewSessionResponseContent.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = ClientErrorResponseContent.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = ClientErrorResponseContent.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = ClientErrorResponseContent.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = ClientErrorResponseContent.from_dict(response.json()) + + return response_404 + + if response.status_code == 406: + response_406 = ClientErrorResponseContent.from_dict(response.json()) + + return response_406 + + if response.status_code == 409: + response_409 = ClientErrorResponseContent.from_dict(response.json()) + + return response_409 + + if response.status_code == 422: + response_422 = ClientErrorResponseContent.from_dict(response.json()) + + return response_422 + + if response.status_code == 500: + response_500 = ServiceErrorResponseContent.from_dict(response.json()) + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ClientErrorResponseContent, RenewSessionResponseContent, ServiceErrorResponseContent]]: + 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: Union[AuthenticatedClient, Client], +) -> Response[Union[ClientErrorResponseContent, RenewSessionResponseContent, ServiceErrorResponseContent]]: + """ + 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[Union[ClientErrorResponseContent, RenewSessionResponseContent, ServiceErrorResponseContent]] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[ClientErrorResponseContent, RenewSessionResponseContent, ServiceErrorResponseContent]]: + """ + 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: + Union[ClientErrorResponseContent, RenewSessionResponseContent, ServiceErrorResponseContent] + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[ClientErrorResponseContent, RenewSessionResponseContent, ServiceErrorResponseContent]]: + """ + 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[Union[ClientErrorResponseContent, RenewSessionResponseContent, ServiceErrorResponseContent]] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[ClientErrorResponseContent, RenewSessionResponseContent, ServiceErrorResponseContent]]: + """ + 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: + Union[ClientErrorResponseContent, RenewSessionResponseContent, ServiceErrorResponseContent] + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/griptape_cloud_client/api/sessions/update_session.py b/griptape_cloud_client/api/sessions/update_session.py new file mode 100644 index 0000000..7b4de31 --- /dev/null +++ b/griptape_cloud_client/api/sessions/update_session.py @@ -0,0 +1,211 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.client_error_response_content import ClientErrorResponseContent +from ...models.service_error_response_content import ServiceErrorResponseContent +from ...models.update_session_request_content import UpdateSessionRequestContent +from ...models.update_session_response_content import UpdateSessionResponseContent +from ...types import Response + + +def _get_kwargs( + session_id: str, + *, + body: UpdateSessionRequestContent, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": f"/api/sessions/{session_id}", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ClientErrorResponseContent, ServiceErrorResponseContent, UpdateSessionResponseContent]]: + if response.status_code == 200: + response_200 = UpdateSessionResponseContent.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = ClientErrorResponseContent.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = ClientErrorResponseContent.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = ClientErrorResponseContent.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = ClientErrorResponseContent.from_dict(response.json()) + + return response_404 + + if response.status_code == 406: + response_406 = ClientErrorResponseContent.from_dict(response.json()) + + return response_406 + + if response.status_code == 409: + response_409 = ClientErrorResponseContent.from_dict(response.json()) + + return response_409 + + if response.status_code == 422: + response_422 = ClientErrorResponseContent.from_dict(response.json()) + + return response_422 + + if response.status_code == 500: + response_500 = ServiceErrorResponseContent.from_dict(response.json()) + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ClientErrorResponseContent, ServiceErrorResponseContent, UpdateSessionResponseContent]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + session_id: str, + *, + client: Union[AuthenticatedClient, Client], + body: UpdateSessionRequestContent, +) -> Response[Union[ClientErrorResponseContent, ServiceErrorResponseContent, UpdateSessionResponseContent]]: + """ + Args: + session_id (str): + body (UpdateSessionRequestContent): + + 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[Union[ClientErrorResponseContent, ServiceErrorResponseContent, UpdateSessionResponseContent]] + """ + + kwargs = _get_kwargs( + session_id=session_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + session_id: str, + *, + client: Union[AuthenticatedClient, Client], + body: UpdateSessionRequestContent, +) -> Optional[Union[ClientErrorResponseContent, ServiceErrorResponseContent, UpdateSessionResponseContent]]: + """ + Args: + session_id (str): + body (UpdateSessionRequestContent): + + 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: + Union[ClientErrorResponseContent, ServiceErrorResponseContent, UpdateSessionResponseContent] + """ + + return sync_detailed( + session_id=session_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + session_id: str, + *, + client: Union[AuthenticatedClient, Client], + body: UpdateSessionRequestContent, +) -> Response[Union[ClientErrorResponseContent, ServiceErrorResponseContent, UpdateSessionResponseContent]]: + """ + Args: + session_id (str): + body (UpdateSessionRequestContent): + + 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[Union[ClientErrorResponseContent, ServiceErrorResponseContent, UpdateSessionResponseContent]] + """ + + kwargs = _get_kwargs( + session_id=session_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + session_id: str, + *, + client: Union[AuthenticatedClient, Client], + body: UpdateSessionRequestContent, +) -> Optional[Union[ClientErrorResponseContent, ServiceErrorResponseContent, UpdateSessionResponseContent]]: + """ + Args: + session_id (str): + body (UpdateSessionRequestContent): + + 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: + Union[ClientErrorResponseContent, ServiceErrorResponseContent, UpdateSessionResponseContent] + """ + + return ( + await asyncio_detailed( + session_id=session_id, + client=client, + body=body, + ) + ).parsed diff --git a/griptape_cloud_client/api/spans/list_spans.py b/griptape_cloud_client/api/spans/list_spans.py index b1f861c..affae7e 100644 --- a/griptape_cloud_client/api/spans/list_spans.py +++ b/griptape_cloud_client/api/spans/list_spans.py @@ -27,7 +27,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/structure-runs/{structure_run_id}/spans", + "url": f"/api/structure-runs/{structure_run_id}/spans", "params": params, } diff --git a/griptape_cloud_client/api/structure_runs/cancel_structure_run.py b/griptape_cloud_client/api/structure_runs/cancel_structure_run.py index c83a6a2..18f2aba 100644 --- a/griptape_cloud_client/api/structure_runs/cancel_structure_run.py +++ b/griptape_cloud_client/api/structure_runs/cancel_structure_run.py @@ -16,7 +16,7 @@ def _get_kwargs( ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "post", - "url": f"/structure-runs/{structure_run_id}/cancel", + "url": f"/api/structure-runs/{structure_run_id}/cancel", } return _kwargs diff --git a/griptape_cloud_client/api/structure_runs/create_structure_run.py b/griptape_cloud_client/api/structure_runs/create_structure_run.py index 6821d58..9724979 100644 --- a/griptape_cloud_client/api/structure_runs/create_structure_run.py +++ b/griptape_cloud_client/api/structure_runs/create_structure_run.py @@ -21,7 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": f"/structures/{structure_id}/runs", + "url": f"/api/structures/{structure_id}/runs", } _kwargs["json"] = body.to_dict() diff --git a/griptape_cloud_client/api/structure_runs/get_structure_run.py b/griptape_cloud_client/api/structure_runs/get_structure_run.py index 501124e..bd6ff24 100644 --- a/griptape_cloud_client/api/structure_runs/get_structure_run.py +++ b/griptape_cloud_client/api/structure_runs/get_structure_run.py @@ -16,7 +16,7 @@ def _get_kwargs( ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", - "url": f"/structure-runs/{structure_run_id}", + "url": f"/api/structure-runs/{structure_run_id}", } return _kwargs diff --git a/griptape_cloud_client/api/structure_runs/list_structure_run_logs.py b/griptape_cloud_client/api/structure_runs/list_structure_run_logs.py index ae5f17b..3e12125 100644 --- a/griptape_cloud_client/api/structure_runs/list_structure_run_logs.py +++ b/griptape_cloud_client/api/structure_runs/list_structure_run_logs.py @@ -16,7 +16,7 @@ def _get_kwargs( ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", - "url": f"/structure-runs/{structure_run_id}/logs", + "url": f"/api/structure-runs/{structure_run_id}/logs", } return _kwargs diff --git a/griptape_cloud_client/api/structure_runs/list_structure_runs.py b/griptape_cloud_client/api/structure_runs/list_structure_runs.py index 564340c..d51a7c9 100644 --- a/griptape_cloud_client/api/structure_runs/list_structure_runs.py +++ b/griptape_cloud_client/api/structure_runs/list_structure_runs.py @@ -38,7 +38,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/structures/{structure_id}/runs", + "url": f"/api/structures/{structure_id}/runs", "params": params, } diff --git a/griptape_cloud_client/api/structures/create_structure.py b/griptape_cloud_client/api/structures/create_structure.py index df3a36c..5108ce8 100644 --- a/griptape_cloud_client/api/structures/create_structure.py +++ b/griptape_cloud_client/api/structures/create_structure.py @@ -20,7 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/structures", + "url": "/api/structures", } _kwargs["json"] = body.to_dict() diff --git a/griptape_cloud_client/api/structures/delete_structure.py b/griptape_cloud_client/api/structures/delete_structure.py index a67bd8c..cda4ab6 100644 --- a/griptape_cloud_client/api/structures/delete_structure.py +++ b/griptape_cloud_client/api/structures/delete_structure.py @@ -15,7 +15,7 @@ def _get_kwargs( ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/structures/{structure_id}", + "url": f"/api/structures/{structure_id}", } return _kwargs diff --git a/griptape_cloud_client/api/structures/get_structure.py b/griptape_cloud_client/api/structures/get_structure.py index dd10b86..4645b8d 100644 --- a/griptape_cloud_client/api/structures/get_structure.py +++ b/griptape_cloud_client/api/structures/get_structure.py @@ -16,7 +16,7 @@ def _get_kwargs( ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", - "url": f"/structures/{structure_id}", + "url": f"/api/structures/{structure_id}", } return _kwargs diff --git a/griptape_cloud_client/api/structures/get_structures_dashboard.py b/griptape_cloud_client/api/structures/get_structures_dashboard.py index b735946..29ad3d7 100644 --- a/griptape_cloud_client/api/structures/get_structures_dashboard.py +++ b/griptape_cloud_client/api/structures/get_structures_dashboard.py @@ -44,7 +44,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/dashboards/structures", + "url": "/api/dashboards/structures", "params": params, } diff --git a/griptape_cloud_client/api/structures/invoke_structure_webhook_get.py b/griptape_cloud_client/api/structures/invoke_structure_webhook_get.py index 014deaa..bf8abc6 100644 --- a/griptape_cloud_client/api/structures/invoke_structure_webhook_get.py +++ b/griptape_cloud_client/api/structures/invoke_structure_webhook_get.py @@ -24,7 +24,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/structures/{structure_id}/webhook", + "url": f"/api/structures/{structure_id}/webhook", "params": params, } diff --git a/griptape_cloud_client/api/structures/invoke_structure_webhook_post.py b/griptape_cloud_client/api/structures/invoke_structure_webhook_post.py index 3696af9..4a4d991 100644 --- a/griptape_cloud_client/api/structures/invoke_structure_webhook_post.py +++ b/griptape_cloud_client/api/structures/invoke_structure_webhook_post.py @@ -24,7 +24,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": f"/structures/{structure_id}/webhook", + "url": f"/api/structures/{structure_id}/webhook", "params": params, } diff --git a/griptape_cloud_client/api/structures/list_structures.py b/griptape_cloud_client/api/structures/list_structures.py index 65c9339..48f3707 100644 --- a/griptape_cloud_client/api/structures/list_structures.py +++ b/griptape_cloud_client/api/structures/list_structures.py @@ -26,7 +26,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/structures", + "url": "/api/structures", "params": params, } diff --git a/griptape_cloud_client/api/structures/update_structure.py b/griptape_cloud_client/api/structures/update_structure.py index a2e29c0..a539e37 100644 --- a/griptape_cloud_client/api/structures/update_structure.py +++ b/griptape_cloud_client/api/structures/update_structure.py @@ -21,7 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "patch", - "url": f"/structures/{structure_id}", + "url": f"/api/structures/{structure_id}", } _kwargs["json"] = body.to_dict() diff --git a/griptape_cloud_client/api/threads/create_thread.py b/griptape_cloud_client/api/threads/create_thread.py index 6dccdf5..c7001a1 100644 --- a/griptape_cloud_client/api/threads/create_thread.py +++ b/griptape_cloud_client/api/threads/create_thread.py @@ -20,7 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/threads", + "url": "/api/threads", } _kwargs["json"] = body.to_dict() diff --git a/griptape_cloud_client/api/threads/delete_thread.py b/griptape_cloud_client/api/threads/delete_thread.py index 645cb84..17d13d8 100644 --- a/griptape_cloud_client/api/threads/delete_thread.py +++ b/griptape_cloud_client/api/threads/delete_thread.py @@ -15,7 +15,7 @@ def _get_kwargs( ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/threads/{thread_id}", + "url": f"/api/threads/{thread_id}", } return _kwargs diff --git a/griptape_cloud_client/api/threads/get_thread.py b/griptape_cloud_client/api/threads/get_thread.py index 97c7b9f..ff47840 100644 --- a/griptape_cloud_client/api/threads/get_thread.py +++ b/griptape_cloud_client/api/threads/get_thread.py @@ -16,7 +16,7 @@ def _get_kwargs( ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", - "url": f"/threads/{thread_id}", + "url": f"/api/threads/{thread_id}", } return _kwargs diff --git a/griptape_cloud_client/api/threads/list_threads.py b/griptape_cloud_client/api/threads/list_threads.py index 0269336..e259c31 100644 --- a/griptape_cloud_client/api/threads/list_threads.py +++ b/griptape_cloud_client/api/threads/list_threads.py @@ -35,7 +35,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/threads", + "url": "/api/threads", "params": params, } diff --git a/griptape_cloud_client/api/threads/update_thread.py b/griptape_cloud_client/api/threads/update_thread.py index 273bd51..cbfc464 100644 --- a/griptape_cloud_client/api/threads/update_thread.py +++ b/griptape_cloud_client/api/threads/update_thread.py @@ -21,7 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "patch", - "url": f"/threads/{thread_id}", + "url": f"/api/threads/{thread_id}", } _kwargs["json"] = body.to_dict() diff --git a/griptape_cloud_client/api/tool_invoke/create_tool_activity_run.py b/griptape_cloud_client/api/tool_invoke/create_tool_activity_run.py index 29fb8cd..6454c55 100644 --- a/griptape_cloud_client/api/tool_invoke/create_tool_activity_run.py +++ b/griptape_cloud_client/api/tool_invoke/create_tool_activity_run.py @@ -20,7 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": f"/tools/{tool_id}/activities/{activity_path}", + "url": f"/api/tools/{tool_id}/activities/{activity_path}", } _kwargs["json"] = body diff --git a/griptape_cloud_client/api/tool_invoke/get_tool_open_api_run.py b/griptape_cloud_client/api/tool_invoke/get_tool_open_api_run.py index 29876d4..155c79a 100644 --- a/griptape_cloud_client/api/tool_invoke/get_tool_open_api_run.py +++ b/griptape_cloud_client/api/tool_invoke/get_tool_open_api_run.py @@ -15,7 +15,7 @@ def _get_kwargs( ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", - "url": f"/tools/{tool_id}/openapi", + "url": f"/api/tools/{tool_id}/openapi", } return _kwargs diff --git a/griptape_cloud_client/api/tool_runs/get_tool_run.py b/griptape_cloud_client/api/tool_runs/get_tool_run.py index a52c185..26e2621 100644 --- a/griptape_cloud_client/api/tool_runs/get_tool_run.py +++ b/griptape_cloud_client/api/tool_runs/get_tool_run.py @@ -16,7 +16,7 @@ def _get_kwargs( ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", - "url": f"/tool-runs/{tool_run_id}", + "url": f"/api/tool-runs/{tool_run_id}", } return _kwargs diff --git a/griptape_cloud_client/api/tool_runs/list_tool_run_logs.py b/griptape_cloud_client/api/tool_runs/list_tool_run_logs.py index 15df759..cd2c6bc 100644 --- a/griptape_cloud_client/api/tool_runs/list_tool_run_logs.py +++ b/griptape_cloud_client/api/tool_runs/list_tool_run_logs.py @@ -16,7 +16,7 @@ def _get_kwargs( ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", - "url": f"/tool-runs/{tool_run_id}/logs", + "url": f"/api/tool-runs/{tool_run_id}/logs", } return _kwargs diff --git a/griptape_cloud_client/api/tool_runs/list_tool_runs.py b/griptape_cloud_client/api/tool_runs/list_tool_runs.py index 0e74bee..89c72b0 100644 --- a/griptape_cloud_client/api/tool_runs/list_tool_runs.py +++ b/griptape_cloud_client/api/tool_runs/list_tool_runs.py @@ -38,7 +38,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/tools/{tool_id}/runs", + "url": f"/api/tools/{tool_id}/runs", "params": params, } diff --git a/griptape_cloud_client/api/tools/create_tool.py b/griptape_cloud_client/api/tools/create_tool.py index 52f7bdd..0fb3399 100644 --- a/griptape_cloud_client/api/tools/create_tool.py +++ b/griptape_cloud_client/api/tools/create_tool.py @@ -20,7 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/tools", + "url": "/api/tools", } _kwargs["json"] = body.to_dict() diff --git a/griptape_cloud_client/api/tools/delete_tool.py b/griptape_cloud_client/api/tools/delete_tool.py index de0ba02..d3a37cd 100644 --- a/griptape_cloud_client/api/tools/delete_tool.py +++ b/griptape_cloud_client/api/tools/delete_tool.py @@ -15,7 +15,7 @@ def _get_kwargs( ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/tools/{tool_id}", + "url": f"/api/tools/{tool_id}", } return _kwargs diff --git a/griptape_cloud_client/api/tools/get_tool.py b/griptape_cloud_client/api/tools/get_tool.py index ea969d3..85dfe7e 100644 --- a/griptape_cloud_client/api/tools/get_tool.py +++ b/griptape_cloud_client/api/tools/get_tool.py @@ -16,7 +16,7 @@ def _get_kwargs( ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", - "url": f"/tools/{tool_id}", + "url": f"/api/tools/{tool_id}", } return _kwargs diff --git a/griptape_cloud_client/api/tools/list_tools.py b/griptape_cloud_client/api/tools/list_tools.py index e2acd62..787c642 100644 --- a/griptape_cloud_client/api/tools/list_tools.py +++ b/griptape_cloud_client/api/tools/list_tools.py @@ -26,7 +26,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/tools", + "url": "/api/tools", "params": params, } diff --git a/griptape_cloud_client/api/tools/update_tool.py b/griptape_cloud_client/api/tools/update_tool.py index 31c05e9..5aef4e2 100644 --- a/griptape_cloud_client/api/tools/update_tool.py +++ b/griptape_cloud_client/api/tools/update_tool.py @@ -21,7 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "patch", - "url": f"/tools/{tool_id}", + "url": f"/api/tools/{tool_id}", } _kwargs["json"] = body.to_dict() diff --git a/griptape_cloud_client/api/usage/create_nodes_usage.py b/griptape_cloud_client/api/usage/create_nodes_usage.py index 2758d76..3fca5eb 100644 --- a/griptape_cloud_client/api/usage/create_nodes_usage.py +++ b/griptape_cloud_client/api/usage/create_nodes_usage.py @@ -19,7 +19,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/usage/report/nodes", + "url": "/api/usage/report/nodes", } _kwargs["json"] = body.to_dict() diff --git a/griptape_cloud_client/api/usage/get_usage.py b/griptape_cloud_client/api/usage/get_usage.py index 071c3f2..c0d61d1 100644 --- a/griptape_cloud_client/api/usage/get_usage.py +++ b/griptape_cloud_client/api/usage/get_usage.py @@ -14,7 +14,7 @@ def _get_kwargs() -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", - "url": "/usage", + "url": "/api/usage", } return _kwargs diff --git a/griptape_cloud_client/api/users/get_user.py b/griptape_cloud_client/api/users/get_user.py index 77aecf3..0abc7b2 100644 --- a/griptape_cloud_client/api/users/get_user.py +++ b/griptape_cloud_client/api/users/get_user.py @@ -16,7 +16,7 @@ def _get_kwargs( ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", - "url": f"/users/{user_id}", + "url": f"/api/users/{user_id}", } return _kwargs diff --git a/griptape_cloud_client/models/__init__.py b/griptape_cloud_client/models/__init__.py index ed1f42b..8c7d63b 100644 --- a/griptape_cloud_client/models/__init__.py +++ b/griptape_cloud_client/models/__init__.py @@ -1,6 +1,8 @@ """Contains all the data models used in inputs/outputs""" from .activity_duration import ActivityDuration +from .allocate_session_request_content import AllocateSessionRequestContent +from .allocate_session_response_content import AllocateSessionResponseContent from .api_key_detail import ApiKeyDetail from .artifact import Artifact from .assert_url_operation import AssertUrlOperation @@ -9,6 +11,7 @@ from .assistant_event_detail import AssistantEventDetail from .assistant_run_detail import AssistantRunDetail from .assistant_run_status import AssistantRunStatus +from .auth_config_detail import AuthConfigDetail from .bucket_detail import BucketDetail from .cancel_assistant_run_response_content import CancelAssistantRunResponseContent from .cancel_data_job_response_content import CancelDataJobResponseContent @@ -37,6 +40,8 @@ from .create_assistant_response_content import CreateAssistantResponseContent from .create_assistant_run_request_content import CreateAssistantRunRequestContent from .create_assistant_run_response_content import CreateAssistantRunResponseContent +from .create_auth_config_request_content import CreateAuthConfigRequestContent +from .create_auth_config_response_content import CreateAuthConfigResponseContent from .create_billing_management_url_response_content import CreateBillingManagementUrlResponseContent from .create_bucket_request_content import CreateBucketRequestContent from .create_bucket_response_content import CreateBucketResponseContent @@ -51,11 +56,17 @@ from .create_data_connector_request_content import CreateDataConnectorRequestContent from .create_data_connector_response_content import CreateDataConnectorResponseContent from .create_data_job_response_content import CreateDataJobResponseContent +from .create_entitlement_policy_request_content import CreateEntitlementPolicyRequestContent +from .create_entitlement_policy_response_content import CreateEntitlementPolicyResponseContent from .create_events_request_content import CreateEventsRequestContent +from .create_export_job_request_content import CreateExportJobRequestContent +from .create_export_job_response_content import CreateExportJobResponseContent from .create_function_deployment_request_content import CreateFunctionDeploymentRequestContent from .create_function_deployment_response_content import CreateFunctionDeploymentResponseContent from .create_function_request_content import CreateFunctionRequestContent from .create_function_response_content import CreateFunctionResponseContent +from .create_import_job_request_content import CreateImportJobRequestContent +from .create_import_job_response_content import CreateImportJobResponseContent from .create_integration_request_content import CreateIntegrationRequestContent from .create_integration_response_content import CreateIntegrationResponseContent from .create_invite_request_content import CreateInviteRequestContent @@ -65,12 +76,19 @@ from .create_knowledge_base_response_content import CreateKnowledgeBaseResponseContent from .create_library_request_content import CreateLibraryRequestContent from .create_library_response_content import CreateLibraryResponseContent +from .create_license_group_request_content import CreateLicenseGroupRequestContent +from .create_license_group_response_content import CreateLicenseGroupResponseContent +from .create_license_request_content import CreateLicenseRequestContent +from .create_license_response_content import CreateLicenseResponseContent from .create_message_request_content import CreateMessageRequestContent from .create_message_response_content import CreateMessageResponseContent +from .create_model_request_content import CreateModelRequestContent +from .create_model_response_content import CreateModelResponseContent from .create_nodes_usage_request_content import CreateNodesUsageRequestContent from .create_organization_api_key_request_content import CreateOrganizationApiKeyRequestContent from .create_organization_api_key_response_content import CreateOrganizationApiKeyResponseContent from .create_organization_request_content import CreateOrganizationRequestContent +from .create_organization_response_content import CreateOrganizationResponseContent from .create_retriever_component_request_content import CreateRetrieverComponentRequestContent from .create_retriever_component_response_content import CreateRetrieverComponentResponseContent from .create_retriever_request_content import CreateRetrieverRequestContent @@ -93,6 +111,7 @@ from .create_tool_deployment_response_content import CreateToolDeploymentResponseContent from .create_tool_request_content import CreateToolRequestContent from .create_tool_response_content import CreateToolResponseContent +from .credit_transaction_detail import CreditTransactionDetail from .credit_transaction_type import CreditTransactionType from .data_connector_config_input_union_type_0 import DataConnectorConfigInputUnionType0 from .data_connector_config_input_union_type_1 import DataConnectorConfigInputUnionType1 @@ -126,6 +145,7 @@ from .duration_timeseries_element import DurationTimeseriesElement from .embedding_model import EmbeddingModel from .entitlement import Entitlement +from .entitlement_policy_detail import EntitlementPolicyDetail from .entry import Entry from .env_var import EnvVar from .env_var_source import EnvVarSource @@ -134,6 +154,8 @@ from .error_type_count import ErrorTypeCount from .event_detail import EventDetail from .event_input import EventInput +from .export_job_detail import ExportJobDetail +from .export_job_status import ExportJobStatus from .function_code_type_0 import FunctionCodeType0 from .function_code_type_1 import FunctionCodeType1 from .function_code_type_2 import FunctionCodeType2 @@ -145,15 +167,19 @@ from .get_asset_response_content import GetAssetResponseContent from .get_assistant_response_content import GetAssistantResponseContent from .get_assistant_run_response_content import GetAssistantRunResponseContent +from .get_auth_config_response_content import GetAuthConfigResponseContent from .get_bucket_response_content import GetBucketResponseContent from .get_config_response_content import GetConfigResponseContent from .get_credit_balance_response_content import GetCreditBalanceResponseContent from .get_data_connector_response_content import GetDataConnectorResponseContent from .get_data_job_response_content import GetDataJobResponseContent from .get_deployment_response_content import GetDeploymentResponseContent +from .get_entitlement_policy_response_content import GetEntitlementPolicyResponseContent from .get_event_response_content import GetEventResponseContent +from .get_export_job_response_content import GetExportJobResponseContent from .get_function_response_content import GetFunctionResponseContent from .get_function_run_response_content import GetFunctionRunResponseContent +from .get_import_job_response_content import GetImportJobResponseContent from .get_integration_response_content import GetIntegrationResponseContent from .get_invite_response_content import GetInviteResponseContent from .get_knowledge_base_job_response_content import GetKnowledgeBaseJobResponseContent @@ -161,12 +187,18 @@ from .get_knowledge_base_response_content import GetKnowledgeBaseResponseContent from .get_knowledge_base_search_response_content import GetKnowledgeBaseSearchResponseContent from .get_library_response_content import GetLibraryResponseContent +from .get_license_group_response_content import GetLicenseGroupResponseContent +from .get_license_response_content import GetLicenseResponseContent from .get_message_response_content import GetMessageResponseContent +from .get_model_response_content import GetModelResponseContent +from .get_organization_response_content import GetOrganizationResponseContent from .get_retriever_component_response_content import GetRetrieverComponentResponseContent from .get_retriever_response_content import GetRetrieverResponseContent from .get_rule_response_content import GetRuleResponseContent from .get_ruleset_response_content import GetRulesetResponseContent from .get_secret_response_content import GetSecretResponseContent +from .get_session_pool_response_content import GetSessionPoolResponseContent +from .get_session_response_content import GetSessionResponseContent from .get_structure_response_content import GetStructureResponseContent from .get_structure_run_response_content import GetStructureRunResponseContent from .get_structures_dashboard_response_content import GetStructuresDashboardResponseContent @@ -193,6 +225,8 @@ from .gtc_hybid_sqlpg_vector_knowledge_base_input import GTCHybidSQLPGVectorKnowledgeBaseInput from .gtcpg_vector_knowledge_base_detail import GTCPGVectorKnowledgeBaseDetail from .gtcpg_vector_knowledge_base_input import GTCPGVectorKnowledgeBaseInput +from .import_job_detail import ImportJobDetail +from .import_job_status import ImportJobStatus from .integration_config_input_union_type_0 import IntegrationConfigInputUnionType0 from .integration_config_input_union_type_1 import IntegrationConfigInputUnionType1 from .integration_config_input_union_type_2 import IntegrationConfigInputUnionType2 @@ -223,20 +257,29 @@ from .knowledge_base_query_detail import KnowledgeBaseQueryDetail from .knowledge_base_search_detail import KnowledgeBaseSearchDetail from .library_detail import LibraryDetail +from .license_detail import LicenseDetail +from .license_group_detail import LicenseGroupDetail +from .license_status import LicenseStatus +from .license_type import LicenseType from .list_api_keys_response_content import ListApiKeysResponseContent from .list_assets_response_content import ListAssetsResponseContent from .list_assistant_events_response_content import ListAssistantEventsResponseContent from .list_assistant_runs_response_content import ListAssistantRunsResponseContent from .list_assistants_response_content import ListAssistantsResponseContent +from .list_auth_configs_response_content import ListAuthConfigsResponseContent from .list_buckets_response_content import ListBucketsResponseContent from .list_connections_response_content import ListConnectionsResponseContent +from .list_credit_transactions_response_content import ListCreditTransactionsResponseContent from .list_data_connectors_response_content import ListDataConnectorsResponseContent from .list_data_jobs_response_content import ListDataJobsResponseContent +from .list_entitlement_policies_response_content import ListEntitlementPoliciesResponseContent from .list_events_response_content import ListEventsResponseContent +from .list_export_jobs_response_content import ListExportJobsResponseContent from .list_function_deployments_response_content import ListFunctionDeploymentsResponseContent from .list_function_run_logs_response_content import ListFunctionRunLogsResponseContent from .list_function_runs_response_content import ListFunctionRunsResponseContent from .list_functions_response_content import ListFunctionsResponseContent +from .list_import_jobs_response_content import ListImportJobsResponseContent from .list_integrations_response_content import ListIntegrationsResponseContent from .list_invites_response_content import ListInvitesResponseContent from .list_knowledge_base_jobs_response_content import ListKnowledgeBaseJobsResponseContent @@ -244,15 +287,19 @@ from .list_knowledge_base_searches_response_content import ListKnowledgeBaseSearchesResponseContent from .list_knowledge_bases_response_content import ListKnowledgeBasesResponseContent from .list_libraries_response_content import ListLibrariesResponseContent +from .list_license_groups_response_content import ListLicenseGroupsResponseContent +from .list_licenses_response_content import ListLicensesResponseContent from .list_messages_response_content import ListMessagesResponseContent from .list_models_response_content import ListModelsResponseContent from .list_organization_api_keys_response_content import ListOrganizationApiKeysResponseContent from .list_organization_users_response_content import ListOrganizationUsersResponseContent +from .list_organizations_response_content import ListOrganizationsResponseContent from .list_retriever_components_response_content import ListRetrieverComponentsResponseContent from .list_retrievers_response_content import ListRetrieversResponseContent from .list_rules_response_content import ListRulesResponseContent from .list_rulesets_response_content import ListRulesetsResponseContent from .list_secrets_response_content import ListSecretsResponseContent +from .list_sessions_response_content import ListSessionsResponseContent from .list_spans_response_content import ListSpansResponseContent from .list_structure_deployments_response_content import ListStructureDeploymentsResponseContent from .list_structure_run_logs_response_content import ListStructureRunLogsResponseContent @@ -275,6 +322,7 @@ from .model_token_counts_map import ModelTokenCountsMap from .model_type import ModelType from .observability_event import ObservabilityEvent +from .organization_detail import OrganizationDetail from .organization_model_config import OrganizationModelConfig from .organization_user_detail import OrganizationUserDetail from .pagination import Pagination @@ -287,6 +335,9 @@ from .query_knowledge_base_response_content import QueryKnowledgeBaseResponseContent from .query_retriever_request_content import QueryRetrieverRequestContent from .query_retriever_response_content import QueryRetrieverResponseContent +from .reissue_license_token_request_content import ReissueLicenseTokenRequestContent +from .reissue_license_token_response_content import ReissueLicenseTokenResponseContent +from .renew_session_response_content import RenewSessionResponseContent from .respond_to_invite_request_content import RespondToInviteRequestContent from .retriever_component_detail import RetrieverComponentDetail from .retriever_component_input import RetrieverComponentInput @@ -301,10 +352,13 @@ from .search_knowledge_base_response_content import SearchKnowledgeBaseResponseContent from .secret_detail import SecretDetail from .service_error_response_content import ServiceErrorResponseContent +from .session_detail import SessionDetail +from .session_status import SessionStatus from .slack_detail import SlackDetail from .slack_input import SlackInput from .span_detail import SpanDetail from .span_status import SpanStatus +from .start_import_job_response_content import StartImportJobResponseContent from .stream_message_content import StreamMessageContent from .structure_code_type_0 import StructureCodeType0 from .structure_code_type_1 import StructureCodeType1 @@ -334,10 +388,14 @@ from .update_api_key_response_content import UpdateApiKeyResponseContent from .update_assistant_request_content import UpdateAssistantRequestContent from .update_assistant_response_content import UpdateAssistantResponseContent +from .update_auth_config_request_content import UpdateAuthConfigRequestContent +from .update_auth_config_response_content import UpdateAuthConfigResponseContent from .update_bucket_request_content import UpdateBucketRequestContent from .update_bucket_response_content import UpdateBucketResponseContent from .update_data_connector_request_content import UpdateDataConnectorRequestContent from .update_data_connector_response_content import UpdateDataConnectorResponseContent +from .update_entitlement_policy_request_content import UpdateEntitlementPolicyRequestContent +from .update_entitlement_policy_response_content import UpdateEntitlementPolicyResponseContent from .update_function_request_content import UpdateFunctionRequestContent from .update_function_response_content import UpdateFunctionResponseContent from .update_integration_request_content import UpdateIntegrationRequestContent @@ -346,9 +404,16 @@ from .update_knowledge_base_response_content import UpdateKnowledgeBaseResponseContent from .update_library_request_content import UpdateLibraryRequestContent from .update_library_response_content import UpdateLibraryResponseContent +from .update_license_group_request_content import UpdateLicenseGroupRequestContent +from .update_license_group_response_content import UpdateLicenseGroupResponseContent +from .update_license_request_content import UpdateLicenseRequestContent +from .update_license_response_content import UpdateLicenseResponseContent from .update_message_request_content import UpdateMessageRequestContent from .update_message_response_content import UpdateMessageResponseContent +from .update_model_request_content import UpdateModelRequestContent +from .update_model_response_content import UpdateModelResponseContent from .update_organization_request_content import UpdateOrganizationRequestContent +from .update_organization_response_content import UpdateOrganizationResponseContent from .update_retriever_component_request_content import UpdateRetrieverComponentRequestContent from .update_retriever_component_response_content import UpdateRetrieverComponentResponseContent from .update_retriever_request_content import UpdateRetrieverRequestContent @@ -359,6 +424,8 @@ from .update_ruleset_response_content import UpdateRulesetResponseContent from .update_secret_request_content import UpdateSecretRequestContent from .update_secret_response_content import UpdateSecretResponseContent +from .update_session_request_content import UpdateSessionRequestContent +from .update_session_response_content import UpdateSessionResponseContent from .update_structure_request_content import UpdateStructureRequestContent from .update_structure_response_content import UpdateStructureResponseContent from .update_thread_request_content import UpdateThreadRequestContent @@ -373,6 +440,8 @@ __all__ = ( "ActivityDuration", + "AllocateSessionRequestContent", + "AllocateSessionResponseContent", "ApiKeyDetail", "Artifact", "AssertUrlOperation", @@ -381,6 +450,7 @@ "AssistantEventDetail", "AssistantRunDetail", "AssistantRunStatus", + "AuthConfigDetail", "BucketDetail", "CancelAssistantRunResponseContent", "CancelDataJobResponseContent", @@ -409,6 +479,8 @@ "CreateAssistantResponseContent", "CreateAssistantRunRequestContent", "CreateAssistantRunResponseContent", + "CreateAuthConfigRequestContent", + "CreateAuthConfigResponseContent", "CreateBillingManagementUrlResponseContent", "CreateBucketRequestContent", "CreateBucketResponseContent", @@ -423,11 +495,17 @@ "CreateDataConnectorRequestContent", "CreateDataConnectorResponseContent", "CreateDataJobResponseContent", + "CreateEntitlementPolicyRequestContent", + "CreateEntitlementPolicyResponseContent", "CreateEventsRequestContent", + "CreateExportJobRequestContent", + "CreateExportJobResponseContent", "CreateFunctionDeploymentRequestContent", "CreateFunctionDeploymentResponseContent", "CreateFunctionRequestContent", "CreateFunctionResponseContent", + "CreateImportJobRequestContent", + "CreateImportJobResponseContent", "CreateIntegrationRequestContent", "CreateIntegrationResponseContent", "CreateInviteRequestContent", @@ -437,12 +515,19 @@ "CreateKnowledgeBaseResponseContent", "CreateLibraryRequestContent", "CreateLibraryResponseContent", + "CreateLicenseGroupRequestContent", + "CreateLicenseGroupResponseContent", + "CreateLicenseRequestContent", + "CreateLicenseResponseContent", "CreateMessageRequestContent", "CreateMessageResponseContent", + "CreateModelRequestContent", + "CreateModelResponseContent", "CreateNodesUsageRequestContent", "CreateOrganizationApiKeyRequestContent", "CreateOrganizationApiKeyResponseContent", "CreateOrganizationRequestContent", + "CreateOrganizationResponseContent", "CreateRetrieverComponentRequestContent", "CreateRetrieverComponentResponseContent", "CreateRetrieverRequestContent", @@ -465,6 +550,7 @@ "CreateToolDeploymentResponseContent", "CreateToolRequestContent", "CreateToolResponseContent", + "CreditTransactionDetail", "CreditTransactionType", "DataConnectorConfigInputUnionType0", "DataConnectorConfigInputUnionType1", @@ -498,6 +584,7 @@ "DurationTimeseriesElement", "EmbeddingModel", "Entitlement", + "EntitlementPolicyDetail", "Entry", "EnvVar", "EnvVarSource", @@ -506,6 +593,8 @@ "ErrorTypeCount", "EventDetail", "EventInput", + "ExportJobDetail", + "ExportJobStatus", "FunctionCodeType0", "FunctionCodeType1", "FunctionCodeType2", @@ -517,15 +606,19 @@ "GetAssetResponseContent", "GetAssistantResponseContent", "GetAssistantRunResponseContent", + "GetAuthConfigResponseContent", "GetBucketResponseContent", "GetConfigResponseContent", "GetCreditBalanceResponseContent", "GetDataConnectorResponseContent", "GetDataJobResponseContent", "GetDeploymentResponseContent", + "GetEntitlementPolicyResponseContent", "GetEventResponseContent", + "GetExportJobResponseContent", "GetFunctionResponseContent", "GetFunctionRunResponseContent", + "GetImportJobResponseContent", "GetIntegrationResponseContent", "GetInviteResponseContent", "GetKnowledgeBaseJobResponseContent", @@ -533,12 +626,18 @@ "GetKnowledgeBaseResponseContent", "GetKnowledgeBaseSearchResponseContent", "GetLibraryResponseContent", + "GetLicenseGroupResponseContent", + "GetLicenseResponseContent", "GetMessageResponseContent", + "GetModelResponseContent", + "GetOrganizationResponseContent", "GetRetrieverComponentResponseContent", "GetRetrieverResponseContent", "GetRuleResponseContent", "GetRulesetResponseContent", "GetSecretResponseContent", + "GetSessionPoolResponseContent", + "GetSessionResponseContent", "GetStructureResponseContent", "GetStructureRunResponseContent", "GetStructuresDashboardResponseContent", @@ -565,6 +664,8 @@ "GTCHybidSQLPGVectorKnowledgeBaseInput", "GTCPGVectorKnowledgeBaseDetail", "GTCPGVectorKnowledgeBaseInput", + "ImportJobDetail", + "ImportJobStatus", "IntegrationConfigInputUnionType0", "IntegrationConfigInputUnionType1", "IntegrationConfigInputUnionType2", @@ -595,20 +696,29 @@ "KnowledgeBaseQueryDetail", "KnowledgeBaseSearchDetail", "LibraryDetail", + "LicenseDetail", + "LicenseGroupDetail", + "LicenseStatus", + "LicenseType", "ListApiKeysResponseContent", "ListAssetsResponseContent", "ListAssistantEventsResponseContent", "ListAssistantRunsResponseContent", "ListAssistantsResponseContent", + "ListAuthConfigsResponseContent", "ListBucketsResponseContent", "ListConnectionsResponseContent", + "ListCreditTransactionsResponseContent", "ListDataConnectorsResponseContent", "ListDataJobsResponseContent", + "ListEntitlementPoliciesResponseContent", "ListEventsResponseContent", + "ListExportJobsResponseContent", "ListFunctionDeploymentsResponseContent", "ListFunctionRunLogsResponseContent", "ListFunctionRunsResponseContent", "ListFunctionsResponseContent", + "ListImportJobsResponseContent", "ListIntegrationsResponseContent", "ListInvitesResponseContent", "ListKnowledgeBaseJobsResponseContent", @@ -616,15 +726,19 @@ "ListKnowledgeBaseSearchesResponseContent", "ListKnowledgeBasesResponseContent", "ListLibrariesResponseContent", + "ListLicenseGroupsResponseContent", + "ListLicensesResponseContent", "ListMessagesResponseContent", "ListModelsResponseContent", "ListOrganizationApiKeysResponseContent", + "ListOrganizationsResponseContent", "ListOrganizationUsersResponseContent", "ListRetrieverComponentsResponseContent", "ListRetrieversResponseContent", "ListRulesetsResponseContent", "ListRulesResponseContent", "ListSecretsResponseContent", + "ListSessionsResponseContent", "ListSpansResponseContent", "ListStructureDeploymentsResponseContent", "ListStructureRunLogsResponseContent", @@ -647,6 +761,7 @@ "ModelTokenCountsMap", "ModelType", "ObservabilityEvent", + "OrganizationDetail", "OrganizationModelConfig", "OrganizationUserDetail", "Pagination", @@ -659,6 +774,9 @@ "QueryKnowledgeBaseResponseContent", "QueryRetrieverRequestContent", "QueryRetrieverResponseContent", + "ReissueLicenseTokenRequestContent", + "ReissueLicenseTokenResponseContent", + "RenewSessionResponseContent", "RespondToInviteRequestContent", "RetrieverComponentDetail", "RetrieverComponentInput", @@ -673,10 +791,13 @@ "SearchKnowledgeBaseResponseContent", "SecretDetail", "ServiceErrorResponseContent", + "SessionDetail", + "SessionStatus", "SlackDetail", "SlackInput", "SpanDetail", "SpanStatus", + "StartImportJobResponseContent", "StreamMessageContent", "StructureCodeType0", "StructureCodeType1", @@ -706,10 +827,14 @@ "UpdateApiKeyResponseContent", "UpdateAssistantRequestContent", "UpdateAssistantResponseContent", + "UpdateAuthConfigRequestContent", + "UpdateAuthConfigResponseContent", "UpdateBucketRequestContent", "UpdateBucketResponseContent", "UpdateDataConnectorRequestContent", "UpdateDataConnectorResponseContent", + "UpdateEntitlementPolicyRequestContent", + "UpdateEntitlementPolicyResponseContent", "UpdateFunctionRequestContent", "UpdateFunctionResponseContent", "UpdateIntegrationRequestContent", @@ -718,9 +843,16 @@ "UpdateKnowledgeBaseResponseContent", "UpdateLibraryRequestContent", "UpdateLibraryResponseContent", + "UpdateLicenseGroupRequestContent", + "UpdateLicenseGroupResponseContent", + "UpdateLicenseRequestContent", + "UpdateLicenseResponseContent", "UpdateMessageRequestContent", "UpdateMessageResponseContent", + "UpdateModelRequestContent", + "UpdateModelResponseContent", "UpdateOrganizationRequestContent", + "UpdateOrganizationResponseContent", "UpdateRetrieverComponentRequestContent", "UpdateRetrieverComponentResponseContent", "UpdateRetrieverRequestContent", @@ -731,6 +863,8 @@ "UpdateRulesetResponseContent", "UpdateSecretRequestContent", "UpdateSecretResponseContent", + "UpdateSessionRequestContent", + "UpdateSessionResponseContent", "UpdateStructureRequestContent", "UpdateStructureResponseContent", "UpdateThreadRequestContent", diff --git a/griptape_cloud_client/models/allocate_session_request_content.py b/griptape_cloud_client/models/allocate_session_request_content.py new file mode 100644 index 0000000..42bfc44 --- /dev/null +++ b/griptape_cloud_client/models/allocate_session_request_content.py @@ -0,0 +1,59 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="AllocateSessionRequestContent") + + +@_attrs_define +class AllocateSessionRequestContent: + """ + Attributes: + application_id (str): + """ + + application_id: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + application_id = self.application_id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "application_id": application_id, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + application_id = d.pop("application_id") + + allocate_session_request_content = cls( + application_id=application_id, + ) + + allocate_session_request_content.additional_properties = d + return allocate_session_request_content + + @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/griptape_cloud_client/models/allocate_session_response_content.py b/griptape_cloud_client/models/allocate_session_response_content.py new file mode 100644 index 0000000..0fa5e16 --- /dev/null +++ b/griptape_cloud_client/models/allocate_session_response_content.py @@ -0,0 +1,67 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="AllocateSessionResponseContent") + + +@_attrs_define +class AllocateSessionResponseContent: + """ + Attributes: + policy_documents (Any): + session_token (str): + """ + + policy_documents: Any + session_token: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + policy_documents = self.policy_documents + + session_token = self.session_token + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "policy_documents": policy_documents, + "session_token": session_token, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + policy_documents = d.pop("policy_documents") + + session_token = d.pop("session_token") + + allocate_session_response_content = cls( + policy_documents=policy_documents, + session_token=session_token, + ) + + allocate_session_response_content.additional_properties = d + return allocate_session_response_content + + @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/griptape_cloud_client/models/assistant_detail.py b/griptape_cloud_client/models/assistant_detail.py index 83661c2..01abcb7 100644 --- a/griptape_cloud_client/models/assistant_detail.py +++ b/griptape_cloud_client/models/assistant_detail.py @@ -28,6 +28,7 @@ class AssistantDetail: tool_ids (list[str]): updated_at (datetime.datetime): input_ (Union[Unset, str]): + model (Union[Unset, str]): """ assistant_id: str @@ -43,6 +44,7 @@ class AssistantDetail: tool_ids: list[str] updated_at: datetime.datetime input_: Union[Unset, str] = UNSET + model: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -72,6 +74,8 @@ def to_dict(self) -> dict[str, Any]: input_ = self.input_ + model = self.model + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( @@ -92,6 +96,8 @@ def to_dict(self) -> dict[str, Any]: ) if input_ is not UNSET: field_dict["input"] = input_ + if model is not UNSET: + field_dict["model"] = model return field_dict @@ -124,6 +130,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: input_ = d.pop("input", UNSET) + model = d.pop("model", UNSET) + assistant_detail = cls( assistant_id=assistant_id, created_at=created_at, @@ -138,6 +146,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: tool_ids=tool_ids, updated_at=updated_at, input_=input_, + model=model, ) assistant_detail.additional_properties = d diff --git a/griptape_cloud_client/models/assistant_run_detail.py b/griptape_cloud_client/models/assistant_run_detail.py index c9df3f2..8e73b5b 100644 --- a/griptape_cloud_client/models/assistant_run_detail.py +++ b/griptape_cloud_client/models/assistant_run_detail.py @@ -31,6 +31,7 @@ class AssistantRunDetail: tool_ids (list[str]): updated_at (datetime.datetime): input_ (Union[Unset, str]): + model (Union[Unset, str]): output (Union[Unset, Any]): status_detail (Union[Unset, Any]): thread_id (Union[Unset, str]): @@ -51,6 +52,7 @@ class AssistantRunDetail: tool_ids: list[str] updated_at: datetime.datetime input_: Union[Unset, str] = UNSET + model: Union[Unset, str] = UNSET output: Union[Unset, Any] = UNSET status_detail: Union[Unset, Any] = UNSET thread_id: Union[Unset, str] = UNSET @@ -91,6 +93,8 @@ def to_dict(self) -> dict[str, Any]: input_ = self.input_ + model = self.model + output = self.output status_detail = self.status_detail @@ -119,6 +123,8 @@ def to_dict(self) -> dict[str, Any]: ) if input_ is not UNSET: field_dict["input"] = input_ + if model is not UNSET: + field_dict["model"] = model if output is not UNSET: field_dict["output"] = output if status_detail is not UNSET: @@ -174,6 +180,8 @@ def _parse_completed_at(data: object) -> Union[None, datetime.datetime]: input_ = d.pop("input", UNSET) + model = d.pop("model", UNSET) + output = d.pop("output", UNSET) status_detail = d.pop("status_detail", UNSET) @@ -196,6 +204,7 @@ def _parse_completed_at(data: object) -> Union[None, datetime.datetime]: tool_ids=tool_ids, updated_at=updated_at, input_=input_, + model=model, output=output, status_detail=status_detail, thread_id=thread_id, diff --git a/griptape_cloud_client/models/auth_config_detail.py b/griptape_cloud_client/models/auth_config_detail.py new file mode 100644 index 0000000..3e7cd73 --- /dev/null +++ b/griptape_cloud_client/models/auth_config_detail.py @@ -0,0 +1,112 @@ +import datetime +from collections.abc import Mapping +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="AuthConfigDetail") + + +@_attrs_define +class AuthConfigDetail: + """ + Attributes: + api_key_secret_id (str): + auth_config_id (str): + base_url (str): + created_at (datetime.datetime): + name (str): + updated_at (datetime.datetime): + kwargs (Union[Unset, Any]): + """ + + api_key_secret_id: str + auth_config_id: str + base_url: str + created_at: datetime.datetime + name: str + updated_at: datetime.datetime + kwargs: Union[Unset, Any] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + api_key_secret_id = self.api_key_secret_id + + auth_config_id = self.auth_config_id + + base_url = self.base_url + + created_at = self.created_at.isoformat() + + name = self.name + + updated_at = self.updated_at.isoformat() + + kwargs = self.kwargs + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "api_key_secret_id": api_key_secret_id, + "auth_config_id": auth_config_id, + "base_url": base_url, + "created_at": created_at, + "name": name, + "updated_at": updated_at, + } + ) + if kwargs is not UNSET: + field_dict["kwargs"] = kwargs + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + api_key_secret_id = d.pop("api_key_secret_id") + + auth_config_id = d.pop("auth_config_id") + + base_url = d.pop("base_url") + + created_at = isoparse(d.pop("created_at")) + + name = d.pop("name") + + updated_at = isoparse(d.pop("updated_at")) + + kwargs = d.pop("kwargs", UNSET) + + auth_config_detail = cls( + api_key_secret_id=api_key_secret_id, + auth_config_id=auth_config_id, + base_url=base_url, + created_at=created_at, + name=name, + updated_at=updated_at, + kwargs=kwargs, + ) + + auth_config_detail.additional_properties = d + return auth_config_detail + + @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/griptape_cloud_client/models/cancel_assistant_run_response_content.py b/griptape_cloud_client/models/cancel_assistant_run_response_content.py index a2eaa80..d04588a 100644 --- a/griptape_cloud_client/models/cancel_assistant_run_response_content.py +++ b/griptape_cloud_client/models/cancel_assistant_run_response_content.py @@ -31,6 +31,7 @@ class CancelAssistantRunResponseContent: tool_ids (list[str]): updated_at (datetime.datetime): input_ (Union[Unset, str]): + model (Union[Unset, str]): output (Union[Unset, Any]): status_detail (Union[Unset, Any]): thread_id (Union[Unset, str]): @@ -51,6 +52,7 @@ class CancelAssistantRunResponseContent: tool_ids: list[str] updated_at: datetime.datetime input_: Union[Unset, str] = UNSET + model: Union[Unset, str] = UNSET output: Union[Unset, Any] = UNSET status_detail: Union[Unset, Any] = UNSET thread_id: Union[Unset, str] = UNSET @@ -91,6 +93,8 @@ def to_dict(self) -> dict[str, Any]: input_ = self.input_ + model = self.model + output = self.output status_detail = self.status_detail @@ -119,6 +123,8 @@ def to_dict(self) -> dict[str, Any]: ) if input_ is not UNSET: field_dict["input"] = input_ + if model is not UNSET: + field_dict["model"] = model if output is not UNSET: field_dict["output"] = output if status_detail is not UNSET: @@ -174,6 +180,8 @@ def _parse_completed_at(data: object) -> Union[None, datetime.datetime]: input_ = d.pop("input", UNSET) + model = d.pop("model", UNSET) + output = d.pop("output", UNSET) status_detail = d.pop("status_detail", UNSET) @@ -196,6 +204,7 @@ def _parse_completed_at(data: object) -> Union[None, datetime.datetime]: tool_ids=tool_ids, updated_at=updated_at, input_=input_, + model=model, output=output, status_detail=status_detail, thread_id=thread_id, diff --git a/griptape_cloud_client/models/create_asset_url_request_content.py b/griptape_cloud_client/models/create_asset_url_request_content.py index eb18bd4..322ff69 100644 --- a/griptape_cloud_client/models/create_asset_url_request_content.py +++ b/griptape_cloud_client/models/create_asset_url_request_content.py @@ -14,13 +14,18 @@ class CreateAssetUrlRequestContent: """ Attributes: + content_type (Union[Unset, str]): Optional MIME type to apply to the presigned URL. When provided, overrides the + type guessed from the asset name. Must be of the form 'type/subtype'. operation (Union[Unset, AssertUrlOperation]): """ + content_type: Union[Unset, str] = UNSET operation: Union[Unset, AssertUrlOperation] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + content_type = self.content_type + operation: Union[Unset, str] = UNSET if not isinstance(self.operation, Unset): operation = self.operation.value @@ -28,6 +33,8 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({}) + if content_type is not UNSET: + field_dict["content_type"] = content_type if operation is not UNSET: field_dict["operation"] = operation @@ -36,6 +43,8 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) + content_type = d.pop("content_type", UNSET) + _operation = d.pop("operation", UNSET) operation: Union[Unset, AssertUrlOperation] if isinstance(_operation, Unset): @@ -44,6 +53,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: operation = AssertUrlOperation(_operation) create_asset_url_request_content = cls( + content_type=content_type, operation=operation, ) diff --git a/griptape_cloud_client/models/create_assistant_request_content.py b/griptape_cloud_client/models/create_assistant_request_content.py index 4328216..fb8bd0f 100644 --- a/griptape_cloud_client/models/create_assistant_request_content.py +++ b/griptape_cloud_client/models/create_assistant_request_content.py @@ -17,6 +17,7 @@ class CreateAssistantRequestContent: description (Union[Unset, str]): input_ (Union[Unset, str]): knowledge_base_ids (Union[Unset, list[str]]): + model (Union[Unset, str]): retriever_ids (Union[Unset, list[str]]): ruleset_ids (Union[Unset, list[str]]): structure_ids (Union[Unset, list[str]]): @@ -27,6 +28,7 @@ class CreateAssistantRequestContent: description: Union[Unset, str] = UNSET input_: Union[Unset, str] = UNSET knowledge_base_ids: Union[Unset, list[str]] = UNSET + model: Union[Unset, str] = UNSET retriever_ids: Union[Unset, list[str]] = UNSET ruleset_ids: Union[Unset, list[str]] = UNSET structure_ids: Union[Unset, list[str]] = UNSET @@ -44,6 +46,8 @@ def to_dict(self) -> dict[str, Any]: if not isinstance(self.knowledge_base_ids, Unset): knowledge_base_ids = self.knowledge_base_ids + model = self.model + retriever_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.retriever_ids, Unset): retriever_ids = self.retriever_ids @@ -73,6 +77,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["input"] = input_ if knowledge_base_ids is not UNSET: field_dict["knowledge_base_ids"] = knowledge_base_ids + if model is not UNSET: + field_dict["model"] = model if retriever_ids is not UNSET: field_dict["retriever_ids"] = retriever_ids if ruleset_ids is not UNSET: @@ -95,6 +101,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: knowledge_base_ids = cast(list[str], d.pop("knowledge_base_ids", UNSET)) + model = d.pop("model", UNSET) + retriever_ids = cast(list[str], d.pop("retriever_ids", UNSET)) ruleset_ids = cast(list[str], d.pop("ruleset_ids", UNSET)) @@ -108,6 +116,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description=description, input_=input_, knowledge_base_ids=knowledge_base_ids, + model=model, retriever_ids=retriever_ids, ruleset_ids=ruleset_ids, structure_ids=structure_ids, diff --git a/griptape_cloud_client/models/create_assistant_response_content.py b/griptape_cloud_client/models/create_assistant_response_content.py index 83401b4..58b24b7 100644 --- a/griptape_cloud_client/models/create_assistant_response_content.py +++ b/griptape_cloud_client/models/create_assistant_response_content.py @@ -28,6 +28,7 @@ class CreateAssistantResponseContent: tool_ids (list[str]): updated_at (datetime.datetime): input_ (Union[Unset, str]): + model (Union[Unset, str]): """ assistant_id: str @@ -43,6 +44,7 @@ class CreateAssistantResponseContent: tool_ids: list[str] updated_at: datetime.datetime input_: Union[Unset, str] = UNSET + model: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -72,6 +74,8 @@ def to_dict(self) -> dict[str, Any]: input_ = self.input_ + model = self.model + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( @@ -92,6 +96,8 @@ def to_dict(self) -> dict[str, Any]: ) if input_ is not UNSET: field_dict["input"] = input_ + if model is not UNSET: + field_dict["model"] = model return field_dict @@ -124,6 +130,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: input_ = d.pop("input", UNSET) + model = d.pop("model", UNSET) + create_assistant_response_content = cls( assistant_id=assistant_id, created_at=created_at, @@ -138,6 +146,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: tool_ids=tool_ids, updated_at=updated_at, input_=input_, + model=model, ) create_assistant_response_content.additional_properties = d diff --git a/griptape_cloud_client/models/create_assistant_run_request_content.py b/griptape_cloud_client/models/create_assistant_run_request_content.py index 19cb47a..a3503fc 100644 --- a/griptape_cloud_client/models/create_assistant_run_request_content.py +++ b/griptape_cloud_client/models/create_assistant_run_request_content.py @@ -21,6 +21,7 @@ class CreateAssistantRunRequestContent: args (Union[Unset, list[str]]): input_ (Union[Unset, str]): knowledge_base_ids (Union[Unset, list[str]]): + model (Union[Unset, str]): new_thread (Union[Unset, bool]): If true, create a new thread for this run to be returned in the response thread_id. retriever_ids (Union[Unset, list[str]]): @@ -40,6 +41,7 @@ class CreateAssistantRunRequestContent: args: Union[Unset, list[str]] = UNSET input_: Union[Unset, str] = UNSET knowledge_base_ids: Union[Unset, list[str]] = UNSET + model: Union[Unset, str] = UNSET new_thread: Union[Unset, bool] = UNSET retriever_ids: Union[Unset, list[str]] = UNSET ruleset_ids: Union[Unset, list[str]] = UNSET @@ -80,6 +82,8 @@ def to_dict(self) -> dict[str, Any]: if not isinstance(self.knowledge_base_ids, Unset): knowledge_base_ids = self.knowledge_base_ids + model = self.model + new_thread = self.new_thread retriever_ids: Union[Unset, list[str]] = UNSET @@ -121,6 +125,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["input"] = input_ if knowledge_base_ids is not UNSET: field_dict["knowledge_base_ids"] = knowledge_base_ids + if model is not UNSET: + field_dict["model"] = model if new_thread is not UNSET: field_dict["new_thread"] = new_thread if retriever_ids is not UNSET: @@ -157,6 +163,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: knowledge_base_ids = cast(list[str], d.pop("knowledge_base_ids", UNSET)) + model = d.pop("model", UNSET) + new_thread = d.pop("new_thread", UNSET) retriever_ids = cast(list[str], d.pop("retriever_ids", UNSET)) @@ -180,6 +188,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: args=args, input_=input_, knowledge_base_ids=knowledge_base_ids, + model=model, new_thread=new_thread, retriever_ids=retriever_ids, ruleset_ids=ruleset_ids, diff --git a/griptape_cloud_client/models/create_assistant_run_response_content.py b/griptape_cloud_client/models/create_assistant_run_response_content.py index 64c1818..9285671 100644 --- a/griptape_cloud_client/models/create_assistant_run_response_content.py +++ b/griptape_cloud_client/models/create_assistant_run_response_content.py @@ -31,6 +31,7 @@ class CreateAssistantRunResponseContent: tool_ids (list[str]): updated_at (datetime.datetime): input_ (Union[Unset, str]): + model (Union[Unset, str]): output (Union[Unset, Any]): status_detail (Union[Unset, Any]): thread_id (Union[Unset, str]): @@ -51,6 +52,7 @@ class CreateAssistantRunResponseContent: tool_ids: list[str] updated_at: datetime.datetime input_: Union[Unset, str] = UNSET + model: Union[Unset, str] = UNSET output: Union[Unset, Any] = UNSET status_detail: Union[Unset, Any] = UNSET thread_id: Union[Unset, str] = UNSET @@ -91,6 +93,8 @@ def to_dict(self) -> dict[str, Any]: input_ = self.input_ + model = self.model + output = self.output status_detail = self.status_detail @@ -119,6 +123,8 @@ def to_dict(self) -> dict[str, Any]: ) if input_ is not UNSET: field_dict["input"] = input_ + if model is not UNSET: + field_dict["model"] = model if output is not UNSET: field_dict["output"] = output if status_detail is not UNSET: @@ -174,6 +180,8 @@ def _parse_completed_at(data: object) -> Union[None, datetime.datetime]: input_ = d.pop("input", UNSET) + model = d.pop("model", UNSET) + output = d.pop("output", UNSET) status_detail = d.pop("status_detail", UNSET) @@ -196,6 +204,7 @@ def _parse_completed_at(data: object) -> Union[None, datetime.datetime]: tool_ids=tool_ids, updated_at=updated_at, input_=input_, + model=model, output=output, status_detail=status_detail, thread_id=thread_id, diff --git a/griptape_cloud_client/models/create_auth_config_request_content.py b/griptape_cloud_client/models/create_auth_config_request_content.py new file mode 100644 index 0000000..1f360dd --- /dev/null +++ b/griptape_cloud_client/models/create_auth_config_request_content.py @@ -0,0 +1,86 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CreateAuthConfigRequestContent") + + +@_attrs_define +class CreateAuthConfigRequestContent: + """ + Attributes: + api_key_secret_id (str): + base_url (str): + name (str): + kwargs (Union[Unset, Any]): + """ + + api_key_secret_id: str + base_url: str + name: str + kwargs: Union[Unset, Any] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + api_key_secret_id = self.api_key_secret_id + + base_url = self.base_url + + name = self.name + + kwargs = self.kwargs + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "api_key_secret_id": api_key_secret_id, + "base_url": base_url, + "name": name, + } + ) + if kwargs is not UNSET: + field_dict["kwargs"] = kwargs + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + api_key_secret_id = d.pop("api_key_secret_id") + + base_url = d.pop("base_url") + + name = d.pop("name") + + kwargs = d.pop("kwargs", UNSET) + + create_auth_config_request_content = cls( + api_key_secret_id=api_key_secret_id, + base_url=base_url, + name=name, + kwargs=kwargs, + ) + + create_auth_config_request_content.additional_properties = d + return create_auth_config_request_content + + @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/griptape_cloud_client/models/create_auth_config_response_content.py b/griptape_cloud_client/models/create_auth_config_response_content.py new file mode 100644 index 0000000..1a0da52 --- /dev/null +++ b/griptape_cloud_client/models/create_auth_config_response_content.py @@ -0,0 +1,112 @@ +import datetime +from collections.abc import Mapping +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CreateAuthConfigResponseContent") + + +@_attrs_define +class CreateAuthConfigResponseContent: + """ + Attributes: + api_key_secret_id (str): + auth_config_id (str): + base_url (str): + created_at (datetime.datetime): + name (str): + updated_at (datetime.datetime): + kwargs (Union[Unset, Any]): + """ + + api_key_secret_id: str + auth_config_id: str + base_url: str + created_at: datetime.datetime + name: str + updated_at: datetime.datetime + kwargs: Union[Unset, Any] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + api_key_secret_id = self.api_key_secret_id + + auth_config_id = self.auth_config_id + + base_url = self.base_url + + created_at = self.created_at.isoformat() + + name = self.name + + updated_at = self.updated_at.isoformat() + + kwargs = self.kwargs + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "api_key_secret_id": api_key_secret_id, + "auth_config_id": auth_config_id, + "base_url": base_url, + "created_at": created_at, + "name": name, + "updated_at": updated_at, + } + ) + if kwargs is not UNSET: + field_dict["kwargs"] = kwargs + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + api_key_secret_id = d.pop("api_key_secret_id") + + auth_config_id = d.pop("auth_config_id") + + base_url = d.pop("base_url") + + created_at = isoparse(d.pop("created_at")) + + name = d.pop("name") + + updated_at = isoparse(d.pop("updated_at")) + + kwargs = d.pop("kwargs", UNSET) + + create_auth_config_response_content = cls( + api_key_secret_id=api_key_secret_id, + auth_config_id=auth_config_id, + base_url=base_url, + created_at=created_at, + name=name, + updated_at=updated_at, + kwargs=kwargs, + ) + + create_auth_config_response_content.additional_properties = d + return create_auth_config_response_content + + @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/griptape_cloud_client/models/create_entitlement_policy_request_content.py b/griptape_cloud_client/models/create_entitlement_policy_request_content.py new file mode 100644 index 0000000..f6f8843 --- /dev/null +++ b/griptape_cloud_client/models/create_entitlement_policy_request_content.py @@ -0,0 +1,100 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.metadata import Metadata + + +T = TypeVar("T", bound="CreateEntitlementPolicyRequestContent") + + +@_attrs_define +class CreateEntitlementPolicyRequestContent: + """ + Attributes: + name (str): + policy_document (Any): + description (Union[Unset, str]): + metadata (Union[Unset, Metadata]): + """ + + name: str + policy_document: Any + description: Union[Unset, str] = UNSET + metadata: Union[Unset, "Metadata"] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + name = self.name + + policy_document = self.policy_document + + description = self.description + + metadata: Union[Unset, dict[str, Any]] = UNSET + if not isinstance(self.metadata, Unset): + metadata = self.metadata.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "name": name, + "policy_document": policy_document, + } + ) + if description is not UNSET: + field_dict["description"] = description + if metadata is not UNSET: + field_dict["metadata"] = metadata + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.metadata import Metadata + + d = dict(src_dict) + name = d.pop("name") + + policy_document = d.pop("policy_document") + + description = d.pop("description", UNSET) + + _metadata = d.pop("metadata", UNSET) + metadata: Union[Unset, Metadata] + if isinstance(_metadata, Unset): + metadata = UNSET + else: + metadata = Metadata.from_dict(_metadata) + + create_entitlement_policy_request_content = cls( + name=name, + policy_document=policy_document, + description=description, + metadata=metadata, + ) + + create_entitlement_policy_request_content.additional_properties = d + return create_entitlement_policy_request_content + + @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/griptape_cloud_client/models/create_entitlement_policy_response_content.py b/griptape_cloud_client/models/create_entitlement_policy_response_content.py new file mode 100644 index 0000000..b71489b --- /dev/null +++ b/griptape_cloud_client/models/create_entitlement_policy_response_content.py @@ -0,0 +1,134 @@ +import datetime +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.metadata import Metadata + + +T = TypeVar("T", bound="CreateEntitlementPolicyResponseContent") + + +@_attrs_define +class CreateEntitlementPolicyResponseContent: + """ + Attributes: + created_at (datetime.datetime): + entitlement_policy_id (str): + name (str): + organization_id (str): + policy_document (Any): + updated_at (datetime.datetime): + description (Union[Unset, str]): + metadata (Union[Unset, Metadata]): + """ + + created_at: datetime.datetime + entitlement_policy_id: str + name: str + organization_id: str + policy_document: Any + updated_at: datetime.datetime + description: Union[Unset, str] = UNSET + metadata: Union[Unset, "Metadata"] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + created_at = self.created_at.isoformat() + + entitlement_policy_id = self.entitlement_policy_id + + name = self.name + + organization_id = self.organization_id + + policy_document = self.policy_document + + updated_at = self.updated_at.isoformat() + + description = self.description + + metadata: Union[Unset, dict[str, Any]] = UNSET + if not isinstance(self.metadata, Unset): + metadata = self.metadata.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "created_at": created_at, + "entitlement_policy_id": entitlement_policy_id, + "name": name, + "organization_id": organization_id, + "policy_document": policy_document, + "updated_at": updated_at, + } + ) + if description is not UNSET: + field_dict["description"] = description + if metadata is not UNSET: + field_dict["metadata"] = metadata + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.metadata import Metadata + + d = dict(src_dict) + created_at = isoparse(d.pop("created_at")) + + entitlement_policy_id = d.pop("entitlement_policy_id") + + name = d.pop("name") + + organization_id = d.pop("organization_id") + + policy_document = d.pop("policy_document") + + updated_at = isoparse(d.pop("updated_at")) + + description = d.pop("description", UNSET) + + _metadata = d.pop("metadata", UNSET) + metadata: Union[Unset, Metadata] + if isinstance(_metadata, Unset): + metadata = UNSET + else: + metadata = Metadata.from_dict(_metadata) + + create_entitlement_policy_response_content = cls( + created_at=created_at, + entitlement_policy_id=entitlement_policy_id, + name=name, + organization_id=organization_id, + policy_document=policy_document, + updated_at=updated_at, + description=description, + metadata=metadata, + ) + + create_entitlement_policy_response_content.additional_properties = d + return create_entitlement_policy_response_content + + @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/griptape_cloud_client/models/create_export_job_request_content.py b/griptape_cloud_client/models/create_export_job_request_content.py new file mode 100644 index 0000000..fd06e9d --- /dev/null +++ b/griptape_cloud_client/models/create_export_job_request_content.py @@ -0,0 +1,83 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.metadata import Metadata + + +T = TypeVar("T", bound="CreateExportJobRequestContent") + + +@_attrs_define +class CreateExportJobRequestContent: + """ + Attributes: + export_data (Any): + metadata (Union[Unset, Metadata]): + """ + + export_data: Any + metadata: Union[Unset, "Metadata"] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + export_data = self.export_data + + metadata: Union[Unset, dict[str, Any]] = UNSET + if not isinstance(self.metadata, Unset): + metadata = self.metadata.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "export_data": export_data, + } + ) + if metadata is not UNSET: + field_dict["metadata"] = metadata + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.metadata import Metadata + + d = dict(src_dict) + export_data = d.pop("export_data") + + _metadata = d.pop("metadata", UNSET) + metadata: Union[Unset, Metadata] + if isinstance(_metadata, Unset): + metadata = UNSET + else: + metadata = Metadata.from_dict(_metadata) + + create_export_job_request_content = cls( + export_data=export_data, + metadata=metadata, + ) + + create_export_job_request_content.additional_properties = d + return create_export_job_request_content + + @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/griptape_cloud_client/models/create_export_job_response_content.py b/griptape_cloud_client/models/create_export_job_response_content.py new file mode 100644 index 0000000..423f514 --- /dev/null +++ b/griptape_cloud_client/models/create_export_job_response_content.py @@ -0,0 +1,174 @@ +import datetime +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from ..models.export_job_status import ExportJobStatus +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.metadata import Metadata + + +T = TypeVar("T", bound="CreateExportJobResponseContent") + + +@_attrs_define +class CreateExportJobResponseContent: + """ + Attributes: + created_at (datetime.datetime): + created_by (str): + export_job_id (str): + organization_id (str): + status (ExportJobStatus): + updated_at (datetime.datetime): + completed_at (Union[None, Unset, datetime.datetime]): + data_lake_asset_path (Union[Unset, str]): + metadata (Union[Unset, Metadata]): + status_detail (Union[Unset, str]): + """ + + created_at: datetime.datetime + created_by: str + export_job_id: str + organization_id: str + status: ExportJobStatus + updated_at: datetime.datetime + completed_at: Union[None, Unset, datetime.datetime] = UNSET + data_lake_asset_path: Union[Unset, str] = UNSET + metadata: Union[Unset, "Metadata"] = UNSET + status_detail: Union[Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + created_at = self.created_at.isoformat() + + created_by = self.created_by + + export_job_id = self.export_job_id + + organization_id = self.organization_id + + status = self.status.value + + updated_at = self.updated_at.isoformat() + + completed_at: Union[None, Unset, str] + if isinstance(self.completed_at, Unset): + completed_at = UNSET + elif isinstance(self.completed_at, datetime.datetime): + completed_at = self.completed_at.isoformat() + else: + completed_at = self.completed_at + + data_lake_asset_path = self.data_lake_asset_path + + metadata: Union[Unset, dict[str, Any]] = UNSET + if not isinstance(self.metadata, Unset): + metadata = self.metadata.to_dict() + + status_detail = self.status_detail + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "created_at": created_at, + "created_by": created_by, + "export_job_id": export_job_id, + "organization_id": organization_id, + "status": status, + "updated_at": updated_at, + } + ) + if completed_at is not UNSET: + field_dict["completed_at"] = completed_at + if data_lake_asset_path is not UNSET: + field_dict["data_lake_asset_path"] = data_lake_asset_path + if metadata is not UNSET: + field_dict["metadata"] = metadata + if status_detail is not UNSET: + field_dict["status_detail"] = status_detail + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.metadata import Metadata + + d = dict(src_dict) + created_at = isoparse(d.pop("created_at")) + + created_by = d.pop("created_by") + + export_job_id = d.pop("export_job_id") + + organization_id = d.pop("organization_id") + + status = ExportJobStatus(d.pop("status")) + + updated_at = isoparse(d.pop("updated_at")) + + def _parse_completed_at(data: object) -> Union[None, Unset, datetime.datetime]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + completed_at_type_0 = isoparse(data) + + return completed_at_type_0 + except: # noqa: E722 + pass + return cast(Union[None, Unset, datetime.datetime], data) + + completed_at = _parse_completed_at(d.pop("completed_at", UNSET)) + + data_lake_asset_path = d.pop("data_lake_asset_path", UNSET) + + _metadata = d.pop("metadata", UNSET) + metadata: Union[Unset, Metadata] + if isinstance(_metadata, Unset): + metadata = UNSET + else: + metadata = Metadata.from_dict(_metadata) + + status_detail = d.pop("status_detail", UNSET) + + create_export_job_response_content = cls( + created_at=created_at, + created_by=created_by, + export_job_id=export_job_id, + organization_id=organization_id, + status=status, + updated_at=updated_at, + completed_at=completed_at, + data_lake_asset_path=data_lake_asset_path, + metadata=metadata, + status_detail=status_detail, + ) + + create_export_job_response_content.additional_properties = d + return create_export_job_response_content + + @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/griptape_cloud_client/models/create_import_job_request_content.py b/griptape_cloud_client/models/create_import_job_request_content.py new file mode 100644 index 0000000..48b65d4 --- /dev/null +++ b/griptape_cloud_client/models/create_import_job_request_content.py @@ -0,0 +1,101 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.metadata import Metadata + + +T = TypeVar("T", bound="CreateImportJobRequestContent") + + +@_attrs_define +class CreateImportJobRequestContent: + """ + Attributes: + import_type (str): + data_lake_asset_path (Union[Unset, str]): + metadata (Union[Unset, Metadata]): + resource_suffix (Union[Unset, str]): + """ + + import_type: str + data_lake_asset_path: Union[Unset, str] = UNSET + metadata: Union[Unset, "Metadata"] = UNSET + resource_suffix: Union[Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + import_type = self.import_type + + data_lake_asset_path = self.data_lake_asset_path + + metadata: Union[Unset, dict[str, Any]] = UNSET + if not isinstance(self.metadata, Unset): + metadata = self.metadata.to_dict() + + resource_suffix = self.resource_suffix + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "import_type": import_type, + } + ) + if data_lake_asset_path is not UNSET: + field_dict["data_lake_asset_path"] = data_lake_asset_path + if metadata is not UNSET: + field_dict["metadata"] = metadata + if resource_suffix is not UNSET: + field_dict["resource_suffix"] = resource_suffix + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.metadata import Metadata + + d = dict(src_dict) + import_type = d.pop("import_type") + + data_lake_asset_path = d.pop("data_lake_asset_path", UNSET) + + _metadata = d.pop("metadata", UNSET) + metadata: Union[Unset, Metadata] + if isinstance(_metadata, Unset): + metadata = UNSET + else: + metadata = Metadata.from_dict(_metadata) + + resource_suffix = d.pop("resource_suffix", UNSET) + + create_import_job_request_content = cls( + import_type=import_type, + data_lake_asset_path=data_lake_asset_path, + metadata=metadata, + resource_suffix=resource_suffix, + ) + + create_import_job_request_content.additional_properties = d + return create_import_job_request_content + + @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/griptape_cloud_client/models/create_import_job_response_content.py b/griptape_cloud_client/models/create_import_job_response_content.py new file mode 100644 index 0000000..ac40c4e --- /dev/null +++ b/griptape_cloud_client/models/create_import_job_response_content.py @@ -0,0 +1,199 @@ +import datetime +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from ..models.import_job_status import ImportJobStatus +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.metadata import Metadata + + +T = TypeVar("T", bound="CreateImportJobResponseContent") + + +@_attrs_define +class CreateImportJobResponseContent: + """ + Attributes: + created_at (datetime.datetime): + created_by (str): + data_lake_asset_path (str): + import_job_id (str): + import_type (str): + organization_id (str): + status (ImportJobStatus): + updated_at (datetime.datetime): + completed_at (Union[None, Unset, datetime.datetime]): + import_data (Union[Unset, Any]): + metadata (Union[Unset, Metadata]): + resource_suffix (Union[Unset, str]): + status_detail (Union[Unset, Any]): + """ + + created_at: datetime.datetime + created_by: str + data_lake_asset_path: str + import_job_id: str + import_type: str + organization_id: str + status: ImportJobStatus + updated_at: datetime.datetime + completed_at: Union[None, Unset, datetime.datetime] = UNSET + import_data: Union[Unset, Any] = UNSET + metadata: Union[Unset, "Metadata"] = UNSET + resource_suffix: Union[Unset, str] = UNSET + status_detail: Union[Unset, Any] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + created_at = self.created_at.isoformat() + + created_by = self.created_by + + data_lake_asset_path = self.data_lake_asset_path + + import_job_id = self.import_job_id + + import_type = self.import_type + + organization_id = self.organization_id + + status = self.status.value + + updated_at = self.updated_at.isoformat() + + completed_at: Union[None, Unset, str] + if isinstance(self.completed_at, Unset): + completed_at = UNSET + elif isinstance(self.completed_at, datetime.datetime): + completed_at = self.completed_at.isoformat() + else: + completed_at = self.completed_at + + import_data = self.import_data + + metadata: Union[Unset, dict[str, Any]] = UNSET + if not isinstance(self.metadata, Unset): + metadata = self.metadata.to_dict() + + resource_suffix = self.resource_suffix + + status_detail = self.status_detail + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "created_at": created_at, + "created_by": created_by, + "data_lake_asset_path": data_lake_asset_path, + "import_job_id": import_job_id, + "import_type": import_type, + "organization_id": organization_id, + "status": status, + "updated_at": updated_at, + } + ) + if completed_at is not UNSET: + field_dict["completed_at"] = completed_at + if import_data is not UNSET: + field_dict["import_data"] = import_data + if metadata is not UNSET: + field_dict["metadata"] = metadata + if resource_suffix is not UNSET: + field_dict["resource_suffix"] = resource_suffix + if status_detail is not UNSET: + field_dict["status_detail"] = status_detail + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.metadata import Metadata + + d = dict(src_dict) + created_at = isoparse(d.pop("created_at")) + + created_by = d.pop("created_by") + + data_lake_asset_path = d.pop("data_lake_asset_path") + + import_job_id = d.pop("import_job_id") + + import_type = d.pop("import_type") + + organization_id = d.pop("organization_id") + + status = ImportJobStatus(d.pop("status")) + + updated_at = isoparse(d.pop("updated_at")) + + def _parse_completed_at(data: object) -> Union[None, Unset, datetime.datetime]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + completed_at_type_0 = isoparse(data) + + return completed_at_type_0 + except: # noqa: E722 + pass + return cast(Union[None, Unset, datetime.datetime], data) + + completed_at = _parse_completed_at(d.pop("completed_at", UNSET)) + + import_data = d.pop("import_data", UNSET) + + _metadata = d.pop("metadata", UNSET) + metadata: Union[Unset, Metadata] + if isinstance(_metadata, Unset): + metadata = UNSET + else: + metadata = Metadata.from_dict(_metadata) + + resource_suffix = d.pop("resource_suffix", UNSET) + + status_detail = d.pop("status_detail", UNSET) + + create_import_job_response_content = cls( + created_at=created_at, + created_by=created_by, + data_lake_asset_path=data_lake_asset_path, + import_job_id=import_job_id, + import_type=import_type, + organization_id=organization_id, + status=status, + updated_at=updated_at, + completed_at=completed_at, + import_data=import_data, + metadata=metadata, + resource_suffix=resource_suffix, + status_detail=status_detail, + ) + + create_import_job_response_content.additional_properties = d + return create_import_job_response_content + + @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/griptape_cloud_client/models/create_invite_response_content.py b/griptape_cloud_client/models/create_invite_response_content.py index 593d62c..474b7f7 100644 --- a/griptape_cloud_client/models/create_invite_response_content.py +++ b/griptape_cloud_client/models/create_invite_response_content.py @@ -22,6 +22,7 @@ class CreateInviteResponseContent: expires_at (datetime.datetime): invite_id (str): organization_id (str): + organization_name (str): status (InviteStatus): responded_at (Union[Unset, datetime.datetime]): """ @@ -32,6 +33,7 @@ class CreateInviteResponseContent: expires_at: datetime.datetime invite_id: str organization_id: str + organization_name: str status: InviteStatus responded_at: Union[Unset, datetime.datetime] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -49,6 +51,8 @@ def to_dict(self) -> dict[str, Any]: organization_id = self.organization_id + organization_name = self.organization_name + status = self.status.value responded_at: Union[Unset, str] = UNSET @@ -65,6 +69,7 @@ def to_dict(self) -> dict[str, Any]: "expires_at": expires_at, "invite_id": invite_id, "organization_id": organization_id, + "organization_name": organization_name, "status": status, } ) @@ -88,6 +93,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: organization_id = d.pop("organization_id") + organization_name = d.pop("organization_name") + status = InviteStatus(d.pop("status")) _responded_at = d.pop("responded_at", UNSET) @@ -104,6 +111,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: expires_at=expires_at, invite_id=invite_id, organization_id=organization_id, + organization_name=organization_name, status=status, responded_at=responded_at, ) diff --git a/griptape_cloud_client/models/create_license_group_request_content.py b/griptape_cloud_client/models/create_license_group_request_content.py new file mode 100644 index 0000000..90ca8d8 --- /dev/null +++ b/griptape_cloud_client/models/create_license_group_request_content.py @@ -0,0 +1,114 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.metadata import Metadata + + +T = TypeVar("T", bound="CreateLicenseGroupRequestContent") + + +@_attrs_define +class CreateLicenseGroupRequestContent: + """ + Attributes: + name (str): + description (Union[Unset, str]): + entitlement_policy_ids (Union[Unset, list[str]]): + license_ids (Union[Unset, list[str]]): + metadata (Union[Unset, Metadata]): + """ + + name: str + description: Union[Unset, str] = UNSET + entitlement_policy_ids: Union[Unset, list[str]] = UNSET + license_ids: Union[Unset, list[str]] = UNSET + metadata: Union[Unset, "Metadata"] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + name = self.name + + description = self.description + + entitlement_policy_ids: Union[Unset, list[str]] = UNSET + if not isinstance(self.entitlement_policy_ids, Unset): + entitlement_policy_ids = self.entitlement_policy_ids + + license_ids: Union[Unset, list[str]] = UNSET + if not isinstance(self.license_ids, Unset): + license_ids = self.license_ids + + metadata: Union[Unset, dict[str, Any]] = UNSET + if not isinstance(self.metadata, Unset): + metadata = self.metadata.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "name": name, + } + ) + if description is not UNSET: + field_dict["description"] = description + if entitlement_policy_ids is not UNSET: + field_dict["entitlement_policy_ids"] = entitlement_policy_ids + if license_ids is not UNSET: + field_dict["license_ids"] = license_ids + if metadata is not UNSET: + field_dict["metadata"] = metadata + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.metadata import Metadata + + d = dict(src_dict) + name = d.pop("name") + + description = d.pop("description", UNSET) + + entitlement_policy_ids = cast(list[str], d.pop("entitlement_policy_ids", UNSET)) + + license_ids = cast(list[str], d.pop("license_ids", UNSET)) + + _metadata = d.pop("metadata", UNSET) + metadata: Union[Unset, Metadata] + if isinstance(_metadata, Unset): + metadata = UNSET + else: + metadata = Metadata.from_dict(_metadata) + + create_license_group_request_content = cls( + name=name, + description=description, + entitlement_policy_ids=entitlement_policy_ids, + license_ids=license_ids, + metadata=metadata, + ) + + create_license_group_request_content.additional_properties = d + return create_license_group_request_content + + @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/griptape_cloud_client/models/create_license_group_response_content.py b/griptape_cloud_client/models/create_license_group_response_content.py new file mode 100644 index 0000000..19285d7 --- /dev/null +++ b/griptape_cloud_client/models/create_license_group_response_content.py @@ -0,0 +1,148 @@ +import datetime +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.metadata import Metadata + + +T = TypeVar("T", bound="CreateLicenseGroupResponseContent") + + +@_attrs_define +class CreateLicenseGroupResponseContent: + """ + Attributes: + created_at (datetime.datetime): + license_group_id (str): + name (str): + organization_id (str): + updated_at (datetime.datetime): + description (Union[Unset, str]): + entitlement_policy_ids (Union[Unset, list[str]]): + license_ids (Union[Unset, list[str]]): + metadata (Union[Unset, Metadata]): + """ + + created_at: datetime.datetime + license_group_id: str + name: str + organization_id: str + updated_at: datetime.datetime + description: Union[Unset, str] = UNSET + entitlement_policy_ids: Union[Unset, list[str]] = UNSET + license_ids: Union[Unset, list[str]] = UNSET + metadata: Union[Unset, "Metadata"] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + created_at = self.created_at.isoformat() + + license_group_id = self.license_group_id + + name = self.name + + organization_id = self.organization_id + + updated_at = self.updated_at.isoformat() + + description = self.description + + entitlement_policy_ids: Union[Unset, list[str]] = UNSET + if not isinstance(self.entitlement_policy_ids, Unset): + entitlement_policy_ids = self.entitlement_policy_ids + + license_ids: Union[Unset, list[str]] = UNSET + if not isinstance(self.license_ids, Unset): + license_ids = self.license_ids + + metadata: Union[Unset, dict[str, Any]] = UNSET + if not isinstance(self.metadata, Unset): + metadata = self.metadata.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "created_at": created_at, + "license_group_id": license_group_id, + "name": name, + "organization_id": organization_id, + "updated_at": updated_at, + } + ) + if description is not UNSET: + field_dict["description"] = description + if entitlement_policy_ids is not UNSET: + field_dict["entitlement_policy_ids"] = entitlement_policy_ids + if license_ids is not UNSET: + field_dict["license_ids"] = license_ids + if metadata is not UNSET: + field_dict["metadata"] = metadata + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.metadata import Metadata + + d = dict(src_dict) + created_at = isoparse(d.pop("created_at")) + + license_group_id = d.pop("license_group_id") + + name = d.pop("name") + + organization_id = d.pop("organization_id") + + updated_at = isoparse(d.pop("updated_at")) + + description = d.pop("description", UNSET) + + entitlement_policy_ids = cast(list[str], d.pop("entitlement_policy_ids", UNSET)) + + license_ids = cast(list[str], d.pop("license_ids", UNSET)) + + _metadata = d.pop("metadata", UNSET) + metadata: Union[Unset, Metadata] + if isinstance(_metadata, Unset): + metadata = UNSET + else: + metadata = Metadata.from_dict(_metadata) + + create_license_group_response_content = cls( + created_at=created_at, + license_group_id=license_group_id, + name=name, + organization_id=organization_id, + updated_at=updated_at, + description=description, + entitlement_policy_ids=entitlement_policy_ids, + license_ids=license_ids, + metadata=metadata, + ) + + create_license_group_response_content.additional_properties = d + return create_license_group_response_content + + @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/griptape_cloud_client/models/create_license_request_content.py b/griptape_cloud_client/models/create_license_request_content.py new file mode 100644 index 0000000..13066ad --- /dev/null +++ b/griptape_cloud_client/models/create_license_request_content.py @@ -0,0 +1,122 @@ +import datetime +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from ..models.license_type import LicenseType +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.metadata import Metadata + + +T = TypeVar("T", bound="CreateLicenseRequestContent") + + +@_attrs_define +class CreateLicenseRequestContent: + """ + Attributes: + expires_at (datetime.datetime): + license_type (LicenseType): + name (str): + entitlement_policy_ids (Union[Unset, list[str]]): + metadata (Union[Unset, Metadata]): + user_id (Union[Unset, str]): + """ + + expires_at: datetime.datetime + license_type: LicenseType + name: str + entitlement_policy_ids: Union[Unset, list[str]] = UNSET + metadata: Union[Unset, "Metadata"] = UNSET + user_id: Union[Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + expires_at = self.expires_at.isoformat() + + license_type = self.license_type.value + + name = self.name + + entitlement_policy_ids: Union[Unset, list[str]] = UNSET + if not isinstance(self.entitlement_policy_ids, Unset): + entitlement_policy_ids = self.entitlement_policy_ids + + metadata: Union[Unset, dict[str, Any]] = UNSET + if not isinstance(self.metadata, Unset): + metadata = self.metadata.to_dict() + + user_id = self.user_id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "expires_at": expires_at, + "license_type": license_type, + "name": name, + } + ) + if entitlement_policy_ids is not UNSET: + field_dict["entitlement_policy_ids"] = entitlement_policy_ids + if metadata is not UNSET: + field_dict["metadata"] = metadata + if user_id is not UNSET: + field_dict["user_id"] = user_id + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.metadata import Metadata + + d = dict(src_dict) + expires_at = isoparse(d.pop("expires_at")) + + license_type = LicenseType(d.pop("license_type")) + + name = d.pop("name") + + entitlement_policy_ids = cast(list[str], d.pop("entitlement_policy_ids", UNSET)) + + _metadata = d.pop("metadata", UNSET) + metadata: Union[Unset, Metadata] + if isinstance(_metadata, Unset): + metadata = UNSET + else: + metadata = Metadata.from_dict(_metadata) + + user_id = d.pop("user_id", UNSET) + + create_license_request_content = cls( + expires_at=expires_at, + license_type=license_type, + name=name, + entitlement_policy_ids=entitlement_policy_ids, + metadata=metadata, + user_id=user_id, + ) + + create_license_request_content.additional_properties = d + return create_license_request_content + + @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/griptape_cloud_client/models/create_license_response_content.py b/griptape_cloud_client/models/create_license_response_content.py new file mode 100644 index 0000000..43c94a0 --- /dev/null +++ b/griptape_cloud_client/models/create_license_response_content.py @@ -0,0 +1,201 @@ +import datetime +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from ..models.license_status import LicenseStatus +from ..models.license_type import LicenseType +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.metadata import Metadata + + +T = TypeVar("T", bound="CreateLicenseResponseContent") + + +@_attrs_define +class CreateLicenseResponseContent: + """ + Attributes: + created_at (datetime.datetime): + expires_at (datetime.datetime): + license_id (str): + license_token (str): + license_type (LicenseType): + name (str): + organization_id (str): + status (LicenseStatus): + token_version (float): + updated_at (datetime.datetime): + effective_entitlement_policy_ids (Union[Unset, list[str]]): + entitlement_policy_ids (Union[Unset, list[str]]): + license_group_ids (Union[Unset, list[str]]): + metadata (Union[Unset, Metadata]): + user_id (Union[Unset, str]): + """ + + created_at: datetime.datetime + expires_at: datetime.datetime + license_id: str + license_token: str + license_type: LicenseType + name: str + organization_id: str + status: LicenseStatus + token_version: float + updated_at: datetime.datetime + effective_entitlement_policy_ids: Union[Unset, list[str]] = UNSET + entitlement_policy_ids: Union[Unset, list[str]] = UNSET + license_group_ids: Union[Unset, list[str]] = UNSET + metadata: Union[Unset, "Metadata"] = UNSET + user_id: Union[Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + created_at = self.created_at.isoformat() + + expires_at = self.expires_at.isoformat() + + license_id = self.license_id + + license_token = self.license_token + + license_type = self.license_type.value + + name = self.name + + organization_id = self.organization_id + + status = self.status.value + + token_version = self.token_version + + updated_at = self.updated_at.isoformat() + + effective_entitlement_policy_ids: Union[Unset, list[str]] = UNSET + if not isinstance(self.effective_entitlement_policy_ids, Unset): + effective_entitlement_policy_ids = self.effective_entitlement_policy_ids + + entitlement_policy_ids: Union[Unset, list[str]] = UNSET + if not isinstance(self.entitlement_policy_ids, Unset): + entitlement_policy_ids = self.entitlement_policy_ids + + license_group_ids: Union[Unset, list[str]] = UNSET + if not isinstance(self.license_group_ids, Unset): + license_group_ids = self.license_group_ids + + metadata: Union[Unset, dict[str, Any]] = UNSET + if not isinstance(self.metadata, Unset): + metadata = self.metadata.to_dict() + + user_id = self.user_id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "created_at": created_at, + "expires_at": expires_at, + "license_id": license_id, + "license_token": license_token, + "license_type": license_type, + "name": name, + "organization_id": organization_id, + "status": status, + "token_version": token_version, + "updated_at": updated_at, + } + ) + if effective_entitlement_policy_ids is not UNSET: + field_dict["effective_entitlement_policy_ids"] = effective_entitlement_policy_ids + if entitlement_policy_ids is not UNSET: + field_dict["entitlement_policy_ids"] = entitlement_policy_ids + if license_group_ids is not UNSET: + field_dict["license_group_ids"] = license_group_ids + if metadata is not UNSET: + field_dict["metadata"] = metadata + if user_id is not UNSET: + field_dict["user_id"] = user_id + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.metadata import Metadata + + d = dict(src_dict) + created_at = isoparse(d.pop("created_at")) + + expires_at = isoparse(d.pop("expires_at")) + + license_id = d.pop("license_id") + + license_token = d.pop("license_token") + + license_type = LicenseType(d.pop("license_type")) + + name = d.pop("name") + + organization_id = d.pop("organization_id") + + status = LicenseStatus(d.pop("status")) + + token_version = d.pop("token_version") + + updated_at = isoparse(d.pop("updated_at")) + + effective_entitlement_policy_ids = cast(list[str], d.pop("effective_entitlement_policy_ids", UNSET)) + + entitlement_policy_ids = cast(list[str], d.pop("entitlement_policy_ids", UNSET)) + + license_group_ids = cast(list[str], d.pop("license_group_ids", UNSET)) + + _metadata = d.pop("metadata", UNSET) + metadata: Union[Unset, Metadata] + if isinstance(_metadata, Unset): + metadata = UNSET + else: + metadata = Metadata.from_dict(_metadata) + + user_id = d.pop("user_id", UNSET) + + create_license_response_content = cls( + created_at=created_at, + expires_at=expires_at, + license_id=license_id, + license_token=license_token, + license_type=license_type, + name=name, + organization_id=organization_id, + status=status, + token_version=token_version, + updated_at=updated_at, + effective_entitlement_policy_ids=effective_entitlement_policy_ids, + entitlement_policy_ids=entitlement_policy_ids, + license_group_ids=license_group_ids, + metadata=metadata, + user_id=user_id, + ) + + create_license_response_content.additional_properties = d + return create_license_response_content + + @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/griptape_cloud_client/models/create_model_request_content.py b/griptape_cloud_client/models/create_model_request_content.py new file mode 100644 index 0000000..ce7da8c --- /dev/null +++ b/griptape_cloud_client/models/create_model_request_content.py @@ -0,0 +1,105 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.model_type import ModelType +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CreateModelRequestContent") + + +@_attrs_define +class CreateModelRequestContent: + """ + Attributes: + auth_config_id (str): + model_name (str): + model_type (ModelType): + active (Union[Unset, bool]): + description (Union[Unset, str]): + kwargs (Union[Unset, Any]): + """ + + auth_config_id: str + model_name: str + model_type: ModelType + active: Union[Unset, bool] = UNSET + description: Union[Unset, str] = UNSET + kwargs: Union[Unset, Any] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + auth_config_id = self.auth_config_id + + model_name = self.model_name + + model_type = self.model_type.value + + active = self.active + + description = self.description + + kwargs = self.kwargs + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "auth_config_id": auth_config_id, + "model_name": model_name, + "model_type": model_type, + } + ) + if active is not UNSET: + field_dict["active"] = active + if description is not UNSET: + field_dict["description"] = description + if kwargs is not UNSET: + field_dict["kwargs"] = kwargs + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + auth_config_id = d.pop("auth_config_id") + + model_name = d.pop("model_name") + + model_type = ModelType(d.pop("model_type")) + + active = d.pop("active", UNSET) + + description = d.pop("description", UNSET) + + kwargs = d.pop("kwargs", UNSET) + + create_model_request_content = cls( + auth_config_id=auth_config_id, + model_name=model_name, + model_type=model_type, + active=active, + description=description, + kwargs=kwargs, + ) + + create_model_request_content.additional_properties = d + return create_model_request_content + + @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/griptape_cloud_client/models/create_model_response_content.py b/griptape_cloud_client/models/create_model_response_content.py new file mode 100644 index 0000000..6e6cbcb --- /dev/null +++ b/griptape_cloud_client/models/create_model_response_content.py @@ -0,0 +1,172 @@ +import datetime +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from ..models.model_type import ModelType +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.auth_config_detail import AuthConfigDetail + + +T = TypeVar("T", bound="CreateModelResponseContent") + + +@_attrs_define +class CreateModelResponseContent: + """ + Attributes: + created_at (datetime.datetime): + default (bool): + model_name (str): + model_type (ModelType): + updated_at (datetime.datetime): + active (Union[Unset, bool]): + auth_config (Union[Unset, AuthConfigDetail]): + description (Union[Unset, str]): + editable (Union[Unset, bool]): + kwargs (Union[Unset, Any]): + model_config_id (Union[Unset, str]): + source (Union[Unset, str]): + """ + + created_at: datetime.datetime + default: bool + model_name: str + model_type: ModelType + updated_at: datetime.datetime + active: Union[Unset, bool] = UNSET + auth_config: Union[Unset, "AuthConfigDetail"] = UNSET + description: Union[Unset, str] = UNSET + editable: Union[Unset, bool] = UNSET + kwargs: Union[Unset, Any] = UNSET + model_config_id: Union[Unset, str] = UNSET + source: Union[Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + created_at = self.created_at.isoformat() + + default = self.default + + model_name = self.model_name + + model_type = self.model_type.value + + updated_at = self.updated_at.isoformat() + + active = self.active + + auth_config: Union[Unset, dict[str, Any]] = UNSET + if not isinstance(self.auth_config, Unset): + auth_config = self.auth_config.to_dict() + + description = self.description + + editable = self.editable + + kwargs = self.kwargs + + model_config_id = self.model_config_id + + source = self.source + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "created_at": created_at, + "default": default, + "model_name": model_name, + "model_type": model_type, + "updated_at": updated_at, + } + ) + if active is not UNSET: + field_dict["active"] = active + if auth_config is not UNSET: + field_dict["auth_config"] = auth_config + if description is not UNSET: + field_dict["description"] = description + if editable is not UNSET: + field_dict["editable"] = editable + if kwargs is not UNSET: + field_dict["kwargs"] = kwargs + if model_config_id is not UNSET: + field_dict["model_config_id"] = model_config_id + if source is not UNSET: + field_dict["source"] = source + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.auth_config_detail import AuthConfigDetail + + d = dict(src_dict) + created_at = isoparse(d.pop("created_at")) + + default = d.pop("default") + + model_name = d.pop("model_name") + + model_type = ModelType(d.pop("model_type")) + + updated_at = isoparse(d.pop("updated_at")) + + active = d.pop("active", UNSET) + + _auth_config = d.pop("auth_config", UNSET) + auth_config: Union[Unset, AuthConfigDetail] + if isinstance(_auth_config, Unset): + auth_config = UNSET + else: + auth_config = AuthConfigDetail.from_dict(_auth_config) + + description = d.pop("description", UNSET) + + editable = d.pop("editable", UNSET) + + kwargs = d.pop("kwargs", UNSET) + + model_config_id = d.pop("model_config_id", UNSET) + + source = d.pop("source", UNSET) + + create_model_response_content = cls( + created_at=created_at, + default=default, + model_name=model_name, + model_type=model_type, + updated_at=updated_at, + active=active, + auth_config=auth_config, + description=description, + editable=editable, + kwargs=kwargs, + model_config_id=model_config_id, + source=source, + ) + + create_model_response_content.additional_properties = d + return create_model_response_content + + @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/griptape_cloud_client/models/create_organization_response_content.py b/griptape_cloud_client/models/create_organization_response_content.py new file mode 100644 index 0000000..dc219c5 --- /dev/null +++ b/griptape_cloud_client/models/create_organization_response_content.py @@ -0,0 +1,142 @@ +import datetime +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from ..models.entitlement import Entitlement +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.organization_model_config import OrganizationModelConfig + + +T = TypeVar("T", bound="CreateOrganizationResponseContent") + + +@_attrs_define +class CreateOrganizationResponseContent: + """ + Attributes: + created_at (datetime.datetime): + created_by (str): + default_bucket_id (str): + description (str): + entitlement (Entitlement): Default: Entitlement.FREE. + name (str): + organization_id (str): + updated_at (datetime.datetime): + model_config (Union[Unset, OrganizationModelConfig]): + """ + + created_at: datetime.datetime + created_by: str + default_bucket_id: str + description: str + name: str + organization_id: str + updated_at: datetime.datetime + entitlement: Entitlement = Entitlement.FREE + model_config: Union[Unset, "OrganizationModelConfig"] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + created_at = self.created_at.isoformat() + + created_by = self.created_by + + default_bucket_id = self.default_bucket_id + + description = self.description + + entitlement = self.entitlement.value + + name = self.name + + organization_id = self.organization_id + + updated_at = self.updated_at.isoformat() + + model_config: Union[Unset, dict[str, Any]] = UNSET + if not isinstance(self.model_config, Unset): + model_config = self.model_config.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "created_at": created_at, + "created_by": created_by, + "default_bucket_id": default_bucket_id, + "description": description, + "entitlement": entitlement, + "name": name, + "organization_id": organization_id, + "updated_at": updated_at, + } + ) + if model_config is not UNSET: + field_dict["model_config"] = model_config + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.organization_model_config import OrganizationModelConfig + + d = dict(src_dict) + created_at = isoparse(d.pop("created_at")) + + created_by = d.pop("created_by") + + default_bucket_id = d.pop("default_bucket_id") + + description = d.pop("description") + + entitlement = Entitlement(d.pop("entitlement")) + + name = d.pop("name") + + organization_id = d.pop("organization_id") + + updated_at = isoparse(d.pop("updated_at")) + + _model_config = d.pop("model_config", UNSET) + model_config: Union[Unset, OrganizationModelConfig] + if isinstance(_model_config, Unset): + model_config = UNSET + else: + model_config = OrganizationModelConfig.from_dict(_model_config) + + create_organization_response_content = cls( + created_at=created_at, + created_by=created_by, + default_bucket_id=default_bucket_id, + description=description, + entitlement=entitlement, + name=name, + organization_id=organization_id, + updated_at=updated_at, + model_config=model_config, + ) + + create_organization_response_content.additional_properties = d + return create_organization_response_content + + @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/griptape_cloud_client/models/credit_transaction_detail.py b/griptape_cloud_client/models/credit_transaction_detail.py new file mode 100644 index 0000000..41e704a --- /dev/null +++ b/griptape_cloud_client/models/credit_transaction_detail.py @@ -0,0 +1,95 @@ +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 dateutil.parser import isoparse + +from ..models.credit_transaction_type import CreditTransactionType + +T = TypeVar("T", bound="CreditTransactionDetail") + + +@_attrs_define +class CreditTransactionDetail: + """ + Attributes: + created_at (datetime.datetime): + credits_ (float): + organization_id (str): + transaction_id (str): + transaction_type (CreditTransactionType): Default: CreditTransactionType.DEBIT. + """ + + created_at: datetime.datetime + credits_: float + organization_id: str + transaction_id: str + transaction_type: CreditTransactionType = CreditTransactionType.DEBIT + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + created_at = self.created_at.isoformat() + + credits_ = self.credits_ + + organization_id = self.organization_id + + transaction_id = self.transaction_id + + transaction_type = self.transaction_type.value + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "created_at": created_at, + "credits": credits_, + "organization_id": organization_id, + "transaction_id": transaction_id, + "transaction_type": transaction_type, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + created_at = isoparse(d.pop("created_at")) + + credits_ = d.pop("credits") + + organization_id = d.pop("organization_id") + + transaction_id = d.pop("transaction_id") + + transaction_type = CreditTransactionType(d.pop("transaction_type")) + + credit_transaction_detail = cls( + created_at=created_at, + credits_=credits_, + organization_id=organization_id, + transaction_id=transaction_id, + transaction_type=transaction_type, + ) + + credit_transaction_detail.additional_properties = d + return credit_transaction_detail + + @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/griptape_cloud_client/models/entitlement_policy_detail.py b/griptape_cloud_client/models/entitlement_policy_detail.py new file mode 100644 index 0000000..53e32d2 --- /dev/null +++ b/griptape_cloud_client/models/entitlement_policy_detail.py @@ -0,0 +1,134 @@ +import datetime +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.metadata import Metadata + + +T = TypeVar("T", bound="EntitlementPolicyDetail") + + +@_attrs_define +class EntitlementPolicyDetail: + """ + Attributes: + created_at (datetime.datetime): + entitlement_policy_id (str): + name (str): + organization_id (str): + policy_document (Any): + updated_at (datetime.datetime): + description (Union[Unset, str]): + metadata (Union[Unset, Metadata]): + """ + + created_at: datetime.datetime + entitlement_policy_id: str + name: str + organization_id: str + policy_document: Any + updated_at: datetime.datetime + description: Union[Unset, str] = UNSET + metadata: Union[Unset, "Metadata"] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + created_at = self.created_at.isoformat() + + entitlement_policy_id = self.entitlement_policy_id + + name = self.name + + organization_id = self.organization_id + + policy_document = self.policy_document + + updated_at = self.updated_at.isoformat() + + description = self.description + + metadata: Union[Unset, dict[str, Any]] = UNSET + if not isinstance(self.metadata, Unset): + metadata = self.metadata.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "created_at": created_at, + "entitlement_policy_id": entitlement_policy_id, + "name": name, + "organization_id": organization_id, + "policy_document": policy_document, + "updated_at": updated_at, + } + ) + if description is not UNSET: + field_dict["description"] = description + if metadata is not UNSET: + field_dict["metadata"] = metadata + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.metadata import Metadata + + d = dict(src_dict) + created_at = isoparse(d.pop("created_at")) + + entitlement_policy_id = d.pop("entitlement_policy_id") + + name = d.pop("name") + + organization_id = d.pop("organization_id") + + policy_document = d.pop("policy_document") + + updated_at = isoparse(d.pop("updated_at")) + + description = d.pop("description", UNSET) + + _metadata = d.pop("metadata", UNSET) + metadata: Union[Unset, Metadata] + if isinstance(_metadata, Unset): + metadata = UNSET + else: + metadata = Metadata.from_dict(_metadata) + + entitlement_policy_detail = cls( + created_at=created_at, + entitlement_policy_id=entitlement_policy_id, + name=name, + organization_id=organization_id, + policy_document=policy_document, + updated_at=updated_at, + description=description, + metadata=metadata, + ) + + entitlement_policy_detail.additional_properties = d + return entitlement_policy_detail + + @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/griptape_cloud_client/models/export_job_detail.py b/griptape_cloud_client/models/export_job_detail.py new file mode 100644 index 0000000..a6acf1f --- /dev/null +++ b/griptape_cloud_client/models/export_job_detail.py @@ -0,0 +1,174 @@ +import datetime +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from ..models.export_job_status import ExportJobStatus +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.metadata import Metadata + + +T = TypeVar("T", bound="ExportJobDetail") + + +@_attrs_define +class ExportJobDetail: + """ + Attributes: + created_at (datetime.datetime): + created_by (str): + export_job_id (str): + organization_id (str): + status (ExportJobStatus): + updated_at (datetime.datetime): + completed_at (Union[None, Unset, datetime.datetime]): + data_lake_asset_path (Union[Unset, str]): + metadata (Union[Unset, Metadata]): + status_detail (Union[Unset, str]): + """ + + created_at: datetime.datetime + created_by: str + export_job_id: str + organization_id: str + status: ExportJobStatus + updated_at: datetime.datetime + completed_at: Union[None, Unset, datetime.datetime] = UNSET + data_lake_asset_path: Union[Unset, str] = UNSET + metadata: Union[Unset, "Metadata"] = UNSET + status_detail: Union[Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + created_at = self.created_at.isoformat() + + created_by = self.created_by + + export_job_id = self.export_job_id + + organization_id = self.organization_id + + status = self.status.value + + updated_at = self.updated_at.isoformat() + + completed_at: Union[None, Unset, str] + if isinstance(self.completed_at, Unset): + completed_at = UNSET + elif isinstance(self.completed_at, datetime.datetime): + completed_at = self.completed_at.isoformat() + else: + completed_at = self.completed_at + + data_lake_asset_path = self.data_lake_asset_path + + metadata: Union[Unset, dict[str, Any]] = UNSET + if not isinstance(self.metadata, Unset): + metadata = self.metadata.to_dict() + + status_detail = self.status_detail + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "created_at": created_at, + "created_by": created_by, + "export_job_id": export_job_id, + "organization_id": organization_id, + "status": status, + "updated_at": updated_at, + } + ) + if completed_at is not UNSET: + field_dict["completed_at"] = completed_at + if data_lake_asset_path is not UNSET: + field_dict["data_lake_asset_path"] = data_lake_asset_path + if metadata is not UNSET: + field_dict["metadata"] = metadata + if status_detail is not UNSET: + field_dict["status_detail"] = status_detail + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.metadata import Metadata + + d = dict(src_dict) + created_at = isoparse(d.pop("created_at")) + + created_by = d.pop("created_by") + + export_job_id = d.pop("export_job_id") + + organization_id = d.pop("organization_id") + + status = ExportJobStatus(d.pop("status")) + + updated_at = isoparse(d.pop("updated_at")) + + def _parse_completed_at(data: object) -> Union[None, Unset, datetime.datetime]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + completed_at_type_0 = isoparse(data) + + return completed_at_type_0 + except: # noqa: E722 + pass + return cast(Union[None, Unset, datetime.datetime], data) + + completed_at = _parse_completed_at(d.pop("completed_at", UNSET)) + + data_lake_asset_path = d.pop("data_lake_asset_path", UNSET) + + _metadata = d.pop("metadata", UNSET) + metadata: Union[Unset, Metadata] + if isinstance(_metadata, Unset): + metadata = UNSET + else: + metadata = Metadata.from_dict(_metadata) + + status_detail = d.pop("status_detail", UNSET) + + export_job_detail = cls( + created_at=created_at, + created_by=created_by, + export_job_id=export_job_id, + organization_id=organization_id, + status=status, + updated_at=updated_at, + completed_at=completed_at, + data_lake_asset_path=data_lake_asset_path, + metadata=metadata, + status_detail=status_detail, + ) + + export_job_detail.additional_properties = d + return export_job_detail + + @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/griptape_cloud_client/models/export_job_status.py b/griptape_cloud_client/models/export_job_status.py new file mode 100644 index 0000000..7d2f17e --- /dev/null +++ b/griptape_cloud_client/models/export_job_status.py @@ -0,0 +1,12 @@ +from enum import Enum + + +class ExportJobStatus(str, Enum): + CANCELLED = "CANCELLED" + FAILED = "FAILED" + QUEUED = "QUEUED" + RUNNING = "RUNNING" + SUCCEEDED = "SUCCEEDED" + + def __str__(self) -> str: + return str(self.value) diff --git a/griptape_cloud_client/models/get_assistant_response_content.py b/griptape_cloud_client/models/get_assistant_response_content.py index 7e46ff4..f256ed4 100644 --- a/griptape_cloud_client/models/get_assistant_response_content.py +++ b/griptape_cloud_client/models/get_assistant_response_content.py @@ -28,6 +28,7 @@ class GetAssistantResponseContent: tool_ids (list[str]): updated_at (datetime.datetime): input_ (Union[Unset, str]): + model (Union[Unset, str]): """ assistant_id: str @@ -43,6 +44,7 @@ class GetAssistantResponseContent: tool_ids: list[str] updated_at: datetime.datetime input_: Union[Unset, str] = UNSET + model: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -72,6 +74,8 @@ def to_dict(self) -> dict[str, Any]: input_ = self.input_ + model = self.model + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( @@ -92,6 +96,8 @@ def to_dict(self) -> dict[str, Any]: ) if input_ is not UNSET: field_dict["input"] = input_ + if model is not UNSET: + field_dict["model"] = model return field_dict @@ -124,6 +130,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: input_ = d.pop("input", UNSET) + model = d.pop("model", UNSET) + get_assistant_response_content = cls( assistant_id=assistant_id, created_at=created_at, @@ -138,6 +146,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: tool_ids=tool_ids, updated_at=updated_at, input_=input_, + model=model, ) get_assistant_response_content.additional_properties = d diff --git a/griptape_cloud_client/models/get_assistant_run_response_content.py b/griptape_cloud_client/models/get_assistant_run_response_content.py index fd857fe..ef37905 100644 --- a/griptape_cloud_client/models/get_assistant_run_response_content.py +++ b/griptape_cloud_client/models/get_assistant_run_response_content.py @@ -31,6 +31,7 @@ class GetAssistantRunResponseContent: tool_ids (list[str]): updated_at (datetime.datetime): input_ (Union[Unset, str]): + model (Union[Unset, str]): output (Union[Unset, Any]): status_detail (Union[Unset, Any]): thread_id (Union[Unset, str]): @@ -51,6 +52,7 @@ class GetAssistantRunResponseContent: tool_ids: list[str] updated_at: datetime.datetime input_: Union[Unset, str] = UNSET + model: Union[Unset, str] = UNSET output: Union[Unset, Any] = UNSET status_detail: Union[Unset, Any] = UNSET thread_id: Union[Unset, str] = UNSET @@ -91,6 +93,8 @@ def to_dict(self) -> dict[str, Any]: input_ = self.input_ + model = self.model + output = self.output status_detail = self.status_detail @@ -119,6 +123,8 @@ def to_dict(self) -> dict[str, Any]: ) if input_ is not UNSET: field_dict["input"] = input_ + if model is not UNSET: + field_dict["model"] = model if output is not UNSET: field_dict["output"] = output if status_detail is not UNSET: @@ -174,6 +180,8 @@ def _parse_completed_at(data: object) -> Union[None, datetime.datetime]: input_ = d.pop("input", UNSET) + model = d.pop("model", UNSET) + output = d.pop("output", UNSET) status_detail = d.pop("status_detail", UNSET) @@ -196,6 +204,7 @@ def _parse_completed_at(data: object) -> Union[None, datetime.datetime]: tool_ids=tool_ids, updated_at=updated_at, input_=input_, + model=model, output=output, status_detail=status_detail, thread_id=thread_id, diff --git a/griptape_cloud_client/models/get_auth_config_response_content.py b/griptape_cloud_client/models/get_auth_config_response_content.py new file mode 100644 index 0000000..620d5ef --- /dev/null +++ b/griptape_cloud_client/models/get_auth_config_response_content.py @@ -0,0 +1,112 @@ +import datetime +from collections.abc import Mapping +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="GetAuthConfigResponseContent") + + +@_attrs_define +class GetAuthConfigResponseContent: + """ + Attributes: + api_key_secret_id (str): + auth_config_id (str): + base_url (str): + created_at (datetime.datetime): + name (str): + updated_at (datetime.datetime): + kwargs (Union[Unset, Any]): + """ + + api_key_secret_id: str + auth_config_id: str + base_url: str + created_at: datetime.datetime + name: str + updated_at: datetime.datetime + kwargs: Union[Unset, Any] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + api_key_secret_id = self.api_key_secret_id + + auth_config_id = self.auth_config_id + + base_url = self.base_url + + created_at = self.created_at.isoformat() + + name = self.name + + updated_at = self.updated_at.isoformat() + + kwargs = self.kwargs + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "api_key_secret_id": api_key_secret_id, + "auth_config_id": auth_config_id, + "base_url": base_url, + "created_at": created_at, + "name": name, + "updated_at": updated_at, + } + ) + if kwargs is not UNSET: + field_dict["kwargs"] = kwargs + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + api_key_secret_id = d.pop("api_key_secret_id") + + auth_config_id = d.pop("auth_config_id") + + base_url = d.pop("base_url") + + created_at = isoparse(d.pop("created_at")) + + name = d.pop("name") + + updated_at = isoparse(d.pop("updated_at")) + + kwargs = d.pop("kwargs", UNSET) + + get_auth_config_response_content = cls( + api_key_secret_id=api_key_secret_id, + auth_config_id=auth_config_id, + base_url=base_url, + created_at=created_at, + name=name, + updated_at=updated_at, + kwargs=kwargs, + ) + + get_auth_config_response_content.additional_properties = d + return get_auth_config_response_content + + @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/griptape_cloud_client/models/get_entitlement_policy_response_content.py b/griptape_cloud_client/models/get_entitlement_policy_response_content.py new file mode 100644 index 0000000..7001a0c --- /dev/null +++ b/griptape_cloud_client/models/get_entitlement_policy_response_content.py @@ -0,0 +1,134 @@ +import datetime +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.metadata import Metadata + + +T = TypeVar("T", bound="GetEntitlementPolicyResponseContent") + + +@_attrs_define +class GetEntitlementPolicyResponseContent: + """ + Attributes: + created_at (datetime.datetime): + entitlement_policy_id (str): + name (str): + organization_id (str): + policy_document (Any): + updated_at (datetime.datetime): + description (Union[Unset, str]): + metadata (Union[Unset, Metadata]): + """ + + created_at: datetime.datetime + entitlement_policy_id: str + name: str + organization_id: str + policy_document: Any + updated_at: datetime.datetime + description: Union[Unset, str] = UNSET + metadata: Union[Unset, "Metadata"] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + created_at = self.created_at.isoformat() + + entitlement_policy_id = self.entitlement_policy_id + + name = self.name + + organization_id = self.organization_id + + policy_document = self.policy_document + + updated_at = self.updated_at.isoformat() + + description = self.description + + metadata: Union[Unset, dict[str, Any]] = UNSET + if not isinstance(self.metadata, Unset): + metadata = self.metadata.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "created_at": created_at, + "entitlement_policy_id": entitlement_policy_id, + "name": name, + "organization_id": organization_id, + "policy_document": policy_document, + "updated_at": updated_at, + } + ) + if description is not UNSET: + field_dict["description"] = description + if metadata is not UNSET: + field_dict["metadata"] = metadata + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.metadata import Metadata + + d = dict(src_dict) + created_at = isoparse(d.pop("created_at")) + + entitlement_policy_id = d.pop("entitlement_policy_id") + + name = d.pop("name") + + organization_id = d.pop("organization_id") + + policy_document = d.pop("policy_document") + + updated_at = isoparse(d.pop("updated_at")) + + description = d.pop("description", UNSET) + + _metadata = d.pop("metadata", UNSET) + metadata: Union[Unset, Metadata] + if isinstance(_metadata, Unset): + metadata = UNSET + else: + metadata = Metadata.from_dict(_metadata) + + get_entitlement_policy_response_content = cls( + created_at=created_at, + entitlement_policy_id=entitlement_policy_id, + name=name, + organization_id=organization_id, + policy_document=policy_document, + updated_at=updated_at, + description=description, + metadata=metadata, + ) + + get_entitlement_policy_response_content.additional_properties = d + return get_entitlement_policy_response_content + + @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/griptape_cloud_client/models/get_export_job_response_content.py b/griptape_cloud_client/models/get_export_job_response_content.py new file mode 100644 index 0000000..02f80b1 --- /dev/null +++ b/griptape_cloud_client/models/get_export_job_response_content.py @@ -0,0 +1,174 @@ +import datetime +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from ..models.export_job_status import ExportJobStatus +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.metadata import Metadata + + +T = TypeVar("T", bound="GetExportJobResponseContent") + + +@_attrs_define +class GetExportJobResponseContent: + """ + Attributes: + created_at (datetime.datetime): + created_by (str): + export_job_id (str): + organization_id (str): + status (ExportJobStatus): + updated_at (datetime.datetime): + completed_at (Union[None, Unset, datetime.datetime]): + data_lake_asset_path (Union[Unset, str]): + metadata (Union[Unset, Metadata]): + status_detail (Union[Unset, str]): + """ + + created_at: datetime.datetime + created_by: str + export_job_id: str + organization_id: str + status: ExportJobStatus + updated_at: datetime.datetime + completed_at: Union[None, Unset, datetime.datetime] = UNSET + data_lake_asset_path: Union[Unset, str] = UNSET + metadata: Union[Unset, "Metadata"] = UNSET + status_detail: Union[Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + created_at = self.created_at.isoformat() + + created_by = self.created_by + + export_job_id = self.export_job_id + + organization_id = self.organization_id + + status = self.status.value + + updated_at = self.updated_at.isoformat() + + completed_at: Union[None, Unset, str] + if isinstance(self.completed_at, Unset): + completed_at = UNSET + elif isinstance(self.completed_at, datetime.datetime): + completed_at = self.completed_at.isoformat() + else: + completed_at = self.completed_at + + data_lake_asset_path = self.data_lake_asset_path + + metadata: Union[Unset, dict[str, Any]] = UNSET + if not isinstance(self.metadata, Unset): + metadata = self.metadata.to_dict() + + status_detail = self.status_detail + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "created_at": created_at, + "created_by": created_by, + "export_job_id": export_job_id, + "organization_id": organization_id, + "status": status, + "updated_at": updated_at, + } + ) + if completed_at is not UNSET: + field_dict["completed_at"] = completed_at + if data_lake_asset_path is not UNSET: + field_dict["data_lake_asset_path"] = data_lake_asset_path + if metadata is not UNSET: + field_dict["metadata"] = metadata + if status_detail is not UNSET: + field_dict["status_detail"] = status_detail + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.metadata import Metadata + + d = dict(src_dict) + created_at = isoparse(d.pop("created_at")) + + created_by = d.pop("created_by") + + export_job_id = d.pop("export_job_id") + + organization_id = d.pop("organization_id") + + status = ExportJobStatus(d.pop("status")) + + updated_at = isoparse(d.pop("updated_at")) + + def _parse_completed_at(data: object) -> Union[None, Unset, datetime.datetime]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + completed_at_type_0 = isoparse(data) + + return completed_at_type_0 + except: # noqa: E722 + pass + return cast(Union[None, Unset, datetime.datetime], data) + + completed_at = _parse_completed_at(d.pop("completed_at", UNSET)) + + data_lake_asset_path = d.pop("data_lake_asset_path", UNSET) + + _metadata = d.pop("metadata", UNSET) + metadata: Union[Unset, Metadata] + if isinstance(_metadata, Unset): + metadata = UNSET + else: + metadata = Metadata.from_dict(_metadata) + + status_detail = d.pop("status_detail", UNSET) + + get_export_job_response_content = cls( + created_at=created_at, + created_by=created_by, + export_job_id=export_job_id, + organization_id=organization_id, + status=status, + updated_at=updated_at, + completed_at=completed_at, + data_lake_asset_path=data_lake_asset_path, + metadata=metadata, + status_detail=status_detail, + ) + + get_export_job_response_content.additional_properties = d + return get_export_job_response_content + + @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/griptape_cloud_client/models/get_import_job_response_content.py b/griptape_cloud_client/models/get_import_job_response_content.py new file mode 100644 index 0000000..c5b04cb --- /dev/null +++ b/griptape_cloud_client/models/get_import_job_response_content.py @@ -0,0 +1,199 @@ +import datetime +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from ..models.import_job_status import ImportJobStatus +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.metadata import Metadata + + +T = TypeVar("T", bound="GetImportJobResponseContent") + + +@_attrs_define +class GetImportJobResponseContent: + """ + Attributes: + created_at (datetime.datetime): + created_by (str): + data_lake_asset_path (str): + import_job_id (str): + import_type (str): + organization_id (str): + status (ImportJobStatus): + updated_at (datetime.datetime): + completed_at (Union[None, Unset, datetime.datetime]): + import_data (Union[Unset, Any]): + metadata (Union[Unset, Metadata]): + resource_suffix (Union[Unset, str]): + status_detail (Union[Unset, Any]): + """ + + created_at: datetime.datetime + created_by: str + data_lake_asset_path: str + import_job_id: str + import_type: str + organization_id: str + status: ImportJobStatus + updated_at: datetime.datetime + completed_at: Union[None, Unset, datetime.datetime] = UNSET + import_data: Union[Unset, Any] = UNSET + metadata: Union[Unset, "Metadata"] = UNSET + resource_suffix: Union[Unset, str] = UNSET + status_detail: Union[Unset, Any] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + created_at = self.created_at.isoformat() + + created_by = self.created_by + + data_lake_asset_path = self.data_lake_asset_path + + import_job_id = self.import_job_id + + import_type = self.import_type + + organization_id = self.organization_id + + status = self.status.value + + updated_at = self.updated_at.isoformat() + + completed_at: Union[None, Unset, str] + if isinstance(self.completed_at, Unset): + completed_at = UNSET + elif isinstance(self.completed_at, datetime.datetime): + completed_at = self.completed_at.isoformat() + else: + completed_at = self.completed_at + + import_data = self.import_data + + metadata: Union[Unset, dict[str, Any]] = UNSET + if not isinstance(self.metadata, Unset): + metadata = self.metadata.to_dict() + + resource_suffix = self.resource_suffix + + status_detail = self.status_detail + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "created_at": created_at, + "created_by": created_by, + "data_lake_asset_path": data_lake_asset_path, + "import_job_id": import_job_id, + "import_type": import_type, + "organization_id": organization_id, + "status": status, + "updated_at": updated_at, + } + ) + if completed_at is not UNSET: + field_dict["completed_at"] = completed_at + if import_data is not UNSET: + field_dict["import_data"] = import_data + if metadata is not UNSET: + field_dict["metadata"] = metadata + if resource_suffix is not UNSET: + field_dict["resource_suffix"] = resource_suffix + if status_detail is not UNSET: + field_dict["status_detail"] = status_detail + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.metadata import Metadata + + d = dict(src_dict) + created_at = isoparse(d.pop("created_at")) + + created_by = d.pop("created_by") + + data_lake_asset_path = d.pop("data_lake_asset_path") + + import_job_id = d.pop("import_job_id") + + import_type = d.pop("import_type") + + organization_id = d.pop("organization_id") + + status = ImportJobStatus(d.pop("status")) + + updated_at = isoparse(d.pop("updated_at")) + + def _parse_completed_at(data: object) -> Union[None, Unset, datetime.datetime]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + completed_at_type_0 = isoparse(data) + + return completed_at_type_0 + except: # noqa: E722 + pass + return cast(Union[None, Unset, datetime.datetime], data) + + completed_at = _parse_completed_at(d.pop("completed_at", UNSET)) + + import_data = d.pop("import_data", UNSET) + + _metadata = d.pop("metadata", UNSET) + metadata: Union[Unset, Metadata] + if isinstance(_metadata, Unset): + metadata = UNSET + else: + metadata = Metadata.from_dict(_metadata) + + resource_suffix = d.pop("resource_suffix", UNSET) + + status_detail = d.pop("status_detail", UNSET) + + get_import_job_response_content = cls( + created_at=created_at, + created_by=created_by, + data_lake_asset_path=data_lake_asset_path, + import_job_id=import_job_id, + import_type=import_type, + organization_id=organization_id, + status=status, + updated_at=updated_at, + completed_at=completed_at, + import_data=import_data, + metadata=metadata, + resource_suffix=resource_suffix, + status_detail=status_detail, + ) + + get_import_job_response_content.additional_properties = d + return get_import_job_response_content + + @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/griptape_cloud_client/models/get_invite_response_content.py b/griptape_cloud_client/models/get_invite_response_content.py index 8938d72..3f8a134 100644 --- a/griptape_cloud_client/models/get_invite_response_content.py +++ b/griptape_cloud_client/models/get_invite_response_content.py @@ -22,6 +22,7 @@ class GetInviteResponseContent: expires_at (datetime.datetime): invite_id (str): organization_id (str): + organization_name (str): status (InviteStatus): responded_at (Union[Unset, datetime.datetime]): """ @@ -32,6 +33,7 @@ class GetInviteResponseContent: expires_at: datetime.datetime invite_id: str organization_id: str + organization_name: str status: InviteStatus responded_at: Union[Unset, datetime.datetime] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -49,6 +51,8 @@ def to_dict(self) -> dict[str, Any]: organization_id = self.organization_id + organization_name = self.organization_name + status = self.status.value responded_at: Union[Unset, str] = UNSET @@ -65,6 +69,7 @@ def to_dict(self) -> dict[str, Any]: "expires_at": expires_at, "invite_id": invite_id, "organization_id": organization_id, + "organization_name": organization_name, "status": status, } ) @@ -88,6 +93,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: organization_id = d.pop("organization_id") + organization_name = d.pop("organization_name") + status = InviteStatus(d.pop("status")) _responded_at = d.pop("responded_at", UNSET) @@ -104,6 +111,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: expires_at=expires_at, invite_id=invite_id, organization_id=organization_id, + organization_name=organization_name, status=status, responded_at=responded_at, ) diff --git a/griptape_cloud_client/models/get_license_group_response_content.py b/griptape_cloud_client/models/get_license_group_response_content.py new file mode 100644 index 0000000..1f35f52 --- /dev/null +++ b/griptape_cloud_client/models/get_license_group_response_content.py @@ -0,0 +1,148 @@ +import datetime +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.metadata import Metadata + + +T = TypeVar("T", bound="GetLicenseGroupResponseContent") + + +@_attrs_define +class GetLicenseGroupResponseContent: + """ + Attributes: + created_at (datetime.datetime): + license_group_id (str): + name (str): + organization_id (str): + updated_at (datetime.datetime): + description (Union[Unset, str]): + entitlement_policy_ids (Union[Unset, list[str]]): + license_ids (Union[Unset, list[str]]): + metadata (Union[Unset, Metadata]): + """ + + created_at: datetime.datetime + license_group_id: str + name: str + organization_id: str + updated_at: datetime.datetime + description: Union[Unset, str] = UNSET + entitlement_policy_ids: Union[Unset, list[str]] = UNSET + license_ids: Union[Unset, list[str]] = UNSET + metadata: Union[Unset, "Metadata"] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + created_at = self.created_at.isoformat() + + license_group_id = self.license_group_id + + name = self.name + + organization_id = self.organization_id + + updated_at = self.updated_at.isoformat() + + description = self.description + + entitlement_policy_ids: Union[Unset, list[str]] = UNSET + if not isinstance(self.entitlement_policy_ids, Unset): + entitlement_policy_ids = self.entitlement_policy_ids + + license_ids: Union[Unset, list[str]] = UNSET + if not isinstance(self.license_ids, Unset): + license_ids = self.license_ids + + metadata: Union[Unset, dict[str, Any]] = UNSET + if not isinstance(self.metadata, Unset): + metadata = self.metadata.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "created_at": created_at, + "license_group_id": license_group_id, + "name": name, + "organization_id": organization_id, + "updated_at": updated_at, + } + ) + if description is not UNSET: + field_dict["description"] = description + if entitlement_policy_ids is not UNSET: + field_dict["entitlement_policy_ids"] = entitlement_policy_ids + if license_ids is not UNSET: + field_dict["license_ids"] = license_ids + if metadata is not UNSET: + field_dict["metadata"] = metadata + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.metadata import Metadata + + d = dict(src_dict) + created_at = isoparse(d.pop("created_at")) + + license_group_id = d.pop("license_group_id") + + name = d.pop("name") + + organization_id = d.pop("organization_id") + + updated_at = isoparse(d.pop("updated_at")) + + description = d.pop("description", UNSET) + + entitlement_policy_ids = cast(list[str], d.pop("entitlement_policy_ids", UNSET)) + + license_ids = cast(list[str], d.pop("license_ids", UNSET)) + + _metadata = d.pop("metadata", UNSET) + metadata: Union[Unset, Metadata] + if isinstance(_metadata, Unset): + metadata = UNSET + else: + metadata = Metadata.from_dict(_metadata) + + get_license_group_response_content = cls( + created_at=created_at, + license_group_id=license_group_id, + name=name, + organization_id=organization_id, + updated_at=updated_at, + description=description, + entitlement_policy_ids=entitlement_policy_ids, + license_ids=license_ids, + metadata=metadata, + ) + + get_license_group_response_content.additional_properties = d + return get_license_group_response_content + + @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/griptape_cloud_client/models/get_license_response_content.py b/griptape_cloud_client/models/get_license_response_content.py new file mode 100644 index 0000000..b0bad20 --- /dev/null +++ b/griptape_cloud_client/models/get_license_response_content.py @@ -0,0 +1,193 @@ +import datetime +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from ..models.license_status import LicenseStatus +from ..models.license_type import LicenseType +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.metadata import Metadata + + +T = TypeVar("T", bound="GetLicenseResponseContent") + + +@_attrs_define +class GetLicenseResponseContent: + """ + Attributes: + created_at (datetime.datetime): + expires_at (datetime.datetime): + license_id (str): + license_type (LicenseType): + name (str): + organization_id (str): + status (LicenseStatus): + token_version (float): + updated_at (datetime.datetime): + effective_entitlement_policy_ids (Union[Unset, list[str]]): + entitlement_policy_ids (Union[Unset, list[str]]): + license_group_ids (Union[Unset, list[str]]): + metadata (Union[Unset, Metadata]): + user_id (Union[Unset, str]): + """ + + created_at: datetime.datetime + expires_at: datetime.datetime + license_id: str + license_type: LicenseType + name: str + organization_id: str + status: LicenseStatus + token_version: float + updated_at: datetime.datetime + effective_entitlement_policy_ids: Union[Unset, list[str]] = UNSET + entitlement_policy_ids: Union[Unset, list[str]] = UNSET + license_group_ids: Union[Unset, list[str]] = UNSET + metadata: Union[Unset, "Metadata"] = UNSET + user_id: Union[Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + created_at = self.created_at.isoformat() + + expires_at = self.expires_at.isoformat() + + license_id = self.license_id + + license_type = self.license_type.value + + name = self.name + + organization_id = self.organization_id + + status = self.status.value + + token_version = self.token_version + + updated_at = self.updated_at.isoformat() + + effective_entitlement_policy_ids: Union[Unset, list[str]] = UNSET + if not isinstance(self.effective_entitlement_policy_ids, Unset): + effective_entitlement_policy_ids = self.effective_entitlement_policy_ids + + entitlement_policy_ids: Union[Unset, list[str]] = UNSET + if not isinstance(self.entitlement_policy_ids, Unset): + entitlement_policy_ids = self.entitlement_policy_ids + + license_group_ids: Union[Unset, list[str]] = UNSET + if not isinstance(self.license_group_ids, Unset): + license_group_ids = self.license_group_ids + + metadata: Union[Unset, dict[str, Any]] = UNSET + if not isinstance(self.metadata, Unset): + metadata = self.metadata.to_dict() + + user_id = self.user_id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "created_at": created_at, + "expires_at": expires_at, + "license_id": license_id, + "license_type": license_type, + "name": name, + "organization_id": organization_id, + "status": status, + "token_version": token_version, + "updated_at": updated_at, + } + ) + if effective_entitlement_policy_ids is not UNSET: + field_dict["effective_entitlement_policy_ids"] = effective_entitlement_policy_ids + if entitlement_policy_ids is not UNSET: + field_dict["entitlement_policy_ids"] = entitlement_policy_ids + if license_group_ids is not UNSET: + field_dict["license_group_ids"] = license_group_ids + if metadata is not UNSET: + field_dict["metadata"] = metadata + if user_id is not UNSET: + field_dict["user_id"] = user_id + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.metadata import Metadata + + d = dict(src_dict) + created_at = isoparse(d.pop("created_at")) + + expires_at = isoparse(d.pop("expires_at")) + + license_id = d.pop("license_id") + + license_type = LicenseType(d.pop("license_type")) + + name = d.pop("name") + + organization_id = d.pop("organization_id") + + status = LicenseStatus(d.pop("status")) + + token_version = d.pop("token_version") + + updated_at = isoparse(d.pop("updated_at")) + + effective_entitlement_policy_ids = cast(list[str], d.pop("effective_entitlement_policy_ids", UNSET)) + + entitlement_policy_ids = cast(list[str], d.pop("entitlement_policy_ids", UNSET)) + + license_group_ids = cast(list[str], d.pop("license_group_ids", UNSET)) + + _metadata = d.pop("metadata", UNSET) + metadata: Union[Unset, Metadata] + if isinstance(_metadata, Unset): + metadata = UNSET + else: + metadata = Metadata.from_dict(_metadata) + + user_id = d.pop("user_id", UNSET) + + get_license_response_content = cls( + created_at=created_at, + expires_at=expires_at, + license_id=license_id, + license_type=license_type, + name=name, + organization_id=organization_id, + status=status, + token_version=token_version, + updated_at=updated_at, + effective_entitlement_policy_ids=effective_entitlement_policy_ids, + entitlement_policy_ids=entitlement_policy_ids, + license_group_ids=license_group_ids, + metadata=metadata, + user_id=user_id, + ) + + get_license_response_content.additional_properties = d + return get_license_response_content + + @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/griptape_cloud_client/models/get_model_response_content.py b/griptape_cloud_client/models/get_model_response_content.py new file mode 100644 index 0000000..82d4e31 --- /dev/null +++ b/griptape_cloud_client/models/get_model_response_content.py @@ -0,0 +1,172 @@ +import datetime +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from ..models.model_type import ModelType +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.auth_config_detail import AuthConfigDetail + + +T = TypeVar("T", bound="GetModelResponseContent") + + +@_attrs_define +class GetModelResponseContent: + """ + Attributes: + created_at (datetime.datetime): + default (bool): + model_name (str): + model_type (ModelType): + updated_at (datetime.datetime): + active (Union[Unset, bool]): + auth_config (Union[Unset, AuthConfigDetail]): + description (Union[Unset, str]): + editable (Union[Unset, bool]): + kwargs (Union[Unset, Any]): + model_config_id (Union[Unset, str]): + source (Union[Unset, str]): + """ + + created_at: datetime.datetime + default: bool + model_name: str + model_type: ModelType + updated_at: datetime.datetime + active: Union[Unset, bool] = UNSET + auth_config: Union[Unset, "AuthConfigDetail"] = UNSET + description: Union[Unset, str] = UNSET + editable: Union[Unset, bool] = UNSET + kwargs: Union[Unset, Any] = UNSET + model_config_id: Union[Unset, str] = UNSET + source: Union[Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + created_at = self.created_at.isoformat() + + default = self.default + + model_name = self.model_name + + model_type = self.model_type.value + + updated_at = self.updated_at.isoformat() + + active = self.active + + auth_config: Union[Unset, dict[str, Any]] = UNSET + if not isinstance(self.auth_config, Unset): + auth_config = self.auth_config.to_dict() + + description = self.description + + editable = self.editable + + kwargs = self.kwargs + + model_config_id = self.model_config_id + + source = self.source + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "created_at": created_at, + "default": default, + "model_name": model_name, + "model_type": model_type, + "updated_at": updated_at, + } + ) + if active is not UNSET: + field_dict["active"] = active + if auth_config is not UNSET: + field_dict["auth_config"] = auth_config + if description is not UNSET: + field_dict["description"] = description + if editable is not UNSET: + field_dict["editable"] = editable + if kwargs is not UNSET: + field_dict["kwargs"] = kwargs + if model_config_id is not UNSET: + field_dict["model_config_id"] = model_config_id + if source is not UNSET: + field_dict["source"] = source + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.auth_config_detail import AuthConfigDetail + + d = dict(src_dict) + created_at = isoparse(d.pop("created_at")) + + default = d.pop("default") + + model_name = d.pop("model_name") + + model_type = ModelType(d.pop("model_type")) + + updated_at = isoparse(d.pop("updated_at")) + + active = d.pop("active", UNSET) + + _auth_config = d.pop("auth_config", UNSET) + auth_config: Union[Unset, AuthConfigDetail] + if isinstance(_auth_config, Unset): + auth_config = UNSET + else: + auth_config = AuthConfigDetail.from_dict(_auth_config) + + description = d.pop("description", UNSET) + + editable = d.pop("editable", UNSET) + + kwargs = d.pop("kwargs", UNSET) + + model_config_id = d.pop("model_config_id", UNSET) + + source = d.pop("source", UNSET) + + get_model_response_content = cls( + created_at=created_at, + default=default, + model_name=model_name, + model_type=model_type, + updated_at=updated_at, + active=active, + auth_config=auth_config, + description=description, + editable=editable, + kwargs=kwargs, + model_config_id=model_config_id, + source=source, + ) + + get_model_response_content.additional_properties = d + return get_model_response_content + + @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/griptape_cloud_client/models/get_organization_response_content.py b/griptape_cloud_client/models/get_organization_response_content.py new file mode 100644 index 0000000..f369b9d --- /dev/null +++ b/griptape_cloud_client/models/get_organization_response_content.py @@ -0,0 +1,142 @@ +import datetime +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from ..models.entitlement import Entitlement +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.organization_model_config import OrganizationModelConfig + + +T = TypeVar("T", bound="GetOrganizationResponseContent") + + +@_attrs_define +class GetOrganizationResponseContent: + """ + Attributes: + created_at (datetime.datetime): + created_by (str): + default_bucket_id (str): + description (str): + entitlement (Entitlement): Default: Entitlement.FREE. + name (str): + organization_id (str): + updated_at (datetime.datetime): + model_config (Union[Unset, OrganizationModelConfig]): + """ + + created_at: datetime.datetime + created_by: str + default_bucket_id: str + description: str + name: str + organization_id: str + updated_at: datetime.datetime + entitlement: Entitlement = Entitlement.FREE + model_config: Union[Unset, "OrganizationModelConfig"] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + created_at = self.created_at.isoformat() + + created_by = self.created_by + + default_bucket_id = self.default_bucket_id + + description = self.description + + entitlement = self.entitlement.value + + name = self.name + + organization_id = self.organization_id + + updated_at = self.updated_at.isoformat() + + model_config: Union[Unset, dict[str, Any]] = UNSET + if not isinstance(self.model_config, Unset): + model_config = self.model_config.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "created_at": created_at, + "created_by": created_by, + "default_bucket_id": default_bucket_id, + "description": description, + "entitlement": entitlement, + "name": name, + "organization_id": organization_id, + "updated_at": updated_at, + } + ) + if model_config is not UNSET: + field_dict["model_config"] = model_config + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.organization_model_config import OrganizationModelConfig + + d = dict(src_dict) + created_at = isoparse(d.pop("created_at")) + + created_by = d.pop("created_by") + + default_bucket_id = d.pop("default_bucket_id") + + description = d.pop("description") + + entitlement = Entitlement(d.pop("entitlement")) + + name = d.pop("name") + + organization_id = d.pop("organization_id") + + updated_at = isoparse(d.pop("updated_at")) + + _model_config = d.pop("model_config", UNSET) + model_config: Union[Unset, OrganizationModelConfig] + if isinstance(_model_config, Unset): + model_config = UNSET + else: + model_config = OrganizationModelConfig.from_dict(_model_config) + + get_organization_response_content = cls( + created_at=created_at, + created_by=created_by, + default_bucket_id=default_bucket_id, + description=description, + entitlement=entitlement, + name=name, + organization_id=organization_id, + updated_at=updated_at, + model_config=model_config, + ) + + get_organization_response_content.additional_properties = d + return get_organization_response_content + + @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/griptape_cloud_client/models/get_session_pool_response_content.py b/griptape_cloud_client/models/get_session_pool_response_content.py new file mode 100644 index 0000000..a2fa5f2 --- /dev/null +++ b/griptape_cloud_client/models/get_session_pool_response_content.py @@ -0,0 +1,101 @@ +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 dateutil.parser import isoparse + +T = TypeVar("T", bound="GetSessionPoolResponseContent") + + +@_attrs_define +class GetSessionPoolResponseContent: + """ + Attributes: + active_count (float): + created_at (datetime.datetime): + organization_id (str): + session_pool_id (str): + total_sessions (float): + updated_at (datetime.datetime): + """ + + active_count: float + created_at: datetime.datetime + organization_id: str + session_pool_id: str + total_sessions: float + updated_at: datetime.datetime + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + active_count = self.active_count + + created_at = self.created_at.isoformat() + + organization_id = self.organization_id + + session_pool_id = self.session_pool_id + + total_sessions = self.total_sessions + + updated_at = self.updated_at.isoformat() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "active_count": active_count, + "created_at": created_at, + "organization_id": organization_id, + "session_pool_id": session_pool_id, + "total_sessions": total_sessions, + "updated_at": updated_at, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + active_count = d.pop("active_count") + + created_at = isoparse(d.pop("created_at")) + + organization_id = d.pop("organization_id") + + session_pool_id = d.pop("session_pool_id") + + total_sessions = d.pop("total_sessions") + + updated_at = isoparse(d.pop("updated_at")) + + get_session_pool_response_content = cls( + active_count=active_count, + created_at=created_at, + organization_id=organization_id, + session_pool_id=session_pool_id, + total_sessions=total_sessions, + updated_at=updated_at, + ) + + get_session_pool_response_content.additional_properties = d + return get_session_pool_response_content + + @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/griptape_cloud_client/models/get_session_response_content.py b/griptape_cloud_client/models/get_session_response_content.py new file mode 100644 index 0000000..d3baaad --- /dev/null +++ b/griptape_cloud_client/models/get_session_response_content.py @@ -0,0 +1,119 @@ +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 dateutil.parser import isoparse + +from ..models.session_status import SessionStatus + +T = TypeVar("T", bound="GetSessionResponseContent") + + +@_attrs_define +class GetSessionResponseContent: + """ + Attributes: + application_id (str): + created_at (datetime.datetime): + expires_at (datetime.datetime): + license_id (str): + organization_id (str): + session_id (str): + status (SessionStatus): + updated_at (datetime.datetime): + """ + + application_id: str + created_at: datetime.datetime + expires_at: datetime.datetime + license_id: str + organization_id: str + session_id: str + status: SessionStatus + updated_at: datetime.datetime + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + application_id = self.application_id + + created_at = self.created_at.isoformat() + + expires_at = self.expires_at.isoformat() + + license_id = self.license_id + + organization_id = self.organization_id + + session_id = self.session_id + + status = self.status.value + + updated_at = self.updated_at.isoformat() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "application_id": application_id, + "created_at": created_at, + "expires_at": expires_at, + "license_id": license_id, + "organization_id": organization_id, + "session_id": session_id, + "status": status, + "updated_at": updated_at, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + application_id = d.pop("application_id") + + created_at = isoparse(d.pop("created_at")) + + expires_at = isoparse(d.pop("expires_at")) + + license_id = d.pop("license_id") + + organization_id = d.pop("organization_id") + + session_id = d.pop("session_id") + + status = SessionStatus(d.pop("status")) + + updated_at = isoparse(d.pop("updated_at")) + + get_session_response_content = cls( + application_id=application_id, + created_at=created_at, + expires_at=expires_at, + license_id=license_id, + organization_id=organization_id, + session_id=session_id, + status=status, + updated_at=updated_at, + ) + + get_session_response_content.additional_properties = d + return get_session_response_content + + @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/griptape_cloud_client/models/import_job_detail.py b/griptape_cloud_client/models/import_job_detail.py new file mode 100644 index 0000000..0d58113 --- /dev/null +++ b/griptape_cloud_client/models/import_job_detail.py @@ -0,0 +1,199 @@ +import datetime +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from ..models.import_job_status import ImportJobStatus +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.metadata import Metadata + + +T = TypeVar("T", bound="ImportJobDetail") + + +@_attrs_define +class ImportJobDetail: + """ + Attributes: + created_at (datetime.datetime): + created_by (str): + data_lake_asset_path (str): + import_job_id (str): + import_type (str): + organization_id (str): + status (ImportJobStatus): + updated_at (datetime.datetime): + completed_at (Union[None, Unset, datetime.datetime]): + import_data (Union[Unset, Any]): + metadata (Union[Unset, Metadata]): + resource_suffix (Union[Unset, str]): + status_detail (Union[Unset, Any]): + """ + + created_at: datetime.datetime + created_by: str + data_lake_asset_path: str + import_job_id: str + import_type: str + organization_id: str + status: ImportJobStatus + updated_at: datetime.datetime + completed_at: Union[None, Unset, datetime.datetime] = UNSET + import_data: Union[Unset, Any] = UNSET + metadata: Union[Unset, "Metadata"] = UNSET + resource_suffix: Union[Unset, str] = UNSET + status_detail: Union[Unset, Any] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + created_at = self.created_at.isoformat() + + created_by = self.created_by + + data_lake_asset_path = self.data_lake_asset_path + + import_job_id = self.import_job_id + + import_type = self.import_type + + organization_id = self.organization_id + + status = self.status.value + + updated_at = self.updated_at.isoformat() + + completed_at: Union[None, Unset, str] + if isinstance(self.completed_at, Unset): + completed_at = UNSET + elif isinstance(self.completed_at, datetime.datetime): + completed_at = self.completed_at.isoformat() + else: + completed_at = self.completed_at + + import_data = self.import_data + + metadata: Union[Unset, dict[str, Any]] = UNSET + if not isinstance(self.metadata, Unset): + metadata = self.metadata.to_dict() + + resource_suffix = self.resource_suffix + + status_detail = self.status_detail + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "created_at": created_at, + "created_by": created_by, + "data_lake_asset_path": data_lake_asset_path, + "import_job_id": import_job_id, + "import_type": import_type, + "organization_id": organization_id, + "status": status, + "updated_at": updated_at, + } + ) + if completed_at is not UNSET: + field_dict["completed_at"] = completed_at + if import_data is not UNSET: + field_dict["import_data"] = import_data + if metadata is not UNSET: + field_dict["metadata"] = metadata + if resource_suffix is not UNSET: + field_dict["resource_suffix"] = resource_suffix + if status_detail is not UNSET: + field_dict["status_detail"] = status_detail + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.metadata import Metadata + + d = dict(src_dict) + created_at = isoparse(d.pop("created_at")) + + created_by = d.pop("created_by") + + data_lake_asset_path = d.pop("data_lake_asset_path") + + import_job_id = d.pop("import_job_id") + + import_type = d.pop("import_type") + + organization_id = d.pop("organization_id") + + status = ImportJobStatus(d.pop("status")) + + updated_at = isoparse(d.pop("updated_at")) + + def _parse_completed_at(data: object) -> Union[None, Unset, datetime.datetime]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + completed_at_type_0 = isoparse(data) + + return completed_at_type_0 + except: # noqa: E722 + pass + return cast(Union[None, Unset, datetime.datetime], data) + + completed_at = _parse_completed_at(d.pop("completed_at", UNSET)) + + import_data = d.pop("import_data", UNSET) + + _metadata = d.pop("metadata", UNSET) + metadata: Union[Unset, Metadata] + if isinstance(_metadata, Unset): + metadata = UNSET + else: + metadata = Metadata.from_dict(_metadata) + + resource_suffix = d.pop("resource_suffix", UNSET) + + status_detail = d.pop("status_detail", UNSET) + + import_job_detail = cls( + created_at=created_at, + created_by=created_by, + data_lake_asset_path=data_lake_asset_path, + import_job_id=import_job_id, + import_type=import_type, + organization_id=organization_id, + status=status, + updated_at=updated_at, + completed_at=completed_at, + import_data=import_data, + metadata=metadata, + resource_suffix=resource_suffix, + status_detail=status_detail, + ) + + import_job_detail.additional_properties = d + return import_job_detail + + @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/griptape_cloud_client/models/import_job_status.py b/griptape_cloud_client/models/import_job_status.py new file mode 100644 index 0000000..cb57eae --- /dev/null +++ b/griptape_cloud_client/models/import_job_status.py @@ -0,0 +1,13 @@ +from enum import Enum + + +class ImportJobStatus(str, Enum): + CANCELLED = "CANCELLED" + CREATED = "CREATED" + FAILED = "FAILED" + QUEUED = "QUEUED" + RUNNING = "RUNNING" + SUCCEEDED = "SUCCEEDED" + + def __str__(self) -> str: + return str(self.value) diff --git a/griptape_cloud_client/models/invite_detail.py b/griptape_cloud_client/models/invite_detail.py index 1e8787b..b22bba5 100644 --- a/griptape_cloud_client/models/invite_detail.py +++ b/griptape_cloud_client/models/invite_detail.py @@ -22,6 +22,7 @@ class InviteDetail: expires_at (datetime.datetime): invite_id (str): organization_id (str): + organization_name (str): status (InviteStatus): responded_at (Union[Unset, datetime.datetime]): """ @@ -32,6 +33,7 @@ class InviteDetail: expires_at: datetime.datetime invite_id: str organization_id: str + organization_name: str status: InviteStatus responded_at: Union[Unset, datetime.datetime] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -49,6 +51,8 @@ def to_dict(self) -> dict[str, Any]: organization_id = self.organization_id + organization_name = self.organization_name + status = self.status.value responded_at: Union[Unset, str] = UNSET @@ -65,6 +69,7 @@ def to_dict(self) -> dict[str, Any]: "expires_at": expires_at, "invite_id": invite_id, "organization_id": organization_id, + "organization_name": organization_name, "status": status, } ) @@ -88,6 +93,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: organization_id = d.pop("organization_id") + organization_name = d.pop("organization_name") + status = InviteStatus(d.pop("status")) _responded_at = d.pop("responded_at", UNSET) @@ -104,6 +111,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: expires_at=expires_at, invite_id=invite_id, organization_id=organization_id, + organization_name=organization_name, status=status, responded_at=responded_at, ) diff --git a/griptape_cloud_client/models/license_detail.py b/griptape_cloud_client/models/license_detail.py new file mode 100644 index 0000000..3d58a9a --- /dev/null +++ b/griptape_cloud_client/models/license_detail.py @@ -0,0 +1,193 @@ +import datetime +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from ..models.license_status import LicenseStatus +from ..models.license_type import LicenseType +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.metadata import Metadata + + +T = TypeVar("T", bound="LicenseDetail") + + +@_attrs_define +class LicenseDetail: + """ + Attributes: + created_at (datetime.datetime): + expires_at (datetime.datetime): + license_id (str): + license_type (LicenseType): + name (str): + organization_id (str): + status (LicenseStatus): + token_version (float): + updated_at (datetime.datetime): + effective_entitlement_policy_ids (Union[Unset, list[str]]): + entitlement_policy_ids (Union[Unset, list[str]]): + license_group_ids (Union[Unset, list[str]]): + metadata (Union[Unset, Metadata]): + user_id (Union[Unset, str]): + """ + + created_at: datetime.datetime + expires_at: datetime.datetime + license_id: str + license_type: LicenseType + name: str + organization_id: str + status: LicenseStatus + token_version: float + updated_at: datetime.datetime + effective_entitlement_policy_ids: Union[Unset, list[str]] = UNSET + entitlement_policy_ids: Union[Unset, list[str]] = UNSET + license_group_ids: Union[Unset, list[str]] = UNSET + metadata: Union[Unset, "Metadata"] = UNSET + user_id: Union[Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + created_at = self.created_at.isoformat() + + expires_at = self.expires_at.isoformat() + + license_id = self.license_id + + license_type = self.license_type.value + + name = self.name + + organization_id = self.organization_id + + status = self.status.value + + token_version = self.token_version + + updated_at = self.updated_at.isoformat() + + effective_entitlement_policy_ids: Union[Unset, list[str]] = UNSET + if not isinstance(self.effective_entitlement_policy_ids, Unset): + effective_entitlement_policy_ids = self.effective_entitlement_policy_ids + + entitlement_policy_ids: Union[Unset, list[str]] = UNSET + if not isinstance(self.entitlement_policy_ids, Unset): + entitlement_policy_ids = self.entitlement_policy_ids + + license_group_ids: Union[Unset, list[str]] = UNSET + if not isinstance(self.license_group_ids, Unset): + license_group_ids = self.license_group_ids + + metadata: Union[Unset, dict[str, Any]] = UNSET + if not isinstance(self.metadata, Unset): + metadata = self.metadata.to_dict() + + user_id = self.user_id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "created_at": created_at, + "expires_at": expires_at, + "license_id": license_id, + "license_type": license_type, + "name": name, + "organization_id": organization_id, + "status": status, + "token_version": token_version, + "updated_at": updated_at, + } + ) + if effective_entitlement_policy_ids is not UNSET: + field_dict["effective_entitlement_policy_ids"] = effective_entitlement_policy_ids + if entitlement_policy_ids is not UNSET: + field_dict["entitlement_policy_ids"] = entitlement_policy_ids + if license_group_ids is not UNSET: + field_dict["license_group_ids"] = license_group_ids + if metadata is not UNSET: + field_dict["metadata"] = metadata + if user_id is not UNSET: + field_dict["user_id"] = user_id + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.metadata import Metadata + + d = dict(src_dict) + created_at = isoparse(d.pop("created_at")) + + expires_at = isoparse(d.pop("expires_at")) + + license_id = d.pop("license_id") + + license_type = LicenseType(d.pop("license_type")) + + name = d.pop("name") + + organization_id = d.pop("organization_id") + + status = LicenseStatus(d.pop("status")) + + token_version = d.pop("token_version") + + updated_at = isoparse(d.pop("updated_at")) + + effective_entitlement_policy_ids = cast(list[str], d.pop("effective_entitlement_policy_ids", UNSET)) + + entitlement_policy_ids = cast(list[str], d.pop("entitlement_policy_ids", UNSET)) + + license_group_ids = cast(list[str], d.pop("license_group_ids", UNSET)) + + _metadata = d.pop("metadata", UNSET) + metadata: Union[Unset, Metadata] + if isinstance(_metadata, Unset): + metadata = UNSET + else: + metadata = Metadata.from_dict(_metadata) + + user_id = d.pop("user_id", UNSET) + + license_detail = cls( + created_at=created_at, + expires_at=expires_at, + license_id=license_id, + license_type=license_type, + name=name, + organization_id=organization_id, + status=status, + token_version=token_version, + updated_at=updated_at, + effective_entitlement_policy_ids=effective_entitlement_policy_ids, + entitlement_policy_ids=entitlement_policy_ids, + license_group_ids=license_group_ids, + metadata=metadata, + user_id=user_id, + ) + + license_detail.additional_properties = d + return license_detail + + @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/griptape_cloud_client/models/license_group_detail.py b/griptape_cloud_client/models/license_group_detail.py new file mode 100644 index 0000000..29c6712 --- /dev/null +++ b/griptape_cloud_client/models/license_group_detail.py @@ -0,0 +1,148 @@ +import datetime +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.metadata import Metadata + + +T = TypeVar("T", bound="LicenseGroupDetail") + + +@_attrs_define +class LicenseGroupDetail: + """ + Attributes: + created_at (datetime.datetime): + license_group_id (str): + name (str): + organization_id (str): + updated_at (datetime.datetime): + description (Union[Unset, str]): + entitlement_policy_ids (Union[Unset, list[str]]): + license_ids (Union[Unset, list[str]]): + metadata (Union[Unset, Metadata]): + """ + + created_at: datetime.datetime + license_group_id: str + name: str + organization_id: str + updated_at: datetime.datetime + description: Union[Unset, str] = UNSET + entitlement_policy_ids: Union[Unset, list[str]] = UNSET + license_ids: Union[Unset, list[str]] = UNSET + metadata: Union[Unset, "Metadata"] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + created_at = self.created_at.isoformat() + + license_group_id = self.license_group_id + + name = self.name + + organization_id = self.organization_id + + updated_at = self.updated_at.isoformat() + + description = self.description + + entitlement_policy_ids: Union[Unset, list[str]] = UNSET + if not isinstance(self.entitlement_policy_ids, Unset): + entitlement_policy_ids = self.entitlement_policy_ids + + license_ids: Union[Unset, list[str]] = UNSET + if not isinstance(self.license_ids, Unset): + license_ids = self.license_ids + + metadata: Union[Unset, dict[str, Any]] = UNSET + if not isinstance(self.metadata, Unset): + metadata = self.metadata.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "created_at": created_at, + "license_group_id": license_group_id, + "name": name, + "organization_id": organization_id, + "updated_at": updated_at, + } + ) + if description is not UNSET: + field_dict["description"] = description + if entitlement_policy_ids is not UNSET: + field_dict["entitlement_policy_ids"] = entitlement_policy_ids + if license_ids is not UNSET: + field_dict["license_ids"] = license_ids + if metadata is not UNSET: + field_dict["metadata"] = metadata + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.metadata import Metadata + + d = dict(src_dict) + created_at = isoparse(d.pop("created_at")) + + license_group_id = d.pop("license_group_id") + + name = d.pop("name") + + organization_id = d.pop("organization_id") + + updated_at = isoparse(d.pop("updated_at")) + + description = d.pop("description", UNSET) + + entitlement_policy_ids = cast(list[str], d.pop("entitlement_policy_ids", UNSET)) + + license_ids = cast(list[str], d.pop("license_ids", UNSET)) + + _metadata = d.pop("metadata", UNSET) + metadata: Union[Unset, Metadata] + if isinstance(_metadata, Unset): + metadata = UNSET + else: + metadata = Metadata.from_dict(_metadata) + + license_group_detail = cls( + created_at=created_at, + license_group_id=license_group_id, + name=name, + organization_id=organization_id, + updated_at=updated_at, + description=description, + entitlement_policy_ids=entitlement_policy_ids, + license_ids=license_ids, + metadata=metadata, + ) + + license_group_detail.additional_properties = d + return license_group_detail + + @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/griptape_cloud_client/models/license_status.py b/griptape_cloud_client/models/license_status.py new file mode 100644 index 0000000..8eee1e0 --- /dev/null +++ b/griptape_cloud_client/models/license_status.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class LicenseStatus(str, Enum): + ACTIVE = "ACTIVE" + REVOKED = "REVOKED" + + def __str__(self) -> str: + return str(self.value) diff --git a/griptape_cloud_client/models/license_type.py b/griptape_cloud_client/models/license_type.py new file mode 100644 index 0000000..b249071 --- /dev/null +++ b/griptape_cloud_client/models/license_type.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class LicenseType(str, Enum): + HEADLESS = "HEADLESS" + INTERACTIVE = "INTERACTIVE" + + def __str__(self) -> str: + return str(self.value) diff --git a/griptape_cloud_client/models/list_auth_configs_response_content.py b/griptape_cloud_client/models/list_auth_configs_response_content.py new file mode 100644 index 0000000..8717489 --- /dev/null +++ b/griptape_cloud_client/models/list_auth_configs_response_content.py @@ -0,0 +1,83 @@ +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 + +if TYPE_CHECKING: + from ..models.auth_config_detail import AuthConfigDetail + from ..models.pagination import Pagination + + +T = TypeVar("T", bound="ListAuthConfigsResponseContent") + + +@_attrs_define +class ListAuthConfigsResponseContent: + """ + Attributes: + auth_configs (list['AuthConfigDetail']): + pagination (Pagination): + """ + + auth_configs: list["AuthConfigDetail"] + pagination: "Pagination" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + auth_configs = [] + for auth_configs_item_data in self.auth_configs: + auth_configs_item = auth_configs_item_data.to_dict() + auth_configs.append(auth_configs_item) + + pagination = self.pagination.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "auth_configs": auth_configs, + "pagination": pagination, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.auth_config_detail import AuthConfigDetail + from ..models.pagination import Pagination + + d = dict(src_dict) + auth_configs = [] + _auth_configs = d.pop("auth_configs") + for auth_configs_item_data in _auth_configs: + auth_configs_item = AuthConfigDetail.from_dict(auth_configs_item_data) + + auth_configs.append(auth_configs_item) + + pagination = Pagination.from_dict(d.pop("pagination")) + + list_auth_configs_response_content = cls( + auth_configs=auth_configs, + pagination=pagination, + ) + + list_auth_configs_response_content.additional_properties = d + return list_auth_configs_response_content + + @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/griptape_cloud_client/models/list_credit_transactions_response_content.py b/griptape_cloud_client/models/list_credit_transactions_response_content.py new file mode 100644 index 0000000..b33bd8c --- /dev/null +++ b/griptape_cloud_client/models/list_credit_transactions_response_content.py @@ -0,0 +1,83 @@ +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 + +if TYPE_CHECKING: + from ..models.credit_transaction_detail import CreditTransactionDetail + from ..models.pagination import Pagination + + +T = TypeVar("T", bound="ListCreditTransactionsResponseContent") + + +@_attrs_define +class ListCreditTransactionsResponseContent: + """ + Attributes: + pagination (Pagination): + transactions (list['CreditTransactionDetail']): + """ + + pagination: "Pagination" + transactions: list["CreditTransactionDetail"] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + pagination = self.pagination.to_dict() + + transactions = [] + for transactions_item_data in self.transactions: + transactions_item = transactions_item_data.to_dict() + transactions.append(transactions_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "pagination": pagination, + "transactions": transactions, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.credit_transaction_detail import CreditTransactionDetail + from ..models.pagination import Pagination + + d = dict(src_dict) + pagination = Pagination.from_dict(d.pop("pagination")) + + transactions = [] + _transactions = d.pop("transactions") + for transactions_item_data in _transactions: + transactions_item = CreditTransactionDetail.from_dict(transactions_item_data) + + transactions.append(transactions_item) + + list_credit_transactions_response_content = cls( + pagination=pagination, + transactions=transactions, + ) + + list_credit_transactions_response_content.additional_properties = d + return list_credit_transactions_response_content + + @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/griptape_cloud_client/models/list_entitlement_policies_response_content.py b/griptape_cloud_client/models/list_entitlement_policies_response_content.py new file mode 100644 index 0000000..915bd40 --- /dev/null +++ b/griptape_cloud_client/models/list_entitlement_policies_response_content.py @@ -0,0 +1,83 @@ +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 + +if TYPE_CHECKING: + from ..models.entitlement_policy_detail import EntitlementPolicyDetail + from ..models.pagination import Pagination + + +T = TypeVar("T", bound="ListEntitlementPoliciesResponseContent") + + +@_attrs_define +class ListEntitlementPoliciesResponseContent: + """ + Attributes: + entitlement_policies (list['EntitlementPolicyDetail']): + pagination (Pagination): + """ + + entitlement_policies: list["EntitlementPolicyDetail"] + pagination: "Pagination" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + entitlement_policies = [] + for entitlement_policies_item_data in self.entitlement_policies: + entitlement_policies_item = entitlement_policies_item_data.to_dict() + entitlement_policies.append(entitlement_policies_item) + + pagination = self.pagination.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "entitlement_policies": entitlement_policies, + "pagination": pagination, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.entitlement_policy_detail import EntitlementPolicyDetail + from ..models.pagination import Pagination + + d = dict(src_dict) + entitlement_policies = [] + _entitlement_policies = d.pop("entitlement_policies") + for entitlement_policies_item_data in _entitlement_policies: + entitlement_policies_item = EntitlementPolicyDetail.from_dict(entitlement_policies_item_data) + + entitlement_policies.append(entitlement_policies_item) + + pagination = Pagination.from_dict(d.pop("pagination")) + + list_entitlement_policies_response_content = cls( + entitlement_policies=entitlement_policies, + pagination=pagination, + ) + + list_entitlement_policies_response_content.additional_properties = d + return list_entitlement_policies_response_content + + @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/griptape_cloud_client/models/list_export_jobs_response_content.py b/griptape_cloud_client/models/list_export_jobs_response_content.py new file mode 100644 index 0000000..7c9c85c --- /dev/null +++ b/griptape_cloud_client/models/list_export_jobs_response_content.py @@ -0,0 +1,83 @@ +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 + +if TYPE_CHECKING: + from ..models.export_job_detail import ExportJobDetail + from ..models.pagination import Pagination + + +T = TypeVar("T", bound="ListExportJobsResponseContent") + + +@_attrs_define +class ListExportJobsResponseContent: + """ + Attributes: + export_jobs (list['ExportJobDetail']): + pagination (Pagination): + """ + + export_jobs: list["ExportJobDetail"] + pagination: "Pagination" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + export_jobs = [] + for export_jobs_item_data in self.export_jobs: + export_jobs_item = export_jobs_item_data.to_dict() + export_jobs.append(export_jobs_item) + + pagination = self.pagination.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "export_jobs": export_jobs, + "pagination": pagination, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.export_job_detail import ExportJobDetail + from ..models.pagination import Pagination + + d = dict(src_dict) + export_jobs = [] + _export_jobs = d.pop("export_jobs") + for export_jobs_item_data in _export_jobs: + export_jobs_item = ExportJobDetail.from_dict(export_jobs_item_data) + + export_jobs.append(export_jobs_item) + + pagination = Pagination.from_dict(d.pop("pagination")) + + list_export_jobs_response_content = cls( + export_jobs=export_jobs, + pagination=pagination, + ) + + list_export_jobs_response_content.additional_properties = d + return list_export_jobs_response_content + + @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/griptape_cloud_client/models/list_import_jobs_response_content.py b/griptape_cloud_client/models/list_import_jobs_response_content.py new file mode 100644 index 0000000..01a491e --- /dev/null +++ b/griptape_cloud_client/models/list_import_jobs_response_content.py @@ -0,0 +1,83 @@ +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 + +if TYPE_CHECKING: + from ..models.import_job_detail import ImportJobDetail + from ..models.pagination import Pagination + + +T = TypeVar("T", bound="ListImportJobsResponseContent") + + +@_attrs_define +class ListImportJobsResponseContent: + """ + Attributes: + import_jobs (list['ImportJobDetail']): + pagination (Pagination): + """ + + import_jobs: list["ImportJobDetail"] + pagination: "Pagination" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + import_jobs = [] + for import_jobs_item_data in self.import_jobs: + import_jobs_item = import_jobs_item_data.to_dict() + import_jobs.append(import_jobs_item) + + pagination = self.pagination.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "import_jobs": import_jobs, + "pagination": pagination, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.import_job_detail import ImportJobDetail + from ..models.pagination import Pagination + + d = dict(src_dict) + import_jobs = [] + _import_jobs = d.pop("import_jobs") + for import_jobs_item_data in _import_jobs: + import_jobs_item = ImportJobDetail.from_dict(import_jobs_item_data) + + import_jobs.append(import_jobs_item) + + pagination = Pagination.from_dict(d.pop("pagination")) + + list_import_jobs_response_content = cls( + import_jobs=import_jobs, + pagination=pagination, + ) + + list_import_jobs_response_content.additional_properties = d + return list_import_jobs_response_content + + @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/griptape_cloud_client/models/list_license_groups_response_content.py b/griptape_cloud_client/models/list_license_groups_response_content.py new file mode 100644 index 0000000..20ea32e --- /dev/null +++ b/griptape_cloud_client/models/list_license_groups_response_content.py @@ -0,0 +1,83 @@ +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 + +if TYPE_CHECKING: + from ..models.license_group_detail import LicenseGroupDetail + from ..models.pagination import Pagination + + +T = TypeVar("T", bound="ListLicenseGroupsResponseContent") + + +@_attrs_define +class ListLicenseGroupsResponseContent: + """ + Attributes: + license_groups (list['LicenseGroupDetail']): + pagination (Pagination): + """ + + license_groups: list["LicenseGroupDetail"] + pagination: "Pagination" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + license_groups = [] + for license_groups_item_data in self.license_groups: + license_groups_item = license_groups_item_data.to_dict() + license_groups.append(license_groups_item) + + pagination = self.pagination.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "license_groups": license_groups, + "pagination": pagination, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.license_group_detail import LicenseGroupDetail + from ..models.pagination import Pagination + + d = dict(src_dict) + license_groups = [] + _license_groups = d.pop("license_groups") + for license_groups_item_data in _license_groups: + license_groups_item = LicenseGroupDetail.from_dict(license_groups_item_data) + + license_groups.append(license_groups_item) + + pagination = Pagination.from_dict(d.pop("pagination")) + + list_license_groups_response_content = cls( + license_groups=license_groups, + pagination=pagination, + ) + + list_license_groups_response_content.additional_properties = d + return list_license_groups_response_content + + @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/griptape_cloud_client/models/list_licenses_response_content.py b/griptape_cloud_client/models/list_licenses_response_content.py new file mode 100644 index 0000000..dd0b1ce --- /dev/null +++ b/griptape_cloud_client/models/list_licenses_response_content.py @@ -0,0 +1,83 @@ +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 + +if TYPE_CHECKING: + from ..models.license_detail import LicenseDetail + from ..models.pagination import Pagination + + +T = TypeVar("T", bound="ListLicensesResponseContent") + + +@_attrs_define +class ListLicensesResponseContent: + """ + Attributes: + licenses (list['LicenseDetail']): + pagination (Pagination): + """ + + licenses: list["LicenseDetail"] + pagination: "Pagination" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + licenses = [] + for licenses_item_data in self.licenses: + licenses_item = licenses_item_data.to_dict() + licenses.append(licenses_item) + + pagination = self.pagination.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "licenses": licenses, + "pagination": pagination, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.license_detail import LicenseDetail + from ..models.pagination import Pagination + + d = dict(src_dict) + licenses = [] + _licenses = d.pop("licenses") + for licenses_item_data in _licenses: + licenses_item = LicenseDetail.from_dict(licenses_item_data) + + licenses.append(licenses_item) + + pagination = Pagination.from_dict(d.pop("pagination")) + + list_licenses_response_content = cls( + licenses=licenses, + pagination=pagination, + ) + + list_licenses_response_content.additional_properties = d + return list_licenses_response_content + + @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/griptape_cloud_client/models/list_organizations_response_content.py b/griptape_cloud_client/models/list_organizations_response_content.py new file mode 100644 index 0000000..0703c46 --- /dev/null +++ b/griptape_cloud_client/models/list_organizations_response_content.py @@ -0,0 +1,75 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.organization_detail import OrganizationDetail + + +T = TypeVar("T", bound="ListOrganizationsResponseContent") + + +@_attrs_define +class ListOrganizationsResponseContent: + """ + Attributes: + organizations (Union[Unset, list['OrganizationDetail']]): + """ + + organizations: Union[Unset, list["OrganizationDetail"]] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + organizations: Union[Unset, list[dict[str, Any]]] = UNSET + if not isinstance(self.organizations, Unset): + organizations = [] + for organizations_item_data in self.organizations: + organizations_item = organizations_item_data.to_dict() + organizations.append(organizations_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if organizations is not UNSET: + field_dict["organizations"] = organizations + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.organization_detail import OrganizationDetail + + d = dict(src_dict) + organizations = [] + _organizations = d.pop("organizations", UNSET) + for organizations_item_data in _organizations or []: + organizations_item = OrganizationDetail.from_dict(organizations_item_data) + + organizations.append(organizations_item) + + list_organizations_response_content = cls( + organizations=organizations, + ) + + list_organizations_response_content.additional_properties = d + return list_organizations_response_content + + @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/griptape_cloud_client/models/list_sessions_response_content.py b/griptape_cloud_client/models/list_sessions_response_content.py new file mode 100644 index 0000000..910a6b4 --- /dev/null +++ b/griptape_cloud_client/models/list_sessions_response_content.py @@ -0,0 +1,83 @@ +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 + +if TYPE_CHECKING: + from ..models.pagination import Pagination + from ..models.session_detail import SessionDetail + + +T = TypeVar("T", bound="ListSessionsResponseContent") + + +@_attrs_define +class ListSessionsResponseContent: + """ + Attributes: + pagination (Pagination): + sessions (list['SessionDetail']): + """ + + pagination: "Pagination" + sessions: list["SessionDetail"] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + pagination = self.pagination.to_dict() + + sessions = [] + for sessions_item_data in self.sessions: + sessions_item = sessions_item_data.to_dict() + sessions.append(sessions_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "pagination": pagination, + "sessions": sessions, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.pagination import Pagination + from ..models.session_detail import SessionDetail + + d = dict(src_dict) + pagination = Pagination.from_dict(d.pop("pagination")) + + sessions = [] + _sessions = d.pop("sessions") + for sessions_item_data in _sessions: + sessions_item = SessionDetail.from_dict(sessions_item_data) + + sessions.append(sessions_item) + + list_sessions_response_content = cls( + pagination=pagination, + sessions=sessions, + ) + + list_sessions_response_content.additional_properties = d + return list_sessions_response_content + + @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/griptape_cloud_client/models/model_detail.py b/griptape_cloud_client/models/model_detail.py index 4276106..6ca2224 100644 --- a/griptape_cloud_client/models/model_detail.py +++ b/griptape_cloud_client/models/model_detail.py @@ -1,12 +1,18 @@ +import datetime from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field +from dateutil.parser import isoparse from ..models.model_type import ModelType from ..types import UNSET, Unset +if TYPE_CHECKING: + from ..models.auth_config_detail import AuthConfigDetail + + T = TypeVar("T", bound="ModelDetail") @@ -14,57 +20,136 @@ class ModelDetail: """ Attributes: + created_at (datetime.datetime): default (bool): model_name (str): model_type (ModelType): + updated_at (datetime.datetime): + active (Union[Unset, bool]): + auth_config (Union[Unset, AuthConfigDetail]): description (Union[Unset, str]): + editable (Union[Unset, bool]): + kwargs (Union[Unset, Any]): + model_config_id (Union[Unset, str]): + source (Union[Unset, str]): """ + created_at: datetime.datetime default: bool model_name: str model_type: ModelType + updated_at: datetime.datetime + active: Union[Unset, bool] = UNSET + auth_config: Union[Unset, "AuthConfigDetail"] = UNSET description: Union[Unset, str] = UNSET + editable: Union[Unset, bool] = UNSET + kwargs: Union[Unset, Any] = UNSET + model_config_id: Union[Unset, str] = UNSET + source: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + created_at = self.created_at.isoformat() + default = self.default model_name = self.model_name model_type = self.model_type.value + updated_at = self.updated_at.isoformat() + + active = self.active + + auth_config: Union[Unset, dict[str, Any]] = UNSET + if not isinstance(self.auth_config, Unset): + auth_config = self.auth_config.to_dict() + description = self.description + editable = self.editable + + kwargs = self.kwargs + + model_config_id = self.model_config_id + + source = self.source + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( { + "created_at": created_at, "default": default, "model_name": model_name, "model_type": model_type, + "updated_at": updated_at, } ) + if active is not UNSET: + field_dict["active"] = active + if auth_config is not UNSET: + field_dict["auth_config"] = auth_config if description is not UNSET: field_dict["description"] = description + if editable is not UNSET: + field_dict["editable"] = editable + if kwargs is not UNSET: + field_dict["kwargs"] = kwargs + if model_config_id is not UNSET: + field_dict["model_config_id"] = model_config_id + if source is not UNSET: + field_dict["source"] = source return field_dict @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.auth_config_detail import AuthConfigDetail + d = dict(src_dict) + created_at = isoparse(d.pop("created_at")) + default = d.pop("default") model_name = d.pop("model_name") model_type = ModelType(d.pop("model_type")) + updated_at = isoparse(d.pop("updated_at")) + + active = d.pop("active", UNSET) + + _auth_config = d.pop("auth_config", UNSET) + auth_config: Union[Unset, AuthConfigDetail] + if isinstance(_auth_config, Unset): + auth_config = UNSET + else: + auth_config = AuthConfigDetail.from_dict(_auth_config) + description = d.pop("description", UNSET) + editable = d.pop("editable", UNSET) + + kwargs = d.pop("kwargs", UNSET) + + model_config_id = d.pop("model_config_id", UNSET) + + source = d.pop("source", UNSET) + model_detail = cls( + created_at=created_at, default=default, model_name=model_name, model_type=model_type, + updated_at=updated_at, + active=active, + auth_config=auth_config, description=description, + editable=editable, + kwargs=kwargs, + model_config_id=model_config_id, + source=source, ) model_detail.additional_properties = d diff --git a/griptape_cloud_client/models/organization_detail.py b/griptape_cloud_client/models/organization_detail.py new file mode 100644 index 0000000..e875980 --- /dev/null +++ b/griptape_cloud_client/models/organization_detail.py @@ -0,0 +1,142 @@ +import datetime +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from ..models.entitlement import Entitlement +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.organization_model_config import OrganizationModelConfig + + +T = TypeVar("T", bound="OrganizationDetail") + + +@_attrs_define +class OrganizationDetail: + """ + Attributes: + created_at (datetime.datetime): + created_by (str): + default_bucket_id (str): + description (str): + entitlement (Entitlement): Default: Entitlement.FREE. + name (str): + organization_id (str): + updated_at (datetime.datetime): + model_config (Union[Unset, OrganizationModelConfig]): + """ + + created_at: datetime.datetime + created_by: str + default_bucket_id: str + description: str + name: str + organization_id: str + updated_at: datetime.datetime + entitlement: Entitlement = Entitlement.FREE + model_config: Union[Unset, "OrganizationModelConfig"] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + created_at = self.created_at.isoformat() + + created_by = self.created_by + + default_bucket_id = self.default_bucket_id + + description = self.description + + entitlement = self.entitlement.value + + name = self.name + + organization_id = self.organization_id + + updated_at = self.updated_at.isoformat() + + model_config: Union[Unset, dict[str, Any]] = UNSET + if not isinstance(self.model_config, Unset): + model_config = self.model_config.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "created_at": created_at, + "created_by": created_by, + "default_bucket_id": default_bucket_id, + "description": description, + "entitlement": entitlement, + "name": name, + "organization_id": organization_id, + "updated_at": updated_at, + } + ) + if model_config is not UNSET: + field_dict["model_config"] = model_config + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.organization_model_config import OrganizationModelConfig + + d = dict(src_dict) + created_at = isoparse(d.pop("created_at")) + + created_by = d.pop("created_by") + + default_bucket_id = d.pop("default_bucket_id") + + description = d.pop("description") + + entitlement = Entitlement(d.pop("entitlement")) + + name = d.pop("name") + + organization_id = d.pop("organization_id") + + updated_at = isoparse(d.pop("updated_at")) + + _model_config = d.pop("model_config", UNSET) + model_config: Union[Unset, OrganizationModelConfig] + if isinstance(_model_config, Unset): + model_config = UNSET + else: + model_config = OrganizationModelConfig.from_dict(_model_config) + + organization_detail = cls( + created_at=created_at, + created_by=created_by, + default_bucket_id=default_bucket_id, + description=description, + entitlement=entitlement, + name=name, + organization_id=organization_id, + updated_at=updated_at, + model_config=model_config, + ) + + organization_detail.additional_properties = d + return organization_detail + + @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/griptape_cloud_client/models/reissue_license_token_request_content.py b/griptape_cloud_client/models/reissue_license_token_request_content.py new file mode 100644 index 0000000..7d3fd99 --- /dev/null +++ b/griptape_cloud_client/models/reissue_license_token_request_content.py @@ -0,0 +1,68 @@ +import datetime +from collections.abc import Mapping +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ReissueLicenseTokenRequestContent") + + +@_attrs_define +class ReissueLicenseTokenRequestContent: + """ + Attributes: + expires_at (Union[Unset, datetime.datetime]): + """ + + expires_at: Union[Unset, datetime.datetime] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + expires_at: Union[Unset, str] = UNSET + if not isinstance(self.expires_at, Unset): + expires_at = self.expires_at.isoformat() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if expires_at is not UNSET: + field_dict["expires_at"] = expires_at + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + _expires_at = d.pop("expires_at", UNSET) + expires_at: Union[Unset, datetime.datetime] + if isinstance(_expires_at, Unset): + expires_at = UNSET + else: + expires_at = isoparse(_expires_at) + + reissue_license_token_request_content = cls( + expires_at=expires_at, + ) + + reissue_license_token_request_content.additional_properties = d + return reissue_license_token_request_content + + @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/griptape_cloud_client/models/reissue_license_token_response_content.py b/griptape_cloud_client/models/reissue_license_token_response_content.py new file mode 100644 index 0000000..3a88f6f --- /dev/null +++ b/griptape_cloud_client/models/reissue_license_token_response_content.py @@ -0,0 +1,59 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="ReissueLicenseTokenResponseContent") + + +@_attrs_define +class ReissueLicenseTokenResponseContent: + """ + Attributes: + license_token (str): + """ + + license_token: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + license_token = self.license_token + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "license_token": license_token, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + license_token = d.pop("license_token") + + reissue_license_token_response_content = cls( + license_token=license_token, + ) + + reissue_license_token_response_content.additional_properties = d + return reissue_license_token_response_content + + @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/griptape_cloud_client/models/renew_session_response_content.py b/griptape_cloud_client/models/renew_session_response_content.py new file mode 100644 index 0000000..5c20d79 --- /dev/null +++ b/griptape_cloud_client/models/renew_session_response_content.py @@ -0,0 +1,67 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="RenewSessionResponseContent") + + +@_attrs_define +class RenewSessionResponseContent: + """ + Attributes: + policy_documents (Any): + session_token (str): + """ + + policy_documents: Any + session_token: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + policy_documents = self.policy_documents + + session_token = self.session_token + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "policy_documents": policy_documents, + "session_token": session_token, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + policy_documents = d.pop("policy_documents") + + session_token = d.pop("session_token") + + renew_session_response_content = cls( + policy_documents=policy_documents, + session_token=session_token, + ) + + renew_session_response_content.additional_properties = d + return renew_session_response_content + + @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/griptape_cloud_client/models/session_detail.py b/griptape_cloud_client/models/session_detail.py new file mode 100644 index 0000000..a4fca28 --- /dev/null +++ b/griptape_cloud_client/models/session_detail.py @@ -0,0 +1,119 @@ +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 dateutil.parser import isoparse + +from ..models.session_status import SessionStatus + +T = TypeVar("T", bound="SessionDetail") + + +@_attrs_define +class SessionDetail: + """ + Attributes: + application_id (str): + created_at (datetime.datetime): + expires_at (datetime.datetime): + license_id (str): + organization_id (str): + session_id (str): + status (SessionStatus): + updated_at (datetime.datetime): + """ + + application_id: str + created_at: datetime.datetime + expires_at: datetime.datetime + license_id: str + organization_id: str + session_id: str + status: SessionStatus + updated_at: datetime.datetime + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + application_id = self.application_id + + created_at = self.created_at.isoformat() + + expires_at = self.expires_at.isoformat() + + license_id = self.license_id + + organization_id = self.organization_id + + session_id = self.session_id + + status = self.status.value + + updated_at = self.updated_at.isoformat() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "application_id": application_id, + "created_at": created_at, + "expires_at": expires_at, + "license_id": license_id, + "organization_id": organization_id, + "session_id": session_id, + "status": status, + "updated_at": updated_at, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + application_id = d.pop("application_id") + + created_at = isoparse(d.pop("created_at")) + + expires_at = isoparse(d.pop("expires_at")) + + license_id = d.pop("license_id") + + organization_id = d.pop("organization_id") + + session_id = d.pop("session_id") + + status = SessionStatus(d.pop("status")) + + updated_at = isoparse(d.pop("updated_at")) + + session_detail = cls( + application_id=application_id, + created_at=created_at, + expires_at=expires_at, + license_id=license_id, + organization_id=organization_id, + session_id=session_id, + status=status, + updated_at=updated_at, + ) + + session_detail.additional_properties = d + return session_detail + + @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/griptape_cloud_client/models/session_status.py b/griptape_cloud_client/models/session_status.py new file mode 100644 index 0000000..61ea3b7 --- /dev/null +++ b/griptape_cloud_client/models/session_status.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class SessionStatus(str, Enum): + ACTIVE = "ACTIVE" + EXPIRED = "EXPIRED" + RELEASED = "RELEASED" + + def __str__(self) -> str: + return str(self.value) diff --git a/griptape_cloud_client/models/start_import_job_response_content.py b/griptape_cloud_client/models/start_import_job_response_content.py new file mode 100644 index 0000000..9c078b3 --- /dev/null +++ b/griptape_cloud_client/models/start_import_job_response_content.py @@ -0,0 +1,199 @@ +import datetime +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from ..models.import_job_status import ImportJobStatus +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.metadata import Metadata + + +T = TypeVar("T", bound="StartImportJobResponseContent") + + +@_attrs_define +class StartImportJobResponseContent: + """ + Attributes: + created_at (datetime.datetime): + created_by (str): + data_lake_asset_path (str): + import_job_id (str): + import_type (str): + organization_id (str): + status (ImportJobStatus): + updated_at (datetime.datetime): + completed_at (Union[None, Unset, datetime.datetime]): + import_data (Union[Unset, Any]): + metadata (Union[Unset, Metadata]): + resource_suffix (Union[Unset, str]): + status_detail (Union[Unset, Any]): + """ + + created_at: datetime.datetime + created_by: str + data_lake_asset_path: str + import_job_id: str + import_type: str + organization_id: str + status: ImportJobStatus + updated_at: datetime.datetime + completed_at: Union[None, Unset, datetime.datetime] = UNSET + import_data: Union[Unset, Any] = UNSET + metadata: Union[Unset, "Metadata"] = UNSET + resource_suffix: Union[Unset, str] = UNSET + status_detail: Union[Unset, Any] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + created_at = self.created_at.isoformat() + + created_by = self.created_by + + data_lake_asset_path = self.data_lake_asset_path + + import_job_id = self.import_job_id + + import_type = self.import_type + + organization_id = self.organization_id + + status = self.status.value + + updated_at = self.updated_at.isoformat() + + completed_at: Union[None, Unset, str] + if isinstance(self.completed_at, Unset): + completed_at = UNSET + elif isinstance(self.completed_at, datetime.datetime): + completed_at = self.completed_at.isoformat() + else: + completed_at = self.completed_at + + import_data = self.import_data + + metadata: Union[Unset, dict[str, Any]] = UNSET + if not isinstance(self.metadata, Unset): + metadata = self.metadata.to_dict() + + resource_suffix = self.resource_suffix + + status_detail = self.status_detail + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "created_at": created_at, + "created_by": created_by, + "data_lake_asset_path": data_lake_asset_path, + "import_job_id": import_job_id, + "import_type": import_type, + "organization_id": organization_id, + "status": status, + "updated_at": updated_at, + } + ) + if completed_at is not UNSET: + field_dict["completed_at"] = completed_at + if import_data is not UNSET: + field_dict["import_data"] = import_data + if metadata is not UNSET: + field_dict["metadata"] = metadata + if resource_suffix is not UNSET: + field_dict["resource_suffix"] = resource_suffix + if status_detail is not UNSET: + field_dict["status_detail"] = status_detail + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.metadata import Metadata + + d = dict(src_dict) + created_at = isoparse(d.pop("created_at")) + + created_by = d.pop("created_by") + + data_lake_asset_path = d.pop("data_lake_asset_path") + + import_job_id = d.pop("import_job_id") + + import_type = d.pop("import_type") + + organization_id = d.pop("organization_id") + + status = ImportJobStatus(d.pop("status")) + + updated_at = isoparse(d.pop("updated_at")) + + def _parse_completed_at(data: object) -> Union[None, Unset, datetime.datetime]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + completed_at_type_0 = isoparse(data) + + return completed_at_type_0 + except: # noqa: E722 + pass + return cast(Union[None, Unset, datetime.datetime], data) + + completed_at = _parse_completed_at(d.pop("completed_at", UNSET)) + + import_data = d.pop("import_data", UNSET) + + _metadata = d.pop("metadata", UNSET) + metadata: Union[Unset, Metadata] + if isinstance(_metadata, Unset): + metadata = UNSET + else: + metadata = Metadata.from_dict(_metadata) + + resource_suffix = d.pop("resource_suffix", UNSET) + + status_detail = d.pop("status_detail", UNSET) + + start_import_job_response_content = cls( + created_at=created_at, + created_by=created_by, + data_lake_asset_path=data_lake_asset_path, + import_job_id=import_job_id, + import_type=import_type, + organization_id=organization_id, + status=status, + updated_at=updated_at, + completed_at=completed_at, + import_data=import_data, + metadata=metadata, + resource_suffix=resource_suffix, + status_detail=status_detail, + ) + + start_import_job_response_content.additional_properties = d + return start_import_job_response_content + + @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/griptape_cloud_client/models/update_assistant_request_content.py b/griptape_cloud_client/models/update_assistant_request_content.py index 2d34af3..0f8d620 100644 --- a/griptape_cloud_client/models/update_assistant_request_content.py +++ b/griptape_cloud_client/models/update_assistant_request_content.py @@ -16,6 +16,7 @@ class UpdateAssistantRequestContent: description (Union[Unset, str]): input_ (Union[Unset, str]): knowledge_base_ids (Union[Unset, list[str]]): + model (Union[Unset, str]): name (Union[Unset, str]): ruleset_ids (Union[Unset, list[str]]): structure_ids (Union[Unset, list[str]]): @@ -25,6 +26,7 @@ class UpdateAssistantRequestContent: description: Union[Unset, str] = UNSET input_: Union[Unset, str] = UNSET knowledge_base_ids: Union[Unset, list[str]] = UNSET + model: Union[Unset, str] = UNSET name: Union[Unset, str] = UNSET ruleset_ids: Union[Unset, list[str]] = UNSET structure_ids: Union[Unset, list[str]] = UNSET @@ -40,6 +42,8 @@ def to_dict(self) -> dict[str, Any]: if not isinstance(self.knowledge_base_ids, Unset): knowledge_base_ids = self.knowledge_base_ids + model = self.model + name = self.name ruleset_ids: Union[Unset, list[str]] = UNSET @@ -63,6 +67,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["input"] = input_ if knowledge_base_ids is not UNSET: field_dict["knowledge_base_ids"] = knowledge_base_ids + if model is not UNSET: + field_dict["model"] = model if name is not UNSET: field_dict["name"] = name if ruleset_ids is not UNSET: @@ -83,6 +89,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: knowledge_base_ids = cast(list[str], d.pop("knowledge_base_ids", UNSET)) + model = d.pop("model", UNSET) + name = d.pop("name", UNSET) ruleset_ids = cast(list[str], d.pop("ruleset_ids", UNSET)) @@ -95,6 +103,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description=description, input_=input_, knowledge_base_ids=knowledge_base_ids, + model=model, name=name, ruleset_ids=ruleset_ids, structure_ids=structure_ids, diff --git a/griptape_cloud_client/models/update_assistant_response_content.py b/griptape_cloud_client/models/update_assistant_response_content.py index d1af5e2..5930f04 100644 --- a/griptape_cloud_client/models/update_assistant_response_content.py +++ b/griptape_cloud_client/models/update_assistant_response_content.py @@ -28,6 +28,7 @@ class UpdateAssistantResponseContent: tool_ids (list[str]): updated_at (datetime.datetime): input_ (Union[Unset, str]): + model (Union[Unset, str]): """ assistant_id: str @@ -43,6 +44,7 @@ class UpdateAssistantResponseContent: tool_ids: list[str] updated_at: datetime.datetime input_: Union[Unset, str] = UNSET + model: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -72,6 +74,8 @@ def to_dict(self) -> dict[str, Any]: input_ = self.input_ + model = self.model + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( @@ -92,6 +96,8 @@ def to_dict(self) -> dict[str, Any]: ) if input_ is not UNSET: field_dict["input"] = input_ + if model is not UNSET: + field_dict["model"] = model return field_dict @@ -124,6 +130,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: input_ = d.pop("input", UNSET) + model = d.pop("model", UNSET) + update_assistant_response_content = cls( assistant_id=assistant_id, created_at=created_at, @@ -138,6 +146,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: tool_ids=tool_ids, updated_at=updated_at, input_=input_, + model=model, ) update_assistant_response_content.additional_properties = d diff --git a/griptape_cloud_client/models/update_auth_config_request_content.py b/griptape_cloud_client/models/update_auth_config_request_content.py new file mode 100644 index 0000000..219d91c --- /dev/null +++ b/griptape_cloud_client/models/update_auth_config_request_content.py @@ -0,0 +1,86 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="UpdateAuthConfigRequestContent") + + +@_attrs_define +class UpdateAuthConfigRequestContent: + """ + Attributes: + api_key_secret_id (Union[Unset, str]): + base_url (Union[Unset, str]): + kwargs (Union[Unset, Any]): + name (Union[Unset, str]): + """ + + api_key_secret_id: Union[Unset, str] = UNSET + base_url: Union[Unset, str] = UNSET + kwargs: Union[Unset, Any] = UNSET + name: Union[Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + api_key_secret_id = self.api_key_secret_id + + base_url = self.base_url + + kwargs = self.kwargs + + name = self.name + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if api_key_secret_id is not UNSET: + field_dict["api_key_secret_id"] = api_key_secret_id + if base_url is not UNSET: + field_dict["base_url"] = base_url + if kwargs is not UNSET: + field_dict["kwargs"] = kwargs + if name is not UNSET: + field_dict["name"] = name + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + api_key_secret_id = d.pop("api_key_secret_id", UNSET) + + base_url = d.pop("base_url", UNSET) + + kwargs = d.pop("kwargs", UNSET) + + name = d.pop("name", UNSET) + + update_auth_config_request_content = cls( + api_key_secret_id=api_key_secret_id, + base_url=base_url, + kwargs=kwargs, + name=name, + ) + + update_auth_config_request_content.additional_properties = d + return update_auth_config_request_content + + @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/griptape_cloud_client/models/update_auth_config_response_content.py b/griptape_cloud_client/models/update_auth_config_response_content.py new file mode 100644 index 0000000..a5e53d0 --- /dev/null +++ b/griptape_cloud_client/models/update_auth_config_response_content.py @@ -0,0 +1,112 @@ +import datetime +from collections.abc import Mapping +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="UpdateAuthConfigResponseContent") + + +@_attrs_define +class UpdateAuthConfigResponseContent: + """ + Attributes: + api_key_secret_id (str): + auth_config_id (str): + base_url (str): + created_at (datetime.datetime): + name (str): + updated_at (datetime.datetime): + kwargs (Union[Unset, Any]): + """ + + api_key_secret_id: str + auth_config_id: str + base_url: str + created_at: datetime.datetime + name: str + updated_at: datetime.datetime + kwargs: Union[Unset, Any] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + api_key_secret_id = self.api_key_secret_id + + auth_config_id = self.auth_config_id + + base_url = self.base_url + + created_at = self.created_at.isoformat() + + name = self.name + + updated_at = self.updated_at.isoformat() + + kwargs = self.kwargs + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "api_key_secret_id": api_key_secret_id, + "auth_config_id": auth_config_id, + "base_url": base_url, + "created_at": created_at, + "name": name, + "updated_at": updated_at, + } + ) + if kwargs is not UNSET: + field_dict["kwargs"] = kwargs + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + api_key_secret_id = d.pop("api_key_secret_id") + + auth_config_id = d.pop("auth_config_id") + + base_url = d.pop("base_url") + + created_at = isoparse(d.pop("created_at")) + + name = d.pop("name") + + updated_at = isoparse(d.pop("updated_at")) + + kwargs = d.pop("kwargs", UNSET) + + update_auth_config_response_content = cls( + api_key_secret_id=api_key_secret_id, + auth_config_id=auth_config_id, + base_url=base_url, + created_at=created_at, + name=name, + updated_at=updated_at, + kwargs=kwargs, + ) + + update_auth_config_response_content.additional_properties = d + return update_auth_config_response_content + + @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/griptape_cloud_client/models/update_entitlement_policy_request_content.py b/griptape_cloud_client/models/update_entitlement_policy_request_content.py new file mode 100644 index 0000000..919d77a --- /dev/null +++ b/griptape_cloud_client/models/update_entitlement_policy_request_content.py @@ -0,0 +1,99 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.metadata import Metadata + + +T = TypeVar("T", bound="UpdateEntitlementPolicyRequestContent") + + +@_attrs_define +class UpdateEntitlementPolicyRequestContent: + """ + Attributes: + description (Union[Unset, str]): + metadata (Union[Unset, Metadata]): + name (Union[Unset, str]): + policy_document (Union[Unset, Any]): + """ + + description: Union[Unset, str] = UNSET + metadata: Union[Unset, "Metadata"] = UNSET + name: Union[Unset, str] = UNSET + policy_document: Union[Unset, Any] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + description = self.description + + metadata: Union[Unset, dict[str, Any]] = UNSET + if not isinstance(self.metadata, Unset): + metadata = self.metadata.to_dict() + + name = self.name + + policy_document = self.policy_document + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if description is not UNSET: + field_dict["description"] = description + if metadata is not UNSET: + field_dict["metadata"] = metadata + if name is not UNSET: + field_dict["name"] = name + if policy_document is not UNSET: + field_dict["policy_document"] = policy_document + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.metadata import Metadata + + d = dict(src_dict) + description = d.pop("description", UNSET) + + _metadata = d.pop("metadata", UNSET) + metadata: Union[Unset, Metadata] + if isinstance(_metadata, Unset): + metadata = UNSET + else: + metadata = Metadata.from_dict(_metadata) + + name = d.pop("name", UNSET) + + policy_document = d.pop("policy_document", UNSET) + + update_entitlement_policy_request_content = cls( + description=description, + metadata=metadata, + name=name, + policy_document=policy_document, + ) + + update_entitlement_policy_request_content.additional_properties = d + return update_entitlement_policy_request_content + + @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/griptape_cloud_client/models/update_entitlement_policy_response_content.py b/griptape_cloud_client/models/update_entitlement_policy_response_content.py new file mode 100644 index 0000000..048d60f --- /dev/null +++ b/griptape_cloud_client/models/update_entitlement_policy_response_content.py @@ -0,0 +1,134 @@ +import datetime +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.metadata import Metadata + + +T = TypeVar("T", bound="UpdateEntitlementPolicyResponseContent") + + +@_attrs_define +class UpdateEntitlementPolicyResponseContent: + """ + Attributes: + created_at (datetime.datetime): + entitlement_policy_id (str): + name (str): + organization_id (str): + policy_document (Any): + updated_at (datetime.datetime): + description (Union[Unset, str]): + metadata (Union[Unset, Metadata]): + """ + + created_at: datetime.datetime + entitlement_policy_id: str + name: str + organization_id: str + policy_document: Any + updated_at: datetime.datetime + description: Union[Unset, str] = UNSET + metadata: Union[Unset, "Metadata"] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + created_at = self.created_at.isoformat() + + entitlement_policy_id = self.entitlement_policy_id + + name = self.name + + organization_id = self.organization_id + + policy_document = self.policy_document + + updated_at = self.updated_at.isoformat() + + description = self.description + + metadata: Union[Unset, dict[str, Any]] = UNSET + if not isinstance(self.metadata, Unset): + metadata = self.metadata.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "created_at": created_at, + "entitlement_policy_id": entitlement_policy_id, + "name": name, + "organization_id": organization_id, + "policy_document": policy_document, + "updated_at": updated_at, + } + ) + if description is not UNSET: + field_dict["description"] = description + if metadata is not UNSET: + field_dict["metadata"] = metadata + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.metadata import Metadata + + d = dict(src_dict) + created_at = isoparse(d.pop("created_at")) + + entitlement_policy_id = d.pop("entitlement_policy_id") + + name = d.pop("name") + + organization_id = d.pop("organization_id") + + policy_document = d.pop("policy_document") + + updated_at = isoparse(d.pop("updated_at")) + + description = d.pop("description", UNSET) + + _metadata = d.pop("metadata", UNSET) + metadata: Union[Unset, Metadata] + if isinstance(_metadata, Unset): + metadata = UNSET + else: + metadata = Metadata.from_dict(_metadata) + + update_entitlement_policy_response_content = cls( + created_at=created_at, + entitlement_policy_id=entitlement_policy_id, + name=name, + organization_id=organization_id, + policy_document=policy_document, + updated_at=updated_at, + description=description, + metadata=metadata, + ) + + update_entitlement_policy_response_content.additional_properties = d + return update_entitlement_policy_response_content + + @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/griptape_cloud_client/models/update_license_group_request_content.py b/griptape_cloud_client/models/update_license_group_request_content.py new file mode 100644 index 0000000..822beb3 --- /dev/null +++ b/griptape_cloud_client/models/update_license_group_request_content.py @@ -0,0 +1,112 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.metadata import Metadata + + +T = TypeVar("T", bound="UpdateLicenseGroupRequestContent") + + +@_attrs_define +class UpdateLicenseGroupRequestContent: + """ + Attributes: + description (Union[Unset, str]): + entitlement_policy_ids (Union[Unset, list[str]]): + license_ids (Union[Unset, list[str]]): + metadata (Union[Unset, Metadata]): + name (Union[Unset, str]): + """ + + description: Union[Unset, str] = UNSET + entitlement_policy_ids: Union[Unset, list[str]] = UNSET + license_ids: Union[Unset, list[str]] = UNSET + metadata: Union[Unset, "Metadata"] = UNSET + name: Union[Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + description = self.description + + entitlement_policy_ids: Union[Unset, list[str]] = UNSET + if not isinstance(self.entitlement_policy_ids, Unset): + entitlement_policy_ids = self.entitlement_policy_ids + + license_ids: Union[Unset, list[str]] = UNSET + if not isinstance(self.license_ids, Unset): + license_ids = self.license_ids + + metadata: Union[Unset, dict[str, Any]] = UNSET + if not isinstance(self.metadata, Unset): + metadata = self.metadata.to_dict() + + name = self.name + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if description is not UNSET: + field_dict["description"] = description + if entitlement_policy_ids is not UNSET: + field_dict["entitlement_policy_ids"] = entitlement_policy_ids + if license_ids is not UNSET: + field_dict["license_ids"] = license_ids + if metadata is not UNSET: + field_dict["metadata"] = metadata + if name is not UNSET: + field_dict["name"] = name + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.metadata import Metadata + + d = dict(src_dict) + description = d.pop("description", UNSET) + + entitlement_policy_ids = cast(list[str], d.pop("entitlement_policy_ids", UNSET)) + + license_ids = cast(list[str], d.pop("license_ids", UNSET)) + + _metadata = d.pop("metadata", UNSET) + metadata: Union[Unset, Metadata] + if isinstance(_metadata, Unset): + metadata = UNSET + else: + metadata = Metadata.from_dict(_metadata) + + name = d.pop("name", UNSET) + + update_license_group_request_content = cls( + description=description, + entitlement_policy_ids=entitlement_policy_ids, + license_ids=license_ids, + metadata=metadata, + name=name, + ) + + update_license_group_request_content.additional_properties = d + return update_license_group_request_content + + @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/griptape_cloud_client/models/update_license_group_response_content.py b/griptape_cloud_client/models/update_license_group_response_content.py new file mode 100644 index 0000000..a9dc79d --- /dev/null +++ b/griptape_cloud_client/models/update_license_group_response_content.py @@ -0,0 +1,148 @@ +import datetime +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.metadata import Metadata + + +T = TypeVar("T", bound="UpdateLicenseGroupResponseContent") + + +@_attrs_define +class UpdateLicenseGroupResponseContent: + """ + Attributes: + created_at (datetime.datetime): + license_group_id (str): + name (str): + organization_id (str): + updated_at (datetime.datetime): + description (Union[Unset, str]): + entitlement_policy_ids (Union[Unset, list[str]]): + license_ids (Union[Unset, list[str]]): + metadata (Union[Unset, Metadata]): + """ + + created_at: datetime.datetime + license_group_id: str + name: str + organization_id: str + updated_at: datetime.datetime + description: Union[Unset, str] = UNSET + entitlement_policy_ids: Union[Unset, list[str]] = UNSET + license_ids: Union[Unset, list[str]] = UNSET + metadata: Union[Unset, "Metadata"] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + created_at = self.created_at.isoformat() + + license_group_id = self.license_group_id + + name = self.name + + organization_id = self.organization_id + + updated_at = self.updated_at.isoformat() + + description = self.description + + entitlement_policy_ids: Union[Unset, list[str]] = UNSET + if not isinstance(self.entitlement_policy_ids, Unset): + entitlement_policy_ids = self.entitlement_policy_ids + + license_ids: Union[Unset, list[str]] = UNSET + if not isinstance(self.license_ids, Unset): + license_ids = self.license_ids + + metadata: Union[Unset, dict[str, Any]] = UNSET + if not isinstance(self.metadata, Unset): + metadata = self.metadata.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "created_at": created_at, + "license_group_id": license_group_id, + "name": name, + "organization_id": organization_id, + "updated_at": updated_at, + } + ) + if description is not UNSET: + field_dict["description"] = description + if entitlement_policy_ids is not UNSET: + field_dict["entitlement_policy_ids"] = entitlement_policy_ids + if license_ids is not UNSET: + field_dict["license_ids"] = license_ids + if metadata is not UNSET: + field_dict["metadata"] = metadata + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.metadata import Metadata + + d = dict(src_dict) + created_at = isoparse(d.pop("created_at")) + + license_group_id = d.pop("license_group_id") + + name = d.pop("name") + + organization_id = d.pop("organization_id") + + updated_at = isoparse(d.pop("updated_at")) + + description = d.pop("description", UNSET) + + entitlement_policy_ids = cast(list[str], d.pop("entitlement_policy_ids", UNSET)) + + license_ids = cast(list[str], d.pop("license_ids", UNSET)) + + _metadata = d.pop("metadata", UNSET) + metadata: Union[Unset, Metadata] + if isinstance(_metadata, Unset): + metadata = UNSET + else: + metadata = Metadata.from_dict(_metadata) + + update_license_group_response_content = cls( + created_at=created_at, + license_group_id=license_group_id, + name=name, + organization_id=organization_id, + updated_at=updated_at, + description=description, + entitlement_policy_ids=entitlement_policy_ids, + license_ids=license_ids, + metadata=metadata, + ) + + update_license_group_response_content.additional_properties = d + return update_license_group_response_content + + @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/griptape_cloud_client/models/update_license_request_content.py b/griptape_cloud_client/models/update_license_request_content.py new file mode 100644 index 0000000..7b595f1 --- /dev/null +++ b/griptape_cloud_client/models/update_license_request_content.py @@ -0,0 +1,109 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.license_status import LicenseStatus +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.metadata import Metadata + + +T = TypeVar("T", bound="UpdateLicenseRequestContent") + + +@_attrs_define +class UpdateLicenseRequestContent: + """ + Attributes: + entitlement_policy_ids (Union[Unset, list[str]]): + metadata (Union[Unset, Metadata]): + name (Union[Unset, str]): + status (Union[Unset, LicenseStatus]): + """ + + entitlement_policy_ids: Union[Unset, list[str]] = UNSET + metadata: Union[Unset, "Metadata"] = UNSET + name: Union[Unset, str] = UNSET + status: Union[Unset, LicenseStatus] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + entitlement_policy_ids: Union[Unset, list[str]] = UNSET + if not isinstance(self.entitlement_policy_ids, Unset): + entitlement_policy_ids = self.entitlement_policy_ids + + metadata: Union[Unset, dict[str, Any]] = UNSET + if not isinstance(self.metadata, Unset): + metadata = self.metadata.to_dict() + + name = self.name + + status: Union[Unset, str] = UNSET + if not isinstance(self.status, Unset): + status = self.status.value + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if entitlement_policy_ids is not UNSET: + field_dict["entitlement_policy_ids"] = entitlement_policy_ids + if metadata is not UNSET: + field_dict["metadata"] = metadata + if name is not UNSET: + field_dict["name"] = name + if status is not UNSET: + field_dict["status"] = status + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.metadata import Metadata + + d = dict(src_dict) + entitlement_policy_ids = cast(list[str], d.pop("entitlement_policy_ids", UNSET)) + + _metadata = d.pop("metadata", UNSET) + metadata: Union[Unset, Metadata] + if isinstance(_metadata, Unset): + metadata = UNSET + else: + metadata = Metadata.from_dict(_metadata) + + name = d.pop("name", UNSET) + + _status = d.pop("status", UNSET) + status: Union[Unset, LicenseStatus] + if isinstance(_status, Unset): + status = UNSET + else: + status = LicenseStatus(_status) + + update_license_request_content = cls( + entitlement_policy_ids=entitlement_policy_ids, + metadata=metadata, + name=name, + status=status, + ) + + update_license_request_content.additional_properties = d + return update_license_request_content + + @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/griptape_cloud_client/models/update_license_response_content.py b/griptape_cloud_client/models/update_license_response_content.py new file mode 100644 index 0000000..2b43da3 --- /dev/null +++ b/griptape_cloud_client/models/update_license_response_content.py @@ -0,0 +1,193 @@ +import datetime +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from ..models.license_status import LicenseStatus +from ..models.license_type import LicenseType +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.metadata import Metadata + + +T = TypeVar("T", bound="UpdateLicenseResponseContent") + + +@_attrs_define +class UpdateLicenseResponseContent: + """ + Attributes: + created_at (datetime.datetime): + expires_at (datetime.datetime): + license_id (str): + license_type (LicenseType): + name (str): + organization_id (str): + status (LicenseStatus): + token_version (float): + updated_at (datetime.datetime): + effective_entitlement_policy_ids (Union[Unset, list[str]]): + entitlement_policy_ids (Union[Unset, list[str]]): + license_group_ids (Union[Unset, list[str]]): + metadata (Union[Unset, Metadata]): + user_id (Union[Unset, str]): + """ + + created_at: datetime.datetime + expires_at: datetime.datetime + license_id: str + license_type: LicenseType + name: str + organization_id: str + status: LicenseStatus + token_version: float + updated_at: datetime.datetime + effective_entitlement_policy_ids: Union[Unset, list[str]] = UNSET + entitlement_policy_ids: Union[Unset, list[str]] = UNSET + license_group_ids: Union[Unset, list[str]] = UNSET + metadata: Union[Unset, "Metadata"] = UNSET + user_id: Union[Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + created_at = self.created_at.isoformat() + + expires_at = self.expires_at.isoformat() + + license_id = self.license_id + + license_type = self.license_type.value + + name = self.name + + organization_id = self.organization_id + + status = self.status.value + + token_version = self.token_version + + updated_at = self.updated_at.isoformat() + + effective_entitlement_policy_ids: Union[Unset, list[str]] = UNSET + if not isinstance(self.effective_entitlement_policy_ids, Unset): + effective_entitlement_policy_ids = self.effective_entitlement_policy_ids + + entitlement_policy_ids: Union[Unset, list[str]] = UNSET + if not isinstance(self.entitlement_policy_ids, Unset): + entitlement_policy_ids = self.entitlement_policy_ids + + license_group_ids: Union[Unset, list[str]] = UNSET + if not isinstance(self.license_group_ids, Unset): + license_group_ids = self.license_group_ids + + metadata: Union[Unset, dict[str, Any]] = UNSET + if not isinstance(self.metadata, Unset): + metadata = self.metadata.to_dict() + + user_id = self.user_id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "created_at": created_at, + "expires_at": expires_at, + "license_id": license_id, + "license_type": license_type, + "name": name, + "organization_id": organization_id, + "status": status, + "token_version": token_version, + "updated_at": updated_at, + } + ) + if effective_entitlement_policy_ids is not UNSET: + field_dict["effective_entitlement_policy_ids"] = effective_entitlement_policy_ids + if entitlement_policy_ids is not UNSET: + field_dict["entitlement_policy_ids"] = entitlement_policy_ids + if license_group_ids is not UNSET: + field_dict["license_group_ids"] = license_group_ids + if metadata is not UNSET: + field_dict["metadata"] = metadata + if user_id is not UNSET: + field_dict["user_id"] = user_id + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.metadata import Metadata + + d = dict(src_dict) + created_at = isoparse(d.pop("created_at")) + + expires_at = isoparse(d.pop("expires_at")) + + license_id = d.pop("license_id") + + license_type = LicenseType(d.pop("license_type")) + + name = d.pop("name") + + organization_id = d.pop("organization_id") + + status = LicenseStatus(d.pop("status")) + + token_version = d.pop("token_version") + + updated_at = isoparse(d.pop("updated_at")) + + effective_entitlement_policy_ids = cast(list[str], d.pop("effective_entitlement_policy_ids", UNSET)) + + entitlement_policy_ids = cast(list[str], d.pop("entitlement_policy_ids", UNSET)) + + license_group_ids = cast(list[str], d.pop("license_group_ids", UNSET)) + + _metadata = d.pop("metadata", UNSET) + metadata: Union[Unset, Metadata] + if isinstance(_metadata, Unset): + metadata = UNSET + else: + metadata = Metadata.from_dict(_metadata) + + user_id = d.pop("user_id", UNSET) + + update_license_response_content = cls( + created_at=created_at, + expires_at=expires_at, + license_id=license_id, + license_type=license_type, + name=name, + organization_id=organization_id, + status=status, + token_version=token_version, + updated_at=updated_at, + effective_entitlement_policy_ids=effective_entitlement_policy_ids, + entitlement_policy_ids=entitlement_policy_ids, + license_group_ids=license_group_ids, + metadata=metadata, + user_id=user_id, + ) + + update_license_response_content.additional_properties = d + return update_license_response_content + + @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/griptape_cloud_client/models/update_model_request_content.py b/griptape_cloud_client/models/update_model_request_content.py new file mode 100644 index 0000000..59ab37d --- /dev/null +++ b/griptape_cloud_client/models/update_model_request_content.py @@ -0,0 +1,112 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.model_type import ModelType +from ..types import UNSET, Unset + +T = TypeVar("T", bound="UpdateModelRequestContent") + + +@_attrs_define +class UpdateModelRequestContent: + """ + Attributes: + active (Union[Unset, bool]): + auth_config_id (Union[Unset, str]): + description (Union[Unset, str]): + kwargs (Union[Unset, Any]): + model_name (Union[Unset, str]): + model_type (Union[Unset, ModelType]): + """ + + active: Union[Unset, bool] = UNSET + auth_config_id: Union[Unset, str] = UNSET + description: Union[Unset, str] = UNSET + kwargs: Union[Unset, Any] = UNSET + model_name: Union[Unset, str] = UNSET + model_type: Union[Unset, ModelType] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + active = self.active + + auth_config_id = self.auth_config_id + + description = self.description + + kwargs = self.kwargs + + model_name = self.model_name + + model_type: Union[Unset, str] = UNSET + if not isinstance(self.model_type, Unset): + model_type = self.model_type.value + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if active is not UNSET: + field_dict["active"] = active + if auth_config_id is not UNSET: + field_dict["auth_config_id"] = auth_config_id + if description is not UNSET: + field_dict["description"] = description + if kwargs is not UNSET: + field_dict["kwargs"] = kwargs + if model_name is not UNSET: + field_dict["model_name"] = model_name + if model_type is not UNSET: + field_dict["model_type"] = model_type + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + active = d.pop("active", UNSET) + + auth_config_id = d.pop("auth_config_id", UNSET) + + description = d.pop("description", UNSET) + + kwargs = d.pop("kwargs", UNSET) + + model_name = d.pop("model_name", UNSET) + + _model_type = d.pop("model_type", UNSET) + model_type: Union[Unset, ModelType] + if isinstance(_model_type, Unset): + model_type = UNSET + else: + model_type = ModelType(_model_type) + + update_model_request_content = cls( + active=active, + auth_config_id=auth_config_id, + description=description, + kwargs=kwargs, + model_name=model_name, + model_type=model_type, + ) + + update_model_request_content.additional_properties = d + return update_model_request_content + + @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/griptape_cloud_client/models/update_model_response_content.py b/griptape_cloud_client/models/update_model_response_content.py new file mode 100644 index 0000000..fe5ec33 --- /dev/null +++ b/griptape_cloud_client/models/update_model_response_content.py @@ -0,0 +1,172 @@ +import datetime +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from ..models.model_type import ModelType +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.auth_config_detail import AuthConfigDetail + + +T = TypeVar("T", bound="UpdateModelResponseContent") + + +@_attrs_define +class UpdateModelResponseContent: + """ + Attributes: + created_at (datetime.datetime): + default (bool): + model_name (str): + model_type (ModelType): + updated_at (datetime.datetime): + active (Union[Unset, bool]): + auth_config (Union[Unset, AuthConfigDetail]): + description (Union[Unset, str]): + editable (Union[Unset, bool]): + kwargs (Union[Unset, Any]): + model_config_id (Union[Unset, str]): + source (Union[Unset, str]): + """ + + created_at: datetime.datetime + default: bool + model_name: str + model_type: ModelType + updated_at: datetime.datetime + active: Union[Unset, bool] = UNSET + auth_config: Union[Unset, "AuthConfigDetail"] = UNSET + description: Union[Unset, str] = UNSET + editable: Union[Unset, bool] = UNSET + kwargs: Union[Unset, Any] = UNSET + model_config_id: Union[Unset, str] = UNSET + source: Union[Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + created_at = self.created_at.isoformat() + + default = self.default + + model_name = self.model_name + + model_type = self.model_type.value + + updated_at = self.updated_at.isoformat() + + active = self.active + + auth_config: Union[Unset, dict[str, Any]] = UNSET + if not isinstance(self.auth_config, Unset): + auth_config = self.auth_config.to_dict() + + description = self.description + + editable = self.editable + + kwargs = self.kwargs + + model_config_id = self.model_config_id + + source = self.source + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "created_at": created_at, + "default": default, + "model_name": model_name, + "model_type": model_type, + "updated_at": updated_at, + } + ) + if active is not UNSET: + field_dict["active"] = active + if auth_config is not UNSET: + field_dict["auth_config"] = auth_config + if description is not UNSET: + field_dict["description"] = description + if editable is not UNSET: + field_dict["editable"] = editable + if kwargs is not UNSET: + field_dict["kwargs"] = kwargs + if model_config_id is not UNSET: + field_dict["model_config_id"] = model_config_id + if source is not UNSET: + field_dict["source"] = source + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.auth_config_detail import AuthConfigDetail + + d = dict(src_dict) + created_at = isoparse(d.pop("created_at")) + + default = d.pop("default") + + model_name = d.pop("model_name") + + model_type = ModelType(d.pop("model_type")) + + updated_at = isoparse(d.pop("updated_at")) + + active = d.pop("active", UNSET) + + _auth_config = d.pop("auth_config", UNSET) + auth_config: Union[Unset, AuthConfigDetail] + if isinstance(_auth_config, Unset): + auth_config = UNSET + else: + auth_config = AuthConfigDetail.from_dict(_auth_config) + + description = d.pop("description", UNSET) + + editable = d.pop("editable", UNSET) + + kwargs = d.pop("kwargs", UNSET) + + model_config_id = d.pop("model_config_id", UNSET) + + source = d.pop("source", UNSET) + + update_model_response_content = cls( + created_at=created_at, + default=default, + model_name=model_name, + model_type=model_type, + updated_at=updated_at, + active=active, + auth_config=auth_config, + description=description, + editable=editable, + kwargs=kwargs, + model_config_id=model_config_id, + source=source, + ) + + update_model_response_content.additional_properties = d + return update_model_response_content + + @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/griptape_cloud_client/models/update_organization_response_content.py b/griptape_cloud_client/models/update_organization_response_content.py new file mode 100644 index 0000000..50e9b65 --- /dev/null +++ b/griptape_cloud_client/models/update_organization_response_content.py @@ -0,0 +1,142 @@ +import datetime +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from ..models.entitlement import Entitlement +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.organization_model_config import OrganizationModelConfig + + +T = TypeVar("T", bound="UpdateOrganizationResponseContent") + + +@_attrs_define +class UpdateOrganizationResponseContent: + """ + Attributes: + created_at (datetime.datetime): + created_by (str): + default_bucket_id (str): + description (str): + entitlement (Entitlement): Default: Entitlement.FREE. + name (str): + organization_id (str): + updated_at (datetime.datetime): + model_config (Union[Unset, OrganizationModelConfig]): + """ + + created_at: datetime.datetime + created_by: str + default_bucket_id: str + description: str + name: str + organization_id: str + updated_at: datetime.datetime + entitlement: Entitlement = Entitlement.FREE + model_config: Union[Unset, "OrganizationModelConfig"] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + created_at = self.created_at.isoformat() + + created_by = self.created_by + + default_bucket_id = self.default_bucket_id + + description = self.description + + entitlement = self.entitlement.value + + name = self.name + + organization_id = self.organization_id + + updated_at = self.updated_at.isoformat() + + model_config: Union[Unset, dict[str, Any]] = UNSET + if not isinstance(self.model_config, Unset): + model_config = self.model_config.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "created_at": created_at, + "created_by": created_by, + "default_bucket_id": default_bucket_id, + "description": description, + "entitlement": entitlement, + "name": name, + "organization_id": organization_id, + "updated_at": updated_at, + } + ) + if model_config is not UNSET: + field_dict["model_config"] = model_config + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.organization_model_config import OrganizationModelConfig + + d = dict(src_dict) + created_at = isoparse(d.pop("created_at")) + + created_by = d.pop("created_by") + + default_bucket_id = d.pop("default_bucket_id") + + description = d.pop("description") + + entitlement = Entitlement(d.pop("entitlement")) + + name = d.pop("name") + + organization_id = d.pop("organization_id") + + updated_at = isoparse(d.pop("updated_at")) + + _model_config = d.pop("model_config", UNSET) + model_config: Union[Unset, OrganizationModelConfig] + if isinstance(_model_config, Unset): + model_config = UNSET + else: + model_config = OrganizationModelConfig.from_dict(_model_config) + + update_organization_response_content = cls( + created_at=created_at, + created_by=created_by, + default_bucket_id=default_bucket_id, + description=description, + entitlement=entitlement, + name=name, + organization_id=organization_id, + updated_at=updated_at, + model_config=model_config, + ) + + update_organization_response_content.additional_properties = d + return update_organization_response_content + + @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/griptape_cloud_client/models/update_session_request_content.py b/griptape_cloud_client/models/update_session_request_content.py new file mode 100644 index 0000000..d1a3db3 --- /dev/null +++ b/griptape_cloud_client/models/update_session_request_content.py @@ -0,0 +1,77 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.session_status import SessionStatus +from ..types import UNSET, Unset + +T = TypeVar("T", bound="UpdateSessionRequestContent") + + +@_attrs_define +class UpdateSessionRequestContent: + """ + Attributes: + grace_period (Union[Unset, float]): Grace period in seconds applied when transitioning to RELEASED. + Ignored if status is not RELEASED. Max 900 (15 minutes). + status (Union[Unset, SessionStatus]): + """ + + grace_period: Union[Unset, float] = UNSET + status: Union[Unset, SessionStatus] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + grace_period = self.grace_period + + status: Union[Unset, str] = UNSET + if not isinstance(self.status, Unset): + status = self.status.value + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if grace_period is not UNSET: + field_dict["grace_period"] = grace_period + if status is not UNSET: + field_dict["status"] = status + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + grace_period = d.pop("grace_period", UNSET) + + _status = d.pop("status", UNSET) + status: Union[Unset, SessionStatus] + if isinstance(_status, Unset): + status = UNSET + else: + status = SessionStatus(_status) + + update_session_request_content = cls( + grace_period=grace_period, + status=status, + ) + + update_session_request_content.additional_properties = d + return update_session_request_content + + @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/griptape_cloud_client/models/update_session_response_content.py b/griptape_cloud_client/models/update_session_response_content.py new file mode 100644 index 0000000..6b2ab6b --- /dev/null +++ b/griptape_cloud_client/models/update_session_response_content.py @@ -0,0 +1,119 @@ +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 dateutil.parser import isoparse + +from ..models.session_status import SessionStatus + +T = TypeVar("T", bound="UpdateSessionResponseContent") + + +@_attrs_define +class UpdateSessionResponseContent: + """ + Attributes: + application_id (str): + created_at (datetime.datetime): + expires_at (datetime.datetime): + license_id (str): + organization_id (str): + session_id (str): + status (SessionStatus): + updated_at (datetime.datetime): + """ + + application_id: str + created_at: datetime.datetime + expires_at: datetime.datetime + license_id: str + organization_id: str + session_id: str + status: SessionStatus + updated_at: datetime.datetime + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + application_id = self.application_id + + created_at = self.created_at.isoformat() + + expires_at = self.expires_at.isoformat() + + license_id = self.license_id + + organization_id = self.organization_id + + session_id = self.session_id + + status = self.status.value + + updated_at = self.updated_at.isoformat() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "application_id": application_id, + "created_at": created_at, + "expires_at": expires_at, + "license_id": license_id, + "organization_id": organization_id, + "session_id": session_id, + "status": status, + "updated_at": updated_at, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + application_id = d.pop("application_id") + + created_at = isoparse(d.pop("created_at")) + + expires_at = isoparse(d.pop("expires_at")) + + license_id = d.pop("license_id") + + organization_id = d.pop("organization_id") + + session_id = d.pop("session_id") + + status = SessionStatus(d.pop("status")) + + updated_at = isoparse(d.pop("updated_at")) + + update_session_response_content = cls( + application_id=application_id, + created_at=created_at, + expires_at=expires_at, + license_id=license_id, + organization_id=organization_id, + session_id=session_id, + status=status, + updated_at=updated_at, + ) + + update_session_response_content.additional_properties = d + return update_session_response_content + + @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/scripts/gen_sdk.py b/scripts/gen_sdk.py index 78482fc..b9bdeaf 100644 --- a/scripts/gen_sdk.py +++ b/scripts/gen_sdk.py @@ -30,6 +30,26 @@ def _strip_oneof_titles(spec: dict) -> None: del item["title"] +def _collapse_allof_default(spec: dict) -> None: + """Hoist a standalone `default` out of an allOf. + + Pydantic emits enum defaults as `allOf: [{$ref: ...}, {default: X}]`. The + bare `{default: X}` member has no type or $ref, which openapi-python-client + rejects as "a non-object" and then drops the whole schema. Collapse it by + removing that member and hoisting the default onto the schema itself. + """ + allof = spec.get("allOf") + if not isinstance(allof, list): + return + kept = [] + for item in allof: + if isinstance(item, dict) and set(item.keys()) == {"default"}: + spec["default"] = item["default"] + else: + kept.append(item) + spec["allOf"] = kept + + def _handle_create_asset_operation(spec: dict) -> None: """Handle CreateAsset operation by cloning 201 response to 200.""" if spec.get("operationId") != "CreateAsset": @@ -55,6 +75,9 @@ def recurse_openapi_spec_for_edits(spec: dict | list) -> None: # Strip oneOf titles _strip_oneof_titles(spec) + # Collapse allOf with a standalone default + _collapse_allof_default(spec) + # Handle CreateAsset operation _handle_create_asset_operation(spec)