createThreatModel method

Future<CreateThreatModelOutput> createThreatModel({
  1. required String agentSpaceId,
  2. required String serviceRole,
  3. required String title,
  4. Assets? assets,
  5. String? description,
  6. CloudWatchLog? logConfig,
  7. ReportDestination? reportDestination,
  8. List<DocumentInfo>? scopeDocs,
})

Creates a new threat model configuration in an agent space. A threat model defines the parameters for automated threat analysis.

Parameter agentSpaceId : The unique identifier of the agent space to create the threat model in.

Parameter serviceRole : The IAM service role to use for the threat model.

Parameter title : The title of the threat model.

Parameter assets : The assets to include in the threat model.

Parameter description : A description of the application or system being threat modeled.

Parameter logConfig : The CloudWatch Logs configuration for the threat model.

Parameter reportDestination : The destination for publishing scan reports to an integrated document provider.

Parameter scopeDocs : The scoped documents for the agent to focus on during threat modeling.

Implementation

Future<CreateThreatModelOutput> createThreatModel({
  required String agentSpaceId,
  required String serviceRole,
  required String title,
  Assets? assets,
  String? description,
  CloudWatchLog? logConfig,
  ReportDestination? reportDestination,
  List<DocumentInfo>? scopeDocs,
}) async {
  final $payload = <String, dynamic>{
    'agentSpaceId': agentSpaceId,
    'serviceRole': serviceRole,
    'title': title,
    if (assets != null) 'assets': assets,
    if (description != null) 'description': description,
    if (logConfig != null) 'logConfig': logConfig,
    if (reportDestination != null) 'reportDestination': reportDestination,
    if (scopeDocs != null) 'scopeDocs': scopeDocs,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/CreateThreatModel',
    exceptionFnMap: _exceptionFns,
  );
  return CreateThreatModelOutput.fromJson(response);
}