{-# 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.EC2.DescribeTags
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Describes the specified tags for your EC2 resources.
--
-- For more information about tags, see
-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html Tag your Amazon EC2 resources>
-- in the /Amazon Elastic Compute Cloud User Guide/.
--
-- This operation returns paginated results.
module Amazonka.EC2.DescribeTags
  ( -- * Creating a Request
    DescribeTags (..),
    newDescribeTags,

    -- * Request Lenses
    describeTags_dryRun,
    describeTags_filters,
    describeTags_maxResults,
    describeTags_nextToken,

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

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

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EC2.Types
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'
  { -- | Checks whether you have the required permissions for the action, without
    -- actually making the request, and provides an error response. If you have
    -- the required permissions, the error response is @DryRunOperation@.
    -- Otherwise, it is @UnauthorizedOperation@.
    DescribeTags -> Maybe Bool
dryRun :: Prelude.Maybe Prelude.Bool,
    -- | The filters.
    --
    -- -   @key@ - The tag key.
    --
    -- -   @resource-id@ - The ID of the resource.
    --
    -- -   @resource-type@ - The resource type (@customer-gateway@ |
    --     @dedicated-host@ | @dhcp-options@ | @elastic-ip@ | @fleet@ |
    --     @fpga-image@ | @host-reservation@ | @image@ | @instance@ |
    --     @internet-gateway@ | @key-pair@ | @launch-template@ | @natgateway@ |
    --     @network-acl@ | @network-interface@ | @placement-group@ |
    --     @reserved-instances@ | @route-table@ | @security-group@ | @snapshot@
    --     | @spot-instances-request@ | @subnet@ | @volume@ | @vpc@ |
    --     @vpc-endpoint@ | @vpc-endpoint-service@ | @vpc-peering-connection@ |
    --     @vpn-connection@ | @vpn-gateway@).
    --
    -- -   @tag@:\<key> - The key\/value combination of the tag. For example,
    --     specify \"tag:Owner\" for the filter name and \"TeamA\" for the
    --     filter value to find resources with the tag \"Owner=TeamA\".
    --
    -- -   @value@ - The tag value.
    DescribeTags -> Maybe [Filter]
filters :: Prelude.Maybe [Filter],
    -- | The maximum number of results to return in a single call. This value can
    -- be between 5 and 1000. To retrieve the remaining results, make another
    -- call with the returned @NextToken@ value.
    DescribeTags -> Maybe Int
maxResults :: Prelude.Maybe Prelude.Int,
    -- | The token to retrieve the next page of results.
    DescribeTags -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
  }
  deriving (DescribeTags -> DescribeTags -> Bool
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]
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
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. 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:
--
-- 'dryRun', 'describeTags_dryRun' - Checks whether you have the required permissions for the action, without
-- actually making the request, and provides an error response. If you have
-- the required permissions, the error response is @DryRunOperation@.
-- Otherwise, it is @UnauthorizedOperation@.
--
-- 'filters', 'describeTags_filters' - The filters.
--
-- -   @key@ - The tag key.
--
-- -   @resource-id@ - The ID of the resource.
--
-- -   @resource-type@ - The resource type (@customer-gateway@ |
--     @dedicated-host@ | @dhcp-options@ | @elastic-ip@ | @fleet@ |
--     @fpga-image@ | @host-reservation@ | @image@ | @instance@ |
--     @internet-gateway@ | @key-pair@ | @launch-template@ | @natgateway@ |
--     @network-acl@ | @network-interface@ | @placement-group@ |
--     @reserved-instances@ | @route-table@ | @security-group@ | @snapshot@
--     | @spot-instances-request@ | @subnet@ | @volume@ | @vpc@ |
--     @vpc-endpoint@ | @vpc-endpoint-service@ | @vpc-peering-connection@ |
--     @vpn-connection@ | @vpn-gateway@).
--
-- -   @tag@:\<key> - The key\/value combination of the tag. For example,
--     specify \"tag:Owner\" for the filter name and \"TeamA\" for the
--     filter value to find resources with the tag \"Owner=TeamA\".
--
-- -   @value@ - The tag value.
--
-- 'maxResults', 'describeTags_maxResults' - The maximum number of results to return in a single call. This value can
-- be between 5 and 1000. To retrieve the remaining results, make another
-- call with the returned @NextToken@ value.
--
-- 'nextToken', 'describeTags_nextToken' - The token to retrieve the next page of results.
newDescribeTags ::
  DescribeTags
newDescribeTags :: DescribeTags
newDescribeTags =
  DescribeTags'
    { $sel:dryRun:DescribeTags' :: Maybe Bool
dryRun = forall a. Maybe a
Prelude.Nothing,
      $sel:filters:DescribeTags' :: Maybe [Filter]
filters = forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:DescribeTags' :: Maybe Int
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeTags' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing
    }

-- | Checks whether you have the required permissions for the action, without
-- actually making the request, and provides an error response. If you have
-- the required permissions, the error response is @DryRunOperation@.
-- Otherwise, it is @UnauthorizedOperation@.
describeTags_dryRun :: Lens.Lens' DescribeTags (Prelude.Maybe Prelude.Bool)
describeTags_dryRun :: Lens' DescribeTags (Maybe Bool)
describeTags_dryRun = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTags' {Maybe Bool
dryRun :: Maybe Bool
$sel:dryRun:DescribeTags' :: DescribeTags -> Maybe Bool
dryRun} -> Maybe Bool
dryRun) (\s :: DescribeTags
s@DescribeTags' {} Maybe Bool
a -> DescribeTags
s {$sel:dryRun:DescribeTags' :: Maybe Bool
dryRun = Maybe Bool
a} :: DescribeTags)

