diff --git a/.fern/metadata.json b/.fern/metadata.json
new file mode 100644
index 0000000..8871989
--- /dev/null
+++ b/.fern/metadata.json
@@ -0,0 +1,25 @@
+{
+ "cliVersion": "3.5.0",
+ "generatorName": "fernapi/fern-python-sdk",
+ "generatorVersion": "4.45.1",
+ "generatorConfig": {
+ "package_name": "truefoundry_sdk",
+ "pydantic_config": {
+ "enum_type": "python_enums",
+ "use_provided_defaults": true,
+ "frozen": false
+ },
+ "client": {
+ "class_name": "BaseTrueFoundry",
+ "filename": "base_client.py",
+ "exported_class_name": "TrueFoundry",
+ "exported_filename": "client.py"
+ },
+ "pyproject_python_version": ">=3.8",
+ "extra_dev_dependencies": {
+ "ipython": ">=8.0.0,<10.0.0",
+ "Jinja2": ">=3.1.6,<4.0.0",
+ "numpydoc": ">=1.7.0,<2.0.0"
+ }
+ }
+}
\ No newline at end of file
diff --git a/README.md b/README.md
index af18e0e..fa29765 100644
--- a/README.md
+++ b/README.md
@@ -11,6 +11,21 @@ This library provides convenient access to the TrueFoundry API.
> - TypeScript: [](https://deepwiki.com/truefoundry/truefoundry-typescript-sdk)
+## Table of Contents
+
+- [Installation](#installation)
+- [Reference](#reference)
+- [Usage](#usage)
+- [Async Client](#async-client)
+- [Exception Handling](#exception-handling)
+- [Pagination](#pagination)
+- [Advanced](#advanced)
+ - [Access Raw Response Data](#access-raw-response-data)
+ - [Retries](#retries)
+ - [Timeouts](#timeouts)
+ - [Custom Client](#custom-client)
+- [Contributing](#contributing)
+
## Installation
```sh
@@ -152,6 +167,15 @@ for page in response.iter_pages():
yield page
```
+```python
+# You can also iterate through pages and access the typed response per page
+pager = client.users.list(...)
+for page in pager.iter_pages():
+ print(page.response) # access the typed response for each page
+ for item in page:
+ print(item)
+```
+
## Advanced
### Access Raw Response Data
@@ -169,11 +193,11 @@ response = client.applications.with_raw_response.list(...)
print(response.headers) # access the response headers
print(response.data) # access the underlying object
pager = client.users.list(...)
-print(pager.response.headers) # access the response headers for the first page
+print(pager.response) # access the typed response for the first page
for item in pager:
print(item) # access the underlying object(s)
for page in pager.iter_pages():
- print(page.response.headers) # access the response headers for each page
+ print(page.response) # access the typed response for each page
for item in page:
print(item) # access the underlying object(s)
```
diff --git a/poetry.lock b/poetry.lock
index a2bd784..7bde5c8 100644
--- a/poetry.lock
+++ b/poetry.lock
@@ -60,18 +60,18 @@ files = [
[[package]]
name = "asttokens"
-version = "3.0.0"
+version = "3.0.1"
description = "Annotate AST trees with source code positions"
optional = false
python-versions = ">=3.8"
files = [
- {file = "asttokens-3.0.0-py3-none-any.whl", hash = "sha256:e3078351a059199dd5138cb1c706e6430c05eff2ff136af5eb4790f9d28932e2"},
- {file = "asttokens-3.0.0.tar.gz", hash = "sha256:0dcd8baa8d62b0c1d118b399b2ddba3c4aff271d0d7a9e0d4c1681c79035bbc7"},
+ {file = "asttokens-3.0.1-py3-none-any.whl", hash = "sha256:15a3ebc0f43c2d0a50eeafea25e19046c68398e487b9f1f5b517f7c0f40f976a"},
+ {file = "asttokens-3.0.1.tar.gz", hash = "sha256:71a4ee5de0bde6a31d64f6b13f2293ac190344478f081c3d1bccfcf5eacb0cb7"},
]
[package.extras]
-astroid = ["astroid (>=2,<4)"]
-test = ["astroid (>=2,<4)", "pytest", "pytest-cov", "pytest-xdist"]
+astroid = ["astroid (>=2,<5)"]
+test = ["astroid (>=2,<5)", "pytest (<9.0)", "pytest-cov", "pytest-xdist"]
[[package]]
name = "babel"
@@ -103,13 +103,13 @@ files = [
[[package]]
name = "certifi"
-version = "2025.10.5"
+version = "2025.11.12"
description = "Python package for providing Mozilla's CA Bundle."
optional = false
python-versions = ">=3.7"
files = [
- {file = "certifi-2025.10.5-py3-none-any.whl", hash = "sha256:0f212c2744a9bb6de0c56639a6f68afe01ecd92d91f14ae897c4fe7bbeeef0de"},
- {file = "certifi-2025.10.5.tar.gz", hash = "sha256:47c09d31ccf2acf0be3f701ea53595ee7e0b8fa08801c6624be771df09ae7b43"},
+ {file = "certifi-2025.11.12-py3-none-any.whl", hash = "sha256:97de8790030bbd5c2d96b7ec782fc2f7820ef8dba6db909ccf95449f2d062d4b"},
+ {file = "certifi-2025.11.12.tar.gz", hash = "sha256:d8ab5478f2ecd78af242878415affce761ca6bc54a22a27e026d7c25357c3316"},
]
[[package]]
@@ -269,13 +269,13 @@ files = [
[[package]]
name = "exceptiongroup"
-version = "1.3.0"
+version = "1.3.1"
description = "Backport of PEP 654 (exception groups)"
optional = false
python-versions = ">=3.7"
files = [
- {file = "exceptiongroup-1.3.0-py3-none-any.whl", hash = "sha256:4d111e6e0c13d0644cad6ddaa7ed0261a0b36971f6d23e7ec9b4b9097da78a10"},
- {file = "exceptiongroup-1.3.0.tar.gz", hash = "sha256:b241f5885f560bc56a59ee63ca4c6a8bfa46ae4ad651af316d4e81817bb9fd88"},
+ {file = "exceptiongroup-1.3.1-py3-none-any.whl", hash = "sha256:a7a39a3bd276781e98394987d3a5701d0c4edffb633bb7a5144577f82c773598"},
+ {file = "exceptiongroup-1.3.1.tar.gz", hash = "sha256:8b412432c6055b0b7d14c310000ae93352ed6754f70fa8f7c34141f91c4e3219"},
]
[package.dependencies]
@@ -284,6 +284,20 @@ typing-extensions = {version = ">=4.6.0", markers = "python_version < \"3.13\""}
[package.extras]
test = ["pytest (>=6)"]
+[[package]]
+name = "execnet"
+version = "2.1.2"
+description = "execnet: rapid multi-Python deployment"
+optional = false
+python-versions = ">=3.8"
+files = [
+ {file = "execnet-2.1.2-py3-none-any.whl", hash = "sha256:67fba928dd5a544b783f6056f449e5e3931a5c378b128bc18501f7ea79e296ec"},
+ {file = "execnet-2.1.2.tar.gz", hash = "sha256:63d83bfdd9a23e35b9c6a3261412324f964c2ec8dcd8d3c6916ee9373e0befcd"},
+]
+
+[package.extras]
+testing = ["hatch", "pre-commit", "pytest", "tox"]
+
[[package]]
name = "executing"
version = "2.2.1"
@@ -947,6 +961,26 @@ pytest = ">=7.0.0,<9"
docs = ["sphinx (>=5.3)", "sphinx-rtd-theme (>=1.0)"]
testing = ["coverage (>=6.2)", "hypothesis (>=5.7.1)"]
+[[package]]
+name = "pytest-xdist"
+version = "3.6.1"
+description = "pytest xdist plugin for distributed testing, most importantly across multiple CPUs"
+optional = false
+python-versions = ">=3.8"
+files = [
+ {file = "pytest_xdist-3.6.1-py3-none-any.whl", hash = "sha256:9ed4adfb68a016610848639bb7e02c9352d5d9f03d04809919e2dafc3be4cca7"},
+ {file = "pytest_xdist-3.6.1.tar.gz", hash = "sha256:ead156a4db231eec769737f57668ef58a2084a34b2e55c4a8fa20d861107300d"},
+]
+
+[package.dependencies]
+execnet = ">=2.1"
+pytest = ">=7.0.0"
+
+[package.extras]
+psutil = ["psutil (>=3.0)"]
+setproctitle = ["setproctitle"]
+testing = ["filelock"]
+
[[package]]
name = "python-dateutil"
version = "2.9.0.post0"
@@ -1348,4 +1382,4 @@ type = ["pytest-mypy"]
[metadata]
lock-version = "2.0"
python-versions = ">=3.8"
-content-hash = "75943e35a81ca9f13e98b1a430c6887005f94dee3af894431826a9ccf49b0eaa"
+content-hash = "467d9c9c9207b7d74127c6809b14048829f83d64d12ccd46e8eae6d2b154ad09"
diff --git a/pyproject.toml b/pyproject.toml
index 2a716b4..e8936f1 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,5 +1,6 @@
[project]
name = "truefoundry-sdk"
+dynamic = ["version"]
[tool.poetry]
name = "truefoundry-sdk"
@@ -44,6 +45,7 @@ typing_extensions = ">= 4.0.0"
mypy = "==1.13.0"
pytest = "^7.4.0"
pytest-asyncio = "^0.23.5"
+pytest-xdist = "^3.6.1"
python-dateutil = "^2.9.0"
types-python-dateutil = "^2.9.0.20240316"
Jinja2 = ">=3.1.6,<4.0.0"
diff --git a/reference.md b/reference.md
index f9a7fa7..9712a6b 100644
--- a/reference.md
+++ b/reference.md
@@ -452,14 +452,6 @@ client.users.pre_register_users(
-
-**account_id:** `typing.Optional[str]` — Account ID to add the user to
-
-
-
-
-
--
-
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -532,7 +524,15 @@ client.users.update_roles(
-
-**roles:** `typing.Sequence[str]` — Roles for the user
+**roles:** `typing.Sequence[str]` — Role names for the user
+
+
+
+
+
+-
+
+**resource_type:** `typing.Optional[str]` — Resource Type
@@ -762,14 +762,6 @@ client.users.invite_user(
-
-**account_id:** `typing.Optional[str]` — Account ID to add the user to
-
-
-
-
-
--
-
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -2479,8 +2471,8 @@ client.virtual_accounts.delete_jwt(
-## Secrets
-client.secrets.list(...)
+## Clusters
+client.clusters.list(...)
-
@@ -2492,7 +2484,7 @@ client.virtual_accounts.delete_jwt(
-
-List secrets associated with a user filtered with optional parameters passed in the body.
+Retrieves a list of all latest Clusters. Pagination is available based on query parameters.
@@ -2513,7 +2505,10 @@ client = TrueFoundry(
api_key="YOUR_API_KEY",
base_url="https://yourhost.com/path/to/api",
)
-response = client.secrets.list()
+response = client.clusters.list(
+ limit=10,
+ offset=0,
+)
for item in response:
yield item
# alternatively, you can paginate page-by-page
@@ -2550,30 +2545,6 @@ for page in response.iter_pages():
-
-**secret_fqns:** `typing.Optional[typing.Sequence[str]]` — Array of FQNs
-
-
-
-
-
--
-
-**secret_group_id:** `typing.Optional[str]` — Secret Group Id of the secret gourp.
-
-
-
-
-
--
-
-**with_value:** `typing.Optional[bool]` — Whether to include the secret values in the response. Defaults to false.
-
-
-
-
-
--
-
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -2586,7 +2557,7 @@ for page in response.iter_pages():
-client.secrets.get(...)
+client.clusters.create_or_update(...)
-
@@ -2598,7 +2569,7 @@ for page in response.iter_pages():
-
-Get Secret associated with provided id. The secret value is not returned if the control plane has `DISABLE_SECRET_VALUE_VIEW` set
+Create or Update cluster with provided manifest
@@ -2613,14 +2584,29 @@ Get Secret associated with provided id. The secret value is not returned if the
-
```python
-from truefoundry_sdk import TrueFoundry
+from truefoundry_sdk import (
+ ClusterManifest,
+ ClusterManifestClusterType,
+ Collaborator,
+ TrueFoundry,
+)
client = TrueFoundry(
api_key="YOUR_API_KEY",
base_url="https://yourhost.com/path/to/api",
)
-client.secrets.get(
- id="id",
+client.clusters.create_or_update(
+ manifest=ClusterManifest(
+ name="name",
+ cluster_type=ClusterManifestClusterType.AWS_EKS,
+ environment_names=["environment_names"],
+ collaborators=[
+ Collaborator(
+ subject="subject",
+ role_id="role_id",
+ )
+ ],
+ ),
)
```
@@ -2637,7 +2623,15 @@ client.secrets.get(
-
-**id:** `str` — Secret Id of the secret.
+**manifest:** `ClusterManifest` — Cluster manifest
+
+
+
+
+
+-
+
+**dry_run:** `typing.Optional[bool]` — Dry run the cluster creation/update
@@ -2657,7 +2651,7 @@ client.secrets.get(
-client.secrets.delete(...)
+client.clusters.get(...)
-
@@ -2669,7 +2663,7 @@ client.secrets.get(
-
-Deletes a secret and its versions along with its values.
+Get cluster associated with provided id
@@ -2690,7 +2684,7 @@ client = TrueFoundry(
api_key="YOUR_API_KEY",
base_url="https://yourhost.com/path/to/api",
)
-client.secrets.delete(
+client.clusters.get(
id="id",
)
@@ -2708,7 +2702,7 @@ client.secrets.delete(
-
-**id:** `str` — Secret Id of the secret.
+**id:** `str` — Cluster id of the cluster
@@ -2728,8 +2722,7 @@ client.secrets.delete(
-## SecretGroups
-client.secret_groups.list(...)
+client.clusters.delete(...)
-
@@ -2741,7 +2734,7 @@ client.secrets.delete(
-
-List the secret groups associated with a user along with the associated secrets for each group. Filtered with the options passed in the query fields. Note: This method does not return the secret values of the associatedSecrets in the response. A separate API call to `/v1/secrets/{id}` should be made to fetch the associated secret value.
+Delete cluster associated with provided cluster id
@@ -2762,17 +2755,9 @@ client = TrueFoundry(
api_key="YOUR_API_KEY",
base_url="https://yourhost.com/path/to/api",
)
-response = client.secret_groups.list(
- limit=10,
- offset=0,
- fqn="fqn",
- search="search",
+client.clusters.delete(
+ id="id",
)
-for item in response:
- yield item
-# alternatively, you can paginate page-by-page
-for page in response.iter_pages():
- yield page
```
@@ -2788,31 +2773,7 @@ for page in response.iter_pages():
-
-**limit:** `typing.Optional[int]` — Number of items per page
-
-
-
-
-
--
-
-**offset:** `typing.Optional[int]` — Number of items to skip
-
-
-
-
-
--
-
-**fqn:** `typing.Optional[str]` — Fqn of secret group.
-
-
-
-
-
--
-
-**search:** `typing.Optional[str]` — Search query - filters by secret group names that contain the search string
+**id:** `str` — Cluster id of the cluster
@@ -2832,7 +2793,7 @@ for page in response.iter_pages():
-client.secret_groups.create(...)
+client.clusters.get_addons(...)
-
@@ -2844,7 +2805,7 @@ for page in response.iter_pages():
-
-Creates a secret group with secrets in it. A secret version for each of the created secret is created with version number as 1. The returned secret group does not have any secret values in the associatedSecrets field. A separate API call to `/v1/secrets/{id}` should be made to fetch the associated secret value.
+List addons for the provided cluster. Pagination is available based on query parameters.
@@ -2859,21 +2820,16 @@ Creates a secret group with secrets in it. A secret version for each of the crea
-
```python
-from truefoundry_sdk import SecretInput, TrueFoundry
+from truefoundry_sdk import TrueFoundry
client = TrueFoundry(
api_key="YOUR_API_KEY",
base_url="https://yourhost.com/path/to/api",
)
-client.secret_groups.create(
- name="name",
- integration_id="integrationId",
- secrets=[
- SecretInput(
- key="key",
- value="value",
- )
- ],
+client.clusters.get_addons(
+ id="id",
+ limit=10,
+ offset=0,
)
```
@@ -2890,7 +2846,7 @@ client.secret_groups.create(
-
-**name:** `str` — Name of the secret group.
+**id:** `str` — Cluster id of the cluster
@@ -2898,7 +2854,7 @@ client.secret_groups.create(
-
-**integration_id:** `str` — Id of the provider integration.
+**limit:** `typing.Optional[int]` — Number of items per page
@@ -2906,7 +2862,7 @@ client.secret_groups.create(
-
-**secrets:** `typing.Sequence[SecretInput]` — The secrets to be associated with the secret group
+**offset:** `typing.Optional[int]` — Number of items to skip
@@ -2926,7 +2882,7 @@ client.secret_groups.create(
-client.secret_groups.get(...)
+client.clusters.is_connected(...)
-
@@ -2938,7 +2894,7 @@ client.secret_groups.create(
-
-Get Secret Group by id. This method does not return the secret values of the associatedSecrets in the response. A separate API call to `/v1/secrets/{id}` should be made to fetch the associated secret value.
+Get the status of provided cluster
@@ -2959,7 +2915,7 @@ client = TrueFoundry(
api_key="YOUR_API_KEY",
base_url="https://yourhost.com/path/to/api",
)
-client.secret_groups.get(
+client.clusters.is_connected(
id="id",
)
@@ -2977,7 +2933,7 @@ client.secret_groups.get(
-
-**id:** `str` — Secret Id of the secret group.
+**id:** `str` — Cluster id of the cluster
@@ -2997,7 +2953,8 @@ client.secret_groups.get(
-client.secret_groups.update(...)
+## Applications
+client.applications.list(...)
-
@@ -3009,7 +2966,7 @@ client.secret_groups.get(
-
-Updates the secrets in a secret group with new values. A new secret version is created for every secret that has a modified value and any omitted secrets are deleted. The returned updated secret group does not have any secret values in the associatedSecrets field. A separate API call to `/v1/secrets/{id}` should be made to fetch the associated secret value.
+Retrieves a list of all latest applications. Supports filtering by application ID, name, type, and other parameters. Pagination is available based on query parameters.
@@ -3024,20 +2981,40 @@ Updates the secrets in a secret group with new values. A new secret version is c
-
```python
-from truefoundry_sdk import TrueFoundry, UpdateSecretInput
+from truefoundry_sdk import TrueFoundry
+from truefoundry_sdk.applications import (
+ ApplicationsListRequestDeviceTypeFilter,
+ ApplicationsListRequestLifecycleStage,
+)
client = TrueFoundry(
api_key="YOUR_API_KEY",
base_url="https://yourhost.com/path/to/api",
)
-client.secret_groups.update(
- id="id",
- secrets=[
- UpdateSecretInput(
- key="key",
- )
- ],
+response = client.applications.list(
+ limit=10,
+ offset=0,
+ application_id="applicationId",
+ workspace_id="workspaceId",
+ application_name="applicationName",
+ fqn="fqn",
+ workspace_fqn="workspaceFqn",
+ application_type="applicationType",
+ name_search_query="nameSearchQuery",
+ environment_id="environmentId",
+ cluster_id="clusterId",
+ application_set_id="applicationSetId",
+ paused=True,
+ device_type_filter=ApplicationsListRequestDeviceTypeFilter.CPU,
+ last_deployed_by_subjects="lastDeployedBySubjects",
+ lifecycle_stage=ApplicationsListRequestLifecycleStage.ACTIVE,
+ is_recommendation_present_and_visible=True,
)
+for item in response:
+ yield item
+# alternatively, you can paginate page-by-page
+for page in response.iter_pages():
+ yield page
```
@@ -3053,7 +3030,7 @@ client.secret_groups.update(
-
-**id:** `str` — Secret Id of the secret group.
+**limit:** `typing.Optional[int]` — Number of items per page
@@ -3061,7 +3038,7 @@ client.secret_groups.update(
-
-**secrets:** `typing.Sequence[UpdateSecretInput]`
+**offset:** `typing.Optional[int]` — Number of items to skip
@@ -3069,70 +3046,119 @@ client.secret_groups.update(
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+**application_id:** `typing.Optional[str]` — Application id of the application
-
-
+
+-
+**workspace_id:** `typing.Optional[str]` — Workspace id of the application (comma separated for multiple)
+
-
-client.secret_groups.delete(...)
-
-#### 📝 Description
+**application_name:** `typing.Optional[str]` — Name of application
+
+
+
-
+**fqn:** `typing.Optional[str]` — Fully qualified name (FQN) of the application
+
+
+
+
-
-Deletes the secret group, its associated secrets and secret versions of those secrets.
+**workspace_fqn:** `typing.Optional[str]` — Fully qualified name (FQN) of the workspace
+
+
+
+-
+
+**application_type:** `typing.Optional[str]` — Type of application (comma separated for multiple). Allowed Values: async-service, service, job, spark-job, helm, notebook, codeserver, rstudio, ssh-server, volume, application, application-set, intercept, workflow
+
-#### 🔌 Usage
-
-
+**name_search_query:** `typing.Optional[str]` — Search query for application name
+
+
+
+
-
-```python
-from truefoundry_sdk import TrueFoundry
+**environment_id:** `typing.Optional[str]` — Filter by Environment ids of the application (comma separated for multiple)
+
+
+
-client = TrueFoundry(
- api_key="YOUR_API_KEY",
- base_url="https://yourhost.com/path/to/api",
-)
-client.secret_groups.delete(
- id="id",
-)
+
+-
-```
+**cluster_id:** `typing.Optional[str]` — Filter by Cluster ids of the application (comma separated for multiple)
+
+
+
+-
+
+**application_set_id:** `typing.Optional[str]` — Filter by Application Set id of the application
+
-#### ⚙️ Parameters
+
+-
+
+**paused:** `typing.Optional[bool]` — Filter by Application Paused status
+
+
+
-
+**device_type_filter:** `typing.Optional[ApplicationsListRequestDeviceTypeFilter]` — Filter by device type of the application. Allowed values: cpu, nvidia_gpu, aws_inferentia, nvidia_mig_gpu, nvidia_timeslicing_gpu, gcp_tpu
+
+
+
+
-
-**id:** `str` — Secret Id of the secret group.
+**last_deployed_by_subjects:** `typing.Optional[str]` — Filter by last deployed by specific users
+
+
+
+
+
+-
+
+**lifecycle_stage:** `typing.Optional[ApplicationsListRequestLifecycleStage]` — Filter by application lifecycle state
+
+
+
+
+
+-
+
+**is_recommendation_present_and_visible:** `typing.Optional[bool]` — Filter out applications with recommendations that are allowed to be shown
@@ -3152,8 +3178,7 @@ client.secret_groups.delete(
-## Clusters
-client.clusters.list(...)
+client.applications.create_or_update(...)
-
@@ -3165,7 +3190,7 @@ client.secret_groups.delete(
-
-Retrieves a list of all latest Clusters. Pagination is available based on query parameters.
+Create a new Application Deployment based on the provided manifest.
@@ -3186,15 +3211,9 @@ client = TrueFoundry(
api_key="YOUR_API_KEY",
base_url="https://yourhost.com/path/to/api",
)
-response = client.clusters.list(
- limit=10,
- offset=0,
+client.applications.create_or_update(
+ manifest={"key": "value"},
)
-for item in response:
- yield item
-# alternatively, you can paginate page-by-page
-for page in response.iter_pages():
- yield page
```
@@ -3210,7 +3229,7 @@ for page in response.iter_pages():
-
-**limit:** `typing.Optional[int]` — Number of items per page
+**manifest:** `typing.Dict[str, typing.Any]` — Manifest of application
@@ -3218,7 +3237,7 @@ for page in response.iter_pages():
-
-**offset:** `typing.Optional[int]` — Number of items to skip
+**dry_run:** `typing.Optional[bool]` — Dry run
@@ -3226,85 +3245,39 @@ for page in response.iter_pages():
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+**force_deploy:** `typing.Optional[bool]` — Cancels any ongoing deployments
-
-
-
-
-
-
-
-client.clusters.create_or_update(...)
-
-#### 📝 Description
-
-
--
+**trigger_on_deploy:** `typing.Optional[bool]` — Trigger on deploy
+
+
+
-
-Create or Update cluster with provided manifest
-
-
+**workspace_id:** `typing.Optional[str]` — workspace id of the workspace
+
-#### 🔌 Usage
-
-
--
-
-
-```python
-from truefoundry_sdk import (
- ClusterManifest,
- ClusterManifestClusterType,
- Collaborator,
- TrueFoundry,
-)
-
-client = TrueFoundry(
- api_key="YOUR_API_KEY",
- base_url="https://yourhost.com/path/to/api",
-)
-client.clusters.create_or_update(
- manifest=ClusterManifest(
- name="name",
- cluster_type=ClusterManifestClusterType.AWS_EKS,
- environment_names=["environment_names"],
- collaborators=[
- Collaborator(
- subject="subject",
- role_id="role_id",
- )
- ],
- ),
-)
-
-```
-
-
+**application_id:** `typing.Optional[str]` — Id of the application
+
-#### ⚙️ Parameters
-
-
--
-
-
-**manifest:** `ClusterManifest` — Cluster manifest
+**name:** `typing.Optional[str]` — Name of application
@@ -3312,7 +3285,7 @@ client.clusters.create_or_update(
-
-**dry_run:** `typing.Optional[bool]` — Dry run the cluster creation/update
+**application_set_id:** `typing.Optional[str]` — Application Set Id
@@ -3332,7 +3305,7 @@ client.clusters.create_or_update(
-client.clusters.get(...)
+client.applications.get(...)
-
@@ -3344,7 +3317,7 @@ client.clusters.create_or_update(
-
-Get cluster associated with provided id
+Get Application associated with the provided application ID.
@@ -3365,7 +3338,7 @@ client = TrueFoundry(
api_key="YOUR_API_KEY",
base_url="https://yourhost.com/path/to/api",
)
-client.clusters.get(
+client.applications.get(
id="id",
)
@@ -3383,7 +3356,7 @@ client.clusters.get(
-
-**id:** `str` — Cluster id of the cluster
+**id:** `str` — Id of the application
@@ -3403,7 +3376,7 @@ client.clusters.get(
-client.clusters.delete(...)
+client.applications.delete(...)
-
@@ -3415,7 +3388,7 @@ client.clusters.get(
-
-Delete cluster associated with provided cluster id
+Delete Application associated with the provided application ID.
@@ -3436,7 +3409,7 @@ client = TrueFoundry(
api_key="YOUR_API_KEY",
base_url="https://yourhost.com/path/to/api",
)
-client.clusters.delete(
+client.applications.delete(
id="id",
)
@@ -3454,7 +3427,7 @@ client.clusters.delete(
-
-**id:** `str` — Cluster id of the cluster
+**id:** `str` — Id of the application
@@ -3474,7 +3447,7 @@ client.clusters.delete(
-client.clusters.get_addons(...)
+client.applications.scale_to_zero(...)
-
@@ -3486,7 +3459,7 @@ client.clusters.delete(
-
-List addons for the provided cluster. Pagination is available based on query parameters.
+Pause a running application by scaling to 0 replicas
@@ -3507,10 +3480,8 @@ client = TrueFoundry(
api_key="YOUR_API_KEY",
base_url="https://yourhost.com/path/to/api",
)
-client.clusters.get_addons(
+client.applications.scale_to_zero(
id="id",
- limit=10,
- offset=0,
)
```
@@ -3527,23 +3498,7 @@ client.clusters.get_addons(
-
-**id:** `str` — Cluster id of the cluster
-
-
-
-
-
--
-
-**limit:** `typing.Optional[int]` — Number of items per page
-
-
-
-
-
--
-
-**offset:** `typing.Optional[int]` — Number of items to skip
+**id:** `str` — Id of the application
@@ -3563,7 +3518,7 @@ client.clusters.get_addons(
-client.clusters.is_connected(...)
+client.applications.scale_to_original(...)
-
@@ -3575,7 +3530,7 @@ client.clusters.get_addons(
-
-Get the status of provided cluster
+Resume a paused application by scaling back to the original number of replicas
@@ -3596,7 +3551,7 @@ client = TrueFoundry(
api_key="YOUR_API_KEY",
base_url="https://yourhost.com/path/to/api",
)
-client.clusters.is_connected(
+client.applications.scale_to_original(
id="id",
)
@@ -3614,7 +3569,7 @@ client.clusters.is_connected(
-
-**id:** `str` — Cluster id of the cluster
+**id:** `str` — Id of the application
@@ -3634,8 +3589,7 @@ client.clusters.is_connected(
-## Environments
-client.environments.list(...)
+client.applications.cancel_deployment(...)
-
@@ -3647,7 +3601,7 @@ client.clusters.is_connected(
-
-List environments, if no environments are found, default environments are created and returned. Pagination is available based on query parameters
+Cancel an ongoing deployment associated with the provided application ID and deployment ID.
@@ -3668,15 +3622,10 @@ client = TrueFoundry(
api_key="YOUR_API_KEY",
base_url="https://yourhost.com/path/to/api",
)
-response = client.environments.list(
- limit=10,
- offset=0,
+client.applications.cancel_deployment(
+ id="id",
+ deployment_id="deploymentId",
)
-for item in response:
- yield item
-# alternatively, you can paginate page-by-page
-for page in response.iter_pages():
- yield page
```
@@ -3692,7 +3641,7 @@ for page in response.iter_pages():
-
-**limit:** `typing.Optional[int]` — Number of items per page
+**id:** `str` — Application id of the application
@@ -3700,7 +3649,7 @@ for page in response.iter_pages():
-
-**offset:** `typing.Optional[int]` — Number of items to skip
+**deployment_id:** `str` — Deployment id of the deployment
@@ -3720,7 +3669,8 @@ for page in response.iter_pages():
-client.environments.create_or_update(...)
+## ApplicationVersions
+client.application_versions.list(...)
-
@@ -3732,7 +3682,7 @@ for page in response.iter_pages():
-
-Creates a new Environment or updates an existing Environment.
+Fetch all deployments for a given application ID with optional filters such as deployment ID or version. Supports pagination.
@@ -3747,25 +3697,24 @@ Creates a new Environment or updates an existing Environment.
-
```python
-from truefoundry_sdk import (
- EnvironmentColor,
- EnvironmentManifest,
- EnvironmentOptimizeFor,
- TrueFoundry,
-)
+from truefoundry_sdk import TrueFoundry
client = TrueFoundry(
api_key="YOUR_API_KEY",
base_url="https://yourhost.com/path/to/api",
)
-client.environments.create_or_update(
- manifest=EnvironmentManifest(
- name="name",
- color=EnvironmentColor(),
- is_production=True,
- optimize_for=EnvironmentOptimizeFor.COST,
- ),
+response = client.application_versions.list(
+ id="id",
+ limit=10,
+ offset=0,
+ version="1",
+ deployment_id="deployment123",
)
+for item in response:
+ yield item
+# alternatively, you can paginate page-by-page
+for page in response.iter_pages():
+ yield page
```
@@ -3781,7 +3730,7 @@ client.environments.create_or_update(
-
-**manifest:** `EnvironmentManifest` — Environment Manifest
+**id:** `str` — Id of the application
@@ -3789,7 +3738,7 @@ client.environments.create_or_update(
-
-**dry_run:** `typing.Optional[bool]` — Dry run
+**limit:** `typing.Optional[int]` — Number of items per page
@@ -3797,31 +3746,55 @@ client.environments.create_or_update(
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+**offset:** `typing.Optional[int]` — Number of items to skip
-
-
+
+-
+**version:** `typing.Optional[str]` — Deployment version. Filter deployments by version.
+
-
-client.environments.get(...)
-
-#### 📝 Description
+**deployment_id:** `typing.Optional[str]` — Deployment ID. Filter deployments by a specific ID.
+
+
+
-
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.application_versions.get(...)
-
-Get Environment associated with the provided id.
+#### 📝 Description
+
+
+-
+
+
+-
+
+Get Deployment associated with the provided application ID and deployment ID.
@@ -3842,8 +3815,9 @@ client = TrueFoundry(
api_key="YOUR_API_KEY",
base_url="https://yourhost.com/path/to/api",
)
-client.environments.get(
+client.application_versions.get(
id="id",
+ deployment_id="deploymentId",
)
```
@@ -3860,7 +3834,15 @@ client.environments.get(
-
-**id:** `str` — Environment id
+**id:** `str` — Application id of the application
+
+
+
+
+
+-
+
+**deployment_id:** `str` — Deployment id of the deployment
@@ -3880,7 +3862,8 @@ client.environments.get(
-client.environments.delete(...)
+## Jobs
+client.jobs.list_runs(...)
-
@@ -3892,7 +3875,7 @@ client.environments.get(
-
-Delete Environment associated with the provided id.
+List Job Runs for provided Job Id. Filter the data based on parameters passed in the query
@@ -3907,15 +3890,25 @@ Delete Environment associated with the provided id.
-
```python
-from truefoundry_sdk import TrueFoundry
+from truefoundry_sdk import JobRunsSortBy, SortDirection, TrueFoundry
client = TrueFoundry(
api_key="YOUR_API_KEY",
base_url="https://yourhost.com/path/to/api",
)
-client.environments.delete(
- id="id",
+response = client.jobs.list_runs(
+ job_id="jobId",
+ limit=10,
+ offset=0,
+ search_prefix="searchPrefix",
+ sort_by=JobRunsSortBy.START_TIME,
+ order=SortDirection.ASC,
)
+for item in response:
+ yield item
+# alternatively, you can paginate page-by-page
+for page in response.iter_pages():
+ yield page
```
@@ -3931,7 +3924,71 @@ client.environments.delete(
-
-**id:** `str` — Environment id
+**job_id:** `str` — Job id of the application
+
+
+
+
+
+-
+
+**limit:** `typing.Optional[int]` — Number of items per page
+
+
+
+
+
+-
+
+**offset:** `typing.Optional[int]` — Number of items to skip
+
+
+
+
+
+-
+
+**search_prefix:** `typing.Optional[str]` — Prefix used to search for job runs by name or identifier
+
+
+
+
+
+-
+
+**sort_by:** `typing.Optional[JobRunsSortBy]` — Attribute to sort by
+
+
+
+
+
+-
+
+**order:** `typing.Optional[SortDirection]` — Sorting order
+
+
+
+
+
+-
+
+**triggered_by:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Array of subject slugs
+
+
+
+
+
+-
+
+**status:** `typing.Optional[typing.Union[JobRunStatus, typing.Sequence[JobRunStatus]]]` — Status of the job run
+
+
+
+
+
+-
+
+**version_numbers:** `typing.Optional[typing.Union[float, typing.Sequence[float]]]` — Version number of the deployment
@@ -3951,8 +4008,7 @@ client.environments.delete(
-## Applications
-client.applications.list(...)
+client.jobs.get_run(...)
-
@@ -3964,7 +4020,7 @@ client.environments.delete(
-
-Retrieves a list of all latest applications. Supports filtering by application ID, name, type, and other parameters. Pagination is available based on query parameters.
+Get Job Run for provided jobRunName and jobId
@@ -3980,39 +4036,15 @@ Retrieves a list of all latest applications. Supports filtering by application I
```python
from truefoundry_sdk import TrueFoundry
-from truefoundry_sdk.applications import (
- ApplicationsListRequestDeviceTypeFilter,
- ApplicationsListRequestLifecycleStage,
-)
client = TrueFoundry(
api_key="YOUR_API_KEY",
base_url="https://yourhost.com/path/to/api",
)
-response = client.applications.list(
- limit=10,
- offset=0,
- application_id="applicationId",
- workspace_id="workspaceId",
- application_name="applicationName",
- fqn="fqn",
- workspace_fqn="workspaceFqn",
- application_type="applicationType",
- name_search_query="nameSearchQuery",
- environment_id="environmentId",
- cluster_id="clusterId",
- application_set_id="applicationSetId",
- paused=True,
- device_type_filter=ApplicationsListRequestDeviceTypeFilter.CPU,
- last_deployed_by_subjects="lastDeployedBySubjects",
- lifecycle_stage=ApplicationsListRequestLifecycleStage.ACTIVE,
- is_recommendation_present_and_visible=True,
+client.jobs.get_run(
+ job_id="jobId",
+ job_run_name="jobRunName",
)
-for item in response:
- yield item
-# alternatively, you can paginate page-by-page
-for page in response.iter_pages():
- yield page
```
@@ -4028,7 +4060,7 @@ for page in response.iter_pages():
-
-**limit:** `typing.Optional[int]` — Number of items per page
+**job_id:** `str` — Application Id of JOB
@@ -4036,7 +4068,7 @@ for page in response.iter_pages():
-
-**offset:** `typing.Optional[int]` — Number of items to skip
+**job_run_name:** `str` — Job run name of the application
@@ -4044,31 +4076,71 @@ for page in response.iter_pages():
-
-**application_id:** `typing.Optional[str]` — Application id of the application
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+client.jobs.delete_run(...)
-
-**workspace_id:** `typing.Optional[str]` — Workspace id of the application (comma separated for multiple)
-
+#### 📝 Description
+
+
+-
+
+
+-
+
+Delete Job Run for provided jobRunName and jobId
+
+
+#### 🔌 Usage
+
-
-**application_name:** `typing.Optional[str]` — Name of application
-
+
+-
+
+```python
+from truefoundry_sdk import TrueFoundry
+
+client = TrueFoundry(
+ api_key="YOUR_API_KEY",
+ base_url="https://yourhost.com/path/to/api",
+)
+client.jobs.delete_run(
+ job_id="jobId",
+ job_run_name="jobRunName",
+)
+
+```
+
+
+
+#### ⚙️ Parameters
-
-**fqn:** `typing.Optional[str]` — Fully qualified name (FQN) of the application
+
+-
+
+**job_id:** `str` — Application Id of JOB
@@ -4076,7 +4148,7 @@ for page in response.iter_pages():
-
-**workspace_fqn:** `typing.Optional[str]` — Fully qualified name (FQN) of the workspace
+**job_run_name:** `str` — Job run name of the application
@@ -4084,31 +4156,68 @@ for page in response.iter_pages():
-
-**application_type:** `typing.Optional[str]` — Type of application (comma separated for multiple). Allowed Values: async-service, service, job, spark-job, helm, notebook, codeserver, rstudio, ssh-server, volume, application, application-set, intercept, workflow
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+client.jobs.trigger(...)
-
-**name_search_query:** `typing.Optional[str]` — Search query for application name
-
+#### 📝 Description
+
+
+-
+
+
+-
+
+Trigger Job for provided deploymentId or applicationId
+
+
+#### 🔌 Usage
+
-
-**environment_id:** `typing.Optional[str]` — Filter by Environment ids of the application (comma separated for multiple)
-
+
+-
+
+```python
+from truefoundry_sdk import TrueFoundry
+
+client = TrueFoundry(
+ api_key="YOUR_API_KEY",
+ base_url="https://yourhost.com/path/to/api",
+)
+client.jobs.trigger()
+
+```
+
+
+
+#### ⚙️ Parameters
-
-**cluster_id:** `typing.Optional[str]` — Filter by Cluster ids of the application (comma separated for multiple)
+
+-
+
+**deployment_id:** `typing.Optional[str]` — Deployment Id of the job
@@ -4116,7 +4225,7 @@ for page in response.iter_pages():
-
-**application_set_id:** `typing.Optional[str]` — Filter by Application Set id of the application
+**application_id:** `typing.Optional[str]` — Application Id of the job
@@ -4124,7 +4233,7 @@ for page in response.iter_pages():
-
-**paused:** `typing.Optional[bool]` — Filter by Application Paused status
+**input:** `typing.Optional[TriggerJobRequestInput]` — Job trigger input
@@ -4132,7 +4241,7 @@ for page in response.iter_pages():
-
-**device_type_filter:** `typing.Optional[ApplicationsListRequestDeviceTypeFilter]` — Filter by device type of the application. Allowed values: cpu, nvidia_gpu, aws_inferentia, nvidia_mig_gpu, nvidia_timeslicing_gpu, gcp_tpu
+**metadata:** `typing.Optional[Metadata]` — Metadata for the job run including job_alias_name
@@ -4140,15 +4249,71 @@ for page in response.iter_pages():
-
-**last_deployed_by_subjects:** `typing.Optional[str]` — Filter by last deployed by specific users
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+client.jobs.terminate(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Terminate Job for provided deploymentId and jobRunName
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from truefoundry_sdk import TrueFoundry
+
+client = TrueFoundry(
+ api_key="YOUR_API_KEY",
+ base_url="https://yourhost.com/path/to/api",
+)
+client.jobs.terminate(
+ deployment_id="deploymentId",
+ job_run_name="jobRunName",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
-
-**lifecycle_stage:** `typing.Optional[ApplicationsListRequestLifecycleStage]` — Filter by application lifecycle state
+**deployment_id:** `str` — Deployment Id of the Deployment
@@ -4156,7 +4321,7 @@ for page in response.iter_pages():
-
-**is_recommendation_present_and_visible:** `typing.Optional[bool]` — Filter out applications with recommendations that are allowed to be shown
+**job_run_name:** `str` — Job Run name
@@ -4176,7 +4341,8 @@ for page in response.iter_pages():
-client.applications.create_or_update(...)
+## Workspaces
+client.workspaces.list(...)
-
@@ -4188,7 +4354,7 @@ for page in response.iter_pages():
-
-Create a new Application Deployment based on the provided manifest.
+List workspaces associated with the user. Optional filters include clusterId, fqn, and workspace name. Pagination is available based on query parameters.
@@ -4209,9 +4375,18 @@ client = TrueFoundry(
api_key="YOUR_API_KEY",
base_url="https://yourhost.com/path/to/api",
)
-client.applications.create_or_update(
- manifest={"key": "value"},
+response = client.workspaces.list(
+ limit=10,
+ offset=0,
+ cluster_id="clusterId",
+ name="name",
+ fqn="fqn",
)
+for item in response:
+ yield item
+# alternatively, you can paginate page-by-page
+for page in response.iter_pages():
+ yield page
```
@@ -4227,31 +4402,7 @@ client.applications.create_or_update(
-
-**manifest:** `typing.Dict[str, typing.Optional[typing.Any]]` — Manifest of application
-
-
-
-
-
--
-
-**dry_run:** `typing.Optional[bool]` — Dry run
-
-
-
-
-
--
-
-**force_deploy:** `typing.Optional[bool]` — Cancels any ongoing deployments
-
-
-
-
-
--
-
-**trigger_on_deploy:** `typing.Optional[bool]` — Trigger on deploy
+**limit:** `typing.Optional[int]` — Number of items per page
@@ -4259,7 +4410,7 @@ client.applications.create_or_update(
-
-**workspace_id:** `typing.Optional[str]` — workspace id of the workspace
+**offset:** `typing.Optional[int]` — Number of items to skip
@@ -4267,7 +4418,7 @@ client.applications.create_or_update(
-
-**application_id:** `typing.Optional[str]` — Id of the application
+**cluster_id:** `typing.Optional[str]` — ClusterId of the Cluster
@@ -4275,7 +4426,7 @@ client.applications.create_or_update(
-
-**name:** `typing.Optional[str]` — Name of application
+**name:** `typing.Optional[str]` — Workspace Name
@@ -4283,7 +4434,7 @@ client.applications.create_or_update(
-
-**application_set_id:** `typing.Optional[str]` — Application Set Id
+**fqn:** `typing.Optional[str]` — Workspace FQN
@@ -4303,7 +4454,7 @@ client.applications.create_or_update(
-client.applications.get(...)
+client.workspaces.create_or_update(...)
-
@@ -4315,7 +4466,7 @@ client.applications.create_or_update(
-
-Get Application associated with the provided application ID.
+Creates a new workspace or updates an existing one based on the provided manifest.
@@ -4330,14 +4481,17 @@ Get Application associated with the provided application ID.
-
```python
-from truefoundry_sdk import TrueFoundry
+from truefoundry_sdk import TrueFoundry, WorkspaceManifest
client = TrueFoundry(
api_key="YOUR_API_KEY",
base_url="https://yourhost.com/path/to/api",
)
-client.applications.get(
- id="id",
+client.workspaces.create_or_update(
+ manifest=WorkspaceManifest(
+ cluster_fqn="cluster_fqn",
+ name="name",
+ ),
)
```
@@ -4354,7 +4508,15 @@ client.applications.get(
-
-**id:** `str` — Id of the application
+**manifest:** `WorkspaceManifest` — Workspace manifest
+
+
+
+
+
+-
+
+**dry_run:** `typing.Optional[bool]` — Dry run the request
@@ -4374,7 +4536,7 @@ client.applications.get(
-client.applications.delete(...)
+client.workspaces.get(...)
-
@@ -4386,7 +4548,7 @@ client.applications.get(
-
-Delete Application associated with the provided application ID.
+Get workspace associated with provided workspace id
@@ -4407,7 +4569,7 @@ client = TrueFoundry(
api_key="YOUR_API_KEY",
base_url="https://yourhost.com/path/to/api",
)
-client.applications.delete(
+client.workspaces.get(
id="id",
)
@@ -4425,7 +4587,7 @@ client.applications.delete(
-
-**id:** `str` — Id of the application
+**id:** `str` — Workspace id of the space
@@ -4445,7 +4607,7 @@ client.applications.delete(
-client.applications.scale_to_zero(...)
+client.workspaces.delete(...)
-
@@ -4457,7 +4619,9 @@ client.applications.delete(
-
-Pause a running application by scaling to 0 replicas
+Deletes the workspace with the given workspace ID.
+ - Removes the associated namespace from the cluster.
+ - Deletes the corresponding authorization entry.
@@ -4478,7 +4642,7 @@ client = TrueFoundry(
api_key="YOUR_API_KEY",
base_url="https://yourhost.com/path/to/api",
)
-client.applications.scale_to_zero(
+client.workspaces.delete(
id="id",
)
@@ -4496,7 +4660,7 @@ client.applications.scale_to_zero(
-
-**id:** `str` — Id of the application
+**id:** `str` — Workspace id of the space
@@ -4516,7 +4680,8 @@ client.applications.scale_to_zero(
-client.applications.scale_to_original(...)
+## Environments
+client.environments.list(...)
-
@@ -4528,7 +4693,7 @@ client.applications.scale_to_zero(
-
-Resume a paused application by scaling back to the original number of replicas
+List environments, if no environments are found, default environments are created and returned. Pagination is available based on query parameters
@@ -4549,9 +4714,15 @@ client = TrueFoundry(
api_key="YOUR_API_KEY",
base_url="https://yourhost.com/path/to/api",
)
-client.applications.scale_to_original(
- id="id",
+response = client.environments.list(
+ limit=10,
+ offset=0,
)
+for item in response:
+ yield item
+# alternatively, you can paginate page-by-page
+for page in response.iter_pages():
+ yield page
```
@@ -4567,7 +4738,15 @@ client.applications.scale_to_original(
-
-**id:** `str` — Id of the application
+**limit:** `typing.Optional[int]` — Number of items per page
+
+
+
+
+
+-
+
+**offset:** `typing.Optional[int]` — Number of items to skip
@@ -4587,7 +4766,7 @@ client.applications.scale_to_original(
-client.applications.cancel_deployment(...)
+client.environments.create_or_update(...)
-
@@ -4599,7 +4778,7 @@ client.applications.scale_to_original(
-
-Cancel an ongoing deployment associated with the provided application ID and deployment ID.
+Creates a new Environment or updates an existing Environment.
@@ -4614,15 +4793,24 @@ Cancel an ongoing deployment associated with the provided application ID and dep
-
```python
-from truefoundry_sdk import TrueFoundry
+from truefoundry_sdk import (
+ EnvironmentColor,
+ EnvironmentManifest,
+ EnvironmentOptimizeFor,
+ TrueFoundry,
+)
client = TrueFoundry(
api_key="YOUR_API_KEY",
base_url="https://yourhost.com/path/to/api",
)
-client.applications.cancel_deployment(
- id="id",
- deployment_id="deploymentId",
+client.environments.create_or_update(
+ manifest=EnvironmentManifest(
+ name="name",
+ color=EnvironmentColor(),
+ is_production=True,
+ optimize_for=EnvironmentOptimizeFor.COST,
+ ),
)
```
@@ -4639,7 +4827,7 @@ client.applications.cancel_deployment(
-
-**id:** `str` — Application id of the application
+**manifest:** `EnvironmentManifest` — Environment Manifest
@@ -4647,7 +4835,7 @@ client.applications.cancel_deployment(
-
-**deployment_id:** `str` — Deployment id of the deployment
+**dry_run:** `typing.Optional[bool]` — Dry run
@@ -4667,8 +4855,7 @@ client.applications.cancel_deployment(
-## ApplicationVersions
-client.application_versions.list(...)
+client.environments.get(...)
-
@@ -4680,7 +4867,7 @@ client.applications.cancel_deployment(
-
-Fetch all deployments for a given application ID with optional filters such as deployment ID or version. Supports pagination.
+Get Environment associated with the provided id.
@@ -4701,18 +4888,9 @@ client = TrueFoundry(
api_key="YOUR_API_KEY",
base_url="https://yourhost.com/path/to/api",
)
-response = client.application_versions.list(
+client.environments.get(
id="id",
- limit=10,
- offset=0,
- version="1",
- deployment_id="deployment123",
)
-for item in response:
- yield item
-# alternatively, you can paginate page-by-page
-for page in response.iter_pages():
- yield page
```
@@ -4728,39 +4906,7 @@ for page in response.iter_pages():
-
-**id:** `str` — Id of the application
-
-
-
-
-
--
-
-**limit:** `typing.Optional[int]` — Number of items per page
-
-
-
-
-
--
-
-**offset:** `typing.Optional[int]` — Number of items to skip
-
-
-
-
-
--
-
-**version:** `typing.Optional[str]` — Deployment version. Filter deployments by version.
-
-
-
-
-
--
-
-**deployment_id:** `typing.Optional[str]` — Deployment ID. Filter deployments by a specific ID.
+**id:** `str` — Environment id
@@ -4780,7 +4926,7 @@ for page in response.iter_pages():
-client.application_versions.get(...)
+client.environments.delete(...)
-
@@ -4792,7 +4938,7 @@ for page in response.iter_pages():
-
-Get Deployment associated with the provided application ID and deployment ID.
+Delete Environment associated with the provided id.
@@ -4813,9 +4959,8 @@ client = TrueFoundry(
api_key="YOUR_API_KEY",
base_url="https://yourhost.com/path/to/api",
)
-client.application_versions.get(
+client.environments.delete(
id="id",
- deployment_id="deploymentId",
)
```
@@ -4832,15 +4977,7 @@ client.application_versions.get(
-
-**id:** `str` — Application id of the application
-
-
-
-
-
--
-
-**deployment_id:** `str` — Deployment id of the deployment
+**id:** `str` — Environment id
@@ -4860,8 +4997,8 @@ client.application_versions.get(
-## Jobs
-client.jobs.list_runs(...)
+## Secrets
+client.secrets.list(...)
-
@@ -4873,7 +5010,7 @@ client.application_versions.get(
-
-List Job Runs for provided Job Id. Filter the data based on parameters passed in the query
+List secrets associated with a user filtered with optional parameters passed in the body.
@@ -4888,73 +5025,34 @@ List Job Runs for provided Job Id. Filter the data based on parameters passed in
-
```python
-from truefoundry_sdk import JobRunsSortBy, SortDirection, TrueFoundry
+from truefoundry_sdk import TrueFoundry
client = TrueFoundry(
api_key="YOUR_API_KEY",
base_url="https://yourhost.com/path/to/api",
)
-response = client.jobs.list_runs(
- job_id="jobId",
- limit=10,
- offset=0,
- search_prefix="searchPrefix",
- sort_by=JobRunsSortBy.START_TIME,
- order=SortDirection.ASC,
-)
+response = client.secrets.list()
for item in response:
- yield item
-# alternatively, you can paginate page-by-page
-for page in response.iter_pages():
- yield page
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**job_id:** `str` — Job id of the application
-
-
-
-
-
--
+ yield item
+# alternatively, you can paginate page-by-page
+for page in response.iter_pages():
+ yield page
-**limit:** `typing.Optional[int]` — Number of items per page
-
+```
-
-
--
-
-**offset:** `typing.Optional[int]` — Number of items to skip
-
+#### ⚙️ Parameters
+
-
-**search_prefix:** `typing.Optional[str]` — Prefix used to search for job runs by name or identifier
-
-
-
-
-
-**sort_by:** `typing.Optional[JobRunsSortBy]` — Attribute to sort by
+**limit:** `typing.Optional[int]` — Number of items per page
@@ -4962,7 +5060,7 @@ for page in response.iter_pages():
-
-**order:** `typing.Optional[SortDirection]` — Sorting order
+**offset:** `typing.Optional[int]` — Number of items to skip
@@ -4970,7 +5068,7 @@ for page in response.iter_pages():
-
-**triggered_by:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Array of subject slugs
+**secret_fqns:** `typing.Optional[typing.Sequence[str]]` — Array of FQNs
@@ -4978,7 +5076,7 @@ for page in response.iter_pages():
-
-**status:** `typing.Optional[typing.Union[JobRunStatus, typing.Sequence[JobRunStatus]]]` — Status of the job run
+**secret_group_id:** `typing.Optional[str]` — Secret Group Id of the secret gourp.
@@ -4986,7 +5084,7 @@ for page in response.iter_pages():
-
-**version_numbers:** `typing.Optional[typing.Union[float, typing.Sequence[float]]]` — Version number of the deployment
+**with_value:** `typing.Optional[bool]` — Whether to include the secret values in the response. Defaults to false.
@@ -5006,7 +5104,7 @@ for page in response.iter_pages():
-client.jobs.get_run(...)
+client.secrets.get(...)
-
@@ -5018,7 +5116,7 @@ for page in response.iter_pages():
-
-Get Job Run for provided jobRunName and jobId
+Get Secret associated with provided id. The secret value is not returned if the control plane has `DISABLE_SECRET_VALUE_VIEW` set
@@ -5039,9 +5137,8 @@ client = TrueFoundry(
api_key="YOUR_API_KEY",
base_url="https://yourhost.com/path/to/api",
)
-client.jobs.get_run(
- job_id="jobId",
- job_run_name="jobRunName",
+client.secrets.get(
+ id="id",
)
```
@@ -5058,15 +5155,7 @@ client.jobs.get_run(
-
-**job_id:** `str` — Application Id of JOB
-
-
-
-
-
--
-
-**job_run_name:** `str` — Job run name of the application
+**id:** `str` — Secret Id of the secret.
@@ -5086,7 +5175,7 @@ client.jobs.get_run(
-client.jobs.delete_run(...)
+client.secrets.delete(...)
-
@@ -5098,7 +5187,7 @@ client.jobs.get_run(
-
-Delete Job Run for provided jobRunName and jobId
+Deletes a secret and its versions along with its values.
@@ -5119,9 +5208,8 @@ client = TrueFoundry(
api_key="YOUR_API_KEY",
base_url="https://yourhost.com/path/to/api",
)
-client.jobs.delete_run(
- job_id="jobId",
- job_run_name="jobRunName",
+client.secrets.delete(
+ id="id",
)
```
@@ -5138,15 +5226,7 @@ client.jobs.delete_run(
-
-**job_id:** `str` — Application Id of JOB
-
-
-
-
-
--
-
-**job_run_name:** `str` — Job run name of the application
+**id:** `str` — Secret Id of the secret.
@@ -5166,7 +5246,8 @@ client.jobs.delete_run(
-client.jobs.trigger(...)
+## SecretGroups
+client.secret_groups.list(...)
-
@@ -5178,7 +5259,7 @@ client.jobs.delete_run(
-
-Trigger Job for provided deploymentId or applicationId
+List the secret groups associated with a user along with the associated secrets for each group. Filtered with the options passed in the query fields. Note: This method does not return the secret values of the associatedSecrets in the response. A separate API call to `/v1/secrets/{id}` should be made to fetch the associated secret value.
@@ -5199,7 +5280,17 @@ client = TrueFoundry(
api_key="YOUR_API_KEY",
base_url="https://yourhost.com/path/to/api",
)
-client.jobs.trigger()
+response = client.secret_groups.list(
+ limit=10,
+ offset=0,
+ fqn="fqn",
+ search="search",
+)
+for item in response:
+ yield item
+# alternatively, you can paginate page-by-page
+for page in response.iter_pages():
+ yield page
```
@@ -5215,7 +5306,7 @@ client.jobs.trigger()
-
-**deployment_id:** `typing.Optional[str]` — Deployment Id of the job
+**limit:** `typing.Optional[int]` — Number of items per page
@@ -5223,7 +5314,7 @@ client.jobs.trigger()
-
-**application_id:** `typing.Optional[str]` — Application Id of the job
+**offset:** `typing.Optional[int]` — Number of items to skip
@@ -5231,7 +5322,7 @@ client.jobs.trigger()
-
-**input:** `typing.Optional[TriggerJobRequestInput]` — Job trigger input
+**fqn:** `typing.Optional[str]` — Fqn of secret group.
@@ -5239,7 +5330,7 @@ client.jobs.trigger()
-
-**metadata:** `typing.Optional[Metadata]` — Metadata for the job run including job_alias_name
+**search:** `typing.Optional[str]` — Search query - filters by secret group names that contain the search string
@@ -5259,7 +5350,7 @@ client.jobs.trigger()
-client.jobs.terminate(...)
+client.secret_groups.create(...)
-
@@ -5271,7 +5362,7 @@ client.jobs.trigger()
-
-Terminate Job for provided deploymentId and jobRunName
+Creates a secret group with secrets in it. A secret version for each of the created secret is created with version number as 1. The returned secret group does not have any secret values in the associatedSecrets field. A separate API call to `/v1/secrets/{id}` should be made to fetch the associated secret value.
@@ -5286,15 +5377,21 @@ Terminate Job for provided deploymentId and jobRunName
-
```python
-from truefoundry_sdk import TrueFoundry
+from truefoundry_sdk import SecretInput, TrueFoundry
client = TrueFoundry(
api_key="YOUR_API_KEY",
base_url="https://yourhost.com/path/to/api",
)
-client.jobs.terminate(
- deployment_id="deploymentId",
- job_run_name="jobRunName",
+client.secret_groups.create(
+ name="name",
+ integration_id="integrationId",
+ secrets=[
+ SecretInput(
+ key="key",
+ value="value",
+ )
+ ],
)
```
@@ -5311,7 +5408,7 @@ client.jobs.terminate(
-
-**deployment_id:** `str` — Deployment Id of the Deployment
+**name:** `str` — Name of the secret group.
@@ -5319,7 +5416,15 @@ client.jobs.terminate(
-
-**job_run_name:** `str` — Job Run name
+**integration_id:** `str` — Id of the provider integration.
+
+
+
+
+
+-
+
+**secrets:** `typing.Sequence[SecretInput]` — The secrets to be associated with the secret group
@@ -5339,8 +5444,7 @@ client.jobs.terminate(
-## Workspaces
-client.workspaces.list(...)
+client.secret_groups.create_or_update(...)
-
@@ -5352,7 +5456,7 @@ client.jobs.terminate(
-
-List workspaces associated with the user. Optional filters include clusterId, fqn, and workspace name. Pagination is available based on query parameters.
+Creates a new secret group or updates an existing one based on the provided manifest.
@@ -5367,24 +5471,24 @@ List workspaces associated with the user. Optional filters include clusterId, fq
-
```python
-from truefoundry_sdk import TrueFoundry
+from truefoundry_sdk import Collaborator, SecretGroupManifest, TrueFoundry
client = TrueFoundry(
api_key="YOUR_API_KEY",
base_url="https://yourhost.com/path/to/api",
)
-response = client.workspaces.list(
- limit=10,
- offset=0,
- cluster_id="clusterId",
- name="name",
- fqn="fqn",
+client.secret_groups.create_or_update(
+ manifest=SecretGroupManifest(
+ name="name",
+ integration_fqn="integration_fqn",
+ collaborators=[
+ Collaborator(
+ subject="subject",
+ role_id="role_id",
+ )
+ ],
+ ),
)
-for item in response:
- yield item
-# alternatively, you can paginate page-by-page
-for page in response.iter_pages():
- yield page
```
@@ -5400,39 +5504,7 @@ for page in response.iter_pages():
-
-**limit:** `typing.Optional[int]` — Number of items per page
-
-
-
-
-
--
-
-**offset:** `typing.Optional[int]` — Number of items to skip
-
-
-
-
-
--
-
-**cluster_id:** `typing.Optional[str]` — ClusterId of the Cluster
-
-
-
-
-
--
-
-**name:** `typing.Optional[str]` — Workspace Name
-
-
-
-
-
--
-
-**fqn:** `typing.Optional[str]` — Workspace FQN
+**manifest:** `SecretGroupManifest` — Secret Group Manifest
@@ -5452,7 +5524,7 @@ for page in response.iter_pages():
-client.workspaces.create_or_update(...)
+client.secret_groups.get(...)
-
@@ -5464,7 +5536,7 @@ for page in response.iter_pages():
-
-Creates a new workspace or updates an existing one based on the provided manifest.
+Get Secret Group by id. This method does not return the secret values of the associatedSecrets in the response. A separate API call to `/v1/secrets/{id}` should be made to fetch the associated secret value.
@@ -5479,17 +5551,14 @@ Creates a new workspace or updates an existing one based on the provided manifes
-
```python
-from truefoundry_sdk import TrueFoundry, WorkspaceManifest
+from truefoundry_sdk import TrueFoundry
client = TrueFoundry(
api_key="YOUR_API_KEY",
base_url="https://yourhost.com/path/to/api",
)
-client.workspaces.create_or_update(
- manifest=WorkspaceManifest(
- cluster_fqn="cluster_fqn",
- name="name",
- ),
+client.secret_groups.get(
+ id="id",
)
```
@@ -5506,15 +5575,7 @@ client.workspaces.create_or_update(
-
-**manifest:** `WorkspaceManifest` — Workspace manifest
-
-
-
-
-
--
-
-**dry_run:** `typing.Optional[bool]` — Dry run the request
+**id:** `str` — Secret Id of the secret group.
@@ -5534,7 +5595,7 @@ client.workspaces.create_or_update(
-client.workspaces.get(...)
+client.secret_groups.update(...)
-
@@ -5546,7 +5607,7 @@ client.workspaces.create_or_update(
-
-Get workspace associated with provided workspace id
+Updates the secrets in a secret group with new values. A new secret version is created for every secret that has a modified value and any omitted secrets are deleted. The returned updated secret group does not have any secret values in the associatedSecrets field. A separate API call to `/v1/secrets/{id}` should be made to fetch the associated secret value.
@@ -5561,14 +5622,19 @@ Get workspace associated with provided workspace id
-
```python
-from truefoundry_sdk import TrueFoundry
+from truefoundry_sdk import TrueFoundry, UpdateSecretInput
client = TrueFoundry(
api_key="YOUR_API_KEY",
base_url="https://yourhost.com/path/to/api",
)
-client.workspaces.get(
+client.secret_groups.update(
id="id",
+ secrets=[
+ UpdateSecretInput(
+ key="key",
+ )
+ ],
)
```
@@ -5585,7 +5651,15 @@ client.workspaces.get(
-
-**id:** `str` — Workspace id of the space
+**id:** `str` — Secret Id of the secret group.
+
+
+
+
+
+-
+
+**secrets:** `typing.Sequence[UpdateSecretInput]`
@@ -5605,7 +5679,7 @@ client.workspaces.get(
-client.workspaces.delete(...)
+client.secret_groups.delete(...)
-
@@ -5617,9 +5691,7 @@ client.workspaces.get(
-
-Deletes the workspace with the given workspace ID.
- - Removes the associated namespace from the cluster.
- - Deletes the corresponding authorization entry.
+Deletes the secret group, its associated secrets and secret versions of those secrets.
@@ -5640,7 +5712,7 @@ client = TrueFoundry(
api_key="YOUR_API_KEY",
base_url="https://yourhost.com/path/to/api",
)
-client.workspaces.delete(
+client.secret_groups.delete(
id="id",
)
@@ -5658,7 +5730,7 @@ client.workspaces.delete(
-
-**id:** `str` — Workspace id of the space
+**id:** `str` — Secret Id of the secret group.
@@ -6758,6 +6830,7 @@ response = client.artifacts.list(
offset=1,
limit=1,
run_id="run_id",
+ include_empty_artifacts=True,
)
for item in response:
yield item
@@ -6827,6 +6900,14 @@ for page in response.iter_pages():
-
+**include_empty_artifacts:** `typing.Optional[bool]`
+
+
+
+
+
+-
+
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -7045,6 +7126,7 @@ response = client.prompts.list(
name="name",
offset=1,
limit=1,
+ include_empty_prompts=True,
)
for item in response:
yield item
@@ -7106,6 +7188,14 @@ for page in response.iter_pages():
-
+**include_empty_prompts:** `typing.Optional[bool]`
+
+
+
+
+
+-
+
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -7325,6 +7415,7 @@ response = client.models.list(
offset=1,
limit=1,
run_id="run_id",
+ include_empty_models=True,
)
for item in response:
yield item
@@ -7394,6 +7485,14 @@ for page in response.iter_pages():
-
+**include_empty_models:** `typing.Optional[bool]`
+
+
+
+
+
+-
+
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -10881,7 +10980,7 @@ client.internal.workflows.execute_workflow(
-
-**inputs:** `typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]` — Workflow inputs
+**inputs:** `typing.Optional[typing.Dict[str, typing.Any]]` — Workflow inputs
@@ -10889,7 +10988,7 @@ client.internal.workflows.execute_workflow(
-
-**inputs_literal_map:** `typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]` — Workflow inputs literal map
+**inputs_literal_map:** `typing.Optional[typing.Dict[str, typing.Any]]` — Workflow inputs literal map
diff --git a/src/truefoundry_sdk/__init__.py b/src/truefoundry_sdk/__init__.py
index c866646..452b879 100644
--- a/src/truefoundry_sdk/__init__.py
+++ b/src/truefoundry_sdk/__init__.py
@@ -7,6 +7,7 @@
if typing.TYPE_CHECKING:
from .types import (
+ Account,
ActivateUserResponse,
AddOnComponentSource,
AddonComponent,
@@ -51,7 +52,7 @@
ArtifactsDownloadArtifactsItem,
AssistantMessage,
AssistantMessageContent,
- AssistantMessageContentItem,
+ AssistantMessageContentOneItem,
AsyncProcessorSidecar,
AsyncService,
AsyncServiceAutoscaling,
@@ -62,6 +63,7 @@
AwsAccessKeyAuth,
AwsAccessKeyBasedAuth,
AwsAssumedRoleBasedAuth,
+ AwsBedrockAssumedRoleBasedAuth,
AwsBedrockGuardrailConfig,
AwsBedrockGuardrailConfigAuthData,
AwsBedrockGuardrailConfigOperation,
@@ -84,6 +86,8 @@
AwsSagemakerProviderAccountAuthData,
AwsSecretsManager,
AwsSecretsManagerAuthData,
+ AwsSqsAccessKeyBasedAuth,
+ AwsSqsAssumedRoleBasedAuth,
AzureAksIntegration,
AzureBasicAuth,
AzureBlobStorage,
@@ -120,6 +124,7 @@
BitbucketProviderAccount,
BlobStorageReference,
BlueGreen,
+ BudgetAlert,
BudgetConfig,
BudgetLimitUnit,
BudgetRule,
@@ -270,7 +275,6 @@
GcpIntegrations,
GcpKeyFileAuth,
GcpProviderAccount,
- GcpProviderAccountAuthData,
GcpRegion,
GcpTpu,
GeminiModel,
@@ -334,6 +338,7 @@
HashicorpTokenAuth,
HashicorpVaultIntegration,
HeaderMatch,
+ HeaderRoutingConfig,
HealthProbe,
Helm,
HelmRepo,
@@ -436,7 +441,6 @@
McpServerIntegrationTransport,
McpServerIntegrations,
McpServerOAuth2,
- McpServerOAuth2Dcr,
McpServerOAuth2JwtSource,
McpServerPassthrough,
McpServerProviderAccount,
@@ -479,6 +483,7 @@
NomicKeyAuth,
NomicModel,
NomicProviderAccount,
+ NonNegativeFloat,
Notebook,
NotebookConfig,
NotificationTarget,
@@ -526,6 +531,7 @@
PaloAltoPrismaAirsKeyAuth,
PangeaGuardType,
PangeaGuardrailConfig,
+ PangeaGuardrailConfigOperation,
PangeaKeyAuth,
Param,
ParamParamType,
@@ -577,6 +583,7 @@
Prompt,
PromptFooGuardType,
PromptFooGuardrailConfig,
+ PromptFooGuardrailConfigOperation,
PromptVersion,
ProviderAccounts,
PublicCostMetric,
@@ -607,6 +614,8 @@
ResourcesNode,
RetryConfig,
RevokeAllPersonalAccessTokenResponse,
+ RoleManifest,
+ RolePermissions,
Rolling,
RpsMetric,
SagemakerModel,
@@ -618,6 +627,7 @@
ScheduleConcurrencyPolicy,
Secret,
SecretGroup,
+ SecretGroupManifest,
SecretInput,
SecretMount,
SecretStoreConfig,
@@ -682,6 +692,7 @@
SqsInputConfig,
SqsOutputConfig,
SqsQueueMetricConfig,
+ SqsQueueMetricConfigAuth,
SshServer,
SshServerConfig,
SsoTeamManifest,
@@ -740,10 +751,12 @@
User,
UserMessage,
UserMessageContent,
- UserMessageContentItem,
+ UserMessageContentOneItem,
UserMetadata,
UserMetadataTenantRoleManagedBy,
UserResource,
+ UserRoleWithResource,
+ UserRoleWithResourceResourceType,
Uv,
ValidationError,
ValidationErrorLocItem,
@@ -753,6 +766,8 @@
VirtualAccountOwnedBy,
VirtualMcpServerIntegration,
VirtualMcpServerSource,
+ VirtualModel,
+ VirtualModelProviderAccount,
Volume,
VolumeBrowser,
VolumeConfig,
@@ -832,6 +847,7 @@
from .version import __version__
from .workspaces import WorkspacesDeleteResponse
_dynamic_imports: typing.Dict[str, str] = {
+ "Account": ".types",
"ActivateUserResponse": ".types",
"AddOnComponentSource": ".types",
"AddonComponent": ".types",
@@ -880,7 +896,7 @@
"ArtifactsDownloadArtifactsItem": ".types",
"AssistantMessage": ".types",
"AssistantMessageContent": ".types",
- "AssistantMessageContentItem": ".types",
+ "AssistantMessageContentOneItem": ".types",
"AsyncProcessorSidecar": ".types",
"AsyncService": ".types",
"AsyncServiceAutoscaling": ".types",
@@ -892,6 +908,7 @@
"AwsAccessKeyAuth": ".types",
"AwsAccessKeyBasedAuth": ".types",
"AwsAssumedRoleBasedAuth": ".types",
+ "AwsBedrockAssumedRoleBasedAuth": ".types",
"AwsBedrockGuardrailConfig": ".types",
"AwsBedrockGuardrailConfigAuthData": ".types",
"AwsBedrockGuardrailConfigOperation": ".types",
@@ -914,6 +931,8 @@
"AwsSagemakerProviderAccountAuthData": ".types",
"AwsSecretsManager": ".types",
"AwsSecretsManagerAuthData": ".types",
+ "AwsSqsAccessKeyBasedAuth": ".types",
+ "AwsSqsAssumedRoleBasedAuth": ".types",
"AzureAksIntegration": ".types",
"AzureBasicAuth": ".types",
"AzureBlobStorage": ".types",
@@ -951,6 +970,7 @@
"BitbucketProviderAccount": ".types",
"BlobStorageReference": ".types",
"BlueGreen": ".types",
+ "BudgetAlert": ".types",
"BudgetConfig": ".types",
"BudgetLimitUnit": ".types",
"BudgetRule": ".types",
@@ -1106,7 +1126,6 @@
"GcpIntegrations": ".types",
"GcpKeyFileAuth": ".types",
"GcpProviderAccount": ".types",
- "GcpProviderAccountAuthData": ".types",
"GcpRegion": ".types",
"GcpTpu": ".types",
"GeminiModel": ".types",
@@ -1170,6 +1189,7 @@
"HashicorpTokenAuth": ".types",
"HashicorpVaultIntegration": ".types",
"HeaderMatch": ".types",
+ "HeaderRoutingConfig": ".types",
"HealthProbe": ".types",
"Helm": ".types",
"HelmRepo": ".types",
@@ -1272,7 +1292,6 @@
"McpServerIntegrationTransport": ".types",
"McpServerIntegrations": ".types",
"McpServerOAuth2": ".types",
- "McpServerOAuth2Dcr": ".types",
"McpServerOAuth2JwtSource": ".types",
"McpServerPassthrough": ".types",
"McpServerProviderAccount": ".types",
@@ -1316,6 +1335,7 @@
"NomicKeyAuth": ".types",
"NomicModel": ".types",
"NomicProviderAccount": ".types",
+ "NonNegativeFloat": ".types",
"NotFoundError": ".errors",
"NotImplementedError": ".errors",
"Notebook": ".types",
@@ -1365,6 +1385,7 @@
"PaloAltoPrismaAirsKeyAuth": ".types",
"PangeaGuardType": ".types",
"PangeaGuardrailConfig": ".types",
+ "PangeaGuardrailConfigOperation": ".types",
"PangeaKeyAuth": ".types",
"Param": ".types",
"ParamParamType": ".types",
@@ -1416,6 +1437,7 @@
"Prompt": ".types",
"PromptFooGuardType": ".types",
"PromptFooGuardrailConfig": ".types",
+ "PromptFooGuardrailConfigOperation": ".types",
"PromptVersion": ".types",
"ProviderAccounts": ".types",
"PublicCostMetric": ".types",
@@ -1447,6 +1469,8 @@
"ResourcesNode": ".types",
"RetryConfig": ".types",
"RevokeAllPersonalAccessTokenResponse": ".types",
+ "RoleManifest": ".types",
+ "RolePermissions": ".types",
"Rolling": ".types",
"RpsMetric": ".types",
"SagemakerModel": ".types",
@@ -1458,6 +1482,7 @@
"ScheduleConcurrencyPolicy": ".types",
"Secret": ".types",
"SecretGroup": ".types",
+ "SecretGroupManifest": ".types",
"SecretInput": ".types",
"SecretMount": ".types",
"SecretStoreConfig": ".types",
@@ -1522,6 +1547,7 @@
"SqsInputConfig": ".types",
"SqsOutputConfig": ".types",
"SqsQueueMetricConfig": ".types",
+ "SqsQueueMetricConfigAuth": ".types",
"SshServer": ".types",
"SshServerConfig": ".types",
"SsoTeamManifest": ".types",
@@ -1586,10 +1612,12 @@
"User": ".types",
"UserMessage": ".types",
"UserMessageContent": ".types",
- "UserMessageContentItem": ".types",
+ "UserMessageContentOneItem": ".types",
"UserMetadata": ".types",
"UserMetadataTenantRoleManagedBy": ".types",
"UserResource": ".types",
+ "UserRoleWithResource": ".types",
+ "UserRoleWithResourceResourceType": ".types",
"Uv": ".types",
"ValidationError": ".types",
"ValidationErrorLocItem": ".types",
@@ -1599,6 +1627,8 @@
"VirtualAccountOwnedBy": ".types",
"VirtualMcpServerIntegration": ".types",
"VirtualMcpServerSource": ".types",
+ "VirtualModel": ".types",
+ "VirtualModelProviderAccount": ".types",
"Volume": ".types",
"VolumeBrowser": ".types",
"VolumeConfig": ".types",
@@ -1676,6 +1706,7 @@ def __dir__():
__all__ = [
+ "Account",
"ActivateUserResponse",
"AddOnComponentSource",
"AddonComponent",
@@ -1724,7 +1755,7 @@ def __dir__():
"ArtifactsDownloadArtifactsItem",
"AssistantMessage",
"AssistantMessageContent",
- "AssistantMessageContentItem",
+ "AssistantMessageContentOneItem",
"AsyncProcessorSidecar",
"AsyncService",
"AsyncServiceAutoscaling",
@@ -1736,6 +1767,7 @@ def __dir__():
"AwsAccessKeyAuth",
"AwsAccessKeyBasedAuth",
"AwsAssumedRoleBasedAuth",
+ "AwsBedrockAssumedRoleBasedAuth",
"AwsBedrockGuardrailConfig",
"AwsBedrockGuardrailConfigAuthData",
"AwsBedrockGuardrailConfigOperation",
@@ -1758,6 +1790,8 @@ def __dir__():
"AwsSagemakerProviderAccountAuthData",
"AwsSecretsManager",
"AwsSecretsManagerAuthData",
+ "AwsSqsAccessKeyBasedAuth",
+ "AwsSqsAssumedRoleBasedAuth",
"AzureAksIntegration",
"AzureBasicAuth",
"AzureBlobStorage",
@@ -1795,6 +1829,7 @@ def __dir__():
"BitbucketProviderAccount",
"BlobStorageReference",
"BlueGreen",
+ "BudgetAlert",
"BudgetConfig",
"BudgetLimitUnit",
"BudgetRule",
@@ -1950,7 +1985,6 @@ def __dir__():
"GcpIntegrations",
"GcpKeyFileAuth",
"GcpProviderAccount",
- "GcpProviderAccountAuthData",
"GcpRegion",
"GcpTpu",
"GeminiModel",
@@ -2014,6 +2048,7 @@ def __dir__():
"HashicorpTokenAuth",
"HashicorpVaultIntegration",
"HeaderMatch",
+ "HeaderRoutingConfig",
"HealthProbe",
"Helm",
"HelmRepo",
@@ -2116,7 +2151,6 @@ def __dir__():
"McpServerIntegrationTransport",
"McpServerIntegrations",
"McpServerOAuth2",
- "McpServerOAuth2Dcr",
"McpServerOAuth2JwtSource",
"McpServerPassthrough",
"McpServerProviderAccount",
@@ -2160,6 +2194,7 @@ def __dir__():
"NomicKeyAuth",
"NomicModel",
"NomicProviderAccount",
+ "NonNegativeFloat",
"NotFoundError",
"NotImplementedError",
"Notebook",
@@ -2209,6 +2244,7 @@ def __dir__():
"PaloAltoPrismaAirsKeyAuth",
"PangeaGuardType",
"PangeaGuardrailConfig",
+ "PangeaGuardrailConfigOperation",
"PangeaKeyAuth",
"Param",
"ParamParamType",
@@ -2260,6 +2296,7 @@ def __dir__():
"Prompt",
"PromptFooGuardType",
"PromptFooGuardrailConfig",
+ "PromptFooGuardrailConfigOperation",
"PromptVersion",
"ProviderAccounts",
"PublicCostMetric",
@@ -2291,6 +2328,8 @@ def __dir__():
"ResourcesNode",
"RetryConfig",
"RevokeAllPersonalAccessTokenResponse",
+ "RoleManifest",
+ "RolePermissions",
"Rolling",
"RpsMetric",
"SagemakerModel",
@@ -2302,6 +2341,7 @@ def __dir__():
"ScheduleConcurrencyPolicy",
"Secret",
"SecretGroup",
+ "SecretGroupManifest",
"SecretInput",
"SecretMount",
"SecretStoreConfig",
@@ -2366,6 +2406,7 @@ def __dir__():
"SqsInputConfig",
"SqsOutputConfig",
"SqsQueueMetricConfig",
+ "SqsQueueMetricConfigAuth",
"SshServer",
"SshServerConfig",
"SsoTeamManifest",
@@ -2430,10 +2471,12 @@ def __dir__():
"User",
"UserMessage",
"UserMessageContent",
- "UserMessageContentItem",
+ "UserMessageContentOneItem",
"UserMetadata",
"UserMetadataTenantRoleManagedBy",
"UserResource",
+ "UserRoleWithResource",
+ "UserRoleWithResourceResourceType",
"Uv",
"ValidationError",
"ValidationErrorLocItem",
@@ -2443,6 +2486,8 @@ def __dir__():
"VirtualAccountOwnedBy",
"VirtualMcpServerIntegration",
"VirtualMcpServerSource",
+ "VirtualModel",
+ "VirtualModelProviderAccount",
"Volume",
"VolumeBrowser",
"VolumeConfig",
diff --git a/src/truefoundry_sdk/_wrapped_clients.py b/src/truefoundry_sdk/_wrapped_clients.py
index 16a3959..6a3388a 100644
--- a/src/truefoundry_sdk/_wrapped_clients.py
+++ b/src/truefoundry_sdk/_wrapped_clients.py
@@ -28,17 +28,18 @@
from pydantic import BaseModel
T = TypeVar("T", bound=BaseModel)
+R = TypeVar("R", bound=BaseModel)
-class HasListMethod(Protocol[T]):
- def list(self, *, fqn: str, limit: Optional[int] = None, **kwargs: Any) -> SyncPager[T]: ...
+class HasListMethod(Protocol[T, R]):
+ def list(self, *, fqn: str, limit: Optional[int] = None, **kwargs: Any) -> SyncPager[T, R]: ...
-class HasAsyncListMethod(Protocol[T]):
- async def list(self, *, fqn: str, limit: Optional[int] = None, **kwargs) -> AsyncPager[T]: ...
+class HasAsyncListMethod(Protocol[T, R]):
+ async def list(self, *, fqn: str, limit: Optional[int] = None, **kwargs) -> AsyncPager[T, R]: ...
-def _get_by_fqn(client: HasListMethod[T], *, fqn: str, request_options: Optional[RequestOptions] = None) -> T:
+def _get_by_fqn(client: HasListMethod[T, R], *, fqn: str, request_options: Optional[RequestOptions] = None) -> T:
result = None
for item in client.list(fqn=fqn, limit=1, request_options=request_options):
result = item
@@ -54,7 +55,7 @@ def _get_by_fqn(client: HasListMethod[T], *, fqn: str, request_options: Optional
async def _aget_by_fqn(
- client: HasAsyncListMethod[T], *, fqn: str, request_options: Optional[RequestOptions] = None
+ client: HasAsyncListMethod[T, R], *, fqn: str, request_options: Optional[RequestOptions] = None
) -> T:
result = None
pager = await client.list(fqn=fqn, limit=1, request_options=request_options)
diff --git a/src/truefoundry_sdk/alerts/raw_client.py b/src/truefoundry_sdk/alerts/raw_client.py
index f55a771..430342f 100644
--- a/src/truefoundry_sdk/alerts/raw_client.py
+++ b/src/truefoundry_sdk/alerts/raw_client.py
@@ -83,9 +83,9 @@ def list(
raise BadRequestError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -175,9 +175,9 @@ async def list(
raise BadRequestError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
diff --git a/src/truefoundry_sdk/application_versions/client.py b/src/truefoundry_sdk/application_versions/client.py
index 10c3ca3..905c126 100644
--- a/src/truefoundry_sdk/application_versions/client.py
+++ b/src/truefoundry_sdk/application_versions/client.py
@@ -7,6 +7,7 @@
from ..core.request_options import RequestOptions
from ..types.deployment import Deployment
from ..types.get_application_deployment_response import GetApplicationDeploymentResponse
+from ..types.list_application_deployments_response import ListApplicationDeploymentsResponse
from .raw_client import AsyncRawApplicationVersionsClient, RawApplicationVersionsClient
@@ -34,7 +35,7 @@ def list(
version: typing.Optional[str] = None,
deployment_id: typing.Optional[str] = None,
request_options: typing.Optional[RequestOptions] = None,
- ) -> SyncPager[Deployment]:
+ ) -> SyncPager[Deployment, ListApplicationDeploymentsResponse]:
"""
Fetch all deployments for a given application ID with optional filters such as deployment ID or version. Supports pagination.
@@ -60,7 +61,7 @@ def list(
Returns
-------
- SyncPager[Deployment]
+ SyncPager[Deployment, ListApplicationDeploymentsResponse]
List of deployments matching the provided filters.
Examples
@@ -156,7 +157,7 @@ async def list(
version: typing.Optional[str] = None,
deployment_id: typing.Optional[str] = None,
request_options: typing.Optional[RequestOptions] = None,
- ) -> AsyncPager[Deployment]:
+ ) -> AsyncPager[Deployment, ListApplicationDeploymentsResponse]:
"""
Fetch all deployments for a given application ID with optional filters such as deployment ID or version. Supports pagination.
@@ -182,7 +183,7 @@ async def list(
Returns
-------
- AsyncPager[Deployment]
+ AsyncPager[Deployment, ListApplicationDeploymentsResponse]
List of deployments matching the provided filters.
Examples
diff --git a/src/truefoundry_sdk/application_versions/raw_client.py b/src/truefoundry_sdk/application_versions/raw_client.py
index d354ff9..f9050ce 100644
--- a/src/truefoundry_sdk/application_versions/raw_client.py
+++ b/src/truefoundry_sdk/application_versions/raw_client.py
@@ -7,7 +7,7 @@
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from ..core.http_response import AsyncHttpResponse, HttpResponse
from ..core.jsonable_encoder import jsonable_encoder
-from ..core.pagination import AsyncPager, BaseHttpResponse, SyncPager
+from ..core.pagination import AsyncPager, SyncPager
from ..core.pydantic_utilities import parse_obj_as
from ..core.request_options import RequestOptions
from ..errors.forbidden_error import ForbiddenError
@@ -31,7 +31,7 @@ def list(
version: typing.Optional[str] = None,
deployment_id: typing.Optional[str] = None,
request_options: typing.Optional[RequestOptions] = None,
- ) -> SyncPager[Deployment]:
+ ) -> SyncPager[Deployment, ListApplicationDeploymentsResponse]:
"""
Fetch all deployments for a given application ID with optional filters such as deployment ID or version. Supports pagination.
@@ -57,7 +57,7 @@ def list(
Returns
-------
- SyncPager[Deployment]
+ SyncPager[Deployment, ListApplicationDeploymentsResponse]
List of deployments matching the provided filters.
"""
offset = offset if offset is not None else 0
@@ -92,9 +92,7 @@ def list(
deployment_id=deployment_id,
request_options=request_options,
)
- return SyncPager(
- has_next=_has_next, items=_items, get_next=_get_next, response=BaseHttpResponse(response=_response)
- )
+ return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
if _response.status_code == 403:
raise ForbiddenError(
headers=dict(_response.headers),
@@ -110,9 +108,9 @@ def list(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -174,9 +172,9 @@ def get(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -200,7 +198,7 @@ async def list(
version: typing.Optional[str] = None,
deployment_id: typing.Optional[str] = None,
request_options: typing.Optional[RequestOptions] = None,
- ) -> AsyncPager[Deployment]:
+ ) -> AsyncPager[Deployment, ListApplicationDeploymentsResponse]:
"""
Fetch all deployments for a given application ID with optional filters such as deployment ID or version. Supports pagination.
@@ -226,7 +224,7 @@ async def list(
Returns
-------
- AsyncPager[Deployment]
+ AsyncPager[Deployment, ListApplicationDeploymentsResponse]
List of deployments matching the provided filters.
"""
offset = offset if offset is not None else 0
@@ -264,9 +262,7 @@ async def _get_next():
request_options=request_options,
)
- return AsyncPager(
- has_next=_has_next, items=_items, get_next=_get_next, response=BaseHttpResponse(response=_response)
- )
+ return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
if _response.status_code == 403:
raise ForbiddenError(
headers=dict(_response.headers),
@@ -282,9 +278,9 @@ async def _get_next():
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -346,9 +342,9 @@ async def get(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
diff --git a/src/truefoundry_sdk/applications/client.py b/src/truefoundry_sdk/applications/client.py
index 3f5cfb8..a53bc35 100644
--- a/src/truefoundry_sdk/applications/client.py
+++ b/src/truefoundry_sdk/applications/client.py
@@ -10,6 +10,7 @@
from ..types.deployment import Deployment
from ..types.get_application_deployment_response import GetApplicationDeploymentResponse
from ..types.get_application_response import GetApplicationResponse
+from ..types.list_applications_response import ListApplicationsResponse
from .raw_client import AsyncRawApplicationsClient, RawApplicationsClient
from .types.applications_cancel_deployment_response import ApplicationsCancelDeploymentResponse
from .types.applications_list_request_device_type_filter import ApplicationsListRequestDeviceTypeFilter
@@ -55,7 +56,7 @@ def list(
lifecycle_stage: typing.Optional[ApplicationsListRequestLifecycleStage] = None,
is_recommendation_present_and_visible: typing.Optional[bool] = None,
request_options: typing.Optional[RequestOptions] = None,
- ) -> SyncPager[Application]:
+ ) -> SyncPager[Application, ListApplicationsResponse]:
"""
Retrieves a list of all latest applications. Supports filtering by application ID, name, type, and other parameters. Pagination is available based on query parameters.
@@ -117,7 +118,7 @@ def list(
Returns
-------
- SyncPager[Application]
+ SyncPager[Application, ListApplicationsResponse]
Retrieve latest applications based on the specified query parameters. If pagination parameters are provided, the response includes paginated data.
Examples
@@ -181,7 +182,7 @@ def list(
def create_or_update(
self,
*,
- manifest: typing.Dict[str, typing.Optional[typing.Any]],
+ manifest: typing.Dict[str, typing.Any],
dry_run: typing.Optional[bool] = OMIT,
force_deploy: typing.Optional[bool] = OMIT,
trigger_on_deploy: typing.Optional[bool] = OMIT,
@@ -196,7 +197,7 @@ def create_or_update(
Parameters
----------
- manifest : typing.Dict[str, typing.Optional[typing.Any]]
+ manifest : typing.Dict[str, typing.Any]
Manifest of application
dry_run : typing.Optional[bool]
@@ -458,7 +459,7 @@ async def list(
lifecycle_stage: typing.Optional[ApplicationsListRequestLifecycleStage] = None,
is_recommendation_present_and_visible: typing.Optional[bool] = None,
request_options: typing.Optional[RequestOptions] = None,
- ) -> AsyncPager[Application]:
+ ) -> AsyncPager[Application, ListApplicationsResponse]:
"""
Retrieves a list of all latest applications. Supports filtering by application ID, name, type, and other parameters. Pagination is available based on query parameters.
@@ -520,7 +521,7 @@ async def list(
Returns
-------
- AsyncPager[Application]
+ AsyncPager[Application, ListApplicationsResponse]
Retrieve latest applications based on the specified query parameters. If pagination parameters are provided, the response includes paginated data.
Examples
@@ -593,7 +594,7 @@ async def main() -> None:
async def create_or_update(
self,
*,
- manifest: typing.Dict[str, typing.Optional[typing.Any]],
+ manifest: typing.Dict[str, typing.Any],
dry_run: typing.Optional[bool] = OMIT,
force_deploy: typing.Optional[bool] = OMIT,
trigger_on_deploy: typing.Optional[bool] = OMIT,
@@ -608,7 +609,7 @@ async def create_or_update(
Parameters
----------
- manifest : typing.Dict[str, typing.Optional[typing.Any]]
+ manifest : typing.Dict[str, typing.Any]
Manifest of application
dry_run : typing.Optional[bool]
diff --git a/src/truefoundry_sdk/applications/raw_client.py b/src/truefoundry_sdk/applications/raw_client.py
index 070ca71..7f4fb39 100644
--- a/src/truefoundry_sdk/applications/raw_client.py
+++ b/src/truefoundry_sdk/applications/raw_client.py
@@ -7,7 +7,7 @@
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from ..core.http_response import AsyncHttpResponse, HttpResponse
from ..core.jsonable_encoder import jsonable_encoder
-from ..core.pagination import AsyncPager, BaseHttpResponse, SyncPager
+from ..core.pagination import AsyncPager, SyncPager
from ..core.pydantic_utilities import parse_obj_as
from ..core.request_options import RequestOptions
from ..errors.bad_request_error import BadRequestError
@@ -56,7 +56,7 @@ def list(
lifecycle_stage: typing.Optional[ApplicationsListRequestLifecycleStage] = None,
is_recommendation_present_and_visible: typing.Optional[bool] = None,
request_options: typing.Optional[RequestOptions] = None,
- ) -> SyncPager[Application]:
+ ) -> SyncPager[Application, ListApplicationsResponse]:
"""
Retrieves a list of all latest applications. Supports filtering by application ID, name, type, and other parameters. Pagination is available based on query parameters.
@@ -118,7 +118,7 @@ def list(
Returns
-------
- SyncPager[Application]
+ SyncPager[Application, ListApplicationsResponse]
Retrieve latest applications based on the specified query parameters. If pagination parameters are provided, the response includes paginated data.
"""
offset = offset if offset is not None else 0
@@ -178,16 +178,14 @@ def list(
is_recommendation_present_and_visible=is_recommendation_present_and_visible,
request_options=request_options,
)
- return SyncPager(
- has_next=_has_next, items=_items, get_next=_get_next, response=BaseHttpResponse(response=_response)
- )
+ return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
if _response.status_code == 400:
raise BadRequestError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -200,7 +198,7 @@ def list(
def create_or_update(
self,
*,
- manifest: typing.Dict[str, typing.Optional[typing.Any]],
+ manifest: typing.Dict[str, typing.Any],
dry_run: typing.Optional[bool] = OMIT,
force_deploy: typing.Optional[bool] = OMIT,
trigger_on_deploy: typing.Optional[bool] = OMIT,
@@ -215,7 +213,7 @@ def create_or_update(
Parameters
----------
- manifest : typing.Dict[str, typing.Optional[typing.Any]]
+ manifest : typing.Dict[str, typing.Any]
Manifest of application
dry_run : typing.Optional[bool]
@@ -283,9 +281,9 @@ def create_or_update(
raise BadRequestError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -305,9 +303,9 @@ def create_or_update(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -377,9 +375,9 @@ def get(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -438,9 +436,9 @@ def delete(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -489,9 +487,9 @@ def scale_to_zero(self, id: str, *, request_options: typing.Optional[RequestOpti
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -500,9 +498,9 @@ def scale_to_zero(self, id: str, *, request_options: typing.Optional[RequestOpti
raise MethodNotAllowedError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -572,9 +570,9 @@ def scale_to_original(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -647,9 +645,9 @@ def cancel_deployment(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -696,7 +694,7 @@ async def list(
lifecycle_stage: typing.Optional[ApplicationsListRequestLifecycleStage] = None,
is_recommendation_present_and_visible: typing.Optional[bool] = None,
request_options: typing.Optional[RequestOptions] = None,
- ) -> AsyncPager[Application]:
+ ) -> AsyncPager[Application, ListApplicationsResponse]:
"""
Retrieves a list of all latest applications. Supports filtering by application ID, name, type, and other parameters. Pagination is available based on query parameters.
@@ -758,7 +756,7 @@ async def list(
Returns
-------
- AsyncPager[Application]
+ AsyncPager[Application, ListApplicationsResponse]
Retrieve latest applications based on the specified query parameters. If pagination parameters are provided, the response includes paginated data.
"""
offset = offset if offset is not None else 0
@@ -821,16 +819,14 @@ async def _get_next():
request_options=request_options,
)
- return AsyncPager(
- has_next=_has_next, items=_items, get_next=_get_next, response=BaseHttpResponse(response=_response)
- )
+ return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
if _response.status_code == 400:
raise BadRequestError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -843,7 +839,7 @@ async def _get_next():
async def create_or_update(
self,
*,
- manifest: typing.Dict[str, typing.Optional[typing.Any]],
+ manifest: typing.Dict[str, typing.Any],
dry_run: typing.Optional[bool] = OMIT,
force_deploy: typing.Optional[bool] = OMIT,
trigger_on_deploy: typing.Optional[bool] = OMIT,
@@ -858,7 +854,7 @@ async def create_or_update(
Parameters
----------
- manifest : typing.Dict[str, typing.Optional[typing.Any]]
+ manifest : typing.Dict[str, typing.Any]
Manifest of application
dry_run : typing.Optional[bool]
@@ -926,9 +922,9 @@ async def create_or_update(
raise BadRequestError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -948,9 +944,9 @@ async def create_or_update(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -1020,9 +1016,9 @@ async def get(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -1081,9 +1077,9 @@ async def delete(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -1134,9 +1130,9 @@ async def scale_to_zero(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -1145,9 +1141,9 @@ async def scale_to_zero(
raise MethodNotAllowedError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -1217,9 +1213,9 @@ async def scale_to_original(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -1292,9 +1288,9 @@ async def cancel_deployment(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
diff --git a/src/truefoundry_sdk/applications/types/applications_list_request_device_type_filter.py b/src/truefoundry_sdk/applications/types/applications_list_request_device_type_filter.py
index b7456e2..ebaf079 100644
--- a/src/truefoundry_sdk/applications/types/applications_list_request_device_type_filter.py
+++ b/src/truefoundry_sdk/applications/types/applications_list_request_device_type_filter.py
@@ -1,12 +1,13 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ...core import enum
+
T_Result = typing.TypeVar("T_Result")
-class ApplicationsListRequestDeviceTypeFilter(str, enum.Enum):
+class ApplicationsListRequestDeviceTypeFilter(enum.StrEnum):
CPU = "cpu"
NVIDIA_GPU = "nvidia_gpu"
AWS_INFERENTIA = "aws_inferentia"
diff --git a/src/truefoundry_sdk/applications/types/applications_list_request_lifecycle_stage.py b/src/truefoundry_sdk/applications/types/applications_list_request_lifecycle_stage.py
index effce73..de485d7 100644
--- a/src/truefoundry_sdk/applications/types/applications_list_request_lifecycle_stage.py
+++ b/src/truefoundry_sdk/applications/types/applications_list_request_lifecycle_stage.py
@@ -1,12 +1,13 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ...core import enum
+
T_Result = typing.TypeVar("T_Result")
-class ApplicationsListRequestLifecycleStage(str, enum.Enum):
+class ApplicationsListRequestLifecycleStage(enum.StrEnum):
ACTIVE = "active"
DELETING = "deleting"
DELETION_FAILED = "deletion_failed"
diff --git a/src/truefoundry_sdk/artifact_versions/client.py b/src/truefoundry_sdk/artifact_versions/client.py
index 09e401a..3f43548 100644
--- a/src/truefoundry_sdk/artifact_versions/client.py
+++ b/src/truefoundry_sdk/artifact_versions/client.py
@@ -10,6 +10,8 @@
from ..types.file_info import FileInfo
from ..types.get_artifact_version_response import GetArtifactVersionResponse
from ..types.get_signed_ur_ls_response import GetSignedUrLsResponse
+from ..types.list_artifact_versions_response import ListArtifactVersionsResponse
+from ..types.list_files_response import ListFilesResponse
from ..types.multi_part_upload_response import MultiPartUploadResponse
from ..types.operation import Operation
from ..types.stage_artifact_response import StageArtifactResponse
@@ -155,7 +157,7 @@ def list(
limit: typing.Optional[int] = 100,
include_internal_metadata: typing.Optional[bool] = False,
request_options: typing.Optional[RequestOptions] = None,
- ) -> SyncPager[ArtifactVersion]:
+ ) -> SyncPager[ArtifactVersion, ListArtifactVersionsResponse]:
"""
List artifact version API
@@ -188,7 +190,7 @@ def list(
Returns
-------
- SyncPager[ArtifactVersion]
+ SyncPager[ArtifactVersion, ListArtifactVersionsResponse]
Successful Response
Examples
@@ -358,7 +360,7 @@ def list_files(
limit: typing.Optional[int] = OMIT,
page_token: typing.Optional[str] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
- ) -> SyncPager[FileInfo]:
+ ) -> SyncPager[FileInfo, ListFilesResponse]:
"""
Parameters
----------
@@ -375,7 +377,7 @@ def list_files(
Returns
-------
- SyncPager[FileInfo]
+ SyncPager[FileInfo, ListFilesResponse]
Successful Response
Examples
@@ -590,7 +592,7 @@ async def list(
limit: typing.Optional[int] = 100,
include_internal_metadata: typing.Optional[bool] = False,
request_options: typing.Optional[RequestOptions] = None,
- ) -> AsyncPager[ArtifactVersion]:
+ ) -> AsyncPager[ArtifactVersion, ListArtifactVersionsResponse]:
"""
List artifact version API
@@ -623,7 +625,7 @@ async def list(
Returns
-------
- AsyncPager[ArtifactVersion]
+ AsyncPager[ArtifactVersion, ListArtifactVersionsResponse]
Successful Response
Examples
@@ -830,7 +832,7 @@ async def list_files(
limit: typing.Optional[int] = OMIT,
page_token: typing.Optional[str] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
- ) -> AsyncPager[FileInfo]:
+ ) -> AsyncPager[FileInfo, ListFilesResponse]:
"""
Parameters
----------
@@ -847,7 +849,7 @@ async def list_files(
Returns
-------
- AsyncPager[FileInfo]
+ AsyncPager[FileInfo, ListFilesResponse]
Successful Response
Examples
diff --git a/src/truefoundry_sdk/artifact_versions/raw_client.py b/src/truefoundry_sdk/artifact_versions/raw_client.py
index 4078a64..6296192 100644
--- a/src/truefoundry_sdk/artifact_versions/raw_client.py
+++ b/src/truefoundry_sdk/artifact_versions/raw_client.py
@@ -7,7 +7,7 @@
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from ..core.http_response import AsyncHttpResponse, HttpResponse
from ..core.jsonable_encoder import jsonable_encoder
-from ..core.pagination import AsyncPager, BaseHttpResponse, SyncPager
+from ..core.pagination import AsyncPager, SyncPager
from ..core.pydantic_utilities import parse_obj_as
from ..core.request_options import RequestOptions
from ..core.serialization import convert_and_respect_annotation_metadata
@@ -85,9 +85,9 @@ def apply_tags(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -134,9 +134,9 @@ def get(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -183,9 +183,9 @@ def delete(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -210,7 +210,7 @@ def list(
limit: typing.Optional[int] = 100,
include_internal_metadata: typing.Optional[bool] = False,
request_options: typing.Optional[RequestOptions] = None,
- ) -> SyncPager[ArtifactVersion]:
+ ) -> SyncPager[ArtifactVersion, ListArtifactVersionsResponse]:
"""
List artifact version API
@@ -243,7 +243,7 @@ def list(
Returns
-------
- SyncPager[ArtifactVersion]
+ SyncPager[ArtifactVersion, ListArtifactVersionsResponse]
Successful Response
"""
offset = offset if offset is not None else 0
@@ -291,16 +291,14 @@ def list(
include_internal_metadata=include_internal_metadata,
request_options=request_options,
)
- return SyncPager(
- has_next=_has_next, items=_items, get_next=_get_next, response=BaseHttpResponse(response=_response)
- )
+ return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -363,9 +361,9 @@ def get_signed_urls(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -423,9 +421,9 @@ def create_multi_part_upload(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -479,9 +477,9 @@ def stage(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -499,7 +497,7 @@ def list_files(
limit: typing.Optional[int] = OMIT,
page_token: typing.Optional[str] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
- ) -> SyncPager[FileInfo]:
+ ) -> SyncPager[FileInfo, ListFilesResponse]:
"""
Parameters
----------
@@ -516,7 +514,7 @@ def list_files(
Returns
-------
- SyncPager[FileInfo]
+ SyncPager[FileInfo, ListFilesResponse]
Successful Response
"""
_response = self._client_wrapper.httpx_client.request(
@@ -556,16 +554,14 @@ def list_files(
page_token=_parsed_next,
request_options=request_options,
)
- return SyncPager(
- has_next=_has_next, items=_items, get_next=_get_next, response=BaseHttpResponse(response=_response)
- )
+ return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -617,9 +613,9 @@ def mark_stage_failure(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -687,9 +683,9 @@ async def apply_tags(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -736,9 +732,9 @@ async def get(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -785,9 +781,9 @@ async def delete(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -812,7 +808,7 @@ async def list(
limit: typing.Optional[int] = 100,
include_internal_metadata: typing.Optional[bool] = False,
request_options: typing.Optional[RequestOptions] = None,
- ) -> AsyncPager[ArtifactVersion]:
+ ) -> AsyncPager[ArtifactVersion, ListArtifactVersionsResponse]:
"""
List artifact version API
@@ -845,7 +841,7 @@ async def list(
Returns
-------
- AsyncPager[ArtifactVersion]
+ AsyncPager[ArtifactVersion, ListArtifactVersionsResponse]
Successful Response
"""
offset = offset if offset is not None else 0
@@ -896,16 +892,14 @@ async def _get_next():
request_options=request_options,
)
- return AsyncPager(
- has_next=_has_next, items=_items, get_next=_get_next, response=BaseHttpResponse(response=_response)
- )
+ return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -968,9 +962,9 @@ async def get_signed_urls(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -1028,9 +1022,9 @@ async def create_multi_part_upload(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -1084,9 +1078,9 @@ async def stage(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -1104,7 +1098,7 @@ async def list_files(
limit: typing.Optional[int] = OMIT,
page_token: typing.Optional[str] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
- ) -> AsyncPager[FileInfo]:
+ ) -> AsyncPager[FileInfo, ListFilesResponse]:
"""
Parameters
----------
@@ -1121,7 +1115,7 @@ async def list_files(
Returns
-------
- AsyncPager[FileInfo]
+ AsyncPager[FileInfo, ListFilesResponse]
Successful Response
"""
_response = await self._client_wrapper.httpx_client.request(
@@ -1164,16 +1158,14 @@ async def _get_next():
request_options=request_options,
)
- return AsyncPager(
- has_next=_has_next, items=_items, get_next=_get_next, response=BaseHttpResponse(response=_response)
- )
+ return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -1225,9 +1217,9 @@ async def mark_stage_failure(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
diff --git a/src/truefoundry_sdk/artifacts/client.py b/src/truefoundry_sdk/artifacts/client.py
index b15fa60..6540a33 100644
--- a/src/truefoundry_sdk/artifacts/client.py
+++ b/src/truefoundry_sdk/artifacts/client.py
@@ -10,6 +10,7 @@
from ..types.empty_response import EmptyResponse
from ..types.get_artifact_response import GetArtifactResponse
from ..types.get_artifact_version_response import GetArtifactVersionResponse
+from ..types.list_artifacts_response import ListArtifactsResponse
from .raw_client import AsyncRawArtifactsClient, RawArtifactsClient
# this is used as the default value for optional parameters
@@ -98,8 +99,9 @@ def list(
offset: typing.Optional[int] = 0,
limit: typing.Optional[int] = 100,
run_id: typing.Optional[str] = None,
+ include_empty_artifacts: typing.Optional[bool] = True,
request_options: typing.Optional[RequestOptions] = None,
- ) -> SyncPager[Artifact]:
+ ) -> SyncPager[Artifact, ListArtifactsResponse]:
"""
Parameters
----------
@@ -115,12 +117,14 @@ def list(
run_id : typing.Optional[str]
+ include_empty_artifacts : typing.Optional[bool]
+
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
- SyncPager[Artifact]
+ SyncPager[Artifact, ListArtifactsResponse]
Successful Response
Examples
@@ -138,6 +142,7 @@ def list(
offset=1,
limit=1,
run_id="run_id",
+ include_empty_artifacts=True,
)
for item in response:
yield item
@@ -152,6 +157,7 @@ def list(
offset=offset,
limit=limit,
run_id=run_id,
+ include_empty_artifacts=include_empty_artifacts,
request_options=request_options,
)
@@ -294,8 +300,9 @@ async def list(
offset: typing.Optional[int] = 0,
limit: typing.Optional[int] = 100,
run_id: typing.Optional[str] = None,
+ include_empty_artifacts: typing.Optional[bool] = True,
request_options: typing.Optional[RequestOptions] = None,
- ) -> AsyncPager[Artifact]:
+ ) -> AsyncPager[Artifact, ListArtifactsResponse]:
"""
Parameters
----------
@@ -311,12 +318,14 @@ async def list(
run_id : typing.Optional[str]
+ include_empty_artifacts : typing.Optional[bool]
+
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
- AsyncPager[Artifact]
+ AsyncPager[Artifact, ListArtifactsResponse]
Successful Response
Examples
@@ -339,6 +348,7 @@ async def main() -> None:
offset=1,
limit=1,
run_id="run_id",
+ include_empty_artifacts=True,
)
async for item in response:
yield item
@@ -357,6 +367,7 @@ async def main() -> None:
offset=offset,
limit=limit,
run_id=run_id,
+ include_empty_artifacts=include_empty_artifacts,
request_options=request_options,
)
diff --git a/src/truefoundry_sdk/artifacts/raw_client.py b/src/truefoundry_sdk/artifacts/raw_client.py
index f0ff3fc..1160b1b 100644
--- a/src/truefoundry_sdk/artifacts/raw_client.py
+++ b/src/truefoundry_sdk/artifacts/raw_client.py
@@ -7,7 +7,7 @@
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from ..core.http_response import AsyncHttpResponse, HttpResponse
from ..core.jsonable_encoder import jsonable_encoder
-from ..core.pagination import AsyncPager, BaseHttpResponse, SyncPager
+from ..core.pagination import AsyncPager, SyncPager
from ..core.pydantic_utilities import parse_obj_as
from ..core.request_options import RequestOptions
from ..core.serialization import convert_and_respect_annotation_metadata
@@ -62,9 +62,9 @@ def get(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -109,9 +109,9 @@ def delete(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -130,8 +130,9 @@ def list(
offset: typing.Optional[int] = 0,
limit: typing.Optional[int] = 100,
run_id: typing.Optional[str] = None,
+ include_empty_artifacts: typing.Optional[bool] = True,
request_options: typing.Optional[RequestOptions] = None,
- ) -> SyncPager[Artifact]:
+ ) -> SyncPager[Artifact, ListArtifactsResponse]:
"""
Parameters
----------
@@ -147,12 +148,14 @@ def list(
run_id : typing.Optional[str]
+ include_empty_artifacts : typing.Optional[bool]
+
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
- SyncPager[Artifact]
+ SyncPager[Artifact, ListArtifactsResponse]
Successful Response
"""
offset = offset if offset is not None else 0
@@ -167,6 +170,7 @@ def list(
"offset": offset,
"limit": limit,
"run_id": run_id,
+ "include_empty_artifacts": include_empty_artifacts,
},
request_options=request_options,
)
@@ -188,18 +192,17 @@ def list(
offset=offset + len(_items),
limit=limit,
run_id=run_id,
+ include_empty_artifacts=include_empty_artifacts,
request_options=request_options,
)
- return SyncPager(
- has_next=_has_next, items=_items, get_next=_get_next, response=BaseHttpResponse(response=_response)
- )
+ return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -253,9 +256,9 @@ def create_or_update(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -305,9 +308,9 @@ async def get(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -352,9 +355,9 @@ async def delete(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -373,8 +376,9 @@ async def list(
offset: typing.Optional[int] = 0,
limit: typing.Optional[int] = 100,
run_id: typing.Optional[str] = None,
+ include_empty_artifacts: typing.Optional[bool] = True,
request_options: typing.Optional[RequestOptions] = None,
- ) -> AsyncPager[Artifact]:
+ ) -> AsyncPager[Artifact, ListArtifactsResponse]:
"""
Parameters
----------
@@ -390,12 +394,14 @@ async def list(
run_id : typing.Optional[str]
+ include_empty_artifacts : typing.Optional[bool]
+
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
- AsyncPager[Artifact]
+ AsyncPager[Artifact, ListArtifactsResponse]
Successful Response
"""
offset = offset if offset is not None else 0
@@ -410,6 +416,7 @@ async def list(
"offset": offset,
"limit": limit,
"run_id": run_id,
+ "include_empty_artifacts": include_empty_artifacts,
},
request_options=request_options,
)
@@ -433,19 +440,18 @@ async def _get_next():
offset=offset + len(_items),
limit=limit,
run_id=run_id,
+ include_empty_artifacts=include_empty_artifacts,
request_options=request_options,
)
- return AsyncPager(
- has_next=_has_next, items=_items, get_next=_get_next, response=BaseHttpResponse(response=_response)
- )
+ return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -499,9 +505,9 @@ async def create_or_update(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
diff --git a/src/truefoundry_sdk/base_client.py b/src/truefoundry_sdk/base_client.py
index 6ebf23b..d61d3af 100644
--- a/src/truefoundry_sdk/base_client.py
+++ b/src/truefoundry_sdk/base_client.py
@@ -108,14 +108,14 @@ def __init__(
self._teams: typing.Optional[TeamsClient] = None
self._personal_access_tokens: typing.Optional[PersonalAccessTokensClient] = None
self._virtual_accounts: typing.Optional[VirtualAccountsClient] = None
- self._secrets: typing.Optional[SecretsClient] = None
- self._secret_groups: typing.Optional[SecretGroupsClient] = None
self._clusters: typing.Optional[ClustersClient] = None
- self._environments: typing.Optional[EnvironmentsClient] = None
self._applications: typing.Optional[ApplicationsClient] = None
self._application_versions: typing.Optional[ApplicationVersionsClient] = None
self._jobs: typing.Optional[JobsClient] = None
self._workspaces: typing.Optional[WorkspacesClient] = None
+ self._environments: typing.Optional[EnvironmentsClient] = None
+ self._secrets: typing.Optional[SecretsClient] = None
+ self._secret_groups: typing.Optional[SecretGroupsClient] = None
self._events: typing.Optional[EventsClient] = None
self._alerts: typing.Optional[AlertsClient] = None
self._logs: typing.Optional[LogsClient] = None
@@ -272,22 +272,6 @@ def virtual_accounts(self):
self._virtual_accounts = VirtualAccountsClient(client_wrapper=self._client_wrapper)
return self._virtual_accounts
- @property
- def secrets(self):
- if self._secrets is None:
- from .secrets.client import SecretsClient # noqa: E402
-
- self._secrets = SecretsClient(client_wrapper=self._client_wrapper)
- return self._secrets
-
- @property
- def secret_groups(self):
- if self._secret_groups is None:
- from .secret_groups.client import SecretGroupsClient # noqa: E402
-
- self._secret_groups = SecretGroupsClient(client_wrapper=self._client_wrapper)
- return self._secret_groups
-
@property
def clusters(self):
if self._clusters is None:
@@ -296,14 +280,6 @@ def clusters(self):
self._clusters = ClustersClient(client_wrapper=self._client_wrapper)
return self._clusters
- @property
- def environments(self):
- if self._environments is None:
- from .environments.client import EnvironmentsClient # noqa: E402
-
- self._environments = EnvironmentsClient(client_wrapper=self._client_wrapper)
- return self._environments
-
@property
def applications(self):
if self._applications is None:
@@ -336,6 +312,30 @@ def workspaces(self):
self._workspaces = WorkspacesClient(client_wrapper=self._client_wrapper)
return self._workspaces
+ @property
+ def environments(self):
+ if self._environments is None:
+ from .environments.client import EnvironmentsClient # noqa: E402
+
+ self._environments = EnvironmentsClient(client_wrapper=self._client_wrapper)
+ return self._environments
+
+ @property
+ def secrets(self):
+ if self._secrets is None:
+ from .secrets.client import SecretsClient # noqa: E402
+
+ self._secrets = SecretsClient(client_wrapper=self._client_wrapper)
+ return self._secrets
+
+ @property
+ def secret_groups(self):
+ if self._secret_groups is None:
+ from .secret_groups.client import SecretGroupsClient # noqa: E402
+
+ self._secret_groups = SecretGroupsClient(client_wrapper=self._client_wrapper)
+ return self._secret_groups
+
@property
def events(self):
if self._events is None:
@@ -497,14 +497,14 @@ def __init__(
self._teams: typing.Optional[AsyncTeamsClient] = None
self._personal_access_tokens: typing.Optional[AsyncPersonalAccessTokensClient] = None
self._virtual_accounts: typing.Optional[AsyncVirtualAccountsClient] = None
- self._secrets: typing.Optional[AsyncSecretsClient] = None
- self._secret_groups: typing.Optional[AsyncSecretGroupsClient] = None
self._clusters: typing.Optional[AsyncClustersClient] = None
- self._environments: typing.Optional[AsyncEnvironmentsClient] = None
self._applications: typing.Optional[AsyncApplicationsClient] = None
self._application_versions: typing.Optional[AsyncApplicationVersionsClient] = None
self._jobs: typing.Optional[AsyncJobsClient] = None
self._workspaces: typing.Optional[AsyncWorkspacesClient] = None
+ self._environments: typing.Optional[AsyncEnvironmentsClient] = None
+ self._secrets: typing.Optional[AsyncSecretsClient] = None
+ self._secret_groups: typing.Optional[AsyncSecretGroupsClient] = None
self._events: typing.Optional[AsyncEventsClient] = None
self._alerts: typing.Optional[AsyncAlertsClient] = None
self._logs: typing.Optional[AsyncLogsClient] = None
@@ -677,22 +677,6 @@ def virtual_accounts(self):
self._virtual_accounts = AsyncVirtualAccountsClient(client_wrapper=self._client_wrapper)
return self._virtual_accounts
- @property
- def secrets(self):
- if self._secrets is None:
- from .secrets.client import AsyncSecretsClient # noqa: E402
-
- self._secrets = AsyncSecretsClient(client_wrapper=self._client_wrapper)
- return self._secrets
-
- @property
- def secret_groups(self):
- if self._secret_groups is None:
- from .secret_groups.client import AsyncSecretGroupsClient # noqa: E402
-
- self._secret_groups = AsyncSecretGroupsClient(client_wrapper=self._client_wrapper)
- return self._secret_groups
-
@property
def clusters(self):
if self._clusters is None:
@@ -701,14 +685,6 @@ def clusters(self):
self._clusters = AsyncClustersClient(client_wrapper=self._client_wrapper)
return self._clusters
- @property
- def environments(self):
- if self._environments is None:
- from .environments.client import AsyncEnvironmentsClient # noqa: E402
-
- self._environments = AsyncEnvironmentsClient(client_wrapper=self._client_wrapper)
- return self._environments
-
@property
def applications(self):
if self._applications is None:
@@ -741,6 +717,30 @@ def workspaces(self):
self._workspaces = AsyncWorkspacesClient(client_wrapper=self._client_wrapper)
return self._workspaces
+ @property
+ def environments(self):
+ if self._environments is None:
+ from .environments.client import AsyncEnvironmentsClient # noqa: E402
+
+ self._environments = AsyncEnvironmentsClient(client_wrapper=self._client_wrapper)
+ return self._environments
+
+ @property
+ def secrets(self):
+ if self._secrets is None:
+ from .secrets.client import AsyncSecretsClient # noqa: E402
+
+ self._secrets = AsyncSecretsClient(client_wrapper=self._client_wrapper)
+ return self._secrets
+
+ @property
+ def secret_groups(self):
+ if self._secret_groups is None:
+ from .secret_groups.client import AsyncSecretGroupsClient # noqa: E402
+
+ self._secret_groups = AsyncSecretGroupsClient(client_wrapper=self._client_wrapper)
+ return self._secret_groups
+
@property
def events(self):
if self._events is None:
diff --git a/src/truefoundry_sdk/clusters/client.py b/src/truefoundry_sdk/clusters/client.py
index 7e64508..5311320 100644
--- a/src/truefoundry_sdk/clusters/client.py
+++ b/src/truefoundry_sdk/clusters/client.py
@@ -10,6 +10,7 @@
from ..types.get_cluster_response import GetClusterResponse
from ..types.is_cluster_connected_response import IsClusterConnectedResponse
from ..types.list_cluster_addons_response import ListClusterAddonsResponse
+from ..types.list_clusters_response import ListClustersResponse
from .raw_client import AsyncRawClustersClient, RawClustersClient
from .types.clusters_delete_response import ClustersDeleteResponse
@@ -38,7 +39,7 @@ def list(
limit: typing.Optional[int] = 100,
offset: typing.Optional[int] = 0,
request_options: typing.Optional[RequestOptions] = None,
- ) -> SyncPager[Cluster]:
+ ) -> SyncPager[Cluster, ListClustersResponse]:
"""
Retrieves a list of all latest Clusters. Pagination is available based on query parameters.
@@ -55,7 +56,7 @@ def list(
Returns
-------
- SyncPager[Cluster]
+ SyncPager[Cluster, ListClustersResponse]
Retrieve latest Clusters. If pagination parameters are provided, the response includes paginated data.
Examples
@@ -303,7 +304,7 @@ async def list(
limit: typing.Optional[int] = 100,
offset: typing.Optional[int] = 0,
request_options: typing.Optional[RequestOptions] = None,
- ) -> AsyncPager[Cluster]:
+ ) -> AsyncPager[Cluster, ListClustersResponse]:
"""
Retrieves a list of all latest Clusters. Pagination is available based on query parameters.
@@ -320,7 +321,7 @@ async def list(
Returns
-------
- AsyncPager[Cluster]
+ AsyncPager[Cluster, ListClustersResponse]
Retrieve latest Clusters. If pagination parameters are provided, the response includes paginated data.
Examples
diff --git a/src/truefoundry_sdk/clusters/raw_client.py b/src/truefoundry_sdk/clusters/raw_client.py
index e9d70af..df051ad 100644
--- a/src/truefoundry_sdk/clusters/raw_client.py
+++ b/src/truefoundry_sdk/clusters/raw_client.py
@@ -7,7 +7,7 @@
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from ..core.http_response import AsyncHttpResponse, HttpResponse
from ..core.jsonable_encoder import jsonable_encoder
-from ..core.pagination import AsyncPager, BaseHttpResponse, SyncPager
+from ..core.pagination import AsyncPager, SyncPager
from ..core.pydantic_utilities import parse_obj_as
from ..core.request_options import RequestOptions
from ..core.serialization import convert_and_respect_annotation_metadata
@@ -38,7 +38,7 @@ def list(
limit: typing.Optional[int] = 100,
offset: typing.Optional[int] = 0,
request_options: typing.Optional[RequestOptions] = None,
- ) -> SyncPager[Cluster]:
+ ) -> SyncPager[Cluster, ListClustersResponse]:
"""
Retrieves a list of all latest Clusters. Pagination is available based on query parameters.
@@ -55,7 +55,7 @@ def list(
Returns
-------
- SyncPager[Cluster]
+ SyncPager[Cluster, ListClustersResponse]
Retrieve latest Clusters. If pagination parameters are provided, the response includes paginated data.
"""
offset = offset if offset is not None else 0
@@ -85,9 +85,7 @@ def list(
offset=offset + len(_items),
request_options=request_options,
)
- return SyncPager(
- has_next=_has_next, items=_items, get_next=_get_next, response=BaseHttpResponse(response=_response)
- )
+ return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
if _response.status_code == 401:
raise UnauthorizedError(
headers=dict(_response.headers),
@@ -181,9 +179,9 @@ def create_or_update(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -242,9 +240,9 @@ def get(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -303,9 +301,9 @@ def delete(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -379,9 +377,9 @@ def get_addons(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -452,7 +450,7 @@ async def list(
limit: typing.Optional[int] = 100,
offset: typing.Optional[int] = 0,
request_options: typing.Optional[RequestOptions] = None,
- ) -> AsyncPager[Cluster]:
+ ) -> AsyncPager[Cluster, ListClustersResponse]:
"""
Retrieves a list of all latest Clusters. Pagination is available based on query parameters.
@@ -469,7 +467,7 @@ async def list(
Returns
-------
- AsyncPager[Cluster]
+ AsyncPager[Cluster, ListClustersResponse]
Retrieve latest Clusters. If pagination parameters are provided, the response includes paginated data.
"""
offset = offset if offset is not None else 0
@@ -502,9 +500,7 @@ async def _get_next():
request_options=request_options,
)
- return AsyncPager(
- has_next=_has_next, items=_items, get_next=_get_next, response=BaseHttpResponse(response=_response)
- )
+ return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
if _response.status_code == 401:
raise UnauthorizedError(
headers=dict(_response.headers),
@@ -598,9 +594,9 @@ async def create_or_update(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -659,9 +655,9 @@ async def get(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -720,9 +716,9 @@ async def delete(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -796,9 +792,9 @@ async def get_addons(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
diff --git a/src/truefoundry_sdk/core/__init__.py b/src/truefoundry_sdk/core/__init__.py
index bfce76d..3b5240a 100644
--- a/src/truefoundry_sdk/core/__init__.py
+++ b/src/truefoundry_sdk/core/__init__.py
@@ -8,6 +8,7 @@
if typing.TYPE_CHECKING:
from .api_error import ApiError
from .client_wrapper import AsyncClientWrapper, BaseClientWrapper, SyncClientWrapper
+ from .custom_pagination import AsyncCustomPager, SyncCustomPager
from .datetime_utils import serialize_datetime
from .file import File, convert_file_dict_to_httpx_tuples, with_content_type
from .http_client import AsyncHttpClient, HttpClient
@@ -30,6 +31,7 @@
_dynamic_imports: typing.Dict[str, str] = {
"ApiError": ".api_error",
"AsyncClientWrapper": ".client_wrapper",
+ "AsyncCustomPager": ".custom_pagination",
"AsyncHttpClient": ".http_client",
"AsyncHttpResponse": ".http_response",
"AsyncPager": ".pagination",
@@ -41,6 +43,7 @@
"IS_PYDANTIC_V2": ".pydantic_utilities",
"RequestOptions": ".request_options",
"SyncClientWrapper": ".client_wrapper",
+ "SyncCustomPager": ".custom_pagination",
"SyncPager": ".pagination",
"UniversalBaseModel": ".pydantic_utilities",
"UniversalRootModel": ".pydantic_utilities",
@@ -82,6 +85,7 @@ def __dir__():
__all__ = [
"ApiError",
"AsyncClientWrapper",
+ "AsyncCustomPager",
"AsyncHttpClient",
"AsyncHttpResponse",
"AsyncPager",
@@ -93,6 +97,7 @@ def __dir__():
"IS_PYDANTIC_V2",
"RequestOptions",
"SyncClientWrapper",
+ "SyncCustomPager",
"SyncPager",
"UniversalBaseModel",
"UniversalRootModel",
diff --git a/src/truefoundry_sdk/core/client_wrapper.py b/src/truefoundry_sdk/core/client_wrapper.py
index 9f70bb2..6cec980 100644
--- a/src/truefoundry_sdk/core/client_wrapper.py
+++ b/src/truefoundry_sdk/core/client_wrapper.py
@@ -74,12 +74,22 @@ def __init__(
headers: typing.Optional[typing.Dict[str, str]] = None,
base_url: str,
timeout: typing.Optional[float] = None,
+ async_token: typing.Optional[typing.Callable[[], typing.Awaitable[str]]] = None,
httpx_client: httpx.AsyncClient,
):
super().__init__(api_key=api_key, headers=headers, base_url=base_url, timeout=timeout)
+ self._async_token = async_token
self.httpx_client = AsyncHttpClient(
httpx_client=httpx_client,
base_headers=self.get_headers,
base_timeout=self.get_timeout,
base_url=self.get_base_url,
+ async_base_headers=self.async_get_headers,
)
+
+ async def async_get_headers(self) -> typing.Dict[str, str]:
+ headers = self.get_headers()
+ if self._async_token is not None:
+ token = await self._async_token()
+ headers["Authorization"] = f"Bearer {token}"
+ return headers
diff --git a/src/truefoundry_sdk/core/custom_pagination.py b/src/truefoundry_sdk/core/custom_pagination.py
new file mode 100644
index 0000000..5de2c7a
--- /dev/null
+++ b/src/truefoundry_sdk/core/custom_pagination.py
@@ -0,0 +1,152 @@
+# This file was auto-generated by Fern from our API Definition.
+
+"""
+Custom Pagination Support
+
+This file is designed to be modified by SDK users to implement their own
+pagination logic. The generator will import SyncCustomPager and AsyncCustomPager
+from this module when custom pagination is used.
+
+Users should:
+1. Implement their custom pager (e.g., PayrocPager, MyCustomPager, etc.)
+2. Create adapter classes (SyncCustomPager/AsyncCustomPager) that bridge
+ between the generated SDK code and their custom pager implementation
+"""
+
+from __future__ import annotations
+
+from typing import Any, AsyncIterator, Generic, Iterator, TypeVar
+
+# Import the base utilities you'll need
+# Adjust these imports based on your actual structure
+try:
+ from .client_wrapper import AsyncClientWrapper, SyncClientWrapper
+except ImportError:
+ # Fallback for type hints
+ AsyncClientWrapper = Any # type: ignore
+ SyncClientWrapper = Any # type: ignore
+
+TItem = TypeVar("TItem")
+TResponse = TypeVar("TResponse")
+
+
+class SyncCustomPager(Generic[TItem, TResponse]):
+ """
+ Adapter for custom synchronous pagination.
+
+ The generator will call this with:
+ SyncCustomPager(initial_response=response, client_wrapper=client_wrapper)
+
+ Implement this class to extract pagination metadata from your response
+ and delegate to your custom pager implementation.
+
+ Example implementation:
+
+ class SyncCustomPager(Generic[TItem, TResponse]):
+ def __init__(
+ self,
+ *,
+ initial_response: TResponse,
+ client_wrapper: SyncClientWrapper,
+ ):
+ # Extract data and pagination metadata from response
+ data = initial_response.data # Adjust based on your response structure
+ links = initial_response.links
+
+ # Initialize your custom pager
+ self._pager = MyCustomPager(
+ current_page=Page(data),
+ httpx_client=client_wrapper.httpx_client,
+ get_headers=client_wrapper.get_headers,
+ # ... other parameters
+ )
+
+ def __iter__(self):
+ return iter(self._pager)
+
+ # Delegate other methods to your pager...
+ """
+
+ def __init__(
+ self,
+ *,
+ initial_response: TResponse,
+ client_wrapper: SyncClientWrapper,
+ ):
+ """
+ Initialize the custom pager.
+
+ Args:
+ initial_response: The parsed API response from the first request
+ client_wrapper: The client wrapper providing HTTP client and utilities
+ """
+ raise NotImplementedError(
+ "SyncCustomPager must be implemented. "
+ "Please implement this class in core/custom_pagination.py to define your pagination logic. "
+ "See the class docstring for examples."
+ )
+
+ def __iter__(self) -> Iterator[TItem]:
+ """Iterate through all items across all pages."""
+ raise NotImplementedError("Must implement __iter__ method")
+
+
+class AsyncCustomPager(Generic[TItem, TResponse]):
+ """
+ Adapter for custom asynchronous pagination.
+
+ The generator will call this with:
+ AsyncCustomPager(initial_response=response, client_wrapper=client_wrapper)
+
+ Implement this class to extract pagination metadata from your response
+ and delegate to your custom async pager implementation.
+
+ Example implementation:
+
+ class AsyncCustomPager(Generic[TItem, TResponse]):
+ def __init__(
+ self,
+ *,
+ initial_response: TResponse,
+ client_wrapper: AsyncClientWrapper,
+ ):
+ # Extract data and pagination metadata from response
+ data = initial_response.data # Adjust based on your response structure
+ links = initial_response.links
+
+ # Initialize your custom async pager
+ self._pager = MyAsyncCustomPager(
+ current_page=Page(data),
+ httpx_client=client_wrapper.httpx_client,
+ get_headers=client_wrapper.get_headers,
+ # ... other parameters
+ )
+
+ async def __aiter__(self):
+ return self._pager.__aiter__()
+
+ # Delegate other methods to your pager...
+ """
+
+ def __init__(
+ self,
+ *,
+ initial_response: TResponse,
+ client_wrapper: AsyncClientWrapper,
+ ):
+ """
+ Initialize the custom async pager.
+
+ Args:
+ initial_response: The parsed API response from the first request
+ client_wrapper: The client wrapper providing HTTP client and utilities
+ """
+ raise NotImplementedError(
+ "AsyncCustomPager must be implemented. "
+ "Please implement this class in core/custom_pagination.py to define your pagination logic. "
+ "See the class docstring for examples."
+ )
+
+ async def __aiter__(self) -> AsyncIterator[TItem]:
+ """Asynchronously iterate through all items across all pages."""
+ raise NotImplementedError("Must implement __aiter__ method")
diff --git a/src/truefoundry_sdk/core/enum.py b/src/truefoundry_sdk/core/enum.py
new file mode 100644
index 0000000..a3d17a6
--- /dev/null
+++ b/src/truefoundry_sdk/core/enum.py
@@ -0,0 +1,20 @@
+# This file was auto-generated by Fern from our API Definition.
+
+"""
+Provides a StrEnum base class that works across Python versions.
+
+For Python >= 3.11, this re-exports the standard library enum.StrEnum.
+For older Python versions, this defines a compatible StrEnum using the
+(str, Enum) mixin pattern so that generated SDKs can use a single base
+class in all supported Python versions.
+"""
+
+import enum
+import sys
+
+if sys.version_info >= (3, 11):
+ from enum import StrEnum
+else:
+
+ class StrEnum(str, enum.Enum):
+ pass
diff --git a/src/truefoundry_sdk/core/http_client.py b/src/truefoundry_sdk/core/http_client.py
index e4173f9..f4a7c07 100644
--- a/src/truefoundry_sdk/core/http_client.py
+++ b/src/truefoundry_sdk/core/http_client.py
@@ -14,13 +14,13 @@
from .force_multipart import FORCE_MULTIPART
from .jsonable_encoder import jsonable_encoder
from .query_encoder import encode_query
-from .remove_none_from_dict import remove_none_from_dict
+from .remove_none_from_dict import remove_none_from_dict as remove_none_from_dict
from .request_options import RequestOptions
from httpx._types import RequestFiles
-INITIAL_RETRY_DELAY_SECONDS = 0.5
-MAX_RETRY_DELAY_SECONDS = 10
-MAX_RETRY_DELAY_SECONDS_FROM_HEADER = 30
+INITIAL_RETRY_DELAY_SECONDS = 1.0
+MAX_RETRY_DELAY_SECONDS = 60.0
+JITTER_FACTOR = 0.2 # 20% random jitter
def _parse_retry_after(response_headers: httpx.Headers) -> typing.Optional[float]:
@@ -64,6 +64,38 @@ def _parse_retry_after(response_headers: httpx.Headers) -> typing.Optional[float
return seconds
+def _add_positive_jitter(delay: float) -> float:
+ """Add positive jitter (0-20%) to prevent thundering herd."""
+ jitter_multiplier = 1 + random() * JITTER_FACTOR
+ return delay * jitter_multiplier
+
+
+def _add_symmetric_jitter(delay: float) -> float:
+ """Add symmetric jitter (±10%) for exponential backoff."""
+ jitter_multiplier = 1 + (random() - 0.5) * JITTER_FACTOR
+ return delay * jitter_multiplier
+
+
+def _parse_x_ratelimit_reset(response_headers: httpx.Headers) -> typing.Optional[float]:
+ """
+ Parse the X-RateLimit-Reset header (Unix timestamp in seconds).
+ Returns seconds to wait, or None if header is missing/invalid.
+ """
+ reset_time_str = response_headers.get("x-ratelimit-reset")
+ if reset_time_str is None:
+ return None
+
+ try:
+ reset_time = int(reset_time_str)
+ delay = reset_time - time.time()
+ if delay > 0:
+ return delay
+ except (ValueError, TypeError):
+ pass
+
+ return None
+
+
def _retry_timeout(response: httpx.Response, retries: int) -> float:
"""
Determine the amount of time to wait before retrying a request.
@@ -71,17 +103,19 @@ def _retry_timeout(response: httpx.Response, retries: int) -> float:
with a jitter to determine the number of seconds to wait.
"""
- # If the API asks us to wait a certain amount of time (and it's a reasonable amount), just do what it says.
+ # 1. Check Retry-After header first
retry_after = _parse_retry_after(response.headers)
- if retry_after is not None and retry_after <= MAX_RETRY_DELAY_SECONDS_FROM_HEADER:
- return retry_after
+ if retry_after is not None and retry_after > 0:
+ return min(retry_after, MAX_RETRY_DELAY_SECONDS)
- # Apply exponential backoff, capped at MAX_RETRY_DELAY_SECONDS.
- retry_delay = min(INITIAL_RETRY_DELAY_SECONDS * pow(2.0, retries), MAX_RETRY_DELAY_SECONDS)
+ # 2. Check X-RateLimit-Reset header (with positive jitter)
+ ratelimit_reset = _parse_x_ratelimit_reset(response.headers)
+ if ratelimit_reset is not None:
+ return _add_positive_jitter(min(ratelimit_reset, MAX_RETRY_DELAY_SECONDS))
- # Add a randomness / jitter to the retry delay to avoid overwhelming the server with retries.
- timeout = retry_delay * (1 - 0.25 * random())
- return timeout if timeout >= 0 else 0
+ # 3. Fall back to exponential backoff (with symmetric jitter)
+ backoff = min(INITIAL_RETRY_DELAY_SECONDS * pow(2.0, retries), MAX_RETRY_DELAY_SECONDS)
+ return _add_symmetric_jitter(backoff)
def _should_retry(response: httpx.Response) -> bool:
@@ -89,6 +123,21 @@ def _should_retry(response: httpx.Response) -> bool:
return response.status_code >= 500 or response.status_code in retryable_400s
+def _maybe_filter_none_from_multipart_data(
+ data: typing.Optional[typing.Any],
+ request_files: typing.Optional[RequestFiles],
+ force_multipart: typing.Optional[bool],
+) -> typing.Optional[typing.Any]:
+ """
+ Filter None values from data body for multipart/form requests.
+ This prevents httpx from converting None to empty strings in multipart encoding.
+ Only applies when files are present or force_multipart is True.
+ """
+ if data is not None and isinstance(data, typing.Mapping) and (request_files or force_multipart):
+ return remove_none_from_dict(data)
+ return data
+
+
def remove_omit_from_dict(
original: typing.Dict[str, typing.Optional[typing.Any]],
omit: typing.Optional[typing.Any],
@@ -210,6 +259,8 @@ def request(
if (request_files is None or len(request_files) == 0) and force_multipart:
request_files = FORCE_MULTIPART
+ data_body = _maybe_filter_none_from_multipart_data(data_body, request_files, force_multipart)
+
response = self.httpx_client.request(
method=method,
url=urllib.parse.urljoin(f"{base_url}/", path),
@@ -307,6 +358,8 @@ def stream(
json_body, data_body = get_request_body(json=json, data=data, request_options=request_options, omit=omit)
+ data_body = _maybe_filter_none_from_multipart_data(data_body, request_files, force_multipart)
+
with self.httpx_client.stream(
method=method,
url=urllib.parse.urljoin(f"{base_url}/", path),
@@ -353,12 +406,19 @@ def __init__(
base_timeout: typing.Callable[[], typing.Optional[float]],
base_headers: typing.Callable[[], typing.Dict[str, str]],
base_url: typing.Optional[typing.Callable[[], str]] = None,
+ async_base_headers: typing.Optional[typing.Callable[[], typing.Awaitable[typing.Dict[str, str]]]] = None,
):
self.base_url = base_url
self.base_timeout = base_timeout
self.base_headers = base_headers
+ self.async_base_headers = async_base_headers
self.httpx_client = httpx_client
+ async def _get_headers(self) -> typing.Dict[str, str]:
+ if self.async_base_headers is not None:
+ return await self.async_base_headers()
+ return self.base_headers()
+
def get_base_url(self, maybe_base_url: typing.Optional[str]) -> str:
base_url = maybe_base_url
if self.base_url is not None and base_url is None:
@@ -408,6 +468,11 @@ async def request(
json_body, data_body = get_request_body(json=json, data=data, request_options=request_options, omit=omit)
+ data_body = _maybe_filter_none_from_multipart_data(data_body, request_files, force_multipart)
+
+ # Get headers (supports async token providers)
+ _headers = await self._get_headers()
+
# Add the input to each of these and do None-safety checks
response = await self.httpx_client.request(
method=method,
@@ -415,7 +480,7 @@ async def request(
headers=jsonable_encoder(
remove_none_from_dict(
{
- **self.base_headers(),
+ **_headers,
**(headers if headers is not None else {}),
**(request_options.get("additional_headers", {}) or {} if request_options is not None else {}),
}
@@ -505,13 +570,18 @@ async def stream(
json_body, data_body = get_request_body(json=json, data=data, request_options=request_options, omit=omit)
+ data_body = _maybe_filter_none_from_multipart_data(data_body, request_files, force_multipart)
+
+ # Get headers (supports async token providers)
+ _headers = await self._get_headers()
+
async with self.httpx_client.stream(
method=method,
url=urllib.parse.urljoin(f"{base_url}/", path),
headers=jsonable_encoder(
remove_none_from_dict(
{
- **self.base_headers(),
+ **_headers,
**(headers if headers is not None else {}),
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
}
diff --git a/src/truefoundry_sdk/core/pagination.py b/src/truefoundry_sdk/core/pagination.py
index 97bcb64..760b089 100644
--- a/src/truefoundry_sdk/core/pagination.py
+++ b/src/truefoundry_sdk/core/pagination.py
@@ -5,10 +5,10 @@
from dataclasses import dataclass
from typing import AsyncIterator, Awaitable, Callable, Generic, Iterator, List, Optional, TypeVar
-from .http_response import BaseHttpResponse
-
# Generic to represent the underlying type of the results within a page
T = TypeVar("T")
+# Generic to represent the type of the API response
+R = TypeVar("R")
# SDKs implement a Page ABC per-pagination request, the endpoint then returns a pager that wraps this type
@@ -23,11 +23,11 @@
@dataclass(frozen=True)
-class SyncPager(Generic[T]):
- get_next: Optional[Callable[[], Optional[SyncPager[T]]]]
+class SyncPager(Generic[T, R]):
+ get_next: Optional[Callable[[], Optional[SyncPager[T, R]]]]
has_next: bool
items: Optional[List[T]]
- response: Optional[BaseHttpResponse]
+ response: R
# Here we type ignore the iterator to avoid a mypy error
# caused by the type conflict with Pydanitc's __iter__ method
@@ -37,8 +37,8 @@ def __iter__(self) -> Iterator[T]: # type: ignore[override]
if page.items is not None:
yield from page.items
- def iter_pages(self) -> Iterator[SyncPager[T]]:
- page: Optional[SyncPager[T]] = self
+ def iter_pages(self) -> Iterator[SyncPager[T, R]]:
+ page: Optional[SyncPager[T, R]] = self
while page is not None:
yield page
@@ -49,16 +49,16 @@ def iter_pages(self) -> Iterator[SyncPager[T]]:
if page is None or page.items is None or len(page.items) == 0:
return
- def next_page(self) -> Optional[SyncPager[T]]:
+ def next_page(self) -> Optional[SyncPager[T, R]]:
return self.get_next() if self.get_next is not None else None
@dataclass(frozen=True)
-class AsyncPager(Generic[T]):
- get_next: Optional[Callable[[], Awaitable[Optional[AsyncPager[T]]]]]
+class AsyncPager(Generic[T, R]):
+ get_next: Optional[Callable[[], Awaitable[Optional[AsyncPager[T, R]]]]]
has_next: bool
items: Optional[List[T]]
- response: Optional[BaseHttpResponse]
+ response: R
async def __aiter__(self) -> AsyncIterator[T]:
async for page in self.iter_pages():
@@ -66,8 +66,8 @@ async def __aiter__(self) -> AsyncIterator[T]:
for item in page.items:
yield item
- async def iter_pages(self) -> AsyncIterator[AsyncPager[T]]:
- page: Optional[AsyncPager[T]] = self
+ async def iter_pages(self) -> AsyncIterator[AsyncPager[T, R]]:
+ page: Optional[AsyncPager[T, R]] = self
while page is not None:
yield page
@@ -78,5 +78,5 @@ async def iter_pages(self) -> AsyncIterator[AsyncPager[T]]:
if page is None or page.items is None or len(page.items) == 0:
return
- async def next_page(self) -> Optional[AsyncPager[T]]:
+ async def next_page(self) -> Optional[AsyncPager[T, R]]:
return await self.get_next() if self.get_next is not None else None
diff --git a/src/truefoundry_sdk/data_directories/client.py b/src/truefoundry_sdk/data_directories/client.py
index 39fb1d5..d3a58fc 100644
--- a/src/truefoundry_sdk/data_directories/client.py
+++ b/src/truefoundry_sdk/data_directories/client.py
@@ -11,6 +11,8 @@
from ..types.file_info import FileInfo
from ..types.get_data_directory_response import GetDataDirectoryResponse
from ..types.get_signed_ur_ls_response import GetSignedUrLsResponse
+from ..types.list_data_directories_response import ListDataDirectoriesResponse
+from ..types.list_files_response import ListFilesResponse
from ..types.multi_part_upload_response import MultiPartUploadResponse
from ..types.operation import Operation
from .raw_client import AsyncRawDataDirectoriesClient, RawDataDirectoriesClient
@@ -129,7 +131,7 @@ def list(
limit: typing.Optional[int] = 100,
offset: typing.Optional[int] = 0,
request_options: typing.Optional[RequestOptions] = None,
- ) -> SyncPager[DataDirectory]:
+ ) -> SyncPager[DataDirectory, ListDataDirectoriesResponse]:
"""
List all data directories with optional filtering and pagination.
@@ -161,7 +163,7 @@ def list(
Returns
-------
- SyncPager[DataDirectory]
+ SyncPager[DataDirectory, ListDataDirectoriesResponse]
Successful Response
Examples
@@ -237,7 +239,7 @@ def list_files(
limit: typing.Optional[int] = OMIT,
page_token: typing.Optional[str] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
- ) -> SyncPager[FileInfo]:
+ ) -> SyncPager[FileInfo, ListFilesResponse]:
"""
List files in a dataset.
@@ -263,7 +265,7 @@ def list_files(
Returns
-------
- SyncPager[FileInfo]
+ SyncPager[FileInfo, ListFilesResponse]
Successful Response
Examples
@@ -560,7 +562,7 @@ async def list(
limit: typing.Optional[int] = 100,
offset: typing.Optional[int] = 0,
request_options: typing.Optional[RequestOptions] = None,
- ) -> AsyncPager[DataDirectory]:
+ ) -> AsyncPager[DataDirectory, ListDataDirectoriesResponse]:
"""
List all data directories with optional filtering and pagination.
@@ -592,7 +594,7 @@ async def list(
Returns
-------
- AsyncPager[DataDirectory]
+ AsyncPager[DataDirectory, ListDataDirectoriesResponse]
Successful Response
Examples
@@ -685,7 +687,7 @@ async def list_files(
limit: typing.Optional[int] = OMIT,
page_token: typing.Optional[str] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
- ) -> AsyncPager[FileInfo]:
+ ) -> AsyncPager[FileInfo, ListFilesResponse]:
"""
List files in a dataset.
@@ -711,7 +713,7 @@ async def list_files(
Returns
-------
- AsyncPager[FileInfo]
+ AsyncPager[FileInfo, ListFilesResponse]
Successful Response
Examples
diff --git a/src/truefoundry_sdk/data_directories/raw_client.py b/src/truefoundry_sdk/data_directories/raw_client.py
index f0e938a..9c3190f 100644
--- a/src/truefoundry_sdk/data_directories/raw_client.py
+++ b/src/truefoundry_sdk/data_directories/raw_client.py
@@ -7,7 +7,7 @@
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from ..core.http_response import AsyncHttpResponse, HttpResponse
from ..core.jsonable_encoder import jsonable_encoder
-from ..core.pagination import AsyncPager, BaseHttpResponse, SyncPager
+from ..core.pagination import AsyncPager, SyncPager
from ..core.pydantic_utilities import parse_obj_as
from ..core.request_options import RequestOptions
from ..core.serialization import convert_and_respect_annotation_metadata
@@ -75,9 +75,9 @@ def get(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -141,9 +141,9 @@ def delete(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -162,7 +162,7 @@ def list(
limit: typing.Optional[int] = 100,
offset: typing.Optional[int] = 0,
request_options: typing.Optional[RequestOptions] = None,
- ) -> SyncPager[DataDirectory]:
+ ) -> SyncPager[DataDirectory, ListDataDirectoriesResponse]:
"""
List all data directories with optional filtering and pagination.
@@ -194,7 +194,7 @@ def list(
Returns
-------
- SyncPager[DataDirectory]
+ SyncPager[DataDirectory, ListDataDirectoriesResponse]
Successful Response
"""
offset = offset if offset is not None else 0
@@ -230,16 +230,14 @@ def list(
offset=offset + len(_items),
request_options=request_options,
)
- return SyncPager(
- has_next=_has_next, items=_items, get_next=_get_next, response=BaseHttpResponse(response=_response)
- )
+ return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -293,9 +291,9 @@ def create_or_update(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -313,7 +311,7 @@ def list_files(
limit: typing.Optional[int] = OMIT,
page_token: typing.Optional[str] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
- ) -> SyncPager[FileInfo]:
+ ) -> SyncPager[FileInfo, ListFilesResponse]:
"""
List files in a dataset.
@@ -339,7 +337,7 @@ def list_files(
Returns
-------
- SyncPager[FileInfo]
+ SyncPager[FileInfo, ListFilesResponse]
Successful Response
"""
_response = self._client_wrapper.httpx_client.request(
@@ -379,16 +377,14 @@ def list_files(
page_token=_parsed_next,
request_options=request_options,
)
- return SyncPager(
- has_next=_has_next, items=_items, get_next=_get_next, response=BaseHttpResponse(response=_response)
- )
+ return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -452,9 +448,9 @@ def delete_files(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -526,9 +522,9 @@ def get_signed_urls(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -595,9 +591,9 @@ def create_multipart_upload(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -656,9 +652,9 @@ async def get(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -722,9 +718,9 @@ async def delete(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -743,7 +739,7 @@ async def list(
limit: typing.Optional[int] = 100,
offset: typing.Optional[int] = 0,
request_options: typing.Optional[RequestOptions] = None,
- ) -> AsyncPager[DataDirectory]:
+ ) -> AsyncPager[DataDirectory, ListDataDirectoriesResponse]:
"""
List all data directories with optional filtering and pagination.
@@ -775,7 +771,7 @@ async def list(
Returns
-------
- AsyncPager[DataDirectory]
+ AsyncPager[DataDirectory, ListDataDirectoriesResponse]
Successful Response
"""
offset = offset if offset is not None else 0
@@ -814,16 +810,14 @@ async def _get_next():
request_options=request_options,
)
- return AsyncPager(
- has_next=_has_next, items=_items, get_next=_get_next, response=BaseHttpResponse(response=_response)
- )
+ return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -877,9 +871,9 @@ async def create_or_update(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -897,7 +891,7 @@ async def list_files(
limit: typing.Optional[int] = OMIT,
page_token: typing.Optional[str] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
- ) -> AsyncPager[FileInfo]:
+ ) -> AsyncPager[FileInfo, ListFilesResponse]:
"""
List files in a dataset.
@@ -923,7 +917,7 @@ async def list_files(
Returns
-------
- AsyncPager[FileInfo]
+ AsyncPager[FileInfo, ListFilesResponse]
Successful Response
"""
_response = await self._client_wrapper.httpx_client.request(
@@ -966,16 +960,14 @@ async def _get_next():
request_options=request_options,
)
- return AsyncPager(
- has_next=_has_next, items=_items, get_next=_get_next, response=BaseHttpResponse(response=_response)
- )
+ return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -1039,9 +1031,9 @@ async def delete_files(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -1113,9 +1105,9 @@ async def get_signed_urls(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -1182,9 +1174,9 @@ async def create_multipart_upload(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
diff --git a/src/truefoundry_sdk/environments/client.py b/src/truefoundry_sdk/environments/client.py
index cd4a712..0718d42 100644
--- a/src/truefoundry_sdk/environments/client.py
+++ b/src/truefoundry_sdk/environments/client.py
@@ -8,6 +8,7 @@
from ..types.environment import Environment
from ..types.environment_manifest import EnvironmentManifest
from ..types.get_environment_response import GetEnvironmentResponse
+from ..types.list_environments_response import ListEnvironmentsResponse
from .raw_client import AsyncRawEnvironmentsClient, RawEnvironmentsClient
# this is used as the default value for optional parameters
@@ -35,7 +36,7 @@ def list(
limit: typing.Optional[int] = 100,
offset: typing.Optional[int] = 0,
request_options: typing.Optional[RequestOptions] = None,
- ) -> SyncPager[Environment]:
+ ) -> SyncPager[Environment, ListEnvironmentsResponse]:
"""
List environments, if no environments are found, default environments are created and returned. Pagination is available based on query parameters
@@ -52,7 +53,7 @@ def list(
Returns
-------
- SyncPager[Environment]
+ SyncPager[Environment, ListEnvironmentsResponse]
Returns a list of environment. If pagination parameters are provided, the response includes paginated data
Examples
@@ -214,7 +215,7 @@ async def list(
limit: typing.Optional[int] = 100,
offset: typing.Optional[int] = 0,
request_options: typing.Optional[RequestOptions] = None,
- ) -> AsyncPager[Environment]:
+ ) -> AsyncPager[Environment, ListEnvironmentsResponse]:
"""
List environments, if no environments are found, default environments are created and returned. Pagination is available based on query parameters
@@ -231,7 +232,7 @@ async def list(
Returns
-------
- AsyncPager[Environment]
+ AsyncPager[Environment, ListEnvironmentsResponse]
Returns a list of environment. If pagination parameters are provided, the response includes paginated data
Examples
diff --git a/src/truefoundry_sdk/environments/raw_client.py b/src/truefoundry_sdk/environments/raw_client.py
index 7e72c43..779c08c 100644
--- a/src/truefoundry_sdk/environments/raw_client.py
+++ b/src/truefoundry_sdk/environments/raw_client.py
@@ -7,7 +7,7 @@
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from ..core.http_response import AsyncHttpResponse, HttpResponse
from ..core.jsonable_encoder import jsonable_encoder
-from ..core.pagination import AsyncPager, BaseHttpResponse, SyncPager
+from ..core.pagination import AsyncPager, SyncPager
from ..core.pydantic_utilities import parse_obj_as
from ..core.request_options import RequestOptions
from ..core.serialization import convert_and_respect_annotation_metadata
@@ -34,7 +34,7 @@ def list(
limit: typing.Optional[int] = 100,
offset: typing.Optional[int] = 0,
request_options: typing.Optional[RequestOptions] = None,
- ) -> SyncPager[Environment]:
+ ) -> SyncPager[Environment, ListEnvironmentsResponse]:
"""
List environments, if no environments are found, default environments are created and returned. Pagination is available based on query parameters
@@ -51,7 +51,7 @@ def list(
Returns
-------
- SyncPager[Environment]
+ SyncPager[Environment, ListEnvironmentsResponse]
Returns a list of environment. If pagination parameters are provided, the response includes paginated data
"""
offset = offset if offset is not None else 0
@@ -81,9 +81,7 @@ def list(
offset=offset + len(_items),
request_options=request_options,
)
- return SyncPager(
- has_next=_has_next, items=_items, get_next=_get_next, response=BaseHttpResponse(response=_response)
- )
+ return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
@@ -144,9 +142,9 @@ def create_or_update(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -231,9 +229,9 @@ def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] =
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -265,7 +263,7 @@ async def list(
limit: typing.Optional[int] = 100,
offset: typing.Optional[int] = 0,
request_options: typing.Optional[RequestOptions] = None,
- ) -> AsyncPager[Environment]:
+ ) -> AsyncPager[Environment, ListEnvironmentsResponse]:
"""
List environments, if no environments are found, default environments are created and returned. Pagination is available based on query parameters
@@ -282,7 +280,7 @@ async def list(
Returns
-------
- AsyncPager[Environment]
+ AsyncPager[Environment, ListEnvironmentsResponse]
Returns a list of environment. If pagination parameters are provided, the response includes paginated data
"""
offset = offset if offset is not None else 0
@@ -315,9 +313,7 @@ async def _get_next():
request_options=request_options,
)
- return AsyncPager(
- has_next=_has_next, items=_items, get_next=_get_next, response=BaseHttpResponse(response=_response)
- )
+ return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
@@ -378,9 +374,9 @@ async def create_or_update(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -467,9 +463,9 @@ async def delete(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
diff --git a/src/truefoundry_sdk/errors/bad_request_error.py b/src/truefoundry_sdk/errors/bad_request_error.py
index baf5be4..ec78e26 100644
--- a/src/truefoundry_sdk/errors/bad_request_error.py
+++ b/src/truefoundry_sdk/errors/bad_request_error.py
@@ -6,5 +6,5 @@
class BadRequestError(ApiError):
- def __init__(self, body: typing.Optional[typing.Any], headers: typing.Optional[typing.Dict[str, str]] = None):
+ def __init__(self, body: typing.Any, headers: typing.Optional[typing.Dict[str, str]] = None):
super().__init__(status_code=400, headers=headers, body=body)
diff --git a/src/truefoundry_sdk/errors/method_not_allowed_error.py b/src/truefoundry_sdk/errors/method_not_allowed_error.py
index 0402f86..762c498 100644
--- a/src/truefoundry_sdk/errors/method_not_allowed_error.py
+++ b/src/truefoundry_sdk/errors/method_not_allowed_error.py
@@ -6,5 +6,5 @@
class MethodNotAllowedError(ApiError):
- def __init__(self, body: typing.Optional[typing.Any], headers: typing.Optional[typing.Dict[str, str]] = None):
+ def __init__(self, body: typing.Any, headers: typing.Optional[typing.Dict[str, str]] = None):
super().__init__(status_code=405, headers=headers, body=body)
diff --git a/src/truefoundry_sdk/errors/not_found_error.py b/src/truefoundry_sdk/errors/not_found_error.py
index dcd60e3..75f557d 100644
--- a/src/truefoundry_sdk/errors/not_found_error.py
+++ b/src/truefoundry_sdk/errors/not_found_error.py
@@ -6,5 +6,5 @@
class NotFoundError(ApiError):
- def __init__(self, body: typing.Optional[typing.Any], headers: typing.Optional[typing.Dict[str, str]] = None):
+ def __init__(self, body: typing.Any, headers: typing.Optional[typing.Dict[str, str]] = None):
super().__init__(status_code=404, headers=headers, body=body)
diff --git a/src/truefoundry_sdk/errors/unprocessable_entity_error.py b/src/truefoundry_sdk/errors/unprocessable_entity_error.py
index 93cb1ab..1c801a4 100644
--- a/src/truefoundry_sdk/errors/unprocessable_entity_error.py
+++ b/src/truefoundry_sdk/errors/unprocessable_entity_error.py
@@ -6,5 +6,5 @@
class UnprocessableEntityError(ApiError):
- def __init__(self, body: typing.Optional[typing.Any], headers: typing.Optional[typing.Dict[str, str]] = None):
+ def __init__(self, body: typing.Any, headers: typing.Optional[typing.Dict[str, str]] = None):
super().__init__(status_code=422, headers=headers, body=body)
diff --git a/src/truefoundry_sdk/events/raw_client.py b/src/truefoundry_sdk/events/raw_client.py
index e029dda..80ada6d 100644
--- a/src/truefoundry_sdk/events/raw_client.py
+++ b/src/truefoundry_sdk/events/raw_client.py
@@ -88,9 +88,9 @@ def get(
raise BadRequestError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -110,9 +110,9 @@ def get(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -196,9 +196,9 @@ async def get(
raise BadRequestError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -218,9 +218,9 @@ async def get(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
diff --git a/src/truefoundry_sdk/internal/ai_gateway/types/ai_gateway_get_gateway_config_request_type.py b/src/truefoundry_sdk/internal/ai_gateway/types/ai_gateway_get_gateway_config_request_type.py
index 6b06e62..03b6734 100644
--- a/src/truefoundry_sdk/internal/ai_gateway/types/ai_gateway_get_gateway_config_request_type.py
+++ b/src/truefoundry_sdk/internal/ai_gateway/types/ai_gateway_get_gateway_config_request_type.py
@@ -1,12 +1,13 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ....core import enum
+
T_Result = typing.TypeVar("T_Result")
-class AiGatewayGetGatewayConfigRequestType(str, enum.Enum):
+class AiGatewayGetGatewayConfigRequestType(enum.StrEnum):
GATEWAY_RATE_LIMITING_CONFIG = "gateway-rate-limiting-config"
GATEWAY_FALLBACK_CONFIG = "gateway-fallback-config"
GATEWAY_LOAD_BALANCING_CONFIG = "gateway-load-balancing-config"
diff --git a/src/truefoundry_sdk/internal/applications/raw_client.py b/src/truefoundry_sdk/internal/applications/raw_client.py
index 4dcffa9..f0f6253 100644
--- a/src/truefoundry_sdk/internal/applications/raw_client.py
+++ b/src/truefoundry_sdk/internal/applications/raw_client.py
@@ -54,9 +54,9 @@ def promote_rollout(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -65,9 +65,9 @@ def promote_rollout(
raise MethodNotAllowedError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -125,9 +125,9 @@ def get_pod_template_hash_to_deployment_version(
raise BadRequestError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -178,9 +178,9 @@ async def promote_rollout(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -189,9 +189,9 @@ async def promote_rollout(
raise MethodNotAllowedError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -249,9 +249,9 @@ async def get_pod_template_hash_to_deployment_version(
raise BadRequestError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
diff --git a/src/truefoundry_sdk/internal/artifact_versions/client.py b/src/truefoundry_sdk/internal/artifact_versions/client.py
index 02ccdeb..d79328e 100644
--- a/src/truefoundry_sdk/internal/artifact_versions/client.py
+++ b/src/truefoundry_sdk/internal/artifact_versions/client.py
@@ -5,6 +5,7 @@
from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from ...core.pagination import AsyncPager, SyncPager
from ...core.request_options import RequestOptions
+from ...types.internal_list_artifact_versions_response import InternalListArtifactVersionsResponse
from ...types.internal_list_artifact_versions_response_data_item import InternalListArtifactVersionsResponseDataItem
from .raw_client import AsyncRawArtifactVersionsClient, RawArtifactVersionsClient
@@ -40,7 +41,7 @@ def list(
include_internal_metadata: typing.Optional[bool] = False,
include_model_versions: typing.Optional[bool] = False,
request_options: typing.Optional[RequestOptions] = None,
- ) -> SyncPager[InternalListArtifactVersionsResponseDataItem]:
+ ) -> SyncPager[InternalListArtifactVersionsResponseDataItem, InternalListArtifactVersionsResponse]:
"""
List artifact version API
@@ -75,7 +76,7 @@ def list(
Returns
-------
- SyncPager[InternalListArtifactVersionsResponseDataItem]
+ SyncPager[InternalListArtifactVersionsResponseDataItem, InternalListArtifactVersionsResponse]
Successful Response
Examples
@@ -152,7 +153,7 @@ async def list(
include_internal_metadata: typing.Optional[bool] = False,
include_model_versions: typing.Optional[bool] = False,
request_options: typing.Optional[RequestOptions] = None,
- ) -> AsyncPager[InternalListArtifactVersionsResponseDataItem]:
+ ) -> AsyncPager[InternalListArtifactVersionsResponseDataItem, InternalListArtifactVersionsResponse]:
"""
List artifact version API
@@ -187,7 +188,7 @@ async def list(
Returns
-------
- AsyncPager[InternalListArtifactVersionsResponseDataItem]
+ AsyncPager[InternalListArtifactVersionsResponseDataItem, InternalListArtifactVersionsResponse]
Successful Response
Examples
diff --git a/src/truefoundry_sdk/internal/artifact_versions/raw_client.py b/src/truefoundry_sdk/internal/artifact_versions/raw_client.py
index 4bfb431..4bbee05 100644
--- a/src/truefoundry_sdk/internal/artifact_versions/raw_client.py
+++ b/src/truefoundry_sdk/internal/artifact_versions/raw_client.py
@@ -5,7 +5,7 @@
from ...core.api_error import ApiError
from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
-from ...core.pagination import AsyncPager, BaseHttpResponse, SyncPager
+from ...core.pagination import AsyncPager, SyncPager
from ...core.pydantic_utilities import parse_obj_as
from ...core.request_options import RequestOptions
from ...errors.unprocessable_entity_error import UnprocessableEntityError
@@ -33,7 +33,7 @@ def list(
include_internal_metadata: typing.Optional[bool] = False,
include_model_versions: typing.Optional[bool] = False,
request_options: typing.Optional[RequestOptions] = None,
- ) -> SyncPager[InternalListArtifactVersionsResponseDataItem]:
+ ) -> SyncPager[InternalListArtifactVersionsResponseDataItem, InternalListArtifactVersionsResponse]:
"""
List artifact version API
@@ -68,7 +68,7 @@ def list(
Returns
-------
- SyncPager[InternalListArtifactVersionsResponseDataItem]
+ SyncPager[InternalListArtifactVersionsResponseDataItem, InternalListArtifactVersionsResponse]
Successful Response
"""
offset = offset if offset is not None else 0
@@ -118,16 +118,14 @@ def list(
include_model_versions=include_model_versions,
request_options=request_options,
)
- return SyncPager(
- has_next=_has_next, items=_items, get_next=_get_next, response=BaseHttpResponse(response=_response)
- )
+ return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -158,7 +156,7 @@ async def list(
include_internal_metadata: typing.Optional[bool] = False,
include_model_versions: typing.Optional[bool] = False,
request_options: typing.Optional[RequestOptions] = None,
- ) -> AsyncPager[InternalListArtifactVersionsResponseDataItem]:
+ ) -> AsyncPager[InternalListArtifactVersionsResponseDataItem, InternalListArtifactVersionsResponse]:
"""
List artifact version API
@@ -193,7 +191,7 @@ async def list(
Returns
-------
- AsyncPager[InternalListArtifactVersionsResponseDataItem]
+ AsyncPager[InternalListArtifactVersionsResponseDataItem, InternalListArtifactVersionsResponse]
Successful Response
"""
offset = offset if offset is not None else 0
@@ -246,16 +244,14 @@ async def _get_next():
request_options=request_options,
)
- return AsyncPager(
- has_next=_has_next, items=_items, get_next=_get_next, response=BaseHttpResponse(response=_response)
- )
+ return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
diff --git a/src/truefoundry_sdk/internal/client.py b/src/truefoundry_sdk/internal/client.py
index 32fb837..c726eee 100644
--- a/src/truefoundry_sdk/internal/client.py
+++ b/src/truefoundry_sdk/internal/client.py
@@ -51,7 +51,7 @@ def with_raw_response(self) -> RawInternalClient:
def get_id_from_fqn(
self, type: str, *, fqn: str, request_options: typing.Optional[RequestOptions] = None
- ) -> typing.Dict[str, typing.Optional[typing.Any]]:
+ ) -> typing.Dict[str, typing.Any]:
"""
Get IDs associated with the FQN for various entity types, such as deployment, application, workspace, or cluster.
@@ -68,7 +68,7 @@ def get_id_from_fqn(
Returns
-------
- typing.Dict[str, typing.Optional[typing.Any]]
+ typing.Dict[str, typing.Any]
Returns the IDs for the specified entity type based on the provided FQN. For example, deploymentId, applicationId, and workspaceId for type deployment, or applicationId and workspaceId for type app.
Examples
@@ -205,7 +205,7 @@ def with_raw_response(self) -> AsyncRawInternalClient:
async def get_id_from_fqn(
self, type: str, *, fqn: str, request_options: typing.Optional[RequestOptions] = None
- ) -> typing.Dict[str, typing.Optional[typing.Any]]:
+ ) -> typing.Dict[str, typing.Any]:
"""
Get IDs associated with the FQN for various entity types, such as deployment, application, workspace, or cluster.
@@ -222,7 +222,7 @@ async def get_id_from_fqn(
Returns
-------
- typing.Dict[str, typing.Optional[typing.Any]]
+ typing.Dict[str, typing.Any]
Returns the IDs for the specified entity type based on the provided FQN. For example, deploymentId, applicationId, and workspaceId for type deployment, or applicationId and workspaceId for type app.
Examples
diff --git a/src/truefoundry_sdk/internal/deployments/raw_client.py b/src/truefoundry_sdk/internal/deployments/raw_client.py
index 667f0b7..6b82090 100644
--- a/src/truefoundry_sdk/internal/deployments/raw_client.py
+++ b/src/truefoundry_sdk/internal/deployments/raw_client.py
@@ -66,9 +66,9 @@ def get_deployment_statuses(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -119,9 +119,9 @@ def get_builds(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -250,9 +250,9 @@ def get_suggested_endpoint(
raise BadRequestError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -308,9 +308,9 @@ async def get_deployment_statuses(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -361,9 +361,9 @@ async def get_builds(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -492,9 +492,9 @@ async def get_suggested_endpoint(
raise BadRequestError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
diff --git a/src/truefoundry_sdk/internal/docker_registries/raw_client.py b/src/truefoundry_sdk/internal/docker_registries/raw_client.py
index 42602c1..fba97a3 100644
--- a/src/truefoundry_sdk/internal/docker_registries/raw_client.py
+++ b/src/truefoundry_sdk/internal/docker_registries/raw_client.py
@@ -78,9 +78,9 @@ def create_repository(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -203,9 +203,9 @@ async def create_repository(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
diff --git a/src/truefoundry_sdk/internal/metrics/raw_client.py b/src/truefoundry_sdk/internal/metrics/raw_client.py
index 963d8e8..1b6b7d2 100644
--- a/src/truefoundry_sdk/internal/metrics/raw_client.py
+++ b/src/truefoundry_sdk/internal/metrics/raw_client.py
@@ -85,9 +85,9 @@ def get_charts(
raise BadRequestError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -96,9 +96,9 @@ def get_charts(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -107,9 +107,9 @@ def get_charts(
raise MethodNotAllowedError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -189,9 +189,9 @@ async def get_charts(
raise BadRequestError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -200,9 +200,9 @@ async def get_charts(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -211,9 +211,9 @@ async def get_charts(
raise MethodNotAllowedError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
diff --git a/src/truefoundry_sdk/internal/metrics/types/metrics_get_charts_request_filter_entity.py b/src/truefoundry_sdk/internal/metrics/types/metrics_get_charts_request_filter_entity.py
index 296eefc..3a83142 100644
--- a/src/truefoundry_sdk/internal/metrics/types/metrics_get_charts_request_filter_entity.py
+++ b/src/truefoundry_sdk/internal/metrics/types/metrics_get_charts_request_filter_entity.py
@@ -1,12 +1,13 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ....core import enum
+
T_Result = typing.TypeVar("T_Result")
-class MetricsGetChartsRequestFilterEntity(str, enum.Enum):
+class MetricsGetChartsRequestFilterEntity(enum.StrEnum):
APPLICATION = "application"
POD = "pod"
JOB_RUN = "job-run"
diff --git a/src/truefoundry_sdk/internal/ml/raw_client.py b/src/truefoundry_sdk/internal/ml/raw_client.py
index 89da7d2..c855e79 100644
--- a/src/truefoundry_sdk/internal/ml/raw_client.py
+++ b/src/truefoundry_sdk/internal/ml/raw_client.py
@@ -67,9 +67,9 @@ def apply(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -123,9 +123,9 @@ def delete(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -184,9 +184,9 @@ async def apply(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -240,9 +240,9 @@ async def delete(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
diff --git a/src/truefoundry_sdk/internal/raw_client.py b/src/truefoundry_sdk/internal/raw_client.py
index 5ca119e..cc90b88 100644
--- a/src/truefoundry_sdk/internal/raw_client.py
+++ b/src/truefoundry_sdk/internal/raw_client.py
@@ -19,7 +19,7 @@ def __init__(self, *, client_wrapper: SyncClientWrapper):
def get_id_from_fqn(
self, type: str, *, fqn: str, request_options: typing.Optional[RequestOptions] = None
- ) -> HttpResponse[typing.Dict[str, typing.Optional[typing.Any]]]:
+ ) -> HttpResponse[typing.Dict[str, typing.Any]]:
"""
Get IDs associated with the FQN for various entity types, such as deployment, application, workspace, or cluster.
@@ -36,7 +36,7 @@ def get_id_from_fqn(
Returns
-------
- HttpResponse[typing.Dict[str, typing.Optional[typing.Any]]]
+ HttpResponse[typing.Dict[str, typing.Any]]
Returns the IDs for the specified entity type based on the provided FQN. For example, deploymentId, applicationId, and workspaceId for type deployment, or applicationId and workspaceId for type app.
"""
_response = self._client_wrapper.httpx_client.request(
@@ -50,9 +50,9 @@ def get_id_from_fqn(
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
- typing.Dict[str, typing.Optional[typing.Any]],
+ typing.Dict[str, typing.Any],
parse_obj_as(
- type_=typing.Dict[str, typing.Optional[typing.Any]], # type: ignore
+ type_=typing.Dict[str, typing.Any], # type: ignore
object_=_response.json(),
),
)
@@ -61,9 +61,9 @@ def get_id_from_fqn(
raise BadRequestError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -72,9 +72,9 @@ def get_id_from_fqn(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -91,7 +91,7 @@ def __init__(self, *, client_wrapper: AsyncClientWrapper):
async def get_id_from_fqn(
self, type: str, *, fqn: str, request_options: typing.Optional[RequestOptions] = None
- ) -> AsyncHttpResponse[typing.Dict[str, typing.Optional[typing.Any]]]:
+ ) -> AsyncHttpResponse[typing.Dict[str, typing.Any]]:
"""
Get IDs associated with the FQN for various entity types, such as deployment, application, workspace, or cluster.
@@ -108,7 +108,7 @@ async def get_id_from_fqn(
Returns
-------
- AsyncHttpResponse[typing.Dict[str, typing.Optional[typing.Any]]]
+ AsyncHttpResponse[typing.Dict[str, typing.Any]]
Returns the IDs for the specified entity type based on the provided FQN. For example, deploymentId, applicationId, and workspaceId for type deployment, or applicationId and workspaceId for type app.
"""
_response = await self._client_wrapper.httpx_client.request(
@@ -122,9 +122,9 @@ async def get_id_from_fqn(
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
- typing.Dict[str, typing.Optional[typing.Any]],
+ typing.Dict[str, typing.Any],
parse_obj_as(
- type_=typing.Dict[str, typing.Optional[typing.Any]], # type: ignore
+ type_=typing.Dict[str, typing.Any], # type: ignore
object_=_response.json(),
),
)
@@ -133,9 +133,9 @@ async def get_id_from_fqn(
raise BadRequestError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -144,9 +144,9 @@ async def get_id_from_fqn(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
diff --git a/src/truefoundry_sdk/internal/workflows/client.py b/src/truefoundry_sdk/internal/workflows/client.py
index ba779a9..a4c9c8f 100644
--- a/src/truefoundry_sdk/internal/workflows/client.py
+++ b/src/truefoundry_sdk/internal/workflows/client.py
@@ -30,8 +30,8 @@ def execute_workflow(
self,
application_id: str,
*,
- inputs: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
- inputs_literal_map: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
+ inputs: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
+ inputs_literal_map: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> WorkflowsExecuteWorkflowResponse:
"""
@@ -42,10 +42,10 @@ def execute_workflow(
application_id : str
Id of the application
- inputs : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
+ inputs : typing.Optional[typing.Dict[str, typing.Any]]
Workflow inputs
- inputs_literal_map : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
+ inputs_literal_map : typing.Optional[typing.Dict[str, typing.Any]]
Workflow inputs literal map
request_options : typing.Optional[RequestOptions]
@@ -93,8 +93,8 @@ async def execute_workflow(
self,
application_id: str,
*,
- inputs: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
- inputs_literal_map: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
+ inputs: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
+ inputs_literal_map: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> WorkflowsExecuteWorkflowResponse:
"""
@@ -105,10 +105,10 @@ async def execute_workflow(
application_id : str
Id of the application
- inputs : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
+ inputs : typing.Optional[typing.Dict[str, typing.Any]]
Workflow inputs
- inputs_literal_map : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
+ inputs_literal_map : typing.Optional[typing.Dict[str, typing.Any]]
Workflow inputs literal map
request_options : typing.Optional[RequestOptions]
diff --git a/src/truefoundry_sdk/internal/workflows/raw_client.py b/src/truefoundry_sdk/internal/workflows/raw_client.py
index cdf67b7..7ce6bb7 100644
--- a/src/truefoundry_sdk/internal/workflows/raw_client.py
+++ b/src/truefoundry_sdk/internal/workflows/raw_client.py
@@ -25,8 +25,8 @@ def execute_workflow(
self,
application_id: str,
*,
- inputs: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
- inputs_literal_map: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
+ inputs: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
+ inputs_literal_map: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> HttpResponse[WorkflowsExecuteWorkflowResponse]:
"""
@@ -37,10 +37,10 @@ def execute_workflow(
application_id : str
Id of the application
- inputs : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
+ inputs : typing.Optional[typing.Dict[str, typing.Any]]
Workflow inputs
- inputs_literal_map : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
+ inputs_literal_map : typing.Optional[typing.Dict[str, typing.Any]]
Workflow inputs literal map
request_options : typing.Optional[RequestOptions]
@@ -78,9 +78,9 @@ def execute_workflow(
raise BadRequestError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -89,9 +89,9 @@ def execute_workflow(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -110,8 +110,8 @@ async def execute_workflow(
self,
application_id: str,
*,
- inputs: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
- inputs_literal_map: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
+ inputs: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
+ inputs_literal_map: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> AsyncHttpResponse[WorkflowsExecuteWorkflowResponse]:
"""
@@ -122,10 +122,10 @@ async def execute_workflow(
application_id : str
Id of the application
- inputs : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
+ inputs : typing.Optional[typing.Dict[str, typing.Any]]
Workflow inputs
- inputs_literal_map : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
+ inputs_literal_map : typing.Optional[typing.Dict[str, typing.Any]]
Workflow inputs literal map
request_options : typing.Optional[RequestOptions]
@@ -163,9 +163,9 @@ async def execute_workflow(
raise BadRequestError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -174,9 +174,9 @@ async def execute_workflow(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
diff --git a/src/truefoundry_sdk/jobs/client.py b/src/truefoundry_sdk/jobs/client.py
index 33d1e06..a77f5af 100644
--- a/src/truefoundry_sdk/jobs/client.py
+++ b/src/truefoundry_sdk/jobs/client.py
@@ -10,6 +10,7 @@
from ..types.job_run import JobRun
from ..types.job_run_status import JobRunStatus
from ..types.job_runs_sort_by import JobRunsSortBy
+from ..types.list_job_run_response import ListJobRunResponse
from ..types.metadata import Metadata
from ..types.sort_direction import SortDirection
from ..types.terminate_job_response import TerminateJobResponse
@@ -49,7 +50,7 @@ def list_runs(
status: typing.Optional[typing.Union[JobRunStatus, typing.Sequence[JobRunStatus]]] = None,
version_numbers: typing.Optional[typing.Union[float, typing.Sequence[float]]] = None,
request_options: typing.Optional[RequestOptions] = None,
- ) -> SyncPager[JobRun]:
+ ) -> SyncPager[JobRun, ListJobRunResponse]:
"""
List Job Runs for provided Job Id. Filter the data based on parameters passed in the query
@@ -87,7 +88,7 @@ def list_runs(
Returns
-------
- SyncPager[JobRun]
+ SyncPager[JobRun, ListJobRunResponse]
Returns all runs of a Job sorted by creation date in "data" key and total count in "totalCount" key
Examples
@@ -323,7 +324,7 @@ async def list_runs(
status: typing.Optional[typing.Union[JobRunStatus, typing.Sequence[JobRunStatus]]] = None,
version_numbers: typing.Optional[typing.Union[float, typing.Sequence[float]]] = None,
request_options: typing.Optional[RequestOptions] = None,
- ) -> AsyncPager[JobRun]:
+ ) -> AsyncPager[JobRun, ListJobRunResponse]:
"""
List Job Runs for provided Job Id. Filter the data based on parameters passed in the query
@@ -361,7 +362,7 @@ async def list_runs(
Returns
-------
- AsyncPager[JobRun]
+ AsyncPager[JobRun, ListJobRunResponse]
Returns all runs of a Job sorted by creation date in "data" key and total count in "totalCount" key
Examples
diff --git a/src/truefoundry_sdk/jobs/raw_client.py b/src/truefoundry_sdk/jobs/raw_client.py
index ed98d5b..c00e544 100644
--- a/src/truefoundry_sdk/jobs/raw_client.py
+++ b/src/truefoundry_sdk/jobs/raw_client.py
@@ -7,7 +7,7 @@
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from ..core.http_response import AsyncHttpResponse, HttpResponse
from ..core.jsonable_encoder import jsonable_encoder
-from ..core.pagination import AsyncPager, BaseHttpResponse, SyncPager
+from ..core.pagination import AsyncPager, SyncPager
from ..core.pydantic_utilities import parse_obj_as
from ..core.request_options import RequestOptions
from ..core.serialization import convert_and_respect_annotation_metadata
@@ -51,7 +51,7 @@ def list_runs(
status: typing.Optional[typing.Union[JobRunStatus, typing.Sequence[JobRunStatus]]] = None,
version_numbers: typing.Optional[typing.Union[float, typing.Sequence[float]]] = None,
request_options: typing.Optional[RequestOptions] = None,
- ) -> SyncPager[JobRun]:
+ ) -> SyncPager[JobRun, ListJobRunResponse]:
"""
List Job Runs for provided Job Id. Filter the data based on parameters passed in the query
@@ -89,7 +89,7 @@ def list_runs(
Returns
-------
- SyncPager[JobRun]
+ SyncPager[JobRun, ListJobRunResponse]
Returns all runs of a Job sorted by creation date in "data" key and total count in "totalCount" key
"""
offset = offset if offset is not None else 0
@@ -132,9 +132,7 @@ def list_runs(
version_numbers=version_numbers,
request_options=request_options,
)
- return SyncPager(
- has_next=_has_next, items=_items, get_next=_get_next, response=BaseHttpResponse(response=_response)
- )
+ return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
if _response.status_code == 403:
raise ForbiddenError(
headers=dict(_response.headers),
@@ -150,9 +148,9 @@ def list_runs(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -161,9 +159,9 @@ def list_runs(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -225,9 +223,9 @@ def get_run(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -289,9 +287,9 @@ def delete_run(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -379,9 +377,9 @@ def trigger(
raise BadRequestError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -401,9 +399,9 @@ def trigger(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -412,9 +410,9 @@ def trigger(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -480,9 +478,9 @@ def terminate(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -502,9 +500,9 @@ def terminate(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -532,7 +530,7 @@ async def list_runs(
status: typing.Optional[typing.Union[JobRunStatus, typing.Sequence[JobRunStatus]]] = None,
version_numbers: typing.Optional[typing.Union[float, typing.Sequence[float]]] = None,
request_options: typing.Optional[RequestOptions] = None,
- ) -> AsyncPager[JobRun]:
+ ) -> AsyncPager[JobRun, ListJobRunResponse]:
"""
List Job Runs for provided Job Id. Filter the data based on parameters passed in the query
@@ -570,7 +568,7 @@ async def list_runs(
Returns
-------
- AsyncPager[JobRun]
+ AsyncPager[JobRun, ListJobRunResponse]
Returns all runs of a Job sorted by creation date in "data" key and total count in "totalCount" key
"""
offset = offset if offset is not None else 0
@@ -616,9 +614,7 @@ async def _get_next():
request_options=request_options,
)
- return AsyncPager(
- has_next=_has_next, items=_items, get_next=_get_next, response=BaseHttpResponse(response=_response)
- )
+ return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
if _response.status_code == 403:
raise ForbiddenError(
headers=dict(_response.headers),
@@ -634,9 +630,9 @@ async def _get_next():
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -645,9 +641,9 @@ async def _get_next():
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -709,9 +705,9 @@ async def get_run(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -773,9 +769,9 @@ async def delete_run(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -863,9 +859,9 @@ async def trigger(
raise BadRequestError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -885,9 +881,9 @@ async def trigger(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -896,9 +892,9 @@ async def trigger(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -964,9 +960,9 @@ async def terminate(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -986,9 +982,9 @@ async def terminate(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
diff --git a/src/truefoundry_sdk/logs/raw_client.py b/src/truefoundry_sdk/logs/raw_client.py
index 82e5a75..ddc3505 100644
--- a/src/truefoundry_sdk/logs/raw_client.py
+++ b/src/truefoundry_sdk/logs/raw_client.py
@@ -143,9 +143,9 @@ def get(
raise BadRequestError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -284,9 +284,9 @@ async def get(
raise BadRequestError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
diff --git a/src/truefoundry_sdk/ml_repos/client.py b/src/truefoundry_sdk/ml_repos/client.py
index 4e69c54..3e8deca 100644
--- a/src/truefoundry_sdk/ml_repos/client.py
+++ b/src/truefoundry_sdk/ml_repos/client.py
@@ -7,6 +7,7 @@
from ..core.request_options import RequestOptions
from ..types.empty_response import EmptyResponse
from ..types.get_ml_repo_response import GetMlRepoResponse
+from ..types.list_ml_repos_response import ListMlReposResponse
from ..types.ml_repo import MlRepo
from ..types.ml_repo_manifest import MlRepoManifest
from .raw_client import AsyncRawMlReposClient, RawMlReposClient
@@ -154,7 +155,7 @@ def list(
limit: typing.Optional[int] = 100,
offset: typing.Optional[int] = 0,
request_options: typing.Optional[RequestOptions] = None,
- ) -> SyncPager[MlRepo]:
+ ) -> SyncPager[MlRepo, ListMlReposResponse]:
"""
List ml repos
Args:
@@ -177,7 +178,7 @@ def list(
Returns
-------
- SyncPager[MlRepo]
+ SyncPager[MlRepo, ListMlReposResponse]
Successful Response
Examples
@@ -365,7 +366,7 @@ async def list(
limit: typing.Optional[int] = 100,
offset: typing.Optional[int] = 0,
request_options: typing.Optional[RequestOptions] = None,
- ) -> AsyncPager[MlRepo]:
+ ) -> AsyncPager[MlRepo, ListMlReposResponse]:
"""
List ml repos
Args:
@@ -388,7 +389,7 @@ async def list(
Returns
-------
- AsyncPager[MlRepo]
+ AsyncPager[MlRepo, ListMlReposResponse]
Successful Response
Examples
diff --git a/src/truefoundry_sdk/ml_repos/raw_client.py b/src/truefoundry_sdk/ml_repos/raw_client.py
index 511f2f0..10afdce 100644
--- a/src/truefoundry_sdk/ml_repos/raw_client.py
+++ b/src/truefoundry_sdk/ml_repos/raw_client.py
@@ -7,7 +7,7 @@
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from ..core.http_response import AsyncHttpResponse, HttpResponse
from ..core.jsonable_encoder import jsonable_encoder
-from ..core.pagination import AsyncPager, BaseHttpResponse, SyncPager
+from ..core.pagination import AsyncPager, SyncPager
from ..core.pydantic_utilities import parse_obj_as
from ..core.request_options import RequestOptions
from ..core.serialization import convert_and_respect_annotation_metadata
@@ -77,9 +77,9 @@ def create_or_update(
raise BadRequestError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -88,9 +88,9 @@ def create_or_update(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -110,9 +110,9 @@ def create_or_update(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -165,9 +165,9 @@ def get(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -220,9 +220,9 @@ def delete(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -239,7 +239,7 @@ def list(
limit: typing.Optional[int] = 100,
offset: typing.Optional[int] = 0,
request_options: typing.Optional[RequestOptions] = None,
- ) -> SyncPager[MlRepo]:
+ ) -> SyncPager[MlRepo, ListMlReposResponse]:
"""
List ml repos
Args:
@@ -262,7 +262,7 @@ def list(
Returns
-------
- SyncPager[MlRepo]
+ SyncPager[MlRepo, ListMlReposResponse]
Successful Response
"""
offset = offset if offset is not None else 0
@@ -294,16 +294,14 @@ def list(
offset=offset + len(_items),
request_options=request_options,
)
- return SyncPager(
- has_next=_has_next, items=_items, get_next=_get_next, response=BaseHttpResponse(response=_response)
- )
+ return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -365,9 +363,9 @@ async def create_or_update(
raise BadRequestError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -376,9 +374,9 @@ async def create_or_update(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -398,9 +396,9 @@ async def create_or_update(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -453,9 +451,9 @@ async def get(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -508,9 +506,9 @@ async def delete(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -527,7 +525,7 @@ async def list(
limit: typing.Optional[int] = 100,
offset: typing.Optional[int] = 0,
request_options: typing.Optional[RequestOptions] = None,
- ) -> AsyncPager[MlRepo]:
+ ) -> AsyncPager[MlRepo, ListMlReposResponse]:
"""
List ml repos
Args:
@@ -550,7 +548,7 @@ async def list(
Returns
-------
- AsyncPager[MlRepo]
+ AsyncPager[MlRepo, ListMlReposResponse]
Successful Response
"""
offset = offset if offset is not None else 0
@@ -585,16 +583,14 @@ async def _get_next():
request_options=request_options,
)
- return AsyncPager(
- has_next=_has_next, items=_items, get_next=_get_next, response=BaseHttpResponse(response=_response)
- )
+ return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
diff --git a/src/truefoundry_sdk/model_versions/client.py b/src/truefoundry_sdk/model_versions/client.py
index 9dfc872..3fe771c 100644
--- a/src/truefoundry_sdk/model_versions/client.py
+++ b/src/truefoundry_sdk/model_versions/client.py
@@ -7,6 +7,7 @@
from ..core.request_options import RequestOptions
from ..types.empty_response import EmptyResponse
from ..types.get_model_version_response import GetModelVersionResponse
+from ..types.list_model_versions_response import ListModelVersionsResponse
from ..types.model_version import ModelVersion
from .raw_client import AsyncRawModelVersionsClient, RawModelVersionsClient
@@ -149,7 +150,7 @@ def list(
limit: typing.Optional[int] = 100,
include_internal_metadata: typing.Optional[bool] = False,
request_options: typing.Optional[RequestOptions] = None,
- ) -> SyncPager[ModelVersion]:
+ ) -> SyncPager[ModelVersion, ListModelVersionsResponse]:
"""
List model version API
@@ -182,7 +183,7 @@ def list(
Returns
-------
- SyncPager[ModelVersion]
+ SyncPager[ModelVersion, ListModelVersionsResponse]
Successful Response
Examples
@@ -385,7 +386,7 @@ async def list(
limit: typing.Optional[int] = 100,
include_internal_metadata: typing.Optional[bool] = False,
request_options: typing.Optional[RequestOptions] = None,
- ) -> AsyncPager[ModelVersion]:
+ ) -> AsyncPager[ModelVersion, ListModelVersionsResponse]:
"""
List model version API
@@ -418,7 +419,7 @@ async def list(
Returns
-------
- AsyncPager[ModelVersion]
+ AsyncPager[ModelVersion, ListModelVersionsResponse]
Successful Response
Examples
diff --git a/src/truefoundry_sdk/model_versions/raw_client.py b/src/truefoundry_sdk/model_versions/raw_client.py
index d10fd79..f7138a4 100644
--- a/src/truefoundry_sdk/model_versions/raw_client.py
+++ b/src/truefoundry_sdk/model_versions/raw_client.py
@@ -7,7 +7,7 @@
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from ..core.http_response import AsyncHttpResponse, HttpResponse
from ..core.jsonable_encoder import jsonable_encoder
-from ..core.pagination import AsyncPager, BaseHttpResponse, SyncPager
+from ..core.pagination import AsyncPager, SyncPager
from ..core.pydantic_utilities import parse_obj_as
from ..core.request_options import RequestOptions
from ..errors.unprocessable_entity_error import UnprocessableEntityError
@@ -77,9 +77,9 @@ def apply_tags(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -126,9 +126,9 @@ def get(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -175,9 +175,9 @@ def delete(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -202,7 +202,7 @@ def list(
limit: typing.Optional[int] = 100,
include_internal_metadata: typing.Optional[bool] = False,
request_options: typing.Optional[RequestOptions] = None,
- ) -> SyncPager[ModelVersion]:
+ ) -> SyncPager[ModelVersion, ListModelVersionsResponse]:
"""
List model version API
@@ -235,7 +235,7 @@ def list(
Returns
-------
- SyncPager[ModelVersion]
+ SyncPager[ModelVersion, ListModelVersionsResponse]
Successful Response
"""
offset = offset if offset is not None else 0
@@ -283,16 +283,14 @@ def list(
include_internal_metadata=include_internal_metadata,
request_options=request_options,
)
- return SyncPager(
- has_next=_has_next, items=_items, get_next=_get_next, response=BaseHttpResponse(response=_response)
- )
+ return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -360,9 +358,9 @@ async def apply_tags(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -409,9 +407,9 @@ async def get(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -458,9 +456,9 @@ async def delete(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -485,7 +483,7 @@ async def list(
limit: typing.Optional[int] = 100,
include_internal_metadata: typing.Optional[bool] = False,
request_options: typing.Optional[RequestOptions] = None,
- ) -> AsyncPager[ModelVersion]:
+ ) -> AsyncPager[ModelVersion, ListModelVersionsResponse]:
"""
List model version API
@@ -518,7 +516,7 @@ async def list(
Returns
-------
- AsyncPager[ModelVersion]
+ AsyncPager[ModelVersion, ListModelVersionsResponse]
Successful Response
"""
offset = offset if offset is not None else 0
@@ -569,16 +567,14 @@ async def _get_next():
request_options=request_options,
)
- return AsyncPager(
- has_next=_has_next, items=_items, get_next=_get_next, response=BaseHttpResponse(response=_response)
- )
+ return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
diff --git a/src/truefoundry_sdk/models/client.py b/src/truefoundry_sdk/models/client.py
index caf2f38..fd75b96 100644
--- a/src/truefoundry_sdk/models/client.py
+++ b/src/truefoundry_sdk/models/client.py
@@ -8,6 +8,7 @@
from ..types.empty_response import EmptyResponse
from ..types.get_model_response import GetModelResponse
from ..types.get_model_version_response import GetModelVersionResponse
+from ..types.list_models_response import ListModelsResponse
from ..types.model import Model
from ..types.model_manifest import ModelManifest
from .raw_client import AsyncRawModelsClient, RawModelsClient
@@ -98,8 +99,9 @@ def list(
offset: typing.Optional[int] = 0,
limit: typing.Optional[int] = 100,
run_id: typing.Optional[str] = None,
+ include_empty_models: typing.Optional[bool] = True,
request_options: typing.Optional[RequestOptions] = None,
- ) -> SyncPager[Model]:
+ ) -> SyncPager[Model, ListModelsResponse]:
"""
Parameters
----------
@@ -115,12 +117,14 @@ def list(
run_id : typing.Optional[str]
+ include_empty_models : typing.Optional[bool]
+
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
- SyncPager[Model]
+ SyncPager[Model, ListModelsResponse]
Successful Response
Examples
@@ -138,6 +142,7 @@ def list(
offset=1,
limit=1,
run_id="run_id",
+ include_empty_models=True,
)
for item in response:
yield item
@@ -152,6 +157,7 @@ def list(
offset=offset,
limit=limit,
run_id=run_id,
+ include_empty_models=include_empty_models,
request_options=request_options,
)
@@ -290,8 +296,9 @@ async def list(
offset: typing.Optional[int] = 0,
limit: typing.Optional[int] = 100,
run_id: typing.Optional[str] = None,
+ include_empty_models: typing.Optional[bool] = True,
request_options: typing.Optional[RequestOptions] = None,
- ) -> AsyncPager[Model]:
+ ) -> AsyncPager[Model, ListModelsResponse]:
"""
Parameters
----------
@@ -307,12 +314,14 @@ async def list(
run_id : typing.Optional[str]
+ include_empty_models : typing.Optional[bool]
+
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
- AsyncPager[Model]
+ AsyncPager[Model, ListModelsResponse]
Successful Response
Examples
@@ -335,6 +344,7 @@ async def main() -> None:
offset=1,
limit=1,
run_id="run_id",
+ include_empty_models=True,
)
async for item in response:
yield item
@@ -353,6 +363,7 @@ async def main() -> None:
offset=offset,
limit=limit,
run_id=run_id,
+ include_empty_models=include_empty_models,
request_options=request_options,
)
diff --git a/src/truefoundry_sdk/models/raw_client.py b/src/truefoundry_sdk/models/raw_client.py
index 49b5b96..eab7680 100644
--- a/src/truefoundry_sdk/models/raw_client.py
+++ b/src/truefoundry_sdk/models/raw_client.py
@@ -7,7 +7,7 @@
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from ..core.http_response import AsyncHttpResponse, HttpResponse
from ..core.jsonable_encoder import jsonable_encoder
-from ..core.pagination import AsyncPager, BaseHttpResponse, SyncPager
+from ..core.pagination import AsyncPager, SyncPager
from ..core.pydantic_utilities import parse_obj_as
from ..core.request_options import RequestOptions
from ..core.serialization import convert_and_respect_annotation_metadata
@@ -62,9 +62,9 @@ def get(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -109,9 +109,9 @@ def delete(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -130,8 +130,9 @@ def list(
offset: typing.Optional[int] = 0,
limit: typing.Optional[int] = 100,
run_id: typing.Optional[str] = None,
+ include_empty_models: typing.Optional[bool] = True,
request_options: typing.Optional[RequestOptions] = None,
- ) -> SyncPager[Model]:
+ ) -> SyncPager[Model, ListModelsResponse]:
"""
Parameters
----------
@@ -147,12 +148,14 @@ def list(
run_id : typing.Optional[str]
+ include_empty_models : typing.Optional[bool]
+
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
- SyncPager[Model]
+ SyncPager[Model, ListModelsResponse]
Successful Response
"""
offset = offset if offset is not None else 0
@@ -167,6 +170,7 @@ def list(
"offset": offset,
"limit": limit,
"run_id": run_id,
+ "include_empty_models": include_empty_models,
},
request_options=request_options,
)
@@ -188,18 +192,17 @@ def list(
offset=offset + len(_items),
limit=limit,
run_id=run_id,
+ include_empty_models=include_empty_models,
request_options=request_options,
)
- return SyncPager(
- has_next=_has_next, items=_items, get_next=_get_next, response=BaseHttpResponse(response=_response)
- )
+ return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -253,9 +256,9 @@ def create_or_update(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -305,9 +308,9 @@ async def get(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -352,9 +355,9 @@ async def delete(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -373,8 +376,9 @@ async def list(
offset: typing.Optional[int] = 0,
limit: typing.Optional[int] = 100,
run_id: typing.Optional[str] = None,
+ include_empty_models: typing.Optional[bool] = True,
request_options: typing.Optional[RequestOptions] = None,
- ) -> AsyncPager[Model]:
+ ) -> AsyncPager[Model, ListModelsResponse]:
"""
Parameters
----------
@@ -390,12 +394,14 @@ async def list(
run_id : typing.Optional[str]
+ include_empty_models : typing.Optional[bool]
+
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
- AsyncPager[Model]
+ AsyncPager[Model, ListModelsResponse]
Successful Response
"""
offset = offset if offset is not None else 0
@@ -410,6 +416,7 @@ async def list(
"offset": offset,
"limit": limit,
"run_id": run_id,
+ "include_empty_models": include_empty_models,
},
request_options=request_options,
)
@@ -433,19 +440,18 @@ async def _get_next():
offset=offset + len(_items),
limit=limit,
run_id=run_id,
+ include_empty_models=include_empty_models,
request_options=request_options,
)
- return AsyncPager(
- has_next=_has_next, items=_items, get_next=_get_next, response=BaseHttpResponse(response=_response)
- )
+ return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -499,9 +505,9 @@ async def create_or_update(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
diff --git a/src/truefoundry_sdk/personal_access_tokens/client.py b/src/truefoundry_sdk/personal_access_tokens/client.py
index 8e458c9..65ed5a0 100644
--- a/src/truefoundry_sdk/personal_access_tokens/client.py
+++ b/src/truefoundry_sdk/personal_access_tokens/client.py
@@ -8,6 +8,7 @@
from ..types.create_personal_access_token_response import CreatePersonalAccessTokenResponse
from ..types.delete_personal_access_token_response import DeletePersonalAccessTokenResponse
from ..types.get_or_create_personal_access_token_response import GetOrCreatePersonalAccessTokenResponse
+from ..types.list_personal_access_token_response import ListPersonalAccessTokenResponse
from ..types.revoke_all_personal_access_token_response import RevokeAllPersonalAccessTokenResponse
from ..types.virtual_account import VirtualAccount
from .raw_client import AsyncRawPersonalAccessTokensClient, RawPersonalAccessTokensClient
@@ -37,7 +38,7 @@ def list(
limit: typing.Optional[int] = 100,
offset: typing.Optional[int] = 0,
request_options: typing.Optional[RequestOptions] = None,
- ) -> SyncPager[VirtualAccount]:
+ ) -> SyncPager[VirtualAccount, ListPersonalAccessTokenResponse]:
"""
List Personal Access Tokens created by the user in the current tenant.
@@ -54,7 +55,7 @@ def list(
Returns
-------
- SyncPager[VirtualAccount]
+ SyncPager[VirtualAccount, ListPersonalAccessTokenResponse]
Returns all Personal Access Tokens created by the user in the current tenant.
Examples
@@ -247,7 +248,7 @@ async def list(
limit: typing.Optional[int] = 100,
offset: typing.Optional[int] = 0,
request_options: typing.Optional[RequestOptions] = None,
- ) -> AsyncPager[VirtualAccount]:
+ ) -> AsyncPager[VirtualAccount, ListPersonalAccessTokenResponse]:
"""
List Personal Access Tokens created by the user in the current tenant.
@@ -264,7 +265,7 @@ async def list(
Returns
-------
- AsyncPager[VirtualAccount]
+ AsyncPager[VirtualAccount, ListPersonalAccessTokenResponse]
Returns all Personal Access Tokens created by the user in the current tenant.
Examples
diff --git a/src/truefoundry_sdk/personal_access_tokens/raw_client.py b/src/truefoundry_sdk/personal_access_tokens/raw_client.py
index 233786b..7234e8f 100644
--- a/src/truefoundry_sdk/personal_access_tokens/raw_client.py
+++ b/src/truefoundry_sdk/personal_access_tokens/raw_client.py
@@ -7,7 +7,7 @@
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from ..core.http_response import AsyncHttpResponse, HttpResponse
from ..core.jsonable_encoder import jsonable_encoder
-from ..core.pagination import AsyncPager, BaseHttpResponse, SyncPager
+from ..core.pagination import AsyncPager, SyncPager
from ..core.pydantic_utilities import parse_obj_as
from ..core.request_options import RequestOptions
from ..errors.bad_request_error import BadRequestError
@@ -35,7 +35,7 @@ def list(
limit: typing.Optional[int] = 100,
offset: typing.Optional[int] = 0,
request_options: typing.Optional[RequestOptions] = None,
- ) -> SyncPager[VirtualAccount]:
+ ) -> SyncPager[VirtualAccount, ListPersonalAccessTokenResponse]:
"""
List Personal Access Tokens created by the user in the current tenant.
@@ -52,7 +52,7 @@ def list(
Returns
-------
- SyncPager[VirtualAccount]
+ SyncPager[VirtualAccount, ListPersonalAccessTokenResponse]
Returns all Personal Access Tokens created by the user in the current tenant.
"""
offset = offset if offset is not None else 0
@@ -82,9 +82,7 @@ def list(
offset=offset + len(_items),
request_options=request_options,
)
- return SyncPager(
- has_next=_has_next, items=_items, get_next=_get_next, response=BaseHttpResponse(response=_response)
- )
+ return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
@@ -148,9 +146,9 @@ def create(
raise BadRequestError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -216,9 +214,9 @@ def revoke_all(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -266,9 +264,9 @@ def delete(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -315,9 +313,9 @@ def get(
raise BadRequestError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -338,7 +336,7 @@ async def list(
limit: typing.Optional[int] = 100,
offset: typing.Optional[int] = 0,
request_options: typing.Optional[RequestOptions] = None,
- ) -> AsyncPager[VirtualAccount]:
+ ) -> AsyncPager[VirtualAccount, ListPersonalAccessTokenResponse]:
"""
List Personal Access Tokens created by the user in the current tenant.
@@ -355,7 +353,7 @@ async def list(
Returns
-------
- AsyncPager[VirtualAccount]
+ AsyncPager[VirtualAccount, ListPersonalAccessTokenResponse]
Returns all Personal Access Tokens created by the user in the current tenant.
"""
offset = offset if offset is not None else 0
@@ -388,9 +386,7 @@ async def _get_next():
request_options=request_options,
)
- return AsyncPager(
- has_next=_has_next, items=_items, get_next=_get_next, response=BaseHttpResponse(response=_response)
- )
+ return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
@@ -454,9 +450,9 @@ async def create(
raise BadRequestError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -522,9 +518,9 @@ async def revoke_all(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -572,9 +568,9 @@ async def delete(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -621,9 +617,9 @@ async def get(
raise BadRequestError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
diff --git a/src/truefoundry_sdk/prompt_versions/client.py b/src/truefoundry_sdk/prompt_versions/client.py
index 36381e7..8f28a44 100644
--- a/src/truefoundry_sdk/prompt_versions/client.py
+++ b/src/truefoundry_sdk/prompt_versions/client.py
@@ -7,6 +7,7 @@
from ..core.request_options import RequestOptions
from ..types.empty_response import EmptyResponse
from ..types.get_prompt_version_response import GetPromptVersionResponse
+from ..types.list_prompt_versions_response import ListPromptVersionsResponse
from ..types.prompt_version import PromptVersion
from .raw_client import AsyncRawPromptVersionsClient, RawPromptVersionsClient
@@ -146,7 +147,7 @@ def list(
offset: typing.Optional[int] = 0,
limit: typing.Optional[int] = 100,
request_options: typing.Optional[RequestOptions] = None,
- ) -> SyncPager[PromptVersion]:
+ ) -> SyncPager[PromptVersion, ListPromptVersionsResponse]:
"""
List prompt version API
@@ -173,7 +174,7 @@ def list(
Returns
-------
- SyncPager[PromptVersion]
+ SyncPager[PromptVersion, ListPromptVersionsResponse]
Successful Response
Examples
@@ -371,7 +372,7 @@ async def list(
offset: typing.Optional[int] = 0,
limit: typing.Optional[int] = 100,
request_options: typing.Optional[RequestOptions] = None,
- ) -> AsyncPager[PromptVersion]:
+ ) -> AsyncPager[PromptVersion, ListPromptVersionsResponse]:
"""
List prompt version API
@@ -398,7 +399,7 @@ async def list(
Returns
-------
- AsyncPager[PromptVersion]
+ AsyncPager[PromptVersion, ListPromptVersionsResponse]
Successful Response
Examples
diff --git a/src/truefoundry_sdk/prompt_versions/raw_client.py b/src/truefoundry_sdk/prompt_versions/raw_client.py
index 495326d..9b62c9f 100644
--- a/src/truefoundry_sdk/prompt_versions/raw_client.py
+++ b/src/truefoundry_sdk/prompt_versions/raw_client.py
@@ -7,7 +7,7 @@
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from ..core.http_response import AsyncHttpResponse, HttpResponse
from ..core.jsonable_encoder import jsonable_encoder
-from ..core.pagination import AsyncPager, BaseHttpResponse, SyncPager
+from ..core.pagination import AsyncPager, SyncPager
from ..core.pydantic_utilities import parse_obj_as
from ..core.request_options import RequestOptions
from ..errors.unprocessable_entity_error import UnprocessableEntityError
@@ -77,9 +77,9 @@ def apply_tags(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -126,9 +126,9 @@ def get(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -175,9 +175,9 @@ def delete(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -199,7 +199,7 @@ def list(
offset: typing.Optional[int] = 0,
limit: typing.Optional[int] = 100,
request_options: typing.Optional[RequestOptions] = None,
- ) -> SyncPager[PromptVersion]:
+ ) -> SyncPager[PromptVersion, ListPromptVersionsResponse]:
"""
List prompt version API
@@ -226,7 +226,7 @@ def list(
Returns
-------
- SyncPager[PromptVersion]
+ SyncPager[PromptVersion, ListPromptVersionsResponse]
Successful Response
"""
offset = offset if offset is not None else 0
@@ -268,16 +268,14 @@ def list(
limit=limit,
request_options=request_options,
)
- return SyncPager(
- has_next=_has_next, items=_items, get_next=_get_next, response=BaseHttpResponse(response=_response)
- )
+ return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -345,9 +343,9 @@ async def apply_tags(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -394,9 +392,9 @@ async def get(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -443,9 +441,9 @@ async def delete(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -467,7 +465,7 @@ async def list(
offset: typing.Optional[int] = 0,
limit: typing.Optional[int] = 100,
request_options: typing.Optional[RequestOptions] = None,
- ) -> AsyncPager[PromptVersion]:
+ ) -> AsyncPager[PromptVersion, ListPromptVersionsResponse]:
"""
List prompt version API
@@ -494,7 +492,7 @@ async def list(
Returns
-------
- AsyncPager[PromptVersion]
+ AsyncPager[PromptVersion, ListPromptVersionsResponse]
Successful Response
"""
offset = offset if offset is not None else 0
@@ -539,16 +537,14 @@ async def _get_next():
request_options=request_options,
)
- return AsyncPager(
- has_next=_has_next, items=_items, get_next=_get_next, response=BaseHttpResponse(response=_response)
- )
+ return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
diff --git a/src/truefoundry_sdk/prompts/client.py b/src/truefoundry_sdk/prompts/client.py
index f19e411..5df81f3 100644
--- a/src/truefoundry_sdk/prompts/client.py
+++ b/src/truefoundry_sdk/prompts/client.py
@@ -9,6 +9,7 @@
from ..types.empty_response import EmptyResponse
from ..types.get_prompt_response import GetPromptResponse
from ..types.get_prompt_version_response import GetPromptVersionResponse
+from ..types.list_prompts_response import ListPromptsResponse
from ..types.prompt import Prompt
from .raw_client import AsyncRawPromptsClient, RawPromptsClient
@@ -97,8 +98,9 @@ def list(
name: typing.Optional[str] = None,
offset: typing.Optional[int] = 0,
limit: typing.Optional[int] = 100,
+ include_empty_prompts: typing.Optional[bool] = True,
request_options: typing.Optional[RequestOptions] = None,
- ) -> SyncPager[Prompt]:
+ ) -> SyncPager[Prompt, ListPromptsResponse]:
"""
Parameters
----------
@@ -112,12 +114,14 @@ def list(
limit : typing.Optional[int]
+ include_empty_prompts : typing.Optional[bool]
+
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
- SyncPager[Prompt]
+ SyncPager[Prompt, ListPromptsResponse]
Successful Response
Examples
@@ -134,6 +138,7 @@ def list(
name="name",
offset=1,
limit=1,
+ include_empty_prompts=True,
)
for item in response:
yield item
@@ -142,7 +147,13 @@ def list(
yield page
"""
return self._raw_client.list(
- fqn=fqn, ml_repo_id=ml_repo_id, name=name, offset=offset, limit=limit, request_options=request_options
+ fqn=fqn,
+ ml_repo_id=ml_repo_id,
+ name=name,
+ offset=offset,
+ limit=limit,
+ include_empty_prompts=include_empty_prompts,
+ request_options=request_options,
)
def create_or_update(
@@ -283,8 +294,9 @@ async def list(
name: typing.Optional[str] = None,
offset: typing.Optional[int] = 0,
limit: typing.Optional[int] = 100,
+ include_empty_prompts: typing.Optional[bool] = True,
request_options: typing.Optional[RequestOptions] = None,
- ) -> AsyncPager[Prompt]:
+ ) -> AsyncPager[Prompt, ListPromptsResponse]:
"""
Parameters
----------
@@ -298,12 +310,14 @@ async def list(
limit : typing.Optional[int]
+ include_empty_prompts : typing.Optional[bool]
+
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
- AsyncPager[Prompt]
+ AsyncPager[Prompt, ListPromptsResponse]
Successful Response
Examples
@@ -325,6 +339,7 @@ async def main() -> None:
name="name",
offset=1,
limit=1,
+ include_empty_prompts=True,
)
async for item in response:
yield item
@@ -337,7 +352,13 @@ async def main() -> None:
asyncio.run(main())
"""
return await self._raw_client.list(
- fqn=fqn, ml_repo_id=ml_repo_id, name=name, offset=offset, limit=limit, request_options=request_options
+ fqn=fqn,
+ ml_repo_id=ml_repo_id,
+ name=name,
+ offset=offset,
+ limit=limit,
+ include_empty_prompts=include_empty_prompts,
+ request_options=request_options,
)
async def create_or_update(
diff --git a/src/truefoundry_sdk/prompts/raw_client.py b/src/truefoundry_sdk/prompts/raw_client.py
index 570368c..1eba8eb 100644
--- a/src/truefoundry_sdk/prompts/raw_client.py
+++ b/src/truefoundry_sdk/prompts/raw_client.py
@@ -7,7 +7,7 @@
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from ..core.http_response import AsyncHttpResponse, HttpResponse
from ..core.jsonable_encoder import jsonable_encoder
-from ..core.pagination import AsyncPager, BaseHttpResponse, SyncPager
+from ..core.pagination import AsyncPager, SyncPager
from ..core.pydantic_utilities import parse_obj_as
from ..core.request_options import RequestOptions
from ..core.serialization import convert_and_respect_annotation_metadata
@@ -62,9 +62,9 @@ def get(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -109,9 +109,9 @@ def delete(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -129,8 +129,9 @@ def list(
name: typing.Optional[str] = None,
offset: typing.Optional[int] = 0,
limit: typing.Optional[int] = 100,
+ include_empty_prompts: typing.Optional[bool] = True,
request_options: typing.Optional[RequestOptions] = None,
- ) -> SyncPager[Prompt]:
+ ) -> SyncPager[Prompt, ListPromptsResponse]:
"""
Parameters
----------
@@ -144,12 +145,14 @@ def list(
limit : typing.Optional[int]
+ include_empty_prompts : typing.Optional[bool]
+
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
- SyncPager[Prompt]
+ SyncPager[Prompt, ListPromptsResponse]
Successful Response
"""
offset = offset if offset is not None else 0
@@ -163,6 +166,7 @@ def list(
"name": name,
"offset": offset,
"limit": limit,
+ "include_empty_prompts": include_empty_prompts,
},
request_options=request_options,
)
@@ -183,18 +187,17 @@ def list(
name=name,
offset=offset + len(_items),
limit=limit,
+ include_empty_prompts=include_empty_prompts,
request_options=request_options,
)
- return SyncPager(
- has_next=_has_next, items=_items, get_next=_get_next, response=BaseHttpResponse(response=_response)
- )
+ return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -248,9 +251,9 @@ def create_or_update(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -300,9 +303,9 @@ async def get(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -347,9 +350,9 @@ async def delete(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -367,8 +370,9 @@ async def list(
name: typing.Optional[str] = None,
offset: typing.Optional[int] = 0,
limit: typing.Optional[int] = 100,
+ include_empty_prompts: typing.Optional[bool] = True,
request_options: typing.Optional[RequestOptions] = None,
- ) -> AsyncPager[Prompt]:
+ ) -> AsyncPager[Prompt, ListPromptsResponse]:
"""
Parameters
----------
@@ -382,12 +386,14 @@ async def list(
limit : typing.Optional[int]
+ include_empty_prompts : typing.Optional[bool]
+
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
- AsyncPager[Prompt]
+ AsyncPager[Prompt, ListPromptsResponse]
Successful Response
"""
offset = offset if offset is not None else 0
@@ -401,6 +407,7 @@ async def list(
"name": name,
"offset": offset,
"limit": limit,
+ "include_empty_prompts": include_empty_prompts,
},
request_options=request_options,
)
@@ -423,19 +430,18 @@ async def _get_next():
name=name,
offset=offset + len(_items),
limit=limit,
+ include_empty_prompts=include_empty_prompts,
request_options=request_options,
)
- return AsyncPager(
- has_next=_has_next, items=_items, get_next=_get_next, response=BaseHttpResponse(response=_response)
- )
+ return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -489,9 +495,9 @@ async def create_or_update(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
diff --git a/src/truefoundry_sdk/secret_groups/client.py b/src/truefoundry_sdk/secret_groups/client.py
index 149dc16..bcb0cb8 100644
--- a/src/truefoundry_sdk/secret_groups/client.py
+++ b/src/truefoundry_sdk/secret_groups/client.py
@@ -7,7 +7,9 @@
from ..core.request_options import RequestOptions
from ..types.delete_secret_group_response import DeleteSecretGroupResponse
from ..types.get_secret_group_response import GetSecretGroupResponse
+from ..types.list_secret_group_response import ListSecretGroupResponse
from ..types.secret_group import SecretGroup
+from ..types.secret_group_manifest import SecretGroupManifest
from ..types.secret_input import SecretInput
from ..types.update_secret_input import UpdateSecretInput
from .raw_client import AsyncRawSecretGroupsClient, RawSecretGroupsClient
@@ -39,7 +41,7 @@ def list(
fqn: typing.Optional[str] = None,
search: typing.Optional[str] = None,
request_options: typing.Optional[RequestOptions] = None,
- ) -> SyncPager[SecretGroup]:
+ ) -> SyncPager[SecretGroup, ListSecretGroupResponse]:
"""
List the secret groups associated with a user along with the associated secrets for each group. Filtered with the options passed in the query fields. Note: This method does not return the secret values of the associatedSecrets in the response. A separate API call to `/v1/secrets/{id}` should be made to fetch the associated secret value.
@@ -62,7 +64,7 @@ def list(
Returns
-------
- SyncPager[SecretGroup]
+ SyncPager[SecretGroup, ListSecretGroupResponse]
Returns all the secret groups associated with a user along with the associated secrets for each group.
Examples
@@ -143,6 +145,49 @@ def create(
)
return _response.data
+ def create_or_update(
+ self, *, manifest: SecretGroupManifest, request_options: typing.Optional[RequestOptions] = None
+ ) -> GetSecretGroupResponse:
+ """
+ Creates a new secret group or updates an existing one based on the provided manifest.
+
+ Parameters
+ ----------
+ manifest : SecretGroupManifest
+ Secret Group Manifest
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ GetSecretGroupResponse
+ Secret group created or updated successfully.
+
+ Examples
+ --------
+ from truefoundry_sdk import Collaborator, SecretGroupManifest, TrueFoundry
+
+ client = TrueFoundry(
+ api_key="YOUR_API_KEY",
+ base_url="https://yourhost.com/path/to/api",
+ )
+ client.secret_groups.create_or_update(
+ manifest=SecretGroupManifest(
+ name="name",
+ integration_fqn="integration_fqn",
+ collaborators=[
+ Collaborator(
+ subject="subject",
+ role_id="role_id",
+ )
+ ],
+ ),
+ )
+ """
+ _response = self._raw_client.create_or_update(manifest=manifest, request_options=request_options)
+ return _response.data
+
def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> GetSecretGroupResponse:
"""
Get Secret Group by id. This method does not return the secret values of the associatedSecrets in the response. A separate API call to `/v1/secrets/{id}` should be made to fetch the associated secret value.
@@ -276,7 +321,7 @@ async def list(
fqn: typing.Optional[str] = None,
search: typing.Optional[str] = None,
request_options: typing.Optional[RequestOptions] = None,
- ) -> AsyncPager[SecretGroup]:
+ ) -> AsyncPager[SecretGroup, ListSecretGroupResponse]:
"""
List the secret groups associated with a user along with the associated secrets for each group. Filtered with the options passed in the query fields. Note: This method does not return the secret values of the associatedSecrets in the response. A separate API call to `/v1/secrets/{id}` should be made to fetch the associated secret value.
@@ -299,7 +344,7 @@ async def list(
Returns
-------
- AsyncPager[SecretGroup]
+ AsyncPager[SecretGroup, ListSecretGroupResponse]
Returns all the secret groups associated with a user along with the associated secrets for each group.
Examples
@@ -397,6 +442,57 @@ async def main() -> None:
)
return _response.data
+ async def create_or_update(
+ self, *, manifest: SecretGroupManifest, request_options: typing.Optional[RequestOptions] = None
+ ) -> GetSecretGroupResponse:
+ """
+ Creates a new secret group or updates an existing one based on the provided manifest.
+
+ Parameters
+ ----------
+ manifest : SecretGroupManifest
+ Secret Group Manifest
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ GetSecretGroupResponse
+ Secret group created or updated successfully.
+
+ Examples
+ --------
+ import asyncio
+
+ from truefoundry_sdk import AsyncTrueFoundry, Collaborator, SecretGroupManifest
+
+ client = AsyncTrueFoundry(
+ api_key="YOUR_API_KEY",
+ base_url="https://yourhost.com/path/to/api",
+ )
+
+
+ async def main() -> None:
+ await client.secret_groups.create_or_update(
+ manifest=SecretGroupManifest(
+ name="name",
+ integration_fqn="integration_fqn",
+ collaborators=[
+ Collaborator(
+ subject="subject",
+ role_id="role_id",
+ )
+ ],
+ ),
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._raw_client.create_or_update(manifest=manifest, request_options=request_options)
+ return _response.data
+
async def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> GetSecretGroupResponse:
"""
Get Secret Group by id. This method does not return the secret values of the associatedSecrets in the response. A separate API call to `/v1/secrets/{id}` should be made to fetch the associated secret value.
diff --git a/src/truefoundry_sdk/secret_groups/raw_client.py b/src/truefoundry_sdk/secret_groups/raw_client.py
index 08a5bc8..9cb9943 100644
--- a/src/truefoundry_sdk/secret_groups/raw_client.py
+++ b/src/truefoundry_sdk/secret_groups/raw_client.py
@@ -7,11 +7,12 @@
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from ..core.http_response import AsyncHttpResponse, HttpResponse
from ..core.jsonable_encoder import jsonable_encoder
-from ..core.pagination import AsyncPager, BaseHttpResponse, SyncPager
+from ..core.pagination import AsyncPager, SyncPager
from ..core.pydantic_utilities import parse_obj_as
from ..core.request_options import RequestOptions
from ..core.serialization import convert_and_respect_annotation_metadata
from ..errors.bad_request_error import BadRequestError
+from ..errors.conflict_error import ConflictError
from ..errors.failed_dependency_error import FailedDependencyError
from ..errors.forbidden_error import ForbiddenError
from ..errors.not_found_error import NotFoundError
@@ -21,6 +22,7 @@
from ..types.http_error import HttpError
from ..types.list_secret_group_response import ListSecretGroupResponse
from ..types.secret_group import SecretGroup
+from ..types.secret_group_manifest import SecretGroupManifest
from ..types.secret_input import SecretInput
from ..types.update_secret_input import UpdateSecretInput
@@ -40,7 +42,7 @@ def list(
fqn: typing.Optional[str] = None,
search: typing.Optional[str] = None,
request_options: typing.Optional[RequestOptions] = None,
- ) -> SyncPager[SecretGroup]:
+ ) -> SyncPager[SecretGroup, ListSecretGroupResponse]:
"""
List the secret groups associated with a user along with the associated secrets for each group. Filtered with the options passed in the query fields. Note: This method does not return the secret values of the associatedSecrets in the response. A separate API call to `/v1/secrets/{id}` should be made to fetch the associated secret value.
@@ -63,7 +65,7 @@ def list(
Returns
-------
- SyncPager[SecretGroup]
+ SyncPager[SecretGroup, ListSecretGroupResponse]
Returns all the secret groups associated with a user along with the associated secrets for each group.
"""
offset = offset if offset is not None else 0
@@ -97,9 +99,7 @@ def list(
search=search,
request_options=request_options,
)
- return SyncPager(
- has_next=_has_next, items=_items, get_next=_get_next, response=BaseHttpResponse(response=_response)
- )
+ return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
@@ -165,9 +165,9 @@ def create(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -188,6 +188,109 @@ def create(
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
+ def create_or_update(
+ self, *, manifest: SecretGroupManifest, request_options: typing.Optional[RequestOptions] = None
+ ) -> HttpResponse[GetSecretGroupResponse]:
+ """
+ Creates a new secret group or updates an existing one based on the provided manifest.
+
+ Parameters
+ ----------
+ manifest : SecretGroupManifest
+ Secret Group Manifest
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ HttpResponse[GetSecretGroupResponse]
+ Secret group created or updated successfully.
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "api/svc/v1/secret-groups",
+ method="PUT",
+ json={
+ "manifest": convert_and_respect_annotation_metadata(
+ object_=manifest, annotation=SecretGroupManifest, direction="write"
+ ),
+ },
+ headers={
+ "content-type": "application/json",
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ _data = typing.cast(
+ GetSecretGroupResponse,
+ parse_obj_as(
+ type_=GetSecretGroupResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ return HttpResponse(response=_response, data=_data)
+ if _response.status_code == 400:
+ raise BadRequestError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ typing.Any,
+ parse_obj_as(
+ type_=typing.Any, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ HttpError,
+ parse_obj_as(
+ type_=HttpError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ typing.Any,
+ parse_obj_as(
+ type_=typing.Any, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ HttpError,
+ parse_obj_as(
+ type_=HttpError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ typing.Any,
+ parse_obj_as(
+ type_=typing.Any, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
+
def get(
self, id: str, *, request_options: typing.Optional[RequestOptions] = None
) -> HttpResponse[GetSecretGroupResponse]:
@@ -237,9 +340,9 @@ def get(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -302,9 +405,9 @@ def update(
raise BadRequestError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -324,9 +427,9 @@ def update(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -335,9 +438,9 @@ def update(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -396,9 +499,9 @@ def delete(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -421,7 +524,7 @@ async def list(
fqn: typing.Optional[str] = None,
search: typing.Optional[str] = None,
request_options: typing.Optional[RequestOptions] = None,
- ) -> AsyncPager[SecretGroup]:
+ ) -> AsyncPager[SecretGroup, ListSecretGroupResponse]:
"""
List the secret groups associated with a user along with the associated secrets for each group. Filtered with the options passed in the query fields. Note: This method does not return the secret values of the associatedSecrets in the response. A separate API call to `/v1/secrets/{id}` should be made to fetch the associated secret value.
@@ -444,7 +547,7 @@ async def list(
Returns
-------
- AsyncPager[SecretGroup]
+ AsyncPager[SecretGroup, ListSecretGroupResponse]
Returns all the secret groups associated with a user along with the associated secrets for each group.
"""
offset = offset if offset is not None else 0
@@ -481,9 +584,7 @@ async def _get_next():
request_options=request_options,
)
- return AsyncPager(
- has_next=_has_next, items=_items, get_next=_get_next, response=BaseHttpResponse(response=_response)
- )
+ return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
@@ -549,9 +650,9 @@ async def create(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -572,6 +673,109 @@ async def create(
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
+ async def create_or_update(
+ self, *, manifest: SecretGroupManifest, request_options: typing.Optional[RequestOptions] = None
+ ) -> AsyncHttpResponse[GetSecretGroupResponse]:
+ """
+ Creates a new secret group or updates an existing one based on the provided manifest.
+
+ Parameters
+ ----------
+ manifest : SecretGroupManifest
+ Secret Group Manifest
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ AsyncHttpResponse[GetSecretGroupResponse]
+ Secret group created or updated successfully.
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "api/svc/v1/secret-groups",
+ method="PUT",
+ json={
+ "manifest": convert_and_respect_annotation_metadata(
+ object_=manifest, annotation=SecretGroupManifest, direction="write"
+ ),
+ },
+ headers={
+ "content-type": "application/json",
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ _data = typing.cast(
+ GetSecretGroupResponse,
+ parse_obj_as(
+ type_=GetSecretGroupResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ return AsyncHttpResponse(response=_response, data=_data)
+ if _response.status_code == 400:
+ raise BadRequestError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ typing.Any,
+ parse_obj_as(
+ type_=typing.Any, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ HttpError,
+ parse_obj_as(
+ type_=HttpError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ typing.Any,
+ parse_obj_as(
+ type_=typing.Any, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ HttpError,
+ parse_obj_as(
+ type_=HttpError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ typing.Any,
+ parse_obj_as(
+ type_=typing.Any, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
+
async def get(
self, id: str, *, request_options: typing.Optional[RequestOptions] = None
) -> AsyncHttpResponse[GetSecretGroupResponse]:
@@ -621,9 +825,9 @@ async def get(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -686,9 +890,9 @@ async def update(
raise BadRequestError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -708,9 +912,9 @@ async def update(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -719,9 +923,9 @@ async def update(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -780,9 +984,9 @@ async def delete(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
diff --git a/src/truefoundry_sdk/secrets/client.py b/src/truefoundry_sdk/secrets/client.py
index e6bd446..94b434c 100644
--- a/src/truefoundry_sdk/secrets/client.py
+++ b/src/truefoundry_sdk/secrets/client.py
@@ -6,6 +6,7 @@
from ..core.pagination import AsyncPager, SyncPager
from ..core.request_options import RequestOptions
from ..types.get_secret_response import GetSecretResponse
+from ..types.list_secrets_response import ListSecretsResponse
from ..types.secret import Secret
from .raw_client import AsyncRawSecretsClient, RawSecretsClient
@@ -37,7 +38,7 @@ def list(
secret_group_id: typing.Optional[str] = OMIT,
with_value: typing.Optional[bool] = False,
request_options: typing.Optional[RequestOptions] = None,
- ) -> SyncPager[Secret]:
+ ) -> SyncPager[Secret, ListSecretsResponse]:
"""
List secrets associated with a user filtered with optional parameters passed in the body.
@@ -63,7 +64,7 @@ def list(
Returns
-------
- SyncPager[Secret]
+ SyncPager[Secret, ListSecretsResponse]
Returns the secrets associated with a user filtered with optional parameters passed in the body.
Examples
@@ -179,7 +180,7 @@ async def list(
secret_group_id: typing.Optional[str] = OMIT,
with_value: typing.Optional[bool] = False,
request_options: typing.Optional[RequestOptions] = None,
- ) -> AsyncPager[Secret]:
+ ) -> AsyncPager[Secret, ListSecretsResponse]:
"""
List secrets associated with a user filtered with optional parameters passed in the body.
@@ -205,7 +206,7 @@ async def list(
Returns
-------
- AsyncPager[Secret]
+ AsyncPager[Secret, ListSecretsResponse]
Returns the secrets associated with a user filtered with optional parameters passed in the body.
Examples
diff --git a/src/truefoundry_sdk/secrets/raw_client.py b/src/truefoundry_sdk/secrets/raw_client.py
index 4bb9225..44d1489 100644
--- a/src/truefoundry_sdk/secrets/raw_client.py
+++ b/src/truefoundry_sdk/secrets/raw_client.py
@@ -7,7 +7,7 @@
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from ..core.http_response import AsyncHttpResponse, HttpResponse
from ..core.jsonable_encoder import jsonable_encoder
-from ..core.pagination import AsyncPager, BaseHttpResponse, SyncPager
+from ..core.pagination import AsyncPager, SyncPager
from ..core.pydantic_utilities import parse_obj_as
from ..core.request_options import RequestOptions
from ..errors.failed_dependency_error import FailedDependencyError
@@ -35,7 +35,7 @@ def list(
secret_group_id: typing.Optional[str] = OMIT,
with_value: typing.Optional[bool] = False,
request_options: typing.Optional[RequestOptions] = None,
- ) -> SyncPager[Secret]:
+ ) -> SyncPager[Secret, ListSecretsResponse]:
"""
List secrets associated with a user filtered with optional parameters passed in the body.
@@ -61,7 +61,7 @@ def list(
Returns
-------
- SyncPager[Secret]
+ SyncPager[Secret, ListSecretsResponse]
Returns the secrets associated with a user filtered with optional parameters passed in the body.
"""
offset = offset if offset is not None else 0
@@ -101,9 +101,7 @@ def list(
with_value=with_value,
request_options=request_options,
)
- return SyncPager(
- has_next=_has_next, items=_items, get_next=_get_next, response=BaseHttpResponse(response=_response)
- )
+ return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
if _response.status_code == 403:
raise ForbiddenError(
headers=dict(_response.headers),
@@ -119,9 +117,9 @@ def list(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -180,9 +178,9 @@ def get(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -239,9 +237,9 @@ def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] =
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -276,7 +274,7 @@ async def list(
secret_group_id: typing.Optional[str] = OMIT,
with_value: typing.Optional[bool] = False,
request_options: typing.Optional[RequestOptions] = None,
- ) -> AsyncPager[Secret]:
+ ) -> AsyncPager[Secret, ListSecretsResponse]:
"""
List secrets associated with a user filtered with optional parameters passed in the body.
@@ -302,7 +300,7 @@ async def list(
Returns
-------
- AsyncPager[Secret]
+ AsyncPager[Secret, ListSecretsResponse]
Returns the secrets associated with a user filtered with optional parameters passed in the body.
"""
offset = offset if offset is not None else 0
@@ -345,9 +343,7 @@ async def _get_next():
request_options=request_options,
)
- return AsyncPager(
- has_next=_has_next, items=_items, get_next=_get_next, response=BaseHttpResponse(response=_response)
- )
+ return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
if _response.status_code == 403:
raise ForbiddenError(
headers=dict(_response.headers),
@@ -363,9 +359,9 @@ async def _get_next():
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -424,9 +420,9 @@ async def get(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -485,9 +481,9 @@ async def delete(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
diff --git a/src/truefoundry_sdk/teams/client.py b/src/truefoundry_sdk/teams/client.py
index ea3e97b..ce6e3fe 100644
--- a/src/truefoundry_sdk/teams/client.py
+++ b/src/truefoundry_sdk/teams/client.py
@@ -7,6 +7,7 @@
from ..core.request_options import RequestOptions
from ..types.delete_team_response import DeleteTeamResponse
from ..types.get_team_response import GetTeamResponse
+from ..types.list_teams_response import ListTeamsResponse
from ..types.team import Team
from .raw_client import AsyncRawTeamsClient, RawTeamsClient
from .types.apply_team_request_manifest import ApplyTeamRequestManifest
@@ -38,7 +39,7 @@ def list(
offset: typing.Optional[int] = 0,
type: typing.Optional[TeamsListRequestType] = None,
request_options: typing.Optional[RequestOptions] = None,
- ) -> SyncPager[Team]:
+ ) -> SyncPager[Team, ListTeamsResponse]:
"""
Retrieve all teams associated with the authenticated user. If the user is a tenant admin, returns all teams for the tenant. Pagination is available based on query parameters
@@ -58,7 +59,7 @@ def list(
Returns
-------
- SyncPager[Team]
+ SyncPager[Team, ListTeamsResponse]
Returns an array of teams associated with the user or tenant And also the response includes paginated data
Examples
@@ -216,7 +217,7 @@ async def list(
offset: typing.Optional[int] = 0,
type: typing.Optional[TeamsListRequestType] = None,
request_options: typing.Optional[RequestOptions] = None,
- ) -> AsyncPager[Team]:
+ ) -> AsyncPager[Team, ListTeamsResponse]:
"""
Retrieve all teams associated with the authenticated user. If the user is a tenant admin, returns all teams for the tenant. Pagination is available based on query parameters
@@ -236,7 +237,7 @@ async def list(
Returns
-------
- AsyncPager[Team]
+ AsyncPager[Team, ListTeamsResponse]
Returns an array of teams associated with the user or tenant And also the response includes paginated data
Examples
diff --git a/src/truefoundry_sdk/teams/raw_client.py b/src/truefoundry_sdk/teams/raw_client.py
index 574d8a4..a57e0b3 100644
--- a/src/truefoundry_sdk/teams/raw_client.py
+++ b/src/truefoundry_sdk/teams/raw_client.py
@@ -7,7 +7,7 @@
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from ..core.http_response import AsyncHttpResponse, HttpResponse
from ..core.jsonable_encoder import jsonable_encoder
-from ..core.pagination import AsyncPager, BaseHttpResponse, SyncPager
+from ..core.pagination import AsyncPager, SyncPager
from ..core.pydantic_utilities import parse_obj_as
from ..core.request_options import RequestOptions
from ..core.serialization import convert_and_respect_annotation_metadata
@@ -37,7 +37,7 @@ def list(
offset: typing.Optional[int] = 0,
type: typing.Optional[TeamsListRequestType] = None,
request_options: typing.Optional[RequestOptions] = None,
- ) -> SyncPager[Team]:
+ ) -> SyncPager[Team, ListTeamsResponse]:
"""
Retrieve all teams associated with the authenticated user. If the user is a tenant admin, returns all teams for the tenant. Pagination is available based on query parameters
@@ -57,7 +57,7 @@ def list(
Returns
-------
- SyncPager[Team]
+ SyncPager[Team, ListTeamsResponse]
Returns an array of teams associated with the user or tenant And also the response includes paginated data
"""
offset = offset if offset is not None else 0
@@ -89,9 +89,7 @@ def list(
type=type,
request_options=request_options,
)
- return SyncPager(
- has_next=_has_next, items=_items, get_next=_get_next, response=BaseHttpResponse(response=_response)
- )
+ return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
@@ -163,9 +161,9 @@ def create_or_update(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -211,9 +209,9 @@ def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = Non
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -261,9 +259,9 @@ def delete(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -296,7 +294,7 @@ async def list(
offset: typing.Optional[int] = 0,
type: typing.Optional[TeamsListRequestType] = None,
request_options: typing.Optional[RequestOptions] = None,
- ) -> AsyncPager[Team]:
+ ) -> AsyncPager[Team, ListTeamsResponse]:
"""
Retrieve all teams associated with the authenticated user. If the user is a tenant admin, returns all teams for the tenant. Pagination is available based on query parameters
@@ -316,7 +314,7 @@ async def list(
Returns
-------
- AsyncPager[Team]
+ AsyncPager[Team, ListTeamsResponse]
Returns an array of teams associated with the user or tenant And also the response includes paginated data
"""
offset = offset if offset is not None else 0
@@ -351,9 +349,7 @@ async def _get_next():
request_options=request_options,
)
- return AsyncPager(
- has_next=_has_next, items=_items, get_next=_get_next, response=BaseHttpResponse(response=_response)
- )
+ return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
@@ -425,9 +421,9 @@ async def create_or_update(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -475,9 +471,9 @@ async def get(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -525,9 +521,9 @@ async def delete(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
diff --git a/src/truefoundry_sdk/teams/types/teams_list_request_type.py b/src/truefoundry_sdk/teams/types/teams_list_request_type.py
index d40364a..c694208 100644
--- a/src/truefoundry_sdk/teams/types/teams_list_request_type.py
+++ b/src/truefoundry_sdk/teams/types/teams_list_request_type.py
@@ -1,12 +1,13 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ...core import enum
+
T_Result = typing.TypeVar("T_Result")
-class TeamsListRequestType(str, enum.Enum):
+class TeamsListRequestType(enum.StrEnum):
TEAM = "team"
SSO_TEAM = "sso-team"
diff --git a/src/truefoundry_sdk/traces/client.py b/src/truefoundry_sdk/traces/client.py
index c48856b..2f31f19 100644
--- a/src/truefoundry_sdk/traces/client.py
+++ b/src/truefoundry_sdk/traces/client.py
@@ -5,6 +5,7 @@
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from ..core.pagination import AsyncPager, SyncPager
from ..core.request_options import RequestOptions
+from ..types.query_spans_response import QuerySpansResponse
from ..types.sort_direction import SortDirection
from ..types.subject_type import SubjectType
from ..types.trace_span import TraceSpan
@@ -47,7 +48,7 @@ def query_spans(
page_token: typing.Optional[str] = OMIT,
filters: typing.Optional[typing.Sequence[QuerySpansRequestFiltersItem]] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
- ) -> SyncPager[TraceSpan]:
+ ) -> SyncPager[TraceSpan, QuerySpansResponse]:
"""
Parameters
----------
@@ -95,7 +96,7 @@ def query_spans(
Returns
-------
- SyncPager[TraceSpan]
+ SyncPager[TraceSpan, QuerySpansResponse]
Returns all the spans matching the query.
Examples
@@ -166,7 +167,7 @@ async def query_spans(
page_token: typing.Optional[str] = OMIT,
filters: typing.Optional[typing.Sequence[QuerySpansRequestFiltersItem]] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
- ) -> AsyncPager[TraceSpan]:
+ ) -> AsyncPager[TraceSpan, QuerySpansResponse]:
"""
Parameters
----------
@@ -214,7 +215,7 @@ async def query_spans(
Returns
-------
- AsyncPager[TraceSpan]
+ AsyncPager[TraceSpan, QuerySpansResponse]
Returns all the spans matching the query.
Examples
diff --git a/src/truefoundry_sdk/traces/raw_client.py b/src/truefoundry_sdk/traces/raw_client.py
index c0114ce..d9d0078 100644
--- a/src/truefoundry_sdk/traces/raw_client.py
+++ b/src/truefoundry_sdk/traces/raw_client.py
@@ -5,7 +5,7 @@
from ..core.api_error import ApiError
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
-from ..core.pagination import AsyncPager, BaseHttpResponse, SyncPager
+from ..core.pagination import AsyncPager, SyncPager
from ..core.pydantic_utilities import parse_obj_as
from ..core.request_options import RequestOptions
from ..core.serialization import convert_and_respect_annotation_metadata
@@ -40,7 +40,7 @@ def query_spans(
page_token: typing.Optional[str] = OMIT,
filters: typing.Optional[typing.Sequence[QuerySpansRequestFiltersItem]] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
- ) -> SyncPager[TraceSpan]:
+ ) -> SyncPager[TraceSpan, QuerySpansResponse]:
"""
Parameters
----------
@@ -88,7 +88,7 @@ def query_spans(
Returns
-------
- SyncPager[TraceSpan]
+ SyncPager[TraceSpan, QuerySpansResponse]
Returns all the spans matching the query.
"""
_response = self._client_wrapper.httpx_client.request(
@@ -148,9 +148,7 @@ def query_spans(
filters=filters,
request_options=request_options,
)
- return SyncPager(
- has_next=_has_next, items=_items, get_next=_get_next, response=BaseHttpResponse(response=_response)
- )
+ return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
@@ -178,7 +176,7 @@ async def query_spans(
page_token: typing.Optional[str] = OMIT,
filters: typing.Optional[typing.Sequence[QuerySpansRequestFiltersItem]] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
- ) -> AsyncPager[TraceSpan]:
+ ) -> AsyncPager[TraceSpan, QuerySpansResponse]:
"""
Parameters
----------
@@ -226,7 +224,7 @@ async def query_spans(
Returns
-------
- AsyncPager[TraceSpan]
+ AsyncPager[TraceSpan, QuerySpansResponse]
Returns all the spans matching the query.
"""
_response = await self._client_wrapper.httpx_client.request(
@@ -289,9 +287,7 @@ async def _get_next():
request_options=request_options,
)
- return AsyncPager(
- has_next=_has_next, items=_items, get_next=_get_next, response=BaseHttpResponse(response=_response)
- )
+ return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
diff --git a/src/truefoundry_sdk/types/__init__.py b/src/truefoundry_sdk/types/__init__.py
index 0f9369b..fe5d29f 100644
--- a/src/truefoundry_sdk/types/__init__.py
+++ b/src/truefoundry_sdk/types/__init__.py
@@ -9,6 +9,7 @@
from .resources import Resources
from .resources_devices_item import ResourcesDevicesItem
from .resources_node import ResourcesNode
+ from .account import Account
from .activate_user_response import ActivateUserResponse
from .add_on_component_source import AddOnComponentSource
from .addon_component import AddonComponent
@@ -53,7 +54,7 @@
from .artifacts_download_artifacts_item import ArtifactsDownloadArtifactsItem
from .assistant_message import AssistantMessage
from .assistant_message_content import AssistantMessageContent
- from .assistant_message_content_item import AssistantMessageContentItem
+ from .assistant_message_content_one_item import AssistantMessageContentOneItem
from .async_processor_sidecar import AsyncProcessorSidecar
from .async_service import AsyncService
from .async_service_autoscaling import AsyncServiceAutoscaling
@@ -64,6 +65,7 @@
from .aws_access_key_auth import AwsAccessKeyAuth
from .aws_access_key_based_auth import AwsAccessKeyBasedAuth
from .aws_assumed_role_based_auth import AwsAssumedRoleBasedAuth
+ from .aws_bedrock_assumed_role_based_auth import AwsBedrockAssumedRoleBasedAuth
from .aws_bedrock_guardrail_config import AwsBedrockGuardrailConfig
from .aws_bedrock_guardrail_config_auth_data import AwsBedrockGuardrailConfigAuthData
from .aws_bedrock_guardrail_config_operation import AwsBedrockGuardrailConfigOperation
@@ -86,6 +88,8 @@
from .aws_sagemaker_provider_account_auth_data import AwsSagemakerProviderAccountAuthData
from .aws_secrets_manager import AwsSecretsManager
from .aws_secrets_manager_auth_data import AwsSecretsManagerAuthData
+ from .aws_sqs_access_key_based_auth import AwsSqsAccessKeyBasedAuth
+ from .aws_sqs_assumed_role_based_auth import AwsSqsAssumedRoleBasedAuth
from .azure_aks_integration import AzureAksIntegration
from .azure_basic_auth import AzureBasicAuth
from .azure_blob_storage import AzureBlobStorage
@@ -122,6 +126,7 @@
from .bitbucket_provider_account import BitbucketProviderAccount
from .blob_storage_reference import BlobStorageReference
from .blue_green import BlueGreen
+ from .budget_alert import BudgetAlert
from .budget_config import BudgetConfig
from .budget_limit_unit import BudgetLimitUnit
from .budget_rule import BudgetRule
@@ -272,7 +277,6 @@
from .gcp_integrations import GcpIntegrations
from .gcp_key_file_auth import GcpKeyFileAuth
from .gcp_provider_account import GcpProviderAccount
- from .gcp_provider_account_auth_data import GcpProviderAccountAuthData
from .gcp_region import GcpRegion
from .gcp_tpu import GcpTpu
from .gemini_model import GeminiModel
@@ -336,6 +340,7 @@
from .hashicorp_token_auth import HashicorpTokenAuth
from .hashicorp_vault_integration import HashicorpVaultIntegration
from .header_match import HeaderMatch
+ from .header_routing_config import HeaderRoutingConfig
from .health_probe import HealthProbe
from .helm import Helm
from .helm_repo import HelmRepo
@@ -438,7 +443,6 @@
from .mcp_server_integration_transport import McpServerIntegrationTransport
from .mcp_server_integrations import McpServerIntegrations
from .mcp_server_o_auth2 import McpServerOAuth2
- from .mcp_server_o_auth2dcr import McpServerOAuth2Dcr
from .mcp_server_o_auth2jwt_source import McpServerOAuth2JwtSource
from .mcp_server_passthrough import McpServerPassthrough
from .mcp_server_provider_account import McpServerProviderAccount
@@ -481,6 +485,7 @@
from .nomic_key_auth import NomicKeyAuth
from .nomic_model import NomicModel
from .nomic_provider_account import NomicProviderAccount
+ from .non_negative_float import NonNegativeFloat
from .notebook import Notebook
from .notebook_config import NotebookConfig
from .notification_target import NotificationTarget
@@ -532,6 +537,7 @@
from .palo_alto_prisma_airs_key_auth import PaloAltoPrismaAirsKeyAuth
from .pangea_guard_type import PangeaGuardType
from .pangea_guardrail_config import PangeaGuardrailConfig
+ from .pangea_guardrail_config_operation import PangeaGuardrailConfigOperation
from .pangea_key_auth import PangeaKeyAuth
from .param import Param
from .param_param_type import ParamParamType
@@ -583,6 +589,7 @@
from .prompt import Prompt
from .prompt_foo_guard_type import PromptFooGuardType
from .prompt_foo_guardrail_config import PromptFooGuardrailConfig
+ from .prompt_foo_guardrail_config_operation import PromptFooGuardrailConfigOperation
from .prompt_version import PromptVersion
from .provider_accounts import ProviderAccounts
from .public_cost_metric import PublicCostMetric
@@ -610,6 +617,8 @@
from .remote_source import RemoteSource
from .retry_config import RetryConfig
from .revoke_all_personal_access_token_response import RevokeAllPersonalAccessTokenResponse
+ from .role_manifest import RoleManifest
+ from .role_permissions import RolePermissions
from .rolling import Rolling
from .rps_metric import RpsMetric
from .sagemaker_model import SagemakerModel
@@ -621,6 +630,7 @@
from .schedule_concurrency_policy import ScheduleConcurrencyPolicy
from .secret import Secret
from .secret_group import SecretGroup
+ from .secret_group_manifest import SecretGroupManifest
from .secret_input import SecretInput
from .secret_mount import SecretMount
from .secret_store_config import SecretStoreConfig
@@ -685,6 +695,7 @@
from .sqs_input_config import SqsInputConfig
from .sqs_output_config import SqsOutputConfig
from .sqs_queue_metric_config import SqsQueueMetricConfig
+ from .sqs_queue_metric_config_auth import SqsQueueMetricConfigAuth
from .ssh_server import SshServer
from .ssh_server_config import SshServerConfig
from .sso_team_manifest import SsoTeamManifest
@@ -743,10 +754,12 @@
from .user import User
from .user_message import UserMessage
from .user_message_content import UserMessageContent
- from .user_message_content_item import UserMessageContentItem
+ from .user_message_content_one_item import UserMessageContentOneItem
from .user_metadata import UserMetadata
from .user_metadata_tenant_role_managed_by import UserMetadataTenantRoleManagedBy
from .user_resource import UserResource
+ from .user_role_with_resource import UserRoleWithResource
+ from .user_role_with_resource_resource_type import UserRoleWithResourceResourceType
from .uv import Uv
from .validation_error import ValidationError
from .validation_error_loc_item import ValidationErrorLocItem
@@ -756,6 +769,8 @@
from .virtual_account_owned_by import VirtualAccountOwnedBy
from .virtual_mcp_server_integration import VirtualMcpServerIntegration
from .virtual_mcp_server_source import VirtualMcpServerSource
+ from .virtual_model import VirtualModel
+ from .virtual_model_provider_account import VirtualModelProviderAccount
from .volume import Volume
from .volume_browser import VolumeBrowser
from .volume_config import VolumeConfig
@@ -782,6 +797,7 @@
from .xg_boost_model_schema import XgBoostModelSchema
from .xg_boost_serialization_format import XgBoostSerializationFormat
_dynamic_imports: typing.Dict[str, str] = {
+ "Account": ".account",
"ActivateUserResponse": ".activate_user_response",
"AddOnComponentSource": ".add_on_component_source",
"AddonComponent": ".addon_component",
@@ -826,7 +842,7 @@
"ArtifactsDownloadArtifactsItem": ".artifacts_download_artifacts_item",
"AssistantMessage": ".assistant_message",
"AssistantMessageContent": ".assistant_message_content",
- "AssistantMessageContentItem": ".assistant_message_content_item",
+ "AssistantMessageContentOneItem": ".assistant_message_content_one_item",
"AsyncProcessorSidecar": ".async_processor_sidecar",
"AsyncService": ".async_service",
"AsyncServiceAutoscaling": ".async_service_autoscaling",
@@ -837,6 +853,7 @@
"AwsAccessKeyAuth": ".aws_access_key_auth",
"AwsAccessKeyBasedAuth": ".aws_access_key_based_auth",
"AwsAssumedRoleBasedAuth": ".aws_assumed_role_based_auth",
+ "AwsBedrockAssumedRoleBasedAuth": ".aws_bedrock_assumed_role_based_auth",
"AwsBedrockGuardrailConfig": ".aws_bedrock_guardrail_config",
"AwsBedrockGuardrailConfigAuthData": ".aws_bedrock_guardrail_config_auth_data",
"AwsBedrockGuardrailConfigOperation": ".aws_bedrock_guardrail_config_operation",
@@ -859,6 +876,8 @@
"AwsSagemakerProviderAccountAuthData": ".aws_sagemaker_provider_account_auth_data",
"AwsSecretsManager": ".aws_secrets_manager",
"AwsSecretsManagerAuthData": ".aws_secrets_manager_auth_data",
+ "AwsSqsAccessKeyBasedAuth": ".aws_sqs_access_key_based_auth",
+ "AwsSqsAssumedRoleBasedAuth": ".aws_sqs_assumed_role_based_auth",
"AzureAksIntegration": ".azure_aks_integration",
"AzureBasicAuth": ".azure_basic_auth",
"AzureBlobStorage": ".azure_blob_storage",
@@ -895,6 +914,7 @@
"BitbucketProviderAccount": ".bitbucket_provider_account",
"BlobStorageReference": ".blob_storage_reference",
"BlueGreen": ".blue_green",
+ "BudgetAlert": ".budget_alert",
"BudgetConfig": ".budget_config",
"BudgetLimitUnit": ".budget_limit_unit",
"BudgetRule": ".budget_rule",
@@ -1045,7 +1065,6 @@
"GcpIntegrations": ".gcp_integrations",
"GcpKeyFileAuth": ".gcp_key_file_auth",
"GcpProviderAccount": ".gcp_provider_account",
- "GcpProviderAccountAuthData": ".gcp_provider_account_auth_data",
"GcpRegion": ".gcp_region",
"GcpTpu": ".gcp_tpu",
"GeminiModel": ".gemini_model",
@@ -1109,6 +1128,7 @@
"HashicorpTokenAuth": ".hashicorp_token_auth",
"HashicorpVaultIntegration": ".hashicorp_vault_integration",
"HeaderMatch": ".header_match",
+ "HeaderRoutingConfig": ".header_routing_config",
"HealthProbe": ".health_probe",
"Helm": ".helm",
"HelmRepo": ".helm_repo",
@@ -1211,7 +1231,6 @@
"McpServerIntegrationTransport": ".mcp_server_integration_transport",
"McpServerIntegrations": ".mcp_server_integrations",
"McpServerOAuth2": ".mcp_server_o_auth2",
- "McpServerOAuth2Dcr": ".mcp_server_o_auth2dcr",
"McpServerOAuth2JwtSource": ".mcp_server_o_auth2jwt_source",
"McpServerPassthrough": ".mcp_server_passthrough",
"McpServerProviderAccount": ".mcp_server_provider_account",
@@ -1254,6 +1273,7 @@
"NomicKeyAuth": ".nomic_key_auth",
"NomicModel": ".nomic_model",
"NomicProviderAccount": ".nomic_provider_account",
+ "NonNegativeFloat": ".non_negative_float",
"Notebook": ".notebook",
"NotebookConfig": ".notebook_config",
"NotificationTarget": ".notification_target",
@@ -1301,6 +1321,7 @@
"PaloAltoPrismaAirsKeyAuth": ".palo_alto_prisma_airs_key_auth",
"PangeaGuardType": ".pangea_guard_type",
"PangeaGuardrailConfig": ".pangea_guardrail_config",
+ "PangeaGuardrailConfigOperation": ".pangea_guardrail_config_operation",
"PangeaKeyAuth": ".pangea_key_auth",
"Param": ".param",
"ParamParamType": ".param_param_type",
@@ -1352,6 +1373,7 @@
"Prompt": ".prompt",
"PromptFooGuardType": ".prompt_foo_guard_type",
"PromptFooGuardrailConfig": ".prompt_foo_guardrail_config",
+ "PromptFooGuardrailConfigOperation": ".prompt_foo_guardrail_config_operation",
"PromptVersion": ".prompt_version",
"ProviderAccounts": ".provider_accounts",
"PublicCostMetric": ".public_cost_metric",
@@ -1382,6 +1404,8 @@
"ResourcesNode": ".resources_node",
"RetryConfig": ".retry_config",
"RevokeAllPersonalAccessTokenResponse": ".revoke_all_personal_access_token_response",
+ "RoleManifest": ".role_manifest",
+ "RolePermissions": ".role_permissions",
"Rolling": ".rolling",
"RpsMetric": ".rps_metric",
"SagemakerModel": ".sagemaker_model",
@@ -1393,6 +1417,7 @@
"ScheduleConcurrencyPolicy": ".schedule_concurrency_policy",
"Secret": ".secret",
"SecretGroup": ".secret_group",
+ "SecretGroupManifest": ".secret_group_manifest",
"SecretInput": ".secret_input",
"SecretMount": ".secret_mount",
"SecretStoreConfig": ".secret_store_config",
@@ -1457,6 +1482,7 @@
"SqsInputConfig": ".sqs_input_config",
"SqsOutputConfig": ".sqs_output_config",
"SqsQueueMetricConfig": ".sqs_queue_metric_config",
+ "SqsQueueMetricConfigAuth": ".sqs_queue_metric_config_auth",
"SshServer": ".ssh_server",
"SshServerConfig": ".ssh_server_config",
"SsoTeamManifest": ".sso_team_manifest",
@@ -1515,10 +1541,12 @@
"User": ".user",
"UserMessage": ".user_message",
"UserMessageContent": ".user_message_content",
- "UserMessageContentItem": ".user_message_content_item",
+ "UserMessageContentOneItem": ".user_message_content_one_item",
"UserMetadata": ".user_metadata",
"UserMetadataTenantRoleManagedBy": ".user_metadata_tenant_role_managed_by",
"UserResource": ".user_resource",
+ "UserRoleWithResource": ".user_role_with_resource",
+ "UserRoleWithResourceResourceType": ".user_role_with_resource_resource_type",
"Uv": ".uv",
"ValidationError": ".validation_error",
"ValidationErrorLocItem": ".validation_error_loc_item",
@@ -1528,6 +1556,8 @@
"VirtualAccountOwnedBy": ".virtual_account_owned_by",
"VirtualMcpServerIntegration": ".virtual_mcp_server_integration",
"VirtualMcpServerSource": ".virtual_mcp_server_source",
+ "VirtualModel": ".virtual_model",
+ "VirtualModelProviderAccount": ".virtual_model_provider_account",
"Volume": ".volume",
"VolumeBrowser": ".volume_browser",
"VolumeConfig": ".volume_config",
@@ -1578,6 +1608,7 @@ def __dir__():
__all__ = [
+ "Account",
"ActivateUserResponse",
"AddOnComponentSource",
"AddonComponent",
@@ -1622,7 +1653,7 @@ def __dir__():
"ArtifactsDownloadArtifactsItem",
"AssistantMessage",
"AssistantMessageContent",
- "AssistantMessageContentItem",
+ "AssistantMessageContentOneItem",
"AsyncProcessorSidecar",
"AsyncService",
"AsyncServiceAutoscaling",
@@ -1633,6 +1664,7 @@ def __dir__():
"AwsAccessKeyAuth",
"AwsAccessKeyBasedAuth",
"AwsAssumedRoleBasedAuth",
+ "AwsBedrockAssumedRoleBasedAuth",
"AwsBedrockGuardrailConfig",
"AwsBedrockGuardrailConfigAuthData",
"AwsBedrockGuardrailConfigOperation",
@@ -1655,6 +1687,8 @@ def __dir__():
"AwsSagemakerProviderAccountAuthData",
"AwsSecretsManager",
"AwsSecretsManagerAuthData",
+ "AwsSqsAccessKeyBasedAuth",
+ "AwsSqsAssumedRoleBasedAuth",
"AzureAksIntegration",
"AzureBasicAuth",
"AzureBlobStorage",
@@ -1691,6 +1725,7 @@ def __dir__():
"BitbucketProviderAccount",
"BlobStorageReference",
"BlueGreen",
+ "BudgetAlert",
"BudgetConfig",
"BudgetLimitUnit",
"BudgetRule",
@@ -1841,7 +1876,6 @@ def __dir__():
"GcpIntegrations",
"GcpKeyFileAuth",
"GcpProviderAccount",
- "GcpProviderAccountAuthData",
"GcpRegion",
"GcpTpu",
"GeminiModel",
@@ -1905,6 +1939,7 @@ def __dir__():
"HashicorpTokenAuth",
"HashicorpVaultIntegration",
"HeaderMatch",
+ "HeaderRoutingConfig",
"HealthProbe",
"Helm",
"HelmRepo",
@@ -2007,7 +2042,6 @@ def __dir__():
"McpServerIntegrationTransport",
"McpServerIntegrations",
"McpServerOAuth2",
- "McpServerOAuth2Dcr",
"McpServerOAuth2JwtSource",
"McpServerPassthrough",
"McpServerProviderAccount",
@@ -2050,6 +2084,7 @@ def __dir__():
"NomicKeyAuth",
"NomicModel",
"NomicProviderAccount",
+ "NonNegativeFloat",
"Notebook",
"NotebookConfig",
"NotificationTarget",
@@ -2097,6 +2132,7 @@ def __dir__():
"PaloAltoPrismaAirsKeyAuth",
"PangeaGuardType",
"PangeaGuardrailConfig",
+ "PangeaGuardrailConfigOperation",
"PangeaKeyAuth",
"Param",
"ParamParamType",
@@ -2148,6 +2184,7 @@ def __dir__():
"Prompt",
"PromptFooGuardType",
"PromptFooGuardrailConfig",
+ "PromptFooGuardrailConfigOperation",
"PromptVersion",
"ProviderAccounts",
"PublicCostMetric",
@@ -2178,6 +2215,8 @@ def __dir__():
"ResourcesNode",
"RetryConfig",
"RevokeAllPersonalAccessTokenResponse",
+ "RoleManifest",
+ "RolePermissions",
"Rolling",
"RpsMetric",
"SagemakerModel",
@@ -2189,6 +2228,7 @@ def __dir__():
"ScheduleConcurrencyPolicy",
"Secret",
"SecretGroup",
+ "SecretGroupManifest",
"SecretInput",
"SecretMount",
"SecretStoreConfig",
@@ -2253,6 +2293,7 @@ def __dir__():
"SqsInputConfig",
"SqsOutputConfig",
"SqsQueueMetricConfig",
+ "SqsQueueMetricConfigAuth",
"SshServer",
"SshServerConfig",
"SsoTeamManifest",
@@ -2311,10 +2352,12 @@ def __dir__():
"User",
"UserMessage",
"UserMessageContent",
- "UserMessageContentItem",
+ "UserMessageContentOneItem",
"UserMetadata",
"UserMetadataTenantRoleManagedBy",
"UserResource",
+ "UserRoleWithResource",
+ "UserRoleWithResourceResourceType",
"Uv",
"ValidationError",
"ValidationErrorLocItem",
@@ -2324,6 +2367,8 @@ def __dir__():
"VirtualAccountOwnedBy",
"VirtualMcpServerIntegration",
"VirtualMcpServerSource",
+ "VirtualModel",
+ "VirtualModelProviderAccount",
"Volume",
"VolumeBrowser",
"VolumeConfig",
diff --git a/src/truefoundry_sdk/types/account.py b/src/truefoundry_sdk/types/account.py
new file mode 100644
index 0000000..9a7f21e
--- /dev/null
+++ b/src/truefoundry_sdk/types/account.py
@@ -0,0 +1,33 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import datetime as dt
+import typing
+
+import pydantic
+import typing_extensions
+from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
+from ..core.serialization import FieldMetadata
+from .subject import Subject
+
+
+class Account(UniversalBaseModel):
+ id: typing.Optional[str] = None
+ name: typing.Optional[str] = None
+ tenant_name: typing_extensions.Annotated[str, FieldMetadata(alias="tenantName")]
+ manifest: typing.Dict[str, typing.Any] = pydantic.Field()
+ """
+ Account manifest
+ """
+
+ created_by_subject: typing_extensions.Annotated[Subject, FieldMetadata(alias="createdBySubject")]
+ created_at: typing_extensions.Annotated[typing.Optional[dt.datetime], FieldMetadata(alias="createdAt")] = None
+ updated_at: typing_extensions.Annotated[typing.Optional[dt.datetime], FieldMetadata(alias="updatedAt")] = None
+ is_editable: typing_extensions.Annotated[bool, FieldMetadata(alias="isEditable")]
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/truefoundry_sdk/types/addon_component.py b/src/truefoundry_sdk/types/addon_component.py
index 153bd8c..806f2c4 100644
--- a/src/truefoundry_sdk/types/addon_component.py
+++ b/src/truefoundry_sdk/types/addon_component.py
@@ -27,7 +27,7 @@ class AddonComponent(UniversalBaseModel):
installed: typing.Optional[bool] = None
status: typing.Optional[AddonComponentStatus] = None
version: typing.Optional[str] = None
- manifest: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None
+ manifest: typing.Optional[typing.Dict[str, typing.Any]] = None
installation_source: typing_extensions.Annotated[
typing.Optional[str], FieldMetadata(alias="installationSource")
] = None
diff --git a/src/truefoundry_sdk/types/addon_component_name.py b/src/truefoundry_sdk/types/addon_component_name.py
index 6c2aae2..c5e37b0 100644
--- a/src/truefoundry_sdk/types/addon_component_name.py
+++ b/src/truefoundry_sdk/types/addon_component_name.py
@@ -1,12 +1,13 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ..core import enum
+
T_Result = typing.TypeVar("T_Result")
-class AddonComponentName(str, enum.Enum):
+class AddonComponentName(enum.StrEnum):
ARGOCD = "ARGOCD"
ARGO_ROLLOUT = "ARGO_ROLLOUT"
ARGO_WORKFLOW = "ARGO_WORKFLOW"
diff --git a/src/truefoundry_sdk/types/alert_config_resource_type.py b/src/truefoundry_sdk/types/alert_config_resource_type.py
index f73feff..6e13e88 100644
--- a/src/truefoundry_sdk/types/alert_config_resource_type.py
+++ b/src/truefoundry_sdk/types/alert_config_resource_type.py
@@ -1,12 +1,13 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ..core import enum
+
T_Result = typing.TypeVar("T_Result")
-class AlertConfigResourceType(str, enum.Enum):
+class AlertConfigResourceType(enum.StrEnum):
"""
The type of resource this alert config belongs to. Can be either an application or a cluster.
"""
diff --git a/src/truefoundry_sdk/types/alert_severity.py b/src/truefoundry_sdk/types/alert_severity.py
index f9c14d6..cd2e98e 100644
--- a/src/truefoundry_sdk/types/alert_severity.py
+++ b/src/truefoundry_sdk/types/alert_severity.py
@@ -1,12 +1,13 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ..core import enum
+
T_Result = typing.TypeVar("T_Result")
-class AlertSeverity(str, enum.Enum):
+class AlertSeverity(enum.StrEnum):
WARNING = "warning"
CRITICAL = "critical"
diff --git a/src/truefoundry_sdk/types/alert_status.py b/src/truefoundry_sdk/types/alert_status.py
index 2f90c12..0d277b2 100644
--- a/src/truefoundry_sdk/types/alert_status.py
+++ b/src/truefoundry_sdk/types/alert_status.py
@@ -1,12 +1,13 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ..core import enum
+
T_Result = typing.TypeVar("T_Result")
-class AlertStatus(str, enum.Enum):
+class AlertStatus(enum.StrEnum):
FIRING = "firing"
RESOLVED = "resolved"
diff --git a/src/truefoundry_sdk/types/application.py b/src/truefoundry_sdk/types/application.py
index 597f57c..acf0a6e 100644
--- a/src/truefoundry_sdk/types/application.py
+++ b/src/truefoundry_sdk/types/application.py
@@ -43,7 +43,7 @@ class Application(UniversalBaseModel):
"""
alerts_summary: typing_extensions.Annotated[
- typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]], FieldMetadata(alias="alertsSummary")
+ typing.Optional[typing.Dict[str, typing.Any]], FieldMetadata(alias="alertsSummary")
] = pydantic.Field(default=None)
"""
Summary of alerts for this application
@@ -63,7 +63,7 @@ class Application(UniversalBaseModel):
Potential problems with the application
"""
- autopilot: typing.Dict[str, typing.Optional[typing.Any]]
+ autopilot: typing.Dict[str, typing.Any]
workspace_fqn: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="workspaceFqn")] = None
created_by: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="createdBy")] = None
deployment: typing.Optional["Deployment"] = None
@@ -86,4 +86,4 @@ class Config:
from .application_debug_info import ApplicationDebugInfo # noqa: E402, I001
from .deployment import Deployment # noqa: E402, I001
-update_forward_refs(Application)
+update_forward_refs(Application, ApplicationDebugInfo=ApplicationDebugInfo, Deployment=Deployment)
diff --git a/src/truefoundry_sdk/types/application_debug_info.py b/src/truefoundry_sdk/types/application_debug_info.py
index 64e571b..5a208c9 100644
--- a/src/truefoundry_sdk/types/application_debug_info.py
+++ b/src/truefoundry_sdk/types/application_debug_info.py
@@ -15,9 +15,7 @@ class ApplicationDebugInfo(UniversalBaseModel):
id: typing.Optional[str] = None
application_id: typing_extensions.Annotated[str, FieldMetadata(alias="applicationId")]
application: typing.Optional["Application"] = None
- debug_info: typing_extensions.Annotated[
- typing.Dict[str, typing.Optional[typing.Any]], FieldMetadata(alias="debugInfo")
- ]
+ debug_info: typing_extensions.Annotated[typing.Dict[str, typing.Any], FieldMetadata(alias="debugInfo")]
created_at: typing_extensions.Annotated[typing.Optional[dt.datetime], FieldMetadata(alias="createdAt")] = None
updated_at: typing_extensions.Annotated[typing.Optional[dt.datetime], FieldMetadata(alias="updatedAt")] = None
@@ -31,5 +29,6 @@ class Config:
from .application import Application # noqa: E402, I001
+from .deployment import Deployment # noqa: E402, I001
-update_forward_refs(ApplicationDebugInfo)
+update_forward_refs(ApplicationDebugInfo, Application=Application, Deployment=Deployment)
diff --git a/src/truefoundry_sdk/types/application_lifecycle_stage.py b/src/truefoundry_sdk/types/application_lifecycle_stage.py
index ec08b90..4b616ea 100644
--- a/src/truefoundry_sdk/types/application_lifecycle_stage.py
+++ b/src/truefoundry_sdk/types/application_lifecycle_stage.py
@@ -1,12 +1,13 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ..core import enum
+
T_Result = typing.TypeVar("T_Result")
-class ApplicationLifecycleStage(str, enum.Enum):
+class ApplicationLifecycleStage(enum.StrEnum):
ACTIVE = "active"
DELETING = "deleting"
DELETION_FAILED = "deletion_failed"
diff --git a/src/truefoundry_sdk/types/application_set.py b/src/truefoundry_sdk/types/application_set.py
index dd4e2d1..65d3102 100644
--- a/src/truefoundry_sdk/types/application_set.py
+++ b/src/truefoundry_sdk/types/application_set.py
@@ -32,7 +32,7 @@ class ApplicationSet(UniversalBaseModel):
Template to be used for the application set.
"""
- values: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
+ values: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None)
"""
Values to be used to render components for the application set.
"""
diff --git a/src/truefoundry_sdk/types/application_type.py b/src/truefoundry_sdk/types/application_type.py
index 963ea07..74018eb 100644
--- a/src/truefoundry_sdk/types/application_type.py
+++ b/src/truefoundry_sdk/types/application_type.py
@@ -1,12 +1,13 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ..core import enum
+
T_Result = typing.TypeVar("T_Result")
-class ApplicationType(str, enum.Enum):
+class ApplicationType(enum.StrEnum):
ASYNC_SERVICE = "async-service"
SERVICE = "service"
JOB = "job"
diff --git a/src/truefoundry_sdk/types/artifact_manifest.py b/src/truefoundry_sdk/types/artifact_manifest.py
index 2d438a4..3f5cb28 100644
--- a/src/truefoundry_sdk/types/artifact_manifest.py
+++ b/src/truefoundry_sdk/types/artifact_manifest.py
@@ -18,7 +18,7 @@ class ArtifactManifest(UniversalBaseModel):
"""
description: typing.Optional[str] = None
- metadata: typing.Dict[str, typing.Optional[typing.Any]] = pydantic.Field()
+ metadata: typing.Dict[str, typing.Any] = pydantic.Field()
"""
Key value metadata. Should be valid JSON. For e.g. `{"business-unit": "sales", "quality": "good", "rating": 4.5}`
"""
diff --git a/src/truefoundry_sdk/types/artifact_type.py b/src/truefoundry_sdk/types/artifact_type.py
index 47ec67f..ecf41b8 100644
--- a/src/truefoundry_sdk/types/artifact_type.py
+++ b/src/truefoundry_sdk/types/artifact_type.py
@@ -1,12 +1,13 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ..core import enum
+
T_Result = typing.TypeVar("T_Result")
-class ArtifactType(str, enum.Enum):
+class ArtifactType(enum.StrEnum):
"""
An enumeration.
"""
diff --git a/src/truefoundry_sdk/types/assistant_message_content.py b/src/truefoundry_sdk/types/assistant_message_content.py
index 4da2369..9f49e0e 100644
--- a/src/truefoundry_sdk/types/assistant_message_content.py
+++ b/src/truefoundry_sdk/types/assistant_message_content.py
@@ -2,7 +2,7 @@
import typing
-from .assistant_message_content_item import AssistantMessageContentItem
+from .assistant_message_content_one_item import AssistantMessageContentOneItem
from .blob_storage_reference import BlobStorageReference
-AssistantMessageContent = typing.Union[str, typing.List[AssistantMessageContentItem], BlobStorageReference]
+AssistantMessageContent = typing.Union[str, typing.List[AssistantMessageContentOneItem], BlobStorageReference]
diff --git a/src/truefoundry_sdk/types/assistant_message_content_item.py b/src/truefoundry_sdk/types/assistant_message_content_one_item.py
similarity index 68%
rename from src/truefoundry_sdk/types/assistant_message_content_item.py
rename to src/truefoundry_sdk/types/assistant_message_content_one_item.py
index a226151..b7a4866 100644
--- a/src/truefoundry_sdk/types/assistant_message_content_item.py
+++ b/src/truefoundry_sdk/types/assistant_message_content_one_item.py
@@ -5,4 +5,4 @@
from .refusal_content_part import RefusalContentPart
from .text_content_part import TextContentPart
-AssistantMessageContentItem = typing.Union[TextContentPart, RefusalContentPart]
+AssistantMessageContentOneItem = typing.Union[TextContentPart, RefusalContentPart]
diff --git a/src/truefoundry_sdk/types/aws_bedrock_assumed_role_based_auth.py b/src/truefoundry_sdk/types/aws_bedrock_assumed_role_based_auth.py
new file mode 100644
index 0000000..144c7bd
--- /dev/null
+++ b/src/truefoundry_sdk/types/aws_bedrock_assumed_role_based_auth.py
@@ -0,0 +1,26 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+from .aws_assumed_role_based_auth import AwsAssumedRoleBasedAuth
+
+
+class AwsBedrockAssumedRoleBasedAuth(AwsAssumedRoleBasedAuth):
+ """
+ AWS Assumed Role Based Auth for Bedrock
+ """
+
+ external_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Optional external ID to use when assuming the role. This provides an added layer of security by ensuring only parties with the correct external ID can assume the role.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/truefoundry_sdk/types/aws_bedrock_guardrail_config_auth_data.py b/src/truefoundry_sdk/types/aws_bedrock_guardrail_config_auth_data.py
index 6ef84b0..916a651 100644
--- a/src/truefoundry_sdk/types/aws_bedrock_guardrail_config_auth_data.py
+++ b/src/truefoundry_sdk/types/aws_bedrock_guardrail_config_auth_data.py
@@ -3,6 +3,6 @@
import typing
from .aws_access_key_based_auth import AwsAccessKeyBasedAuth
-from .aws_assumed_role_based_auth import AwsAssumedRoleBasedAuth
+from .aws_bedrock_assumed_role_based_auth import AwsBedrockAssumedRoleBasedAuth
-AwsBedrockGuardrailConfigAuthData = typing.Union[AwsAccessKeyBasedAuth, AwsAssumedRoleBasedAuth]
+AwsBedrockGuardrailConfigAuthData = typing.Union[AwsAccessKeyBasedAuth, AwsBedrockAssumedRoleBasedAuth]
diff --git a/src/truefoundry_sdk/types/aws_bedrock_guardrail_config_operation.py b/src/truefoundry_sdk/types/aws_bedrock_guardrail_config_operation.py
index 4b9839b..40c0175 100644
--- a/src/truefoundry_sdk/types/aws_bedrock_guardrail_config_operation.py
+++ b/src/truefoundry_sdk/types/aws_bedrock_guardrail_config_operation.py
@@ -1,12 +1,13 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ..core import enum
+
T_Result = typing.TypeVar("T_Result")
-class AwsBedrockGuardrailConfigOperation(str, enum.Enum):
+class AwsBedrockGuardrailConfigOperation(enum.StrEnum):
"""
The operation type to use for the Guardrail. Validate guardrails are used to validate requests and mutate can validate as well as mutate requests.
Validate guardrails are run in parallel while mutate guardrails are run sequentially.
diff --git a/src/truefoundry_sdk/types/aws_bedrock_provider_account_auth_data.py b/src/truefoundry_sdk/types/aws_bedrock_provider_account_auth_data.py
index 4713683..b081b15 100644
--- a/src/truefoundry_sdk/types/aws_bedrock_provider_account_auth_data.py
+++ b/src/truefoundry_sdk/types/aws_bedrock_provider_account_auth_data.py
@@ -3,6 +3,6 @@
import typing
from .aws_access_key_based_auth import AwsAccessKeyBasedAuth
-from .aws_assumed_role_based_auth import AwsAssumedRoleBasedAuth
+from .aws_bedrock_assumed_role_based_auth import AwsBedrockAssumedRoleBasedAuth
-AwsBedrockProviderAccountAuthData = typing.Union[AwsAccessKeyBasedAuth, AwsAssumedRoleBasedAuth]
+AwsBedrockProviderAccountAuthData = typing.Union[AwsAccessKeyBasedAuth, AwsBedrockAssumedRoleBasedAuth]
diff --git a/src/truefoundry_sdk/types/aws_region.py b/src/truefoundry_sdk/types/aws_region.py
index 8074f03..ad29987 100644
--- a/src/truefoundry_sdk/types/aws_region.py
+++ b/src/truefoundry_sdk/types/aws_region.py
@@ -1,12 +1,13 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ..core import enum
+
T_Result = typing.TypeVar("T_Result")
-class AwsRegion(str, enum.Enum):
+class AwsRegion(enum.StrEnum):
AF_SOUTH1 = "af-south-1"
AP_EAST1 = "ap-east-1"
AP_NORTHEAST1 = "ap-northeast-1"
diff --git a/src/truefoundry_sdk/types/aws_s3.py b/src/truefoundry_sdk/types/aws_s3.py
index 72d08d7..a40e692 100644
--- a/src/truefoundry_sdk/types/aws_s3.py
+++ b/src/truefoundry_sdk/types/aws_s3.py
@@ -25,7 +25,7 @@ class AwsS3(UniversalBaseModel):
storage_root: str = pydantic.Field()
"""
- The root path of the storage.
+ The S3 storage path in the format 's3:///'. Works with S3-compatible storage providers like MinIO, Ceph, and DigitalOcean Spaces. Example: 's3://mybucket' or 's3://mybucket/artifacts/production'.
"""
region: AwsRegion
diff --git a/src/truefoundry_sdk/types/aws_sagemaker_provider_account_auth_data.py b/src/truefoundry_sdk/types/aws_sagemaker_provider_account_auth_data.py
index 253b2a0..e28e87a 100644
--- a/src/truefoundry_sdk/types/aws_sagemaker_provider_account_auth_data.py
+++ b/src/truefoundry_sdk/types/aws_sagemaker_provider_account_auth_data.py
@@ -3,6 +3,6 @@
import typing
from .aws_access_key_based_auth import AwsAccessKeyBasedAuth
-from .aws_assumed_role_based_auth import AwsAssumedRoleBasedAuth
+from .aws_bedrock_assumed_role_based_auth import AwsBedrockAssumedRoleBasedAuth
-AwsSagemakerProviderAccountAuthData = typing.Union[AwsAccessKeyBasedAuth, AwsAssumedRoleBasedAuth]
+AwsSagemakerProviderAccountAuthData = typing.Union[AwsAccessKeyBasedAuth, AwsBedrockAssumedRoleBasedAuth]
diff --git a/src/truefoundry_sdk/types/aws_sqs_access_key_based_auth.py b/src/truefoundry_sdk/types/aws_sqs_access_key_based_auth.py
new file mode 100644
index 0000000..67b3da4
--- /dev/null
+++ b/src/truefoundry_sdk/types/aws_sqs_access_key_based_auth.py
@@ -0,0 +1,35 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
+
+
+class AwsSqsAccessKeyBasedAuth(UniversalBaseModel):
+ """
+ AWS Access Key Based Auth
+ """
+
+ type: typing.Literal["access-key-based"] = pydantic.Field(default="access-key-based")
+ """
+ +value=access-key-based
+ """
+
+ access_key_id: str = pydantic.Field()
+ """
+ AWS access key ID that you want to use for authentication.
+ """
+
+ secret_access_key: str = pydantic.Field()
+ """
+ AWS access key secret that you want to use for authentication.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/truefoundry_sdk/types/mcp_server_o_auth2dcr.py b/src/truefoundry_sdk/types/aws_sqs_assumed_role_based_auth.py
similarity index 55%
rename from src/truefoundry_sdk/types/mcp_server_o_auth2dcr.py
rename to src/truefoundry_sdk/types/aws_sqs_assumed_role_based_auth.py
index 6414e7d..d1f9f2e 100644
--- a/src/truefoundry_sdk/types/mcp_server_o_auth2dcr.py
+++ b/src/truefoundry_sdk/types/aws_sqs_assumed_role_based_auth.py
@@ -6,14 +6,19 @@
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
-class McpServerOAuth2Dcr(UniversalBaseModel):
+class AwsSqsAssumedRoleBasedAuth(UniversalBaseModel):
"""
- DCR
+ AWS Assumed Role Based Auth
"""
- type: typing.Literal["dcr"] = pydantic.Field(default="dcr")
+ type: typing.Literal["assumed-role-based"] = pydantic.Field(default="assumed-role-based")
"""
- Uses Dynamic Client Registration (RFC 7591) to automatically obtain OAuth2 credentials from the MCP server. The system will register as a client, receive client ID and secret, and handle the complete OAuth2 flow without manual configuration.
+ +value=assumed-role-based
+ """
+
+ assumed_role_arn: str = pydantic.Field()
+ """
+ ARN of the role you want to assume.
"""
if IS_PYDANTIC_V2:
diff --git a/src/truefoundry_sdk/types/azure_blob_storage.py b/src/truefoundry_sdk/types/azure_blob_storage.py
index 60f3033..81631fe 100644
--- a/src/truefoundry_sdk/types/azure_blob_storage.py
+++ b/src/truefoundry_sdk/types/azure_blob_storage.py
@@ -26,7 +26,7 @@ class AzureBlobStorage(UniversalBaseModel):
storage_root: str = pydantic.Field()
"""
- The root path of the storage.
+ The full Azure Blob Storage URL in the format 'https://.blob.core.windows.net//'. Example: 'https://mystorageaccount.blob.core.windows.net/mycontainer' or 'https://mystorageaccount.blob.core.windows.net/mycontainer/artifacts/production'.
"""
auth_data: typing.Optional[AzureConnectionStringAuth] = None
diff --git a/src/truefoundry_sdk/types/azure_content_safety_category.py b/src/truefoundry_sdk/types/azure_content_safety_category.py
index bb19d31..33cc55a 100644
--- a/src/truefoundry_sdk/types/azure_content_safety_category.py
+++ b/src/truefoundry_sdk/types/azure_content_safety_category.py
@@ -1,12 +1,13 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ..core import enum
+
T_Result = typing.TypeVar("T_Result")
-class AzureContentSafetyCategory(str, enum.Enum):
+class AzureContentSafetyCategory(enum.StrEnum):
HATE = "Hate"
SELF_HARM = "SelfHarm"
SEXUAL = "Sexual"
diff --git a/src/truefoundry_sdk/types/azure_content_safety_guardrail_config.py b/src/truefoundry_sdk/types/azure_content_safety_guardrail_config.py
index 2612415..cc1c7d3 100644
--- a/src/truefoundry_sdk/types/azure_content_safety_guardrail_config.py
+++ b/src/truefoundry_sdk/types/azure_content_safety_guardrail_config.py
@@ -41,6 +41,11 @@ class AzureContentSafetyGuardrailConfig(UniversalBaseModel):
Custom endpoint URL for the Content Safety API (optional, uses default Azure endpoint if not specified)
"""
+ operation: typing.Optional[typing.Literal["validate"]] = pydantic.Field(default=None)
+ """
+ The operation type for this guardrail. Azure Content Safety guardrails can only be used for validation.
+ """
+
blocklist_names: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
"""
Names of custom blocklists created in Azure Content Safety to check text against. Leave empty if not using custom blocklists
diff --git a/src/truefoundry_sdk/types/azure_pii_category.py b/src/truefoundry_sdk/types/azure_pii_category.py
index 046b20d..e3e8ae6 100644
--- a/src/truefoundry_sdk/types/azure_pii_category.py
+++ b/src/truefoundry_sdk/types/azure_pii_category.py
@@ -1,12 +1,13 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ..core import enum
+
T_Result = typing.TypeVar("T_Result")
-class AzurePiiCategory(str, enum.Enum):
+class AzurePiiCategory(enum.StrEnum):
ALL = "all"
PERSON = "Person"
PERSON_TYPE = "PersonType"
diff --git a/src/truefoundry_sdk/types/azure_pii_guardrail_config.py b/src/truefoundry_sdk/types/azure_pii_guardrail_config.py
index bd57625..ab8cf29 100644
--- a/src/truefoundry_sdk/types/azure_pii_guardrail_config.py
+++ b/src/truefoundry_sdk/types/azure_pii_guardrail_config.py
@@ -42,6 +42,11 @@ class AzurePiiGuardrailConfig(UniversalBaseModel):
Custom endpoint URL for the PII detection API (optional, uses default Azure endpoint if not specified)
"""
+ operation: typing.Optional[typing.Literal["mutate"]] = pydantic.Field(default=None)
+ """
+ The operation type for this guardrail. Azure PII guardrails can only be used for mutate.
+ """
+
domain: AzurePiiGuardrailConfigDomain = pydantic.Field()
"""
Specialized domain for PII detection. Use healthcare for PHI (Protected Health Information) or none for general text
diff --git a/src/truefoundry_sdk/types/azure_pii_guardrail_config_domain.py b/src/truefoundry_sdk/types/azure_pii_guardrail_config_domain.py
index c948626..8acbf87 100644
--- a/src/truefoundry_sdk/types/azure_pii_guardrail_config_domain.py
+++ b/src/truefoundry_sdk/types/azure_pii_guardrail_config_domain.py
@@ -1,12 +1,13 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ..core import enum
+
T_Result = typing.TypeVar("T_Result")
-class AzurePiiGuardrailConfigDomain(str, enum.Enum):
+class AzurePiiGuardrailConfigDomain(enum.StrEnum):
"""
Specialized domain for PII detection. Use healthcare for PHI (Protected Health Information) or none for general text
"""
diff --git a/src/truefoundry_sdk/types/base_o_auth2login_jwt_source.py b/src/truefoundry_sdk/types/base_o_auth2login_jwt_source.py
index c7a6ce4..293dc79 100644
--- a/src/truefoundry_sdk/types/base_o_auth2login_jwt_source.py
+++ b/src/truefoundry_sdk/types/base_o_auth2login_jwt_source.py
@@ -1,12 +1,13 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ..core import enum
+
T_Result = typing.TypeVar("T_Result")
-class BaseOAuth2LoginJwtSource(str, enum.Enum):
+class BaseOAuth2LoginJwtSource(enum.StrEnum):
"""
Source of the JWT token to be used for verification.
"""
diff --git a/src/truefoundry_sdk/types/budget_alert.py b/src/truefoundry_sdk/types/budget_alert.py
new file mode 100644
index 0000000..57fcb2a
--- /dev/null
+++ b/src/truefoundry_sdk/types/budget_alert.py
@@ -0,0 +1,31 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
+from .notification_target import NotificationTarget
+
+
+class BudgetAlert(UniversalBaseModel):
+ """
+ Budget Alert
+ """
+
+ thresholds: typing.List[float] = pydantic.Field()
+ """
+ List of usage percentages (0-100) at which alerts should be triggered. Default thresholds are [75, 90, 95, 100].
+ """
+
+ notification_target: typing.List[NotificationTarget] = pydantic.Field()
+ """
+ Select where to send budget alert notifications
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/truefoundry_sdk/types/budget_limit_unit.py b/src/truefoundry_sdk/types/budget_limit_unit.py
index 2b39a9d..b6893a4 100644
--- a/src/truefoundry_sdk/types/budget_limit_unit.py
+++ b/src/truefoundry_sdk/types/budget_limit_unit.py
@@ -1,18 +1,20 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ..core import enum
+
T_Result = typing.TypeVar("T_Result")
-class BudgetLimitUnit(str, enum.Enum):
+class BudgetLimitUnit(enum.StrEnum):
"""
Unit for budget limit calculation
"""
COST_PER_DAY = "cost_per_day"
COST_PER_MONTH = "cost_per_month"
+ COST_PER_WEEK = "cost_per_week"
TOKENS_PER_DAY = "tokens_per_day"
TOKENS_PER_MONTH = "tokens_per_month"
@@ -20,6 +22,7 @@ def visit(
self,
cost_per_day: typing.Callable[[], T_Result],
cost_per_month: typing.Callable[[], T_Result],
+ cost_per_week: typing.Callable[[], T_Result],
tokens_per_day: typing.Callable[[], T_Result],
tokens_per_month: typing.Callable[[], T_Result],
) -> T_Result:
@@ -27,6 +30,8 @@ def visit(
return cost_per_day()
if self is BudgetLimitUnit.COST_PER_MONTH:
return cost_per_month()
+ if self is BudgetLimitUnit.COST_PER_WEEK:
+ return cost_per_week()
if self is BudgetLimitUnit.TOKENS_PER_DAY:
return tokens_per_day()
if self is BudgetLimitUnit.TOKENS_PER_MONTH:
diff --git a/src/truefoundry_sdk/types/budget_rule.py b/src/truefoundry_sdk/types/budget_rule.py
index c83867c..1f5f6da 100644
--- a/src/truefoundry_sdk/types/budget_rule.py
+++ b/src/truefoundry_sdk/types/budget_rule.py
@@ -4,6 +4,7 @@
import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
+from .budget_alert import BudgetAlert
from .budget_limit_unit import BudgetLimitUnit
from .budget_when import BudgetWhen
@@ -25,6 +26,12 @@ class BudgetRule(UniversalBaseModel):
"""
unit: BudgetLimitUnit
+ budget_applies_per: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
+ """
+ Create separate budget rules for each unique value of the selected entity. For example, if "user" is selected, a separate budget rule will be created for each unique user making requests. Options: user, virtualaccount, model, or a metadata key (e.g., metadata.appId).
+ """
+
+ alerts: typing.Optional[BudgetAlert] = None
if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2
diff --git a/src/truefoundry_sdk/types/build_status.py b/src/truefoundry_sdk/types/build_status.py
index b70d1a3..16caa88 100644
--- a/src/truefoundry_sdk/types/build_status.py
+++ b/src/truefoundry_sdk/types/build_status.py
@@ -1,12 +1,13 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ..core import enum
+
T_Result = typing.TypeVar("T_Result")
-class BuildStatus(str, enum.Enum):
+class BuildStatus(enum.StrEnum):
STARTED = "STARTED"
SUCCEEDED = "SUCCEEDED"
FAILED = "FAILED"
diff --git a/src/truefoundry_sdk/types/chat_prompt_manifest.py b/src/truefoundry_sdk/types/chat_prompt_manifest.py
index 70064df..ad9cfa6 100644
--- a/src/truefoundry_sdk/types/chat_prompt_manifest.py
+++ b/src/truefoundry_sdk/types/chat_prompt_manifest.py
@@ -25,7 +25,7 @@ class ChatPromptManifest(UniversalBaseModel):
"""
description: typing.Optional[str] = None
- metadata: typing.Dict[str, typing.Optional[typing.Any]] = pydantic.Field()
+ metadata: typing.Dict[str, typing.Any] = pydantic.Field()
"""
Key value metadata. Should be valid JSON. For e.g. `{"business-unit": "sales", "quality": "good", "rating": 4.5}`
"""
diff --git a/src/truefoundry_sdk/types/cloudera_model.py b/src/truefoundry_sdk/types/cloudera_model.py
index 9553142..7cec116 100644
--- a/src/truefoundry_sdk/types/cloudera_model.py
+++ b/src/truefoundry_sdk/types/cloudera_model.py
@@ -28,6 +28,11 @@ class ClouderaModel(UniversalBaseModel):
The unique identifier of the Model in Cloudera Model Registry. This is the model ID assigned when you registered or deployed your model in the CDP Model Registry
"""
+ base_url: str = pydantic.Field()
+ """
+ The model endpoint URL up to the API version v1. To get the base_url, copy the model endpoint URL and delete the last two path components
+ """
+
model_types: typing.List[ModelType] = pydantic.Field()
"""
Specify the type of the Cloudera model
diff --git a/src/truefoundry_sdk/types/cloudera_provider_account.py b/src/truefoundry_sdk/types/cloudera_provider_account.py
index ea09fb5..9ea03d8 100644
--- a/src/truefoundry_sdk/types/cloudera_provider_account.py
+++ b/src/truefoundry_sdk/types/cloudera_provider_account.py
@@ -32,11 +32,6 @@ class ClouderaProviderAccount(UniversalBaseModel):
Cloudera authentication credentials
"""
- base_url: str = pydantic.Field()
- """
- The base URL of your Cloudera CDP environment. This should be the CDP API endpoint URL for your region and environment.
- """
-
integrations: typing.List[ClouderaIntegrations] = pydantic.Field()
"""
List of integrations that are associated with the Cloudera provider account
diff --git a/src/truefoundry_sdk/types/cloudera_workload_auth_token.py b/src/truefoundry_sdk/types/cloudera_workload_auth_token.py
index 7e3aeb2..b97cee8 100644
--- a/src/truefoundry_sdk/types/cloudera_workload_auth_token.py
+++ b/src/truefoundry_sdk/types/cloudera_workload_auth_token.py
@@ -16,6 +16,11 @@ class ClouderaWorkloadAuthToken(UniversalBaseModel):
+value=workload-auth-token
"""
+ cdp_base_url: str = pydantic.Field()
+ """
+ The base URL for CDP API services
+ """
+
access_key_id: str = pydantic.Field()
"""
The access key ID for your Cloudera CDP workload authentication.
diff --git a/src/truefoundry_sdk/types/cluster_manifest_cluster_type.py b/src/truefoundry_sdk/types/cluster_manifest_cluster_type.py
index 3d7b276..517ff97 100644
--- a/src/truefoundry_sdk/types/cluster_manifest_cluster_type.py
+++ b/src/truefoundry_sdk/types/cluster_manifest_cluster_type.py
@@ -1,12 +1,13 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ..core import enum
+
T_Result = typing.TypeVar("T_Result")
-class ClusterManifestClusterType(str, enum.Enum):
+class ClusterManifestClusterType(enum.StrEnum):
"""
The cluster type of this cluster
"""
diff --git a/src/truefoundry_sdk/types/cluster_type.py b/src/truefoundry_sdk/types/cluster_type.py
index 1f0cd79..7b59353 100644
--- a/src/truefoundry_sdk/types/cluster_type.py
+++ b/src/truefoundry_sdk/types/cluster_type.py
@@ -1,12 +1,13 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ..core import enum
+
T_Result = typing.TypeVar("T_Result")
-class ClusterType(str, enum.Enum):
+class ClusterType(enum.StrEnum):
AWS_EKS = "aws-eks"
GCP_GKE_STANDARD = "gcp-gke-standard"
AZURE_AKS = "azure-aks"
diff --git a/src/truefoundry_sdk/types/custom_blob_storage.py b/src/truefoundry_sdk/types/custom_blob_storage.py
index 0fe5c51..a071daa 100644
--- a/src/truefoundry_sdk/types/custom_blob_storage.py
+++ b/src/truefoundry_sdk/types/custom_blob_storage.py
@@ -29,7 +29,7 @@ class CustomBlobStorage(UniversalBaseModel):
storage_root: str = pydantic.Field()
"""
- The root path of the storage.
+ The S3-compatible storage path in the format 's3:///'. Works with S3-compatible storage providers like MinIO, Ceph, and DigitalOcean Spaces. Example: 's3://mybucket' or 's3://mybucket/artifacts/production'.
"""
region: typing.Optional[str] = pydantic.Field(default=None)
diff --git a/src/truefoundry_sdk/types/custom_guardrail_config.py b/src/truefoundry_sdk/types/custom_guardrail_config.py
index e99d051..d0f4127 100644
--- a/src/truefoundry_sdk/types/custom_guardrail_config.py
+++ b/src/truefoundry_sdk/types/custom_guardrail_config.py
@@ -53,7 +53,7 @@ class CustomGuardrailConfig(UniversalBaseModel):
Headers for the Guardrail Server. Forwarded to the Guardrail Server as is. For example: `{"Authorization": "APIKey "}`
"""
- config: typing.Dict[str, typing.Optional[typing.Any]] = pydantic.Field()
+ config: typing.Dict[str, typing.Any] = pydantic.Field()
"""
The config for the Guardrail Server. This is a JSON object that will be sent as a config to Guardrail Server along with the request.
"""
diff --git a/src/truefoundry_sdk/types/custom_guardrail_config_operation.py b/src/truefoundry_sdk/types/custom_guardrail_config_operation.py
index 2484ade..0279243 100644
--- a/src/truefoundry_sdk/types/custom_guardrail_config_operation.py
+++ b/src/truefoundry_sdk/types/custom_guardrail_config_operation.py
@@ -1,12 +1,13 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ..core import enum
+
T_Result = typing.TypeVar("T_Result")
-class CustomGuardrailConfigOperation(str, enum.Enum):
+class CustomGuardrailConfigOperation(enum.StrEnum):
"""
The operation type to use for the Guardrail. Validate guardrails are used to validate requests and mutate can validate as well as mutate requests.
Validate guardrails are run in parallel while mutate guardrails are run sequentially.
diff --git a/src/truefoundry_sdk/types/custom_guardrail_config_target.py b/src/truefoundry_sdk/types/custom_guardrail_config_target.py
index 5592f93..a71a435 100644
--- a/src/truefoundry_sdk/types/custom_guardrail_config_target.py
+++ b/src/truefoundry_sdk/types/custom_guardrail_config_target.py
@@ -1,12 +1,13 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ..core import enum
+
T_Result = typing.TypeVar("T_Result")
-class CustomGuardrailConfigTarget(str, enum.Enum):
+class CustomGuardrailConfigTarget(enum.StrEnum):
"""
Specify whether the guardrail should be applied to the request or response. Guardrails with target "Request" can be only used in input guardrails and guardrails with target "Response" can only be used in output guardrails.
"""
diff --git a/src/truefoundry_sdk/types/data_directory_manifest.py b/src/truefoundry_sdk/types/data_directory_manifest.py
index c8426e9..2015849 100644
--- a/src/truefoundry_sdk/types/data_directory_manifest.py
+++ b/src/truefoundry_sdk/types/data_directory_manifest.py
@@ -28,7 +28,7 @@ class DataDirectoryManifest(UniversalBaseModel):
Description for the data directory
"""
- metadata: typing.Dict[str, typing.Optional[typing.Any]] = pydantic.Field()
+ metadata: typing.Dict[str, typing.Any] = pydantic.Field()
"""
Key Value metadata. Should be valid JSON. For e.g. `{"business-unit": "sales", "quality": "good", "rating": 4.5}`
"""
diff --git a/src/truefoundry_sdk/types/deployment.py b/src/truefoundry_sdk/types/deployment.py
index d3b624e..a4abf40 100644
--- a/src/truefoundry_sdk/types/deployment.py
+++ b/src/truefoundry_sdk/types/deployment.py
@@ -55,5 +55,6 @@ class Config:
from .application import Application # noqa: E402, I001
+from .application_debug_info import ApplicationDebugInfo # noqa: E402, I001
-update_forward_refs(Deployment)
+update_forward_refs(Deployment, Application=Application, ApplicationDebugInfo=ApplicationDebugInfo)
diff --git a/src/truefoundry_sdk/types/deployment_build.py b/src/truefoundry_sdk/types/deployment_build.py
index 5be9084..e83ecce 100644
--- a/src/truefoundry_sdk/types/deployment_build.py
+++ b/src/truefoundry_sdk/types/deployment_build.py
@@ -23,6 +23,7 @@ class DeploymentBuild(UniversalBaseModel):
get_logs_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="getLogsUrl")] = None
tail_logs_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="tailLogsUrl")] = None
logs_start_ts: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="logsStartTs")] = None
+ metadata: typing.Optional[typing.Dict[str, typing.Any]] = None
created_at: typing_extensions.Annotated[typing.Optional[dt.datetime], FieldMetadata(alias="createdAt")] = None
updated_at: typing_extensions.Annotated[typing.Optional[dt.datetime], FieldMetadata(alias="updatedAt")] = None
diff --git a/src/truefoundry_sdk/types/deployment_status.py b/src/truefoundry_sdk/types/deployment_status.py
index a80183a..e48f00b 100644
--- a/src/truefoundry_sdk/types/deployment_status.py
+++ b/src/truefoundry_sdk/types/deployment_status.py
@@ -15,7 +15,7 @@ class DeploymentStatus(UniversalBaseModel):
id: typing.Optional[str] = None
deployment_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="deploymentId")] = None
status: typing.Optional[DeploymentStatusValue] = None
- state: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None
+ state: typing.Optional[typing.Dict[str, typing.Any]] = None
transition: typing.Optional[DeploymentTransition] = None
message: typing.Optional[str] = None
retry_count: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="retryCount")] = None
diff --git a/src/truefoundry_sdk/types/deployment_status_value.py b/src/truefoundry_sdk/types/deployment_status_value.py
index 6f053da..3728368 100644
--- a/src/truefoundry_sdk/types/deployment_status_value.py
+++ b/src/truefoundry_sdk/types/deployment_status_value.py
@@ -1,12 +1,13 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ..core import enum
+
T_Result = typing.TypeVar("T_Result")
-class DeploymentStatusValue(str, enum.Enum):
+class DeploymentStatusValue(enum.StrEnum):
INITIALIZED = "INITIALIZED"
BUILD_SUCCESS = "BUILD_SUCCESS"
BUILD_FAILED = "BUILD_FAILED"
diff --git a/src/truefoundry_sdk/types/deployment_transition.py b/src/truefoundry_sdk/types/deployment_transition.py
index a5ffd17..a305fb6 100644
--- a/src/truefoundry_sdk/types/deployment_transition.py
+++ b/src/truefoundry_sdk/types/deployment_transition.py
@@ -1,12 +1,13 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ..core import enum
+
T_Result = typing.TypeVar("T_Result")
-class DeploymentTransition(str, enum.Enum):
+class DeploymentTransition(enum.StrEnum):
BUILDING = "BUILDING"
DEPLOYING = "DEPLOYING"
REUSING_EXISTING_BUILD = "REUSING_EXISTING_BUILD"
diff --git a/src/truefoundry_sdk/types/enkrypt_ai_guardrail_config_operation.py b/src/truefoundry_sdk/types/enkrypt_ai_guardrail_config_operation.py
index 080d1f4..0cf9221 100644
--- a/src/truefoundry_sdk/types/enkrypt_ai_guardrail_config_operation.py
+++ b/src/truefoundry_sdk/types/enkrypt_ai_guardrail_config_operation.py
@@ -1,12 +1,13 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ..core import enum
+
T_Result = typing.TypeVar("T_Result")
-class EnkryptAiGuardrailConfigOperation(str, enum.Enum):
+class EnkryptAiGuardrailConfigOperation(enum.StrEnum):
"""
The operation type to use for the Guardrail. Validate guardrails are used to validate requests and mutate can validate as well as mutate requests.
Validate guardrails are run in parallel while mutate guardrails are run sequentially.
diff --git a/src/truefoundry_sdk/types/environment_optimize_for.py b/src/truefoundry_sdk/types/environment_optimize_for.py
index 8f04299..61bc2cd 100644
--- a/src/truefoundry_sdk/types/environment_optimize_for.py
+++ b/src/truefoundry_sdk/types/environment_optimize_for.py
@@ -1,12 +1,13 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ..core import enum
+
T_Result = typing.TypeVar("T_Result")
-class EnvironmentOptimizeFor(str, enum.Enum):
+class EnvironmentOptimizeFor(enum.StrEnum):
COST = "COST"
AVAILABILITY = "AVAILABILITY"
diff --git a/src/truefoundry_sdk/types/event_chart_category.py b/src/truefoundry_sdk/types/event_chart_category.py
index 007fe8a..1cee1e1 100644
--- a/src/truefoundry_sdk/types/event_chart_category.py
+++ b/src/truefoundry_sdk/types/event_chart_category.py
@@ -1,12 +1,13 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ..core import enum
+
T_Result = typing.TypeVar("T_Result")
-class EventChartCategory(str, enum.Enum):
+class EventChartCategory(enum.StrEnum):
CONTAINER_TERMINATED = "ContainerTerminated"
CONTAINER_OOM = "ContainerOOM"
POD_TERMINATED = "PodTerminated"
diff --git a/src/truefoundry_sdk/types/fiddler_guard_type.py b/src/truefoundry_sdk/types/fiddler_guard_type.py
index 7862b8e..b549790 100644
--- a/src/truefoundry_sdk/types/fiddler_guard_type.py
+++ b/src/truefoundry_sdk/types/fiddler_guard_type.py
@@ -1,12 +1,13 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ..core import enum
+
T_Result = typing.TypeVar("T_Result")
-class FiddlerGuardType(str, enum.Enum):
+class FiddlerGuardType(enum.StrEnum):
FIDDLER_SAFETY = "fiddler-safety"
FIDDLER_RESPONSE_FAITHFULNESS = "fiddler-response-faithfulness"
diff --git a/src/truefoundry_sdk/types/fiddler_guardrail_config.py b/src/truefoundry_sdk/types/fiddler_guardrail_config.py
index 3a01ebc..bfe20fc 100644
--- a/src/truefoundry_sdk/types/fiddler_guardrail_config.py
+++ b/src/truefoundry_sdk/types/fiddler_guardrail_config.py
@@ -28,6 +28,11 @@ class FiddlerGuardrailConfig(UniversalBaseModel):
auth_data: FiddlerKeyAuth
guard_type: FiddlerGuardType
+ operation: typing.Optional[typing.Literal["validate"]] = pydantic.Field(default=None)
+ """
+ The operation type for this guardrail. Fiddler guardrails can only be used for validation.
+ """
+
threshold: typing.Optional[float] = pydantic.Field(default=None)
"""
Confidence threshold (0.0-1.0) for flagging content. Content scoring above the threshold will be flagged
diff --git a/src/truefoundry_sdk/types/flyte_launch_plan.py b/src/truefoundry_sdk/types/flyte_launch_plan.py
index 520d01e..d98b9e1 100644
--- a/src/truefoundry_sdk/types/flyte_launch_plan.py
+++ b/src/truefoundry_sdk/types/flyte_launch_plan.py
@@ -11,7 +11,7 @@
class FlyteLaunchPlan(UniversalBaseModel):
id: FlyteLaunchPlanId
spec: FlyteLaunchPlanSpec
- closure: typing.Optional[typing.Any] = None
+ closure: typing.Any
if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2
diff --git a/src/truefoundry_sdk/types/flyte_task.py b/src/truefoundry_sdk/types/flyte_task.py
index 2a05ee8..02e7c6c 100644
--- a/src/truefoundry_sdk/types/flyte_task.py
+++ b/src/truefoundry_sdk/types/flyte_task.py
@@ -9,7 +9,7 @@
class FlyteTask(UniversalBaseModel):
template: FlyteTaskTemplate
- description: typing.Optional[typing.Optional[typing.Any]] = None
+ description: typing.Optional[typing.Any] = None
if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2
diff --git a/src/truefoundry_sdk/types/flyte_workflow.py b/src/truefoundry_sdk/types/flyte_workflow.py
index dbf064f..3a8af30 100644
--- a/src/truefoundry_sdk/types/flyte_workflow.py
+++ b/src/truefoundry_sdk/types/flyte_workflow.py
@@ -9,7 +9,7 @@
class FlyteWorkflow(UniversalBaseModel):
template: FlyteWorkflowTemplate
- description: typing.Optional[typing.Optional[typing.Any]] = None
+ description: typing.Optional[typing.Any] = None
if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2
diff --git a/src/truefoundry_sdk/types/function_schema.py b/src/truefoundry_sdk/types/function_schema.py
index 300141b..fdc8bb2 100644
--- a/src/truefoundry_sdk/types/function_schema.py
+++ b/src/truefoundry_sdk/types/function_schema.py
@@ -21,7 +21,7 @@ class FunctionSchema(UniversalBaseModel):
Description of the function
"""
- parameters: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
+ parameters: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None)
"""
Parameters schema for the function
"""
diff --git a/src/truefoundry_sdk/types/gateway_otel_config.py b/src/truefoundry_sdk/types/gateway_otel_config.py
index cee261f..34ed263 100644
--- a/src/truefoundry_sdk/types/gateway_otel_config.py
+++ b/src/truefoundry_sdk/types/gateway_otel_config.py
@@ -18,7 +18,7 @@ class GatewayOtelConfig(UniversalBaseModel):
default=None
)
"""
- OpenTelemetry Traces exporter configuration
+ Set this configuration to export LLM gateway OTEL traces to an external platform. Note that we only export OTEL traces via this configuration, this does not include OTEL metrics.
"""
if IS_PYDANTIC_V2:
diff --git a/src/truefoundry_sdk/types/gateway_request_metadata_filter_operator.py b/src/truefoundry_sdk/types/gateway_request_metadata_filter_operator.py
index 1c7ae74..ae38535 100644
--- a/src/truefoundry_sdk/types/gateway_request_metadata_filter_operator.py
+++ b/src/truefoundry_sdk/types/gateway_request_metadata_filter_operator.py
@@ -1,12 +1,13 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ..core import enum
+
T_Result = typing.TypeVar("T_Result")
-class GatewayRequestMetadataFilterOperator(str, enum.Enum):
+class GatewayRequestMetadataFilterOperator(enum.StrEnum):
EQUAL = "EQUAL"
GREATER_THAN = "GREATER_THAN"
LESS_THAN = "LESS_THAN"
diff --git a/src/truefoundry_sdk/types/gcp_gcs.py b/src/truefoundry_sdk/types/gcp_gcs.py
index 25e1d81..3c5b7bd 100644
--- a/src/truefoundry_sdk/types/gcp_gcs.py
+++ b/src/truefoundry_sdk/types/gcp_gcs.py
@@ -26,7 +26,7 @@ class GcpGcs(UniversalBaseModel):
storage_root: str = pydantic.Field()
"""
- The root path of the storage.
+ The Google Cloud Storage path in the format 'gs:///'. Example: 'gs://mybucket' or 'gs://mybucket/artifacts/production'.
"""
auth_data: typing.Optional[GcpKeyFileAuth] = None
diff --git a/src/truefoundry_sdk/types/gcp_key_file_auth.py b/src/truefoundry_sdk/types/gcp_key_file_auth.py
index fa9f1c5..11c35f0 100644
--- a/src/truefoundry_sdk/types/gcp_key_file_auth.py
+++ b/src/truefoundry_sdk/types/gcp_key_file_auth.py
@@ -16,7 +16,7 @@ class GcpKeyFileAuth(UniversalBaseModel):
+value=key-file
"""
- key_file_content: typing.Dict[str, typing.Optional[typing.Any]] = pydantic.Field()
+ key_file_content: typing.Dict[str, typing.Any] = pydantic.Field()
"""
Key File Content
"""
diff --git a/src/truefoundry_sdk/types/gcp_provider_account.py b/src/truefoundry_sdk/types/gcp_provider_account.py
index c68b842..d4af605 100644
--- a/src/truefoundry_sdk/types/gcp_provider_account.py
+++ b/src/truefoundry_sdk/types/gcp_provider_account.py
@@ -7,7 +7,7 @@
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from ..core.serialization import FieldMetadata
from .gcp_integrations import GcpIntegrations
-from .gcp_provider_account_auth_data import GcpProviderAccountAuthData
+from .gcp_key_file_auth import GcpKeyFileAuth
from .owned_by import OwnedBy
@@ -31,11 +31,7 @@ class GcpProviderAccount(UniversalBaseModel):
The project id of the GCP account.
"""
- auth_data: typing.Optional[GcpProviderAccountAuthData] = pydantic.Field(default=None)
- """
- Authentication data for the GCP account.
- """
-
+ auth_data: typing.Optional[GcpKeyFileAuth] = None
integrations: typing.List[GcpIntegrations] = pydantic.Field()
"""
List of integrations that are associated with the GCP provider account.
diff --git a/src/truefoundry_sdk/types/gcp_provider_account_auth_data.py b/src/truefoundry_sdk/types/gcp_provider_account_auth_data.py
deleted file mode 100644
index e370265..0000000
--- a/src/truefoundry_sdk/types/gcp_provider_account_auth_data.py
+++ /dev/null
@@ -1,8 +0,0 @@
-# This file was auto-generated by Fern from our API Definition.
-
-import typing
-
-from .gcp_api_key_auth import GcpApiKeyAuth
-from .gcp_key_file_auth import GcpKeyFileAuth
-
-GcpProviderAccountAuthData = typing.Union[GcpKeyFileAuth, GcpApiKeyAuth]
diff --git a/src/truefoundry_sdk/types/gcp_region.py b/src/truefoundry_sdk/types/gcp_region.py
index b9a8d1b..1654b47 100644
--- a/src/truefoundry_sdk/types/gcp_region.py
+++ b/src/truefoundry_sdk/types/gcp_region.py
@@ -1,12 +1,13 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ..core import enum
+
T_Result = typing.TypeVar("T_Result")
-class GcpRegion(str, enum.Enum):
+class GcpRegion(enum.StrEnum):
GLOBAL = "global"
NORTHAMERICA_NORTHEAST1 = "northamerica-northeast1"
NORTHAMERICA_NORTHEAST2 = "northamerica-northeast2"
diff --git a/src/truefoundry_sdk/types/get_application_deployment_response.py b/src/truefoundry_sdk/types/get_application_deployment_response.py
index 1ba75cd..bd90c13 100644
--- a/src/truefoundry_sdk/types/get_application_deployment_response.py
+++ b/src/truefoundry_sdk/types/get_application_deployment_response.py
@@ -23,6 +23,13 @@ class Config:
extra = pydantic.Extra.allow
+from .application import Application # noqa: E402, I001
+from .application_debug_info import ApplicationDebugInfo # noqa: E402, I001
from .deployment import Deployment # noqa: E402, I001
-update_forward_refs(GetApplicationDeploymentResponse)
+update_forward_refs(
+ GetApplicationDeploymentResponse,
+ Application=Application,
+ ApplicationDebugInfo=ApplicationDebugInfo,
+ Deployment=Deployment,
+)
diff --git a/src/truefoundry_sdk/types/get_application_response.py b/src/truefoundry_sdk/types/get_application_response.py
index 44ef606..0b776fd 100644
--- a/src/truefoundry_sdk/types/get_application_response.py
+++ b/src/truefoundry_sdk/types/get_application_response.py
@@ -24,5 +24,9 @@ class Config:
from .application import Application # noqa: E402, I001
+from .application_debug_info import ApplicationDebugInfo # noqa: E402, I001
+from .deployment import Deployment # noqa: E402, I001
-update_forward_refs(GetApplicationResponse)
+update_forward_refs(
+ GetApplicationResponse, Application=Application, ApplicationDebugInfo=ApplicationDebugInfo, Deployment=Deployment
+)
diff --git a/src/truefoundry_sdk/types/get_auto_provisioning_state_response.py b/src/truefoundry_sdk/types/get_auto_provisioning_state_response.py
index 1b1c9ce..7f33974 100644
--- a/src/truefoundry_sdk/types/get_auto_provisioning_state_response.py
+++ b/src/truefoundry_sdk/types/get_auto_provisioning_state_response.py
@@ -7,7 +7,7 @@
class GetAutoProvisioningStateResponse(UniversalBaseModel):
- state: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
+ state: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None)
"""
State of auto-provisioning for the cluster.
"""
diff --git a/src/truefoundry_sdk/types/get_secret_response.py b/src/truefoundry_sdk/types/get_secret_response.py
index 6c4ea2d..d52949b 100644
--- a/src/truefoundry_sdk/types/get_secret_response.py
+++ b/src/truefoundry_sdk/types/get_secret_response.py
@@ -24,5 +24,6 @@ class Config:
from .secret import Secret # noqa: E402, I001
+from .secret_version import SecretVersion # noqa: E402, I001
-update_forward_refs(GetSecretResponse)
+update_forward_refs(GetSecretResponse, Secret=Secret, SecretVersion=SecretVersion)
diff --git a/src/truefoundry_sdk/types/graph_chart_type.py b/src/truefoundry_sdk/types/graph_chart_type.py
index 1abf7df..7a2ad8f 100644
--- a/src/truefoundry_sdk/types/graph_chart_type.py
+++ b/src/truefoundry_sdk/types/graph_chart_type.py
@@ -1,12 +1,13 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ..core import enum
+
T_Result = typing.TypeVar("T_Result")
-class GraphChartType(str, enum.Enum):
+class GraphChartType(enum.StrEnum):
"""
Chart type
"""
diff --git a/src/truefoundry_sdk/types/header_routing_config.py b/src/truefoundry_sdk/types/header_routing_config.py
new file mode 100644
index 0000000..3e26afd
--- /dev/null
+++ b/src/truefoundry_sdk/types/header_routing_config.py
@@ -0,0 +1,9 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+from .latency_based_load_balancing import LatencyBasedLoadBalancing
+from .priority_based_load_balancing import PriorityBasedLoadBalancing
+from .weight_based_load_balancing import WeightBasedLoadBalancing
+
+HeaderRoutingConfig = typing.Union[WeightBasedLoadBalancing, LatencyBasedLoadBalancing, PriorityBasedLoadBalancing]
diff --git a/src/truefoundry_sdk/types/helm.py b/src/truefoundry_sdk/types/helm.py
index 7565983..3b91cec 100644
--- a/src/truefoundry_sdk/types/helm.py
+++ b/src/truefoundry_sdk/types/helm.py
@@ -31,15 +31,14 @@ class Helm(UniversalBaseModel):
Source helm repository
"""
- values: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
+ values: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None)
"""
Values file as block file
"""
kustomize: typing.Optional[Kustomize] = None
ignore_differences: typing_extensions.Annotated[
- typing.Optional[typing.List[typing.Dict[str, typing.Optional[typing.Any]]]],
- FieldMetadata(alias="ignoreDifferences"),
+ typing.Optional[typing.List[typing.Dict[str, typing.Any]]], FieldMetadata(alias="ignoreDifferences")
] = None
workspace_fqn: typing.Optional[str] = pydantic.Field(default=None)
"""
diff --git a/src/truefoundry_sdk/types/http_error.py b/src/truefoundry_sdk/types/http_error.py
index 1cdb898..be737b8 100644
--- a/src/truefoundry_sdk/types/http_error.py
+++ b/src/truefoundry_sdk/types/http_error.py
@@ -25,7 +25,7 @@ class HttpError(UniversalBaseModel):
Error code
"""
- details: typing.Optional[typing.List[typing.Dict[str, typing.Optional[typing.Any]]]] = pydantic.Field(default=None)
+ details: typing.Optional[typing.List[typing.Dict[str, typing.Any]]] = pydantic.Field(default=None)
"""
Error details
"""
diff --git a/src/truefoundry_sdk/types/i_change.py b/src/truefoundry_sdk/types/i_change.py
index 99a5c48..b33918f 100644
--- a/src/truefoundry_sdk/types/i_change.py
+++ b/src/truefoundry_sdk/types/i_change.py
@@ -14,9 +14,9 @@
class IChange(UniversalBaseModel):
type: IChangeOperation
key: str
- value: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None
+ value: typing.Optional[typing.Dict[str, typing.Any]] = None
old_value: typing_extensions.Annotated[
- typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]], FieldMetadata(alias="oldValue")
+ typing.Optional[typing.Dict[str, typing.Any]], FieldMetadata(alias="oldValue")
] = None
changes: typing.Optional[typing.List["IChange"]] = None
diff --git a/src/truefoundry_sdk/types/i_change_operation.py b/src/truefoundry_sdk/types/i_change_operation.py
index aa819ec..46fccf0 100644
--- a/src/truefoundry_sdk/types/i_change_operation.py
+++ b/src/truefoundry_sdk/types/i_change_operation.py
@@ -1,12 +1,13 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ..core import enum
+
T_Result = typing.TypeVar("T_Result")
-class IChangeOperation(str, enum.Enum):
+class IChangeOperation(enum.StrEnum):
REMOVE = "REMOVE"
ADD = "ADD"
UPDATE = "UPDATE"
diff --git a/src/truefoundry_sdk/types/infer_method_name.py b/src/truefoundry_sdk/types/infer_method_name.py
index 1b195d8..a41604f 100644
--- a/src/truefoundry_sdk/types/infer_method_name.py
+++ b/src/truefoundry_sdk/types/infer_method_name.py
@@ -1,12 +1,13 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ..core import enum
+
T_Result = typing.TypeVar("T_Result")
-class InferMethodName(str, enum.Enum):
+class InferMethodName(enum.StrEnum):
"""
Name of the method used for inference
"""
diff --git a/src/truefoundry_sdk/types/input_output_based_cost_metric_value.py b/src/truefoundry_sdk/types/input_output_based_cost_metric_value.py
index ec4a5fa..7781e88 100644
--- a/src/truefoundry_sdk/types/input_output_based_cost_metric_value.py
+++ b/src/truefoundry_sdk/types/input_output_based_cost_metric_value.py
@@ -4,22 +4,14 @@
import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
+from .non_negative_float import NonNegativeFloat
class InputOutputBasedCostMetricValue(UniversalBaseModel):
- input: float
- output: float
- cache_read: typing.Optional[float] = pydantic.Field(default=None)
- """
- Cost for reading cached tokens (e.g., OpenAI cached prompts, Anthropic cache reads)
- +uiProps={"allowDecimal":true}
- """
-
- cache_write: typing.Optional[float] = pydantic.Field(default=None)
- """
- Cost for writing/creating cached tokens (e.g., Anthropic cache creation)
- +uiProps={"allowDecimal":true}
- """
+ input: NonNegativeFloat
+ output: NonNegativeFloat
+ cache_read: typing.Optional[NonNegativeFloat] = None
+ cache_write: typing.Optional[NonNegativeFloat] = None
if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2
diff --git a/src/truefoundry_sdk/types/job_run_status.py b/src/truefoundry_sdk/types/job_run_status.py
index 07391d6..9b22ee7 100644
--- a/src/truefoundry_sdk/types/job_run_status.py
+++ b/src/truefoundry_sdk/types/job_run_status.py
@@ -1,12 +1,13 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ..core import enum
+
T_Result = typing.TypeVar("T_Result")
-class JobRunStatus(str, enum.Enum):
+class JobRunStatus(enum.StrEnum):
"""
Status of JobRun
"""
diff --git a/src/truefoundry_sdk/types/job_runs_sort_by.py b/src/truefoundry_sdk/types/job_runs_sort_by.py
index 6253412..66dfdcb 100644
--- a/src/truefoundry_sdk/types/job_runs_sort_by.py
+++ b/src/truefoundry_sdk/types/job_runs_sort_by.py
@@ -1,12 +1,13 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ..core import enum
+
T_Result = typing.TypeVar("T_Result")
-class JobRunsSortBy(str, enum.Enum):
+class JobRunsSortBy(enum.StrEnum):
START_TIME = "startTime"
DURATION = "duration"
DEPLOYMENT_VERSION = "deploymentVersion"
diff --git a/src/truefoundry_sdk/types/job_trigger_input.py b/src/truefoundry_sdk/types/job_trigger_input.py
index f9f2b0c..62c7bb4 100644
--- a/src/truefoundry_sdk/types/job_trigger_input.py
+++ b/src/truefoundry_sdk/types/job_trigger_input.py
@@ -13,7 +13,7 @@ class JobTriggerInput(UniversalBaseModel):
Command
"""
- params: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
+ params: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None)
"""
Parameters used to populate template command
"""
diff --git a/src/truefoundry_sdk/types/json_schema.py b/src/truefoundry_sdk/types/json_schema.py
index 3061473..4ec32e4 100644
--- a/src/truefoundry_sdk/types/json_schema.py
+++ b/src/truefoundry_sdk/types/json_schema.py
@@ -18,9 +18,7 @@ class JsonSchema(UniversalBaseModel):
Name of the schema
"""
- schema_: typing_extensions.Annotated[
- typing.Dict[str, typing.Optional[typing.Any]], FieldMetadata(alias="schema")
- ] = pydantic.Field()
+ schema_: typing_extensions.Annotated[typing.Dict[str, typing.Any], FieldMetadata(alias="schema")] = pydantic.Field()
"""
JSON schema object defining the expected structure
"""
diff --git a/src/truefoundry_sdk/types/jwt.py b/src/truefoundry_sdk/types/jwt.py
index 656ee9f..437f3b7 100644
--- a/src/truefoundry_sdk/types/jwt.py
+++ b/src/truefoundry_sdk/types/jwt.py
@@ -13,7 +13,7 @@ class Jwt(UniversalBaseModel):
id: str
subject_type: typing_extensions.Annotated[str, FieldMetadata(alias="subjectType")]
subject_id: typing_extensions.Annotated[str, FieldMetadata(alias="subjectId")]
- metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None
+ metadata: typing.Optional[typing.Dict[str, typing.Any]] = None
expiry: dt.datetime
created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")]
updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")]
diff --git a/src/truefoundry_sdk/types/kustomize.py b/src/truefoundry_sdk/types/kustomize.py
index 078f125..0b66279 100644
--- a/src/truefoundry_sdk/types/kustomize.py
+++ b/src/truefoundry_sdk/types/kustomize.py
@@ -7,14 +7,12 @@
class Kustomize(UniversalBaseModel):
- patch: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
+ patch: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None)
"""
Content of kustomization.yaml to perform kustomize operation. Please do not include the `resources` section. It is filled in automatically
"""
- additions: typing.Optional[typing.List[typing.Dict[str, typing.Optional[typing.Any]]]] = pydantic.Field(
- default=None
- )
+ additions: typing.Optional[typing.List[typing.Dict[str, typing.Any]]] = pydantic.Field(default=None)
"""
Additional kubernetes manifests to be included in the application
"""
diff --git a/src/truefoundry_sdk/types/latency_based_load_balance_target.py b/src/truefoundry_sdk/types/latency_based_load_balance_target.py
index 66c209f..abf58d7 100644
--- a/src/truefoundry_sdk/types/latency_based_load_balance_target.py
+++ b/src/truefoundry_sdk/types/latency_based_load_balance_target.py
@@ -28,7 +28,7 @@ class LatencyBasedLoadBalanceTarget(UniversalBaseModel):
Whether this target is a fallback candidate. If set to false, this model will not be considered as a fallback option for targets of this load-balance-rule
"""
- override_params: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
+ override_params: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None)
"""
Optional parameters to override in the request
"""
diff --git a/src/truefoundry_sdk/types/library_name.py b/src/truefoundry_sdk/types/library_name.py
index efac705..909e1c1 100644
--- a/src/truefoundry_sdk/types/library_name.py
+++ b/src/truefoundry_sdk/types/library_name.py
@@ -1,12 +1,13 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ..core import enum
+
T_Result = typing.TypeVar("T_Result")
-class LibraryName(str, enum.Enum):
+class LibraryName(enum.StrEnum):
"""
Name of the library for the framework
"""
diff --git a/src/truefoundry_sdk/types/list_application_deployments_response.py b/src/truefoundry_sdk/types/list_application_deployments_response.py
index 2ec1b29..a470172 100644
--- a/src/truefoundry_sdk/types/list_application_deployments_response.py
+++ b/src/truefoundry_sdk/types/list_application_deployments_response.py
@@ -29,6 +29,13 @@ class Config:
extra = pydantic.Extra.allow
+from .application import Application # noqa: E402, I001
+from .application_debug_info import ApplicationDebugInfo # noqa: E402, I001
from .deployment import Deployment # noqa: E402, I001
-update_forward_refs(ListApplicationDeploymentsResponse)
+update_forward_refs(
+ ListApplicationDeploymentsResponse,
+ Application=Application,
+ ApplicationDebugInfo=ApplicationDebugInfo,
+ Deployment=Deployment,
+)
diff --git a/src/truefoundry_sdk/types/list_applications_response.py b/src/truefoundry_sdk/types/list_applications_response.py
index 3cbe7f5..a7ab2d1 100644
--- a/src/truefoundry_sdk/types/list_applications_response.py
+++ b/src/truefoundry_sdk/types/list_applications_response.py
@@ -30,5 +30,9 @@ class Config:
from .application import Application # noqa: E402, I001
+from .application_debug_info import ApplicationDebugInfo # noqa: E402, I001
+from .deployment import Deployment # noqa: E402, I001
-update_forward_refs(ListApplicationsResponse)
+update_forward_refs(
+ ListApplicationsResponse, Application=Application, ApplicationDebugInfo=ApplicationDebugInfo, Deployment=Deployment
+)
diff --git a/src/truefoundry_sdk/types/list_secrets_response.py b/src/truefoundry_sdk/types/list_secrets_response.py
index 6e032e4..7ca58ac 100644
--- a/src/truefoundry_sdk/types/list_secrets_response.py
+++ b/src/truefoundry_sdk/types/list_secrets_response.py
@@ -30,5 +30,6 @@ class Config:
from .secret import Secret # noqa: E402, I001
+from .secret_version import SecretVersion # noqa: E402, I001
-update_forward_refs(ListSecretsResponse)
+update_forward_refs(ListSecretsResponse, Secret=Secret, SecretVersion=SecretVersion)
diff --git a/src/truefoundry_sdk/types/load_balance_target.py b/src/truefoundry_sdk/types/load_balance_target.py
index af755bb..872ca1d 100644
--- a/src/truefoundry_sdk/types/load_balance_target.py
+++ b/src/truefoundry_sdk/types/load_balance_target.py
@@ -33,7 +33,7 @@ class LoadBalanceTarget(UniversalBaseModel):
Whether this target is a fallback candidate. If set to false, this model will not be considered as a fallback option for targets of this load-balance-rule
"""
- override_params: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
+ override_params: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None)
"""
Optional parameters to override in the request
"""
diff --git a/src/truefoundry_sdk/types/load_balancing_when.py b/src/truefoundry_sdk/types/load_balancing_when.py
index ccca04f..f0d1286 100644
--- a/src/truefoundry_sdk/types/load_balancing_when.py
+++ b/src/truefoundry_sdk/types/load_balancing_when.py
@@ -16,7 +16,7 @@ class LoadBalancingWhen(UniversalBaseModel):
List of subjects that this rule applies to
"""
- models: typing.List[str] = pydantic.Field()
+ models: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
"""
List of models that this rule applies to
"""
diff --git a/src/truefoundry_sdk/types/logs_search_filter_type.py b/src/truefoundry_sdk/types/logs_search_filter_type.py
index e9bc8ab..74d25b0 100644
--- a/src/truefoundry_sdk/types/logs_search_filter_type.py
+++ b/src/truefoundry_sdk/types/logs_search_filter_type.py
@@ -1,12 +1,13 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ..core import enum
+
T_Result = typing.TypeVar("T_Result")
-class LogsSearchFilterType(str, enum.Enum):
+class LogsSearchFilterType(enum.StrEnum):
"""
Query filter type for logs search
"""
diff --git a/src/truefoundry_sdk/types/logs_search_operator_type.py b/src/truefoundry_sdk/types/logs_search_operator_type.py
index d25dcb4..5868902 100644
--- a/src/truefoundry_sdk/types/logs_search_operator_type.py
+++ b/src/truefoundry_sdk/types/logs_search_operator_type.py
@@ -1,12 +1,13 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ..core import enum
+
T_Result = typing.TypeVar("T_Result")
-class LogsSearchOperatorType(str, enum.Enum):
+class LogsSearchOperatorType(enum.StrEnum):
"""
Comparison operator logs search
"""
diff --git a/src/truefoundry_sdk/types/logs_sorting_direction.py b/src/truefoundry_sdk/types/logs_sorting_direction.py
index 104ea92..6c53580 100644
--- a/src/truefoundry_sdk/types/logs_sorting_direction.py
+++ b/src/truefoundry_sdk/types/logs_sorting_direction.py
@@ -1,12 +1,13 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ..core import enum
+
T_Result = typing.TypeVar("T_Result")
-class LogsSortingDirection(str, enum.Enum):
+class LogsSortingDirection(enum.StrEnum):
ASC = "asc"
DESC = "desc"
diff --git a/src/truefoundry_sdk/types/mcp_server_auth.py b/src/truefoundry_sdk/types/mcp_server_auth.py
index 647ad9c..bea1449 100644
--- a/src/truefoundry_sdk/types/mcp_server_auth.py
+++ b/src/truefoundry_sdk/types/mcp_server_auth.py
@@ -4,7 +4,6 @@
from .mcp_server_header_auth import McpServerHeaderAuth
from .mcp_server_o_auth2 import McpServerOAuth2
-from .mcp_server_o_auth2dcr import McpServerOAuth2Dcr
from .mcp_server_passthrough import McpServerPassthrough
-McpServerAuth = typing.Union[McpServerHeaderAuth, McpServerOAuth2Dcr, McpServerOAuth2, McpServerPassthrough]
+McpServerAuth = typing.Union[McpServerHeaderAuth, McpServerOAuth2, McpServerPassthrough]
diff --git a/src/truefoundry_sdk/types/mcp_server_integration_transport.py b/src/truefoundry_sdk/types/mcp_server_integration_transport.py
index 2bc72d1..fe2c69b 100644
--- a/src/truefoundry_sdk/types/mcp_server_integration_transport.py
+++ b/src/truefoundry_sdk/types/mcp_server_integration_transport.py
@@ -1,12 +1,13 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ..core import enum
+
T_Result = typing.TypeVar("T_Result")
-class McpServerIntegrationTransport(str, enum.Enum):
+class McpServerIntegrationTransport(enum.StrEnum):
"""
The transport protocol to use for communication with the MCP Server.
"""
diff --git a/src/truefoundry_sdk/types/mcp_server_o_auth2.py b/src/truefoundry_sdk/types/mcp_server_o_auth2.py
index 95170d3..0b4688b 100644
--- a/src/truefoundry_sdk/types/mcp_server_o_auth2.py
+++ b/src/truefoundry_sdk/types/mcp_server_o_auth2.py
@@ -27,11 +27,6 @@ class McpServerOAuth2(UniversalBaseModel):
The endpoint to exchange auth code for tokens.
"""
- scopes: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
- """
- List of scopes to request from the OAuth2 provider.
- """
-
client_id: typing.Optional[str] = pydantic.Field(default=None)
"""
client ID for OAuth2 or the TrueFoundry secret FQN containing the client ID.
@@ -44,7 +39,7 @@ class McpServerOAuth2(UniversalBaseModel):
registration_url: typing.Optional[str] = pydantic.Field(default=None)
"""
- URL for dynamic client registration (RFC 7591). If provided, client credentials will be obtained automatically.
+ URL for dynamic client registration (RFC 7591). If provided, client credentials will be obtained automatically using the Dynamic Client Registration (DCR) process.
"""
code_challenge_methods_supported: typing.Optional[typing.List[typing.Literal["S256"]]] = pydantic.Field(
@@ -59,6 +54,11 @@ class McpServerOAuth2(UniversalBaseModel):
Source of the JWT token to be used for verification.
"""
+ scopes: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
+ """
+ List of scopes to request from the OAuth2 provider.
+ """
+
if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2
else:
diff --git a/src/truefoundry_sdk/types/mcp_server_o_auth2jwt_source.py b/src/truefoundry_sdk/types/mcp_server_o_auth2jwt_source.py
index fe78c0e..148cdcd 100644
--- a/src/truefoundry_sdk/types/mcp_server_o_auth2jwt_source.py
+++ b/src/truefoundry_sdk/types/mcp_server_o_auth2jwt_source.py
@@ -1,12 +1,13 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ..core import enum
+
T_Result = typing.TypeVar("T_Result")
-class McpServerOAuth2JwtSource(str, enum.Enum):
+class McpServerOAuth2JwtSource(enum.StrEnum):
"""
Source of the JWT token to be used for verification.
"""
diff --git a/src/truefoundry_sdk/types/mime_type.py b/src/truefoundry_sdk/types/mime_type.py
index 13acf9a..d798494 100644
--- a/src/truefoundry_sdk/types/mime_type.py
+++ b/src/truefoundry_sdk/types/mime_type.py
@@ -1,12 +1,13 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ..core import enum
+
T_Result = typing.TypeVar("T_Result")
-class MimeType(str, enum.Enum):
+class MimeType(enum.StrEnum):
"""
MIME type of the content
"""
diff --git a/src/truefoundry_sdk/types/model_configuration.py b/src/truefoundry_sdk/types/model_configuration.py
index f56f708..df26682 100644
--- a/src/truefoundry_sdk/types/model_configuration.py
+++ b/src/truefoundry_sdk/types/model_configuration.py
@@ -27,7 +27,7 @@ class ModelConfiguration(UniversalBaseModel):
Parameters to pass to the model when generating
"""
- extra_parameters: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
+ extra_parameters: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None)
"""
Arbitrary extra parameters to pass to the model when generating
"""
diff --git a/src/truefoundry_sdk/types/model_manifest.py b/src/truefoundry_sdk/types/model_manifest.py
index 4e0ae5e..304cdc1 100644
--- a/src/truefoundry_sdk/types/model_manifest.py
+++ b/src/truefoundry_sdk/types/model_manifest.py
@@ -20,7 +20,7 @@ class ModelManifest(UniversalBaseModel):
"""
description: typing.Optional[str] = None
- metadata: typing.Dict[str, typing.Optional[typing.Any]] = pydantic.Field()
+ metadata: typing.Dict[str, typing.Any] = pydantic.Field()
"""
Key value metadata. Should be valid JSON. For e.g. `{"business-unit": "sales", "quality": "good", "rating": 4.5}`
"""
diff --git a/src/truefoundry_sdk/types/model_provider_account.py b/src/truefoundry_sdk/types/model_provider_account.py
index 327263c..13d2b31 100644
--- a/src/truefoundry_sdk/types/model_provider_account.py
+++ b/src/truefoundry_sdk/types/model_provider_account.py
@@ -27,6 +27,7 @@
from .self_hosted_model_provider_account import SelfHostedModelProviderAccount
from .snowflake_cortex_provider_account import SnowflakeCortexProviderAccount
from .together_ai_provider_account import TogetherAiProviderAccount
+from .virtual_model_provider_account import VirtualModelProviderAccount
ModelProviderAccount = typing.Union[
AwsBedrockProviderAccount,
@@ -54,4 +55,5 @@
AwsSagemakerProviderAccount,
CerebrasProviderAccount,
SnowflakeCortexProviderAccount,
+ VirtualModelProviderAccount,
]
diff --git a/src/truefoundry_sdk/types/model_type.py b/src/truefoundry_sdk/types/model_type.py
index 6d1c173..d38ed3f 100644
--- a/src/truefoundry_sdk/types/model_type.py
+++ b/src/truefoundry_sdk/types/model_type.py
@@ -1,12 +1,13 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ..core import enum
+
T_Result = typing.TypeVar("T_Result")
-class ModelType(str, enum.Enum):
+class ModelType(enum.StrEnum):
"""
Model Type
"""
diff --git a/src/truefoundry_sdk/types/multi_part_upload_storage_provider.py b/src/truefoundry_sdk/types/multi_part_upload_storage_provider.py
index 9d42ee4..d8221a4 100644
--- a/src/truefoundry_sdk/types/multi_part_upload_storage_provider.py
+++ b/src/truefoundry_sdk/types/multi_part_upload_storage_provider.py
@@ -1,12 +1,13 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ..core import enum
+
T_Result = typing.TypeVar("T_Result")
-class MultiPartUploadStorageProvider(str, enum.Enum):
+class MultiPartUploadStorageProvider(enum.StrEnum):
"""
An enumeration.
"""
diff --git a/src/truefoundry_sdk/types/node_selector_capacity_type.py b/src/truefoundry_sdk/types/node_selector_capacity_type.py
index d44e900..7d9502b 100644
--- a/src/truefoundry_sdk/types/node_selector_capacity_type.py
+++ b/src/truefoundry_sdk/types/node_selector_capacity_type.py
@@ -1,12 +1,13 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ..core import enum
+
T_Result = typing.TypeVar("T_Result")
-class NodeSelectorCapacityType(str, enum.Enum):
+class NodeSelectorCapacityType(enum.StrEnum):
"""
Configure what type of nodes to run the app. By default no placement logic is applied.
"spot_fallback_on_demand" will try to place the application on spot nodes but will fallback to on-demand when spot nodes are not available.
diff --git a/src/truefoundry_sdk/types/non_negative_float.py b/src/truefoundry_sdk/types/non_negative_float.py
new file mode 100644
index 0000000..da8968d
--- /dev/null
+++ b/src/truefoundry_sdk/types/non_negative_float.py
@@ -0,0 +1,3 @@
+# This file was auto-generated by Fern from our API Definition.
+
+NonNegativeFloat = float
diff --git a/src/truefoundry_sdk/types/nvidia_miggpu_profile.py b/src/truefoundry_sdk/types/nvidia_miggpu_profile.py
index e546e76..56f169d 100644
--- a/src/truefoundry_sdk/types/nvidia_miggpu_profile.py
+++ b/src/truefoundry_sdk/types/nvidia_miggpu_profile.py
@@ -1,12 +1,13 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ..core import enum
+
T_Result = typing.TypeVar("T_Result")
-class NvidiaMiggpuProfile(str, enum.Enum):
+class NvidiaMiggpuProfile(enum.StrEnum):
"""
Name of the MIG profile to use. One of the following based on gpu type
Please refer to https://docs.nvidia.com/datacenter/tesla/mig-user-guide/#supported-mig-profiles for more details
diff --git a/src/truefoundry_sdk/types/open_ai_moderations_guardrail_config.py b/src/truefoundry_sdk/types/open_ai_moderations_guardrail_config.py
index b6618ce..58e4bbe 100644
--- a/src/truefoundry_sdk/types/open_ai_moderations_guardrail_config.py
+++ b/src/truefoundry_sdk/types/open_ai_moderations_guardrail_config.py
@@ -34,6 +34,11 @@ class OpenAiModerationsGuardrailConfig(UniversalBaseModel):
Optional custom base URL for OpenAI API. If not provided, the default base URL will be used.
"""
+ operation: typing.Optional[typing.Literal["validate"]] = pydantic.Field(default=None)
+ """
+ The operation type for this guardrail. OpenAI Moderation guardrails can only be used for validation.
+ """
+
auth_data: OpenaiApiKeyAuth
model: str = pydantic.Field(default="omni-moderation-latest")
"""
diff --git a/src/truefoundry_sdk/types/operation.py b/src/truefoundry_sdk/types/operation.py
index b4ae932..5ad4f48 100644
--- a/src/truefoundry_sdk/types/operation.py
+++ b/src/truefoundry_sdk/types/operation.py
@@ -1,12 +1,13 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ..core import enum
+
T_Result = typing.TypeVar("T_Result")
-class Operation(str, enum.Enum):
+class Operation(enum.StrEnum):
"""
An enumeration.
"""
diff --git a/src/truefoundry_sdk/types/otel_exporter_grpc_config.py b/src/truefoundry_sdk/types/otel_exporter_grpc_config.py
index fa4e97e..260d37a 100644
--- a/src/truefoundry_sdk/types/otel_exporter_grpc_config.py
+++ b/src/truefoundry_sdk/types/otel_exporter_grpc_config.py
@@ -26,6 +26,16 @@ class OtelExporterGrpcConfig(UniversalBaseModel):
gRPC metadata to include in OpenTelemetry export requests
"""
+ additional_resource_attributes: typing.Optional[typing.Dict[str, str]] = pydantic.Field(default=None)
+ """
+ Set additional attributes to append them to existing resource attributes of every exported trace
+ """
+
+ exclude_request_data: typing.Optional[bool] = pydantic.Field(default=None)
+ """
+ Enable to prevent forwarding the LLM or MCP request and response body in exported traces. The following span attributes are dropped: tfy.input, tfy.output, tfy.input_short_hand
+ """
+
if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2
else:
diff --git a/src/truefoundry_sdk/types/otel_exporter_http_config.py b/src/truefoundry_sdk/types/otel_exporter_http_config.py
index 87d5db2..bf8f00d 100644
--- a/src/truefoundry_sdk/types/otel_exporter_http_config.py
+++ b/src/truefoundry_sdk/types/otel_exporter_http_config.py
@@ -32,6 +32,16 @@ class OtelExporterHttpConfig(UniversalBaseModel):
HTTP headers to include in OpenTelemetry export requests
"""
+ additional_resource_attributes: typing.Optional[typing.Dict[str, str]] = pydantic.Field(default=None)
+ """
+ Set additional attributes to append them to existing resource attributes of every exported trace
+ """
+
+ exclude_request_data: typing.Optional[bool] = pydantic.Field(default=None)
+ """
+ Enable to prevent forwarding the LLM or MCP request and response body in exported traces. The following span attributes are dropped: tfy.input, tfy.output, tfy.input_short_hand
+ """
+
if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2
else:
diff --git a/src/truefoundry_sdk/types/otel_exporter_http_config_encoding.py b/src/truefoundry_sdk/types/otel_exporter_http_config_encoding.py
index 75c5163..6a2d63b 100644
--- a/src/truefoundry_sdk/types/otel_exporter_http_config_encoding.py
+++ b/src/truefoundry_sdk/types/otel_exporter_http_config_encoding.py
@@ -1,12 +1,13 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ..core import enum
+
T_Result = typing.TypeVar("T_Result")
-class OtelExporterHttpConfigEncoding(str, enum.Enum):
+class OtelExporterHttpConfigEncoding(enum.StrEnum):
"""
Encoding for OpenTelemetry data
"""
diff --git a/src/truefoundry_sdk/types/palo_alto_prisma_airs_guardrail_config.py b/src/truefoundry_sdk/types/palo_alto_prisma_airs_guardrail_config.py
index 2ac3e49..53a0057 100644
--- a/src/truefoundry_sdk/types/palo_alto_prisma_airs_guardrail_config.py
+++ b/src/truefoundry_sdk/types/palo_alto_prisma_airs_guardrail_config.py
@@ -31,6 +31,11 @@ class PaloAltoPrismaAirsGuardrailConfig(UniversalBaseModel):
The profile name associated with this Guardrail Config.
"""
+ operation: typing.Optional[typing.Literal["validate"]] = pydantic.Field(default=None)
+ """
+ The operation type for this guardrail. Palo Alto Prisma AIRS guardrails can only be used for validation.
+ """
+
mode: typing.Optional[PaloAltoPrismaAirsGuardrailConfigMode] = pydantic.Field(default=None)
"""
Execution mode for the guardrail. Sync waits for the guardrail check to complete before proceeding. Async triggers the check without waiting. Defaults to sync.
diff --git a/src/truefoundry_sdk/types/palo_alto_prisma_airs_guardrail_config_mode.py b/src/truefoundry_sdk/types/palo_alto_prisma_airs_guardrail_config_mode.py
index 2aa56aa..7fe7cbb 100644
--- a/src/truefoundry_sdk/types/palo_alto_prisma_airs_guardrail_config_mode.py
+++ b/src/truefoundry_sdk/types/palo_alto_prisma_airs_guardrail_config_mode.py
@@ -1,12 +1,13 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ..core import enum
+
T_Result = typing.TypeVar("T_Result")
-class PaloAltoPrismaAirsGuardrailConfigMode(str, enum.Enum):
+class PaloAltoPrismaAirsGuardrailConfigMode(enum.StrEnum):
"""
Execution mode for the guardrail. Sync waits for the guardrail check to complete before proceeding. Async triggers the check without waiting. Defaults to sync.
"""
diff --git a/src/truefoundry_sdk/types/pangea_guard_type.py b/src/truefoundry_sdk/types/pangea_guard_type.py
index 9f300b3..66aa2ec 100644
--- a/src/truefoundry_sdk/types/pangea_guard_type.py
+++ b/src/truefoundry_sdk/types/pangea_guard_type.py
@@ -1,12 +1,13 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ..core import enum
+
T_Result = typing.TypeVar("T_Result")
-class PangeaGuardType(str, enum.Enum):
+class PangeaGuardType(enum.StrEnum):
TEXT_GUARD = "textGuard"
PII = "pii"
diff --git a/src/truefoundry_sdk/types/pangea_guardrail_config.py b/src/truefoundry_sdk/types/pangea_guardrail_config.py
index 0dc7ac7..4e92643 100644
--- a/src/truefoundry_sdk/types/pangea_guardrail_config.py
+++ b/src/truefoundry_sdk/types/pangea_guardrail_config.py
@@ -5,6 +5,7 @@
import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from .pangea_guard_type import PangeaGuardType
+from .pangea_guardrail_config_operation import PangeaGuardrailConfigOperation
from .pangea_key_auth import PangeaKeyAuth
@@ -28,6 +29,11 @@ class PangeaGuardrailConfig(UniversalBaseModel):
auth_data: PangeaKeyAuth
guard_type: PangeaGuardType
+ operation: typing.Optional[PangeaGuardrailConfigOperation] = pydantic.Field(default=None)
+ """
+ The operation type to use for the Guardrail. Validate guardrails are used to validate requests and mutate can validate as well as mutate requests.
+ """
+
domain: str = pydantic.Field()
"""
Domain of the cloud provider and region where your Pangea project is configured. Example: if endpoint is: https://.aws.us-west-2.pangea.cloud/v1/text/guard, the input should be: aws.us-west-2.pangea.cloud
diff --git a/src/truefoundry_sdk/types/pangea_guardrail_config_operation.py b/src/truefoundry_sdk/types/pangea_guardrail_config_operation.py
new file mode 100644
index 0000000..38365b6
--- /dev/null
+++ b/src/truefoundry_sdk/types/pangea_guardrail_config_operation.py
@@ -0,0 +1,22 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+from ..core import enum
+
+T_Result = typing.TypeVar("T_Result")
+
+
+class PangeaGuardrailConfigOperation(enum.StrEnum):
+ """
+ The operation type to use for the Guardrail. Validate guardrails are used to validate requests and mutate can validate as well as mutate requests.
+ """
+
+ VALIDATE = "validate"
+ MUTATE = "mutate"
+
+ def visit(self, validate: typing.Callable[[], T_Result], mutate: typing.Callable[[], T_Result]) -> T_Result:
+ if self is PangeaGuardrailConfigOperation.VALIDATE:
+ return validate()
+ if self is PangeaGuardrailConfigOperation.MUTATE:
+ return mutate()
diff --git a/src/truefoundry_sdk/types/param_param_type.py b/src/truefoundry_sdk/types/param_param_type.py
index 2a68c47..704cdbf 100644
--- a/src/truefoundry_sdk/types/param_param_type.py
+++ b/src/truefoundry_sdk/types/param_param_type.py
@@ -1,12 +1,13 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ..core import enum
+
T_Result = typing.TypeVar("T_Result")
-class ParamParamType(str, enum.Enum):
+class ParamParamType(enum.StrEnum):
STRING = "string"
ML_REPO = "ml_repo"
diff --git a/src/truefoundry_sdk/types/patronus_glider_criteria.py b/src/truefoundry_sdk/types/patronus_glider_criteria.py
index 22bdc0f..9fc9293 100644
--- a/src/truefoundry_sdk/types/patronus_glider_criteria.py
+++ b/src/truefoundry_sdk/types/patronus_glider_criteria.py
@@ -1,12 +1,13 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ..core import enum
+
T_Result = typing.TypeVar("T_Result")
-class PatronusGliderCriteria(str, enum.Enum):
+class PatronusGliderCriteria(enum.StrEnum):
PATRONUS_IS_COMPLIANT = "patronus:is-compliant"
PATRONUS_IS_FACTUALLY_CONSISTENT = "patronus:is-factually-consistent"
PATRONUS_IS_GOOD_SUMMARY = "patronus:is-good-summary"
diff --git a/src/truefoundry_sdk/types/patronus_guardrail_config.py b/src/truefoundry_sdk/types/patronus_guardrail_config.py
index 0a5cdcc..22d235d 100644
--- a/src/truefoundry_sdk/types/patronus_guardrail_config.py
+++ b/src/truefoundry_sdk/types/patronus_guardrail_config.py
@@ -27,6 +27,11 @@ class PatronusGuardrailConfig(UniversalBaseModel):
+value=integration/guardrail-config/patronus
"""
+ operation: typing.Optional[typing.Literal["validate"]] = pydantic.Field(default=None)
+ """
+ The operation type for this guardrail. Patronus guardrails can only be used for validation.
+ """
+
auth_data: PatronusKeyAuth
target: PatronusGuardrailConfigTarget = pydantic.Field()
"""
diff --git a/src/truefoundry_sdk/types/patronus_guardrail_config_target.py b/src/truefoundry_sdk/types/patronus_guardrail_config_target.py
index 24068c2..e3bcd80 100644
--- a/src/truefoundry_sdk/types/patronus_guardrail_config_target.py
+++ b/src/truefoundry_sdk/types/patronus_guardrail_config_target.py
@@ -1,12 +1,13 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ..core import enum
+
T_Result = typing.TypeVar("T_Result")
-class PatronusGuardrailConfigTarget(str, enum.Enum):
+class PatronusGuardrailConfigTarget(enum.StrEnum):
"""
Where to apply evaluation: request (evaluate user input) or response (evaluate model response)
"""
diff --git a/src/truefoundry_sdk/types/patronus_judge_criteria.py b/src/truefoundry_sdk/types/patronus_judge_criteria.py
index 2d035eb..b4eee74 100644
--- a/src/truefoundry_sdk/types/patronus_judge_criteria.py
+++ b/src/truefoundry_sdk/types/patronus_judge_criteria.py
@@ -1,12 +1,13 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ..core import enum
+
T_Result = typing.TypeVar("T_Result")
-class PatronusJudgeCriteria(str, enum.Enum):
+class PatronusJudgeCriteria(enum.StrEnum):
PATRONUS_ANSWER_REFUSAL = "patronus:answer-refusal"
PATRONUS_NO_OPENAI_REFERENCE = "patronus:no-openai-reference"
PATRONUS_IS_CONCISE = "patronus:is-concise"
diff --git a/src/truefoundry_sdk/types/per_thousand_embedding_tokens_cost_metric.py b/src/truefoundry_sdk/types/per_thousand_embedding_tokens_cost_metric.py
index 0536eb6..2a754f8 100644
--- a/src/truefoundry_sdk/types/per_thousand_embedding_tokens_cost_metric.py
+++ b/src/truefoundry_sdk/types/per_thousand_embedding_tokens_cost_metric.py
@@ -4,6 +4,7 @@
import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
+from .non_negative_float import NonNegativeFloat
class PerThousandEmbeddingTokensCostMetric(UniversalBaseModel):
@@ -12,7 +13,7 @@ class PerThousandEmbeddingTokensCostMetric(UniversalBaseModel):
+value=per_1000_embedding_tokens
"""
- value: float
+ value: NonNegativeFloat
if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2
diff --git a/src/truefoundry_sdk/types/policy_entity_types.py b/src/truefoundry_sdk/types/policy_entity_types.py
index fa54114..6cc2524 100644
--- a/src/truefoundry_sdk/types/policy_entity_types.py
+++ b/src/truefoundry_sdk/types/policy_entity_types.py
@@ -1,12 +1,13 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ..core import enum
+
T_Result = typing.TypeVar("T_Result")
-class PolicyEntityTypes(str, enum.Enum):
+class PolicyEntityTypes(enum.StrEnum):
SERVICE = "service"
ASYNC_SERVICE = "async-service"
JOB = "job"
diff --git a/src/truefoundry_sdk/types/policy_manifest_mode.py b/src/truefoundry_sdk/types/policy_manifest_mode.py
index ca091af..874ad00 100644
--- a/src/truefoundry_sdk/types/policy_manifest_mode.py
+++ b/src/truefoundry_sdk/types/policy_manifest_mode.py
@@ -1,12 +1,13 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ..core import enum
+
T_Result = typing.TypeVar("T_Result")
-class PolicyManifestMode(str, enum.Enum):
+class PolicyManifestMode(enum.StrEnum):
"""
Mode of the policy: `Audit` logs all policy evaluations without blocking deployments. `Enforce` blocks deployments if the policy fails. `Disabled` deactivates the policy.
"""
diff --git a/src/truefoundry_sdk/types/port_app_protocol.py b/src/truefoundry_sdk/types/port_app_protocol.py
index a0fb606..3f8aa32 100644
--- a/src/truefoundry_sdk/types/port_app_protocol.py
+++ b/src/truefoundry_sdk/types/port_app_protocol.py
@@ -1,12 +1,13 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ..core import enum
+
T_Result = typing.TypeVar("T_Result")
-class PortAppProtocol(str, enum.Enum):
+class PortAppProtocol(enum.StrEnum):
"""
Application Protocol for the port.
Select the application protocol used by your service. For most use cases, this should be `http`(HTTP/1.1).
diff --git a/src/truefoundry_sdk/types/port_protocol.py b/src/truefoundry_sdk/types/port_protocol.py
index 2139400..b33c35d 100644
--- a/src/truefoundry_sdk/types/port_protocol.py
+++ b/src/truefoundry_sdk/types/port_protocol.py
@@ -1,12 +1,13 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ..core import enum
+
T_Result = typing.TypeVar("T_Result")
-class PortProtocol(str, enum.Enum):
+class PortProtocol(enum.StrEnum):
"""
Protocol for the port.
"""
diff --git a/src/truefoundry_sdk/types/presigned_url_object.py b/src/truefoundry_sdk/types/presigned_url_object.py
index 0f17206..ea65bc9 100644
--- a/src/truefoundry_sdk/types/presigned_url_object.py
+++ b/src/truefoundry_sdk/types/presigned_url_object.py
@@ -9,7 +9,7 @@
class PresignedUrlObject(UniversalBaseModel):
uri: str
url: str
- headers: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None
+ headers: typing.Optional[typing.Dict[str, typing.Any]] = None
if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2
diff --git a/src/truefoundry_sdk/types/priority_based_load_balance_target.py b/src/truefoundry_sdk/types/priority_based_load_balance_target.py
index bbaf42c..bbc42a7 100644
--- a/src/truefoundry_sdk/types/priority_based_load_balance_target.py
+++ b/src/truefoundry_sdk/types/priority_based_load_balance_target.py
@@ -31,7 +31,7 @@ class PriorityBasedLoadBalanceTarget(UniversalBaseModel):
Whether this target is a fallback candidate. If set to false, this model will not be considered as a fallback option for targets of this load-balance-rule
"""
- override_params: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
+ override_params: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None)
"""
Optional parameters to override in the request
"""
diff --git a/src/truefoundry_sdk/types/prompt_foo_guard_type.py b/src/truefoundry_sdk/types/prompt_foo_guard_type.py
index 1ae3d58..2eb1437 100644
--- a/src/truefoundry_sdk/types/prompt_foo_guard_type.py
+++ b/src/truefoundry_sdk/types/prompt_foo_guard_type.py
@@ -1,12 +1,13 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ..core import enum
+
T_Result = typing.TypeVar("T_Result")
-class PromptFooGuardType(str, enum.Enum):
+class PromptFooGuardType(enum.StrEnum):
GUARD_CHECK = "guard_check"
PII_REDACTION = "pii_redaction"
HARMFUL_DETECTION = "harmful_detection"
diff --git a/src/truefoundry_sdk/types/prompt_foo_guardrail_config.py b/src/truefoundry_sdk/types/prompt_foo_guardrail_config.py
index 564b9cc..612b142 100644
--- a/src/truefoundry_sdk/types/prompt_foo_guardrail_config.py
+++ b/src/truefoundry_sdk/types/prompt_foo_guardrail_config.py
@@ -5,6 +5,7 @@
import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from .prompt_foo_guard_type import PromptFooGuardType
+from .prompt_foo_guardrail_config_operation import PromptFooGuardrailConfigOperation
class PromptFooGuardrailConfig(UniversalBaseModel):
@@ -26,6 +27,10 @@ class PromptFooGuardrailConfig(UniversalBaseModel):
"""
guard_type: PromptFooGuardType
+ operation: typing.Optional[PromptFooGuardrailConfigOperation] = pydantic.Field(default=None)
+ """
+ The operation type to use for the Guardrail. Validate guardrails are used to validate requests and mutate can validate as well as mutate requests.
+ """
if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2
diff --git a/src/truefoundry_sdk/types/prompt_foo_guardrail_config_operation.py b/src/truefoundry_sdk/types/prompt_foo_guardrail_config_operation.py
new file mode 100644
index 0000000..b86e158
--- /dev/null
+++ b/src/truefoundry_sdk/types/prompt_foo_guardrail_config_operation.py
@@ -0,0 +1,22 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+from ..core import enum
+
+T_Result = typing.TypeVar("T_Result")
+
+
+class PromptFooGuardrailConfigOperation(enum.StrEnum):
+ """
+ The operation type to use for the Guardrail. Validate guardrails are used to validate requests and mutate can validate as well as mutate requests.
+ """
+
+ VALIDATE = "validate"
+ MUTATE = "mutate"
+
+ def visit(self, validate: typing.Callable[[], T_Result], mutate: typing.Callable[[], T_Result]) -> T_Result:
+ if self is PromptFooGuardrailConfigOperation.VALIDATE:
+ return validate()
+ if self is PromptFooGuardrailConfigOperation.MUTATE:
+ return mutate()
diff --git a/src/truefoundry_sdk/types/py_spark_task_config.py b/src/truefoundry_sdk/types/py_spark_task_config.py
index 5a99a62..9ca6734 100644
--- a/src/truefoundry_sdk/types/py_spark_task_config.py
+++ b/src/truefoundry_sdk/types/py_spark_task_config.py
@@ -19,7 +19,7 @@ class PySparkTaskConfig(UniversalBaseModel):
image: TaskPySparkBuild
driver_config: SparkDriverConfig
executor_config: SparkExecutorConfig
- spark_conf: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
+ spark_conf: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None)
"""
Extra configuration properties to be passed to the spark job. [Docs](https://spark.apache.org/docs/latest/configuration.html)
"""
diff --git a/src/truefoundry_sdk/types/rate_limit_unit.py b/src/truefoundry_sdk/types/rate_limit_unit.py
index a1ad0b5..8003cbd 100644
--- a/src/truefoundry_sdk/types/rate_limit_unit.py
+++ b/src/truefoundry_sdk/types/rate_limit_unit.py
@@ -1,12 +1,13 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ..core import enum
+
T_Result = typing.TypeVar("T_Result")
-class RateLimitUnit(str, enum.Enum):
+class RateLimitUnit(enum.StrEnum):
"""
Unit for rate limit calculation
"""
diff --git a/src/truefoundry_sdk/types/recommendation.py b/src/truefoundry_sdk/types/recommendation.py
index 50e9933..c24864e 100644
--- a/src/truefoundry_sdk/types/recommendation.py
+++ b/src/truefoundry_sdk/types/recommendation.py
@@ -18,7 +18,7 @@ class Recommendation(UniversalBaseModel):
typing.Optional[int], FieldMetadata(alias="applicationVersion")
] = None
recommendation_data: typing_extensions.Annotated[
- typing.Dict[str, typing.Optional[typing.Any]], FieldMetadata(alias="recommendationData")
+ typing.Dict[str, typing.Any], FieldMetadata(alias="recommendationData")
]
recommendation_type: typing_extensions.Annotated[str, FieldMetadata(alias="recommendationType")]
applied_deployment_id: typing_extensions.Annotated[
diff --git a/src/truefoundry_sdk/types/role_manifest.py b/src/truefoundry_sdk/types/role_manifest.py
new file mode 100644
index 0000000..2b89596
--- /dev/null
+++ b/src/truefoundry_sdk/types/role_manifest.py
@@ -0,0 +1,49 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+import pydantic
+import typing_extensions
+from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
+from ..core.serialization import FieldMetadata
+from .role_permissions import RolePermissions
+
+
+class RoleManifest(UniversalBaseModel):
+ type: typing.Literal["role"] = pydantic.Field(default="role")
+ """
+ +value=role
+ """
+
+ name: str = pydantic.Field()
+ """
+ Unique identifier of the role across the organization
+ """
+
+ display_name: typing_extensions.Annotated[str, FieldMetadata(alias="displayName")] = pydantic.Field()
+ """
+ Human-readable name for the role
+ """
+
+ description: str = pydantic.Field()
+ """
+ Description of the role that explains its purpose and permissions
+ """
+
+ resource_type: typing_extensions.Annotated[str, FieldMetadata(alias="resourceType")] = pydantic.Field()
+ """
+ Type of resource this role applies to
+ """
+
+ permissions: typing.List[RolePermissions] = pydantic.Field()
+ """
+ Define the resource type and the corresponding actions this role can perform on the resource
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/truefoundry_sdk/types/role_permissions.py b/src/truefoundry_sdk/types/role_permissions.py
new file mode 100644
index 0000000..d618bbc
--- /dev/null
+++ b/src/truefoundry_sdk/types/role_permissions.py
@@ -0,0 +1,28 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+import pydantic
+import typing_extensions
+from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
+from ..core.serialization import FieldMetadata
+
+
+class RolePermissions(UniversalBaseModel):
+ resource_type: typing_extensions.Annotated[str, FieldMetadata(alias="resourceType")] = pydantic.Field()
+ """
+ Type of resource this role can perform actions on
+ """
+
+ actions: typing.List[str] = pydantic.Field()
+ """
+ Actions this role can perform on the resource
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/truefoundry_sdk/types/schedule_concurrency_policy.py b/src/truefoundry_sdk/types/schedule_concurrency_policy.py
index e0f38b8..97f62f8 100644
--- a/src/truefoundry_sdk/types/schedule_concurrency_policy.py
+++ b/src/truefoundry_sdk/types/schedule_concurrency_policy.py
@@ -1,12 +1,13 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ..core import enum
+
T_Result = typing.TypeVar("T_Result")
-class ScheduleConcurrencyPolicy(str, enum.Enum):
+class ScheduleConcurrencyPolicy(enum.StrEnum):
"""
Choose whether to allow this job to run while another instance of the job is running, or to replace the currently running instance. Allow
will enable multiple instances of this job to run. Forbid will keep the current instance of the job running and stop a new instance from being run.
diff --git a/src/truefoundry_sdk/types/secret.py b/src/truefoundry_sdk/types/secret.py
index 76caf62..776c368 100644
--- a/src/truefoundry_sdk/types/secret.py
+++ b/src/truefoundry_sdk/types/secret.py
@@ -42,4 +42,4 @@ class Config:
from .secret_version import SecretVersion # noqa: E402, I001
-update_forward_refs(Secret)
+update_forward_refs(Secret, SecretVersion=SecretVersion)
diff --git a/src/truefoundry_sdk/types/secret_group.py b/src/truefoundry_sdk/types/secret_group.py
index 8236f74..5976fc9 100644
--- a/src/truefoundry_sdk/types/secret_group.py
+++ b/src/truefoundry_sdk/types/secret_group.py
@@ -20,6 +20,7 @@ class SecretGroup(UniversalBaseModel):
created_by_subject: typing_extensions.Annotated[Subject, FieldMetadata(alias="createdBySubject")]
associated_secrets: typing_extensions.Annotated[typing.List["Secret"], FieldMetadata(alias="associatedSecrets")]
integration_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="integrationId")] = None
+ manifest: typing.Optional[typing.Dict[str, typing.Any]] = None
created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")]
updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")]
created_by: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="createdBy")] = None
@@ -34,5 +35,6 @@ class Config:
from .secret import Secret # noqa: E402, I001
+from .secret_version import SecretVersion # noqa: E402, I001
-update_forward_refs(SecretGroup)
+update_forward_refs(SecretGroup, Secret=Secret, SecretVersion=SecretVersion)
diff --git a/src/truefoundry_sdk/types/secret_group_manifest.py b/src/truefoundry_sdk/types/secret_group_manifest.py
new file mode 100644
index 0000000..c6250b0
--- /dev/null
+++ b/src/truefoundry_sdk/types/secret_group_manifest.py
@@ -0,0 +1,37 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
+from .collaborator import Collaborator
+
+
+class SecretGroupManifest(UniversalBaseModel):
+ type: typing.Literal["secret-group"] = pydantic.Field(default="secret-group")
+ """
+ +value=secret-group
+ """
+
+ name: str = pydantic.Field()
+ """
+ Name of the secret group
+ """
+
+ integration_fqn: str = pydantic.Field()
+ """
+ Secret Store to be associated with the secret group
+ """
+
+ collaborators: typing.List[Collaborator] = pydantic.Field()
+ """
+ Users and Teams that have access to Secret Group
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/truefoundry_sdk/types/secret_version.py b/src/truefoundry_sdk/types/secret_version.py
index bc1a251..e85cda8 100644
--- a/src/truefoundry_sdk/types/secret_version.py
+++ b/src/truefoundry_sdk/types/secret_version.py
@@ -32,4 +32,4 @@ class Config:
from .secret import Secret # noqa: E402, I001
-update_forward_refs(SecretVersion)
+update_forward_refs(SecretVersion, Secret=Secret)
diff --git a/src/truefoundry_sdk/types/self_hosted_model_model_server.py b/src/truefoundry_sdk/types/self_hosted_model_model_server.py
index aa3b064..9f6594d 100644
--- a/src/truefoundry_sdk/types/self_hosted_model_model_server.py
+++ b/src/truefoundry_sdk/types/self_hosted_model_model_server.py
@@ -1,12 +1,13 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ..core import enum
+
T_Result = typing.TypeVar("T_Result")
-class SelfHostedModelModelServer(str, enum.Enum):
+class SelfHostedModelModelServer(enum.StrEnum):
"""
The type of model server being used
"""
diff --git a/src/truefoundry_sdk/types/session.py b/src/truefoundry_sdk/types/session.py
index bc7bc3d..d1b9506 100644
--- a/src/truefoundry_sdk/types/session.py
+++ b/src/truefoundry_sdk/types/session.py
@@ -6,6 +6,7 @@
import typing_extensions
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from ..core.serialization import FieldMetadata
+from .account import Account
from .subject_type import SubjectType
from .user_metadata import UserMetadata
@@ -23,7 +24,12 @@ class Session(UniversalBaseModel):
tenant_name: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="tenantName")] = None
roles: typing.List[str]
teams: typing.List[str]
+ accounts: typing.List[str]
metadata: typing.Optional[UserMetadata] = None
+ service_account_metadata: typing_extensions.Annotated[
+ typing.Optional[typing.Dict[str, typing.Any]], FieldMetadata(alias="serviceAccountMetadata")
+ ] = None
+ account: typing.Optional[Account] = None
if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2
diff --git a/src/truefoundry_sdk/types/sklearn_model_schema.py b/src/truefoundry_sdk/types/sklearn_model_schema.py
index 967079e..aa8512a 100644
--- a/src/truefoundry_sdk/types/sklearn_model_schema.py
+++ b/src/truefoundry_sdk/types/sklearn_model_schema.py
@@ -13,12 +13,12 @@ class SklearnModelSchema(UniversalBaseModel):
Name of the method used for inference
"""
- inputs: typing.List[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field()
+ inputs: typing.List[typing.Dict[str, typing.Any]] = pydantic.Field()
"""
Schema of the input
"""
- outputs: typing.List[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field()
+ outputs: typing.List[typing.Dict[str, typing.Any]] = pydantic.Field()
"""
Schema of the output
"""
diff --git a/src/truefoundry_sdk/types/sklearn_serialization_format.py b/src/truefoundry_sdk/types/sklearn_serialization_format.py
index 70d7861..f287fcb 100644
--- a/src/truefoundry_sdk/types/sklearn_serialization_format.py
+++ b/src/truefoundry_sdk/types/sklearn_serialization_format.py
@@ -1,12 +1,13 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ..core import enum
+
T_Result = typing.TypeVar("T_Result")
-class SklearnSerializationFormat(str, enum.Enum):
+class SklearnSerializationFormat(enum.StrEnum):
"""
Serialization format used to save the sklearn model
"""
diff --git a/src/truefoundry_sdk/types/sort_direction.py b/src/truefoundry_sdk/types/sort_direction.py
index 0f707a3..31b2f69 100644
--- a/src/truefoundry_sdk/types/sort_direction.py
+++ b/src/truefoundry_sdk/types/sort_direction.py
@@ -1,12 +1,13 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ..core import enum
+
T_Result = typing.TypeVar("T_Result")
-class SortDirection(str, enum.Enum):
+class SortDirection(enum.StrEnum):
ASC = "asc"
DESC = "desc"
diff --git a/src/truefoundry_sdk/types/span_attribute_filter_operator.py b/src/truefoundry_sdk/types/span_attribute_filter_operator.py
index bc01749..68cb139 100644
--- a/src/truefoundry_sdk/types/span_attribute_filter_operator.py
+++ b/src/truefoundry_sdk/types/span_attribute_filter_operator.py
@@ -1,12 +1,13 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ..core import enum
+
T_Result = typing.TypeVar("T_Result")
-class SpanAttributeFilterOperator(str, enum.Enum):
+class SpanAttributeFilterOperator(enum.StrEnum):
EQUAL = "EQUAL"
GREATER_THAN = "GREATER_THAN"
LESS_THAN = "LESS_THAN"
diff --git a/src/truefoundry_sdk/types/span_field_filter_operator.py b/src/truefoundry_sdk/types/span_field_filter_operator.py
index b4d6511..9eed300 100644
--- a/src/truefoundry_sdk/types/span_field_filter_operator.py
+++ b/src/truefoundry_sdk/types/span_field_filter_operator.py
@@ -1,12 +1,13 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ..core import enum
+
T_Result = typing.TypeVar("T_Result")
-class SpanFieldFilterOperator(str, enum.Enum):
+class SpanFieldFilterOperator(enum.StrEnum):
EQUAL = "EQUAL"
GREATER_THAN = "GREATER_THAN"
LESS_THAN = "LESS_THAN"
diff --git a/src/truefoundry_sdk/types/span_field_filter_span_field_name.py b/src/truefoundry_sdk/types/span_field_filter_span_field_name.py
index 9030506..67b64fa 100644
--- a/src/truefoundry_sdk/types/span_field_filter_span_field_name.py
+++ b/src/truefoundry_sdk/types/span_field_filter_span_field_name.py
@@ -1,12 +1,13 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ..core import enum
+
T_Result = typing.TypeVar("T_Result")
-class SpanFieldFilterSpanFieldName(str, enum.Enum):
+class SpanFieldFilterSpanFieldName(enum.StrEnum):
SPAN_NAME = "spanName"
SPAN_ID = "spanId"
TRACE_ID = "traceId"
@@ -15,6 +16,11 @@ class SpanFieldFilterSpanFieldName(str, enum.Enum):
CREATED_BY_SUBJECT_SLUG = "createdBySubjectSlug"
CREATED_BY_SUBJECT_TYPE = "createdBySubjectType"
DURATION_IN_NS = "durationInNs"
+ DURATION_IN_MS = "durationInMs"
+ SPAN_STATUS_CODE = "spanStatusCode"
+ TAG = "tag"
+ SCOPE_NAME = "scopeName"
+ ENVIRONMENT = "environment"
def visit(
self,
@@ -26,6 +32,11 @@ def visit(
created_by_subject_slug: typing.Callable[[], T_Result],
created_by_subject_type: typing.Callable[[], T_Result],
duration_in_ns: typing.Callable[[], T_Result],
+ duration_in_ms: typing.Callable[[], T_Result],
+ span_status_code: typing.Callable[[], T_Result],
+ tag: typing.Callable[[], T_Result],
+ scope_name: typing.Callable[[], T_Result],
+ environment: typing.Callable[[], T_Result],
) -> T_Result:
if self is SpanFieldFilterSpanFieldName.SPAN_NAME:
return span_name()
@@ -43,3 +54,13 @@ def visit(
return created_by_subject_type()
if self is SpanFieldFilterSpanFieldName.DURATION_IN_NS:
return duration_in_ns()
+ if self is SpanFieldFilterSpanFieldName.DURATION_IN_MS:
+ return duration_in_ms()
+ if self is SpanFieldFilterSpanFieldName.SPAN_STATUS_CODE:
+ return span_status_code()
+ if self is SpanFieldFilterSpanFieldName.TAG:
+ return tag()
+ if self is SpanFieldFilterSpanFieldName.SCOPE_NAME:
+ return scope_name()
+ if self is SpanFieldFilterSpanFieldName.ENVIRONMENT:
+ return environment()
diff --git a/src/truefoundry_sdk/types/spark_job.py b/src/truefoundry_sdk/types/spark_job.py
index dd69485..5b99107 100644
--- a/src/truefoundry_sdk/types/spark_job.py
+++ b/src/truefoundry_sdk/types/spark_job.py
@@ -35,12 +35,12 @@ class SparkJob(UniversalBaseModel):
driver_config: SparkDriverConfig
executor_config: SparkExecutorConfig
- env: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
+ env: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None)
"""
Configure environment variables to be injected in the service either as plain text. [Docs](https://docs.truefoundry.com/docs/env-variables)
"""
- spark_conf: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
+ spark_conf: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None)
"""
Extra configuration properties to be passed to the spark job. [Docs](https://spark.apache.org/docs/latest/configuration.html)
"""
diff --git a/src/truefoundry_sdk/types/sqs_input_config.py b/src/truefoundry_sdk/types/sqs_input_config.py
index 06ea915..f571e9d 100644
--- a/src/truefoundry_sdk/types/sqs_input_config.py
+++ b/src/truefoundry_sdk/types/sqs_input_config.py
@@ -37,7 +37,7 @@ class SqsInputConfig(UniversalBaseModel):
Wait timeout for long polling. For more information, see [here](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-short-and-long-polling.html)
"""
- auth: AwsAccessKeyAuth
+ auth: typing.Optional[AwsAccessKeyAuth] = None
if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2
diff --git a/src/truefoundry_sdk/types/sqs_output_config.py b/src/truefoundry_sdk/types/sqs_output_config.py
index 1489ba6..b130141 100644
--- a/src/truefoundry_sdk/types/sqs_output_config.py
+++ b/src/truefoundry_sdk/types/sqs_output_config.py
@@ -27,7 +27,7 @@ class SqsOutputConfig(UniversalBaseModel):
AWS Region Name
"""
- auth: AwsAccessKeyAuth
+ auth: typing.Optional[AwsAccessKeyAuth] = None
if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2
diff --git a/src/truefoundry_sdk/types/sqs_queue_metric_config.py b/src/truefoundry_sdk/types/sqs_queue_metric_config.py
index ca6f68c..8796fa2 100644
--- a/src/truefoundry_sdk/types/sqs_queue_metric_config.py
+++ b/src/truefoundry_sdk/types/sqs_queue_metric_config.py
@@ -4,6 +4,7 @@
import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
+from .sqs_queue_metric_config_auth import SqsQueueMetricConfigAuth
class SqsQueueMetricConfig(UniversalBaseModel):
@@ -17,6 +18,11 @@ class SqsQueueMetricConfig(UniversalBaseModel):
Upper limit of the number of backlog messages the auto-scaler will try to maintain per replica. If you set this number to 10 and have 30 messages in the queue and one replica, the auto-scaler will scale the number of replicas to 3.
"""
+ auth: typing.Optional[SqsQueueMetricConfigAuth] = pydantic.Field(default=None)
+ """
+ Receive permissions on the SQS Queue
+ """
+
if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2
else:
diff --git a/src/truefoundry_sdk/types/sqs_queue_metric_config_auth.py b/src/truefoundry_sdk/types/sqs_queue_metric_config_auth.py
new file mode 100644
index 0000000..f4ac8d5
--- /dev/null
+++ b/src/truefoundry_sdk/types/sqs_queue_metric_config_auth.py
@@ -0,0 +1,8 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+from .aws_sqs_access_key_based_auth import AwsSqsAccessKeyBasedAuth
+from .aws_sqs_assumed_role_based_auth import AwsSqsAssumedRoleBasedAuth
+
+SqsQueueMetricConfigAuth = typing.Union[AwsSqsAccessKeyBasedAuth, AwsSqsAssumedRoleBasedAuth]
diff --git a/src/truefoundry_sdk/types/subject_type.py b/src/truefoundry_sdk/types/subject_type.py
index 4dd4b94..a6d02b5 100644
--- a/src/truefoundry_sdk/types/subject_type.py
+++ b/src/truefoundry_sdk/types/subject_type.py
@@ -1,12 +1,13 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ..core import enum
+
T_Result = typing.TypeVar("T_Result")
-class SubjectType(str, enum.Enum):
+class SubjectType(enum.StrEnum):
"""
Subject type
"""
@@ -15,6 +16,7 @@ class SubjectType(str, enum.Enum):
TEAM = "team"
SERVICEACCOUNT = "serviceaccount"
VIRTUALACCOUNT = "virtualaccount"
+ EXTERNAL_IDENTITY = "external-identity"
def visit(
self,
@@ -22,6 +24,7 @@ def visit(
team: typing.Callable[[], T_Result],
serviceaccount: typing.Callable[[], T_Result],
virtualaccount: typing.Callable[[], T_Result],
+ external_identity: typing.Callable[[], T_Result],
) -> T_Result:
if self is SubjectType.USER:
return user()
@@ -31,3 +34,5 @@ def visit(
return serviceaccount()
if self is SubjectType.VIRTUALACCOUNT:
return virtualaccount()
+ if self is SubjectType.EXTERNAL_IDENTITY:
+ return external_identity()
diff --git a/src/truefoundry_sdk/types/trace_span.py b/src/truefoundry_sdk/types/trace_span.py
index a3cf73d..d30cbec 100644
--- a/src/truefoundry_sdk/types/trace_span.py
+++ b/src/truefoundry_sdk/types/trace_span.py
@@ -71,13 +71,13 @@ class TraceSpan(UniversalBaseModel):
"""
span_attributes: typing_extensions.Annotated[
- typing.Dict[str, typing.Optional[typing.Any]], FieldMetadata(alias="spanAttributes")
+ typing.Dict[str, typing.Any], FieldMetadata(alias="spanAttributes")
] = pydantic.Field()
"""
Key-value pairs containing additional metadata about the span.
"""
- events: typing.List[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field()
+ events: typing.List[typing.Dict[str, typing.Any]] = pydantic.Field()
"""
Array of events that occurred during the span execution.
"""
diff --git a/src/truefoundry_sdk/types/true_foundry_apply_request_manifest.py b/src/truefoundry_sdk/types/true_foundry_apply_request_manifest.py
index 208d62b..9ee6a04 100644
--- a/src/truefoundry_sdk/types/true_foundry_apply_request_manifest.py
+++ b/src/truefoundry_sdk/types/true_foundry_apply_request_manifest.py
@@ -20,6 +20,8 @@
from .policy_manifest import PolicyManifest
from .provider_accounts import ProviderAccounts
from .r_studio import RStudio
+from .role_manifest import RoleManifest
+from .secret_group_manifest import SecretGroupManifest
from .service import Service
from .spark_job import SparkJob
from .ssh_server import SshServer
@@ -52,8 +54,10 @@
GatewayConfig,
TeamManifest,
PolicyManifest,
+ RoleManifest,
AlertConfig,
VirtualAccountManifest,
CommonToolsSettings,
AiFeaturesSettings,
+ SecretGroupManifest,
]
diff --git a/src/truefoundry_sdk/types/true_foundry_apply_response.py b/src/truefoundry_sdk/types/true_foundry_apply_response.py
index 3c25edf..bfcf75c 100644
--- a/src/truefoundry_sdk/types/true_foundry_apply_response.py
+++ b/src/truefoundry_sdk/types/true_foundry_apply_response.py
@@ -23,7 +23,7 @@ class TrueFoundryApplyResponse(UniversalBaseModel):
The action performed: CREATE or UPDATE
"""
- data: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
+ data: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None)
"""
The created or updated resource
"""
diff --git a/src/truefoundry_sdk/types/true_foundry_apply_response_action.py b/src/truefoundry_sdk/types/true_foundry_apply_response_action.py
index bd6f600..9e0a7d1 100644
--- a/src/truefoundry_sdk/types/true_foundry_apply_response_action.py
+++ b/src/truefoundry_sdk/types/true_foundry_apply_response_action.py
@@ -1,12 +1,13 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ..core import enum
+
T_Result = typing.TypeVar("T_Result")
-class TrueFoundryApplyResponseAction(str, enum.Enum):
+class TrueFoundryApplyResponseAction(enum.StrEnum):
"""
The action performed: CREATE or UPDATE
"""
diff --git a/src/truefoundry_sdk/types/true_foundry_apply_response_existing_manifest.py b/src/truefoundry_sdk/types/true_foundry_apply_response_existing_manifest.py
index 1047972..a0bd4df 100644
--- a/src/truefoundry_sdk/types/true_foundry_apply_response_existing_manifest.py
+++ b/src/truefoundry_sdk/types/true_foundry_apply_response_existing_manifest.py
@@ -20,6 +20,8 @@
from .policy_manifest import PolicyManifest
from .provider_accounts import ProviderAccounts
from .r_studio import RStudio
+from .role_manifest import RoleManifest
+from .secret_group_manifest import SecretGroupManifest
from .service import Service
from .spark_job import SparkJob
from .ssh_server import SshServer
@@ -52,8 +54,10 @@
GatewayConfig,
TeamManifest,
PolicyManifest,
+ RoleManifest,
AlertConfig,
VirtualAccountManifest,
CommonToolsSettings,
AiFeaturesSettings,
+ SecretGroupManifest,
]
diff --git a/src/truefoundry_sdk/types/true_foundry_delete_request_manifest.py b/src/truefoundry_sdk/types/true_foundry_delete_request_manifest.py
index cc75ca8..0f97b78 100644
--- a/src/truefoundry_sdk/types/true_foundry_delete_request_manifest.py
+++ b/src/truefoundry_sdk/types/true_foundry_delete_request_manifest.py
@@ -20,6 +20,8 @@
from .policy_manifest import PolicyManifest
from .provider_accounts import ProviderAccounts
from .r_studio import RStudio
+from .role_manifest import RoleManifest
+from .secret_group_manifest import SecretGroupManifest
from .service import Service
from .spark_job import SparkJob
from .ssh_server import SshServer
@@ -52,8 +54,10 @@
GatewayConfig,
TeamManifest,
PolicyManifest,
+ RoleManifest,
AlertConfig,
VirtualAccountManifest,
CommonToolsSettings,
AiFeaturesSettings,
+ SecretGroupManifest,
]
diff --git a/src/truefoundry_sdk/types/upgrade_data.py b/src/truefoundry_sdk/types/upgrade_data.py
index 5cdde24..3008805 100644
--- a/src/truefoundry_sdk/types/upgrade_data.py
+++ b/src/truefoundry_sdk/types/upgrade_data.py
@@ -32,4 +32,4 @@ class Config:
from .i_change import IChange # noqa: E402, I001
-update_forward_refs(UpgradeData)
+update_forward_refs(UpgradeData, IChange=IChange)
diff --git a/src/truefoundry_sdk/types/user.py b/src/truefoundry_sdk/types/user.py
index 46d5d14..2ebdb0e 100644
--- a/src/truefoundry_sdk/types/user.py
+++ b/src/truefoundry_sdk/types/user.py
@@ -8,6 +8,7 @@
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from ..core.serialization import FieldMetadata
from .user_metadata import UserMetadata
+from .user_role_with_resource import UserRoleWithResource
class User(UniversalBaseModel):
@@ -16,6 +17,9 @@ class User(UniversalBaseModel):
tenant_name: typing_extensions.Annotated[str, FieldMetadata(alias="tenantName")]
metadata: UserMetadata
roles: typing.Optional[typing.List[str]] = None
+ roles_with_resource: typing_extensions.Annotated[
+ typing.Optional[typing.List[UserRoleWithResource]], FieldMetadata(alias="rolesWithResource")
+ ] = None
active: bool
created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")]
updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")]
diff --git a/src/truefoundry_sdk/types/user_message_content.py b/src/truefoundry_sdk/types/user_message_content.py
index 452df8a..1547e60 100644
--- a/src/truefoundry_sdk/types/user_message_content.py
+++ b/src/truefoundry_sdk/types/user_message_content.py
@@ -3,6 +3,6 @@
import typing
from .blob_storage_reference import BlobStorageReference
-from .user_message_content_item import UserMessageContentItem
+from .user_message_content_one_item import UserMessageContentOneItem
-UserMessageContent = typing.Union[str, typing.List[UserMessageContentItem], BlobStorageReference]
+UserMessageContent = typing.Union[str, typing.List[UserMessageContentOneItem], BlobStorageReference]
diff --git a/src/truefoundry_sdk/types/user_message_content_item.py b/src/truefoundry_sdk/types/user_message_content_one_item.py
similarity index 69%
rename from src/truefoundry_sdk/types/user_message_content_item.py
rename to src/truefoundry_sdk/types/user_message_content_one_item.py
index 4887a1d..fdb589d 100644
--- a/src/truefoundry_sdk/types/user_message_content_item.py
+++ b/src/truefoundry_sdk/types/user_message_content_one_item.py
@@ -5,4 +5,4 @@
from .image_content_part import ImageContentPart
from .text_content_part import TextContentPart
-UserMessageContentItem = typing.Union[TextContentPart, ImageContentPart]
+UserMessageContentOneItem = typing.Union[TextContentPart, ImageContentPart]
diff --git a/src/truefoundry_sdk/types/user_metadata.py b/src/truefoundry_sdk/types/user_metadata.py
index 8f6f37f..2b5326b 100644
--- a/src/truefoundry_sdk/types/user_metadata.py
+++ b/src/truefoundry_sdk/types/user_metadata.py
@@ -14,16 +14,17 @@ class UserMetadata(UniversalBaseModel):
image_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="imageURL")] = None
display_name: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="displayName")] = None
user_object: typing_extensions.Annotated[
- typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]], FieldMetadata(alias="userObject")
+ typing.Optional[typing.Dict[str, typing.Any]], FieldMetadata(alias="userObject")
] = None
invite_accepted: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="inviteAccepted")] = None
registered_in_idp: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="registeredInIdp")] = None
- preference: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None
+ preference: typing.Optional[typing.Dict[str, typing.Any]] = None
groups: typing.Optional[typing.List[str]] = None
tenant_role_managed_by: typing_extensions.Annotated[
typing.Optional[UserMetadataTenantRoleManagedBy], FieldMetadata(alias="tenantRoleManagedBy")
] = None
sso_name: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="ssoName")] = None
+ is_primary_sso: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="isPrimarySSO")] = None
if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2
diff --git a/src/truefoundry_sdk/types/user_metadata_tenant_role_managed_by.py b/src/truefoundry_sdk/types/user_metadata_tenant_role_managed_by.py
index 19e36bc..35b643a 100644
--- a/src/truefoundry_sdk/types/user_metadata_tenant_role_managed_by.py
+++ b/src/truefoundry_sdk/types/user_metadata_tenant_role_managed_by.py
@@ -1,12 +1,13 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ..core import enum
+
T_Result = typing.TypeVar("T_Result")
-class UserMetadataTenantRoleManagedBy(str, enum.Enum):
+class UserMetadataTenantRoleManagedBy(enum.StrEnum):
MANUAL = "manual"
GROUP = "group"
INITIAL = "initial"
diff --git a/src/truefoundry_sdk/types/user_role_with_resource.py b/src/truefoundry_sdk/types/user_role_with_resource.py
new file mode 100644
index 0000000..7f96384
--- /dev/null
+++ b/src/truefoundry_sdk/types/user_role_with_resource.py
@@ -0,0 +1,23 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+import pydantic
+import typing_extensions
+from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
+from ..core.serialization import FieldMetadata
+from .user_role_with_resource_resource_type import UserRoleWithResourceResourceType
+
+
+class UserRoleWithResource(UniversalBaseModel):
+ role_id: typing_extensions.Annotated[str, FieldMetadata(alias="roleId")]
+ resource_type: typing_extensions.Annotated[UserRoleWithResourceResourceType, FieldMetadata(alias="resourceType")]
+ resource_id: typing_extensions.Annotated[str, FieldMetadata(alias="resourceId")]
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/truefoundry_sdk/types/user_role_with_resource_resource_type.py b/src/truefoundry_sdk/types/user_role_with_resource_resource_type.py
new file mode 100644
index 0000000..10fcd27
--- /dev/null
+++ b/src/truefoundry_sdk/types/user_role_with_resource_resource_type.py
@@ -0,0 +1,134 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+from ..core import enum
+
+T_Result = typing.TypeVar("T_Result")
+
+
+class UserRoleWithResourceResourceType(enum.StrEnum):
+ ROLE = "role"
+ ACCOUNT = "account"
+ CLUSTER = "cluster"
+ WORKSPACE = "workspace"
+ ENVIRONMENT = "environment"
+ SECRET_GROUP = "secret-group"
+ DEPLOYMENT = "deployment"
+ APPLICATION = "application"
+ SECRET = "secret"
+ DOCKER_REGISTRY = "docker-registry"
+ TENANT = "tenant"
+ VCS_INTEGRATION = "vcs-integration"
+ MLF_PROJECT = "mlf-project"
+ PROVIDER_INTEGRATION = "provider-integration"
+ TEAM = "team"
+ SERVICE_ACCOUNT = "service-account"
+ LLM_GATEWAY = "llm-gateway"
+ POLICY = "policy"
+ SETTINGS = "settings"
+ PROVIDER_ACCOUNT = "provider-account"
+ USER = "user"
+ ALERT_CONFIG = "alert-config"
+ ALERT_RULE = "alert-rule"
+ GATEWAY_CONFIG = "gateway-config"
+ TRACING_PROJECT = "tracing-project"
+ TRACING_APPLICATION = "tracing-application"
+ AGENT_APP = "agent-app"
+ GATEWAY_INSTALLATION = "gateway-installation"
+ VIRTUAL_ACCOUNT = "virtual-account"
+ SSO_BASED_IDENTITY = "sso-based-identity"
+
+ def visit(
+ self,
+ role: typing.Callable[[], T_Result],
+ account: typing.Callable[[], T_Result],
+ cluster: typing.Callable[[], T_Result],
+ workspace: typing.Callable[[], T_Result],
+ environment: typing.Callable[[], T_Result],
+ secret_group: typing.Callable[[], T_Result],
+ deployment: typing.Callable[[], T_Result],
+ application: typing.Callable[[], T_Result],
+ secret: typing.Callable[[], T_Result],
+ docker_registry: typing.Callable[[], T_Result],
+ tenant: typing.Callable[[], T_Result],
+ vcs_integration: typing.Callable[[], T_Result],
+ mlf_project: typing.Callable[[], T_Result],
+ provider_integration: typing.Callable[[], T_Result],
+ team: typing.Callable[[], T_Result],
+ service_account: typing.Callable[[], T_Result],
+ llm_gateway: typing.Callable[[], T_Result],
+ policy: typing.Callable[[], T_Result],
+ settings: typing.Callable[[], T_Result],
+ provider_account: typing.Callable[[], T_Result],
+ user: typing.Callable[[], T_Result],
+ alert_config: typing.Callable[[], T_Result],
+ alert_rule: typing.Callable[[], T_Result],
+ gateway_config: typing.Callable[[], T_Result],
+ tracing_project: typing.Callable[[], T_Result],
+ tracing_application: typing.Callable[[], T_Result],
+ agent_app: typing.Callable[[], T_Result],
+ gateway_installation: typing.Callable[[], T_Result],
+ virtual_account: typing.Callable[[], T_Result],
+ sso_based_identity: typing.Callable[[], T_Result],
+ ) -> T_Result:
+ if self is UserRoleWithResourceResourceType.ROLE:
+ return role()
+ if self is UserRoleWithResourceResourceType.ACCOUNT:
+ return account()
+ if self is UserRoleWithResourceResourceType.CLUSTER:
+ return cluster()
+ if self is UserRoleWithResourceResourceType.WORKSPACE:
+ return workspace()
+ if self is UserRoleWithResourceResourceType.ENVIRONMENT:
+ return environment()
+ if self is UserRoleWithResourceResourceType.SECRET_GROUP:
+ return secret_group()
+ if self is UserRoleWithResourceResourceType.DEPLOYMENT:
+ return deployment()
+ if self is UserRoleWithResourceResourceType.APPLICATION:
+ return application()
+ if self is UserRoleWithResourceResourceType.SECRET:
+ return secret()
+ if self is UserRoleWithResourceResourceType.DOCKER_REGISTRY:
+ return docker_registry()
+ if self is UserRoleWithResourceResourceType.TENANT:
+ return tenant()
+ if self is UserRoleWithResourceResourceType.VCS_INTEGRATION:
+ return vcs_integration()
+ if self is UserRoleWithResourceResourceType.MLF_PROJECT:
+ return mlf_project()
+ if self is UserRoleWithResourceResourceType.PROVIDER_INTEGRATION:
+ return provider_integration()
+ if self is UserRoleWithResourceResourceType.TEAM:
+ return team()
+ if self is UserRoleWithResourceResourceType.SERVICE_ACCOUNT:
+ return service_account()
+ if self is UserRoleWithResourceResourceType.LLM_GATEWAY:
+ return llm_gateway()
+ if self is UserRoleWithResourceResourceType.POLICY:
+ return policy()
+ if self is UserRoleWithResourceResourceType.SETTINGS:
+ return settings()
+ if self is UserRoleWithResourceResourceType.PROVIDER_ACCOUNT:
+ return provider_account()
+ if self is UserRoleWithResourceResourceType.USER:
+ return user()
+ if self is UserRoleWithResourceResourceType.ALERT_CONFIG:
+ return alert_config()
+ if self is UserRoleWithResourceResourceType.ALERT_RULE:
+ return alert_rule()
+ if self is UserRoleWithResourceResourceType.GATEWAY_CONFIG:
+ return gateway_config()
+ if self is UserRoleWithResourceResourceType.TRACING_PROJECT:
+ return tracing_project()
+ if self is UserRoleWithResourceResourceType.TRACING_APPLICATION:
+ return tracing_application()
+ if self is UserRoleWithResourceResourceType.AGENT_APP:
+ return agent_app()
+ if self is UserRoleWithResourceResourceType.GATEWAY_INSTALLATION:
+ return gateway_installation()
+ if self is UserRoleWithResourceResourceType.VIRTUAL_ACCOUNT:
+ return virtual_account()
+ if self is UserRoleWithResourceResourceType.SSO_BASED_IDENTITY:
+ return sso_based_identity()
diff --git a/src/truefoundry_sdk/types/virtual_account.py b/src/truefoundry_sdk/types/virtual_account.py
index 0a44b4c..61ed033 100644
--- a/src/truefoundry_sdk/types/virtual_account.py
+++ b/src/truefoundry_sdk/types/virtual_account.py
@@ -25,6 +25,8 @@ class VirtualAccount(UniversalBaseModel):
is_expired: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="isExpired")] = None
jwts: typing.Optional[typing.List[Jwt]] = None
account_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="accountId")] = None
+ metadata: typing.Optional[typing.Dict[str, typing.Any]] = None
+ role_ids: typing_extensions.Annotated[typing.Optional[typing.List[str]], FieldMetadata(alias="roleIds")] = None
created_by: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="createdBy")] = None
next_scheduled_rotation: typing_extensions.Annotated[
typing.Optional[str], FieldMetadata(alias="nextScheduledRotation")
diff --git a/src/truefoundry_sdk/types/virtual_model.py b/src/truefoundry_sdk/types/virtual_model.py
new file mode 100644
index 0000000..98c3096
--- /dev/null
+++ b/src/truefoundry_sdk/types/virtual_model.py
@@ -0,0 +1,44 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
+from .header_routing_config import HeaderRoutingConfig
+from .model_type import ModelType
+
+
+class VirtualModel(UniversalBaseModel):
+ """
+ Virtual Model
+ """
+
+ name: str = pydantic.Field()
+ """
+ The name of the Virtual Model
+ """
+
+ type: typing.Literal["integration/model/virtual"] = pydantic.Field(default="integration/model/virtual")
+ """
+ +value=integration/model/virtual
+ """
+
+ model_types: typing.List[ModelType] = pydantic.Field()
+ """
+ Specify the type of the Virtual Model
+ """
+
+ slug: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ It should be a unique identifier for the virtual model. It is used to uniquely identify the virtual model. It can be used in place of virtualGroupName/virtualModelName.
+ """
+
+ routing_config: HeaderRoutingConfig
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/truefoundry_sdk/types/virtual_model_provider_account.py b/src/truefoundry_sdk/types/virtual_model_provider_account.py
new file mode 100644
index 0000000..1a9cf17
--- /dev/null
+++ b/src/truefoundry_sdk/types/virtual_model_provider_account.py
@@ -0,0 +1,47 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+import pydantic
+import typing_extensions
+from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
+from ..core.serialization import FieldMetadata
+from .collaborator import Collaborator
+from .owned_by import OwnedBy
+from .virtual_model import VirtualModel
+
+
+class VirtualModelProviderAccount(UniversalBaseModel):
+ """
+ Virtual Model Provider Group
+ """
+
+ name: str = pydantic.Field()
+ """
+ The name of the Virtual Model Provider Group
+ """
+
+ type: typing.Literal["provider-account/virtual-model"] = pydantic.Field(default="provider-account/virtual-model")
+ """
+ +value=provider-account/virtual-model
+ """
+
+ integrations: typing.List[VirtualModel] = pydantic.Field()
+ """
+ List of virtual models in this group
+ """
+
+ collaborators: typing.Optional[typing.List[Collaborator]] = pydantic.Field(default=None)
+ """
+ List of users who have access to this Virtual Model Provider Group
+ """
+
+ owned_by: typing_extensions.Annotated[typing.Optional[OwnedBy], FieldMetadata(alias="ownedBy")] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/truefoundry_sdk/types/xg_boost_model_schema.py b/src/truefoundry_sdk/types/xg_boost_model_schema.py
index 720609f..d033dbe 100644
--- a/src/truefoundry_sdk/types/xg_boost_model_schema.py
+++ b/src/truefoundry_sdk/types/xg_boost_model_schema.py
@@ -16,12 +16,12 @@ class XgBoostModelSchema(UniversalBaseModel):
Name of the method used for inference
"""
- inputs: typing.List[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field()
+ inputs: typing.List[typing.Dict[str, typing.Any]] = pydantic.Field()
"""
Schema of the input
"""
- outputs: typing.List[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field()
+ outputs: typing.List[typing.Dict[str, typing.Any]] = pydantic.Field()
"""
Schema of the output
"""
diff --git a/src/truefoundry_sdk/types/xg_boost_serialization_format.py b/src/truefoundry_sdk/types/xg_boost_serialization_format.py
index ef383b5..4b22eaa 100644
--- a/src/truefoundry_sdk/types/xg_boost_serialization_format.py
+++ b/src/truefoundry_sdk/types/xg_boost_serialization_format.py
@@ -1,12 +1,13 @@
# This file was auto-generated by Fern from our API Definition.
-import enum
import typing
+from ..core import enum
+
T_Result = typing.TypeVar("T_Result")
-class XgBoostSerializationFormat(str, enum.Enum):
+class XgBoostSerializationFormat(enum.StrEnum):
"""
Serialization format used to save the xgboost model
"""
diff --git a/src/truefoundry_sdk/users/client.py b/src/truefoundry_sdk/users/client.py
index ce4c91a..b840957 100644
--- a/src/truefoundry_sdk/users/client.py
+++ b/src/truefoundry_sdk/users/client.py
@@ -13,6 +13,7 @@
from ..types.get_user_response import GetUserResponse
from ..types.get_user_teams_response import GetUserTeamsResponse
from ..types.invite_user_response import InviteUserResponse
+from ..types.list_users_response import ListUsersResponse
from ..types.register_users_response import RegisterUsersResponse
from ..types.update_user_roles_response import UpdateUserRolesResponse
from ..types.user import User
@@ -46,7 +47,7 @@ def list(
show_invalid_users: typing.Optional[bool] = None,
include_virtual_accounts: typing.Optional[str] = None,
request_options: typing.Optional[RequestOptions] = None,
- ) -> SyncPager[User]:
+ ) -> SyncPager[User, ListUsersResponse]:
"""
List all users of tenant filtered by query and showInvalidUsers. Pagination is available based on query parameters.
@@ -71,7 +72,7 @@ def list(
Returns
-------
- SyncPager[User]
+ SyncPager[User, ListUsersResponse]
Returns all users of tenant and also the response includes paginated data.
Examples
@@ -112,7 +113,6 @@ def pre_register_users(
skip_if_user_exists: typing.Optional[bool] = False,
dry_run: typing.Optional[bool] = False,
accept_invite_client_url: typing.Optional[str] = OMIT,
- account_id: typing.Optional[str] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> RegisterUsersResponse:
"""
@@ -135,9 +135,6 @@ def pre_register_users(
accept_invite_client_url : typing.Optional[str]
Url to redirect when invite is accepted
- account_id : typing.Optional[str]
- Account ID to add the user to
-
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
@@ -164,13 +161,17 @@ def pre_register_users(
skip_if_user_exists=skip_if_user_exists,
dry_run=dry_run,
accept_invite_client_url=accept_invite_client_url,
- account_id=account_id,
request_options=request_options,
)
return _response.data
def update_roles(
- self, *, email: str, roles: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None
+ self,
+ *,
+ email: str,
+ roles: typing.Sequence[str],
+ resource_type: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
) -> UpdateUserRolesResponse:
"""
This endpoint allows tenant administrators to update the roles of a user within their tenant.
@@ -181,7 +182,10 @@ def update_roles(
Email of the user
roles : typing.Sequence[str]
- Roles for the user
+ Role names for the user
+
+ resource_type : typing.Optional[str]
+ Resource Type
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
@@ -204,7 +208,9 @@ def update_roles(
roles=["roles"],
)
"""
- _response = self._raw_client.update_roles(email=email, roles=roles, request_options=request_options)
+ _response = self._raw_client.update_roles(
+ email=email, roles=roles, resource_type=resource_type, request_options=request_options
+ )
return _response.data
def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> GetUserResponse:
@@ -272,12 +278,7 @@ def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] =
return _response.data
def invite_user(
- self,
- *,
- accept_invite_client_url: str,
- email: str,
- account_id: typing.Optional[str] = OMIT,
- request_options: typing.Optional[RequestOptions] = None,
+ self, *, accept_invite_client_url: str, email: str, request_options: typing.Optional[RequestOptions] = None
) -> InviteUserResponse:
"""
Invite a user to the tenant
@@ -290,9 +291,6 @@ def invite_user(
email : str
Email of user
- account_id : typing.Optional[str]
- Account ID to add the user to
-
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
@@ -315,10 +313,7 @@ def invite_user(
)
"""
_response = self._raw_client.invite_user(
- accept_invite_client_url=accept_invite_client_url,
- email=email,
- account_id=account_id,
- request_options=request_options,
+ accept_invite_client_url=accept_invite_client_url, email=email, request_options=request_options
)
return _response.data
@@ -528,7 +523,7 @@ async def list(
show_invalid_users: typing.Optional[bool] = None,
include_virtual_accounts: typing.Optional[str] = None,
request_options: typing.Optional[RequestOptions] = None,
- ) -> AsyncPager[User]:
+ ) -> AsyncPager[User, ListUsersResponse]:
"""
List all users of tenant filtered by query and showInvalidUsers. Pagination is available based on query parameters.
@@ -553,7 +548,7 @@ async def list(
Returns
-------
- AsyncPager[User]
+ AsyncPager[User, ListUsersResponse]
Returns all users of tenant and also the response includes paginated data.
Examples
@@ -603,7 +598,6 @@ async def pre_register_users(
skip_if_user_exists: typing.Optional[bool] = False,
dry_run: typing.Optional[bool] = False,
accept_invite_client_url: typing.Optional[str] = OMIT,
- account_id: typing.Optional[str] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> RegisterUsersResponse:
"""
@@ -626,9 +620,6 @@ async def pre_register_users(
accept_invite_client_url : typing.Optional[str]
Url to redirect when invite is accepted
- account_id : typing.Optional[str]
- Account ID to add the user to
-
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
@@ -663,13 +654,17 @@ async def main() -> None:
skip_if_user_exists=skip_if_user_exists,
dry_run=dry_run,
accept_invite_client_url=accept_invite_client_url,
- account_id=account_id,
request_options=request_options,
)
return _response.data
async def update_roles(
- self, *, email: str, roles: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None
+ self,
+ *,
+ email: str,
+ roles: typing.Sequence[str],
+ resource_type: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
) -> UpdateUserRolesResponse:
"""
This endpoint allows tenant administrators to update the roles of a user within their tenant.
@@ -680,7 +675,10 @@ async def update_roles(
Email of the user
roles : typing.Sequence[str]
- Roles for the user
+ Role names for the user
+
+ resource_type : typing.Optional[str]
+ Resource Type
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
@@ -711,7 +709,9 @@ async def main() -> None:
asyncio.run(main())
"""
- _response = await self._raw_client.update_roles(email=email, roles=roles, request_options=request_options)
+ _response = await self._raw_client.update_roles(
+ email=email, roles=roles, resource_type=resource_type, request_options=request_options
+ )
return _response.data
async def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> GetUserResponse:
@@ -795,12 +795,7 @@ async def main() -> None:
return _response.data
async def invite_user(
- self,
- *,
- accept_invite_client_url: str,
- email: str,
- account_id: typing.Optional[str] = OMIT,
- request_options: typing.Optional[RequestOptions] = None,
+ self, *, accept_invite_client_url: str, email: str, request_options: typing.Optional[RequestOptions] = None
) -> InviteUserResponse:
"""
Invite a user to the tenant
@@ -813,9 +808,6 @@ async def invite_user(
email : str
Email of user
- account_id : typing.Optional[str]
- Account ID to add the user to
-
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
@@ -846,10 +838,7 @@ async def main() -> None:
asyncio.run(main())
"""
_response = await self._raw_client.invite_user(
- accept_invite_client_url=accept_invite_client_url,
- email=email,
- account_id=account_id,
- request_options=request_options,
+ accept_invite_client_url=accept_invite_client_url, email=email, request_options=request_options
)
return _response.data
diff --git a/src/truefoundry_sdk/users/raw_client.py b/src/truefoundry_sdk/users/raw_client.py
index 822fa6b..2b4e346 100644
--- a/src/truefoundry_sdk/users/raw_client.py
+++ b/src/truefoundry_sdk/users/raw_client.py
@@ -7,7 +7,7 @@
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from ..core.http_response import AsyncHttpResponse, HttpResponse
from ..core.jsonable_encoder import jsonable_encoder
-from ..core.pagination import AsyncPager, BaseHttpResponse, SyncPager
+from ..core.pagination import AsyncPager, SyncPager
from ..core.pydantic_utilities import parse_obj_as
from ..core.request_options import RequestOptions
from ..errors.bad_request_error import BadRequestError
@@ -47,7 +47,7 @@ def list(
show_invalid_users: typing.Optional[bool] = None,
include_virtual_accounts: typing.Optional[str] = None,
request_options: typing.Optional[RequestOptions] = None,
- ) -> SyncPager[User]:
+ ) -> SyncPager[User, ListUsersResponse]:
"""
List all users of tenant filtered by query and showInvalidUsers. Pagination is available based on query parameters.
@@ -72,7 +72,7 @@ def list(
Returns
-------
- SyncPager[User]
+ SyncPager[User, ListUsersResponse]
Returns all users of tenant and also the response includes paginated data.
"""
offset = offset if offset is not None else 0
@@ -108,9 +108,7 @@ def list(
include_virtual_accounts=include_virtual_accounts,
request_options=request_options,
)
- return SyncPager(
- has_next=_has_next, items=_items, get_next=_get_next, response=BaseHttpResponse(response=_response)
- )
+ return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
@@ -124,7 +122,6 @@ def pre_register_users(
skip_if_user_exists: typing.Optional[bool] = False,
dry_run: typing.Optional[bool] = False,
accept_invite_client_url: typing.Optional[str] = OMIT,
- account_id: typing.Optional[str] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> HttpResponse[RegisterUsersResponse]:
"""
@@ -147,9 +144,6 @@ def pre_register_users(
accept_invite_client_url : typing.Optional[str]
Url to redirect when invite is accepted
- account_id : typing.Optional[str]
- Account ID to add the user to
-
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
@@ -167,7 +161,6 @@ def pre_register_users(
"skipIfUserExists": skip_if_user_exists,
"dryRun": dry_run,
"acceptInviteClientURL": accept_invite_client_url,
- "accountId": account_id,
},
headers={
"content-type": "application/json",
@@ -211,9 +204,9 @@ def pre_register_users(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -224,7 +217,12 @@ def pre_register_users(
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
def update_roles(
- self, *, email: str, roles: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None
+ self,
+ *,
+ email: str,
+ roles: typing.Sequence[str],
+ resource_type: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
) -> HttpResponse[UpdateUserRolesResponse]:
"""
This endpoint allows tenant administrators to update the roles of a user within their tenant.
@@ -235,7 +233,10 @@ def update_roles(
Email of the user
roles : typing.Sequence[str]
- Roles for the user
+ Role names for the user
+
+ resource_type : typing.Optional[str]
+ Resource Type
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
@@ -251,6 +252,7 @@ def update_roles(
json={
"email": email,
"roles": roles,
+ "resourceType": resource_type,
},
headers={
"content-type": "application/json",
@@ -283,9 +285,9 @@ def update_roles(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -294,9 +296,9 @@ def update_roles(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -342,9 +344,9 @@ def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = Non
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -392,9 +394,9 @@ def delete(
raise BadRequestError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -414,9 +416,9 @@ def delete(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -427,12 +429,7 @@ def delete(
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
def invite_user(
- self,
- *,
- accept_invite_client_url: str,
- email: str,
- account_id: typing.Optional[str] = OMIT,
- request_options: typing.Optional[RequestOptions] = None,
+ self, *, accept_invite_client_url: str, email: str, request_options: typing.Optional[RequestOptions] = None
) -> HttpResponse[InviteUserResponse]:
"""
Invite a user to the tenant
@@ -445,9 +442,6 @@ def invite_user(
email : str
Email of user
- account_id : typing.Optional[str]
- Account ID to add the user to
-
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
@@ -462,7 +456,6 @@ def invite_user(
json={
"acceptInviteClientUrl": accept_invite_client_url,
"email": email,
- "accountId": account_id,
},
headers={
"content-type": "application/json",
@@ -574,9 +567,9 @@ def deactivate(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -642,9 +635,9 @@ def activate(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -762,9 +755,9 @@ def get_resources(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -823,9 +816,9 @@ def get_teams(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -849,7 +842,7 @@ async def list(
show_invalid_users: typing.Optional[bool] = None,
include_virtual_accounts: typing.Optional[str] = None,
request_options: typing.Optional[RequestOptions] = None,
- ) -> AsyncPager[User]:
+ ) -> AsyncPager[User, ListUsersResponse]:
"""
List all users of tenant filtered by query and showInvalidUsers. Pagination is available based on query parameters.
@@ -874,7 +867,7 @@ async def list(
Returns
-------
- AsyncPager[User]
+ AsyncPager[User, ListUsersResponse]
Returns all users of tenant and also the response includes paginated data.
"""
offset = offset if offset is not None else 0
@@ -913,9 +906,7 @@ async def _get_next():
request_options=request_options,
)
- return AsyncPager(
- has_next=_has_next, items=_items, get_next=_get_next, response=BaseHttpResponse(response=_response)
- )
+ return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
@@ -929,7 +920,6 @@ async def pre_register_users(
skip_if_user_exists: typing.Optional[bool] = False,
dry_run: typing.Optional[bool] = False,
accept_invite_client_url: typing.Optional[str] = OMIT,
- account_id: typing.Optional[str] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> AsyncHttpResponse[RegisterUsersResponse]:
"""
@@ -952,9 +942,6 @@ async def pre_register_users(
accept_invite_client_url : typing.Optional[str]
Url to redirect when invite is accepted
- account_id : typing.Optional[str]
- Account ID to add the user to
-
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
@@ -972,7 +959,6 @@ async def pre_register_users(
"skipIfUserExists": skip_if_user_exists,
"dryRun": dry_run,
"acceptInviteClientURL": accept_invite_client_url,
- "accountId": account_id,
},
headers={
"content-type": "application/json",
@@ -1016,9 +1002,9 @@ async def pre_register_users(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -1029,7 +1015,12 @@ async def pre_register_users(
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
async def update_roles(
- self, *, email: str, roles: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None
+ self,
+ *,
+ email: str,
+ roles: typing.Sequence[str],
+ resource_type: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
) -> AsyncHttpResponse[UpdateUserRolesResponse]:
"""
This endpoint allows tenant administrators to update the roles of a user within their tenant.
@@ -1040,7 +1031,10 @@ async def update_roles(
Email of the user
roles : typing.Sequence[str]
- Roles for the user
+ Role names for the user
+
+ resource_type : typing.Optional[str]
+ Resource Type
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
@@ -1056,6 +1050,7 @@ async def update_roles(
json={
"email": email,
"roles": roles,
+ "resourceType": resource_type,
},
headers={
"content-type": "application/json",
@@ -1088,9 +1083,9 @@ async def update_roles(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -1099,9 +1094,9 @@ async def update_roles(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -1149,9 +1144,9 @@ async def get(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -1199,9 +1194,9 @@ async def delete(
raise BadRequestError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -1221,9 +1216,9 @@ async def delete(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -1234,12 +1229,7 @@ async def delete(
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
async def invite_user(
- self,
- *,
- accept_invite_client_url: str,
- email: str,
- account_id: typing.Optional[str] = OMIT,
- request_options: typing.Optional[RequestOptions] = None,
+ self, *, accept_invite_client_url: str, email: str, request_options: typing.Optional[RequestOptions] = None
) -> AsyncHttpResponse[InviteUserResponse]:
"""
Invite a user to the tenant
@@ -1252,9 +1242,6 @@ async def invite_user(
email : str
Email of user
- account_id : typing.Optional[str]
- Account ID to add the user to
-
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
@@ -1269,7 +1256,6 @@ async def invite_user(
json={
"acceptInviteClientUrl": accept_invite_client_url,
"email": email,
- "accountId": account_id,
},
headers={
"content-type": "application/json",
@@ -1381,9 +1367,9 @@ async def deactivate(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -1449,9 +1435,9 @@ async def activate(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -1569,9 +1555,9 @@ async def get_resources(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -1630,9 +1616,9 @@ async def get_teams(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
diff --git a/src/truefoundry_sdk/virtual_accounts/client.py b/src/truefoundry_sdk/virtual_accounts/client.py
index 5911145..dba5979 100644
--- a/src/truefoundry_sdk/virtual_accounts/client.py
+++ b/src/truefoundry_sdk/virtual_accounts/client.py
@@ -8,6 +8,7 @@
from ..types.delete_virtual_account_response import DeleteVirtualAccountResponse
from ..types.get_token_for_virtual_account_response import GetTokenForVirtualAccountResponse
from ..types.get_virtual_account_response import GetVirtualAccountResponse
+from ..types.list_virtual_account_response import ListVirtualAccountResponse
from ..types.sync_virtual_account_token_response import SyncVirtualAccountTokenResponse
from ..types.virtual_account import VirtualAccount
from ..types.virtual_account_manifest import VirtualAccountManifest
@@ -38,7 +39,7 @@ def list(
limit: typing.Optional[int] = 100,
offset: typing.Optional[int] = 0,
request_options: typing.Optional[RequestOptions] = None,
- ) -> SyncPager[VirtualAccount]:
+ ) -> SyncPager[VirtualAccount, ListVirtualAccountResponse]:
"""
List virtual accounts for the tenant.
@@ -55,7 +56,7 @@ def list(
Returns
-------
- SyncPager[VirtualAccount]
+ SyncPager[VirtualAccount, ListVirtualAccountResponse]
Return all virtual accounts for the tenant
Examples
@@ -361,7 +362,7 @@ async def list(
limit: typing.Optional[int] = 100,
offset: typing.Optional[int] = 0,
request_options: typing.Optional[RequestOptions] = None,
- ) -> AsyncPager[VirtualAccount]:
+ ) -> AsyncPager[VirtualAccount, ListVirtualAccountResponse]:
"""
List virtual accounts for the tenant.
@@ -378,7 +379,7 @@ async def list(
Returns
-------
- AsyncPager[VirtualAccount]
+ AsyncPager[VirtualAccount, ListVirtualAccountResponse]
Return all virtual accounts for the tenant
Examples
diff --git a/src/truefoundry_sdk/virtual_accounts/raw_client.py b/src/truefoundry_sdk/virtual_accounts/raw_client.py
index 3a09c13..45181b3 100644
--- a/src/truefoundry_sdk/virtual_accounts/raw_client.py
+++ b/src/truefoundry_sdk/virtual_accounts/raw_client.py
@@ -7,7 +7,7 @@
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from ..core.http_response import AsyncHttpResponse, HttpResponse
from ..core.jsonable_encoder import jsonable_encoder
-from ..core.pagination import AsyncPager, BaseHttpResponse, SyncPager
+from ..core.pagination import AsyncPager, SyncPager
from ..core.pydantic_utilities import parse_obj_as
from ..core.request_options import RequestOptions
from ..core.serialization import convert_and_respect_annotation_metadata
@@ -36,7 +36,7 @@ def list(
limit: typing.Optional[int] = 100,
offset: typing.Optional[int] = 0,
request_options: typing.Optional[RequestOptions] = None,
- ) -> SyncPager[VirtualAccount]:
+ ) -> SyncPager[VirtualAccount, ListVirtualAccountResponse]:
"""
List virtual accounts for the tenant.
@@ -53,7 +53,7 @@ def list(
Returns
-------
- SyncPager[VirtualAccount]
+ SyncPager[VirtualAccount, ListVirtualAccountResponse]
Return all virtual accounts for the tenant
"""
offset = offset if offset is not None else 0
@@ -83,9 +83,7 @@ def list(
offset=offset + len(_items),
request_options=request_options,
)
- return SyncPager(
- has_next=_has_next, items=_items, get_next=_get_next, response=BaseHttpResponse(response=_response)
- )
+ return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
@@ -146,9 +144,9 @@ def create_or_update(
raise BadRequestError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -157,9 +155,9 @@ def create_or_update(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -207,9 +205,9 @@ def get(
raise BadRequestError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -257,9 +255,9 @@ def delete(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -346,9 +344,9 @@ def sync_to_secret_store(
raise BadRequestError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -357,9 +355,9 @@ def sync_to_secret_store(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -463,7 +461,7 @@ async def list(
limit: typing.Optional[int] = 100,
offset: typing.Optional[int] = 0,
request_options: typing.Optional[RequestOptions] = None,
- ) -> AsyncPager[VirtualAccount]:
+ ) -> AsyncPager[VirtualAccount, ListVirtualAccountResponse]:
"""
List virtual accounts for the tenant.
@@ -480,7 +478,7 @@ async def list(
Returns
-------
- AsyncPager[VirtualAccount]
+ AsyncPager[VirtualAccount, ListVirtualAccountResponse]
Return all virtual accounts for the tenant
"""
offset = offset if offset is not None else 0
@@ -513,9 +511,7 @@ async def _get_next():
request_options=request_options,
)
- return AsyncPager(
- has_next=_has_next, items=_items, get_next=_get_next, response=BaseHttpResponse(response=_response)
- )
+ return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
@@ -576,9 +572,9 @@ async def create_or_update(
raise BadRequestError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -587,9 +583,9 @@ async def create_or_update(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -637,9 +633,9 @@ async def get(
raise BadRequestError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -687,9 +683,9 @@ async def delete(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -776,9 +772,9 @@ async def sync_to_secret_store(
raise BadRequestError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -787,9 +783,9 @@ async def sync_to_secret_store(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
diff --git a/src/truefoundry_sdk/workspaces/client.py b/src/truefoundry_sdk/workspaces/client.py
index 22f653a..bbf8abe 100644
--- a/src/truefoundry_sdk/workspaces/client.py
+++ b/src/truefoundry_sdk/workspaces/client.py
@@ -6,6 +6,7 @@
from ..core.pagination import AsyncPager, SyncPager
from ..core.request_options import RequestOptions
from ..types.get_workspace_response import GetWorkspaceResponse
+from ..types.list_workspaces_response import ListWorkspacesResponse
from ..types.workspace import Workspace
from ..types.workspace_manifest import WorkspaceManifest
from .raw_client import AsyncRawWorkspacesClient, RawWorkspacesClient
@@ -39,7 +40,7 @@ def list(
name: typing.Optional[str] = None,
fqn: typing.Optional[str] = None,
request_options: typing.Optional[RequestOptions] = None,
- ) -> SyncPager[Workspace]:
+ ) -> SyncPager[Workspace, ListWorkspacesResponse]:
"""
List workspaces associated with the user. Optional filters include clusterId, fqn, and workspace name. Pagination is available based on query parameters.
@@ -65,7 +66,7 @@ def list(
Returns
-------
- SyncPager[Workspace]
+ SyncPager[Workspace, ListWorkspacesResponse]
Returns all the workspaces associated with a user and also the response includes paginated data.
Examples
@@ -232,7 +233,7 @@ async def list(
name: typing.Optional[str] = None,
fqn: typing.Optional[str] = None,
request_options: typing.Optional[RequestOptions] = None,
- ) -> AsyncPager[Workspace]:
+ ) -> AsyncPager[Workspace, ListWorkspacesResponse]:
"""
List workspaces associated with the user. Optional filters include clusterId, fqn, and workspace name. Pagination is available based on query parameters.
@@ -258,7 +259,7 @@ async def list(
Returns
-------
- AsyncPager[Workspace]
+ AsyncPager[Workspace, ListWorkspacesResponse]
Returns all the workspaces associated with a user and also the response includes paginated data.
Examples
diff --git a/src/truefoundry_sdk/workspaces/raw_client.py b/src/truefoundry_sdk/workspaces/raw_client.py
index 48eedba..f9fffcc 100644
--- a/src/truefoundry_sdk/workspaces/raw_client.py
+++ b/src/truefoundry_sdk/workspaces/raw_client.py
@@ -7,7 +7,7 @@
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from ..core.http_response import AsyncHttpResponse, HttpResponse
from ..core.jsonable_encoder import jsonable_encoder
-from ..core.pagination import AsyncPager, BaseHttpResponse, SyncPager
+from ..core.pagination import AsyncPager, SyncPager
from ..core.pydantic_utilities import parse_obj_as
from ..core.request_options import RequestOptions
from ..core.serialization import convert_and_respect_annotation_metadata
@@ -40,7 +40,7 @@ def list(
name: typing.Optional[str] = None,
fqn: typing.Optional[str] = None,
request_options: typing.Optional[RequestOptions] = None,
- ) -> SyncPager[Workspace]:
+ ) -> SyncPager[Workspace, ListWorkspacesResponse]:
"""
List workspaces associated with the user. Optional filters include clusterId, fqn, and workspace name. Pagination is available based on query parameters.
@@ -66,7 +66,7 @@ def list(
Returns
-------
- SyncPager[Workspace]
+ SyncPager[Workspace, ListWorkspacesResponse]
Returns all the workspaces associated with a user and also the response includes paginated data.
"""
offset = offset if offset is not None else 0
@@ -102,9 +102,7 @@ def list(
fqn=fqn,
request_options=request_options,
)
- return SyncPager(
- has_next=_has_next, items=_items, get_next=_get_next, response=BaseHttpResponse(response=_response)
- )
+ return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
@@ -167,9 +165,9 @@ def create_or_update(
raise BadRequestError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -189,9 +187,9 @@ def create_or_update(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -200,9 +198,9 @@ def create_or_update(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -250,9 +248,9 @@ def get(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -302,9 +300,9 @@ def delete(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -339,7 +337,7 @@ async def list(
name: typing.Optional[str] = None,
fqn: typing.Optional[str] = None,
request_options: typing.Optional[RequestOptions] = None,
- ) -> AsyncPager[Workspace]:
+ ) -> AsyncPager[Workspace, ListWorkspacesResponse]:
"""
List workspaces associated with the user. Optional filters include clusterId, fqn, and workspace name. Pagination is available based on query parameters.
@@ -365,7 +363,7 @@ async def list(
Returns
-------
- AsyncPager[Workspace]
+ AsyncPager[Workspace, ListWorkspacesResponse]
Returns all the workspaces associated with a user and also the response includes paginated data.
"""
offset = offset if offset is not None else 0
@@ -404,9 +402,7 @@ async def _get_next():
request_options=request_options,
)
- return AsyncPager(
- has_next=_has_next, items=_items, get_next=_get_next, response=BaseHttpResponse(response=_response)
- )
+ return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
@@ -469,9 +465,9 @@ async def create_or_update(
raise BadRequestError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -491,9 +487,9 @@ async def create_or_update(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -502,9 +498,9 @@ async def create_or_update(
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -552,9 +548,9 @@ async def get(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
@@ -604,9 +600,9 @@ async def delete(
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
- typing.Optional[typing.Any],
+ typing.Any,
parse_obj_as(
- type_=typing.Optional[typing.Any], # type: ignore
+ type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
diff --git a/tests/utils/test_http_client.py b/tests/utils/test_http_client.py
index 4c87538..2e7743f 100644
--- a/tests/utils/test_http_client.py
+++ b/tests/utils/test_http_client.py
@@ -1,6 +1,6 @@
# This file was auto-generated by Fern from our API Definition.
-from truefoundry_sdk.core.http_client import get_request_body
+from truefoundry_sdk.core.http_client import get_request_body, remove_none_from_dict
from truefoundry_sdk.core.request_options import RequestOptions
@@ -8,6 +8,10 @@ def get_request_options() -> RequestOptions:
return {"additional_body_parameters": {"see you": "later"}}
+def get_request_options_with_none() -> RequestOptions:
+ return {"additional_body_parameters": {"see you": "later", "optional": None}}
+
+
def test_get_json_request_body() -> None:
json_body, data_body = get_request_body(json={"hello": "world"}, data=None, request_options=None, omit=None)
assert json_body == {"hello": "world"}
@@ -59,3 +63,47 @@ def test_get_empty_json_request_body() -> None:
assert json_body_extras is None
assert data_body_extras is None
+
+
+def test_json_body_preserves_none_values() -> None:
+ """Test that JSON bodies preserve None values (they become JSON null)."""
+ json_body, data_body = get_request_body(
+ json={"hello": "world", "optional": None}, data=None, request_options=None, omit=None
+ )
+ # JSON bodies should preserve None values
+ assert json_body == {"hello": "world", "optional": None}
+ assert data_body is None
+
+
+def test_data_body_preserves_none_values_without_multipart() -> None:
+ """Test that data bodies preserve None values when not using multipart.
+
+ The filtering of None values happens in HttpClient.request/stream methods,
+ not in get_request_body. This test verifies get_request_body doesn't filter None.
+ """
+ json_body, data_body = get_request_body(
+ json=None, data={"hello": "world", "optional": None}, request_options=None, omit=None
+ )
+ # get_request_body should preserve None values in data body
+ # The filtering happens later in HttpClient.request when multipart is detected
+ assert data_body == {"hello": "world", "optional": None}
+ assert json_body is None
+
+
+def test_remove_none_from_dict_filters_none_values() -> None:
+ """Test that remove_none_from_dict correctly filters out None values."""
+ original = {"hello": "world", "optional": None, "another": "value", "also_none": None}
+ filtered = remove_none_from_dict(original)
+ assert filtered == {"hello": "world", "another": "value"}
+ # Original should not be modified
+ assert original == {"hello": "world", "optional": None, "another": "value", "also_none": None}
+
+
+def test_remove_none_from_dict_empty_dict() -> None:
+ """Test that remove_none_from_dict handles empty dict."""
+ assert remove_none_from_dict({}) == {}
+
+
+def test_remove_none_from_dict_all_none() -> None:
+ """Test that remove_none_from_dict handles dict with all None values."""
+ assert remove_none_from_dict({"a": None, "b": None}) == {}