updateThreat method

Future<UpdateThreatOutput> updateThreat({
  1. required String agentSpaceId,
  2. required String threatId,
  3. ThreatAnchorShape? anchor,
  4. String? comments,
  5. List<ThreatEvidenceShape>? evidence,
  6. List<String>? impactedAssets,
  7. List<String>? impactedGoal,
  8. String? prerequisites,
  9. String? recommendation,
  10. ThreatSeverity? severity,
  11. String? statement,
  12. ThreatStatus? status,
  13. String? threatAction,
  14. String? threatImpact,
  15. String? threatSource,
  16. String? title,
})

Updates a threat.

Parameter agentSpaceId : The unique identifier of the agent space.

Parameter threatId : The unique identifier of the threat to update.

Parameter anchor : The updated DFD element this threat is anchored to.

Parameter comments : Optional customer comment.

Parameter evidence : The updated source code files supporting the threat.

Parameter impactedAssets : The updated list of specific assets affected by the threat.

Parameter impactedGoal : The updated security goals affected by the threat.

Parameter prerequisites : The updated conditions required for the threat to be exploitable.

Parameter recommendation : The updated recommended mitigation guidance for this threat.

Parameter severity : The updated severity level of the threat.

Parameter statement : The updated natural-language threat statement.

Parameter status : The updated status of the threat.

Parameter threatAction : The updated description of what the threat source can do.

Parameter threatImpact : The updated direct consequence of the threat action.

Parameter threatSource : The updated actor or origin of the threat.

Parameter title : A short title summarizing the threat.

Implementation

Future<UpdateThreatOutput> updateThreat({
  required String agentSpaceId,
  required String threatId,
  ThreatAnchorShape? anchor,
  String? comments,
  List<ThreatEvidenceShape>? evidence,
  List<String>? impactedAssets,
  List<String>? impactedGoal,
  String? prerequisites,
  String? recommendation,
  ThreatSeverity? severity,
  String? statement,
  ThreatStatus? status,
  String? threatAction,
  String? threatImpact,
  String? threatSource,
  String? title,
}) async {
  final $payload = <String, dynamic>{
    'agentSpaceId': agentSpaceId,
    'threatId': threatId,
    if (anchor != null) 'anchor': anchor,
    if (comments != null) 'comments': comments,
    if (evidence != null) 'evidence': evidence,
    if (impactedAssets != null) 'impactedAssets': impactedAssets,
    if (impactedGoal != null) 'impactedGoal': impactedGoal,
    if (prerequisites != null) 'prerequisites': prerequisites,
    if (recommendation != null) 'recommendation': recommendation,
    if (severity != null) 'severity': severity.value,
    if (statement != null) 'statement': statement,
    if (status != null) 'status': status.value,
    if (threatAction != null) 'threatAction': threatAction,
    if (threatImpact != null) 'threatImpact': threatImpact,
    if (threatSource != null) 'threatSource': threatSource,
    if (title != null) 'title': title,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/UpdateThreat',
    exceptionFnMap: _exceptionFns,
  );
  return UpdateThreatOutput.fromJson(response);
}