/** * A key/value tag associated with a resource in the provider. Some providers * return tags as a list of objects taking this shape. */ declare type ResourceKeyValueTag = { Key?: string; Value?: string; key?: string; value?: string; }; /** * A listing of key/values associated with a resource in the provider. Some * providers return tags as a collection of objects with key/value properties. */ export declare type ResourceTagList = ResourceKeyValueTag[]; /** * A mapping of key/values associated with a resource in the provider. Some * providers return tags as a `Record`. */ export declare type ResourceTagMap = Record; /** * An entity representing a resource in the provider that has associated tags. * Tags are assigned as `tag.${key}` properties and in cases where a lowercased * tag name matches certain properties, the tag value will be transferred to * that property. */ export declare type TaggedEntity = { name?: string; displayName?: string; [tag: string]: string | string[] | boolean | number | undefined; }; /** * Assigns tags to properties of the entity. * * Tags having the key `'Name'` or `'name'` will be assigned to * `entity.displayName` and, unless a value is already present, `entity.name`. * * @param entity any object, it will be treated as a `TaggedEntity` * @param tags tags returned by provider APIs; may be undefined/null for * convenience (some APIs return those values) * @param assignProperties names of additional tags to transfer as direct entity * properties when a downcased tag key matches; the value of the tag will be * downcased as well! * * @returns entity for chaining convenience */ export declare function assignTags(entity: T, tags: ResourceKeyValueTag[] | ResourceTagMap | undefined | null, assignProperties?: string[]): T; export {};