listHostedConfigurationVersions method

Future<HostedConfigurationVersions> listHostedConfigurationVersions({
  1. required String applicationId,
  2. required String configurationProfileId,
  3. int? maxResults,
  4. String? nextToken,
  5. String? versionLabel,
})

Lists configurations stored in the AppConfig hosted configuration store by version.

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

Parameter applicationId : The application ID.

Parameter configurationProfileId : The configuration profile ID.

Parameter maxResults : The maximum number of items to return for this call. If MaxResults is not provided in the call, AppConfig returns the maximum of 50. The call also returns a token that you can specify in a subsequent call to get the next set of results.

Parameter nextToken : A token to start the list. Use this token to get the next set of results.

Parameter versionLabel : An optional filter that can be used to specify the version label of an AppConfig hosted configuration version. This parameter supports filtering by prefix using a wildcard, for example "v2*". If you don't specify an asterisk at the end of the value, only an exact match is returned.

Implementation

Future<HostedConfigurationVersions> listHostedConfigurationVersions({
  required String applicationId,
  required String configurationProfileId,
  int? maxResults,
  String? nextToken,
  String? versionLabel,
}) 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],
    if (versionLabel != null) 'version_label': [versionLabel],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri:
        '/applications/${Uri.encodeComponent(applicationId)}/configurationprofiles/${Uri.encodeComponent(configurationProfileId)}/hostedconfigurationversions',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return HostedConfigurationVersions.fromJson(response);
}