{-# 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.Rum.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) -- -- Displays the tags associated with a CloudWatch RUM resource. module Amazonka.Rum.ListTagsForResource ( -- * Creating a Request ListTagsForResource (..), newListTagsForResource, -- * Request Lenses listTagsForResource_resourceArn, -- * Destructuring the Response ListTagsForResourceResponse (..), newListTagsForResourceResponse, -- * Response Lenses listTagsForResourceResponse_httpStatus, listTagsForResourceResponse_resourceArn, listTagsForResourceResponse_tags, ) 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 qualified Amazonka.Request as Request import qualified Amazonka.Response as Response import Amazonka.Rum.Types -- | /See:/ 'newListTagsForResource' smart constructor. data ListTagsForResource = ListTagsForResource' { -- | The ARN of the resource that you want to see the tags of. 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 ARN of the resource that you want to see the tags of. newListTagsForResource :: -- | 'resourceArn' Prelude.Text -> ListTagsForResource newListTagsForResource pResourceArn_ = ListTagsForResource' {resourceArn = pResourceArn_} -- | The ARN of the resource that you want to see the tags of. 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.<$> (Prelude.pure (Prelude.fromEnum s)) Prelude.<*> (x Data..:> "ResourceArn") Prelude.<*> (x Data..?> "Tags" Core..!@ Prelude.mempty) ) 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.1" :: Prelude.ByteString ) ] ) instance Data.ToPath ListTagsForResource where toPath ListTagsForResource' {..} = Prelude.mconcat ["/tags/", Data.toBS resourceArn] instance Data.ToQuery ListTagsForResource where toQuery = Prelude.const Prelude.mempty -- | /See:/ 'newListTagsForResourceResponse' smart constructor. data ListTagsForResourceResponse = ListTagsForResourceResponse' { -- | The response's http status code. httpStatus :: Prelude.Int, -- | The ARN of the resource that you are viewing. resourceArn :: Prelude.Text, -- | The list of tag keys and values associated with the resource you -- specified. tags :: Prelude.HashMap Prelude.Text Prelude.Text } 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: -- -- 'httpStatus', 'listTagsForResourceResponse_httpStatus' - The response's http status code. -- -- 'resourceArn', 'listTagsForResourceResponse_resourceArn' - The ARN of the resource that you are viewing. -- -- 'tags', 'listTagsForResourceResponse_tags' - The list of tag keys and values associated with the resource you -- specified. newListTagsForResourceResponse :: -- | 'httpStatus' Prelude.Int -> -- | 'resourceArn' Prelude.Text -> ListTagsForResourceResponse newListTagsForResourceResponse pHttpStatus_ pResourceArn_ = ListTagsForResourceResponse' { httpStatus = pHttpStatus_, resourceArn = pResourceArn_, tags = Prelude.mempty } -- | The response's http status code. listTagsForResourceResponse_httpStatus :: Lens.Lens' ListTagsForResourceResponse Prelude.Int listTagsForResourceResponse_httpStatus = Lens.lens (\ListTagsForResourceResponse' {httpStatus} -> httpStatus) (\s@ListTagsForResourceResponse' {} a -> s {httpStatus = a} :: ListTagsForResourceResponse) -- | The ARN of the resource that you are viewing. listTagsForResourceResponse_resourceArn :: Lens.Lens' ListTagsForResourceResponse Prelude.Text listTagsForResourceResponse_resourceArn = Lens.lens (\ListTagsForResourceResponse' {resourceArn} -> resourceArn) (\s@ListTagsForResourceResponse' {} a -> s {resourceArn = a} :: ListTagsForResourceResponse) -- | The list of tag keys and values associated with the resource you -- specified. listTagsForResourceResponse_tags :: Lens.Lens' ListTagsForResourceResponse (Prelude.HashMap Prelude.Text Prelude.Text) listTagsForResourceResponse_tags = Lens.lens (\ListTagsForResourceResponse' {tags} -> tags) (\s@ListTagsForResourceResponse' {} a -> s {tags = a} :: ListTagsForResourceResponse) Prelude.. Lens.coerced instance Prelude.NFData ListTagsForResourceResponse where rnf ListTagsForResourceResponse' {..} = Prelude.rnf httpStatus `Prelude.seq` Prelude.rnf resourceArn `Prelude.seq` Prelude.rnf tags