{-# 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.ListTagsForResource -- Copyright : (c) 2013-2023 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay -- Stability : auto-generated -- Portability : non-portable (GHC extensions) -- -- Lists all tags currently on a named resource. -- -- 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 -- . -- -- If the cluster is not in the /available/ state, @ListTagsForResource@ -- returns an error. module Amazonka.ElastiCache.ListTagsForResource ( -- * Creating a Request ListTagsForResource (..), newListTagsForResource, -- * Request Lenses listTagsForResource_resourceName, -- * 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 -- | The input parameters for the @ListTagsForResource@ operation. -- -- /See:/ 'newListTagsForResource' smart constructor. data ListTagsForResource = ListTagsForResource' { -- | The Amazon Resource Name (ARN) of the resource for which you want the -- list of tags, for example -- @arn:aws:elasticache:us-west-2:0123456789:cluster:myCluster@ or -- @arn:aws:elasticache:us-west-2:0123456789:snapshot:mySnapshot@. -- -- For more information about ARNs, see -- . resourceName :: Prelude.Text } deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic) -- | -- Create a value of 'ListTagsForResource' 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', 'listTagsForResource_resourceName' - The Amazon Resource Name (ARN) of the resource for which you want the -- list of tags, for example -- @arn:aws:elasticache:us-west-2:0123456789:cluster:myCluster@ or -- @arn:aws:elasticache:us-west-2:0123456789:snapshot:mySnapshot@. -- -- For more information about ARNs, see -- . newListTagsForResource :: -- | 'resourceName' Prelude.Text -> ListTagsForResource newListTagsForResource pResourceName_ = ListTagsForResource' {resourceName = pResourceName_} -- | The Amazon Resource Name (ARN) of the resource for which you want the -- list of tags, for example -- @arn:aws:elasticache:us-west-2:0123456789:cluster:myCluster@ or -- @arn:aws:elasticache:us-west-2:0123456789:snapshot:mySnapshot@. -- -- For more information about ARNs, see -- . listTagsForResource_resourceName :: Lens.Lens' ListTagsForResource Prelude.Text listTagsForResource_resourceName = Lens.lens (\ListTagsForResource' {resourceName} -> resourceName) (\s@ListTagsForResource' {} a -> s {resourceName = a} :: ListTagsForResource) instance Core.AWSRequest ListTagsForResource where type AWSResponse ListTagsForResource = TagListMessage request overrides = Request.postQuery (overrides defaultService) response = Response.receiveXMLWrapper "ListTagsForResourceResult" (\s h x -> Data.parseXML x) instance Prelude.Hashable ListTagsForResource where hashWithSalt _salt ListTagsForResource' {..} = _salt `Prelude.hashWithSalt` resourceName instance Prelude.NFData ListTagsForResource where rnf ListTagsForResource' {..} = Prelude.rnf resourceName instance Data.ToHeaders ListTagsForResource where toHeaders = Prelude.const Prelude.mempty instance Data.ToPath ListTagsForResource where toPath = Prelude.const "/" instance Data.ToQuery ListTagsForResource where toQuery ListTagsForResource' {..} = Prelude.mconcat [ "Action" Data.=: ("ListTagsForResource" :: Prelude.ByteString), "Version" Data.=: ("2015-02-02" :: Prelude.ByteString), "ResourceName" Data.=: resourceName ]