{-# 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.KMS.ListResourceTags
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Returns all tags on the specified KMS key.
--
-- For general information about tags, including the format and syntax, see
-- <https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html Tagging Amazon Web Services resources>
-- in the /Amazon Web Services General Reference/. For information about
-- using tags in KMS, see
-- <https://docs.aws.amazon.com/kms/latest/developerguide/tagging-keys.html Tagging keys>.
--
-- __Cross-account use__: No. You cannot perform this operation on a KMS
-- key in a different Amazon Web Services account.
--
-- __Required permissions__:
-- <https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html kms:ListResourceTags>
-- (key policy)
--
-- __Related operations:__
--
-- -   CreateKey
--
-- -   ReplicateKey
--
-- -   TagResource
--
-- -   UntagResource
module Amazonka.KMS.ListResourceTags
  ( -- * Creating a Request
    ListResourceTags (..),
    newListResourceTags,

    -- * Request Lenses
    listResourceTags_marker,
    listResourceTags_limit,
    listResourceTags_keyId,

    -- * Destructuring the Response
    ListResourceTagsResponse (..),
    newListResourceTagsResponse,

    -- * Response Lenses
    listResourceTagsResponse_truncated,
    listResourceTagsResponse_nextMarker,
    listResourceTagsResponse_tags,
    listResourceTagsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.KMS.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newListResourceTags' smart constructor.
data ListResourceTags = ListResourceTags'
  { -- | Use this parameter in a subsequent request after you receive a response
    -- with truncated results. Set it to the value of @NextMarker@ from the
    -- truncated response you just received.
    --
    -- Do not attempt to construct this value. Use only the value of
    -- @NextMarker@ from the truncated response you just received.
    ListResourceTags -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | Use this parameter to specify the maximum number of items to return.
    -- When this value is present, KMS does not return more than the specified
    -- number of items, but it might return fewer.
    --
    -- This value is optional. If you include a value, it must be between 1 and
    -- 50, inclusive. If you do not include a value, it defaults to 50.
    ListResourceTags -> Maybe Natural
limit :: Prelude.Maybe Prelude.Natural,
    -- | Gets tags on the specified KMS key.
    --
    -- Specify the key ID or key ARN of the KMS key.
    --
    -- For example:
    --
    -- -   Key ID: @1234abcd-12ab-34cd-56ef-1234567890ab@
    --
    -- -   Key ARN:
    --     @arn:aws:kms:us-east-2:111122223333:key\/1234abcd-12ab-34cd-56ef-1234567890ab@
    --
    -- To get the key ID and key ARN for a KMS key, use ListKeys or
    -- DescribeKey.
    ListResourceTags -> Text
keyId :: Prelude.Text
  }
  deriving (ListResourceTags -> ListResourceTags -> Bool
(ListResourceTags -> ListResourceTags -> Bool)
-> (ListResourceTags -> ListResourceTags -> Bool)
-> Eq ListResourceTags
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListResourceTags -> ListResourceTags -> Bool
$c/= :: ListResourceTags -> ListResourceTags -> Bool
== :: ListResourceTags -> ListResourceTags -> Bool
$c== :: ListResourceTags -> ListResourceTags -> Bool
Prelude.Eq, ReadPrec [ListResourceTags]
ReadPrec ListResourceTags
Int -> ReadS ListResourceTags
ReadS [ListResourceTags]
(Int -> ReadS ListResourceTags)
-> ReadS [ListResourceTags]
-> ReadPrec ListResourceTags
-> ReadPrec [ListResourceTags]
-> Read ListResourceTags
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListResourceTags]
$creadListPrec :: ReadPrec [ListResourceTags]
readPrec :: ReadPrec ListResourceTags
$creadPrec :: ReadPrec ListResourceTags
readList :: ReadS [ListResourceTags]
$creadList :: ReadS [ListResourceTags]
readsPrec :: Int -> ReadS ListResourceTags
$creadsPrec :: Int -> ReadS ListResourceTags
Prelude.Read, Int -> ListResourceTags -> ShowS
[ListResourceTags] -> ShowS
ListResourceTags -> String
(Int -> ListResourceTags -> ShowS)
-> (ListResourceTags -> String)
-> ([ListResourceTags] -> ShowS)
-> Show ListResourceTags
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListResourceTags] -> ShowS
$cshowList :: [ListResourceTags] -> ShowS
show :: ListResourceTags -> String
$cshow :: ListResourceTags -> String
showsPrec :: Int -> ListResourceTags -> ShowS
$cshowsPrec :: Int -> ListResourceTags -> ShowS
Prelude.Show, (forall x. ListResourceTags -> Rep ListResourceTags x)
-> (forall x. Rep ListResourceTags x -> ListResourceTags)
-> Generic ListResourceTags
forall x. Rep ListResourceTags x -> ListResourceTags
forall x. ListResourceTags -> Rep ListResourceTags x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListResourceTags x -> ListResourceTags
$cfrom :: forall x. ListResourceTags -> Rep ListResourceTags x
Prelude.Generic)

