Skip to content

Commit b3d42a1

Browse files
Excavator: Upgrade API Version (#223)
1 parent 327d222 commit b3d42a1

40 files changed

+1412
-4330
lines changed

README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,35 @@ with open("result.png", "wb") as f:
435435

436436
<a id="static-types"></a>
437437
## Static type analysis
438+
439+
### Hashable Models
440+
441+
All model objects in the SDK can be used as dictionary keys or set members. This provides several benefits:
442+
443+
```python
444+
# Example: Using models as dictionary keys
445+
from foundry_sdk import FoundryClient
446+
447+
client = FoundryClient(...)
448+
file1 = client.datasets.Dataset.File.get(dataset_rid="ri.foundry.main.dataset.123", file_path="/data.csv")
449+
file2 = client.datasets.Dataset.File.get(dataset_rid="ri.foundry.main.dataset.123", file_path="/data.csv")
450+
451+
# Models with the same content are equal and have the same hash
452+
assert file1 == file2
453+
assert hash(file1) == hash(file2)
454+
455+
# Use models as dictionary keys
456+
file_metadata = {}
457+
file_metadata[file1] = {"last_modified": "2024-08-09"}
458+
459+
# Can look up using any equivalent object
460+
assert file_metadata[file2] == {"last_modified": "2024-08-09"}
461+
```
462+
463+
**Note:** Models remain mutable for backward compatibility. If you modify a model after using it as a dictionary key,
464+
the system will issue a warning and the model's hash value will be reset. Although allowed, mutating models and using
465+
their hash values is not recommended as it can lead to unexpected behavior when using them in dictionaries or sets.
466+
438467
This library uses [Pydantic](https://docs.pydantic.dev) for creating and validating data models which you will see in the
439468
method definitions (see [Documentation for Models](#models-link) below for a full list of models).
440469
All request parameters and responses with nested fields are typed using a Pydantic
@@ -1255,10 +1284,13 @@ Namespace | Name | Import |
12551284
**Filesystem** | [SpaceRid](docs/v2/Filesystem/models/SpaceRid.md) | `from foundry_sdk.v2.filesystem.models import SpaceRid` |
12561285
**Filesystem** | [TrashStatus](docs/v2/Filesystem/models/TrashStatus.md) | `from foundry_sdk.v2.filesystem.models import TrashStatus` |
12571286
**Filesystem** | [UsageAccountRid](docs/v2/Filesystem/models/UsageAccountRid.md) | `from foundry_sdk.v2.filesystem.models import UsageAccountRid` |
1287+
**Functions** | [ArrayConstraint](docs/v2/Functions/models/ArrayConstraint.md) | `from foundry_sdk.v2.functions.models import ArrayConstraint` |
12581288
**Functions** | [DataValue](docs/v2/Functions/models/DataValue.md) | `from foundry_sdk.v2.functions.models import DataValue` |
1289+
**Functions** | [EnumConstraint](docs/v2/Functions/models/EnumConstraint.md) | `from foundry_sdk.v2.functions.models import EnumConstraint` |
12591290
**Functions** | [ExecuteQueryResponse](docs/v2/Functions/models/ExecuteQueryResponse.md) | `from foundry_sdk.v2.functions.models import ExecuteQueryResponse` |
12601291
**Functions** | [FunctionRid](docs/v2/Functions/models/FunctionRid.md) | `from foundry_sdk.v2.functions.models import FunctionRid` |
12611292
**Functions** | [FunctionVersion](docs/v2/Functions/models/FunctionVersion.md) | `from foundry_sdk.v2.functions.models import FunctionVersion` |
1293+
**Functions** | [LengthConstraint](docs/v2/Functions/models/LengthConstraint.md) | `from foundry_sdk.v2.functions.models import LengthConstraint` |
12621294
**Functions** | [Parameter](docs/v2/Functions/models/Parameter.md) | `from foundry_sdk.v2.functions.models import Parameter` |
12631295
**Functions** | [ParameterId](docs/v2/Functions/models/ParameterId.md) | `from foundry_sdk.v2.functions.models import ParameterId` |
12641296
**Functions** | [Query](docs/v2/Functions/models/Query.md) | `from foundry_sdk.v2.functions.models import Query` |
@@ -1274,11 +1306,18 @@ Namespace | Name | Import |
12741306
**Functions** | [QueryStructField](docs/v2/Functions/models/QueryStructField.md) | `from foundry_sdk.v2.functions.models import QueryStructField` |
12751307
**Functions** | [QueryStructType](docs/v2/Functions/models/QueryStructType.md) | `from foundry_sdk.v2.functions.models import QueryStructType` |
12761308
**Functions** | [QueryUnionType](docs/v2/Functions/models/QueryUnionType.md) | `from foundry_sdk.v2.functions.models import QueryUnionType` |
1309+
**Functions** | [RangesConstraint](docs/v2/Functions/models/RangesConstraint.md) | `from foundry_sdk.v2.functions.models import RangesConstraint` |
1310+
**Functions** | [RegexConstraint](docs/v2/Functions/models/RegexConstraint.md) | `from foundry_sdk.v2.functions.models import RegexConstraint` |
1311+
**Functions** | [RidConstraint](docs/v2/Functions/models/RidConstraint.md) | `from foundry_sdk.v2.functions.models import RidConstraint` |
1312+
**Functions** | [StructConstraint](docs/v2/Functions/models/StructConstraint.md) | `from foundry_sdk.v2.functions.models import StructConstraint` |
1313+
**Functions** | [StructFieldApiName](docs/v2/Functions/models/StructFieldApiName.md) | `from foundry_sdk.v2.functions.models import StructFieldApiName` |
12771314
**Functions** | [StructFieldName](docs/v2/Functions/models/StructFieldName.md) | `from foundry_sdk.v2.functions.models import StructFieldName` |
12781315
**Functions** | [ThreeDimensionalAggregation](docs/v2/Functions/models/ThreeDimensionalAggregation.md) | `from foundry_sdk.v2.functions.models import ThreeDimensionalAggregation` |
12791316
**Functions** | [TwoDimensionalAggregation](docs/v2/Functions/models/TwoDimensionalAggregation.md) | `from foundry_sdk.v2.functions.models import TwoDimensionalAggregation` |
1317+
**Functions** | [UuidConstraint](docs/v2/Functions/models/UuidConstraint.md) | `from foundry_sdk.v2.functions.models import UuidConstraint` |
12801318
**Functions** | [ValueType](docs/v2/Functions/models/ValueType.md) | `from foundry_sdk.v2.functions.models import ValueType` |
12811319
**Functions** | [ValueTypeApiName](docs/v2/Functions/models/ValueTypeApiName.md) | `from foundry_sdk.v2.functions.models import ValueTypeApiName` |
1320+
**Functions** | [ValueTypeConstraint](docs/v2/Functions/models/ValueTypeConstraint.md) | `from foundry_sdk.v2.functions.models import ValueTypeConstraint` |
12821321
**Functions** | [ValueTypeDataType](docs/v2/Functions/models/ValueTypeDataType.md) | `from foundry_sdk.v2.functions.models import ValueTypeDataType` |
12831322
**Functions** | [ValueTypeDataTypeArrayType](docs/v2/Functions/models/ValueTypeDataTypeArrayType.md) | `from foundry_sdk.v2.functions.models import ValueTypeDataTypeArrayType` |
12841323
**Functions** | [ValueTypeDataTypeBinaryType](docs/v2/Functions/models/ValueTypeDataTypeBinaryType.md) | `from foundry_sdk.v2.functions.models import ValueTypeDataTypeBinaryType` |
@@ -2389,6 +2428,7 @@ Namespace | Name | Import |
23892428
**Ontologies** | PropertyBaseTypeNotSupported | `from foundry_sdk.v2.ontologies.errors import PropertyBaseTypeNotSupported` |
23902429
**Ontologies** | PropertyFiltersNotSupported | `from foundry_sdk.v2.ontologies.errors import PropertyFiltersNotSupported` |
23912430
**Ontologies** | PropertyNotFound | `from foundry_sdk.v2.ontologies.errors import PropertyNotFound` |
2431+
**Ontologies** | PropertyNotFoundOnObject | `from foundry_sdk.v2.ontologies.errors import PropertyNotFoundOnObject` |
23922432
**Ontologies** | PropertyTypeDoesNotSupportNearestNeighbors | `from foundry_sdk.v2.ontologies.errors import PropertyTypeDoesNotSupportNearestNeighbors` |
23932433
**Ontologies** | PropertyTypeNotFound | `from foundry_sdk.v2.ontologies.errors import PropertyTypeNotFound` |
23942434
**Ontologies** | PropertyTypeRidNotFound | `from foundry_sdk.v2.ontologies.errors import PropertyTypeRidNotFound` |
@@ -2623,6 +2663,7 @@ Namespace | Name | Import |
26232663
**Ontologies** | PropertyBaseTypeNotSupported | `from foundry_sdk.v1.ontologies.errors import PropertyBaseTypeNotSupported` |
26242664
**Ontologies** | PropertyFiltersNotSupported | `from foundry_sdk.v1.ontologies.errors import PropertyFiltersNotSupported` |
26252665
**Ontologies** | PropertyNotFound | `from foundry_sdk.v1.ontologies.errors import PropertyNotFound` |
2666+
**Ontologies** | PropertyNotFoundOnObject | `from foundry_sdk.v1.ontologies.errors import PropertyNotFoundOnObject` |
26262667
**Ontologies** | PropertyTypeDoesNotSupportNearestNeighbors | `from foundry_sdk.v1.ontologies.errors import PropertyTypeDoesNotSupportNearestNeighbors` |
26272668
**Ontologies** | PropertyTypeNotFound | `from foundry_sdk.v1.ontologies.errors import PropertyTypeNotFound` |
26282669
**Ontologies** | PropertyTypeRidNotFound | `from foundry_sdk.v1.ontologies.errors import PropertyTypeRidNotFound` |

docs-snippets-npm/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"sls": {
2525
"dependencies": {
2626
"com.palantir.foundry.api:api-gateway": {
27-
"minVersion": "1.1254.0",
27+
"minVersion": "1.1261.0",
2828
"maxVersion": "1.x.x",
2929
"optional": false
3030
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# ArrayConstraint
2+
3+
ArrayConstraint
4+
5+
## Properties
6+
| Name | Type | Required | Description |
7+
| ------------ | ------------- | ------------- | ------------- |
8+
**minimum_size** | Optional[int] | No | |
9+
**maximum_size** | Optional[int] | No | |
10+
**unique_values** | bool | Yes | |
11+
**value_constraint** | Optional[ValueTypeConstraint] | No | |
12+
**type** | Literal["array"] | Yes | None |
13+
14+
15+
[[Back to Model list]](../../../../README.md#models-v2-link) [[Back to API list]](../../../../README.md#apis-v2-link) [[Back to README]](../../../../README.md)
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# EnumConstraint
2+
3+
EnumConstraint
4+
5+
## Properties
6+
| Name | Type | Required | Description |
7+
| ------------ | ------------- | ------------- | ------------- |
8+
**options** | List[Any] | Yes | |
9+
**type** | Literal["enum"] | Yes | None |
10+
11+
12+
[[Back to Model list]](../../../../README.md#models-v2-link) [[Back to API list]](../../../../README.md#apis-v2-link) [[Back to README]](../../../../README.md)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# LengthConstraint
2+
3+
LengthConstraint
4+
5+
## Properties
6+
| Name | Type | Required | Description |
7+
| ------------ | ------------- | ------------- | ------------- |
8+
**minimum_length** | Optional[int] | No | |
9+
**maximum_length** | Optional[int] | No | |
10+
**type** | Literal["length"] | Yes | None |
11+
12+
13+
[[Back to Model list]](../../../../README.md#models-v2-link) [[Back to API list]](../../../../README.md#apis-v2-link) [[Back to README]](../../../../README.md)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# RangesConstraint
2+
3+
RangesConstraint
4+
5+
## Properties
6+
| Name | Type | Required | Description |
7+
| ------------ | ------------- | ------------- | ------------- |
8+
**minimum_value** | Optional[Any] | No | |
9+
**maximum_value** | Optional[Any] | No | |
10+
**type** | Literal["range"] | Yes | None |
11+
12+
13+
[[Back to Model list]](../../../../README.md#models-v2-link) [[Back to API list]](../../../../README.md#apis-v2-link) [[Back to README]](../../../../README.md)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# RegexConstraint
2+
3+
RegexConstraint
4+
5+
## Properties
6+
| Name | Type | Required | Description |
7+
| ------------ | ------------- | ------------- | ------------- |
8+
**pattern** | str | Yes | |
9+
**partial_match** | bool | Yes | |
10+
**type** | Literal["regex"] | Yes | None |
11+
12+
13+
[[Back to Model list]](../../../../README.md#models-v2-link) [[Back to API list]](../../../../README.md#apis-v2-link) [[Back to README]](../../../../README.md)
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# RidConstraint
2+
3+
RidConstraint
4+
5+
## Properties
6+
| Name | Type | Required | Description |
7+
| ------------ | ------------- | ------------- | ------------- |
8+
**type** | Literal["rid"] | Yes | None |
9+
10+
11+
[[Back to Model list]](../../../../README.md#models-v2-link) [[Back to API list]](../../../../README.md#apis-v2-link) [[Back to README]](../../../../README.md)
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# StructConstraint
2+
3+
StructConstraint
4+
5+
## Properties
6+
| Name | Type | Required | Description |
7+
| ------------ | ------------- | ------------- | ------------- |
8+
**fields** | Dict[StructFieldApiName, ValueTypeApiName] | Yes | |
9+
**type** | Literal["struct"] | Yes | None |
10+
11+
12+
[[Back to Model list]](../../../../README.md#models-v2-link) [[Back to API list]](../../../../README.md#apis-v2-link) [[Back to README]](../../../../README.md)
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# StructFieldApiName
2+
3+
StructFieldApiName
4+
5+
## Type
6+
```python
7+
str
8+
```
9+
10+
11+
[[Back to Model list]](../../../../README.md#models-v2-link) [[Back to API list]](../../../../README.md#apis-v2-link) [[Back to README]](../../../../README.md)

0 commit comments

Comments
 (0)