updateDomainConfiguration method

Future<UpdateDomainConfigurationResponse> updateDomainConfiguration({
  1. required String domainConfigurationName,
  2. AuthorizerConfig? authorizerConfig,
  3. DomainConfigurationStatus? domainConfigurationStatus,
  4. bool? removeAuthorizerConfig,
})

Updates values stored in the domain configuration. Domain configurations for default endpoints can't be updated.

May throw ResourceNotFoundException. May throw CertificateValidationException. May throw InvalidRequestException. May throw ThrottlingException. May throw UnauthorizedException. May throw ServiceUnavailableException. May throw InternalFailureException.

Parameter domainConfigurationName : The name of the domain configuration to be updated.

Parameter authorizerConfig : An object that specifies the authorization service for a domain.

Parameter domainConfigurationStatus : The status to which the domain configuration should be updated.

Parameter removeAuthorizerConfig : Removes the authorization configuration from a domain.

Implementation

Future<UpdateDomainConfigurationResponse> updateDomainConfiguration({
  required String domainConfigurationName,
  AuthorizerConfig? authorizerConfig,
  DomainConfigurationStatus? domainConfigurationStatus,
  bool? removeAuthorizerConfig,
}) async {
  ArgumentError.checkNotNull(
      domainConfigurationName, 'domainConfigurationName');
  _s.validateStringLength(
    'domainConfigurationName',
    domainConfigurationName,
    1,
    128,
    isRequired: true,
  );
  final $payload = <String, dynamic>{
    if (authorizerConfig != null) 'authorizerConfig': authorizerConfig,
    if (domainConfigurationStatus != null)
      'domainConfigurationStatus': domainConfigurationStatus.toValue(),
    if (removeAuthorizerConfig != null)
      'removeAuthorizerConfig': removeAuthorizerConfig,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri:
        '/domainConfigurations/${Uri.encodeComponent(domainConfigurationName)}',
    exceptionFnMap: _exceptionFns,
  );
  return UpdateDomainConfigurationResponse.fromJson(response);
}