updateDomainAssociation method
Creates a new domain association for an Amplify app.
May throw BadRequestException.
May throw DependentServiceFailureException.
May throw InternalFailureException.
May throw NotFoundException.
May throw UnauthorizedException.
Parameter appId :
The unique ID for an Amplify app.
Parameter domainName :
The name of the domain.
Parameter autoSubDomainCreationPatterns :
Sets the branch patterns for automatic subdomain creation.
Parameter autoSubDomainIAMRole :
The required AWS Identity and Access Management (IAM) service role for the
Amazon Resource Name (ARN) for automatically creating subdomains.
Parameter certificateSettings :
The type of SSL/TLS certificate to use for your custom domain.
Parameter enableAutoSubDomain :
Enables the automated creation of subdomains for branches.
Parameter subDomainSettings :
Describes the settings for the subdomain.
Implementation
Future<UpdateDomainAssociationResult> updateDomainAssociation({
required String appId,
required String domainName,
List<String>? autoSubDomainCreationPatterns,
String? autoSubDomainIAMRole,
CertificateSettings? certificateSettings,
bool? enableAutoSubDomain,
List<SubDomainSetting>? subDomainSettings,
}) async {
final $payload = <String, dynamic>{
if (autoSubDomainCreationPatterns != null)
'autoSubDomainCreationPatterns': autoSubDomainCreationPatterns,
if (autoSubDomainIAMRole != null)
'autoSubDomainIAMRole': autoSubDomainIAMRole,
if (certificateSettings != null)
'certificateSettings': certificateSettings,
if (enableAutoSubDomain != null)
'enableAutoSubDomain': enableAutoSubDomain,
if (subDomainSettings != null) 'subDomainSettings': subDomainSettings,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri:
'/apps/${Uri.encodeComponent(appId)}/domains/${Uri.encodeComponent(domainName)}',
exceptionFnMap: _exceptionFns,
);
return UpdateDomainAssociationResult.fromJson(response);
}