Return all refs for this type.
(self)
| 463 | return code |
| 464 | |
| 465 | def get_refs(self): |
| 466 | """Return all refs for this type.""" |
| 467 | refs = set() |
| 468 | if self.enum: |
| 469 | # Enum types don't have refs. |
| 470 | pass |
| 471 | elif self.properties: |
| 472 | # Enumerate refs for a class type. |
| 473 | for prop in self.properties: |
| 474 | if prop.items and prop.items.ref: |
| 475 | refs.add(prop.items.ref) |
| 476 | elif prop.ref: |
| 477 | refs.add(prop.ref) |
| 478 | else: |
| 479 | # A primitive type can't have a direct ref, but it can have an items |
| 480 | # which contains a ref. |
| 481 | if self.items and self.items.ref: |
| 482 | refs.add(self.items.ref) |
| 483 | return refs |
| 484 | |
| 485 | |
| 486 | class CdpParameter(CdpProperty): |