startQAppSession method
Starts a new session for an Amazon Q App, allowing inputs to be provided and the app to be run.
May throw AccessDeniedException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw UnauthorizedException.
May throw ValidationException.
Parameter appId :
The unique identifier of the Q App to start a session for.
Parameter appVersion :
The version of the Q App to use for the session.
Parameter instanceId :
The unique identifier of the Amazon Q Business application environment
instance.
Parameter initialValues :
Optional initial input values to provide for the Q App session.
Parameter sessionId :
The unique identifier of the a Q App session.
Parameter tags :
Optional tags to associate with the new Q App session.
Implementation
Future<StartQAppSessionOutput> startQAppSession({
required String appId,
required int appVersion,
required String instanceId,
List<CardValue>? initialValues,
String? sessionId,
Map<String, String>? tags,
}) async {
_s.validateNumRange(
'appVersion',
appVersion,
0,
2147483647,
isRequired: true,
);
final headers = <String, String>{
'instance-id': instanceId.toString(),
};
final $payload = <String, dynamic>{
'appId': appId,
'appVersion': appVersion,
if (initialValues != null) 'initialValues': initialValues,
if (sessionId != null) 'sessionId': sessionId,
if (tags != null) 'tags': tags,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/runtime.startQAppSession',
headers: headers,
exceptionFnMap: _exceptionFns,
);
return StartQAppSessionOutput.fromJson(response);
}