createKeyValueStore method

Future<CreateKeyValueStoreResult> createKeyValueStore({
  1. required String name,
  2. String? comment,
  3. ImportSource? importSource,
  4. Tags? tags,
})

Specifies the key value store resource to add to your account. In your account, the key value store names must be unique. You can also import key value store data in JSON format from an S3 bucket by providing a valid ImportSource that you own.

May throw AccessDenied. May throw EntityAlreadyExists. May throw EntityLimitExceeded. May throw EntitySizeLimitExceeded. May throw InvalidArgument. May throw UnsupportedOperation.

Parameter name : The name of the key value store. The minimum length is 1 character and the maximum length is 64 characters.

Parameter comment : The comment of the key value store.

Parameter importSource : The S3 bucket that provides the source for the import. The source must be in a valid JSON format.

Implementation

Future<CreateKeyValueStoreResult> createKeyValueStore({
  required String name,
  String? comment,
  ImportSource? importSource,
  Tags? tags,
}) async {
  final $result = await _protocol.sendRaw(
    method: 'POST',
    requestUri: '/2020-05-31/key-value-store',
    payload: CreateKeyValueStoreRequest(
            name: name,
            comment: comment,
            importSource: importSource,
            tags: tags)
        .toXml('CreateKeyValueStoreRequest'),
    exceptionFnMap: _exceptionFns,
  );
  final $elem = await _s.xmlFromResponse($result);
  return CreateKeyValueStoreResult(
    keyValueStore: KeyValueStore.fromXml($elem),
    eTag: _s.extractHeaderStringValue($result.headers, 'ETag'),
    location: _s.extractHeaderStringValue($result.headers, 'Location'),
  );
}