|
50 | 50 | from .protocols_base import CoreNode, CoreNodeSync |
51 | 51 | from .queries import get_commit_update_mutation |
52 | 52 | from .query_groups import InfrahubGroupContext, InfrahubGroupContextSync |
53 | | -from .schema import InfrahubSchema, InfrahubSchemaSync, NodeSchema |
| 53 | +from .schema import InfrahubSchema, InfrahubSchemaSync, NodeSchemaAPI |
54 | 54 | from .store import NodeStore, NodeStoreSync |
55 | 55 | from .timestamp import Timestamp |
56 | 56 | from .types import AsyncRequester, HTTPMethod, SyncRequester |
@@ -448,12 +448,12 @@ async def get( |
448 | 448 | filters: MutableMapping[str, Any] = {} |
449 | 449 |
|
450 | 450 | if id: |
451 | | - if not is_valid_uuid(id) and isinstance(schema, NodeSchema) and schema.default_filter: |
| 451 | + if not is_valid_uuid(id) and isinstance(schema, NodeSchemaAPI) and schema.default_filter: |
452 | 452 | filters[schema.default_filter] = id |
453 | 453 | else: |
454 | 454 | filters["ids"] = [id] |
455 | 455 | if hfid: |
456 | | - if isinstance(schema, NodeSchema) and schema.human_friendly_id: |
| 456 | + if isinstance(schema, NodeSchemaAPI) and schema.human_friendly_id: |
457 | 457 | filters["hfid"] = hfid |
458 | 458 | else: |
459 | 459 | raise ValueError("Cannot filter by HFID if the node doesn't have an HFID defined") |
@@ -1916,12 +1916,12 @@ def get( |
1916 | 1916 | filters: MutableMapping[str, Any] = {} |
1917 | 1917 |
|
1918 | 1918 | if id: |
1919 | | - if not is_valid_uuid(id) and isinstance(schema, NodeSchema) and schema.default_filter: |
| 1919 | + if not is_valid_uuid(id) and isinstance(schema, NodeSchemaAPI) and schema.default_filter: |
1920 | 1920 | filters[schema.default_filter] = id |
1921 | 1921 | else: |
1922 | 1922 | filters["ids"] = [id] |
1923 | 1923 | if hfid: |
1924 | | - if isinstance(schema, NodeSchema) and schema.human_friendly_id: |
| 1924 | + if isinstance(schema, NodeSchemaAPI) and schema.human_friendly_id: |
1925 | 1925 | filters["hfid"] = hfid |
1926 | 1926 | else: |
1927 | 1927 | raise ValueError("Cannot filter by HFID if the node doesn't have an HFID defined") |
|
0 commit comments