listLayerVersions method

Future<ListLayerVersionsResponse> listLayerVersions({
  1. required String layerName,
  2. Architecture? compatibleArchitecture,
  3. Runtime? compatibleRuntime,
  4. String? marker,
  5. int? maxItems,
})

Lists the versions of an Lambda layer. Versions that have been deleted aren't listed. Specify a runtime identifier to list only versions that indicate that they're compatible with that runtime. Specify a compatible architecture to include only layer versions that are compatible with that architecture.

May throw InvalidParameterValueException. May throw ResourceNotFoundException. May throw ServiceException. May throw TooManyRequestsException.

Parameter layerName : The name or Amazon Resource Name (ARN) of the layer.

Parameter compatibleArchitecture : The compatible instruction set architecture.

Parameter compatibleRuntime : A runtime identifier.

The following list includes deprecated runtimes. For more information, see Runtime use after deprecation.

For a list of all currently supported runtimes, see Supported runtimes.

Parameter marker : A pagination token returned by a previous call.

Parameter maxItems : The maximum number of versions to return.

Implementation

Future<ListLayerVersionsResponse> listLayerVersions({
  required String layerName,
  Architecture? compatibleArchitecture,
  Runtime? compatibleRuntime,
  String? marker,
  int? maxItems,
}) async {
  _s.validateNumRange(
    'maxItems',
    maxItems,
    1,
    50,
  );
  final $query = <String, List<String>>{
    if (compatibleArchitecture != null)
      'CompatibleArchitecture': [compatibleArchitecture.value],
    if (compatibleRuntime != null)
      'CompatibleRuntime': [compatibleRuntime.value],
    if (marker != null) 'Marker': [marker],
    if (maxItems != null) 'MaxItems': [maxItems.toString()],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri:
        '/2018-10-31/layers/${Uri.encodeComponent(layerName)}/versions',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListLayerVersionsResponse.fromJson(response);
}