describeFunction method

Future<DescribeFunctionResult> describeFunction({
  1. required String name,
  2. FunctionStage? stage,
})

Gets configuration information and metadata about a CloudFront function, but not the function's code. To get a function's code, use GetFunction.

To get configuration information and metadata about a function, you must provide the function's name and stage. To get these values, you can use ListFunctions.

May throw NoSuchFunctionExists. May throw UnsupportedOperation.

Parameter name : The name of the function that you are getting information about.

Parameter stage : The function's stage, either DEVELOPMENT or LIVE.

Implementation

Future<DescribeFunctionResult> describeFunction({
  required String name,
  FunctionStage? stage,
}) async {
  final $query = <String, List<String>>{
    if (stage != null) 'Stage': [stage.value],
  };
  final $result = await _protocol.sendRaw(
    method: 'GET',
    requestUri: '/2020-05-31/function/${Uri.encodeComponent(name)}/describe',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  final $elem = await _s.xmlFromResponse($result);
  return DescribeFunctionResult(
    functionSummary: FunctionSummary.fromXml($elem),
    eTag: _s.extractHeaderStringValue($result.headers, 'ETag'),
  );
}