{-# 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.Discovery.DescribeTags
-- 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)
--
-- Retrieves a list of configuration items that have tags as specified by
-- the key-value pairs, name and value, passed to the optional parameter
-- @filters@.
--
-- There are three valid tag filter names:
--
-- -   tagKey
--
-- -   tagValue
--
-- -   configurationId
--
-- Also, all configuration items associated with your user account that
-- have tags can be listed if you call @DescribeTags@ as is without passing
-- any parameters.
--
-- This operation returns paginated results.
module Amazonka.Discovery.DescribeTags
  ( -- * Creating a Request
    DescribeTags (..),
    newDescribeTags,

    -- * Request Lenses
    describeTags_filters,
    describeTags_nextToken,
    describeTags_maxResults,

    -- * Destructuring the Response
    DescribeTagsResponse (..),
    newDescribeTagsResponse,

    -- * Response Lenses
    describeTagsResponse_nextToken,
    describeTagsResponse_tags,
    describeTagsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.Discovery.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:/ 'newDescribeTags' smart constructor.
data DescribeTags = DescribeTags'
  { -- | You can filter the list using a /key/-/value/ format. You can separate
    -- these items by using logical operators. Allowed filters include
    -- @tagKey@, @tagValue@, and @configurationId@.
    DescribeTags -> Maybe [TagFilter]
filters :: Prelude.Maybe [TagFilter],
    -- | A token to start the list. Use this token to get the next set of
    -- results.
    DescribeTags -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The total number of items to return in a single page of output. The
    -- maximum value is 100.
    DescribeTags -> Maybe Int
maxResults :: Prelude.Maybe Prelude.Int
  }
  deriving (DescribeTags -> DescribeTags -> Bool
(DescribeTags -> DescribeTags -> Bool)
-> (DescribeTags -> DescribeTags -> Bool) -> Eq DescribeTags
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeTags -> DescribeTags -> Bool
$c/= :: DescribeTags -> DescribeTags -> Bool
== :: DescribeTags -> DescribeTags -> Bool
$c== :: DescribeTags -> DescribeTags -> Bool
Prelude.Eq, ReadPrec [DescribeTags]
ReadPrec DescribeTags
Int -> ReadS DescribeTags
ReadS [DescribeTags]
(Int -> ReadS DescribeTags)
-> ReadS [DescribeTags]
-> ReadPrec DescribeTags
-> ReadPrec [DescribeTags]
-> Read DescribeTags
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeTags]
$creadListPrec :: ReadPrec [DescribeTags]
readPrec :: ReadPrec DescribeTags
$creadPrec :: ReadPrec DescribeTags
readList :: ReadS [DescribeTags]
$creadList :: ReadS [DescribeTags]
readsPrec :: Int -> ReadS DescribeTags
$creadsPrec :: Int -> ReadS DescribeTags
Prelude.Read, Int -> DescribeTags -> ShowS
[DescribeTags] -> ShowS
DescribeTags -> String
(Int -> DescribeTags -> ShowS)
-> (DescribeTags -> String)
-> ([DescribeTags] -> ShowS)
-> Show DescribeTags
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeTags] -> ShowS
$cshowList :: [DescribeTags] -> ShowS
show :: DescribeTags -> String
$cshow :: DescribeTags -> String
showsPrec :: Int -> DescribeTags -> ShowS
$cshowsPrec :: Int -> DescribeTags -> ShowS
Prelude.Show, (forall x. DescribeTags -> Rep DescribeTags x)
-> (forall x. Rep DescribeTags x -> DescribeTags)
-> Generic DescribeTags
forall x. Rep DescribeTags x -> DescribeTags
forall x. DescribeTags -> Rep DescribeTags x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeTags x -> DescribeTags
$cfrom :: forall x. DescribeTags -> Rep DescribeTags x
Prelude.Generic)

-- |
-- Create a value of 'DescribeTags' 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:
--
-- 'filters', 'describeTags_filters' - You can filter the list using a /key/-/value/ format. You can separate
-- these items by using logical operators. Allowed filters include
-- @tagKey@, @tagValue@, and @configurationId@.
--
-- 'nextToken', 'describeTags_nextToken' - A token to start the list. Use this token to get the next set of
-- results.
--
-- 'maxResults', 'describeTags_maxResults' - The total number of items to return in a single page of output. The
-- maximum value is 100.
newDescribeTags ::
  DescribeTags
