listVPCAssociationAuthorizations method

Future<ListVPCAssociationAuthorizationsResponse> listVPCAssociationAuthorizations({
  1. required String hostedZoneId,
  2. String? maxResults,
  3. String? nextToken,
})

Gets a list of the VPCs that were created by other accounts and that can be associated with a specified hosted zone because you've submitted one or more CreateVPCAssociationAuthorization requests.

The response includes a VPCs element with a VPC child element for each VPC that can be associated with the hosted zone.

May throw NoSuchHostedZone. May throw InvalidInput. May throw InvalidPaginationToken.

Parameter hostedZoneId : The ID of the hosted zone for which you want a list of VPCs that can be associated with the hosted zone.

Parameter maxResults : Optional: An integer that specifies the maximum number of VPCs that you want Amazon Route 53 to return. If you don't specify a value for MaxResults, Route 53 returns up to 50 VPCs per page.

Parameter nextToken : Optional: If a response includes a NextToken element, there are more VPCs that can be associated with the specified hosted zone. To get the next page of results, submit another request, and include the value of NextToken from the response in the nexttoken parameter in another ListVPCAssociationAuthorizations request.

Implementation

Future<ListVPCAssociationAuthorizationsResponse>
    listVPCAssociationAuthorizations({
  required String hostedZoneId,
  String? maxResults,
  String? nextToken,
}) async {
  ArgumentError.checkNotNull(hostedZoneId, 'hostedZoneId');
  _s.validateStringLength(
    'hostedZoneId',
    hostedZoneId,
    0,
    32,
    isRequired: true,
  );
  _s.validateStringLength(
    'nextToken',
    nextToken,
    0,
    1024,
  );
  final $query = <String, List<String>>{
    if (maxResults != null) 'maxresults': [maxResults],
    if (nextToken != null) 'nexttoken': [nextToken],
  };
  final $result = await _protocol.send(
    method: 'GET',
    requestUri:
        '/2013-04-01/hostedzone/${Uri.encodeComponent(hostedZoneId)}/authorizevpcassociation',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListVPCAssociationAuthorizationsResponse.fromXml($result.body);
}