describeApps method

Future<DescribeAppsResult> describeApps({
  1. List<String>? appIds,
  2. String? stackId,
})

Requests a description of a specified set of apps. 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 appIds : An array of app IDs for the apps to be described. If you use this parameter, DescribeApps returns a description of the specified apps. Otherwise, it returns a description of every app.

Parameter stackId : The app stack ID. If you use this parameter, DescribeApps returns a description of the apps in the specified stack.

Implementation

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

  return DescribeAppsResult.fromJson(jsonResponse.body);
}