forked from webflow/webflow-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnode.py
More file actions
77 lines (59 loc) · 2.87 KB
/
Copy pathnode.py
File metadata and controls
77 lines (59 loc) · 2.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# This file was auto-generated by Fern from our API Definition.
from __future__ import annotations
from ..core.pydantic_utilities import UniversalBaseModel
import typing
from .text_node_text import TextNodeText
from ..core.pydantic_utilities import IS_PYDANTIC_V2
import pydantic
from .image_node_image import ImageNodeImage
import typing_extensions
from ..core.serialization import FieldMetadata
from .component_property import ComponentProperty
class Node_Text(UniversalBaseModel):
"""
A generic representation of a content element within the Document Object Model (DOM). Each node has a unique identifier and a specific type that determines its content structure and attributes.
"""
type: typing.Literal["text"] = "text"
id: typing.Optional[str] = None
text: typing.Optional[TextNodeText] = None
attributes: typing.Optional[typing.Dict[str, str]] = None
if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
else:
class Config:
frozen = True
smart_union = True
extra = pydantic.Extra.allow
class Node_Image(UniversalBaseModel):
"""
A generic representation of a content element within the Document Object Model (DOM). Each node has a unique identifier and a specific type that determines its content structure and attributes.
"""
type: typing.Literal["image"] = "image"
id: typing.Optional[str] = None
image: typing.Optional[ImageNodeImage] = None
attributes: typing.Optional[typing.Dict[str, str]] = None
if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
else:
class Config:
frozen = True
smart_union = True
extra = pydantic.Extra.allow
class Node_ComponentInstance(UniversalBaseModel):
"""
A generic representation of a content element within the Document Object Model (DOM). Each node has a unique identifier and a specific type that determines its content structure and attributes.
"""
type: typing.Literal["component-instance"] = "component-instance"
id: typing.Optional[str] = None
component_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="componentId")] = None
property_overrides: typing_extensions.Annotated[
typing.Optional[typing.List[ComponentProperty]], FieldMetadata(alias="propertyOverrides")
] = None
if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
else:
class Config:
frozen = True
smart_union = True
extra = pydantic.Extra.allow
Node = typing.Union[Node_Text, Node_Image, Node_ComponentInstance]