-- |
-- Create a value of 'ListResourceTags' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'marker', 'listResourceTags_marker' - Use this parameter in a subsequent request after you receive a response
-- with truncated results. Set it to the value of @NextMarker@ from the
-- truncated response you just received.
--
-- Do not attempt to construct this value. Use only the value of
-- @NextMarker@ from the truncated response you just received.
--
-- 'limit', 'listResourceTags_limit' - Use this parameter to specify the maximum number of items to return.
-- When this value is present, KMS does not return more than the specified
-- number of items, but it might return fewer.
--
-- This value is optional. If you include a value, it must be between 1 and
-- 50, inclusive. If you do not include a value, it defaults to 50.
--
-- 'keyId', 'listResourceTags_keyId' - Gets tags on the specified KMS key.
--
-- Specify the key ID or key ARN of the KMS key.
--
-- For example:
--
-- -   Key ID: @1234abcd-12ab-34cd-56ef-1234567890ab@
--
-- -   Key ARN:
--     @arn:aws:kms:us-east-2:111122223333:key\/1234abcd-12ab-34cd-56ef-1234567890ab@
--
-- To get the key ID and key ARN for a KMS key, use ListKeys or
-- DescribeKey.
newListResourceTags ::
  -- | 'keyId'
  Prelude.Text ->
  ListResourceTags
newListResourceTags :: Text -> ListResourceTags
newListResourceTags Text
pKeyId_ =
  ListResourceTags' :: Maybe Text -> Maybe Natural -> Text -> ListResourceTags
ListResourceTags'
    { $sel:marker:ListResourceTags' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:limit:ListResourceTags' :: Maybe Natural
limit = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:keyId:ListResourceTags' :: Text
keyId = Text
pKeyId_
    }

-- | Use this parameter in a subsequent request after you receive a response
-- with truncated results. Set it to the value of @NextMarker@ from the
-- truncated response you just received.
--
-- Do not attempt to construct this value. Use only the value of
-- @NextMarker@ from the truncated response you just received.
listResourceTags_marker :: Lens.Lens' ListResourceTags (Prelude.Maybe Prelude.Text)
listResourceTags_marker :: (Maybe Text -> f (Maybe Text))
-> ListResourceTags -> f ListResourceTags
listResourceTags_marker = (ListResourceTags -> Maybe Text)
-> (ListResourceTags -> Maybe Text -> ListResourceTags)
-> Lens ListResourceTags ListResourceTags (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListResourceTags' {Maybe Text
marker :: Maybe Text
$sel:marker:ListResourceTags' :: ListResourceTags -> Maybe Text
marker} -> Maybe Text
marker) (\s :: ListResourceTags
s@ListResourceTags' {} Maybe Text
a -> ListResourceTags
s {$sel:marker:ListResourceTags' :: Maybe Text
marker = Maybe Text
a} :: ListResourceTags)