newDescribeTags :: DescribeTags
newDescribeTags =
  DescribeTags' :: Maybe [TagFilter] -> Maybe Text -> Maybe Int -> DescribeTags
DescribeTags'
    { $sel:filters:DescribeTags' :: Maybe [TagFilter]
filters = Maybe [TagFilter]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeTags' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:DescribeTags' :: Maybe Int
maxResults = Maybe Int
forall a. Maybe a
Prelude.Nothing
    }

-- | You can filter the list using a /key/-/value/ format. You can separate
-- these items by using logical operators. Allowed filters include
-- @tagKey@, @tagValue@, and @configurationId@.
describeTags_filters :: Lens.Lens' DescribeTags (Prelude.Maybe [TagFilter])
describeTags_filters :: (Maybe [TagFilter] -> f (Maybe [TagFilter]))
-> DescribeTags -> f DescribeTags
describeTags_filters = (DescribeTags -> Maybe [TagFilter])
-> (DescribeTags -> Maybe [TagFilter] -> DescribeTags)
-> Lens
     DescribeTags DescribeTags (Maybe [TagFilter]) (Maybe [TagFilter])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTags' {Maybe [TagFilter]
filters :: Maybe [TagFilter]
$sel:filters:DescribeTags' :: DescribeTags -> Maybe [TagFilter]
filters} -> Maybe [TagFilter]
filters) (\s :: DescribeTags
s@DescribeTags' {} Maybe [TagFilter]
a -> DescribeTags
s {$sel:filters:DescribeTags' :: Maybe [TagFilter]
filters = Maybe [TagFilter]
a} :: DescribeTags) ((Maybe [TagFilter] -> f (Maybe [TagFilter]))
 -> DescribeTags -> f DescribeTags)
-> ((Maybe [TagFilter] -> f (Maybe [TagFilter]))
    -> Maybe [TagFilter] -> f (Maybe [TagFilter]))
-> (Maybe [TagFilter] -> f (Maybe [TagFilter]))
-> DescribeTags
-> f DescribeTags
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [TagFilter] [TagFilter] [TagFilter] [TagFilter]
-> Iso
     (Maybe [TagFilter])
     (Maybe [TagFilter])
     (Maybe [TagFilter])
     (Maybe [TagFilter])
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 [TagFilter] [TagFilter] [TagFilter] [TagFilter]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A token to start the list. Use this token to get the next set of
-- results.
describeTags_nextToken :: Lens.Lens' DescribeTags (Prelude.Maybe Prelude.Text)
describeTags_nextToken :: (Maybe Text -> f (Maybe Text)) -> DescribeTags -> f DescribeTags
describeTags_nextToken = (DescribeTags -> Maybe Text)
-> (DescribeTags -> Maybe Text -> DescribeTags)
-> Lens DescribeTags DescribeTags (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTags' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeTags' :: DescribeTags -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeTags
s@DescribeTags' {} Maybe Text
a -> DescribeTags
s {$sel:nextToken:DescribeTags' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeTags)

-- | The total number of items to return in a single page of output. The
-- maximum value is 100.
describeTags_maxResults :: Lens.Lens' DescribeTags (Prelude.Maybe Prelude.Int)
describeTags_maxResults :: (Maybe Int -> f (Maybe Int)) -> DescribeTags -> f DescribeTags
describeTags_maxResults = (DescribeTags -> Maybe Int)
-> (DescribeTags -> Maybe Int -> DescribeTags)
-> Lens DescribeTags DescribeTags (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTags' {Maybe Int
maxResults :: Maybe Int
$sel:maxResults:DescribeTags' :: DescribeTags -> Maybe Int
maxResults} -> Maybe Int
maxResults) (\s :: DescribeTags
s@DescribeTags' {} Maybe Int
a -> DescribeTags
s {$sel:maxResults:DescribeTags' :: Maybe Int
maxResults = Maybe Int
a} :: DescribeTags)

instance Core.AWSPager DescribeTags where
  page :: DescribeTags -> AWSResponse DescribeTags -> Maybe DescribeTags
page DescribeTags
rq AWSResponse DescribeTags
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeTags
DescribeTagsResponse
rs
            DescribeTagsResponse
-> Getting (First Text) DescribeTagsResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeTagsResponse -> Const (First Text) DescribeTagsResponse
Lens' DescribeTagsResponse (Maybe Text)
describeTagsResponse_nextToken ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribeTagsResponse -> Const (First Text) DescribeTagsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeTagsResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe DescribeTags
forall a. Maybe a
Prelude.Nothing
    | Maybe [ConfigurationTag] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeTags
DescribeTagsResponse
rs
            DescribeTagsResponse
-> Getting
     (First [ConfigurationTag]) DescribeTagsResponse [ConfigurationTag]
-> Maybe [ConfigurationTag]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [ConfigurationTag]
 -> Const (First [ConfigurationTag]) (Maybe [ConfigurationTag]))
