listDistributionsByWebACLId method

Future<ListDistributionsByWebACLIdResult> listDistributionsByWebACLId({
  1. required String webACLId,
  2. String? marker,
  3. int? maxItems,
})

List the distributions that are associated with a specified WAF web ACL.

May throw InvalidArgument. May throw InvalidWebACLId.

Parameter webACLId : The ID of the WAF web ACL that you want to list the associated distributions. If you specify "null" for the ID, the request returns a list of the distributions that aren't associated with a web ACL.

For WAFV2, this is the ARN of the web ACL, such as arn:aws:wafv2:us-east-1:123456789012:global/webacl/ExampleWebACL/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111.

For WAF Classic, this is the ID of the web ACL, such as a1b2c3d4-5678-90ab-cdef-EXAMPLE11111.

Parameter marker : Use Marker and MaxItems to control pagination of results. If you have more than MaxItems distributions that satisfy the request, the response includes a NextMarker element. To get the next page of results, submit another request. For the value of Marker, specify the value of NextMarker from the last response. (For the first request, omit Marker.)

Parameter maxItems : The maximum number of distributions that you want CloudFront to return in the response body. The maximum and default values are both 100.

Implementation

Future<ListDistributionsByWebACLIdResult> listDistributionsByWebACLId({
  required String webACLId,
  String? marker,
  int? maxItems,
}) async {
  final $query = <String, List<String>>{
    if (marker != null) 'Marker': [marker],
    if (maxItems != null) 'MaxItems': [maxItems.toString()],
  };
  final $result = await _protocol.sendRaw(
    method: 'GET',
    requestUri:
        '/2020-05-31/distributionsByWebACLId/${Uri.encodeComponent(webACLId)}',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  final $elem = await _s.xmlFromResponse($result);
  return ListDistributionsByWebACLIdResult(
    distributionList: DistributionList.fromXml($elem),
  );
}