-- | Use this parameter to specify the maximum number of items to return.
-- When this value is present, KMS does not return more than the specified
-- number of items, but it might return fewer.
--
-- This value is optional. If you include a value, it must be between 1 and
-- 50, inclusive. If you do not include a value, it defaults to 50.
listResourceTags_limit :: Lens.Lens' ListResourceTags (Prelude.Maybe Prelude.Natural)
listResourceTags_limit :: (Maybe Natural -> f (Maybe Natural))
-> ListResourceTags -> f ListResourceTags
listResourceTags_limit = (ListResourceTags -> Maybe Natural)
-> (ListResourceTags -> Maybe Natural -> ListResourceTags)
-> Lens
     ListResourceTags ListResourceTags (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListResourceTags' {Maybe Natural
limit :: Maybe Natural
$sel:limit:ListResourceTags' :: ListResourceTags -> Maybe Natural
limit} -> Maybe Natural
limit) (\s :: ListResourceTags
s@ListResourceTags' {} Maybe Natural
a -> ListResourceTags
s {$sel:limit:ListResourceTags' :: Maybe Natural
limit = Maybe Natural
a} :: ListResourceTags)

-- | Gets tags on the specified KMS key.
--
-- Specify the key ID or key ARN of the KMS key.
--
-- For example:
--
-- -   Key ID: @1234abcd-12ab-34cd-56ef-1234567890ab@
--
-- -   Key ARN:
--     @arn:aws:kms:us-east-2:111122223333:key\/1234abcd-12ab-34cd-56ef-1234567890ab@
--
-- To get the key ID and key ARN for a KMS key, use ListKeys or
-- DescribeKey.
listResourceTags_keyId :: Lens.Lens' ListResourceTags Prelude.Text
listResourceTags_keyId :: (Text -> f Text) -> ListResourceTags -> f ListResourceTags
listResourceTags_keyId = (ListResourceTags -> Text)
-> (ListResourceTags -> Text -> ListResourceTags)
-> Lens ListResourceTags ListResourceTags Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListResourceTags' {Text
keyId :: Text
$sel:keyId:ListResourceTags' :: ListResourceTags -> Text
keyId} -> Text
keyId) (\s :: ListResourceTags
s@ListResourceTags' {} Text
a -> ListResourceTags
s {$sel:keyId:ListResourceTags' :: Text
keyId = Text
a} :: ListResourceTags)

instance Core.AWSRequest ListResourceTags where
  type
    AWSResponse ListResourceTags =
      ListResourceTagsResponse
  request :: ListResourceTags -> Request ListResourceTags
request = Service -> ListResourceTags -> Request ListResourceTags
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ListResourceTags
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListResourceTags)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListResourceTags))
-> Logger
-> Service
-> Proxy ListResourceTags
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListResourceTags)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Bool
-> Maybe Text -> Maybe [Tag] -> Int -> ListResourceTagsResponse
ListResourceTagsResponse'
            (Maybe Bool
 -> Maybe Text -> Maybe [Tag] -> Int -> ListResourceTagsResponse)
-> Either String (Maybe Bool)
-> Either
     String
     (Maybe Text -> Maybe [Tag] -> Int -> ListResourceTagsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Truncated")
            Either
  String
  (Maybe Text -> Maybe [Tag] -> Int -> ListResourceTagsResponse)
-> Either String (Maybe Text)
-> Either String (Maybe [Tag] -> Int -> ListResourceTagsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"NextMarker")
            Either String (Maybe [Tag] -> Int -> ListResourceTagsResponse)
-> Either String (Maybe [Tag])
-> Either String (Int -> ListResourceTagsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [Tag]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Tags" Either String (Maybe (Maybe [Tag]))
-> Maybe [Tag] -> Either String (Maybe [Tag])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Tag]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Int -> ListResourceTagsResponse)
-> Either String Int -> Either String ListResourceTagsResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable ListResourceTags

