This property's Python type annotation.
(self)
| 228 | |
| 229 | @property |
| 230 | def py_annotation(self): |
| 231 | """This property's Python type annotation.""" |
| 232 | if self.items: |
| 233 | if self.items.ref: |
| 234 | py_ref = ref_to_python(self.items.ref) |
| 235 | ann = f"typing.List[{py_ref}]" |
| 236 | else: |
| 237 | ann = f"typing.List[{CdpPrimitiveType.get_annotation(self.items.type)}]" |
| 238 | else: |
| 239 | if self.ref: |
| 240 | py_ref = ref_to_python(self.ref) |
| 241 | ann = py_ref |
| 242 | else: |
| 243 | ann = CdpPrimitiveType.get_annotation(cast(str, self.type)) |
| 244 | if self.optional: |
| 245 | ann = f"typing.Optional[{ann}]" |
| 246 | return ann |
| 247 | |
| 248 | @classmethod |
| 249 | def from_json(cls, property): |
nothing calls this directly
no test coverage detected