openc2lib.types.targets.artifact

 1import dataclasses
 2
 3from openc2lib.types.base import Record
 4from openc2lib.types.data import Payload, Hashes
 5from openc2lib.core.target import target
 6
 7@dataclasses.dataclass
 8@target('artifact')
 9class Artifact(Record):
10	""" OpenC2 Artifact
11
12		Implements the `artifact` target (Section 3.4.1.1). 
13		An array of bytes representing a file-like object or a link to that object.
14	"""
15	mime_type: str = None
16	payload: Payload = None
17	hashes: Hashes = None
18
19	def __post_init__(self):
20		if self.mime_type == None and self.payload == None and self.hashes == None:
21			raise ValueError("An 'Artifact' Target MUST contain at least one property.")
@dataclasses.dataclass
@target('artifact')
class Artifact(openc2lib.types.base.record.Record):
 8@dataclasses.dataclass
 9@target('artifact')
10class Artifact(Record):
11	""" OpenC2 Artifact
12
13		Implements the `artifact` target (Section 3.4.1.1). 
14		An array of bytes representing a file-like object or a link to that object.
15	"""
16	mime_type: str = None
17	payload: Payload = None
18	hashes: Hashes = None
19
20	def __post_init__(self):
21		if self.mime_type == None and self.payload == None and self.hashes == None:
22			raise ValueError("An 'Artifact' Target MUST contain at least one property.")

OpenC2 Artifact

Implements the artifact target (Section 3.4.1.1). An array of bytes representing a file-like object or a link to that object.

Artifact( mime_type: str = None, payload: openc2lib.types.data.payload.Payload = None, hashes: openc2lib.types.data.hashes.Hashes = None)
mime_type: str = None