listStreamSessions method
Retrieves a list of Amazon GameLift Streams stream sessions that a stream group is hosting.
To retrieve stream sessions, specify the stream group, and optionally filter by stream session status. You can paginate the results as needed.
This operation returns the requested stream sessions in no particular order.
May throw AccessDeniedException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
May throw ValidationException.
Parameter identifier :
The unique identifier of a Amazon GameLift Streams stream group to
retrieve the stream session for. You can use either the stream group ID or
the Amazon
Resource Name (ARN).
Parameter exportFilesStatus :
Filter by the exported files status. You can specify one status in each
request to retrieve only sessions that currently have that exported files
status.
Exported files can be in one of the following states:
-
SUCCEEDED: The exported files are successfully stored in an S3 bucket. -
FAILED: The session ended but Amazon GameLift Streams couldn't collect and upload the files to S3. -
PENDING: Either the stream session is still in progress, or uploading the exported files to the S3 bucket is in progress.
Parameter maxResults :
The number of results to return. Use this parameter with
NextToken to return results in sequential pages. Default
value is 25.
Parameter nextToken :
The token that marks the start of the next set of results. Use this token
when you retrieve results as sequential pages. To get the first page of
results, omit a token value. To get the remaining pages, provide the token
returned with the previous result set.
Parameter status :
Filter by the stream session status. You can specify one status in each
request to retrieve only sessions that are currently in that status.
Implementation
Future<ListStreamSessionsOutput> listStreamSessions({
required String identifier,
ExportFilesStatus? exportFilesStatus,
int? maxResults,
String? nextToken,
StreamSessionStatus? status,
}) async {
_s.validateNumRange(
'maxResults',
maxResults,
1,
100,
);
final $query = <String, List<String>>{
if (exportFilesStatus != null)
'ExportFilesStatus': [exportFilesStatus.value],
if (maxResults != null) 'MaxResults': [maxResults.toString()],
if (nextToken != null) 'NextToken': [nextToken],
if (status != null) 'Status': [status.value],
};
final response = await _protocol.send(
payload: null,
method: 'GET',
requestUri:
'/streamgroups/${Uri.encodeComponent(identifier)}/streamsessions',
queryParams: $query,
exceptionFnMap: _exceptionFns,
);
return ListStreamSessionsOutput.fromJson(response);
}