updateCACertificate method
Future<void>
updateCACertificate({
- required String certificateId,
- AutoRegistrationStatus? newAutoRegistrationStatus,
- CACertificateStatus? newStatus,
- RegistrationConfig? registrationConfig,
- bool? removeAutoRegistration,
Updates a registered CA certificate.
May throw ResourceNotFoundException. May throw InvalidRequestException. May throw ThrottlingException. May throw UnauthorizedException. May throw ServiceUnavailableException. May throw InternalFailureException.
Parameter certificateId
:
The CA certificate identifier.
Parameter newAutoRegistrationStatus
:
The new value for the auto registration status. Valid values are: "ENABLE"
or "DISABLE".
Parameter newStatus
:
The updated status of the CA certificate.
Note: The status value REGISTER_INACTIVE is deprecated and should not be used.
Parameter registrationConfig
:
Information about the registration configuration.
Parameter removeAutoRegistration
:
If true, removes auto registration.
Implementation
Future<void> updateCACertificate({
required String certificateId,
AutoRegistrationStatus? newAutoRegistrationStatus,
CACertificateStatus? newStatus,
RegistrationConfig? registrationConfig,
bool? removeAutoRegistration,
}) async {
ArgumentError.checkNotNull(certificateId, 'certificateId');
_s.validateStringLength(
'certificateId',
certificateId,
64,
64,
isRequired: true,
);
final $query = <String, List<String>>{
if (newAutoRegistrationStatus != null)
'newAutoRegistrationStatus': [newAutoRegistrationStatus.toValue()],
if (newStatus != null) 'newStatus': [newStatus.toValue()],
};
final $payload = <String, dynamic>{
if (registrationConfig != null) 'registrationConfig': registrationConfig,
if (removeAutoRegistration != null)
'removeAutoRegistration': removeAutoRegistration,
};
await _protocol.send(
payload: $payload,
method: 'PUT',
requestUri: '/cacertificate/${Uri.encodeComponent(certificateId)}',
queryParams: $query,
exceptionFnMap: _exceptionFns,
);
}