updatePublicKey2018_11_05 method

Future<UpdatePublicKeyResult> updatePublicKey2018_11_05({
  1. required String id,
  2. required PublicKeyConfig publicKeyConfig,
  3. String? ifMatch,
})

Update public key information. Note that the only value you can change is the comment.

May throw AccessDenied. May throw CannotChangeImmutablePublicKeyFields. May throw InvalidArgument. May throw InvalidIfMatchVersion. May throw IllegalUpdate. May throw NoSuchPublicKey. May throw PreconditionFailed.

Parameter id : ID of the public key to be updated.

Parameter publicKeyConfig : Request to update public key information.

Parameter ifMatch : The value of the ETag header that you received when retrieving the public key to update. For example: E2QWRUHAPOMQZL.

Implementation

Future<UpdatePublicKeyResult> updatePublicKey2018_11_05({
  required String id,
  required PublicKeyConfig publicKeyConfig,
  String? ifMatch,
}) async {
  ArgumentError.checkNotNull(id, 'id');
  ArgumentError.checkNotNull(publicKeyConfig, 'publicKeyConfig');
  final headers = <String, String>{
    if (ifMatch != null) 'If-Match': ifMatch.toString(),
  };
  final $result = await _protocol.sendRaw(
    method: 'PUT',
    requestUri: '/2018-11-05/public-key/${Uri.encodeComponent(id)}/config',
    headers: headers,
    payload: publicKeyConfig.toXml('PublicKeyConfig'),
    exceptionFnMap: _exceptionFns,
  );
  final $elem = await _s.xmlFromResponse($result);
  return UpdatePublicKeyResult(
    publicKey: PublicKey.fromXml($elem),
    eTag: _s.extractHeaderStringValue($result.headers, 'ETag'),
  );
}