{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DuplicateRecordFields #-} {-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE StrictData #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE NoImplicitPrelude #-} {-# OPTIONS_GHC -fno-warn-unused-binds #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# OPTIONS_GHC -fno-warn-unused-matches #-} -- Derived from AWS service descriptions, licensed under Apache 2.0. -- | -- Module : Amazonka.ElastiCache.AddTagsToResource -- Copyright : (c) 2013-2023 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay -- Stability : auto-generated -- Portability : non-portable (GHC extensions) -- -- A tag is a key-value pair where the key and value are case-sensitive. -- You can use tags to categorize and track all your ElastiCache resources, -- with the exception of global replication group. When you add or remove -- tags on replication groups, those actions will be replicated to all -- nodes in the replication group. For more information, see -- . -- -- For example, you can use cost-allocation tags to your ElastiCache -- resources, Amazon 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 -- -- in the /ElastiCache User Guide/. module Amazonka.ElastiCache.AddTagsToResource ( -- * Creating a Request AddTagsToResource (..), newAddTagsToResource, -- * Request Lenses addTagsToResource_resourceName, addTagsToResource_tags, -- * Destructuring the Response TagListMessage (..), newTagListMessage, -- * Response Lenses tagListMessage_tagList, ) where import qualified Amazonka.Core as Core import qualified Amazonka.Core.Lens.Internal as Lens import qualified Amazonka.Data as Data import Amazonka.ElastiCache.Types import qualified Amazonka.Prelude as Prelude import qualified Amazonka.Request as Request import qualified Amazonka.Response as Response -- | Represents the input of an AddTagsToResource operation. -- -- /See:/ 'newAddTagsToResource' smart constructor. data AddTagsToResource = AddTagsToResource' { -- | 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@. -- ElastiCache resources are /cluster/ and /snapshot/. -- -- For more information about ARNs, see -- . resourceName :: Prelude.Text, -- | A list of tags to be added to this resource. A tag is a key-value pair. -- A tag key must be accompanied by a tag value, although null is accepted. tags :: [Tag] } deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic) -- | -- Create a value of 'AddTagsToResource' with all optional fields omitted. -- -- Use or to modify other optional fields. -- -- The following record fields are available, with the corresponding lenses provided -- for backwards compatibility: -- -- 'resourceName', 'addTagsToResource_resourceName' - 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@. -- ElastiCache resources are /cluster/ and /snapshot/. -- -- For more information about ARNs, see -- . -- -- 'tags', 'addTagsToResource_tags' - A list of tags to be added to this resource. A tag is a key-value pair. -- A tag key must be accompanied by a tag value, although null is accepted. newAddTagsToResource :: -- | 'resourceName' Prelude.Text -> AddTagsToResource newAddTagsToResource pResourceName_ = AddTagsToResource' { resourceName = pResourceName_, tags = Prelude.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@. -- ElastiCache resources are /cluster/ and /snapshot/. -- -- For more information about ARNs, see -- . addTagsToResource_resourceName :: Lens.Lens' AddTagsToResource Prelude.Text addTagsToResource_resourceName = Lens.lens (\AddTagsToResource' {resourceName} -> resourceName) (\s@AddTagsToResource' {} a -> s {resourceName = a} :: AddTagsToResource) -- | A list of tags to be added to this resource. A tag is a key-value pair. -- A tag key must be accompanied by a tag value, although null is accepted. addTagsToResource_tags :: Lens.Lens' AddTagsToResource [Tag] addTagsToResource_tags = Lens.lens (\AddTagsToResource' {tags} -> tags) (\s@AddTagsToResource' {} a -> s {tags = a} :: AddTagsToResource) Prelude.. Lens.coerced instance Core.AWSRequest AddTagsToResource where type AWSResponse AddTagsToResource = TagListMessage request overrides = Request.postQuery (overrides defaultService) response = Response.receiveXMLWrapper "AddTagsToResourceResult" (\s h x -> Data.parseXML x) instance Prelude.Hashable AddTagsToResource where hashWithSalt _salt AddTagsToResource' {..} = _salt `Prelude.hashWithSalt` resourceName `Prelude.hashWithSalt` tags instance Prelude.NFData AddTagsToResource where rnf AddTagsToResource' {..} = Prelude.rnf resourceName `Prelude.seq` Prelude.rnf tags instance Data.ToHeaders AddTagsToResource where toHeaders = Prelude.const Prelude.mempty instance Data.ToPath AddTagsToResource where toPath = Prelude.const "/" instance Data.ToQuery AddTagsToResource where toQuery AddTagsToResource' {..} = Prelude.mconcat [ "Action" Data.=: ("AddTagsToResource" :: Prelude.ByteString), "Version" Data.=: ("2015-02-02" :: Prelude.ByteString), "ResourceName" Data.=: resourceName, "Tags" Data.=: Data.toQueryList "Tag" tags ]