-> DescribeTagsResponse
-> Const (First [ConfigurationTag]) DescribeTagsResponse
Lens' DescribeTagsResponse (Maybe [ConfigurationTag])
describeTagsResponse_tags ((Maybe [ConfigurationTag]
  -> Const (First [ConfigurationTag]) (Maybe [ConfigurationTag]))
 -> DescribeTagsResponse
 -> Const (First [ConfigurationTag]) DescribeTagsResponse)
-> (([ConfigurationTag]
     -> Const (First [ConfigurationTag]) [ConfigurationTag])
    -> Maybe [ConfigurationTag]
    -> Const (First [ConfigurationTag]) (Maybe [ConfigurationTag]))
-> Getting
     (First [ConfigurationTag]) DescribeTagsResponse [ConfigurationTag]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([ConfigurationTag]
 -> Const (First [ConfigurationTag]) [ConfigurationTag])
-> Maybe [ConfigurationTag]
-> Const (First [ConfigurationTag]) (Maybe [ConfigurationTag])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe DescribeTags
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      DescribeTags -> Maybe DescribeTags
forall a. a -> Maybe a
Prelude.Just (DescribeTags -> Maybe DescribeTags)
-> DescribeTags -> Maybe DescribeTags
forall a b. (a -> b) -> a -> b
Prelude.$
        DescribeTags
rq
          DescribeTags -> (DescribeTags -> DescribeTags) -> DescribeTags
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> DescribeTags -> Identity DescribeTags
Lens DescribeTags DescribeTags (Maybe Text) (Maybe Text)
describeTags_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> DescribeTags -> Identity DescribeTags)
-> Maybe Text -> DescribeTags -> DescribeTags
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeTags
DescribeTagsResponse
rs
          DescribeTagsResponse
-> Getting (First Text) DescribeTagsResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeTagsResponse -> Const (First Text) DescribeTagsResponse
Lens' DescribeTagsResponse (Maybe Text)
describeTagsResponse_nextToken ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribeTagsResponse -> Const (First Text) DescribeTagsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeTagsResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest DescribeTags where
  type AWSResponse DescribeTags = DescribeTagsResponse
  request :: DescribeTags -> Request DescribeTags
request = Service -> DescribeTags -> Request DescribeTags
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeTags
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeTags)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse DescribeTags))
-> Logger
-> Service
-> Proxy DescribeTags
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeTags)))
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 Text
-> Maybe [ConfigurationTag] -> Int -> DescribeTagsResponse
DescribeTagsResponse'
            (Maybe Text
 -> Maybe [ConfigurationTag] -> Int -> DescribeTagsResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe [ConfigurationTag] -> Int -> DescribeTagsResponse)
forall (f :: * -> *) a b. Functor 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
"nextToken")
            Either
  String (Maybe [ConfigurationTag] -> Int -> DescribeTagsResponse)
-> Either String (Maybe [ConfigurationTag])
-> Either String (Int -> DescribeTagsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [ConfigurationTag]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"tags" Either String (Maybe (Maybe [ConfigurationTag]))
-> Maybe [ConfigurationTag]
-> Either String (Maybe [ConfigurationTag])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [ConfigurationTag]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Int -> DescribeTagsResponse)
-> Either String Int -> Either String DescribeTagsResponse
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 DescribeTags

