createCodeInterpreter method

Future<CreateCodeInterpreterResponse> createCodeInterpreter({
  1. required String name,
  2. required CodeInterpreterNetworkConfiguration networkConfiguration,
  3. List<Certificate>? certificates,
  4. String? clientToken,
  5. String? description,
  6. String? executionRoleArn,
  7. Map<String, String>? tags,
})

Creates a custom code interpreter.

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

Parameter name : The name of the code interpreter. The name must be unique within your account.

Parameter networkConfiguration : The network configuration for the code interpreter. This configuration specifies the network mode for the code interpreter.

Parameter certificates : A list of certificates to install in the code interpreter.

Parameter clientToken : A unique, case-sensitive identifier to ensure that the operation completes no more than one time. If this token matches a previous request, Amazon Bedrock AgentCore ignores the request but does not return an error.

Parameter description : The description of the code interpreter.

Parameter executionRoleArn : The Amazon Resource Name (ARN) of the IAM role that provides permissions for the code interpreter to access Amazon Web Services services.

Parameter tags : A map of tag keys and values to assign to the code interpreter. Tags enable you to categorize your resources in different ways, for example, by purpose, owner, or environment.

Implementation

Future<CreateCodeInterpreterResponse> createCodeInterpreter({
  required String name,
  required CodeInterpreterNetworkConfiguration networkConfiguration,
  List<Certificate>? certificates,
  String? clientToken,
  String? description,
  String? executionRoleArn,
  Map<String, String>? tags,
}) async {
  final $payload = <String, dynamic>{
    'name': name,
    'networkConfiguration': networkConfiguration,
    if (certificates != null) 'certificates': certificates,
    'clientToken': clientToken ?? _s.generateIdempotencyToken(),
    if (description != null) 'description': description,
    if (executionRoleArn != null) 'executionRoleArn': executionRoleArn,
    if (tags != null) 'tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri: '/code-interpreters',
    exceptionFnMap: _exceptionFns,
  );
  return CreateCodeInterpreterResponse.fromJson(response);
}