instance Prelude.NFData ListResourceTags

instance Core.ToHeaders ListResourceTags where
  toHeaders :: ListResourceTags -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListResourceTags -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"TrentService.ListResourceTags" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON ListResourceTags where
  toJSON :: ListResourceTags -> Value
toJSON ListResourceTags' {Maybe Natural
Maybe Text
Text
keyId :: Text
limit :: Maybe Natural
marker :: Maybe Text
$sel:keyId:ListResourceTags' :: ListResourceTags -> Text
$sel:limit:ListResourceTags' :: ListResourceTags -> Maybe Natural
$sel:marker:ListResourceTags' :: ListResourceTags -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"Marker" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
marker,
            (Text
"Limit" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
limit,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"KeyId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
keyId)
          ]
      )

instance Core.ToPath ListResourceTags where
  toPath :: ListResourceTags -> ByteString
toPath = ByteString -> ListResourceTags -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery ListResourceTags where
  toQuery :: ListResourceTags -> QueryString
toQuery = QueryString -> ListResourceTags -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newListResourceTagsResponse' smart constructor.
data ListResourceTagsResponse = ListResourceTagsResponse'
  { -- | A flag that indicates whether there are more items in the list. When
    -- this value is true, the list in this response is truncated. To get more
    -- items, pass the value of the @NextMarker@ element in thisresponse to the
    -- @Marker@ parameter in a subsequent request.
    ListResourceTagsResponse -> Maybe Bool
truncated :: Prelude.Maybe Prelude.Bool,
    -- | When @Truncated@ is true, this element is present and contains the value
    -- to use for the @Marker@ parameter in a subsequent request.
    --
    -- Do not assume or infer any information from this value.
    ListResourceTagsResponse -> Maybe Text
nextMarker :: Prelude.Maybe Prelude.Text,
    -- | A list of tags. Each tag consists of a tag key and a tag value.
    --
    -- Tagging or untagging a KMS key can allow or deny permission to the KMS
    -- key. For details, see
    -- <https://docs.aws.amazon.com/kms/latest/developerguide/abac.html Using ABAC in KMS>
    -- in the /Key Management Service Developer Guide/.
    ListResourceTagsResponse -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The response's http status code.
    ListResourceTagsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListResourceTagsResponse -> ListResourceTagsResponse -> Bool
(ListResourceTagsResponse -> ListResourceTagsResponse -> Bool)
-> (ListResourceTagsResponse -> ListResourceTagsResponse -> Bool)
-> Eq ListResourceTagsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListResourceTagsResponse -> ListResourceTagsResponse -> Bool
$c/= :: ListResourceTagsResponse -> ListResourceTagsResponse -> Bool
== :: ListResourceTagsResponse -> ListResourceTagsResponse -> Bool
$c== :: ListResourceTagsResponse -> ListResourceTagsResponse -> Bool
Prelude.Eq, ReadPrec [ListResourceTagsResponse]
ReadPrec ListResourceTagsResponse
Int -> ReadS ListResourceTagsResponse
ReadS [ListResourceTagsResponse]
(Int -> ReadS ListResourceTagsResponse)
-> ReadS [ListResourceTagsResponse]
-> ReadPrec ListResourceTagsResponse
-> ReadPrec [ListResourceTagsResponse]
-> Read ListResourceTagsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListResourceTagsResponse]
$creadListPrec :: ReadPrec [ListResourceTagsResponse]
readPrec :: ReadPrec ListResourceTagsResponse
$creadPrec :: ReadPrec ListResourceTagsResponse
readList :: ReadS [ListResourceTagsResponse]
$creadList :: ReadS [ListResourceTagsResponse]
readsPrec :: Int -> ReadS ListResourceTagsResponse
$creadsPrec :: Int -> ReadS ListResourceTagsResponse
Prelude.Read, Int -> ListResourceTagsResponse -> ShowS
[ListResourceTagsResponse] -> ShowS
ListResourceTagsResponse -> String
(Int -> ListResourceTagsResponse -> ShowS)
-> (ListResourceTagsResponse -> String)
-> ([ListResourceTagsResponse] -> ShowS)
-> Show ListResourceTagsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListResourceTagsResponse] -> ShowS
$cshowList :: [ListResourceTagsResponse] -> ShowS
show :: ListResourceTagsResponse -> String
$cshow :: ListResourceTagsResponse -> String
showsPrec :: Int -> ListResourceTagsResponse -> ShowS
$cshowsPrec :: Int -> ListResourceTagsResponse -> ShowS
Prelude.Show, (forall x.
 ListResourceTagsResponse -> Rep ListResourceTagsResponse x)
