createCodeSecurityScanConfiguration method

Future<CreateCodeSecurityScanConfigurationResponse> createCodeSecurityScanConfiguration({
  1. required CodeSecurityScanConfiguration configuration,
  2. required ConfigurationLevel level,
  3. required String name,
  4. ScopeSettings? scopeSettings,
  5. Map<String, String>? tags,
})

Creates a scan configuration for code security scanning.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ServiceQuotaExceededException. May throw ThrottlingException. May throw ValidationException.

Parameter configuration : The configuration settings for the code security scan.

Parameter level : The security level for the scan configuration.

Parameter name : The name of the scan configuration.

Parameter scopeSettings : The scope settings that define which repositories will be scanned. Include this parameter to create a default scan configuration. Otherwise Amazon Inspector creates a general scan configuration.

A default scan configuration automatically applies to all existing and future projects imported into Amazon Inspector. Use the BatchAssociateCodeSecurityScanConfiguration operation to associate a general scan configuration with projects.

Parameter tags : The tags to apply to the scan configuration.

Implementation

Future<CreateCodeSecurityScanConfigurationResponse>
    createCodeSecurityScanConfiguration({
  required CodeSecurityScanConfiguration configuration,
  required ConfigurationLevel level,
  required String name,
  ScopeSettings? scopeSettings,
  Map<String, String>? tags,
}) async {
  final $payload = <String, dynamic>{
    'configuration': configuration,
    'level': level.value,
    'name': name,
    if (scopeSettings != null) 'scopeSettings': scopeSettings,
    if (tags != null) 'tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/codesecurity/scan-configuration/create',
    exceptionFnMap: _exceptionFns,
  );
  return CreateCodeSecurityScanConfigurationResponse.fromJson(response);
}