renderUiTemplate method
Renders the UI template so that you can preview the worker's experience.
May throw ResourceNotFound.
Parameter roleArn :
The Amazon Resource Name (ARN) that has access to the S3 objects that are
used by the template.
Parameter task :
A RenderableTask object containing a representative task to
render.
Parameter humanTaskUiArn :
The HumanTaskUiArn of the worker UI that you want to render.
Do not provide a HumanTaskUiArn if you use the
UiTemplate parameter.
See a list of available Human Ui Amazon Resource Names (ARNs) in UiConfig.
Parameter uiTemplate :
A Template object containing the worker UI template to
render.
Implementation
Future<RenderUiTemplateResponse> renderUiTemplate({
required String roleArn,
required RenderableTask task,
String? humanTaskUiArn,
UiTemplate? uiTemplate,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'SageMaker.RenderUiTemplate'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'RoleArn': roleArn,
'Task': task,
if (humanTaskUiArn != null) 'HumanTaskUiArn': humanTaskUiArn,
if (uiTemplate != null) 'UiTemplate': uiTemplate,
},
);
return RenderUiTemplateResponse.fromJson(jsonResponse.body);
}