Skip to content
This repository was archived by the owner on Dec 5, 2025. It is now read-only.

Commit 0a2f2b2

Browse files
authored
[client] Add note_types and likelihood property (#310)
1 parent 4e86a92 commit 0a2f2b2

File tree

6 files changed

+24
-0
lines changed

6 files changed

+24
-0
lines changed

pycti/entities/opencti_note.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ def __init__(self, opencti):
112112
attribute_abstract
113113
content
114114
authors
115+
note_types
116+
likelihood
115117
objects {
116118
edges {
117119
node {
@@ -425,6 +427,8 @@ def create(self, **kwargs):
425427
abstract = kwargs.get("abstract", None)
426428
content = kwargs.get("content", None)
427429
authors = kwargs.get("authors", None)
430+
note_types = kwargs.get("note_types", None)
431+
likelihood = kwargs.get("likelihood", None)
428432
x_opencti_stix_ids = kwargs.get("x_opencti_stix_ids", None)
429433
granted_refs = kwargs.get("objectOrganization", None)
430434
update = kwargs.get("update", False)
@@ -460,6 +464,8 @@ def create(self, **kwargs):
460464
"attribute_abstract": abstract,
461465
"content": content,
462466
"authors": authors,
467+
"note_types": note_types,
468+
"likelihood": likelihood,
463469
"x_opencti_stix_ids": x_opencti_stix_ids,
464470
"update": update,
465471
}
@@ -627,6 +633,12 @@ def import_from_stix2(self, **kwargs):
627633
if "x_opencti_stix_ids" in stix_object
628634
else None,
629635
authors=stix_object["authors"] if "authors" in stix_object else None,
636+
note_types=stix_object["note_types"]
637+
if "note_types" in stix_object
638+
else None,
639+
likelihood=stix_object["likelihood"]
640+
if "likelihood" in stix_object
641+
else None,
630642
objectOrganization=stix_object["granted_refs"]
631643
if "granted_refs" in stix_object
632644
else None,

pycti/entities/opencti_stix_core_object.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ def __init__(self, opencti):
133133
attribute_abstract
134134
content
135135
authors
136+
note_types
137+
likelihood
136138
}
137139
... on ObservedData {
138140
first_observed

pycti/entities/opencti_stix_cyber_observable.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2160,6 +2160,8 @@ def notes(self, **kwargs):
21602160
attribute_abstract
21612161
content
21622162
authors
2163+
note_types
2164+
likelihood
21632165
}
21642166
}
21652167
}

pycti/entities/opencti_stix_domain_object.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,8 @@ def __init__(self, opencti, file):
144144
attribute_abstract
145145
content
146146
authors
147+
note_types
148+
likelihood
147149
objects {
148150
edges {
149151
node {
@@ -1560,6 +1562,8 @@ def notes(self, **kwargs):
15601562
attribute_abstract
15611563
content
15621564
authors
1565+
note_types
1566+
likelihood
15631567
}
15641568
}
15651569
}

pycti/entities/opencti_stix_object_or_stix_relationship.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@ def __init__(self, opencti):
129129
attribute_abstract
130130
content
131131
authors
132+
note_types
133+
likelihood
132134
}
133135
... on ObservedData {
134136
first_observed

tests/cases/entities.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,8 @@ def data(self) -> Dict:
509509
"content": "You would like to know that",
510510
"confidence": 50,
511511
"authors": ["you"],
512+
"note_types": ["internal"],
513+
"likelihood": 75,
512514
# "lang": "en",
513515
}
514516

0 commit comments

Comments
 (0)