createDomainName method
Creates a domain name.
May throw AccessDeniedException.
May throw BadRequestException.
May throw ConflictException.
May throw NotFoundException.
May throw TooManyRequestsException.
Parameter domainName :
The domain name.
Parameter domainNameConfigurations :
The domain name configurations.
Parameter mutualTlsAuthentication :
The mutual TLS authentication configuration for a custom domain name.
Parameter routingMode :
The routing mode.
Parameter tags :
The collection of tags associated with a domain name.
Implementation
Future<CreateDomainNameResponse> createDomainName({
required String domainName,
List<DomainNameConfiguration>? domainNameConfigurations,
MutualTlsAuthenticationInput? mutualTlsAuthentication,
RoutingMode? routingMode,
Map<String, String>? tags,
}) async {
final $payload = <String, dynamic>{
'domainName': domainName,
if (domainNameConfigurations != null)
'domainNameConfigurations': domainNameConfigurations,
if (mutualTlsAuthentication != null)
'mutualTlsAuthentication': mutualTlsAuthentication,
if (routingMode != null) 'routingMode': routingMode.value,
if (tags != null) 'tags': tags,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/v2/domainnames',
exceptionFnMap: _exceptionFns,
);
return CreateDomainNameResponse.fromJson(response);
}