-- | The filters.
--
-- -   @key@ - The tag key.
--
-- -   @resource-id@ - The ID of the resource.
--
-- -   @resource-type@ - The resource type (@customer-gateway@ |
--     @dedicated-host@ | @dhcp-options@ | @elastic-ip@ | @fleet@ |
--     @fpga-image@ | @host-reservation@ | @image@ | @instance@ |
--     @internet-gateway@ | @key-pair@ | @launch-template@ | @natgateway@ |
--     @network-acl@ | @network-interface@ | @placement-group@ |
--     @reserved-instances@ | @route-table@ | @security-group@ | @snapshot@
--     | @spot-instances-request@ | @subnet@ | @volume@ | @vpc@ |
--     @vpc-endpoint@ | @vpc-endpoint-service@ | @vpc-peering-connection@ |
--     @vpn-connection@ | @vpn-gateway@).
--
-- -   @tag@:\<key> - The key\/value combination of the tag. For example,
--     specify \"tag:Owner\" for the filter name and \"TeamA\" for the
--     filter value to find resources with the tag \"Owner=TeamA\".
--
-- -   @value@ - The tag value.
describeTags_filters :: Lens.Lens' DescribeTags (Prelude.Maybe [Filter])
describeTags_filters :: Lens' DescribeTags (Maybe [Filter])
describeTags_filters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTags' {Maybe [Filter]
filters :: Maybe [Filter]
$sel:filters:DescribeTags' :: DescribeTags -> Maybe [Filter]
filters} -> Maybe [Filter]
filters) (\s :: DescribeTags
s@DescribeTags' {} Maybe [Filter]
a -> DescribeTags
s {$sel:filters:DescribeTags' :: Maybe [Filter]
filters = Maybe [Filter]
a} :: DescribeTags) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The maximum number of results to return in a single call. This value can
-- be between 5 and 1000. To retrieve the remaining results, make another
-- call with the returned @NextToken@ value.
describeTags_maxResults :: Lens.Lens' DescribeTags (Prelude.Maybe Prelude.Int)
describeTags_maxResults :: Lens' DescribeTags (Maybe Int)
describeTags_maxResults = 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)

-- | The token to retrieve the next page of results.
describeTags_nextToken :: Lens.Lens' DescribeTags (Prelude.Maybe Prelude.Text)
describeTags_nextToken :: Lens' DescribeTags (Maybe Text)
describeTags_nextToken = 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)

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

instance Core.AWSRequest DescribeTags where
  type AWSResponse DescribeTags = DescribeTagsResponse
  request :: (Service -> Service) -> DescribeTags -> Request DescribeTags
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DescribeTags
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeTags)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXML
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe Text -> Maybe [TagDescription] -> Int -> DescribeTagsResponse
DescribeTagsResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"nextToken")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x
                            forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"tagSet"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                            forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"item")
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable DescribeTags where
  hashWithSalt :: Int -> DescribeTags -> Int
hashWithSalt Int
_salt DescribeTags' {Maybe Bool
Maybe Int
Maybe [Filter]
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Int
filters :: Maybe [Filter]
dryRun :: Maybe Bool
$sel:nextToken:DescribeTags' :: DescribeTags -> Maybe Text
$sel:maxResults:DescribeTags' :: DescribeTags -> Maybe Int
$sel:filters:DescribeTags' :: DescribeTags -> Maybe [Filter]
$sel:dryRun:DescribeTags' :: DescribeTags -> Maybe Bool
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
dryRun
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Filter]
filters
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken

instance Prelude.NFData DescribeTags where
  rnf :: DescribeTags -> ()
