MCPcopy Create free account
hub / github.com/Keeper-Security/Commander / data

Method data

keepercommander/keeper_dag/struct/default.py:40–72  ·  view source on GitHub ↗
(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)

Source from the content-addressed store, hash-verified

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,

Callers 1

_add_dataMethod · 0.45

Calls 3

bytes_to_strFunction · 0.85
DAGDataClass · 0.85
RefClass · 0.85

Tested by

no test coverage detected