listHostedZones method

Future<ListHostedZonesResponse> listHostedZones({
  1. String? delegationSetId,
  2. String? marker,
  3. String? maxItems,
})

Retrieves a list of the public and private hosted zones that are associated with the current AWS account. The response includes a HostedZones child element for each hosted zone.

Amazon Route 53 returns a maximum of 100 items in each response. If you have a lot of hosted zones, you can use the maxitems parameter to list them in groups of up to 100.

May throw InvalidInput. May throw NoSuchDelegationSet. May throw DelegationSetNotReusable.

Parameter delegationSetId : If you're using reusable delegation sets and you want to list all of the hosted zones that are associated with a reusable delegation set, specify the ID of that reusable delegation set.

Parameter marker : If the value of IsTruncated in the previous response was true, you have more hosted zones. To get more hosted zones, submit another ListHostedZones request.

For the value of marker, specify the value of NextMarker from the previous response, which is the ID of the first hosted zone that Amazon Route 53 will return if you submit another request.

If the value of IsTruncated in the previous response was false, there are no more hosted zones to get.

Parameter maxItems : (Optional) The maximum number of hosted zones that you want Amazon Route 53 to return. If you have more than maxitems hosted zones, the value of IsTruncated in the response is true, and the value of NextMarker is the hosted zone ID of the first hosted zone that Route 53 will return if you submit another request.

Implementation

Future<ListHostedZonesResponse> listHostedZones({
  String? delegationSetId,
  String? marker,
  String? maxItems,
}) async {
  _s.validateStringLength(
    'delegationSetId',
    delegationSetId,
    0,
    32,
  );
  _s.validateStringLength(
    'marker',
    marker,
    0,
    64,
  );
  final $query = <String, List<String>>{
    if (delegationSetId != null) 'delegationsetid': [delegationSetId],
    if (marker != null) 'marker': [marker],
    if (maxItems != null) 'maxitems': [maxItems],
  };
  final $result = await _protocol.send(
    method: 'GET',
    requestUri: '/2013-04-01/hostedzone',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListHostedZonesResponse.fromXml($result.body);
}