createCase method

Future<CreateCaseResponse> createCase({
  1. required String description,
  2. required EngagementType engagementType,
  3. required List<String> impactedAccounts,
  4. required DateTime reportedIncidentStartDate,
  5. required ResolverType resolverType,
  6. required String title,
  7. required List<Watcher> watchers,
  8. String? clientToken,
  9. List<ImpactedAwsRegion>? impactedAwsRegions,
  10. List<String>? impactedServices,
  11. Map<String, String>? tags,
  12. List<ThreatActorIp>? threatActorIpAddresses,
})

Creates a new case.

Parameter description : Required element used in combination with CreateCase

to provide a description for the new case.

Parameter engagementType : Required element used in combination with CreateCase to provide an engagement type for the new cases. Available engagement types include Security Incident | Investigation

Parameter impactedAccounts : Required element used in combination with CreateCase to provide a list of impacted accounts.

Parameter reportedIncidentStartDate : Required element used in combination with CreateCase to provide an initial start date for the unauthorized activity.

Parameter resolverType : Required element used in combination with CreateCase to identify the resolver type.

Parameter title : Required element used in combination with CreateCase to provide a title for the new case.

Parameter watchers : Required element used in combination with CreateCase to provide a list of entities to receive notifications for case updates.

Parameter clientToken :

Parameter impactedAwsRegions : An optional element used in combination with CreateCase to provide a list of impacted regions.

Parameter impactedServices : An optional element used in combination with CreateCase to provide a list of services impacted.

Parameter tags : An optional element used in combination with CreateCase to add customer specified tags to a case.

Parameter threatActorIpAddresses : An optional element used in combination with CreateCase to provide a list of suspicious internet protocol addresses associated with unauthorized activity.

Implementation

Future<CreateCaseResponse> createCase({
  required String description,
  required EngagementType engagementType,
  required List<String> impactedAccounts,
  required DateTime reportedIncidentStartDate,
  required ResolverType resolverType,
  required String title,
  required List<Watcher> watchers,
  String? clientToken,
  List<ImpactedAwsRegion>? impactedAwsRegions,
  List<String>? impactedServices,
  Map<String, String>? tags,
  List<ThreatActorIp>? threatActorIpAddresses,
}) async {
  final $payload = <String, dynamic>{
    'description': description,
    'engagementType': engagementType.value,
    'impactedAccounts': impactedAccounts,
    'reportedIncidentStartDate':
        unixTimestampToJson(reportedIncidentStartDate),
    'resolverType': resolverType.value,
    'title': title,
    'watchers': watchers,
    'clientToken': clientToken ?? _s.generateIdempotencyToken(),
    if (impactedAwsRegions != null) 'impactedAwsRegions': impactedAwsRegions,
    if (impactedServices != null) 'impactedServices': impactedServices,
    if (tags != null) 'tags': tags,
    if (threatActorIpAddresses != null)
      'threatActorIpAddresses': threatActorIpAddresses,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/v1/create-case',
    exceptionFnMap: _exceptionFns,
  );
  return CreateCaseResponse.fromJson(response);
}