listAliases method
Returns a list of aliases for a Lambda function.
May throw ServiceException. May throw ResourceNotFoundException. May throw InvalidParameterValueException. May throw TooManyRequestsException.
Parameter functionName
:
The name of the Lambda function.
Name formats
-
Function name -
MyFunction
. -
Function ARN -
arn:aws:lambda:us-west-2:123456789012:function:MyFunction
. -
Partial ARN -
123456789012:function:MyFunction
.
Parameter functionVersion
:
Specify a function version to only list aliases that invoke that version.
Parameter marker
:
Specify the pagination token that's returned by a previous request to
retrieve the next page of results.
Parameter maxItems
:
Limit the number of aliases returned.
Implementation
Future<ListAliasesResponse> listAliases({
required String functionName,
String? functionVersion,
String? marker,
int? maxItems,
}) async {
ArgumentError.checkNotNull(functionName, 'functionName');
_s.validateStringLength(
'functionName',
functionName,
1,
140,
isRequired: true,
);
_s.validateStringLength(
'functionVersion',
functionVersion,
1,
1024,
);
_s.validateNumRange(
'maxItems',
maxItems,
1,
10000,
);
final $query = <String, List<String>>{
if (functionVersion != null) 'FunctionVersion': [functionVersion],
if (marker != null) 'Marker': [marker],
if (maxItems != null) 'MaxItems': [maxItems.toString()],
};
final response = await _protocol.send(
payload: null,
method: 'GET',
requestUri:
'/2015-03-31/functions/${Uri.encodeComponent(functionName)}/aliases',
queryParams: $query,
exceptionFnMap: _exceptionFns,
);
return ListAliasesResponse.fromJson(response);
}