|
| 1 | +# NOTE: This file is not generated from |
| 2 | +# https://github.com/buildingSMART/BCF-XML/blob/release_2_1/Extension%20Schemas/extensions.xsd |
| 3 | +# because in bcf 2.1 there is no extensions.xml - I guess, the schema assumes that each .bcf |
| 4 | +# will use their own schema patched by it's own extensions.xsd. |
| 5 | +# |
| 6 | +# To make things simpler we just mimic extensions structures from bcf 3, so they'll have common API, |
| 7 | +# and parse extensions.xsd inside .bcf as .xml and fill our structures. |
| 8 | +# |
| 9 | +# Preferably if we could generate some kind of extensions.xml from extensions.xsd |
| 10 | +# and leave all the handling to xsdata. |
| 11 | +# |
| 12 | +# We also don't add it to __init__.py not to mess with generator. |
| 13 | +# |
| 14 | +# Currently extensions support for v2 is only read-only. |
| 15 | + |
| 16 | + |
| 17 | +from dataclasses import dataclass, field, fields |
| 18 | +from typing import List, NamedTuple, Optional |
| 19 | + |
| 20 | + |
| 21 | +@dataclass(slots=True, kw_only=True) |
| 22 | +class ExtensionsPriorities: |
| 23 | + class Meta: |
| 24 | + global_type = False |
| 25 | + |
| 26 | + priority: List[str] = field( |
| 27 | + default_factory=list, |
| 28 | + metadata={ |
| 29 | + "name": "Priority", |
| 30 | + "type": "Element", |
| 31 | + "namespace": "", |
| 32 | + "min_length": 1, |
| 33 | + "white_space": "collapse", |
| 34 | + }, |
| 35 | + ) |
| 36 | + |
| 37 | + |
| 38 | +@dataclass(slots=True, kw_only=True) |
| 39 | +class ExtensionsSnippetTypes: |
| 40 | + class Meta: |
| 41 | + global_type = False |
| 42 | + |
| 43 | + snippet_type: List[str] = field( |
| 44 | + default_factory=list, |
| 45 | + metadata={ |
| 46 | + "name": "SnippetType", |
| 47 | + "type": "Element", |
| 48 | + "namespace": "", |
| 49 | + "min_length": 1, |
| 50 | + "white_space": "collapse", |
| 51 | + }, |
| 52 | + ) |
| 53 | + |
| 54 | + |
| 55 | +@dataclass(slots=True, kw_only=True) |
| 56 | +class ExtensionsStages: |
| 57 | + class Meta: |
| 58 | + global_type = False |
| 59 | + |
| 60 | + stage: List[str] = field( |
| 61 | + default_factory=list, |
| 62 | + metadata={ |
| 63 | + "name": "Stage", |
| 64 | + "type": "Element", |
| 65 | + "namespace": "", |
| 66 | + "min_length": 1, |
| 67 | + "white_space": "collapse", |
| 68 | + }, |
| 69 | + ) |
| 70 | + |
| 71 | + |
| 72 | +@dataclass(slots=True, kw_only=True) |
| 73 | +class ExtensionsTopicLabels: |
| 74 | + class Meta: |
| 75 | + global_type = False |
| 76 | + |
| 77 | + topic_label: List[str] = field( |
| 78 | + default_factory=list, |
| 79 | + metadata={ |
| 80 | + "name": "TopicLabel", |
| 81 | + "type": "Element", |
| 82 | + "namespace": "", |
| 83 | + "min_length": 1, |
| 84 | + "white_space": "collapse", |
| 85 | + }, |
| 86 | + ) |
| 87 | + |
| 88 | + |
| 89 | +@dataclass(slots=True, kw_only=True) |
| 90 | +class ExtensionsTopicStatuses: |
| 91 | + class Meta: |
| 92 | + global_type = False |
| 93 | + |
| 94 | + topic_status: List[str] = field( |
| 95 | + default_factory=list, |
| 96 | + metadata={ |
| 97 | + "name": "TopicStatus", |
| 98 | + "type": "Element", |
| 99 | + "namespace": "", |
| 100 | + "min_length": 1, |
| 101 | + "white_space": "collapse", |
| 102 | + }, |
| 103 | + ) |
| 104 | + |
| 105 | + |
| 106 | +@dataclass(slots=True, kw_only=True) |
| 107 | +class ExtensionsTopicTypes: |
| 108 | + class Meta: |
| 109 | + global_type = False |
| 110 | + |
| 111 | + topic_type: List[str] = field( |
| 112 | + default_factory=list, |
| 113 | + metadata={ |
| 114 | + "name": "TopicType", |
| 115 | + "type": "Element", |
| 116 | + "namespace": "", |
| 117 | + "min_length": 1, |
| 118 | + "white_space": "collapse", |
| 119 | + }, |
| 120 | + ) |
| 121 | + |
| 122 | + |
| 123 | +@dataclass(slots=True, kw_only=True) |
| 124 | +class ExtensionsUsers: |
| 125 | + class Meta: |
| 126 | + global_type = False |
| 127 | + |
| 128 | + user: List[str] = field( |
| 129 | + default_factory=list, |
| 130 | + metadata={ |
| 131 | + "name": "UserIdType", |
| 132 | + "type": "Element", |
| 133 | + "namespace": "", |
| 134 | + "min_length": 1, |
| 135 | + "white_space": "collapse", |
| 136 | + }, |
| 137 | + ) |
| 138 | + |
| 139 | + |
| 140 | +@dataclass(slots=True, kw_only=True) |
| 141 | +class Extensions: |
| 142 | + topic_types: Optional[ExtensionsTopicTypes] = field( |
| 143 | + default=None, |
| 144 | + metadata={ |
| 145 | + "name": "TopicTypes", |
| 146 | + "type": "Element", |
| 147 | + "namespace": "", |
| 148 | + }, |
| 149 | + ) |
| 150 | + topic_statuses: Optional[ExtensionsTopicStatuses] = field( |
| 151 | + default=None, |
| 152 | + metadata={ |
| 153 | + "name": "TopicStatuses", |
| 154 | + "type": "Element", |
| 155 | + "namespace": "", |
| 156 | + }, |
| 157 | + ) |
| 158 | + priorities: Optional[ExtensionsPriorities] = field( |
| 159 | + default=None, |
| 160 | + metadata={ |
| 161 | + "name": "Priorities", |
| 162 | + "type": "Element", |
| 163 | + "namespace": "", |
| 164 | + }, |
| 165 | + ) |
| 166 | + topic_labels: Optional[ExtensionsTopicLabels] = field( |
| 167 | + default=None, |
| 168 | + metadata={ |
| 169 | + "name": "TopicLabels", |
| 170 | + "type": "Element", |
| 171 | + "namespace": "", |
| 172 | + }, |
| 173 | + ) |
| 174 | + users: Optional[ExtensionsUsers] = field( |
| 175 | + default=None, |
| 176 | + metadata={ |
| 177 | + "name": "Users", |
| 178 | + "type": "Element", |
| 179 | + "namespace": "", |
| 180 | + }, |
| 181 | + ) |
| 182 | + snippet_types: Optional[ExtensionsSnippetTypes] = field( |
| 183 | + default=None, |
| 184 | + metadata={ |
| 185 | + "name": "SnippetTypes", |
| 186 | + "type": "Element", |
| 187 | + "namespace": "", |
| 188 | + }, |
| 189 | + ) |
| 190 | + stages: Optional[ExtensionsStages] = field( |
| 191 | + default=None, |
| 192 | + metadata={ |
| 193 | + "name": "Stages", |
| 194 | + "type": "Element", |
| 195 | + "namespace": "", |
| 196 | + }, |
| 197 | + ) |
0 commit comments