addTagsToVault method

Future<void> addTagsToVault({
  1. required String accountId,
  2. required String vaultName,
  3. Map<String, String>? tags,
})

This operation adds the specified tags to a vault. Each tag is composed of a key and a value. Each vault can have up to 10 tags. If your request would cause the tag limit for the vault to be exceeded, the operation throws the LimitExceededException error. If a tag already exists on the vault under a specified key, the existing key value will be overwritten. For more information about tags, see Tagging Amazon S3 Glacier Resources.

May throw InvalidParameterValueException. May throw MissingParameterValueException. May throw ResourceNotFoundException. May throw LimitExceededException. May throw ServiceUnavailableException.

Parameter accountId : The AccountId value is the AWS account ID of the account that owns the vault. You can either specify an AWS account ID or optionally a single '-' (hyphen), in which case Amazon S3 Glacier uses the AWS account ID associated with the credentials used to sign the request. If you use an account ID, do not include any hyphens ('-') in the ID.

Parameter vaultName : The name of the vault.

Parameter tags : The tags to add to the vault. Each tag is composed of a key and a value. The value can be an empty string.

Implementation

Future<void> addTagsToVault({
  required String accountId,
  required String vaultName,
  Map<String, String>? tags,
}) async {
  ArgumentError.checkNotNull(accountId, 'accountId');
  ArgumentError.checkNotNull(vaultName, 'vaultName');
  final $payload = <String, dynamic>{
    if (tags != null) 'Tags': tags,
  };
  await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/${Uri.encodeComponent(accountId)}/vaults/${Uri.encodeComponent(vaultName)}/tags?operation=add',
    exceptionFnMap: _exceptionFns,
  );
}