listTestGridSessions method
Retrieves a list of sessions for a TestGridProject.
May throw NotFoundException. May throw ArgumentException. May throw InternalServiceException.
Parameter projectArn
:
ARN of a TestGridProject.
Parameter creationTimeAfter
:
Return only sessions created after this time.
Parameter creationTimeBefore
:
Return only sessions created before this time.
Parameter endTimeAfter
:
Return only sessions that ended after this time.
Parameter endTimeBefore
:
Return only sessions that ended before this time.
Parameter maxResult
:
Return only this many results at a time.
Parameter nextToken
:
Pagination token.
Parameter status
:
Return only sessions in this state.
Implementation
Future<ListTestGridSessionsResult> listTestGridSessions({
required String projectArn,
DateTime? creationTimeAfter,
DateTime? creationTimeBefore,
DateTime? endTimeAfter,
DateTime? endTimeBefore,
int? maxResult,
String? nextToken,
TestGridSessionStatus? status,
}) async {
ArgumentError.checkNotNull(projectArn, 'projectArn');
_s.validateStringLength(
'projectArn',
projectArn,
32,
1011,
isRequired: true,
);
_s.validateNumRange(
'maxResult',
maxResult,
1,
1000,
);
_s.validateStringLength(
'nextToken',
nextToken,
4,
1024,
);
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'DeviceFarm_20150623.ListTestGridSessions'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'projectArn': projectArn,
if (creationTimeAfter != null)
'creationTimeAfter': unixTimestampToJson(creationTimeAfter),
if (creationTimeBefore != null)
'creationTimeBefore': unixTimestampToJson(creationTimeBefore),
if (endTimeAfter != null)
'endTimeAfter': unixTimestampToJson(endTimeAfter),
if (endTimeBefore != null)
'endTimeBefore': unixTimestampToJson(endTimeBefore),
if (maxResult != null) 'maxResult': maxResult,
if (nextToken != null) 'nextToken': nextToken,
if (status != null) 'status': status.toValue(),
},
);
return ListTestGridSessionsResult.fromJson(jsonResponse.body);
}