instance Prelude.NFData DescribeTags

instance Core.ToHeaders DescribeTags where
  toHeaders :: DescribeTags -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DescribeTags -> 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
"AWSPoseidonService_V2015_11_01.DescribeTags" ::
                          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 DescribeTags where
  toJSON :: DescribeTags -> Value
toJSON DescribeTags' {Maybe Int
Maybe [TagFilter]
Maybe Text
maxResults :: Maybe Int
nextToken :: Maybe Text
filters :: Maybe [TagFilter]
$sel:maxResults:DescribeTags' :: DescribeTags -> Maybe Int
$sel:nextToken:DescribeTags' :: DescribeTags -> Maybe Text
$sel:filters:DescribeTags' :: DescribeTags -> Maybe [TagFilter]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"filters" Text -> [TagFilter] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([TagFilter] -> Pair) -> Maybe [TagFilter] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [TagFilter]
filters,
            (Text
"nextToken" 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
nextToken,
            (Text
"maxResults" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
maxResults
          ]
      )

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

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

-- | /See:/ 'newDescribeTagsResponse' smart constructor.
data DescribeTagsResponse = DescribeTagsResponse'
  { -- | The call returns a token. Use this token to get the next set of results.
    DescribeTagsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Depending on the input, this is a list of configuration items tagged
    -- with a specific tag, or a list of tags for a specific configuration
    -- item.
    DescribeTagsResponse -> Maybe [ConfigurationTag]
tags :: Prelude.Maybe [ConfigurationTag],
    -- | The response's http status code.
    DescribeTagsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeTagsResponse -> DescribeTagsResponse -> Bool
(DescribeTagsResponse -> DescribeTagsResponse -> Bool)
-> (DescribeTagsResponse -> DescribeTagsResponse -> Bool)
-> Eq DescribeTagsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeTagsResponse -> DescribeTagsResponse -> Bool
$c/= :: DescribeTagsResponse -> DescribeTagsResponse -> Bool
== :: DescribeTagsResponse -> DescribeTagsResponse -> Bool
$c== :: DescribeTagsResponse -> DescribeTagsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeTagsResponse]
ReadPrec DescribeTagsResponse
Int -> ReadS DescribeTagsResponse
ReadS [DescribeTagsResponse]
(Int -> ReadS DescribeTagsResponse)
-> ReadS [DescribeTagsResponse]
-> ReadPrec DescribeTagsResponse
-> ReadPrec [DescribeTagsResponse]
-> Read DescribeTagsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeTagsResponse]
$creadListPrec :: ReadPrec [DescribeTagsResponse]
readPrec :: ReadPrec DescribeTagsResponse
$creadPrec :: ReadPrec DescribeTagsResponse
readList :: ReadS [DescribeTagsResponse]
$creadList :: ReadS [DescribeTagsResponse]
readsPrec :: Int -> ReadS DescribeTagsResponse
$creadsPrec :: Int -> ReadS DescribeTagsResponse
Prelude.Read, Int -> DescribeTagsResponse -> ShowS
[DescribeTagsResponse] -> ShowS
DescribeTagsResponse -> String
(Int -> DescribeTagsResponse -> ShowS)
-> (DescribeTagsResponse -> String)
-> ([DescribeTagsResponse] -> ShowS)
-> Show DescribeTagsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeTagsResponse] -> ShowS
$cshowList :: [DescribeTagsResponse] -> ShowS
show :: DescribeTagsResponse -> String
$cshow :: DescribeTagsResponse -> String
showsPrec :: Int -> DescribeTagsResponse -> ShowS
$cshowsPrec :: Int -> DescribeTagsResponse -> ShowS
Prelude.Show, (forall x. DescribeTagsResponse -> Rep DescribeTagsResponse x)
-> (forall x. Rep DescribeTagsResponse x -> DescribeTagsResponse)
-> Generic DescribeTagsResponse
forall x. Rep DescribeTagsResponse x -> DescribeTagsResponse
forall x. DescribeTagsResponse -> Rep DescribeTagsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeTagsResponse x -> DescribeTagsResponse
$cfrom :: forall x. DescribeTagsResponse -> Rep DescribeTagsResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeTagsResponse' 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:
--
-- 'nextToken', 'describeTagsResponse_nextToken' - The call returns a token. Use this token to get the next set of results.
--
-- 'tags', 'describeTagsResponse_tags' - Depending on the input, this is a list of configuration items tagged
-- with a specific tag, or a list of tags for a specific configuration
-- item.
--
-- 'httpStatus', 'describeTagsResponse_httpStatus' - The response's http status code.
newDescribeTagsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeTagsResponse
newDescribeTagsResponse :: Int -> DescribeTagsResponse
newDescribeTagsResponse Int
pHttpStatus_ =
  DescribeTagsResponse' :: Maybe Text
