addRegion method

Future<void> addRegion({
  1. required String directoryId,
  2. required String regionName,
  3. required DirectoryVpcSettings vPCSettings,
})

Adds two domain controllers in the specified Region for the specified directory.

May throw DirectoryUnavailableException. May throw InvalidParameterException. May throw EntityDoesNotExistException. May throw DirectoryAlreadyInRegionException. May throw UnsupportedOperationException. May throw DirectoryDoesNotExistException. May throw RegionLimitExceededException. May throw AccessDeniedException. May throw ClientException. May throw ServiceException.

Parameter directoryId : The identifier of the directory to which you want to add Region replication.

Parameter regionName : The name of the Region where you want to add domain controllers for replication. For example, us-east-1.

Implementation

Future<void> addRegion({
  required String directoryId,
  required String regionName,
  required DirectoryVpcSettings vPCSettings,
}) async {
  ArgumentError.checkNotNull(directoryId, 'directoryId');
  ArgumentError.checkNotNull(regionName, 'regionName');
  _s.validateStringLength(
    'regionName',
    regionName,
    8,
    32,
    isRequired: true,
  );
  ArgumentError.checkNotNull(vPCSettings, 'vPCSettings');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'DirectoryService_20150416.AddRegion'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'DirectoryId': directoryId,
      'RegionName': regionName,
      'VPCSettings': vPCSettings,
    },
  );
}