tagResource method

Future<void> tagResource({
  1. required String resource,
  2. required List<Tag> tags,
})

Adds tags to the specified AWS Elemental MediaStore container. Tags are key:value pairs that you can associate with AWS resources. For example, the tag key might be "customer" and the tag value might be "companyA." You can specify one or more tags to add to each container. You can add up to 50 tags to each container. For more information about tagging, including naming and usage conventions, see Tagging Resources in MediaStore.

May throw ContainerInUseException. May throw ContainerNotFoundException. May throw InternalServerError.

Parameter resource : The Amazon Resource Name (ARN) for the container.

Parameter tags : An array of key:value pairs that you want to add to the container. You need to specify only the tags that you want to add or update. For example, suppose a container already has two tags (customer:CompanyA and priority:High). You want to change the priority tag and also add a third tag (type:Contract). For TagResource, you specify the following tags: priority:Medium, type:Contract. The result is that your container has three tags: customer:CompanyA, priority:Medium, and type:Contract.

Implementation

Future<void> tagResource({
  required String resource,
  required List<Tag> tags,
}) async {
  ArgumentError.checkNotNull(resource, 'resource');
  _s.validateStringLength(
    'resource',
    resource,
    1,
    1024,
    isRequired: true,
  );
  ArgumentError.checkNotNull(tags, 'tags');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'MediaStore_20170901.TagResource'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'Resource': resource,
      'Tags': tags,
    },
  );
}