listLayerVersions method

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

Lists the versions of an AWS 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.

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

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

Parameter compatibleRuntime : A runtime identifier. For example, go1.x.

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,
  Runtime? compatibleRuntime,
  String? marker,
  int? maxItems,
}) async {
  ArgumentError.checkNotNull(layerName, 'layerName');
  _s.validateStringLength(
    'layerName',
    layerName,
    1,
    140,
    isRequired: true,
  );
  _s.validateNumRange(
    'maxItems',
    maxItems,
    1,
    50,
  );
  final $query = <String, List<String>>{
    if (compatibleRuntime != null)
      'CompatibleRuntime': [compatibleRuntime.toValue()],
    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);
}