createStreamingURL method
Creates a temporary URL to start an WorkSpaces Applications streaming session for the specified user. A streaming URL enables application streaming to be tested without user setup.
May throw InvalidParameterCombinationException.
May throw OperationNotPermittedException.
May throw ResourceNotAvailableException.
May throw ResourceNotFoundException.
Parameter fleetName :
The name of the fleet.
Parameter stackName :
The name of the stack.
Parameter userId :
The identifier of the user.
Parameter applicationId :
The name of the application to launch after the session starts. This is
the name that you specified as Name in the Image Assistant. If your
fleet is enabled for the Desktop stream view, you can also choose
to launch directly to the operating system desktop. To do so, specify
Desktop.
Parameter sessionContext :
The session context. For more information, see Session
Context in the Amazon WorkSpaces Applications Administration
Guide.
Parameter validity :
The time that the streaming URL will be valid, in seconds. Specify a value
between 1 and 604800 seconds. The default is 60 seconds.
Implementation
Future<CreateStreamingURLResult> createStreamingURL({
required String fleetName,
required String stackName,
required String userId,
String? applicationId,
String? sessionContext,
int? validity,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'PhotonAdminProxyService.CreateStreamingURL'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'FleetName': fleetName,
'StackName': stackName,
'UserId': userId,
if (applicationId != null) 'ApplicationId': applicationId,
if (sessionContext != null) 'SessionContext': sessionContext,
if (validity != null) 'Validity': validity,
},
);
return CreateStreamingURLResult.fromJson(jsonResponse.body);
}