{-# 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.QuickSight.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 the tags assigned to a resource. module Amazonka.QuickSight.ListTagsForResource ( -- * Creating a Request ListTagsForResource (..), newListTagsForResource, -- * Request Lenses listTagsForResource_resourceArn, -- * Destructuring the Response ListTagsForResourceResponse (..), newListTagsForResourceResponse, -- * Response Lenses listTagsForResourceResponse_requestId, listTagsForResourceResponse_tags, listTagsForResourceResponse_status, ) where import qualified Amazonka.Core as Core import qualified Amazonka.Core.Lens.Internal as Lens import qualified Amazonka.Data as Data import qualified Amazonka.Prelude as Prelude import Amazonka.QuickSight.Types import qualified Amazonka.Request as Request import qualified Amazonka.Response as Response -- | /See:/ 'newListTagsForResource' smart constructor. data ListTagsForResource = ListTagsForResource' { -- | The Amazon Resource Name (ARN) of the resource that you want a list of -- tags for. resourceArn :: 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: -- -- 'resourceArn', 'listTagsForResource_resourceArn' - The Amazon Resource Name (ARN) of the resource that you want a list of -- tags for. newListTagsForResource :: -- | 'resourceArn' Prelude.Text -> ListTagsForResource newListTagsForResource pResourceArn_ = ListTagsForResource' {resourceArn = pResourceArn_} -- | The Amazon Resource Name (ARN) of the resource that you want a list of -- tags for. listTagsForResource_resourceArn :: Lens.Lens' ListTagsForResource Prelude.Text listTagsForResource_resourceArn = Lens.lens (\ListTagsForResource' {resourceArn} -> resourceArn) (\s@ListTagsForResource' {} a -> s {resourceArn = a} :: ListTagsForResource) instance Core.AWSRequest ListTagsForResource where type AWSResponse ListTagsForResource = ListTagsForResourceResponse request overrides = Request.get (overrides defaultService) response = Response.receiveJSON ( \s h x -> ListTagsForResourceResponse' Prelude.<$> (x Data..?> "RequestId") Prelude.<*> (x Data..?> "Tags") Prelude.<*> (Prelude.pure (Prelude.fromEnum s)) ) instance Prelude.Hashable ListTagsForResource where hashWithSalt _salt ListTagsForResource' {..} = _salt `Prelude.hashWithSalt` resourceArn instance Prelude.NFData ListTagsForResource where rnf ListTagsForResource' {..} = Prelude.rnf resourceArn instance Data.ToHeaders ListTagsForResource where toHeaders = Prelude.const ( Prelude.mconcat [ "Content-Type" Data.=# ( "application/x-amz-json-1.0" :: Prelude.ByteString ) ] ) instance Data.ToPath ListTagsForResource where toPath ListTagsForResource' {..} = Prelude.mconcat ["/resources/", Data.toBS resourceArn, "/tags"] instance Data.ToQuery ListTagsForResource where toQuery = Prelude.const Prelude.mempty -- | /See:/ 'newListTagsForResourceResponse' smart constructor. data ListTagsForResourceResponse = ListTagsForResourceResponse' { -- | The Amazon Web Services request ID for this operation. requestId :: Prelude.Maybe Prelude.Text, -- | Contains a map of the key-value pairs for the resource tag or tags -- assigned to the resource. tags :: Prelude.Maybe (Prelude.NonEmpty Tag), -- | The HTTP status of the request. status :: Prelude.Int } deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic) -- | -- Create a value of 'ListTagsForResourceResponse' 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: -- -- 'requestId', 'listTagsForResourceResponse_requestId' - The Amazon Web Services request ID for this operation. -- -- 'tags', 'listTagsForResourceResponse_tags' - Contains a map of the key-value pairs for the resource tag or tags -- assigned to the resource. -- -- 'status', 'listTagsForResourceResponse_status' - The HTTP status of the request. newListTagsForResourceResponse :: -- | 'status' Prelude.Int -> ListTagsForResourceResponse newListTagsForResourceResponse pStatus_ = ListTagsForResourceResponse' { requestId = Prelude.Nothing, tags = Prelude.Nothing, status = pStatus_ } -- | The Amazon Web Services request ID for this operation. listTagsForResourceResponse_requestId :: Lens.Lens' ListTagsForResourceResponse (Prelude.Maybe Prelude.Text) listTagsForResourceResponse_requestId = Lens.lens (\ListTagsForResourceResponse' {requestId} -> requestId) (\s@ListTagsForResourceResponse' {} a -> s {requestId = a} :: ListTagsForResourceResponse) -- | Contains a map of the key-value pairs for the resource tag or tags -- assigned to the resource. listTagsForResourceResponse_tags :: Lens.Lens' ListTagsForResourceResponse (Prelude.Maybe (Prelude.NonEmpty Tag)) listTagsForResourceResponse_tags = Lens.lens (\ListTagsForResourceResponse' {tags} -> tags) (\s@ListTagsForResourceResponse' {} a -> s {tags = a} :: ListTagsForResourceResponse) Prelude.. Lens.mapping Lens.coerced -- | The HTTP status of the request. listTagsForResourceResponse_status :: Lens.Lens' ListTagsForResourceResponse Prelude.Int listTagsForResourceResponse_status = Lens.lens (\ListTagsForResourceResponse' {status} -> status) (\s@ListTagsForResourceResponse' {} a -> s {status = a} :: ListTagsForResourceResponse) instance Prelude.NFData ListTagsForResourceResponse where rnf ListTagsForResourceResponse' {..} = Prelude.rnf requestId `Prelude.seq` Prelude.rnf tags `Prelude.seq` Prelude.rnf status