getMedia method
Returns the image bytes corresponding to a media object. If you have implemented your own application with the Chat and ChatSync APIs, and have enabled content extraction from visual data in Amazon Q Business, you use the GetMedia API operation to download the images so you can show them in your UI with responses.
For more information, see Extracting semantic meaning from images and visuals.
May throw AccessDeniedException.
May throw InternalServerException.
May throw LicenseNotFoundException.
May throw MediaTooLargeException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
May throw ValidationException.
Parameter applicationId :
The identifier of the Amazon Q Business which contains the media object.
Parameter conversationId :
The identifier of the Amazon Q Business conversation.
Parameter mediaId :
The identifier of the media object. You can find this in the
sourceAttributions returned by the Chat,
ChatSync, and ListMessages API responses.
Parameter messageId :
The identifier of the Amazon Q Business message.
Implementation
Future<GetMediaResponse> getMedia({
required String applicationId,
required String conversationId,
required String mediaId,
required String messageId,
}) async {
final response = await _protocol.send(
payload: null,
method: 'GET',
requestUri:
'/applications/${Uri.encodeComponent(applicationId)}/conversations/${Uri.encodeComponent(conversationId)}/messages/${Uri.encodeComponent(messageId)}/media/${Uri.encodeComponent(mediaId)}',
exceptionFnMap: _exceptionFns,
);
return GetMediaResponse.fromJson(response);
}