tags: Get, set, and delete object tags

tagsR Documentation

Get, set, and delete object tags

Description

Tags are metadata stored in an object's attributes, used to store types and names needed to make AWS API requests.

tag_get returns the value of the given tag, or "" if the tag doesn't exist.

tag_has returns whether the object has the given tag.

tag_add returns the object after adding the given list of tags and values.

tag_del returns the object after recursively deleting tags in tags, or all tags if NULL.

type returns broadly what type an object is, based on its type tag.

Usage

tag_get(object, tag)

tag_get_all(object)

tag_has(object, tag)

tag_add(object, tags)

tag_del(object, tags = NULL)

type(object)

Arguments

object

An object.

tag

A tag name.

tags

A list of tags.

  • tag_add: A named vector with tag names and their values.

  • tag_del: A character vector of tags to delete.

Examples

foo <- list()
foo <- tag_add(foo, list(tag_name = "tag_value"))
tag_has(foo, "tag_name") # TRUE
tag_get(foo, "tag_name") # "tag_value"
tag_get(foo, "not_exist") # ""
foo <- tag_del(foo)
tag_has(foo, "tag_name") # FALSE


paws.common documentation built on Oct. 4, 2024, 1:08 a.m.