createTargetDomain method

Future<CreateTargetDomainOutput> createTargetDomain({
  1. required String targetDomainName,
  2. required DomainVerificationMethod verificationMethod,
  3. Map<String, String>? tags,
})

Creates a new target domain for penetration testing. A target domain is a web domain that must be registered and verified before it can be tested.

Parameter targetDomainName : The domain name to register as a target domain.

Parameter verificationMethod : The method to use for verifying domain ownership. Valid values are DNS_TXT, HTTP_ROUTE, and PRIVATE_VPC.

Parameter tags : The tags to associate with the target domain.

Implementation

Future<CreateTargetDomainOutput> createTargetDomain({
  required String targetDomainName,
  required DomainVerificationMethod verificationMethod,
  Map<String, String>? tags,
}) async {
  final $payload = <String, dynamic>{
    'targetDomainName': targetDomainName,
    'verificationMethod': verificationMethod.value,
    if (tags != null) 'tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/CreateTargetDomain',
    exceptionFnMap: _exceptionFns,
  );
  return CreateTargetDomainOutput.fromJson(response);
}