updatePublicKey2018_06_18 method

Future<UpdatePublicKeyResult> updatePublicKey2018_06_18(
  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_06_18({
  @_s.required String id,
  @_s.required PublicKeyConfig publicKeyConfig,
  String ifMatch,
}) async {
  ArgumentError.checkNotNull(id, 'id');
  ArgumentError.checkNotNull(publicKeyConfig, 'publicKeyConfig');
  final headers = <String, String>{};
  ifMatch?.let((v) => headers['If-Match'] = v.toString());
  final $result = await _protocol.sendRaw(
    method: 'PUT',
    requestUri: '/2018-06-18/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'),
  );
}