listResources method

Future<ListResourcesResponse> listResources({
  1. required String serviceArn,
  2. String? awsRegion,
  3. bool? billable,
  4. int? maxResults,
  5. String? nextToken,
  6. List<String>? resourceTypes,
  7. String? serviceFunctionId,
})

List resources.

May throw AccessDeniedException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ValidationException.

Parameter awsRegion : Filter resources by AWS Region.

Parameter billable : Specifies whether to filter non-billable resources. When true (the default), the operation returns only billable resources.

Parameter resourceTypes : The CloudFormation resource types to include in the response.

Parameter serviceFunctionId : Filter resources by service function identifier.

Implementation

Future<ListResourcesResponse> listResources({
  required String serviceArn,
  String? awsRegion,
  bool? billable,
  int? maxResults,
  String? nextToken,
  List<String>? resourceTypes,
  String? serviceFunctionId,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final $query = <String, List<String>>{
    'serviceArn': [serviceArn],
    if (awsRegion != null) 'awsRegion': [awsRegion],
    if (billable != null) 'billable': [billable.toString()],
    if (maxResults != null) 'maxResults': [maxResults.toString()],
    if (nextToken != null) 'nextToken': [nextToken],
    if (resourceTypes != null) 'resourceTypes': resourceTypes,
    if (serviceFunctionId != null) 'serviceFunctionId': [serviceFunctionId],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri: '/v2/list-resources',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListResourcesResponse.fromJson(response);
}