{-# 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.SESV2.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) -- -- Retrieve a list of the tags (keys and values) that are associated with a -- specified resource. A /tag/ is a label that you optionally define and -- associate with a resource. Each tag consists of a required /tag key/ and -- an optional associated /tag value/. A tag key is a general label that -- acts as a category for more specific tag values. A tag value acts as a -- descriptor within a tag key. module Amazonka.SESV2.ListTagsForResource ( -- * Creating a Request ListTagsForResource (..), newListTagsForResource, -- * Request Lenses listTagsForResource_resourceArn, -- * Destructuring the Response ListTagsForResourceResponse (..), newListTagsForResourceResponse, -- * Response Lenses listTagsForResourceResponse_httpStatus, 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.SESV2.Types -- | /See:/ 'newListTagsForResource' smart constructor. data ListTagsForResource = ListTagsForResource' { -- | The Amazon Resource Name (ARN) of the resource that you want to retrieve -- tag information 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 to retrieve -- tag information for. newListTagsForResource :: -- | 'resourceArn' Prelude.Text -> ListTagsForResource newListTagsForResource pResourceArn_ = ListTagsForResource' {resourceArn = pResourceArn_} -- | The Amazon Resource Name (ARN) of the resource that you want to retrieve -- tag information 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.<$> (Prelude.pure (Prelude.fromEnum s)) 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 = Prelude.const "/v2/email/tags" instance Data.ToQuery ListTagsForResource where toQuery ListTagsForResource' {..} = Prelude.mconcat ["ResourceArn" Data.=: resourceArn] -- | /See:/ 'newListTagsForResourceResponse' smart constructor. data ListTagsForResourceResponse = ListTagsForResourceResponse' { -- | The response's http status code. httpStatus :: Prelude.Int, -- | An array that lists all the tags that are associated with the resource. -- Each tag consists of a required tag key (@Key@) and an associated tag -- value (@Value@) tags :: [Tag] } 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. -- -- 'tags', 'listTagsForResourceResponse_tags' - An array that lists all the tags that are associated with the resource. -- Each tag consists of a required tag key (@Key@) and an associated tag -- value (@Value@) newListTagsForResourceResponse :: -- | 'httpStatus' Prelude.Int -> ListTagsForResourceResponse newListTagsForResourceResponse pHttpStatus_ = ListTagsForResourceResponse' { httpStatus = pHttpStatus_, 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) -- | An array that lists all the tags that are associated with the resource. -- Each tag consists of a required tag key (@Key@) and an associated tag -- value (@Value@) listTagsForResourceResponse_tags :: Lens.Lens' ListTagsForResourceResponse [Tag] 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 tags