-> Maybe [ConfigurationTag] -> Int -> DescribeTagsResponse
DescribeTagsResponse'
    { $sel:nextToken:DescribeTagsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:DescribeTagsResponse' :: Maybe [ConfigurationTag]
tags = Maybe [ConfigurationTag]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeTagsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The call returns a token. Use this token to get the next set of results.
describeTagsResponse_nextToken :: Lens.Lens' DescribeTagsResponse (Prelude.Maybe Prelude.Text)
describeTagsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeTagsResponse -> f DescribeTagsResponse
describeTagsResponse_nextToken = (DescribeTagsResponse -> Maybe Text)
-> (DescribeTagsResponse -> Maybe Text -> DescribeTagsResponse)
-> Lens' DescribeTagsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTagsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeTagsResponse' :: DescribeTagsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeTagsResponse
s@DescribeTagsResponse' {} Maybe Text
a -> DescribeTagsResponse
s {$sel:nextToken:DescribeTagsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeTagsResponse)

-- | Depending on the input, this is a list of configuration items tagged
-- with a specific tag, or a list of tags for a specific configuration
-- item.
describeTagsResponse_tags :: Lens.Lens' DescribeTagsResponse (Prelude.Maybe [ConfigurationTag])
describeTagsResponse_tags :: (Maybe [ConfigurationTag] -> f (Maybe [ConfigurationTag]))
-> DescribeTagsResponse -> f DescribeTagsResponse
describeTagsResponse_tags = (DescribeTagsResponse -> Maybe [ConfigurationTag])
-> (DescribeTagsResponse
    -> Maybe [ConfigurationTag] -> DescribeTagsResponse)
-> Lens' DescribeTagsResponse (Maybe [ConfigurationTag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTagsResponse' {Maybe [ConfigurationTag]
tags :: Maybe [ConfigurationTag]
$sel:tags:DescribeTagsResponse' :: DescribeTagsResponse -> Maybe [ConfigurationTag]
tags} -> Maybe [ConfigurationTag]
tags) (\s :: DescribeTagsResponse
s@DescribeTagsResponse' {} Maybe [ConfigurationTag]
a -> DescribeTagsResponse
s {$sel:tags:DescribeTagsResponse' :: Maybe [ConfigurationTag]
tags = Maybe [ConfigurationTag]
a} :: DescribeTagsResponse) ((Maybe [ConfigurationTag] -> f (Maybe [ConfigurationTag]))
 -> DescribeTagsResponse -> f DescribeTagsResponse)
-> ((Maybe [ConfigurationTag] -> f (Maybe [ConfigurationTag]))
    -> Maybe [ConfigurationTag] -> f (Maybe [ConfigurationTag]))
-> (Maybe [ConfigurationTag] -> f (Maybe [ConfigurationTag]))
-> DescribeTagsResponse
-> f DescribeTagsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ConfigurationTag]
  [ConfigurationTag]
  [ConfigurationTag]
  [ConfigurationTag]
-> Iso
     (Maybe [ConfigurationTag])
     (Maybe [ConfigurationTag])
     (Maybe [ConfigurationTag])
     (Maybe [ConfigurationTag])
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
  [ConfigurationTag]
  [ConfigurationTag]
  [ConfigurationTag]
  [ConfigurationTag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData DescribeTagsResponse