createDomain method

Future<CreateDomainResponse> createDomain({
  1. required String domainName,
})

Creates a new search domain. For more information, see Creating a Search Domain in the Amazon CloudSearch Developer Guide.

May throw BaseException. May throw InternalException. May throw LimitExceededException.

Parameter domainName : A name for the domain you are creating. Allowed characters are a-z (lower-case letters), 0-9, and hyphen (-). Domain names must start with a letter or number and be at least 3 and no more than 28 characters long.

Implementation

Future<CreateDomainResponse> createDomain({
  required String domainName,
}) async {
  ArgumentError.checkNotNull(domainName, 'domainName');
  _s.validateStringLength(
    'domainName',
    domainName,
    3,
    28,
    isRequired: true,
  );
  final $request = <String, dynamic>{};
  $request['DomainName'] = domainName;
  final $result = await _protocol.send(
    $request,
    action: 'CreateDomain',
    version: '2013-01-01',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    shape: shapes['CreateDomainRequest'],
    shapes: shapes,
    resultWrapper: 'CreateDomainResult',
  );
  return CreateDomainResponse.fromXml($result);
}