-> (forall x.
    Rep ListResourceTagsResponse x -> ListResourceTagsResponse)
-> Generic ListResourceTagsResponse
forall x.
Rep ListResourceTagsResponse x -> ListResourceTagsResponse
forall x.
ListResourceTagsResponse -> Rep ListResourceTagsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListResourceTagsResponse x -> ListResourceTagsResponse
$cfrom :: forall x.
ListResourceTagsResponse -> Rep ListResourceTagsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListResourceTagsResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'truncated', 'listResourceTagsResponse_truncated' - A flag that indicates whether there are more items in the list. When
-- this value is true, the list in this response is truncated. To get more
-- items, pass the value of the @NextMarker@ element in thisresponse to the
-- @Marker@ parameter in a subsequent request.
--
-- 'nextMarker', 'listResourceTagsResponse_nextMarker' - When @Truncated@ is true, this element is present and contains the value
-- to use for the @Marker@ parameter in a subsequent request.
--
-- Do not assume or infer any information from this value.
--
-- 'tags', 'listResourceTagsResponse_tags' - A list of tags. Each tag consists of a tag key and a tag value.
--
-- Tagging or untagging a KMS key can allow or deny permission to the KMS
-- key. For details, see
-- <https://docs.aws.amazon.com/kms/latest/developerguide/abac.html Using ABAC in KMS>
-- in the /Key Management Service Developer Guide/.
--
-- 'httpStatus', 'listResourceTagsResponse_httpStatus' - The response's http status code.
newListResourceTagsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListResourceTagsResponse
newListResourceTagsResponse :: Int -> ListResourceTagsResponse
newListResourceTagsResponse Int
pHttpStatus_ =
  ListResourceTagsResponse' :: Maybe Bool
-> Maybe Text -> Maybe [Tag] -> Int -> ListResourceTagsResponse
ListResourceTagsResponse'
    { $sel:truncated:ListResourceTagsResponse' :: Maybe Bool
truncated =
        Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:nextMarker:ListResourceTagsResponse' :: Maybe Text
nextMarker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:ListResourceTagsResponse' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListResourceTagsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A flag that indicates whether there are more items in the list. When
-- this value is true, the list in this response is truncated. To get more
-- items, pass the value of the @NextMarker@ element in thisresponse to the
-- @Marker@ parameter in a subsequent request.
listResourceTagsResponse_truncated :: Lens.Lens' ListResourceTagsResponse (Prelude.Maybe Prelude.Bool)
listResourceTagsResponse_truncated :: (Maybe Bool -> f (Maybe Bool))
-> ListResourceTagsResponse -> f ListResourceTagsResponse
listResourceTagsResponse_truncated = (ListResourceTagsResponse -> Maybe Bool)
-> (ListResourceTagsResponse
    -> Maybe Bool -> ListResourceTagsResponse)
-> Lens
     ListResourceTagsResponse
     ListResourceTagsResponse
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListResourceTagsResponse' {Maybe Bool
truncated :: Maybe Bool
$sel:truncated:ListResourceTagsResponse' :: ListResourceTagsResponse -> Maybe Bool
truncated} -> Maybe Bool
truncated) (\s :: ListResourceTagsResponse
s@ListResourceTagsResponse' {} Maybe Bool
a -> ListResourceTagsResponse
s {$sel:truncated:ListResourceTagsResponse' :: Maybe Bool
truncated = Maybe Bool
a} :: ListResourceTagsResponse)

