From c13ac9ef9ae9344d1ba178646f42237bce8e2ab5 Mon Sep 17 00:00:00 2001 From: svc-excavator-bot Date: Fri, 29 Aug 2025 13:40:58 +0000 Subject: [PATCH] Excavator: Upgrade API Version --- README.md | 11 + docs-snippets-npm/package.json | 2 +- docs-snippets-npm/src/index.ts | 55 +++-- docs/v2/Admin/Group.md | 10 +- docs/v2/Admin/GroupMember.md | 12 +- docs/v2/Admin/GroupMembership.md | 4 +- .../Admin/GroupMembershipExpirationPolicy.md | 8 +- docs/v2/Admin/GroupProviderInfo.md | 8 +- docs/v2/Admin/User.md | 22 +- docs/v2/Admin/UserProviderInfo.md | 8 +- .../models/GetGroupsBatchRequestElement.md | 2 +- .../v2/Admin/models/GetGroupsBatchResponse.md | 2 +- .../models/GetUsersBatchRequestElement.md | 2 +- docs/v2/Admin/models/GetUsersBatchResponse.md | 2 +- docs/v2/Admin/models/Group.md | 2 +- docs/v2/Admin/models/GroupMembership.md | 2 +- docs/v2/Admin/models/User.md | 2 +- docs/v2/Core/models/GroupId.md | 11 + docs/v2/Core/models/PrincipalId.md | 2 +- docs/v2/Core/models/TableRid.md | 11 + docs/v2/Filesystem/Folder.md | 54 +++++ .../models/GetFoldersBatchRequestElement.md | 11 + .../models/GetFoldersBatchResponse.md | 11 + docs/v2/Ontologies/OntologyInterface.md | 94 +++++++++ docs/v2/Ontologies/OntologyObjectSet.md | 8 +- .../Ontologies/TimeSeriesValueBankProperty.md | 4 +- docs/v2/Ontologies/models/EnumConstraint.md | 2 +- .../models/ListObjectsForInterfaceResponse.md | 13 ++ docs/v2/Ontologies/models/RangesConstraint.md | 4 +- .../Ontologies/models/ValueTypeConstraint.md | 1 + docs/v2/Orchestration/Schedule.md | 53 +++++ .../models/AffectedResourcesResponse.md | 11 + docs/v2/Orchestration/models/Build.md | 1 + .../models/TableUpdatedTrigger.md | 15 ++ docs/v2/Orchestration/models/Trigger.md | 1 + foundry_sdk/__init__.py | 1 + foundry_sdk/_core/__init__.py | 2 +- foundry_sdk/_core/api_client.py | 29 ++- foundry_sdk/_core/binary_stream.py | 33 --- foundry_sdk/_core/table.py | 82 ++++++++ foundry_sdk/_versions.py | 2 +- foundry_sdk/v2/admin/errors.py | 40 ++-- foundry_sdk/v2/admin/group.py | 16 +- foundry_sdk/v2/admin/group_member.py | 24 +-- foundry_sdk/v2/admin/group_membership.py | 8 +- .../group_membership_expiration_policy.py | 16 +- foundry_sdk/v2/admin/group_provider_info.py | 16 +- foundry_sdk/v2/admin/models.py | 14 +- foundry_sdk/v2/admin/user.py | 40 ++-- foundry_sdk/v2/admin/user_provider_info.py | 16 +- foundry_sdk/v2/cli.py | 150 ++++++++++++++ foundry_sdk/v2/core/models.py | 12 +- foundry_sdk/v2/filesystem/folder.py | 115 +++++++++++ foundry_sdk/v2/filesystem/models.py | 14 ++ foundry_sdk/v2/ontologies/models.py | 18 +- .../v2/ontologies/ontology_interface.py | 188 ++++++++++++++++++ .../v2/ontologies/ontology_object_set.py | 22 +- foundry_sdk/v2/orchestration/errors.py | 16 ++ foundry_sdk/v2/orchestration/models.py | 22 ++ foundry_sdk/v2/orchestration/schedule.py | 114 +++++++++++ pyproject.toml | 4 + tests/test_api_client.py | 11 +- tox.ini | 3 + 63 files changed, 1272 insertions(+), 217 deletions(-) create mode 100644 docs/v2/Core/models/GroupId.md create mode 100644 docs/v2/Core/models/TableRid.md create mode 100644 docs/v2/Filesystem/models/GetFoldersBatchRequestElement.md create mode 100644 docs/v2/Filesystem/models/GetFoldersBatchResponse.md create mode 100644 docs/v2/Ontologies/models/ListObjectsForInterfaceResponse.md create mode 100644 docs/v2/Orchestration/models/AffectedResourcesResponse.md create mode 100644 docs/v2/Orchestration/models/TableUpdatedTrigger.md delete mode 100644 foundry_sdk/_core/binary_stream.py create mode 100644 foundry_sdk/_core/table.py diff --git a/README.md b/README.md index dd1c2ae1e..3d6be926e 100644 --- a/README.md +++ b/README.md @@ -433,6 +433,7 @@ with open("result.png", "wb") as f: ``` + ## Static type analysis @@ -711,6 +712,7 @@ Namespace | Resource | Operation | HTTP request | **Filesystem** | Folder | [**children**](docs/v2/Filesystem/Folder.md#children) | **GET** /v2/filesystem/folders/{folderRid}/children | **Filesystem** | Folder | [**create**](docs/v2/Filesystem/Folder.md#create) | **POST** /v2/filesystem/folders | **Filesystem** | Folder | [**get**](docs/v2/Filesystem/Folder.md#get) | **GET** /v2/filesystem/folders/{folderRid} | +**Filesystem** | Folder | [**get_batch**](docs/v2/Filesystem/Folder.md#get_batch) | **POST** /v2/filesystem/folders/getBatch | **Filesystem** | Project | [**add_organizations**](docs/v2/Filesystem/Project.md#add_organizations) | **POST** /v2/filesystem/projects/{projectRid}/addOrganizations | **Filesystem** | Project | [**create**](docs/v2/Filesystem/Project.md#create) | **POST** /v2/filesystem/projects/create | **Filesystem** | Project | [**get**](docs/v2/Filesystem/Project.md#get) | **GET** /v2/filesystem/projects/{projectRid} | @@ -791,6 +793,7 @@ Namespace | Resource | Operation | HTTP request | **Orchestration** | Schedule | [**create**](docs/v2/Orchestration/Schedule.md#create) | **POST** /v2/orchestration/schedules | **Orchestration** | Schedule | [**delete**](docs/v2/Orchestration/Schedule.md#delete) | **DELETE** /v2/orchestration/schedules/{scheduleRid} | **Orchestration** | Schedule | [**get**](docs/v2/Orchestration/Schedule.md#get) | **GET** /v2/orchestration/schedules/{scheduleRid} | +**Orchestration** | Schedule | [**get_affected_resources**](docs/v2/Orchestration/Schedule.md#get_affected_resources) | **POST** /v2/orchestration/schedules/{scheduleRid}/getAffectedResources | **Orchestration** | Schedule | [**get_batch**](docs/v2/Orchestration/Schedule.md#get_batch) | **POST** /v2/orchestration/schedules/getBatch | **Orchestration** | Schedule | [**pause**](docs/v2/Orchestration/Schedule.md#pause) | **POST** /v2/orchestration/schedules/{scheduleRid}/pause | **Orchestration** | Schedule | [**replace**](docs/v2/Orchestration/Schedule.md#replace) | **PUT** /v2/orchestration/schedules/{scheduleRid} | @@ -1172,6 +1175,7 @@ Namespace | Name | Import | **Core** | [GeoPointType](docs/v2/Core/models/GeoPointType.md) | `from foundry_sdk.v2.core.models import GeoPointType` | **Core** | [GeoShapeType](docs/v2/Core/models/GeoShapeType.md) | `from foundry_sdk.v2.core.models import GeoShapeType` | **Core** | [GeotimeSeriesReferenceType](docs/v2/Core/models/GeotimeSeriesReferenceType.md) | `from foundry_sdk.v2.core.models import GeotimeSeriesReferenceType` | +**Core** | [GroupId](docs/v2/Core/models/GroupId.md) | `from foundry_sdk.v2.core.models import GroupId` | **Core** | [GroupName](docs/v2/Core/models/GroupName.md) | `from foundry_sdk.v2.core.models import GroupName` | **Core** | [GroupRid](docs/v2/Core/models/GroupRid.md) | `from foundry_sdk.v2.core.models import GroupRid` | **Core** | [IncludeComputeUsage](docs/v2/Core/models/IncludeComputeUsage.md) | `from foundry_sdk.v2.core.models import IncludeComputeUsage` | @@ -1218,6 +1222,7 @@ Namespace | Name | Import | **Core** | [StringType](docs/v2/Core/models/StringType.md) | `from foundry_sdk.v2.core.models import StringType` | **Core** | [StructFieldName](docs/v2/Core/models/StructFieldName.md) | `from foundry_sdk.v2.core.models import StructFieldName` | **Core** | [StructFieldType](docs/v2/Core/models/StructFieldType.md) | `from foundry_sdk.v2.core.models import StructFieldType` | +**Core** | [TableRid](docs/v2/Core/models/TableRid.md) | `from foundry_sdk.v2.core.models import TableRid` | **Core** | [TimeSeriesItemType](docs/v2/Core/models/TimeSeriesItemType.md) | `from foundry_sdk.v2.core.models import TimeSeriesItemType` | **Core** | [TimeseriesType](docs/v2/Core/models/TimeseriesType.md) | `from foundry_sdk.v2.core.models import TimeseriesType` | **Core** | [TimestampType](docs/v2/Core/models/TimestampType.md) | `from foundry_sdk.v2.core.models import TimestampType` | @@ -1298,6 +1303,8 @@ Namespace | Name | Import | **Filesystem** | [Folder](docs/v2/Filesystem/models/Folder.md) | `from foundry_sdk.v2.filesystem.models import Folder` | **Filesystem** | [FolderRid](docs/v2/Filesystem/models/FolderRid.md) | `from foundry_sdk.v2.filesystem.models import FolderRid` | **Filesystem** | [FolderType](docs/v2/Filesystem/models/FolderType.md) | `from foundry_sdk.v2.filesystem.models import FolderType` | +**Filesystem** | [GetFoldersBatchRequestElement](docs/v2/Filesystem/models/GetFoldersBatchRequestElement.md) | `from foundry_sdk.v2.filesystem.models import GetFoldersBatchRequestElement` | +**Filesystem** | [GetFoldersBatchResponse](docs/v2/Filesystem/models/GetFoldersBatchResponse.md) | `from foundry_sdk.v2.filesystem.models import GetFoldersBatchResponse` | **Filesystem** | [IsDirectlyApplied](docs/v2/Filesystem/models/IsDirectlyApplied.md) | `from foundry_sdk.v2.filesystem.models import IsDirectlyApplied` | **Filesystem** | [ListChildrenOfFolderResponse](docs/v2/Filesystem/models/ListChildrenOfFolderResponse.md) | `from foundry_sdk.v2.filesystem.models import ListChildrenOfFolderResponse` | **Filesystem** | [ListMarkingsOfResourceResponse](docs/v2/Filesystem/models/ListMarkingsOfResourceResponse.md) | `from foundry_sdk.v2.filesystem.models import ListMarkingsOfResourceResponse` | @@ -1545,6 +1552,7 @@ Namespace | Name | Import | **Ontologies** | [ListAttachmentsResponseV2](docs/v2/Ontologies/models/ListAttachmentsResponseV2.md) | `from foundry_sdk.v2.ontologies.models import ListAttachmentsResponseV2` | **Ontologies** | [ListInterfaceTypesResponse](docs/v2/Ontologies/models/ListInterfaceTypesResponse.md) | `from foundry_sdk.v2.ontologies.models import ListInterfaceTypesResponse` | **Ontologies** | [ListLinkedObjectsResponseV2](docs/v2/Ontologies/models/ListLinkedObjectsResponseV2.md) | `from foundry_sdk.v2.ontologies.models import ListLinkedObjectsResponseV2` | +**Ontologies** | [ListObjectsForInterfaceResponse](docs/v2/Ontologies/models/ListObjectsForInterfaceResponse.md) | `from foundry_sdk.v2.ontologies.models import ListObjectsForInterfaceResponse` | **Ontologies** | [ListObjectsResponseV2](docs/v2/Ontologies/models/ListObjectsResponseV2.md) | `from foundry_sdk.v2.ontologies.models import ListObjectsResponseV2` | **Ontologies** | [ListObjectTypesV2Response](docs/v2/Ontologies/models/ListObjectTypesV2Response.md) | `from foundry_sdk.v2.ontologies.models import ListObjectTypesV2Response` | **Ontologies** | [ListOntologiesV2Response](docs/v2/Ontologies/models/ListOntologiesV2Response.md) | `from foundry_sdk.v2.ontologies.models import ListOntologiesV2Response` | @@ -1756,6 +1764,7 @@ Namespace | Name | Import | **Ontologies** | [WithinPolygonQuery](docs/v2/Ontologies/models/WithinPolygonQuery.md) | `from foundry_sdk.v2.ontologies.models import WithinPolygonQuery` | **Orchestration** | [AbortOnFailure](docs/v2/Orchestration/models/AbortOnFailure.md) | `from foundry_sdk.v2.orchestration.models import AbortOnFailure` | **Orchestration** | [Action](docs/v2/Orchestration/models/Action.md) | `from foundry_sdk.v2.orchestration.models import Action` | +**Orchestration** | [AffectedResourcesResponse](docs/v2/Orchestration/models/AffectedResourcesResponse.md) | `from foundry_sdk.v2.orchestration.models import AffectedResourcesResponse` | **Orchestration** | [AndTrigger](docs/v2/Orchestration/models/AndTrigger.md) | `from foundry_sdk.v2.orchestration.models import AndTrigger` | **Orchestration** | [Build](docs/v2/Orchestration/models/Build.md) | `from foundry_sdk.v2.orchestration.models import Build` | **Orchestration** | [BuildableRid](docs/v2/Orchestration/models/BuildableRid.md) | `from foundry_sdk.v2.orchestration.models import BuildableRid` | @@ -1832,6 +1841,7 @@ Namespace | Name | Import | **Orchestration** | [SearchBuildsOrderByItem](docs/v2/Orchestration/models/SearchBuildsOrderByItem.md) | `from foundry_sdk.v2.orchestration.models import SearchBuildsOrderByItem` | **Orchestration** | [SearchBuildsOrFilter](docs/v2/Orchestration/models/SearchBuildsOrFilter.md) | `from foundry_sdk.v2.orchestration.models import SearchBuildsOrFilter` | **Orchestration** | [SearchBuildsResponse](docs/v2/Orchestration/models/SearchBuildsResponse.md) | `from foundry_sdk.v2.orchestration.models import SearchBuildsResponse` | +**Orchestration** | [TableUpdatedTrigger](docs/v2/Orchestration/models/TableUpdatedTrigger.md) | `from foundry_sdk.v2.orchestration.models import TableUpdatedTrigger` | **Orchestration** | [TimeTrigger](docs/v2/Orchestration/models/TimeTrigger.md) | `from foundry_sdk.v2.orchestration.models import TimeTrigger` | **Orchestration** | [TransactionalMediaSetJobOutput](docs/v2/Orchestration/models/TransactionalMediaSetJobOutput.md) | `from foundry_sdk.v2.orchestration.models import TransactionalMediaSetJobOutput` | **Orchestration** | [Trigger](docs/v2/Orchestration/models/Trigger.md) | `from foundry_sdk.v2.orchestration.models import Trigger` | @@ -2536,6 +2546,7 @@ Namespace | Name | Import | **Orchestration** | CreateBuildPermissionDenied | `from foundry_sdk.v2.orchestration.errors import CreateBuildPermissionDenied` | **Orchestration** | CreateSchedulePermissionDenied | `from foundry_sdk.v2.orchestration.errors import CreateSchedulePermissionDenied` | **Orchestration** | DeleteSchedulePermissionDenied | `from foundry_sdk.v2.orchestration.errors import DeleteSchedulePermissionDenied` | +**Orchestration** | GetAffectedResourcesSchedulePermissionDenied | `from foundry_sdk.v2.orchestration.errors import GetAffectedResourcesSchedulePermissionDenied` | **Orchestration** | InvalidAndTrigger | `from foundry_sdk.v2.orchestration.errors import InvalidAndTrigger` | **Orchestration** | InvalidMediaSetTrigger | `from foundry_sdk.v2.orchestration.errors import InvalidMediaSetTrigger` | **Orchestration** | InvalidOrTrigger | `from foundry_sdk.v2.orchestration.errors import InvalidOrTrigger` | diff --git a/docs-snippets-npm/package.json b/docs-snippets-npm/package.json index 0258be87e..9ebf12ad4 100644 --- a/docs-snippets-npm/package.json +++ b/docs-snippets-npm/package.json @@ -24,7 +24,7 @@ "sls": { "dependencies": { "com.palantir.foundry.api:api-gateway": { - "minVersion": "1.1268.0", + "minVersion": "1.1280.0", "maxVersion": "1.x.x", "optional": false } diff --git a/docs-snippets-npm/src/index.ts b/docs-snippets-npm/src/index.ts index e39775029..af0a3eb00 100644 --- a/docs-snippets-npm/src/index.ts +++ b/docs-snippets-npm/src/index.ts @@ -285,17 +285,17 @@ export const PYTHON_PLATFORM_SNIPPETS: SdkSnippets T: _type = self._request_info.response_type - if _type is bytes or ( - get_origin(_type) is Union - and bytes in get_args(_type) - and type(None) in get_args(_type) - ): - return cast(T, self._response.content) + is_optional = get_origin(_type) is Union and type(None) in get_args(_type) + + if _type is bytes or is_optional: + if is_optional and self._response.content == b"": + return cast(T, None) + else: + return cast(T, self._response.content) elif _type is None: return cast(T, None) @@ -485,7 +486,7 @@ def _handle_error(self, req: RequestInfo, res: httpx.Response): """ if res.status_code == 404 and res.text == "": raise ApiNotFoundError( - f'The reqeust to "{req.resource_path}" returned a 404 status code ' + f'The request to "{req.resource_path}" returned a 404 status code ' "with no response body. This likely indicates that the API is not yet " "available on your Foundry instance." ) @@ -601,6 +602,11 @@ def make_request(token: Token): if response_mode == "STREAMING": return StreamingContextManager(request_info, api_response) + elif response_mode == "TABLE": + if res.content == b"": + return None + else: + return TableResponse(res.content) elif response_mode == "RAW": return api_response else: @@ -681,6 +687,11 @@ async def make_request(token: Token): if response_mode == "RAW" or response_mode == "STREAMING": return api_response + elif response_mode == "TABLE": + if res.content == b"": + return None + else: + return TableResponse(res.content) else: return api_response.decode() diff --git a/foundry_sdk/_core/binary_stream.py b/foundry_sdk/_core/binary_stream.py deleted file mode 100644 index 2b0753197..000000000 --- a/foundry_sdk/_core/binary_stream.py +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright 2024 Palantir Technologies, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -from typing import Iterator - - -class BinaryStream(Iterator[bytes]): - """A generic class for streaming binary data.""" - - def __init__(self, iterator: Iterator[bytes]): - self._iterator = iterator - - def __next__(self) -> bytes: - return next(self._iterator) - - def __iter__(self) -> Iterator[bytes]: - return self - - def read_all(self) -> bytes: - """Read and concatenate all remaining chunks.""" - return b"".join(self._iterator) diff --git a/foundry_sdk/_core/table.py b/foundry_sdk/_core/table.py new file mode 100644 index 000000000..a42d5ff27 --- /dev/null +++ b/foundry_sdk/_core/table.py @@ -0,0 +1,82 @@ +# Copyright 2024 Palantir Technologies, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from typing import TYPE_CHECKING +from typing import Any +from typing import Optional + +if TYPE_CHECKING: + import duckdb # type: ignore + import pandas as pd # type: ignore + import polars as pl # type: ignore + import pyarrow as pa # type: ignore + + +def _error_msg(package_required: str, convert_to: str, extra_dependency: str): + return ( + f"{package_required} is required to convert to {convert_to}. If you are using pip, " + f"you can install it with 'pip install foundry_sdk[{extra_dependency}]'." + ) + + +class TableResponse(bytes): + """A generic class for deserializing an Arrow Table into various formats.""" + + _arrow_table: Optional["pa.Table"] + + def __new__(cls, arrow_bytes: bytes): + instance = super().__new__(cls, arrow_bytes) + instance._arrow_table = None + return instance + + def to_pandas(self) -> "pd.DataFrame": + """Convert the bytes into a Pandas DataFrame.""" + try: + return self._get_arrow_table("pandas").to_pandas() + except ImportError: + raise ImportError(_error_msg("pandas", "a Pandas DataFrame", "pandas")) + + def to_polars(self) -> "pl.DataFrame": + """Convert the bytes into a Polars DataFrame.""" + try: + import polars as pl + + return pl.DataFrame(self._get_arrow_table("polars")) + except ImportError: + raise ImportError(_error_msg("polars", "a Polars DataFrame", "polars")) + + def to_pyarrow(self) -> "pa.Table": + """Convert the bytes into an Arrow Table.""" + return self._get_arrow_table("pyarrow") + + def to_duckdb(self) -> "duckdb.DuckDBPyRelation": + """Convert the bytes into a DuckDB relation.""" + try: + import duckdb + + return duckdb.from_arrow(self._get_arrow_table("duckdb")) + except ImportError: + raise ImportError(_error_msg("duckdb", "a DuckDB relation", "duckdb")) + + def _get_arrow_table(self, extra_dependency: str) -> "pa.Table": + try: + import pyarrow as pa + except ImportError: + raise ImportError(_error_msg("pyarrow", "an Arrow Table", extra_dependency)) + + if self._arrow_table is None: + self._arrow_table = pa.ipc.open_stream(self).read_all() + + return self._arrow_table diff --git a/foundry_sdk/_versions.py b/foundry_sdk/_versions.py index 1bd3bc426..083dc4299 100644 --- a/foundry_sdk/_versions.py +++ b/foundry_sdk/_versions.py @@ -17,4 +17,4 @@ # using the autorelease bot __version__ = "0.0.0" -__openapi_document_version__ = "1.1268.0" +__openapi_document_version__ = "1.1280.0" diff --git a/foundry_sdk/v2/admin/errors.py b/foundry_sdk/v2/admin/errors.py index 192b41905..5e11e7458 100644 --- a/foundry_sdk/v2/admin/errors.py +++ b/foundry_sdk/v2/admin/errors.py @@ -44,7 +44,7 @@ class AddGroupMembersPermissionDeniedParameters(typing_extensions.TypedDict): __pydantic_config__ = {"extra": "allow"} # type: ignore - groupId: core_models.PrincipalId + groupId: core_models.GroupId @dataclass @@ -201,7 +201,7 @@ class DeleteGroupPermissionDeniedParameters(typing_extensions.TypedDict): __pydantic_config__ = {"extra": "allow"} # type: ignore - groupId: core_models.PrincipalId + groupId: core_models.GroupId @dataclass @@ -216,7 +216,7 @@ class DeleteUserPermissionDeniedParameters(typing_extensions.TypedDict): __pydantic_config__ = {"extra": "allow"} # type: ignore - userId: core_models.PrincipalId + userId: core_models.UserId @dataclass @@ -285,7 +285,7 @@ class GetGroupProviderInfoPermissionDeniedParameters(typing_extensions.TypedDict __pydantic_config__ = {"extra": "allow"} # type: ignore - groupId: core_models.PrincipalId + groupId: core_models.GroupId @dataclass @@ -330,7 +330,7 @@ class GetMarkingsUserPermissionDeniedParameters(typing_extensions.TypedDict): __pydantic_config__ = {"extra": "allow"} # type: ignore - userId: core_models.PrincipalId + userId: core_models.UserId @dataclass @@ -345,7 +345,7 @@ class GetProfilePictureOfUserPermissionDeniedParameters(typing_extensions.TypedD __pydantic_config__ = {"extra": "allow"} # type: ignore - userId: core_models.PrincipalId + userId: core_models.UserId @dataclass @@ -360,7 +360,7 @@ class GetUserProviderInfoPermissionDeniedParameters(typing_extensions.TypedDict) __pydantic_config__ = {"extra": "allow"} # type: ignore - userId: core_models.PrincipalId + userId: core_models.UserId @dataclass @@ -375,7 +375,7 @@ class GroupMembershipExpirationPolicyNotFoundParameters(typing_extensions.TypedD __pydantic_config__ = {"extra": "allow"} # type: ignore - groupId: core_models.PrincipalId + groupId: core_models.GroupId @dataclass @@ -405,7 +405,7 @@ class GroupNotFoundParameters(typing_extensions.TypedDict): __pydantic_config__ = {"extra": "allow"} # type: ignore - groupId: core_models.PrincipalId + groupId: core_models.GroupId @dataclass @@ -420,7 +420,7 @@ class GroupProviderInfoNotFoundParameters(typing_extensions.TypedDict): __pydantic_config__ = {"extra": "allow"} # type: ignore - groupId: core_models.PrincipalId + groupId: core_models.GroupId @dataclass @@ -435,7 +435,7 @@ class InvalidGroupMembershipExpirationParameters(typing_extensions.TypedDict): __pydantic_config__ = {"extra": "allow"} # type: ignore - groupId: core_models.PrincipalId + groupId: core_models.GroupId earliestExpiration: core.AwareDatetime maximumDuration: typing_extensions.NotRequired[core_models.DurationSeconds] maximumValue: typing_extensions.NotRequired[admin_models.GroupMembershipExpiration] @@ -481,7 +481,7 @@ class InvalidProfilePictureParameters(typing_extensions.TypedDict): __pydantic_config__ = {"extra": "allow"} # type: ignore - userId: core_models.PrincipalId + userId: core_models.UserId @dataclass @@ -722,7 +722,7 @@ class ProfilePictureNotFoundParameters(typing_extensions.TypedDict): __pydantic_config__ = {"extra": "allow"} # type: ignore - userId: core_models.PrincipalId + userId: core_models.UserId @dataclass @@ -752,7 +752,7 @@ class RemoveGroupMembersPermissionDeniedParameters(typing_extensions.TypedDict): __pydantic_config__ = {"extra": "allow"} # type: ignore - groupId: core_models.PrincipalId + groupId: core_models.GroupId @dataclass @@ -830,7 +830,7 @@ class ReplaceGroupMembershipExpirationPolicyPermissionDeniedParameters(typing_ex __pydantic_config__ = {"extra": "allow"} # type: ignore - groupId: core_models.PrincipalId + groupId: core_models.GroupId @dataclass @@ -845,7 +845,7 @@ class ReplaceGroupProviderInfoPermissionDeniedParameters(typing_extensions.Typed __pydantic_config__ = {"extra": "allow"} # type: ignore - groupId: core_models.PrincipalId + groupId: core_models.GroupId @dataclass @@ -890,7 +890,7 @@ class ReplaceUserProviderInfoPermissionDeniedParameters(typing_extensions.TypedD __pydantic_config__ = {"extra": "allow"} # type: ignore - userId: core_models.PrincipalId + userId: core_models.UserId @dataclass @@ -905,7 +905,7 @@ class RevokeAllTokensUserPermissionDeniedParameters(typing_extensions.TypedDict) __pydantic_config__ = {"extra": "allow"} # type: ignore - userId: core_models.PrincipalId + userId: core_models.UserId @dataclass @@ -961,7 +961,7 @@ class UserNotFoundParameters(typing_extensions.TypedDict): __pydantic_config__ = {"extra": "allow"} # type: ignore - userId: core_models.PrincipalId + userId: core_models.UserId @dataclass @@ -976,7 +976,7 @@ class UserProviderInfoNotFoundParameters(typing_extensions.TypedDict): __pydantic_config__ = {"extra": "allow"} # type: ignore - userId: core_models.PrincipalId + userId: core_models.UserId @dataclass diff --git a/foundry_sdk/v2/admin/group.py b/foundry_sdk/v2/admin/group.py index 68487e2ad..a37042f90 100644 --- a/foundry_sdk/v2/admin/group.py +++ b/foundry_sdk/v2/admin/group.py @@ -163,7 +163,7 @@ def create( @errors.handle_unexpected def delete( self, - group_id: core_models.PrincipalId, + group_id: core_models.GroupId, *, request_timeout: typing.Optional[core.Timeout] = None, _sdk_internal: core.SdkInternal = {}, @@ -171,7 +171,7 @@ def delete( """ Delete the Group with the specified id. :param group_id: - :type group_id: PrincipalId + :type group_id: GroupId :param request_timeout: timeout setting for this request in seconds. :type request_timeout: Optional[int] :return: Returns the result object. @@ -209,7 +209,7 @@ def delete( @errors.handle_unexpected def get( self, - group_id: core_models.PrincipalId, + group_id: core_models.GroupId, *, request_timeout: typing.Optional[core.Timeout] = None, _sdk_internal: core.SdkInternal = {}, @@ -217,7 +217,7 @@ def get( """ Get the Group with the specified id. :param group_id: - :type group_id: PrincipalId + :type group_id: GroupId :param request_timeout: timeout setting for this request in seconds. :type request_timeout: Optional[int] :return: Returns the result object. @@ -576,7 +576,7 @@ def create( @errors.handle_unexpected def delete( self, - group_id: core_models.PrincipalId, + group_id: core_models.GroupId, *, request_timeout: typing.Optional[core.Timeout] = None, _sdk_internal: core.SdkInternal = {}, @@ -584,7 +584,7 @@ def delete( """ Delete the Group with the specified id. :param group_id: - :type group_id: PrincipalId + :type group_id: GroupId :param request_timeout: timeout setting for this request in seconds. :type request_timeout: Optional[int] :return: Returns the result object. @@ -622,7 +622,7 @@ def delete( @errors.handle_unexpected def get( self, - group_id: core_models.PrincipalId, + group_id: core_models.GroupId, *, request_timeout: typing.Optional[core.Timeout] = None, _sdk_internal: core.SdkInternal = {}, @@ -630,7 +630,7 @@ def get( """ Get the Group with the specified id. :param group_id: - :type group_id: PrincipalId + :type group_id: GroupId :param request_timeout: timeout setting for this request in seconds. :type request_timeout: Optional[int] :return: Returns the result object. diff --git a/foundry_sdk/v2/admin/group_member.py b/foundry_sdk/v2/admin/group_member.py index ba64f0105..ac5972730 100644 --- a/foundry_sdk/v2/admin/group_member.py +++ b/foundry_sdk/v2/admin/group_member.py @@ -54,7 +54,7 @@ def __init__( @errors.handle_unexpected def add( self, - group_id: core_models.PrincipalId, + group_id: core_models.GroupId, *, principal_ids: typing.List[core_models.PrincipalId], expiration: typing.Optional[admin_models.GroupMembershipExpiration] = None, @@ -64,7 +64,7 @@ def add( """ :param group_id: - :type group_id: PrincipalId + :type group_id: GroupId :param principal_ids: :type principal_ids: List[PrincipalId] :param expiration: @@ -121,7 +121,7 @@ def add( @errors.handle_unexpected def list( self, - group_id: core_models.PrincipalId, + group_id: core_models.GroupId, *, page_size: typing.Optional[core_models.PageSize] = None, page_token: typing.Optional[core_models.PageToken] = None, @@ -139,7 +139,7 @@ def list( in the response, you are on the last page. :param group_id: - :type group_id: PrincipalId + :type group_id: GroupId :param page_size: The page size to use for the endpoint. :type page_size: Optional[PageSize] :param page_token: The page token indicates where to start paging. This should be omitted from the first page's request. To fetch the next page, clients should take the value from the `nextPageToken` field of the previous response and use it to populate the `pageToken` field of the next request. @@ -187,7 +187,7 @@ def list( @errors.handle_unexpected def remove( self, - group_id: core_models.PrincipalId, + group_id: core_models.GroupId, *, principal_ids: typing.List[core_models.PrincipalId], request_timeout: typing.Optional[core.Timeout] = None, @@ -196,7 +196,7 @@ def remove( """ :param group_id: - :type group_id: PrincipalId + :type group_id: GroupId :param principal_ids: :type principal_ids: List[PrincipalId] :param request_timeout: timeout setting for this request in seconds. @@ -289,7 +289,7 @@ def __init__( @errors.handle_unexpected def add( self, - group_id: core_models.PrincipalId, + group_id: core_models.GroupId, *, principal_ids: typing.List[core_models.PrincipalId], expiration: typing.Optional[admin_models.GroupMembershipExpiration] = None, @@ -299,7 +299,7 @@ def add( """ :param group_id: - :type group_id: PrincipalId + :type group_id: GroupId :param principal_ids: :type principal_ids: List[PrincipalId] :param expiration: @@ -356,7 +356,7 @@ def add( @errors.handle_unexpected def list( self, - group_id: core_models.PrincipalId, + group_id: core_models.GroupId, *, page_size: typing.Optional[core_models.PageSize] = None, page_token: typing.Optional[core_models.PageToken] = None, @@ -374,7 +374,7 @@ def list( in the response, you are on the last page. :param group_id: - :type group_id: PrincipalId + :type group_id: GroupId :param page_size: The page size to use for the endpoint. :type page_size: Optional[PageSize] :param page_token: The page token indicates where to start paging. This should be omitted from the first page's request. To fetch the next page, clients should take the value from the `nextPageToken` field of the previous response and use it to populate the `pageToken` field of the next request. @@ -422,7 +422,7 @@ def list( @errors.handle_unexpected def remove( self, - group_id: core_models.PrincipalId, + group_id: core_models.GroupId, *, principal_ids: typing.List[core_models.PrincipalId], request_timeout: typing.Optional[core.Timeout] = None, @@ -431,7 +431,7 @@ def remove( """ :param group_id: - :type group_id: PrincipalId + :type group_id: GroupId :param principal_ids: :type principal_ids: List[PrincipalId] :param request_timeout: timeout setting for this request in seconds. diff --git a/foundry_sdk/v2/admin/group_membership.py b/foundry_sdk/v2/admin/group_membership.py index f70184235..9415f5a1a 100644 --- a/foundry_sdk/v2/admin/group_membership.py +++ b/foundry_sdk/v2/admin/group_membership.py @@ -54,7 +54,7 @@ def __init__( @errors.handle_unexpected def list( self, - user_id: core_models.PrincipalId, + user_id: core_models.UserId, *, page_size: typing.Optional[core_models.PageSize] = None, page_token: typing.Optional[core_models.PageToken] = None, @@ -72,7 +72,7 @@ def list( in the response, you are on the last page. :param user_id: - :type user_id: PrincipalId + :type user_id: UserId :param page_size: The page size to use for the endpoint. :type page_size: Optional[PageSize] :param page_token: The page token indicates where to start paging. This should be omitted from the first page's request. To fetch the next page, clients should take the value from the `nextPageToken` field of the previous response and use it to populate the `pageToken` field of the next request. @@ -158,7 +158,7 @@ def __init__( @errors.handle_unexpected def list( self, - user_id: core_models.PrincipalId, + user_id: core_models.UserId, *, page_size: typing.Optional[core_models.PageSize] = None, page_token: typing.Optional[core_models.PageToken] = None, @@ -176,7 +176,7 @@ def list( in the response, you are on the last page. :param user_id: - :type user_id: PrincipalId + :type user_id: UserId :param page_size: The page size to use for the endpoint. :type page_size: Optional[PageSize] :param page_token: The page token indicates where to start paging. This should be omitted from the first page's request. To fetch the next page, clients should take the value from the `nextPageToken` field of the previous response and use it to populate the `pageToken` field of the next request. diff --git a/foundry_sdk/v2/admin/group_membership_expiration_policy.py b/foundry_sdk/v2/admin/group_membership_expiration_policy.py index 60997455c..08e26fc03 100644 --- a/foundry_sdk/v2/admin/group_membership_expiration_policy.py +++ b/foundry_sdk/v2/admin/group_membership_expiration_policy.py @@ -53,7 +53,7 @@ def __init__( @errors.handle_unexpected def get( self, - group_id: core_models.PrincipalId, + group_id: core_models.GroupId, *, preview: typing.Optional[core_models.PreviewMode] = None, request_timeout: typing.Optional[core.Timeout] = None, @@ -62,7 +62,7 @@ def get( """ Get the GroupMembershipExpirationPolicy. :param group_id: - :type group_id: PrincipalId + :type group_id: GroupId :param preview: Enables the use of preview functionality. :type preview: Optional[PreviewMode] :param request_timeout: timeout setting for this request in seconds. @@ -104,7 +104,7 @@ def get( @errors.handle_unexpected def replace( self, - group_id: core_models.PrincipalId, + group_id: core_models.GroupId, *, maximum_duration: typing.Optional[core_models.DurationSeconds] = None, maximum_value: typing.Optional[admin_models.GroupMembershipExpiration] = None, @@ -115,7 +115,7 @@ def replace( """ Replace the GroupMembershipExpirationPolicy. :param group_id: - :type group_id: PrincipalId + :type group_id: GroupId :param maximum_duration: Members in this group must be added with expirations that are less than this duration in seconds into the future from the time they are added. :type maximum_duration: Optional[DurationSeconds] :param maximum_value: Members in this group must be added with expiration times that occur before this value. @@ -213,7 +213,7 @@ def __init__( @errors.handle_unexpected def get( self, - group_id: core_models.PrincipalId, + group_id: core_models.GroupId, *, preview: typing.Optional[core_models.PreviewMode] = None, request_timeout: typing.Optional[core.Timeout] = None, @@ -222,7 +222,7 @@ def get( """ Get the GroupMembershipExpirationPolicy. :param group_id: - :type group_id: PrincipalId + :type group_id: GroupId :param preview: Enables the use of preview functionality. :type preview: Optional[PreviewMode] :param request_timeout: timeout setting for this request in seconds. @@ -264,7 +264,7 @@ def get( @errors.handle_unexpected def replace( self, - group_id: core_models.PrincipalId, + group_id: core_models.GroupId, *, maximum_duration: typing.Optional[core_models.DurationSeconds] = None, maximum_value: typing.Optional[admin_models.GroupMembershipExpiration] = None, @@ -275,7 +275,7 @@ def replace( """ Replace the GroupMembershipExpirationPolicy. :param group_id: - :type group_id: PrincipalId + :type group_id: GroupId :param maximum_duration: Members in this group must be added with expirations that are less than this duration in seconds into the future from the time they are added. :type maximum_duration: Optional[DurationSeconds] :param maximum_value: Members in this group must be added with expiration times that occur before this value. diff --git a/foundry_sdk/v2/admin/group_provider_info.py b/foundry_sdk/v2/admin/group_provider_info.py index 4197a185b..688064873 100644 --- a/foundry_sdk/v2/admin/group_provider_info.py +++ b/foundry_sdk/v2/admin/group_provider_info.py @@ -53,7 +53,7 @@ def __init__( @errors.handle_unexpected def get( self, - group_id: core_models.PrincipalId, + group_id: core_models.GroupId, *, preview: typing.Optional[core_models.PreviewMode] = None, request_timeout: typing.Optional[core.Timeout] = None, @@ -62,7 +62,7 @@ def get( """ Get the GroupProviderInfo. :param group_id: - :type group_id: PrincipalId + :type group_id: GroupId :param preview: Enables the use of preview functionality. :type preview: Optional[PreviewMode] :param request_timeout: timeout setting for this request in seconds. @@ -106,7 +106,7 @@ def get( @errors.handle_unexpected def replace( self, - group_id: core_models.PrincipalId, + group_id: core_models.GroupId, *, provider_id: admin_models.ProviderId, preview: typing.Optional[core_models.PreviewMode] = None, @@ -116,7 +116,7 @@ def replace( """ Replace the GroupProviderInfo. :param group_id: - :type group_id: PrincipalId + :type group_id: GroupId :param provider_id: The ID of the Group in the external authentication provider. This value is determined by the authentication provider. At most one Group can have a given provider ID in a given Realm. :type provider_id: ProviderId :param preview: Enables the use of preview functionality. @@ -216,7 +216,7 @@ def __init__( @errors.handle_unexpected def get( self, - group_id: core_models.PrincipalId, + group_id: core_models.GroupId, *, preview: typing.Optional[core_models.PreviewMode] = None, request_timeout: typing.Optional[core.Timeout] = None, @@ -225,7 +225,7 @@ def get( """ Get the GroupProviderInfo. :param group_id: - :type group_id: PrincipalId + :type group_id: GroupId :param preview: Enables the use of preview functionality. :type preview: Optional[PreviewMode] :param request_timeout: timeout setting for this request in seconds. @@ -269,7 +269,7 @@ def get( @errors.handle_unexpected def replace( self, - group_id: core_models.PrincipalId, + group_id: core_models.GroupId, *, provider_id: admin_models.ProviderId, preview: typing.Optional[core_models.PreviewMode] = None, @@ -279,7 +279,7 @@ def replace( """ Replace the GroupProviderInfo. :param group_id: - :type group_id: PrincipalId + :type group_id: GroupId :param provider_id: The ID of the Group in the external authentication provider. This value is determined by the authentication provider. At most one Group can have a given provider ID in a given Realm. :type provider_id: ProviderId :param preview: Enables the use of preview functionality. diff --git a/foundry_sdk/v2/admin/models.py b/foundry_sdk/v2/admin/models.py index b564bdad4..0235fee29 100644 --- a/foundry_sdk/v2/admin/models.py +++ b/foundry_sdk/v2/admin/models.py @@ -110,13 +110,13 @@ class EnrollmentRoleAssignment(core.ModelBase): class GetGroupsBatchRequestElement(core.ModelBase): """GetGroupsBatchRequestElement""" - group_id: core_models.PrincipalId = pydantic.Field(alias=str("groupId")) # type: ignore[literal-required] + group_id: core_models.GroupId = pydantic.Field(alias=str("groupId")) # type: ignore[literal-required] class GetGroupsBatchResponse(core.ModelBase): """GetGroupsBatchResponse""" - data: typing.Dict[core_models.PrincipalId, Group] + data: typing.Dict[core_models.GroupId, Group] class GetMarkingsBatchRequestElement(core.ModelBase): @@ -156,19 +156,19 @@ class GetUserMarkingsResponse(core.ModelBase): class GetUsersBatchRequestElement(core.ModelBase): """GetUsersBatchRequestElement""" - user_id: core_models.PrincipalId = pydantic.Field(alias=str("userId")) # type: ignore[literal-required] + user_id: core_models.UserId = pydantic.Field(alias=str("userId")) # type: ignore[literal-required] class GetUsersBatchResponse(core.ModelBase): """GetUsersBatchResponse""" - data: typing.Dict[core_models.PrincipalId, User] + data: typing.Dict[core_models.UserId, User] class Group(core.ModelBase): """Group""" - id: core_models.PrincipalId + id: core_models.GroupId name: GroupName """The name of the Group.""" @@ -193,7 +193,7 @@ class GroupMember(core.ModelBase): class GroupMembership(core.ModelBase): """GroupMembership""" - group_id: core_models.PrincipalId = pydantic.Field(alias=str("groupId")) # type: ignore[literal-required] + group_id: core_models.GroupId = pydantic.Field(alias=str("groupId")) # type: ignore[literal-required] GroupMembershipExpiration = core.AwareDatetime @@ -523,7 +523,7 @@ class SearchUsersResponse(core.ModelBase): class User(core.ModelBase): """User""" - id: core_models.PrincipalId + id: core_models.UserId username: UserUsername """The Foundry username of the User. This is unique within the realm.""" diff --git a/foundry_sdk/v2/admin/user.py b/foundry_sdk/v2/admin/user.py index 7fa19f3db..5dee1cea8 100644 --- a/foundry_sdk/v2/admin/user.py +++ b/foundry_sdk/v2/admin/user.py @@ -76,7 +76,7 @@ def GroupMembership(self): @errors.handle_unexpected def delete( self, - user_id: core_models.PrincipalId, + user_id: core_models.UserId, *, request_timeout: typing.Optional[core.Timeout] = None, _sdk_internal: core.SdkInternal = {}, @@ -84,7 +84,7 @@ def delete( """ Delete the User with the specified id. :param user_id: - :type user_id: PrincipalId + :type user_id: UserId :param request_timeout: timeout setting for this request in seconds. :type request_timeout: Optional[int] :return: Returns the result object. @@ -120,7 +120,7 @@ def delete( @errors.handle_unexpected def get( self, - user_id: core_models.PrincipalId, + user_id: core_models.UserId, *, request_timeout: typing.Optional[core.Timeout] = None, _sdk_internal: core.SdkInternal = {}, @@ -128,7 +128,7 @@ def get( """ Get the User with the specified id. :param user_id: - :type user_id: PrincipalId + :type user_id: UserId :param request_timeout: timeout setting for this request in seconds. :type request_timeout: Optional[int] :return: Returns the result object. @@ -250,7 +250,7 @@ def get_current( @errors.handle_unexpected def get_markings( self, - user_id: core_models.PrincipalId, + user_id: core_models.UserId, *, preview: typing.Optional[core_models.PreviewMode] = None, request_timeout: typing.Optional[core.Timeout] = None, @@ -259,7 +259,7 @@ def get_markings( """ Retrieve Markings that the user is currently a member of. :param user_id: - :type user_id: PrincipalId + :type user_id: UserId :param preview: Enables the use of preview functionality. :type preview: Optional[PreviewMode] :param request_timeout: timeout setting for this request in seconds. @@ -351,7 +351,7 @@ def list( @errors.handle_unexpected def profile_picture( self, - user_id: core_models.PrincipalId, + user_id: core_models.UserId, *, request_timeout: typing.Optional[core.Timeout] = None, _sdk_internal: core.SdkInternal = {}, @@ -359,7 +359,7 @@ def profile_picture( """ :param user_id: - :type user_id: PrincipalId + :type user_id: UserId :param request_timeout: timeout setting for this request in seconds. :type request_timeout: Optional[int] :return: Returns the result object. @@ -399,7 +399,7 @@ def profile_picture( @errors.handle_unexpected def revoke_all_tokens( self, - user_id: core_models.PrincipalId, + user_id: core_models.UserId, *, preview: typing.Optional[core_models.PreviewMode] = None, request_timeout: typing.Optional[core.Timeout] = None, @@ -412,7 +412,7 @@ def revoke_all_tokens( The caller must have permission to manage users for the target user's organization. :param user_id: - :type user_id: PrincipalId + :type user_id: UserId :param preview: Enables the use of preview functionality. :type preview: Optional[PreviewMode] :param request_timeout: timeout setting for this request in seconds. @@ -601,7 +601,7 @@ def GroupMembership(self): @errors.handle_unexpected def delete( self, - user_id: core_models.PrincipalId, + user_id: core_models.UserId, *, request_timeout: typing.Optional[core.Timeout] = None, _sdk_internal: core.SdkInternal = {}, @@ -609,7 +609,7 @@ def delete( """ Delete the User with the specified id. :param user_id: - :type user_id: PrincipalId + :type user_id: UserId :param request_timeout: timeout setting for this request in seconds. :type request_timeout: Optional[int] :return: Returns the result object. @@ -645,7 +645,7 @@ def delete( @errors.handle_unexpected def get( self, - user_id: core_models.PrincipalId, + user_id: core_models.UserId, *, request_timeout: typing.Optional[core.Timeout] = None, _sdk_internal: core.SdkInternal = {}, @@ -653,7 +653,7 @@ def get( """ Get the User with the specified id. :param user_id: - :type user_id: PrincipalId + :type user_id: UserId :param request_timeout: timeout setting for this request in seconds. :type request_timeout: Optional[int] :return: Returns the result object. @@ -775,7 +775,7 @@ def get_current( @errors.handle_unexpected def get_markings( self, - user_id: core_models.PrincipalId, + user_id: core_models.UserId, *, preview: typing.Optional[core_models.PreviewMode] = None, request_timeout: typing.Optional[core.Timeout] = None, @@ -784,7 +784,7 @@ def get_markings( """ Retrieve Markings that the user is currently a member of. :param user_id: - :type user_id: PrincipalId + :type user_id: UserId :param preview: Enables the use of preview functionality. :type preview: Optional[PreviewMode] :param request_timeout: timeout setting for this request in seconds. @@ -876,7 +876,7 @@ def list( @errors.handle_unexpected def profile_picture( self, - user_id: core_models.PrincipalId, + user_id: core_models.UserId, *, request_timeout: typing.Optional[core.Timeout] = None, _sdk_internal: core.SdkInternal = {}, @@ -884,7 +884,7 @@ def profile_picture( """ :param user_id: - :type user_id: PrincipalId + :type user_id: UserId :param request_timeout: timeout setting for this request in seconds. :type request_timeout: Optional[int] :return: Returns the result object. @@ -924,7 +924,7 @@ def profile_picture( @errors.handle_unexpected def revoke_all_tokens( self, - user_id: core_models.PrincipalId, + user_id: core_models.UserId, *, preview: typing.Optional[core_models.PreviewMode] = None, request_timeout: typing.Optional[core.Timeout] = None, @@ -937,7 +937,7 @@ def revoke_all_tokens( The caller must have permission to manage users for the target user's organization. :param user_id: - :type user_id: PrincipalId + :type user_id: UserId :param preview: Enables the use of preview functionality. :type preview: Optional[PreviewMode] :param request_timeout: timeout setting for this request in seconds. diff --git a/foundry_sdk/v2/admin/user_provider_info.py b/foundry_sdk/v2/admin/user_provider_info.py index 7d62d3561..b8c31ad7f 100644 --- a/foundry_sdk/v2/admin/user_provider_info.py +++ b/foundry_sdk/v2/admin/user_provider_info.py @@ -53,7 +53,7 @@ def __init__( @errors.handle_unexpected def get( self, - user_id: core_models.PrincipalId, + user_id: core_models.UserId, *, preview: typing.Optional[core_models.PreviewMode] = None, request_timeout: typing.Optional[core.Timeout] = None, @@ -62,7 +62,7 @@ def get( """ Get the UserProviderInfo. :param user_id: - :type user_id: PrincipalId + :type user_id: UserId :param preview: Enables the use of preview functionality. :type preview: Optional[PreviewMode] :param request_timeout: timeout setting for this request in seconds. @@ -106,7 +106,7 @@ def get( @errors.handle_unexpected def replace( self, - user_id: core_models.PrincipalId, + user_id: core_models.UserId, *, provider_id: admin_models.ProviderId, preview: typing.Optional[core_models.PreviewMode] = None, @@ -116,7 +116,7 @@ def replace( """ Replace the UserProviderInfo. :param user_id: - :type user_id: PrincipalId + :type user_id: UserId :param provider_id: The ID of the User in the external authentication provider. This value is determined by the authentication provider. At most one User can have a given provider ID in a given Realm. :type provider_id: ProviderId :param preview: Enables the use of preview functionality. @@ -216,7 +216,7 @@ def __init__( @errors.handle_unexpected def get( self, - user_id: core_models.PrincipalId, + user_id: core_models.UserId, *, preview: typing.Optional[core_models.PreviewMode] = None, request_timeout: typing.Optional[core.Timeout] = None, @@ -225,7 +225,7 @@ def get( """ Get the UserProviderInfo. :param user_id: - :type user_id: PrincipalId + :type user_id: UserId :param preview: Enables the use of preview functionality. :type preview: Optional[PreviewMode] :param request_timeout: timeout setting for this request in seconds. @@ -269,7 +269,7 @@ def get( @errors.handle_unexpected def replace( self, - user_id: core_models.PrincipalId, + user_id: core_models.UserId, *, provider_id: admin_models.ProviderId, preview: typing.Optional[core_models.PreviewMode] = None, @@ -279,7 +279,7 @@ def replace( """ Replace the UserProviderInfo. :param user_id: - :type user_id: PrincipalId + :type user_id: UserId :param provider_id: The ID of the User in the external authentication provider. This value is determined by the authentication provider. At most one User can have a given provider ID in a given Realm. :type provider_id: ProviderId :param preview: Enables the use of preview functionality. diff --git a/foundry_sdk/v2/cli.py b/foundry_sdk/v2/cli.py index ad0ba887c..60c88b521 100644 --- a/foundry_sdk/v2/cli.py +++ b/foundry_sdk/v2/cli.py @@ -5012,6 +5012,30 @@ def filesystem_folder_op_get( click.echo(repr(result)) +@filesystem_folder.command("get_batch") +@click.argument("body", type=str, required=True) +@click.option( + "--preview", type=bool, required=False, help="""Enables the use of preview functionality.""" +) +@click.pass_obj +def filesystem_folder_op_get_batch( + client: FoundryClient, + body: str, + preview: typing.Optional[bool], +): + """ + Fetches multiple folders in a single request. + + + The maximum batch size for this endpoint is 1000. + """ + result = client.filesystem.Folder.get_batch( + body=json.loads(body), + preview=preview, + ) + click.echo(repr(result)) + + @cli.group("functions") def functions(): pass @@ -6021,11 +6045,27 @@ def ontologies_ontology_object_set_op_aggregate( @ontologies_ontology_object_set.command("create_temporary") @click.argument("ontology", type=str, required=True) @click.option("--object_set", type=str, required=True, help="""""") +@click.option( + "--sdk_package_rid", + type=str, + required=False, + help="""The package rid of the generated SDK. +""", +) +@click.option( + "--sdk_version", + type=str, + required=False, + help="""The package version of the generated SDK. +""", +) @click.pass_obj def ontologies_ontology_object_set_op_create_temporary( client: FoundryClient, ontology: str, object_set: str, + sdk_package_rid: typing.Optional[str], + sdk_version: typing.Optional[str], ): """ Creates a temporary `ObjectSet` from the given definition. This `ObjectSet` expires after one hour. @@ -6034,6 +6074,8 @@ def ontologies_ontology_object_set_op_create_temporary( result = client.ontologies.OntologyObjectSet.create_temporary( ontology=ontology, object_set=json.loads(object_set), + sdk_package_rid=sdk_package_rid, + sdk_version=sdk_version, ) click.echo(repr(result)) @@ -6949,6 +6991,95 @@ def ontologies_ontology_interface_op_list( click.echo(repr(result)) +@ontologies_ontology_interface.command("list_objects_for_interface") +@click.argument("ontology", type=str, required=True) +@click.argument("interface_type", type=str, required=True) +@click.option( + "--branch", + type=str, + required=False, + help="""The Foundry branch to list objects from. If not specified, the default branch will be used. +""", +) +@click.option( + "--exclude_rid", + type=bool, + required=False, + help="""A flag to exclude the retrieval of the `__rid` property. +Setting this to true may improve performance of this endpoint for object types in OSV2. +""", +) +@click.option("--order_by", type=str, required=False, help="""""") +@click.option( + "--page_size", + type=int, + required=False, + help="""The desired size of the page to be returned. Defaults to 1,000. +See [page sizes](https://palantir.com/docs/foundry/api/general/overview/paging/#page-sizes) for details. +""", +) +@click.option("--page_token", type=str, required=False, help="""""") +@click.option( + "--select", + type=str, + required=False, + help="""The properties of the interface type that should be included in the response. Omit this parameter to get all +the properties. +""", +) +@click.option( + "--snapshot", + type=bool, + required=False, + help="""A flag to use snapshot consistency when paging. +Setting this to true will give you a consistent view from before you start paging through the results, ensuring you do not get duplicate or missing items. +Setting this to false will let new results enter as you page, but you may encounter duplicate or missing items. +This defaults to false if not specified, which means you will always get the latest results. +""", +) +@click.pass_obj +def ontologies_ontology_interface_op_list_objects_for_interface( + client: FoundryClient, + ontology: str, + interface_type: str, + branch: typing.Optional[str], + exclude_rid: typing.Optional[bool], + order_by: typing.Optional[str], + page_size: typing.Optional[int], + page_token: typing.Optional[str], + select: typing.Optional[str], + snapshot: typing.Optional[bool], +): + """ + Lists the objects for the given Ontology and interface type. + + Note that this endpoint does not guarantee consistency, unless you use the snapshot flag specified below. Changes to the data could result in missing or + repeated objects in the response pages. + + For Object Storage V1 backed objects, this endpoint returns a maximum of 10,000 objects. After 10,000 objects have been returned and if more objects + are available, attempting to load another page will result in an `ObjectsExceededLimit` error being returned. There is no limit on Object Storage V2 backed objects. + + Each page may be smaller or larger than the requested page size. However, it + is guaranteed that if there are more results available, at least one result will be present + in the response. + + Note that null value properties will not be returned. + + """ + result = client.ontologies.OntologyInterface.list_objects_for_interface( + ontology=ontology, + interface_type=interface_type, + branch=branch, + exclude_rid=exclude_rid, + order_by=order_by, + page_size=page_size, + page_token=page_token, + select=None if select is None else json.loads(select), + snapshot=snapshot, + ) + click.echo(repr(result)) + + @ontologies_ontology_interface.command("list_outgoing_interface_link_types") @click.argument("ontology", type=str, required=True) @click.argument("interface_type", type=str, required=True) @@ -8554,6 +8685,25 @@ def orchestration_schedule_op_get( click.echo(repr(result)) +@orchestration_schedule.command("get_affected_resources") +@click.argument("schedule_rid", type=str, required=True) +@click.option( + "--preview", type=bool, required=False, help="""Enables the use of preview functionality.""" +) +@click.pass_obj +def orchestration_schedule_op_get_affected_resources( + client: FoundryClient, + schedule_rid: str, + preview: typing.Optional[bool], +): + """ """ + result = client.orchestration.Schedule.get_affected_resources( + schedule_rid=schedule_rid, + preview=preview, + ) + click.echo(repr(result)) + + @orchestration_schedule.command("get_batch") @click.argument("body", type=str, required=True) @click.option( diff --git a/foundry_sdk/v2/core/models.py b/foundry_sdk/v2/core/models.py index 17e59edd8..327763100 100644 --- a/foundry_sdk/v2/core/models.py +++ b/foundry_sdk/v2/core/models.py @@ -442,6 +442,10 @@ class GeotimeSeriesReferenceType(core.ModelBase): type: typing.Literal["geotimeSeriesReference"] = "geotimeSeriesReference" +GroupId = core.UUID +"""A Foundry Group ID.""" + + GroupName = str """The display name of a multipass group.""" @@ -611,7 +615,7 @@ class NullType(core.ModelBase): """Enables the use of preview functionality.""" -PrincipalId = str +PrincipalId = core.UUID """The ID of a Foundry Group or User.""" @@ -730,6 +734,10 @@ class StructFieldType(core.ModelBase): type: typing.Literal["struct"] = "struct" +TableRid = core.RID +"""The Resource Identifier (RID) of a Table.""" + + TimeSeriesItemType = typing_extensions.Annotated[ typing.Union[StringType, DoubleType], pydantic.Field(discriminator="type") ] @@ -901,6 +909,7 @@ class VectorType(core.ModelBase): "GeoShapeType", "GeohashType", "GeotimeSeriesReferenceType", + "GroupId", "GroupName", "GroupRid", "IncludeComputeUsage", @@ -947,6 +956,7 @@ class VectorType(core.ModelBase): "StringType", "StructFieldName", "StructFieldType", + "TableRid", "TimeSeriesItemType", "TimeUnit", "TimeseriesType", diff --git a/foundry_sdk/v2/filesystem/folder.py b/foundry_sdk/v2/filesystem/folder.py index 4fb50b0fc..8f2c4146c 100644 --- a/foundry_sdk/v2/filesystem/folder.py +++ b/foundry_sdk/v2/filesystem/folder.py @@ -15,6 +15,7 @@ import typing +import annotated_types import pydantic import typing_extensions @@ -244,16 +245,71 @@ def get( ), ) + @core.maybe_ignore_preview + @pydantic.validate_call + @errors.handle_unexpected + def get_batch( + self, + body: typing_extensions.Annotated[ + typing.List[filesystem_models.GetFoldersBatchRequestElement], + annotated_types.Len(min_length=1, max_length=1000), + ], + *, + preview: typing.Optional[core_models.PreviewMode] = None, + request_timeout: typing.Optional[core.Timeout] = None, + _sdk_internal: core.SdkInternal = {}, + ) -> filesystem_models.GetFoldersBatchResponse: + """ + Fetches multiple folders in a single request. + + + The maximum batch size for this endpoint is 1000. + :param body: Body of the request + :type body: List[GetFoldersBatchRequestElement] + :param preview: Enables the use of preview functionality. + :type preview: Optional[PreviewMode] + :param request_timeout: timeout setting for this request in seconds. + :type request_timeout: Optional[int] + :return: Returns the result object. + :rtype: filesystem_models.GetFoldersBatchResponse + """ + + return self._api_client.call_api( + core.RequestInfo( + method="POST", + resource_path="/v2/filesystem/folders/getBatch", + query_params={ + "preview": preview, + }, + path_params={}, + header_params={ + "Content-Type": "application/json", + "Accept": "application/json", + }, + body=body, + body_type=typing_extensions.Annotated[ + typing.List[filesystem_models.GetFoldersBatchRequestElement], + annotated_types.Len(min_length=1, max_length=1000), + ], + response_type=filesystem_models.GetFoldersBatchResponse, + request_timeout=request_timeout, + throwable_errors={}, + response_mode=_sdk_internal.get("response_mode"), + ), + ) + class _FolderClientRaw: def __init__(self, client: FolderClient) -> None: def children(_: filesystem_models.ListChildrenOfFolderResponse): ... def create(_: filesystem_models.Folder): ... def get(_: filesystem_models.Folder): ... + def get_batch(_: filesystem_models.GetFoldersBatchResponse): ... self.children = core.with_raw_response(children, client.children) self.create = core.with_raw_response(create, client.create) self.get = core.with_raw_response(get, client.get) + self.get_batch = core.with_raw_response(get_batch, client.get_batch) class _FolderClientStreaming: @@ -261,10 +317,12 @@ def __init__(self, client: FolderClient) -> None: def children(_: filesystem_models.ListChildrenOfFolderResponse): ... def create(_: filesystem_models.Folder): ... def get(_: filesystem_models.Folder): ... + def get_batch(_: filesystem_models.GetFoldersBatchResponse): ... self.children = core.with_streaming_response(children, client.children) self.create = core.with_streaming_response(create, client.create) self.get = core.with_streaming_response(get, client.get) + self.get_batch = core.with_streaming_response(get_batch, client.get_batch) class AsyncFolderClient: @@ -486,16 +544,71 @@ def get( ), ) + @core.maybe_ignore_preview + @pydantic.validate_call + @errors.handle_unexpected + def get_batch( + self, + body: typing_extensions.Annotated[ + typing.List[filesystem_models.GetFoldersBatchRequestElement], + annotated_types.Len(min_length=1, max_length=1000), + ], + *, + preview: typing.Optional[core_models.PreviewMode] = None, + request_timeout: typing.Optional[core.Timeout] = None, + _sdk_internal: core.SdkInternal = {}, + ) -> typing.Awaitable[filesystem_models.GetFoldersBatchResponse]: + """ + Fetches multiple folders in a single request. + + + The maximum batch size for this endpoint is 1000. + :param body: Body of the request + :type body: List[GetFoldersBatchRequestElement] + :param preview: Enables the use of preview functionality. + :type preview: Optional[PreviewMode] + :param request_timeout: timeout setting for this request in seconds. + :type request_timeout: Optional[int] + :return: Returns the result object. + :rtype: typing.Awaitable[filesystem_models.GetFoldersBatchResponse] + """ + + return self._api_client.call_api( + core.RequestInfo( + method="POST", + resource_path="/v2/filesystem/folders/getBatch", + query_params={ + "preview": preview, + }, + path_params={}, + header_params={ + "Content-Type": "application/json", + "Accept": "application/json", + }, + body=body, + body_type=typing_extensions.Annotated[ + typing.List[filesystem_models.GetFoldersBatchRequestElement], + annotated_types.Len(min_length=1, max_length=1000), + ], + response_type=filesystem_models.GetFoldersBatchResponse, + request_timeout=request_timeout, + throwable_errors={}, + response_mode=_sdk_internal.get("response_mode"), + ), + ) + class _AsyncFolderClientRaw: def __init__(self, client: AsyncFolderClient) -> None: def children(_: filesystem_models.ListChildrenOfFolderResponse): ... def create(_: filesystem_models.Folder): ... def get(_: filesystem_models.Folder): ... + def get_batch(_: filesystem_models.GetFoldersBatchResponse): ... self.children = core.async_with_raw_response(children, client.children) self.create = core.async_with_raw_response(create, client.create) self.get = core.async_with_raw_response(get, client.get) + self.get_batch = core.async_with_raw_response(get_batch, client.get_batch) class _AsyncFolderClientStreaming: @@ -503,7 +616,9 @@ def __init__(self, client: AsyncFolderClient) -> None: def children(_: filesystem_models.ListChildrenOfFolderResponse): ... def create(_: filesystem_models.Folder): ... def get(_: filesystem_models.Folder): ... + def get_batch(_: filesystem_models.GetFoldersBatchResponse): ... self.children = core.async_with_streaming_response(children, client.children) self.create = core.async_with_streaming_response(create, client.create) self.get = core.async_with_streaming_response(get, client.get) + self.get_batch = core.async_with_streaming_response(get_batch, client.get_batch) diff --git a/foundry_sdk/v2/filesystem/models.py b/foundry_sdk/v2/filesystem/models.py index 822d4cd6b..43ddba8bc 100644 --- a/foundry_sdk/v2/filesystem/models.py +++ b/foundry_sdk/v2/filesystem/models.py @@ -98,6 +98,18 @@ class Folder(core.ModelBase): """ +class GetFoldersBatchRequestElement(core.ModelBase): + """GetFoldersBatchRequestElement""" + + folder_rid: FolderRid = pydantic.Field(alias=str("folderRid")) # type: ignore[literal-required] + + +class GetFoldersBatchResponse(core.ModelBase): + """GetFoldersBatchResponse""" + + data: typing.Dict[FolderRid, Folder] + + IsDirectlyApplied = bool """ Boolean flag to indicate if the marking is directly applied to the resource, or if it's applied @@ -422,6 +434,8 @@ class Space(core.ModelBase): "Folder", "FolderRid", "FolderType", + "GetFoldersBatchRequestElement", + "GetFoldersBatchResponse", "IsDirectlyApplied", "ListChildrenOfFolderResponse", "ListMarkingsOfResourceResponse", diff --git a/foundry_sdk/v2/ontologies/models.py b/foundry_sdk/v2/ontologies/models.py index f64b8efdf..11989b61c 100644 --- a/foundry_sdk/v2/ontologies/models.py +++ b/foundry_sdk/v2/ontologies/models.py @@ -791,7 +791,7 @@ class EntrySetType(core.ModelBase): class EnumConstraint(core.ModelBase): """EnumConstraint""" - options: typing.List[typing.Any] + options: typing.List[typing.Optional[PropertyValue]] type: typing.Literal["enum"] = "enum" @@ -1200,6 +1200,16 @@ class ListObjectTypesV2Response(core.ModelBase): """The list of object types in the current page.""" +class ListObjectsForInterfaceResponse(core.ModelBase): + """ListObjectsForInterfaceResponse""" + + next_page_token: typing.Optional[core_models.PageToken] = pydantic.Field(alias=str("nextPageToken"), default=None) # type: ignore[literal-required] + data: typing.List[OntologyObjectV2] + """The list of interface instances in the current page.""" + + total_count: core_models.TotalCount = pydantic.Field(alias=str("totalCount")) # type: ignore[literal-required] + + class ListObjectsResponseV2(core.ModelBase): """ListObjectsResponseV2""" @@ -2347,8 +2357,8 @@ class RangeConstraint(core.ModelBase): class RangesConstraint(core.ModelBase): """RangesConstraint""" - minimum_value: typing.Optional[typing.Any] = pydantic.Field(alias=str("minimumValue"), default=None) # type: ignore[literal-required] - maximum_value: typing.Optional[typing.Any] = pydantic.Field(alias=str("maximumValue"), default=None) # type: ignore[literal-required] + minimum_value: typing.Optional[PropertyValue] = pydantic.Field(alias=str("minimumValue"), default=None) # type: ignore[literal-required] + maximum_value: typing.Optional[PropertyValue] = pydantic.Field(alias=str("maximumValue"), default=None) # type: ignore[literal-required] type: typing.Literal["range"] = "range" @@ -3042,6 +3052,7 @@ class ValueTypeArrayType(core.ModelBase): typing.Union[ StructConstraint, RegexConstraint, + core_models.UnsupportedType, ArrayConstraint, LengthConstraint, RangesConstraint, @@ -3385,6 +3396,7 @@ class WithinPolygonQuery(core.ModelBase): "ListInterfaceTypesResponse", "ListLinkedObjectsResponseV2", "ListObjectTypesV2Response", + "ListObjectsForInterfaceResponse", "ListObjectsResponseV2", "ListOntologiesV2Response", "ListOntologyValueTypesResponse", diff --git a/foundry_sdk/v2/ontologies/ontology_interface.py b/foundry_sdk/v2/ontologies/ontology_interface.py index 5f67fdd2b..9ba9f861e 100644 --- a/foundry_sdk/v2/ontologies/ontology_interface.py +++ b/foundry_sdk/v2/ontologies/ontology_interface.py @@ -301,6 +301,92 @@ def list( ), ) + @core.maybe_ignore_preview + @pydantic.validate_call + @errors.handle_unexpected + def list_objects_for_interface( + self, + ontology: ontologies_models.OntologyIdentifier, + interface_type: ontologies_models.InterfaceTypeApiName, + *, + branch: typing.Optional[core_models.FoundryBranch] = None, + exclude_rid: typing.Optional[bool] = None, + order_by: typing.Optional[ontologies_models.OrderBy] = None, + page_size: typing.Optional[core_models.PageSize] = None, + page_token: typing.Optional[core_models.PageToken] = None, + select: typing.Optional[typing.List[ontologies_models.SelectedPropertyApiName]] = None, + snapshot: typing.Optional[bool] = None, + request_timeout: typing.Optional[core.Timeout] = None, + _sdk_internal: core.SdkInternal = {}, + ) -> core.ResourceIterator[ontologies_models.OntologyObjectV2]: + """ + Lists the objects for the given Ontology and interface type. + + Note that this endpoint does not guarantee consistency, unless you use the snapshot flag specified below. Changes to the data could result in missing or + repeated objects in the response pages. + + For Object Storage V1 backed objects, this endpoint returns a maximum of 10,000 objects. After 10,000 objects have been returned and if more objects + are available, attempting to load another page will result in an `ObjectsExceededLimit` error being returned. There is no limit on Object Storage V2 backed objects. + + Each page may be smaller or larger than the requested page size. However, it + is guaranteed that if there are more results available, at least one result will be present + in the response. + + Note that null value properties will not be returned. + + :param ontology: The API name of the ontology. To find the API name, use the **List ontologies** endpoint or check the **Ontology Manager**. + :type ontology: OntologyIdentifier + :param interface_type: The API name of the interface type. To find the API name, use the **List interface types** endpoint or check the **Ontology Manager**. + :type interface_type: InterfaceTypeApiName + :param branch: The Foundry branch to list objects from. If not specified, the default branch will be used. + :type branch: Optional[FoundryBranch] + :param exclude_rid: A flag to exclude the retrieval of the `__rid` property. Setting this to true may improve performance of this endpoint for object types in OSV2. + :type exclude_rid: Optional[bool] + :param order_by: + :type order_by: Optional[OrderBy] + :param page_size: The desired size of the page to be returned. Defaults to 1,000. See [page sizes](https://palantir.com/docs/foundry/api/general/overview/paging/#page-sizes) for details. + :type page_size: Optional[PageSize] + :param page_token: + :type page_token: Optional[PageToken] + :param select: The properties of the interface type that should be included in the response. Omit this parameter to get all the properties. + :type select: Optional[List[SelectedPropertyApiName]] + :param snapshot: A flag to use snapshot consistency when paging. Setting this to true will give you a consistent view from before you start paging through the results, ensuring you do not get duplicate or missing items. Setting this to false will let new results enter as you page, but you may encounter duplicate or missing items. This defaults to false if not specified, which means you will always get the latest results. + :type snapshot: Optional[bool] + :param request_timeout: timeout setting for this request in seconds. + :type request_timeout: Optional[int] + :return: Returns the result object. + :rtype: core.ResourceIterator[ontologies_models.OntologyObjectV2] + """ + + return self._api_client.call_api( + core.RequestInfo( + method="GET", + resource_path="/v2/ontologies/{ontology}/interfaces/{interfaceType}", + query_params={ + "branch": branch, + "excludeRid": exclude_rid, + "orderBy": order_by, + "pageSize": page_size, + "pageToken": page_token, + "select": select, + "snapshot": snapshot, + }, + path_params={ + "ontology": ontology, + "interfaceType": interface_type, + }, + header_params={ + "Accept": "application/json", + }, + body=None, + body_type=None, + response_type=ontologies_models.ListObjectsForInterfaceResponse, + request_timeout=request_timeout, + throwable_errors={}, + response_mode=_sdk_internal.get("response_mode", "ITERATOR"), + ), + ) + @core.maybe_ignore_preview @pydantic.validate_call @errors.handle_unexpected @@ -506,6 +592,7 @@ def aggregate(_: ontologies_models.AggregateObjectsResponseV2): ... def get(_: ontologies_models.InterfaceType): ... def get_outgoing_interface_link_type(_: ontologies_models.InterfaceLinkType): ... def list(_: ontologies_models.ListInterfaceTypesResponse): ... + def list_objects_for_interface(_: ontologies_models.ListObjectsForInterfaceResponse): ... def list_outgoing_interface_link_types( _: ontologies_models.ListOutgoingInterfaceLinkTypesResponse, ): ... @@ -517,6 +604,9 @@ def search(_: ontologies_models.SearchObjectsResponseV2): ... get_outgoing_interface_link_type, client.get_outgoing_interface_link_type ) self.list = core.with_raw_response(list, client.list) + self.list_objects_for_interface = core.with_raw_response( + list_objects_for_interface, client.list_objects_for_interface + ) self.list_outgoing_interface_link_types = core.with_raw_response( list_outgoing_interface_link_types, client.list_outgoing_interface_link_types ) @@ -529,6 +619,7 @@ def aggregate(_: ontologies_models.AggregateObjectsResponseV2): ... def get(_: ontologies_models.InterfaceType): ... def get_outgoing_interface_link_type(_: ontologies_models.InterfaceLinkType): ... def list(_: ontologies_models.ListInterfaceTypesResponse): ... + def list_objects_for_interface(_: ontologies_models.ListObjectsForInterfaceResponse): ... def list_outgoing_interface_link_types( _: ontologies_models.ListOutgoingInterfaceLinkTypesResponse, ): ... @@ -540,6 +631,9 @@ def search(_: ontologies_models.SearchObjectsResponseV2): ... get_outgoing_interface_link_type, client.get_outgoing_interface_link_type ) self.list = core.with_streaming_response(list, client.list) + self.list_objects_for_interface = core.with_streaming_response( + list_objects_for_interface, client.list_objects_for_interface + ) self.list_outgoing_interface_link_types = core.with_streaming_response( list_outgoing_interface_link_types, client.list_outgoing_interface_link_types ) @@ -823,6 +917,92 @@ def list( ), ) + @core.maybe_ignore_preview + @pydantic.validate_call + @errors.handle_unexpected + def list_objects_for_interface( + self, + ontology: ontologies_models.OntologyIdentifier, + interface_type: ontologies_models.InterfaceTypeApiName, + *, + branch: typing.Optional[core_models.FoundryBranch] = None, + exclude_rid: typing.Optional[bool] = None, + order_by: typing.Optional[ontologies_models.OrderBy] = None, + page_size: typing.Optional[core_models.PageSize] = None, + page_token: typing.Optional[core_models.PageToken] = None, + select: typing.Optional[typing.List[ontologies_models.SelectedPropertyApiName]] = None, + snapshot: typing.Optional[bool] = None, + request_timeout: typing.Optional[core.Timeout] = None, + _sdk_internal: core.SdkInternal = {}, + ) -> core.AsyncResourceIterator[ontologies_models.OntologyObjectV2]: + """ + Lists the objects for the given Ontology and interface type. + + Note that this endpoint does not guarantee consistency, unless you use the snapshot flag specified below. Changes to the data could result in missing or + repeated objects in the response pages. + + For Object Storage V1 backed objects, this endpoint returns a maximum of 10,000 objects. After 10,000 objects have been returned and if more objects + are available, attempting to load another page will result in an `ObjectsExceededLimit` error being returned. There is no limit on Object Storage V2 backed objects. + + Each page may be smaller or larger than the requested page size. However, it + is guaranteed that if there are more results available, at least one result will be present + in the response. + + Note that null value properties will not be returned. + + :param ontology: The API name of the ontology. To find the API name, use the **List ontologies** endpoint or check the **Ontology Manager**. + :type ontology: OntologyIdentifier + :param interface_type: The API name of the interface type. To find the API name, use the **List interface types** endpoint or check the **Ontology Manager**. + :type interface_type: InterfaceTypeApiName + :param branch: The Foundry branch to list objects from. If not specified, the default branch will be used. + :type branch: Optional[FoundryBranch] + :param exclude_rid: A flag to exclude the retrieval of the `__rid` property. Setting this to true may improve performance of this endpoint for object types in OSV2. + :type exclude_rid: Optional[bool] + :param order_by: + :type order_by: Optional[OrderBy] + :param page_size: The desired size of the page to be returned. Defaults to 1,000. See [page sizes](https://palantir.com/docs/foundry/api/general/overview/paging/#page-sizes) for details. + :type page_size: Optional[PageSize] + :param page_token: + :type page_token: Optional[PageToken] + :param select: The properties of the interface type that should be included in the response. Omit this parameter to get all the properties. + :type select: Optional[List[SelectedPropertyApiName]] + :param snapshot: A flag to use snapshot consistency when paging. Setting this to true will give you a consistent view from before you start paging through the results, ensuring you do not get duplicate or missing items. Setting this to false will let new results enter as you page, but you may encounter duplicate or missing items. This defaults to false if not specified, which means you will always get the latest results. + :type snapshot: Optional[bool] + :param request_timeout: timeout setting for this request in seconds. + :type request_timeout: Optional[int] + :return: Returns the result object. + :rtype: core.AsyncResourceIterator[ontologies_models.OntologyObjectV2] + """ + + return self._api_client.call_api( + core.RequestInfo( + method="GET", + resource_path="/v2/ontologies/{ontology}/interfaces/{interfaceType}", + query_params={ + "branch": branch, + "excludeRid": exclude_rid, + "orderBy": order_by, + "pageSize": page_size, + "pageToken": page_token, + "select": select, + "snapshot": snapshot, + }, + path_params={ + "ontology": ontology, + "interfaceType": interface_type, + }, + header_params={ + "Accept": "application/json", + }, + body=None, + body_type=None, + response_type=ontologies_models.ListObjectsForInterfaceResponse, + request_timeout=request_timeout, + throwable_errors={}, + response_mode=_sdk_internal.get("response_mode", "ITERATOR"), + ), + ) + @core.maybe_ignore_preview @pydantic.validate_call @errors.handle_unexpected @@ -1028,6 +1208,7 @@ def aggregate(_: ontologies_models.AggregateObjectsResponseV2): ... def get(_: ontologies_models.InterfaceType): ... def get_outgoing_interface_link_type(_: ontologies_models.InterfaceLinkType): ... def list(_: ontologies_models.ListInterfaceTypesResponse): ... + def list_objects_for_interface(_: ontologies_models.ListObjectsForInterfaceResponse): ... def list_outgoing_interface_link_types( _: ontologies_models.ListOutgoingInterfaceLinkTypesResponse, ): ... @@ -1039,6 +1220,9 @@ def search(_: ontologies_models.SearchObjectsResponseV2): ... get_outgoing_interface_link_type, client.get_outgoing_interface_link_type ) self.list = core.async_with_raw_response(list, client.list) + self.list_objects_for_interface = core.async_with_raw_response( + list_objects_for_interface, client.list_objects_for_interface + ) self.list_outgoing_interface_link_types = core.async_with_raw_response( list_outgoing_interface_link_types, client.list_outgoing_interface_link_types ) @@ -1051,6 +1235,7 @@ def aggregate(_: ontologies_models.AggregateObjectsResponseV2): ... def get(_: ontologies_models.InterfaceType): ... def get_outgoing_interface_link_type(_: ontologies_models.InterfaceLinkType): ... def list(_: ontologies_models.ListInterfaceTypesResponse): ... + def list_objects_for_interface(_: ontologies_models.ListObjectsForInterfaceResponse): ... def list_outgoing_interface_link_types( _: ontologies_models.ListOutgoingInterfaceLinkTypesResponse, ): ... @@ -1062,6 +1247,9 @@ def search(_: ontologies_models.SearchObjectsResponseV2): ... get_outgoing_interface_link_type, client.get_outgoing_interface_link_type ) self.list = core.async_with_streaming_response(list, client.list) + self.list_objects_for_interface = core.async_with_streaming_response( + list_objects_for_interface, client.list_objects_for_interface + ) self.list_outgoing_interface_link_types = core.async_with_streaming_response( list_outgoing_interface_link_types, client.list_outgoing_interface_link_types ) diff --git a/foundry_sdk/v2/ontologies/ontology_object_set.py b/foundry_sdk/v2/ontologies/ontology_object_set.py index 8ba0078d7..b1c8f1ea1 100644 --- a/foundry_sdk/v2/ontologies/ontology_object_set.py +++ b/foundry_sdk/v2/ontologies/ontology_object_set.py @@ -140,6 +140,8 @@ def create_temporary( ontology: ontologies_models.OntologyIdentifier, *, object_set: ontologies_models.ObjectSet, + sdk_package_rid: typing.Optional[ontologies_models.SdkPackageRid] = None, + sdk_version: typing.Optional[ontologies_models.SdkVersion] = None, request_timeout: typing.Optional[core.Timeout] = None, _sdk_internal: core.SdkInternal = {}, ) -> ontologies_models.CreateTemporaryObjectSetResponseV2: @@ -150,6 +152,10 @@ def create_temporary( :type ontology: OntologyIdentifier :param object_set: :type object_set: ObjectSet + :param sdk_package_rid: The package rid of the generated SDK. + :type sdk_package_rid: Optional[SdkPackageRid] + :param sdk_version: The package version of the generated SDK. + :type sdk_version: Optional[SdkVersion] :param request_timeout: timeout setting for this request in seconds. :type request_timeout: Optional[int] :return: Returns the result object. @@ -160,7 +166,10 @@ def create_temporary( core.RequestInfo( method="POST", resource_path="/v2/ontologies/{ontology}/objectSets/createTemporary", - query_params={}, + query_params={ + "sdkPackageRid": sdk_package_rid, + "sdkVersion": sdk_version, + }, path_params={ "ontology": ontology, }, @@ -734,6 +743,8 @@ def create_temporary( ontology: ontologies_models.OntologyIdentifier, *, object_set: ontologies_models.ObjectSet, + sdk_package_rid: typing.Optional[ontologies_models.SdkPackageRid] = None, + sdk_version: typing.Optional[ontologies_models.SdkVersion] = None, request_timeout: typing.Optional[core.Timeout] = None, _sdk_internal: core.SdkInternal = {}, ) -> typing.Awaitable[ontologies_models.CreateTemporaryObjectSetResponseV2]: @@ -744,6 +755,10 @@ def create_temporary( :type ontology: OntologyIdentifier :param object_set: :type object_set: ObjectSet + :param sdk_package_rid: The package rid of the generated SDK. + :type sdk_package_rid: Optional[SdkPackageRid] + :param sdk_version: The package version of the generated SDK. + :type sdk_version: Optional[SdkVersion] :param request_timeout: timeout setting for this request in seconds. :type request_timeout: Optional[int] :return: Returns the result object. @@ -754,7 +769,10 @@ def create_temporary( core.RequestInfo( method="POST", resource_path="/v2/ontologies/{ontology}/objectSets/createTemporary", - query_params={}, + query_params={ + "sdkPackageRid": sdk_package_rid, + "sdkVersion": sdk_version, + }, path_params={ "ontology": ontology, }, diff --git a/foundry_sdk/v2/orchestration/errors.py b/foundry_sdk/v2/orchestration/errors.py index 44df65291..11c9baf8c 100644 --- a/foundry_sdk/v2/orchestration/errors.py +++ b/foundry_sdk/v2/orchestration/errors.py @@ -201,6 +201,21 @@ class DeleteSchedulePermissionDenied(errors.PermissionDeniedError): error_instance_id: str +class GetAffectedResourcesSchedulePermissionDeniedParameters(typing_extensions.TypedDict): + """Could not getAffectedResources the Schedule.""" + + __pydantic_config__ = {"extra": "allow"} # type: ignore + + scheduleRid: core_models.ScheduleRid + + +@dataclass +class GetAffectedResourcesSchedulePermissionDenied(errors.PermissionDeniedError): + name: typing.Literal["GetAffectedResourcesSchedulePermissionDenied"] + parameters: GetAffectedResourcesSchedulePermissionDeniedParameters + error_instance_id: str + + class InvalidAndTriggerParameters(typing_extensions.TypedDict): """The AND trigger should have at least one value.""" @@ -518,6 +533,7 @@ class UnpauseSchedulePermissionDenied(errors.PermissionDeniedError): "CreateBuildPermissionDenied", "CreateSchedulePermissionDenied", "DeleteSchedulePermissionDenied", + "GetAffectedResourcesSchedulePermissionDenied", "InvalidAndTrigger", "InvalidMediaSetTrigger", "InvalidOrTrigger", diff --git a/foundry_sdk/v2/orchestration/models.py b/foundry_sdk/v2/orchestration/models.py index f19a1f53a..bb30a307c 100644 --- a/foundry_sdk/v2/orchestration/models.py +++ b/foundry_sdk/v2/orchestration/models.py @@ -47,6 +47,12 @@ class Action(core.ModelBase): notifications_enabled: NotificationsEnabled = pydantic.Field(alias=str("notificationsEnabled")) # type: ignore[literal-required] +class AffectedResourcesResponse(core.ModelBase): + """AffectedResourcesResponse""" + + datasets: typing.List[BuildableRid] + + class AndTrigger(core.ModelBase): """Trigger after all of the given triggers emit an event.""" @@ -75,6 +81,8 @@ class Build(core.ModelBase): retry_backoff_duration: RetryBackoffDuration = pydantic.Field(alias=str("retryBackoffDuration")) # type: ignore[literal-required] abort_on_failure: AbortOnFailure = pydantic.Field(alias=str("abortOnFailure")) # type: ignore[literal-required] status: BuildStatus + schedule_rid: typing.Optional[core_models.ScheduleRid] = pydantic.Field(alias=str("scheduleRid"), default=None) # type: ignore[literal-required] + """Schedule RID of the Schedule that triggered this build. If a user triggered the build, Schedule RID will be empty.""" BuildStatus = typing.Literal["RUNNING", "SUCCEEDED", "FAILED", "CANCELED"] @@ -710,6 +718,17 @@ class SearchBuildsResponse(core.ModelBase): next_page_token: typing.Optional[core_models.PageToken] = pydantic.Field(alias=str("nextPageToken"), default=None) # type: ignore[literal-required] +class TableUpdatedTrigger(core.ModelBase): + """ + Trigger whenever a new transaction is committed to the + table on the target branch. + """ + + table_rid: core_models.TableRid = pydantic.Field(alias=str("tableRid")) # type: ignore[literal-required] + branch_name: datasets_models.BranchName = pydantic.Field(alias=str("branchName")) # type: ignore[literal-required] + type: typing.Literal["tableUpdated"] = "tableUpdated" + + class TimeTrigger(core.ModelBase): """Trigger on a time based schedule.""" @@ -731,6 +750,7 @@ class TransactionalMediaSetJobOutput(core.ModelBase): JobSucceededTrigger, OrTrigger, NewLogicTrigger, + TableUpdatedTrigger, AndTrigger, DatasetUpdatedTrigger, ScheduleSucceededTrigger, @@ -791,6 +811,7 @@ class UserScope(core.ModelBase): __all__ = [ "AbortOnFailure", "Action", + "AffectedResourcesResponse", "AndTrigger", "Build", "BuildStatus", @@ -867,6 +888,7 @@ class UserScope(core.ModelBase): "SearchBuildsOrderByField", "SearchBuildsOrderByItem", "SearchBuildsResponse", + "TableUpdatedTrigger", "TimeTrigger", "TransactionalMediaSetJobOutput", "Trigger", diff --git a/foundry_sdk/v2/orchestration/schedule.py b/foundry_sdk/v2/orchestration/schedule.py index b3df9a5a7..cea904aff 100644 --- a/foundry_sdk/v2/orchestration/schedule.py +++ b/foundry_sdk/v2/orchestration/schedule.py @@ -217,6 +217,55 @@ def get( ), ) + @core.maybe_ignore_preview + @pydantic.validate_call + @errors.handle_unexpected + def get_affected_resources( + self, + schedule_rid: core_models.ScheduleRid, + *, + preview: typing.Optional[core_models.PreviewMode] = None, + request_timeout: typing.Optional[core.Timeout] = None, + _sdk_internal: core.SdkInternal = {}, + ) -> orchestration_models.AffectedResourcesResponse: + """ + + :param schedule_rid: + :type schedule_rid: ScheduleRid + :param preview: Enables the use of preview functionality. + :type preview: Optional[PreviewMode] + :param request_timeout: timeout setting for this request in seconds. + :type request_timeout: Optional[int] + :return: Returns the result object. + :rtype: orchestration_models.AffectedResourcesResponse + + :raises GetAffectedResourcesSchedulePermissionDenied: Could not getAffectedResources the Schedule. + """ + + return self._api_client.call_api( + core.RequestInfo( + method="POST", + resource_path="/v2/orchestration/schedules/{scheduleRid}/getAffectedResources", + query_params={ + "preview": preview, + }, + path_params={ + "scheduleRid": schedule_rid, + }, + header_params={ + "Accept": "application/json", + }, + body=None, + body_type=None, + response_type=orchestration_models.AffectedResourcesResponse, + request_timeout=request_timeout, + throwable_errors={ + "GetAffectedResourcesSchedulePermissionDenied": orchestration_errors.GetAffectedResourcesSchedulePermissionDenied, + }, + response_mode=_sdk_internal.get("response_mode"), + ), + ) + @core.maybe_ignore_preview @pydantic.validate_call @errors.handle_unexpected @@ -537,6 +586,7 @@ def __init__(self, client: ScheduleClient) -> None: def create(_: orchestration_models.Schedule): ... def delete(_: None): ... def get(_: orchestration_models.Schedule): ... + def get_affected_resources(_: orchestration_models.AffectedResourcesResponse): ... def get_batch(_: orchestration_models.GetSchedulesBatchResponse): ... def pause(_: None): ... def replace(_: orchestration_models.Schedule): ... @@ -547,6 +597,9 @@ def unpause(_: None): ... self.create = core.with_raw_response(create, client.create) self.delete = core.with_raw_response(delete, client.delete) self.get = core.with_raw_response(get, client.get) + self.get_affected_resources = core.with_raw_response( + get_affected_resources, client.get_affected_resources + ) self.get_batch = core.with_raw_response(get_batch, client.get_batch) self.pause = core.with_raw_response(pause, client.pause) self.replace = core.with_raw_response(replace, client.replace) @@ -559,6 +612,7 @@ class _ScheduleClientStreaming: def __init__(self, client: ScheduleClient) -> None: def create(_: orchestration_models.Schedule): ... def get(_: orchestration_models.Schedule): ... + def get_affected_resources(_: orchestration_models.AffectedResourcesResponse): ... def get_batch(_: orchestration_models.GetSchedulesBatchResponse): ... def replace(_: orchestration_models.Schedule): ... def run(_: orchestration_models.ScheduleRun): ... @@ -566,6 +620,9 @@ def runs(_: orchestration_models.ListRunsOfScheduleResponse): ... self.create = core.with_streaming_response(create, client.create) self.get = core.with_streaming_response(get, client.get) + self.get_affected_resources = core.with_streaming_response( + get_affected_resources, client.get_affected_resources + ) self.get_batch = core.with_streaming_response(get_batch, client.get_batch) self.replace = core.with_streaming_response(replace, client.replace) self.run = core.with_streaming_response(run, client.run) @@ -763,6 +820,55 @@ def get( ), ) + @core.maybe_ignore_preview + @pydantic.validate_call + @errors.handle_unexpected + def get_affected_resources( + self, + schedule_rid: core_models.ScheduleRid, + *, + preview: typing.Optional[core_models.PreviewMode] = None, + request_timeout: typing.Optional[core.Timeout] = None, + _sdk_internal: core.SdkInternal = {}, + ) -> typing.Awaitable[orchestration_models.AffectedResourcesResponse]: + """ + + :param schedule_rid: + :type schedule_rid: ScheduleRid + :param preview: Enables the use of preview functionality. + :type preview: Optional[PreviewMode] + :param request_timeout: timeout setting for this request in seconds. + :type request_timeout: Optional[int] + :return: Returns the result object. + :rtype: typing.Awaitable[orchestration_models.AffectedResourcesResponse] + + :raises GetAffectedResourcesSchedulePermissionDenied: Could not getAffectedResources the Schedule. + """ + + return self._api_client.call_api( + core.RequestInfo( + method="POST", + resource_path="/v2/orchestration/schedules/{scheduleRid}/getAffectedResources", + query_params={ + "preview": preview, + }, + path_params={ + "scheduleRid": schedule_rid, + }, + header_params={ + "Accept": "application/json", + }, + body=None, + body_type=None, + response_type=orchestration_models.AffectedResourcesResponse, + request_timeout=request_timeout, + throwable_errors={ + "GetAffectedResourcesSchedulePermissionDenied": orchestration_errors.GetAffectedResourcesSchedulePermissionDenied, + }, + response_mode=_sdk_internal.get("response_mode"), + ), + ) + @core.maybe_ignore_preview @pydantic.validate_call @errors.handle_unexpected @@ -1083,6 +1189,7 @@ def __init__(self, client: AsyncScheduleClient) -> None: def create(_: orchestration_models.Schedule): ... def delete(_: None): ... def get(_: orchestration_models.Schedule): ... + def get_affected_resources(_: orchestration_models.AffectedResourcesResponse): ... def get_batch(_: orchestration_models.GetSchedulesBatchResponse): ... def pause(_: None): ... def replace(_: orchestration_models.Schedule): ... @@ -1093,6 +1200,9 @@ def unpause(_: None): ... self.create = core.async_with_raw_response(create, client.create) self.delete = core.async_with_raw_response(delete, client.delete) self.get = core.async_with_raw_response(get, client.get) + self.get_affected_resources = core.async_with_raw_response( + get_affected_resources, client.get_affected_resources + ) self.get_batch = core.async_with_raw_response(get_batch, client.get_batch) self.pause = core.async_with_raw_response(pause, client.pause) self.replace = core.async_with_raw_response(replace, client.replace) @@ -1105,6 +1215,7 @@ class _AsyncScheduleClientStreaming: def __init__(self, client: AsyncScheduleClient) -> None: def create(_: orchestration_models.Schedule): ... def get(_: orchestration_models.Schedule): ... + def get_affected_resources(_: orchestration_models.AffectedResourcesResponse): ... def get_batch(_: orchestration_models.GetSchedulesBatchResponse): ... def replace(_: orchestration_models.Schedule): ... def run(_: orchestration_models.ScheduleRun): ... @@ -1112,6 +1223,9 @@ def runs(_: orchestration_models.ListRunsOfScheduleResponse): ... self.create = core.async_with_streaming_response(create, client.create) self.get = core.async_with_streaming_response(get, client.get) + self.get_affected_resources = core.async_with_streaming_response( + get_affected_resources, client.get_affected_resources + ) self.get_batch = core.async_with_streaming_response(get_batch, client.get_batch) self.replace = core.async_with_streaming_response(replace, client.replace) self.run = core.async_with_streaming_response(run, client.run) diff --git a/pyproject.toml b/pyproject.toml index 4c047ccbc..060d5e615 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,6 +27,10 @@ fastapi = ">=0.115.6" [tool.poetry.extras] cli = ["click"] +pandas = ["pandas", "pyarrow"] +polars = ["polars", "pyarrow"] +pyarrow = ["pyarrow"] +duckdb = ["duckdb", "pyarrow"] [tool.black] line_length = 100 diff --git a/tests/test_api_client.py b/tests/test_api_client.py index c1de20c45..fcfb92652 100644 --- a/tests/test_api_client.py +++ b/tests/test_api_client.py @@ -529,7 +529,7 @@ def test_response_decode_bytes(): assert response.decode() == b"foo" -def test_response_decode_optional_bytes(): +def test_response_decode_present_optional_bytes(): response = ApiResponse( RequestInfo.with_defaults("GET", "/foo/bar", response_type=Optional[bytes]), httpx.Response(200, content=b"foo"), @@ -538,6 +538,15 @@ def test_response_decode_optional_bytes(): assert response.decode() == b"foo" +def test_response_decode_empty_optional_bytes(): + response = ApiResponse( + RequestInfo.with_defaults("GET", "/foo/bar", response_type=Optional[bytes]), + httpx.Response(200, content=b""), + ) + + assert response.decode() is None + + @pytest.mark.asyncio(scope="session") async def test_async_headers(): client = create_async_mock_client() diff --git a/tox.ini b/tox.ini index 6adddb3dc..0ab32e3e8 100644 --- a/tox.ini +++ b/tox.ini @@ -10,6 +10,9 @@ deps = httpx=={env:HTTPX_VERSION} pyright click + polars + duckdb + pyarrow annotated-types>=0.7.0,<1.0.0 typing-extensions>=4.7.1,<5.0.0 expects>=0.9.0