updateServerCertificate method

Future<void> updateServerCertificate({
  1. required String serverCertificateName,
  2. String? newPath,
  3. String? newServerCertificateName,
})

Updates the name and/or the path of the specified server certificate stored in IAM.

For more information about working with server certificates, see Working with Server Certificates in the IAM User Guide. This topic also includes a list of AWS services that can use the server certificates that you manage with IAM.

May throw NoSuchEntityException. May throw EntityAlreadyExistsException. May throw LimitExceededException. May throw ServiceFailureException.

Parameter serverCertificateName : The name of the server certificate that you want to update.

This parameter allows (through its regex pattern) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-

Parameter newPath : The new path for the server certificate. Include this only if you are updating the server certificate's path.

This parameter allows (through its regex pattern) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (\u0021) through the DEL character (\u007F), including most punctuation characters, digits, and upper and lowercased letters.

Parameter newServerCertificateName : The new name for the server certificate. Include this only if you are updating the server certificate's name. The name of the certificate cannot contain any spaces.

This parameter allows (through its regex pattern) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-

Implementation

Future<void> updateServerCertificate({
  required String serverCertificateName,
  String? newPath,
  String? newServerCertificateName,
}) async {
  ArgumentError.checkNotNull(serverCertificateName, 'serverCertificateName');
  _s.validateStringLength(
    'serverCertificateName',
    serverCertificateName,
    1,
    128,
    isRequired: true,
  );
  _s.validateStringLength(
    'newPath',
    newPath,
    1,
    512,
  );
  _s.validateStringLength(
    'newServerCertificateName',
    newServerCertificateName,
    1,
    128,
  );
  final $request = <String, dynamic>{};
  $request['ServerCertificateName'] = serverCertificateName;
  newPath?.also((arg) => $request['NewPath'] = arg);
  newServerCertificateName
      ?.also((arg) => $request['NewServerCertificateName'] = arg);
  await _protocol.send(
    $request,
    action: 'UpdateServerCertificate',
    version: '2010-05-08',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    shape: shapes['UpdateServerCertificateRequest'],
    shapes: shapes,
  );
}