-- | When @Truncated@ is true, this element is present and contains the value
-- to use for the @Marker@ parameter in a subsequent request.
--
-- Do not assume or infer any information from this value.
listResourceTagsResponse_nextMarker :: Lens.Lens' ListResourceTagsResponse (Prelude.Maybe Prelude.Text)
listResourceTagsResponse_nextMarker :: (Maybe Text -> f (Maybe Text))
-> ListResourceTagsResponse -> f ListResourceTagsResponse
listResourceTagsResponse_nextMarker = (ListResourceTagsResponse -> Maybe Text)
-> (ListResourceTagsResponse
    -> Maybe Text -> ListResourceTagsResponse)
-> Lens
     ListResourceTagsResponse
     ListResourceTagsResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListResourceTagsResponse' {Maybe Text
nextMarker :: Maybe Text
$sel:nextMarker:ListResourceTagsResponse' :: ListResourceTagsResponse -> Maybe Text
nextMarker} -> Maybe Text
nextMarker) (\s :: ListResourceTagsResponse
s@ListResourceTagsResponse' {} Maybe Text
a -> ListResourceTagsResponse
s {$sel:nextMarker:ListResourceTagsResponse' :: Maybe Text
nextMarker = Maybe Text
a} :: ListResourceTagsResponse)

-- | A list of tags. Each tag consists of a tag key and a tag value.
--
-- Tagging or untagging a KMS key can allow or deny permission to the KMS
-- key. For details, see
-- <https://docs.aws.amazon.com/kms/latest/developerguide/abac.html Using ABAC in KMS>
-- in the /Key Management Service Developer Guide/.
listResourceTagsResponse_tags :: Lens.Lens' ListResourceTagsResponse (Prelude.Maybe [Tag])
listResourceTagsResponse_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> ListResourceTagsResponse -> f ListResourceTagsResponse
listResourceTagsResponse_tags = (ListResourceTagsResponse -> Maybe [Tag])
-> (ListResourceTagsResponse
    -> Maybe [Tag] -> ListResourceTagsResponse)
-> Lens
     ListResourceTagsResponse
     ListResourceTagsResponse
     (Maybe [Tag])
     (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListResourceTagsResponse' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:ListResourceTagsResponse' :: ListResourceTagsResponse -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: ListResourceTagsResponse
s@ListResourceTagsResponse' {} Maybe [Tag]
a -> ListResourceTagsResponse
s {$sel:tags:ListResourceTagsResponse' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: ListResourceTagsResponse) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> ListResourceTagsResponse -> f ListResourceTagsResponse)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> ListResourceTagsResponse
-> f ListResourceTagsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The response's http status code.
listResourceTagsResponse_httpStatus :: Lens.Lens' ListResourceTagsResponse Prelude.Int
listResourceTagsResponse_httpStatus :: (Int -> f Int)
-> ListResourceTagsResponse -> f ListResourceTagsResponse
listResourceTagsResponse_httpStatus = (ListResourceTagsResponse -> Int)
-> (ListResourceTagsResponse -> Int -> ListResourceTagsResponse)
-> Lens ListResourceTagsResponse ListResourceTagsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListResourceTagsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListResourceTagsResponse' :: ListResourceTagsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListResourceTagsResponse
s@ListResourceTagsResponse' {} Int
a -> ListResourceTagsResponse
s {$sel:httpStatus:ListResourceTagsResponse' :: Int
httpStatus = Int
a} :: ListResourceTagsResponse)

instance Prelude.NFData ListResourceTagsResponse