describeRegions method

Future<DescribeRegionsResult> describeRegions({
  1. required String directoryId,
  2. String? nextToken,
  3. String? regionName,
})

Provides information about the Regions that are configured for multi-Region replication.

May throw InvalidParameterException. May throw DirectoryDoesNotExistException. May throw UnsupportedOperationException. May throw InvalidNextTokenException. May throw AccessDeniedException. May throw ClientException. May throw ServiceException.

Parameter directoryId : The identifier of the directory.

Parameter nextToken : The DescribeRegionsResult.NextToken value from a previous call to DescribeRegions. Pass null if this is the first call.

Parameter regionName : The name of the Region. For example, us-east-1.

Implementation

Future<DescribeRegionsResult> describeRegions({
  required String directoryId,
  String? nextToken,
  String? regionName,
}) async {
  ArgumentError.checkNotNull(directoryId, 'directoryId');
  _s.validateStringLength(
    'regionName',
    regionName,
    8,
    32,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'DirectoryService_20150416.DescribeRegions'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'DirectoryId': directoryId,
      if (nextToken != null) 'NextToken': nextToken,
      if (regionName != null) 'RegionName': regionName,
    },
  );

  return DescribeRegionsResult.fromJson(jsonResponse.body);
}