(self,
data_type: EdgeType,
tail_uid: str,
content: Optional[bytes] = None,
head_uid: Optional[str] = None,
tail_name: Optional[str] = None,
head_name: Optional[str] = None,
tail_ref_type: Optional[RefType] = None,
head_ref_type: Optional[RefType] = None,
path: Optional[str] = None)
| 38 | ) |
| 39 | |
| 40 | def data(self, |
| 41 | data_type: EdgeType, |
| 42 | tail_uid: str, |
| 43 | content: Optional[bytes] = None, |
| 44 | head_uid: Optional[str] = None, |
| 45 | tail_name: Optional[str] = None, |
| 46 | head_name: Optional[str] = None, |
| 47 | tail_ref_type: Optional[RefType] = None, |
| 48 | head_ref_type: Optional[RefType] = None, |
| 49 | path: Optional[str] = None) -> DAGData: |
| 50 | |
| 51 | if content is not None: |
| 52 | content = bytes_to_str(content) |
| 53 | |
| 54 | return DAGData( |
| 55 | type=data_type, |
| 56 | content=content, |
| 57 | # tail point at this vertex, so it uses this vertex's uid. |
| 58 | ref=Ref( |
| 59 | type=tail_ref_type, |
| 60 | value=tail_uid, |
| 61 | name=tail_name |
| 62 | ), |
| 63 | # Head, the arrowhead, points at the vertex this vertex belongs to, the parent. |
| 64 | # Apparently, for DATA edges, the parentRef is allowed to be None. |
| 65 | # Doesn't hurt to send it. |
| 66 | parentRef=Ref( |
| 67 | type=head_ref_type, |
| 68 | value=head_uid, |
| 69 | name=head_name |
| 70 | ), |
| 71 | path=path |
| 72 | ) |
| 73 | |
| 74 | @staticmethod |
| 75 | def payload(origin_ref: Ref, |
no test coverage detected