Report

class trustar.models.report.Report(id=None, title=None, body=None, time_began=None, external_id=None, external_url=None, is_enclave=True, enclave_ids=None, created=None, updated=None)

Models a Report.

Variables:
  • id – the report guid
  • title – the report title
  • body – the report body
  • time_began – the time that the incident began; either an integer (milliseconds since epoch) or an isoformat datetime string
  • external_id – An external tracking id. For instance, if the report is a copy of a corresponding report in some external system, this should contain its id in that system.
  • external_url – A URL to the report in an external system (if one exists).
  • is_enclave – A boolean representing whether the distribution type of the report is ENCLAVE or COMMUNITY.
  • enclave_ids – A list of IDs of enclaves that the report belongs to
__init__(id=None, title=None, body=None, time_began=None, external_id=None, external_url=None, is_enclave=True, enclave_ids=None, created=None, updated=None)

Constructs a Report object.

Parameters:
  • id – the report guid
  • title – the report title
  • body – the report body
  • time_began – the time that the incident began; either an integer (milliseconds since epoch) or an isoformat datetime string
  • external_id – An external tracking id. For instance, if the report is a copy of a corresponding report in some external system, this should contain its id in that system.
  • external_url – A URL to the report in an external system (if one exists).
  • is_enclave – A boolean representing whether the distribution type of the report is ENCLAVE or COMMUNITY.
  • enclave_ids – The list of enclave_ids the report is associated with. If is_enclave is True, this cannot be None or empty.
classmethod from_dict(report)

Create a report object from a dictionary. This method is intended for internal use, to construct a Report object from the body of a response json. It expects the keys of the dictionary to match those of the json that would be found in a response to an API call such as GET /report/{id}.

Parameters:report – The dictionary.
Returns:The report object.
to_dict(remove_nones=False)

Creates a dictionary representation of the object.

Parameters:remove_nones – Whether None values should be filtered out of the dictionary. Defaults to False.
Returns:A dictionary representation of the report.