addArtifact method

Future<AddArtifactOutput> addArtifact({
  1. required String agentSpaceId,
  2. required Uint8List artifactContent,
  3. required ArtifactType artifactType,
  4. required String fileName,
})

Uploads an artifact to an agent space. Artifacts provide additional context for security testing, such as architecture diagrams, API specifications, or configuration files.

May throw AccessDeniedException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ValidationException.

Parameter agentSpaceId : The unique identifier of the agent space to add the artifact to.

Parameter artifactContent : The binary content of the artifact to upload.

Parameter artifactType : The file type of the artifact. Valid values include TXT, PNG, JPEG, MD, PDF, DOCX, DOC, JSON, and YAML.

Parameter fileName : The file name of the artifact.

Implementation

Future<AddArtifactOutput> addArtifact({
  required String agentSpaceId,
  required Uint8List artifactContent,
  required ArtifactType artifactType,
  required String fileName,
}) async {
  final $payload = <String, dynamic>{
    'agentSpaceId': agentSpaceId,
    'artifactContent': base64Encode(artifactContent),
    'artifactType': artifactType.value,
    'fileName': fileName,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/AddArtifact',
    exceptionFnMap: _exceptionFns,
  );
  return AddArtifactOutput.fromJson(response);
}