describeLayers method

Future<DescribeLayersResult> describeLayers({
  1. List<String>? layerIds,
  2. String? stackId,
})

Requests a description of one or more layers in a specified stack. Required Permissions: To use this action, an IAM user must have a Show, Deploy, or Manage permissions level for the stack, or an attached policy that explicitly grants permissions. For more information about user permissions, see Managing User Permissions.

May throw ValidationException. May throw ResourceNotFoundException.

Parameter layerIds : An array of layer IDs that specify the layers to be described. If you omit this parameter, DescribeLayers returns a description of every layer in the specified stack.

Parameter stackId : The stack ID.

Implementation

Future<DescribeLayersResult> describeLayers({
  List<String>? layerIds,
  String? stackId,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'OpsWorks_20130218.DescribeLayers'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (layerIds != null) 'LayerIds': layerIds,
      if (stackId != null) 'StackId': stackId,
    },
  );

  return DescribeLayersResult.fromJson(jsonResponse.body);
}