createPublicKey2018_06_18 method

Future<CreatePublicKeyResult> createPublicKey2018_06_18(
  1. {@required PublicKeyConfig publicKeyConfig}
)

Add a new public key to CloudFront to use, for example, for field-level encryption. You can add a maximum of 10 public keys with one AWS account.

May throw PublicKeyAlreadyExists. May throw InvalidArgument. May throw TooManyPublicKeys.

Parameter publicKeyConfig : The request to add a public key to CloudFront.

Implementation

Future<CreatePublicKeyResult> createPublicKey2018_06_18({
  @_s.required PublicKeyConfig publicKeyConfig,
}) async {
  ArgumentError.checkNotNull(publicKeyConfig, 'publicKeyConfig');
  final $result = await _protocol.sendRaw(
    method: 'POST',
    requestUri: '/2018-06-18/public-key',
    payload: publicKeyConfig.toXml('PublicKeyConfig'),
    exceptionFnMap: _exceptionFns,
  );
  final $elem = await _s.xmlFromResponse($result);
  return CreatePublicKeyResult(
    publicKey: PublicKey.fromXml($elem),
    eTag: _s.extractHeaderStringValue($result.headers, 'ETag'),
    location: _s.extractHeaderStringValue($result.headers, 'Location'),
  );
}