listDeployments method

Future<Deployments> listDeployments({
  1. required String applicationId,
  2. required String environmentId,
  3. int? maxResults,
  4. String? nextToken,
})

Lists the deployments for an environment in descending deployment number order.

May throw BadRequestException. May throw InternalServerException. May throw ResourceNotFoundException.

Parameter applicationId : The application ID.

Parameter environmentId : The environment ID.

Parameter maxResults : The maximum number of items that may be returned for this call. If there are items that have not yet been returned, the response will include a non-null NextToken that you can provide in a subsequent call to get the next set of results.

Parameter nextToken : The token returned by a prior call to this operation indicating the next set of results to be returned. If not specified, the operation will return the first set of results.

Implementation

Future<Deployments> listDeployments({
  required String applicationId,
  required String environmentId,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    50,
  );
  final $query = <String, List<String>>{
    if (maxResults != null) 'max_results': [maxResults.toString()],
    if (nextToken != null) 'next_token': [nextToken],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri:
        '/applications/${Uri.encodeComponent(applicationId)}/environments/${Uri.encodeComponent(environmentId)}/deployments',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return Deployments.fromJson(response);
}