Skip to content

Commit 7f8d91b

Browse files
Excavator: Upgrade API Version (#146)
1 parent ccff944 commit 7f8d91b

File tree

11 files changed

+172
-11
lines changed

11 files changed

+172
-11
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1451,6 +1451,8 @@ Namespace | Name | Import |
14511451
**Ontologies** | [InterfaceLinkTypeLinkedEntityApiName](docs/v2/Ontologies/models/InterfaceLinkTypeLinkedEntityApiName.md) | `from foundry.v2.ontologies.models import InterfaceLinkTypeLinkedEntityApiName` |
14521452
**Ontologies** | [InterfaceLinkTypeLinkedEntityApiNameDict](docs/v2/Ontologies/models/InterfaceLinkTypeLinkedEntityApiNameDict.md) | `from foundry.v2.ontologies.models import InterfaceLinkTypeLinkedEntityApiNameDict` |
14531453
**Ontologies** | [InterfaceLinkTypeRid](docs/v2/Ontologies/models/InterfaceLinkTypeRid.md) | `from foundry.v2.ontologies.models import InterfaceLinkTypeRid` |
1454+
**Ontologies** | [InterfaceSharedPropertyType](docs/v2/Ontologies/models/InterfaceSharedPropertyType.md) | `from foundry.v2.ontologies.models import InterfaceSharedPropertyType` |
1455+
**Ontologies** | [InterfaceSharedPropertyTypeDict](docs/v2/Ontologies/models/InterfaceSharedPropertyTypeDict.md) | `from foundry.v2.ontologies.models import InterfaceSharedPropertyTypeDict` |
14541456
**Ontologies** | [InterfaceType](docs/v2/Ontologies/models/InterfaceType.md) | `from foundry.v2.ontologies.models import InterfaceType` |
14551457
**Ontologies** | [InterfaceTypeApiName](docs/v2/Ontologies/models/InterfaceTypeApiName.md) | `from foundry.v2.ontologies.models import InterfaceTypeApiName` |
14561458
**Ontologies** | [InterfaceTypeDict](docs/v2/Ontologies/models/InterfaceTypeDict.md) | `from foundry.v2.ontologies.models import InterfaceTypeDict` |
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# InterfaceSharedPropertyType
2+
3+
A shared property type with an additional field to indicate whether the property must be included on every
4+
object type that implements the interface, or whether it is optional.
5+
6+
7+
## Properties
8+
| Name | Type | Required | Description |
9+
| ------------ | ------------- | ------------- | ------------- |
10+
**rid** | SharedPropertyTypeRid | Yes | |
11+
**api_name** | SharedPropertyTypeApiName | Yes | |
12+
**display_name** | DisplayName | Yes | |
13+
**description** | Optional[str] | No | A short text that describes the SharedPropertyType. |
14+
**data_type** | ObjectPropertyType | Yes | |
15+
**required** | bool | Yes | Whether each implementing object type must declare an implementation for this property. |
16+
17+
18+
[[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: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# InterfaceSharedPropertyTypeDict
2+
3+
A shared property type with an additional field to indicate whether the property must be included on every
4+
object type that implements the interface, or whether it is optional.
5+
6+
7+
## Properties
8+
| Name | Type | Required | Description |
9+
| ------------ | ------------- | ------------- | ------------- |
10+
**rid** | SharedPropertyTypeRid | Yes | |
11+
**apiName** | SharedPropertyTypeApiName | Yes | |
12+
**displayName** | DisplayName | Yes | |
13+
**description** | NotRequired[str] | No | A short text that describes the SharedPropertyType. |
14+
**dataType** | ObjectPropertyTypeDict | Yes | |
15+
**required** | bool | Yes | Whether each implementing object type must declare an implementation for this property. |
16+
17+
18+
[[Back to Model list]](../../../../README.md#models-v2-link) [[Back to API list]](../../../../README.md#apis-v2-link) [[Back to README]](../../../../README.md)

docs/v2/Ontologies/models/InterfaceType.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ Represents an interface type in the Ontology.
99
**api_name** | InterfaceTypeApiName | Yes | |
1010
**display_name** | DisplayName | Yes | |
1111
**description** | Optional[str] | No | The description of the interface. |
12-
**properties** | Dict[SharedPropertyTypeApiName, SharedPropertyType] | Yes | A map from a shared property type API name to the corresponding shared property type. The map describes the set of properties the interface has. A shared property type must be unique across all of the properties. |
13-
**all_properties** | Dict[SharedPropertyTypeApiName, SharedPropertyType] | Yes | A map from a shared property type API name to the corresponding shared property type. The map describes the set of properties the interface has, including properties from all directly and indirectly extended interfaces. |
12+
**properties** | Dict[SharedPropertyTypeApiName, InterfaceSharedPropertyType] | Yes | A map from a shared property type API name to the corresponding shared property type. The map describes the set of properties the interface has. A shared property type must be unique across all of the properties. |
13+
**all_properties** | Dict[SharedPropertyTypeApiName, InterfaceSharedPropertyType] | Yes | A map from a shared property type API name to the corresponding shared property type. The map describes the set of properties the interface has, including properties from all directly and indirectly extended interfaces. |
1414
**extends_interfaces** | List[InterfaceTypeApiName] | Yes | A list of interface API names that this interface extends. An interface can extend other interfaces to inherit their properties. |
1515
**all_extends_interfaces** | List[InterfaceTypeApiName] | Yes | A list of interface API names that this interface extends, both directly and indirectly. |
1616
**implemented_by_object_types** | List[ObjectTypeApiName] | Yes | A list of object API names that implement this interface. |

docs/v2/Ontologies/models/InterfaceTypeDict.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ Represents an interface type in the Ontology.
99
**apiName** | InterfaceTypeApiName | Yes | |
1010
**displayName** | DisplayName | Yes | |
1111
**description** | NotRequired[str] | No | The description of the interface. |
12-
**properties** | Dict[SharedPropertyTypeApiName, SharedPropertyTypeDict] | Yes | A map from a shared property type API name to the corresponding shared property type. The map describes the set of properties the interface has. A shared property type must be unique across all of the properties. |
13-
**allProperties** | Dict[SharedPropertyTypeApiName, SharedPropertyTypeDict] | Yes | A map from a shared property type API name to the corresponding shared property type. The map describes the set of properties the interface has, including properties from all directly and indirectly extended interfaces. |
12+
**properties** | Dict[SharedPropertyTypeApiName, InterfaceSharedPropertyTypeDict] | Yes | A map from a shared property type API name to the corresponding shared property type. The map describes the set of properties the interface has. A shared property type must be unique across all of the properties. |
13+
**allProperties** | Dict[SharedPropertyTypeApiName, InterfaceSharedPropertyTypeDict] | Yes | A map from a shared property type API name to the corresponding shared property type. The map describes the set of properties the interface has, including properties from all directly and indirectly extended interfaces. |
1414
**extendsInterfaces** | List[InterfaceTypeApiName] | Yes | A list of interface API names that this interface extends. An interface can extend other interfaces to inherit their properties. |
1515
**allExtendsInterfaces** | List[InterfaceTypeApiName] | Yes | A list of interface API names that this interface extends, both directly and indirectly. |
1616
**implementedByObjectTypes** | List[ObjectTypeApiName] | Yes | A list of object API names that implement this interface. |

foundry/_versions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@
1717
# using the autorelease bot
1818
__version__ = "0.0.0"
1919

20-
__openapi_document_version__ = "1.1085.0"
20+
__openapi_document_version__ = "1.1087.0"

foundry/v2/ontologies/models/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,12 @@
293293
InterfaceLinkTypeLinkedEntityApiNameDict,
294294
) # NOQA
295295
from foundry.v2.ontologies.models._interface_link_type_rid import InterfaceLinkTypeRid
296+
from foundry.v2.ontologies.models._interface_shared_property_type import (
297+
InterfaceSharedPropertyType,
298+
) # NOQA
299+
from foundry.v2.ontologies.models._interface_shared_property_type_dict import (
300+
InterfaceSharedPropertyTypeDict,
301+
) # NOQA
296302
from foundry.v2.ontologies.models._interface_type import InterfaceType
297303
from foundry.v2.ontologies.models._interface_type_api_name import InterfaceTypeApiName
298304
from foundry.v2.ontologies.models._interface_type_dict import InterfaceTypeDict
@@ -960,6 +966,8 @@
960966
"InterfaceLinkTypeLinkedEntityApiName",
961967
"InterfaceLinkTypeLinkedEntityApiNameDict",
962968
"InterfaceLinkTypeRid",
969+
"InterfaceSharedPropertyType",
970+
"InterfaceSharedPropertyTypeDict",
963971
"InterfaceType",
964972
"InterfaceTypeApiName",
965973
"InterfaceTypeDict",
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Copyright 2024 Palantir Technologies, Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
16+
from __future__ import annotations
17+
18+
from typing import Optional
19+
from typing import cast
20+
21+
import pydantic
22+
23+
from foundry.v2.core.models._display_name import DisplayName
24+
from foundry.v2.ontologies.models._interface_shared_property_type_dict import (
25+
InterfaceSharedPropertyTypeDict,
26+
) # NOQA
27+
from foundry.v2.ontologies.models._object_property_type import ObjectPropertyType
28+
from foundry.v2.ontologies.models._shared_property_type_api_name import (
29+
SharedPropertyTypeApiName,
30+
) # NOQA
31+
from foundry.v2.ontologies.models._shared_property_type_rid import SharedPropertyTypeRid
32+
33+
34+
class InterfaceSharedPropertyType(pydantic.BaseModel):
35+
"""
36+
A shared property type with an additional field to indicate whether the property must be included on every
37+
object type that implements the interface, or whether it is optional.
38+
"""
39+
40+
rid: SharedPropertyTypeRid
41+
42+
api_name: SharedPropertyTypeApiName = pydantic.Field(alias=str("apiName")) # type: ignore[literal-required]
43+
44+
display_name: DisplayName = pydantic.Field(alias=str("displayName")) # type: ignore[literal-required]
45+
46+
description: Optional[str] = None
47+
48+
"""A short text that describes the SharedPropertyType."""
49+
50+
data_type: ObjectPropertyType = pydantic.Field(alias=str("dataType")) # type: ignore[literal-required]
51+
52+
required: bool
53+
54+
"""Whether each implementing object type must declare an implementation for this property."""
55+
56+
model_config = {"extra": "allow", "populate_by_name": True}
57+
58+
def to_dict(self) -> InterfaceSharedPropertyTypeDict:
59+
"""Return the dictionary representation of the model using the field aliases."""
60+
return cast(
61+
InterfaceSharedPropertyTypeDict, self.model_dump(by_alias=True, exclude_none=True)
62+
)
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Copyright 2024 Palantir Technologies, Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
16+
from __future__ import annotations
17+
18+
from typing_extensions import NotRequired
19+
from typing_extensions import TypedDict
20+
21+
from foundry.v2.core.models._display_name import DisplayName
22+
from foundry.v2.ontologies.models._object_property_type_dict import ObjectPropertyTypeDict # NOQA
23+
from foundry.v2.ontologies.models._shared_property_type_api_name import (
24+
SharedPropertyTypeApiName,
25+
) # NOQA
26+
from foundry.v2.ontologies.models._shared_property_type_rid import SharedPropertyTypeRid
27+
28+
29+
class InterfaceSharedPropertyTypeDict(TypedDict):
30+
"""
31+
A shared property type with an additional field to indicate whether the property must be included on every
32+
object type that implements the interface, or whether it is optional.
33+
"""
34+
35+
__pydantic_config__ = {"extra": "allow"} # type: ignore
36+
37+
rid: SharedPropertyTypeRid
38+
39+
apiName: SharedPropertyTypeApiName
40+
41+
displayName: DisplayName
42+
43+
description: NotRequired[str]
44+
"""A short text that describes the SharedPropertyType."""
45+
46+
dataType: ObjectPropertyTypeDict
47+
48+
required: bool
49+
"""Whether each implementing object type must declare an implementation for this property."""

foundry/v2/ontologies/models/_interface_type.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,13 @@
2727
from foundry.v2.ontologies.models._interface_link_type_api_name import (
2828
InterfaceLinkTypeApiName,
2929
) # NOQA
30+
from foundry.v2.ontologies.models._interface_shared_property_type import (
31+
InterfaceSharedPropertyType,
32+
) # NOQA
3033
from foundry.v2.ontologies.models._interface_type_api_name import InterfaceTypeApiName
3134
from foundry.v2.ontologies.models._interface_type_dict import InterfaceTypeDict
3235
from foundry.v2.ontologies.models._interface_type_rid import InterfaceTypeRid
3336
from foundry.v2.ontologies.models._object_type_api_name import ObjectTypeApiName
34-
from foundry.v2.ontologies.models._shared_property_type import SharedPropertyType
3537
from foundry.v2.ontologies.models._shared_property_type_api_name import (
3638
SharedPropertyTypeApiName,
3739
) # NOQA
@@ -50,14 +52,14 @@ class InterfaceType(pydantic.BaseModel):
5052

5153
"""The description of the interface."""
5254

53-
properties: Dict[SharedPropertyTypeApiName, SharedPropertyType]
55+
properties: Dict[SharedPropertyTypeApiName, InterfaceSharedPropertyType]
5456

5557
"""
5658
A map from a shared property type API name to the corresponding shared property type. The map describes the
5759
set of properties the interface has. A shared property type must be unique across all of the properties.
5860
"""
5961

60-
all_properties: Dict[SharedPropertyTypeApiName, SharedPropertyType] = pydantic.Field(alias=str("allProperties")) # type: ignore[literal-required]
62+
all_properties: Dict[SharedPropertyTypeApiName, InterfaceSharedPropertyType] = pydantic.Field(alias=str("allProperties")) # type: ignore[literal-required]
6163

6264
"""
6365
A map from a shared property type API name to the corresponding shared property type. The map describes the

0 commit comments

Comments
 (0)