rnf DescribeTags' {Maybe Bool
Maybe Int
Maybe [Filter]
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Int
filters :: Maybe [Filter]
dryRun :: Maybe Bool
$sel:nextToken:DescribeTags' :: DescribeTags -> Maybe Text
$sel:maxResults:DescribeTags' :: DescribeTags -> Maybe Int
$sel:filters:DescribeTags' :: DescribeTags -> Maybe [Filter]
$sel:dryRun:DescribeTags' :: DescribeTags -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
dryRun
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Filter]
filters
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
maxResults
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken

instance Data.ToHeaders DescribeTags where
  toHeaders :: DescribeTags -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

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

instance Data.ToQuery DescribeTags where
  toQuery :: DescribeTags -> QueryString
toQuery DescribeTags' {Maybe Bool
Maybe Int
Maybe [Filter]
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Int
filters :: Maybe [Filter]
dryRun :: Maybe Bool
$sel:nextToken:DescribeTags' :: DescribeTags -> Maybe Text
$sel:maxResults:DescribeTags' :: DescribeTags -> Maybe Int
$sel:filters:DescribeTags' :: DescribeTags -> Maybe [Filter]
$sel:dryRun:DescribeTags' :: DescribeTags -> Maybe Bool
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"DescribeTags" :: Prelude.ByteString),
        ByteString
"Version"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2016-11-15" :: Prelude.ByteString),
        ByteString
"DryRun" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
dryRun,
        forall a. ToQuery a => a -> QueryString
Data.toQuery
          (forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"Filter" forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Filter]
filters),
        ByteString
"MaxResults" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Int
maxResults,
        ByteString
"NextToken" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
nextToken
      ]

-- | /See:/ 'newDescribeTagsResponse' smart constructor.
data DescribeTagsResponse = DescribeTagsResponse'
  { -- | The token to use to retrieve the next page of results. This value is
    -- @null@ when there are no more results to return.
    DescribeTagsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The tags.
    DescribeTagsResponse -> Maybe [TagDescription]
tags :: Prelude.Maybe [TagDescription],
    -- | The response's http status code.
    DescribeTagsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeTagsResponse -> DescribeTagsResponse -> Bool
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]
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
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. 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 token to use to retrieve the next page of results. This value is
-- @null@ when there are no more results to return.
--
-- 'tags', 'describeTagsResponse_tags' - The tags.
--
-- 'httpStatus', 'describeTagsResponse_httpStatus' - The response's http status code.
newDescribeTagsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeTagsResponse
newDescribeTagsResponse :: Int -> DescribeTagsResponse
newDescribeTagsResponse Int
pHttpStatus_ =
  DescribeTagsResponse'
    { $sel:nextToken:DescribeTagsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:tags:DescribeTagsResponse' :: Maybe [TagDescription]
tags = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeTagsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The token to use to retrieve the next page of results. This value is
-- @null@ when there are no more results to return.
describeTagsResponse_nextToken :: Lens.Lens' DescribeTagsResponse (Prelude.Maybe Prelude.Text)
describeTagsResponse_nextToken :: Lens' DescribeTagsResponse (Maybe Text)
describeTagsResponse_nextToken = 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)

-- | The tags.
describeTagsResponse_tags :: Lens.Lens' DescribeTagsResponse (Prelude.Maybe [TagDescription])
describeTagsResponse_tags :: Lens' DescribeTagsResponse (Maybe [TagDescription])
describeTagsResponse_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTagsResponse' {Maybe [TagDescription]
tags :: Maybe [TagDescription]
$sel:tags:DescribeTagsResponse' :: DescribeTagsResponse -> Maybe [TagDescription]
tags} -> Maybe [TagDescription]
tags) (\s :: DescribeTagsResponse
s@DescribeTagsResponse' {} Maybe [TagDescription]
a -> DescribeTagsResponse
s {$sel:tags:DescribeTagsResponse' :: Maybe [TagDescription]
tags = Maybe [TagDescription]
a} :: DescribeTagsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 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 :: Lens' DescribeTagsResponse Int
describeTagsResponse_httpStatus = 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 where
  rnf :: DescribeTagsResponse -> ()
rnf DescribeTagsResponse' {Int
Maybe [TagDescription]
Maybe Text
httpStatus :: Int
tags :: Maybe [TagDescription]
nextToken :: Maybe Text
$sel:httpStatus:DescribeTagsResponse' :: DescribeTagsResponse -> Int
$sel:tags:DescribeTagsResponse' :: DescribeTagsResponse -> Maybe [TagDescription]
$sel:nextToken:DescribeTagsResponse' :: DescribeTagsResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [TagDescription]
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus