listCreatedArtifacts method

Future<ListCreatedArtifactsResult> listCreatedArtifacts({
  1. required String migrationTaskName,
  2. required String progressUpdateStream,
  3. int? maxResults,
  4. String? nextToken,
})

Lists the created artifacts attached to a given migration task in an update stream. This API has the following traits:

  • Gets the list of the created artifacts while migration is taking place.
  • Shows the artifacts created by the migration tool that was associated by the AssociateCreatedArtifact API.
  • Lists created artifacts in a paginated interface.

May throw AccessDeniedException. May throw ThrottlingException. May throw InternalServerError. May throw ServiceUnavailableException. May throw InvalidInputException. May throw ResourceNotFoundException. May throw HomeRegionNotSetException.

Parameter migrationTaskName : Unique identifier that references the migration task. Do not store personal data in this field.

Parameter progressUpdateStream : The name of the ProgressUpdateStream.

Parameter maxResults : Maximum number of results to be returned per page.

Parameter nextToken : If a NextToken was returned by a previous call, there are more results available. To retrieve the next page of results, make the call again using the returned token in NextToken.

Implementation

Future<ListCreatedArtifactsResult> listCreatedArtifacts({
  required String migrationTaskName,
  required String progressUpdateStream,
  int? maxResults,
  String? nextToken,
}) async {
  ArgumentError.checkNotNull(migrationTaskName, 'migrationTaskName');
  _s.validateStringLength(
    'migrationTaskName',
    migrationTaskName,
    1,
    256,
    isRequired: true,
  );
  ArgumentError.checkNotNull(progressUpdateStream, 'progressUpdateStream');
  _s.validateStringLength(
    'progressUpdateStream',
    progressUpdateStream,
    1,
    50,
    isRequired: true,
  );
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    10,
  );
  _s.validateStringLength(
    'nextToken',
    nextToken,
    0,
    2048,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSMigrationHub.ListCreatedArtifacts'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'MigrationTaskName': migrationTaskName,
      'ProgressUpdateStream': progressUpdateStream,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return ListCreatedArtifactsResult.fromJson(jsonResponse.body);
}