listTestGridSessionArtifacts method

Future<ListTestGridSessionArtifactsResult> listTestGridSessionArtifacts({
  1. required String sessionArn,
  2. int? maxResult,
  3. String? nextToken,
  4. TestGridSessionArtifactCategory? type,
})

Retrieves a list of artifacts created during the session.

May throw NotFoundException. May throw ArgumentException. May throw InternalServiceException.

Parameter sessionArn : The ARN of a TestGridSession.

Parameter maxResult : The maximum number of results to be returned by a request.

Parameter nextToken : Pagination token.

Parameter type : Limit results to a specified type of artifact.

Implementation

Future<ListTestGridSessionArtifactsResult> listTestGridSessionArtifacts({
  required String sessionArn,
  int? maxResult,
  String? nextToken,
  TestGridSessionArtifactCategory? type,
}) async {
  ArgumentError.checkNotNull(sessionArn, 'sessionArn');
  _s.validateStringLength(
    'sessionArn',
    sessionArn,
    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.ListTestGridSessionArtifacts'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'sessionArn': sessionArn,
      if (maxResult != null) 'maxResult': maxResult,
      if (nextToken != null) 'nextToken': nextToken,
      if (type != null) 'type': type.toValue(),
    },
  );

  return ListTestGridSessionArtifactsResult.fromJson(jsonResponse.body);
}