{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# OPTIONS_GHC -fno-warn-unused-binds #-} {-# OPTIONS_GHC -fno-warn-unused-matches #-} -- Derived from AWS service descriptions, licensed under Apache 2.0. -- | -- Module : Network.AWS.ElastiCache.AddTagsToResource -- Copyright : (c) 2013-2016 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay -- Stability : auto-generated -- Portability : non-portable (GHC extensions) -- -- The /AddTagsToResource/ action adds up to 10 cost allocation tags to the -- named resource. A /cost allocation tag/ is a key-value pair where the -- key and value are case-sensitive. Cost allocation tags can be used to -- categorize and track your AWS costs. -- -- When you apply tags to your ElastiCache resources, AWS generates a cost -- allocation report as a comma-separated value (CSV) file with your usage -- and costs aggregated by your tags. You can apply tags that represent -- business categories (such as cost centers, application names, or owners) -- to organize your costs across multiple services. For more information, -- see -- . module Network.AWS.ElastiCache.AddTagsToResource ( -- * Creating a Request addTagsToResource , AddTagsToResource -- * Request Lenses , attrResourceName , attrTags -- * Destructuring the Response , tagListMessage , TagListMessage -- * Response Lenses , tlmTagList ) where import Network.AWS.ElastiCache.Types import Network.AWS.ElastiCache.Types.Product import Network.AWS.Lens import Network.AWS.Prelude import Network.AWS.Request import Network.AWS.Response -- | Represents the input of an /AddTagsToResource/ action. -- -- /See:/ 'addTagsToResource' smart constructor. data AddTagsToResource = AddTagsToResource' { _attrResourceName :: !Text , _attrTags :: ![Tag] } deriving (Eq,Read,Show,Data,Typeable,Generic) -- | Creates a value of 'AddTagsToResource' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'attrResourceName' -- -- * 'attrTags' addTagsToResource :: Text -- ^ 'attrResourceName' -> AddTagsToResource addTagsToResource pResourceName_ = AddTagsToResource' { _attrResourceName = pResourceName_ , _attrTags = mempty } -- | The Amazon Resource Name (ARN) of the resource to which the tags are to -- be added, for example -- 'arn:aws:elasticache:us-west-2:0123456789:cluster:myCluster' or -- 'arn:aws:elasticache:us-west-2:0123456789:snapshot:mySnapshot'. -- -- For more information on ARNs, go to -- . attrResourceName :: Lens' AddTagsToResource Text attrResourceName = lens _attrResourceName (\ s a -> s{_attrResourceName = a}); -- | A list of cost allocation tags to be added to this resource. A tag is a -- key-value pair. A tag key must be accompanied by a tag value. attrTags :: Lens' AddTagsToResource [Tag] attrTags = lens _attrTags (\ s a -> s{_attrTags = a}) . _Coerce; instance AWSRequest AddTagsToResource where type Rs AddTagsToResource = TagListMessage request = postQuery elastiCache response = receiveXMLWrapper "AddTagsToResourceResult" (\ s h x -> parseXML x) instance Hashable AddTagsToResource instance NFData AddTagsToResource instance ToHeaders AddTagsToResource where toHeaders = const mempty instance ToPath AddTagsToResource where toPath = const "/" instance ToQuery AddTagsToResource where toQuery AddTagsToResource'{..} = mconcat ["Action" =: ("AddTagsToResource" :: ByteString), "Version" =: ("2015-02-02" :: ByteString), "ResourceName" =: _attrResourceName, "Tags" =: toQueryList "Tag" _attrTags]