updatePrompt method

Future<UpdatePromptResponse> updatePrompt({
  1. required String instanceId,
  2. required String promptId,
  3. String? description,
  4. String? name,
  5. String? s3Uri,
})

Updates a prompt.

May throw InternalServiceException. May throw InvalidParameterException. May throw InvalidRequestException. May throw ResourceNotFoundException. May throw ThrottlingException.

Parameter instanceId : The identifier of the Connect Customer instance. You can find the instance ID in the Amazon Resource Name (ARN) of the instance.

Parameter promptId : A unique identifier for the prompt.

Parameter description : A description of the prompt.

Parameter name : The name of the prompt.

Parameter s3Uri : The URI for the S3 bucket where the prompt is stored. You can provide S3 pre-signed URLs returned by the GetPromptFile API instead of providing S3 URIs.

Implementation

Future<UpdatePromptResponse> updatePrompt({
  required String instanceId,
  required String promptId,
  String? description,
  String? name,
  String? s3Uri,
}) async {
  final $payload = <String, dynamic>{
    if (description != null) 'Description': description,
    if (name != null) 'Name': name,
    if (s3Uri != null) 'S3Uri': s3Uri,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/prompts/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(promptId)}',
    exceptionFnMap: _exceptionFns,
  );
  return UpdatePromptResponse.fromJson(response);
}