createCodeReview method

Future<CreateCodeReviewOutput> createCodeReview({
  1. required String agentSpaceId,
  2. required Assets assets,
  3. required String title,
  4. CodeRemediationStrategy? codeRemediationStrategy,
  5. CloudWatchLog? logConfig,
  6. String? serviceRole,
})

Creates a new code review configuration in an agent space. A code review defines the parameters for automated security-focused code analysis.

Parameter agentSpaceId : The unique identifier of the agent space to create the code review in.

Parameter assets : The assets to include in the code review, such as documents and source code.

Parameter title : The title of the code review.

Parameter codeRemediationStrategy : The code remediation strategy for the code review. Valid values are AUTOMATIC and DISABLED.

Parameter logConfig : The CloudWatch Logs configuration for the code review.

Parameter serviceRole : The IAM service role to use for the code review.

Implementation

Future<CreateCodeReviewOutput> createCodeReview({
  required String agentSpaceId,
  required Assets assets,
  required String title,
  CodeRemediationStrategy? codeRemediationStrategy,
  CloudWatchLog? logConfig,
  String? serviceRole,
}) async {
  final $payload = <String, dynamic>{
    'agentSpaceId': agentSpaceId,
    'assets': assets,
    'title': title,
    if (codeRemediationStrategy != null)
      'codeRemediationStrategy': codeRemediationStrategy.value,
    if (logConfig != null) 'logConfig': logConfig,
    if (serviceRole != null) 'serviceRole': serviceRole,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/CreateCodeReview',
    exceptionFnMap: _exceptionFns,
  );
  return CreateCodeReviewOutput.fromJson(response);
}