listApplicationRevisions method

Future<ListApplicationRevisionsOutput> listApplicationRevisions({
  1. required String applicationName,
  2. ListStateFilterAction? deployed,
  3. String? nextToken,
  4. String? s3Bucket,
  5. String? s3KeyPrefix,
  6. ApplicationRevisionSortBy? sortBy,
  7. SortOrder? sortOrder,
})

Lists information about revisions for an application.

May throw ApplicationDoesNotExistException. May throw ApplicationNameRequiredException. May throw InvalidApplicationNameException. May throw InvalidSortByException. May throw InvalidSortOrderException. May throw InvalidBucketNameFilterException. May throw InvalidKeyPrefixFilterException. May throw BucketNameFilterRequiredException. May throw InvalidDeployedStateFilterException. May throw InvalidNextTokenException.

Parameter applicationName : The name of an AWS CodeDeploy application associated with the IAM user or AWS account.

Parameter deployed : Whether to list revisions based on whether the revision is the target revision of a deployment group:

  • include: List revisions that are target revisions of a deployment group.
  • exclude: Do not list revisions that are target revisions of a deployment group.
  • ignore: List all revisions.

Parameter nextToken : An identifier returned from the previous ListApplicationRevisions call. It can be used to return the next set of applications in the list.

Parameter s3Bucket : An Amazon S3 bucket name to limit the search for revisions.

If set to null, all of the user's buckets are searched.

Parameter s3KeyPrefix : A key prefix for the set of Amazon S3 objects to limit the search for revisions.

Parameter sortBy : The column name to use to sort the list results:

  • registerTime: Sort by the time the revisions were registered with AWS CodeDeploy.
  • firstUsedTime: Sort by the time the revisions were first used in a deployment.
  • lastUsedTime: Sort by the time the revisions were last used in a deployment.
If not specified or set to null, the results are returned in an arbitrary order.

Parameter sortOrder : The order in which to sort the list results:

  • ascending: ascending order.
  • descending: descending order.
If not specified, the results are sorted in ascending order.

If set to null, the results are sorted in an arbitrary order.

Implementation

Future<ListApplicationRevisionsOutput> listApplicationRevisions({
  required String applicationName,
  ListStateFilterAction? deployed,
  String? nextToken,
  String? s3Bucket,
  String? s3KeyPrefix,
  ApplicationRevisionSortBy? sortBy,
  SortOrder? sortOrder,
}) async {
  ArgumentError.checkNotNull(applicationName, 'applicationName');
  _s.validateStringLength(
    'applicationName',
    applicationName,
    1,
    100,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'CodeDeploy_20141006.ListApplicationRevisions'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'applicationName': applicationName,
      if (deployed != null) 'deployed': deployed.toValue(),
      if (nextToken != null) 'nextToken': nextToken,
      if (s3Bucket != null) 's3Bucket': s3Bucket,
      if (s3KeyPrefix != null) 's3KeyPrefix': s3KeyPrefix,
      if (sortBy != null) 'sortBy': sortBy.toValue(),
      if (sortOrder != null) 'sortOrder': sortOrder.toValue(),
    },
  );

  return ListApplicationRevisionsOutput.fromJson(jsonResponse.body);
}