{-# 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.AppMesh.ListTagsForResource
-- 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)
--
-- List the tags for an App Mesh resource.
--
-- This operation returns paginated results.
module Amazonka.AppMesh.ListTagsForResource
  ( -- * Creating a Request
    ListTagsForResource (..),
    newListTagsForResource,

    -- * Request Lenses
    listTagsForResource_nextToken,
    listTagsForResource_limit,
    listTagsForResource_resourceArn,

    -- * Destructuring the Response
    ListTagsForResourceResponse (..),
    newListTagsForResourceResponse,

    -- * Response Lenses
    listTagsForResourceResponse_nextToken,
    listTagsForResourceResponse_httpStatus,
    listTagsForResourceResponse_tags,
  )
where

import Amazonka.AppMesh.Types
import qualified Amazonka.Core as Core
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:/ 'newListTagsForResource' smart constructor.
data ListTagsForResource = ListTagsForResource'
  { -- | The @nextToken@ value returned from a previous paginated
    -- @ListTagsForResource@ request where @limit@ was used and the results
    -- exceeded the value of that parameter. Pagination continues from the end
    -- of the previous results that returned the @nextToken@ value.
    ListTagsForResource -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of tag results returned by @ListTagsForResource@ in
    -- paginated output. When this parameter is used, @ListTagsForResource@
    -- returns only @limit@ results in a single page along with a @nextToken@
    -- response element. You can see the remaining results of the initial
    -- request by sending another @ListTagsForResource@ request with the
    -- returned @nextToken@ value. This value can be between 1 and 100. If you
    -- don\'t use this parameter, @ListTagsForResource@ returns up to 100
    -- results and a @nextToken@ value if applicable.
    ListTagsForResource -> Maybe Natural
limit :: Prelude.Maybe Prelude.Natural,
    -- | The Amazon Resource Name (ARN) that identifies the resource to list the
    -- tags for.
    ListTagsForResource -> Text
resourceArn :: Prelude.Text
  }
  deriving (ListTagsForResource -> ListTagsForResource -> Bool
(ListTagsForResource -> ListTagsForResource -> Bool)
-> (ListTagsForResource -> ListTagsForResource -> Bool)
-> Eq ListTagsForResource
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListTagsForResource -> ListTagsForResource -> Bool
$c/= :: ListTagsForResource -> ListTagsForResource -> Bool
== :: ListTagsForResource -> ListTagsForResource -> Bool
$c== :: ListTagsForResource -> ListTagsForResource -> Bool
Prelude.Eq, ReadPrec [ListTagsForResource]
ReadPrec ListTagsForResource
Int -> ReadS ListTagsForResource
ReadS [ListTagsForResource]
(Int -> ReadS ListTagsForResource)
-> ReadS [ListTagsForResource]
-> ReadPrec ListTagsForResource
-> ReadPrec [ListTagsForResource]
-> Read ListTagsForResource
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListTagsForResource]
$creadListPrec :: ReadPrec [ListTagsForResource]
readPrec :: ReadPrec ListTagsForResource
$creadPrec :: ReadPrec ListTagsForResource
readList :: ReadS [ListTagsForResource]
$creadList :: ReadS [ListTagsForResource]
readsPrec :: Int -> ReadS ListTagsForResource
$creadsPrec :: Int -> ReadS ListTagsForResource
Prelude.Read, Int -> ListTagsForResource -> ShowS
[ListTagsForResource] -> ShowS
ListTagsForResource -> String
(Int -> ListTagsForResource -> ShowS)
-> (ListTagsForResource -> String)
-> ([ListTagsForResource] -> ShowS)
-> Show ListTagsForResource
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListTagsForResource] -> ShowS
$cshowList :: [ListTagsForResource] -> ShowS
show :: ListTagsForResource -> String
$cshow :: ListTagsForResource -> String
showsPrec :: Int -> ListTagsForResource -> ShowS
$cshowsPrec :: Int -> ListTagsForResource -> ShowS
Prelude.Show, (forall x. ListTagsForResource -> Rep ListTagsForResource x)
-> (forall x. Rep ListTagsForResource x -> ListTagsForResource)
-> Generic ListTagsForResource
forall x. Rep ListTagsForResource x -> ListTagsForResource
forall x. ListTagsForResource -> Rep ListTagsForResource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListTagsForResource x -> ListTagsForResource
$cfrom :: forall x. ListTagsForResource -> Rep ListTagsForResource x
Prelude.Generic)

-- |
-- Create a value of 'ListTagsForResource' 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', 'listTagsForResource_nextToken' - The @nextToken@ value returned from a previous paginated
-- @ListTagsForResource@ request where @limit@ was used and the results
-- exceeded the value of that parameter. Pagination continues from the end
-- of the previous results that returned the @nextToken@ value.
--
-- 'limit', 'listTagsForResource_limit' - The maximum number of tag results returned by @ListTagsForResource@ in
-- paginated output. When this parameter is used, @ListTagsForResource@
-- returns only @limit@ results in a single page along with a @nextToken@
-- response element. You can see the remaining results of the initial
-- request by sending another @ListTagsForResource@ request with the
-- returned @nextToken@ value. This value can be between 1 and 100. If you
-- don\'t use this parameter, @ListTagsForResource@ returns up to 100
-- results and a @nextToken@ value if applicable.
--
-- 'resourceArn', 'listTagsForResource_resourceArn' - The Amazon Resource Name (ARN) that identifies the resource to list the
-- tags for.
newListTagsForResource ::
  -- | 'resourceArn'
  Prelude.Text ->
  ListTagsForResource
newListTagsForResource :: Text -> ListTagsForResource
newListTagsForResource Text
pResourceArn_ =
  ListTagsForResource' :: Maybe Text -> Maybe Natural -> Text -> ListTagsForResource
ListTagsForResource'
    { $sel:nextToken:ListTagsForResource' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:limit:ListTagsForResource' :: Maybe Natural
limit = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:resourceArn:ListTagsForResource' :: Text
resourceArn = Text
pResourceArn_
    }

-- | The @nextToken@ value returned from a previous paginated
-- @ListTagsForResource@ request where @limit@ was used and the results
-- exceeded the value of that parameter. Pagination continues from the end
-- of the previous results that returned the @nextToken@ value.
listTagsForResource_nextToken :: Lens.Lens' ListTagsForResource (Prelude.Maybe Prelude.Text)
listTagsForResource_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListTagsForResource -> f ListTagsForResource
listTagsForResource_nextToken = (ListTagsForResource -> Maybe Text)
-> (ListTagsForResource -> Maybe Text -> ListTagsForResource)
-> Lens
     ListTagsForResource ListTagsForResource (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTagsForResource' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListTagsForResource' :: ListTagsForResource -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListTagsForResource
s@ListTagsForResource' {} Maybe Text
a -> ListTagsForResource
s {$sel:nextToken:ListTagsForResource' :: Maybe Text
nextToken = Maybe Text
a} :: ListTagsForResource)

-- | The maximum number of tag results returned by @ListTagsForResource@ in
-- paginated output. When this parameter is used, @ListTagsForResource@
-- returns only @limit@ results in a single page along with a @nextToken@
-- response element. You can see the remaining results of the initial
-- request by sending another @ListTagsForResource@ request with the
-- returned @nextToken@ value. This value can be between 1 and 100. If you
-- don\'t use this parameter, @ListTagsForResource@ returns up to 100
-- results and a @nextToken@ value if applicable.
listTagsForResource_limit :: Lens.Lens' ListTagsForResource (Prelude.Maybe Prelude.Natural)
listTagsForResource_limit :: (Maybe Natural -> f (Maybe Natural))
-> ListTagsForResource -> f ListTagsForResource
listTagsForResource_limit = (ListTagsForResource -> Maybe Natural)
-> (ListTagsForResource -> Maybe Natural -> ListTagsForResource)
-> Lens
     ListTagsForResource
     ListTagsForResource
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTagsForResource' {Maybe Natural
limit :: Maybe Natural
$sel:limit:ListTagsForResource' :: ListTagsForResource -> Maybe Natural
limit} -> Maybe Natural
limit) (\s :: ListTagsForResource
s@ListTagsForResource' {} Maybe Natural
a -> ListTagsForResource
s {$sel:limit:ListTagsForResource' :: Maybe Natural
limit = Maybe Natural
a} :: ListTagsForResource)

-- | The Amazon Resource Name (ARN) that identifies the resource to list the
-- tags for.
listTagsForResource_resourceArn :: Lens.Lens' ListTagsForResource Prelude.Text
listTagsForResource_resourceArn :: (Text -> f Text) -> ListTagsForResource -> f ListTagsForResource
listTagsForResource_resourceArn = (ListTagsForResource -> Text)
-> (ListTagsForResource -> Text -> ListTagsForResource)
-> Lens ListTagsForResource ListTagsForResource Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTagsForResource' {Text
resourceArn :: Text
$sel:resourceArn:ListTagsForResource' :: ListTagsForResource -> Text
resourceArn} -> Text
resourceArn) (\s :: ListTagsForResource
s@ListTagsForResource' {} Text
a -> ListTagsForResource
s {$sel:resourceArn:ListTagsForResource' :: Text
resourceArn = Text
a} :: ListTagsForResource)

instance Core.AWSPager ListTagsForResource where
  page :: ListTagsForResource
-> AWSResponse ListTagsForResource -> Maybe ListTagsForResource
page ListTagsForResource
rq AWSResponse ListTagsForResource
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListTagsForResource
ListTagsForResourceResponse
rs
            ListTagsForResourceResponse
-> Getting (First Text) ListTagsForResourceResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListTagsForResourceResponse
-> Const (First Text) ListTagsForResourceResponse
Lens' ListTagsForResourceResponse (Maybe Text)
listTagsForResourceResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListTagsForResourceResponse
 -> Const (First Text) ListTagsForResourceResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListTagsForResourceResponse 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 ListTagsForResource
forall a. Maybe a
Prelude.Nothing
    | [TagRef] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        (AWSResponse ListTagsForResource
ListTagsForResourceResponse
rs ListTagsForResourceResponse
-> Getting [TagRef] ListTagsForResourceResponse [TagRef]
-> [TagRef]
forall s a. s -> Getting a s a -> a
Lens.^. Getting [TagRef] ListTagsForResourceResponse [TagRef]
Lens' ListTagsForResourceResponse [TagRef]
listTagsForResourceResponse_tags) =
      Maybe ListTagsForResource
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListTagsForResource -> Maybe ListTagsForResource
forall a. a -> Maybe a
Prelude.Just (ListTagsForResource -> Maybe ListTagsForResource)
-> ListTagsForResource -> Maybe ListTagsForResource
forall a b. (a -> b) -> a -> b
Prelude.$
        ListTagsForResource
rq
          ListTagsForResource
-> (ListTagsForResource -> ListTagsForResource)
-> ListTagsForResource
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListTagsForResource -> Identity ListTagsForResource
Lens
  ListTagsForResource ListTagsForResource (Maybe Text) (Maybe Text)
listTagsForResource_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListTagsForResource -> Identity ListTagsForResource)
-> Maybe Text -> ListTagsForResource -> ListTagsForResource
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListTagsForResource
ListTagsForResourceResponse
rs
          ListTagsForResourceResponse
-> Getting (First Text) ListTagsForResourceResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListTagsForResourceResponse
-> Const (First Text) ListTagsForResourceResponse
Lens' ListTagsForResourceResponse (Maybe Text)
listTagsForResourceResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListTagsForResourceResponse
 -> Const (First Text) ListTagsForResourceResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListTagsForResourceResponse 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 ListTagsForResource where
  type
    AWSResponse ListTagsForResource =
      ListTagsForResourceResponse
  request :: ListTagsForResource -> Request ListTagsForResource
request = Service -> ListTagsForResource -> Request ListTagsForResource
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy ListTagsForResource
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListTagsForResource)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListTagsForResource))
-> Logger
-> Service
-> Proxy ListTagsForResource
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListTagsForResource)))
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 -> Int -> [TagRef] -> ListTagsForResourceResponse
ListTagsForResourceResponse'
            (Maybe Text -> Int -> [TagRef] -> ListTagsForResourceResponse)
-> Either String (Maybe Text)
-> Either String (Int -> [TagRef] -> ListTagsForResourceResponse)
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 (Int -> [TagRef] -> ListTagsForResourceResponse)
-> Either String Int
-> Either String ([TagRef] -> ListTagsForResourceResponse)
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))
            Either String ([TagRef] -> ListTagsForResourceResponse)
-> Either String [TagRef]
-> Either String ListTagsForResourceResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe [TagRef])
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"tags" Either String (Maybe [TagRef])
-> [TagRef] -> Either String [TagRef]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [TagRef]
forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable ListTagsForResource

instance Prelude.NFData ListTagsForResource

instance Core.ToHeaders ListTagsForResource where
  toHeaders :: ListTagsForResource -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListTagsForResource -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ 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.ToPath ListTagsForResource where
  toPath :: ListTagsForResource -> ByteString
toPath = ByteString -> ListTagsForResource -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/v20190125/tags"

instance Core.ToQuery ListTagsForResource where
  toQuery :: ListTagsForResource -> QueryString
toQuery ListTagsForResource' {Maybe Natural
Maybe Text
Text
resourceArn :: Text
limit :: Maybe Natural
nextToken :: Maybe Text
$sel:resourceArn:ListTagsForResource' :: ListTagsForResource -> Text
$sel:limit:ListTagsForResource' :: ListTagsForResource -> Maybe Natural
$sel:nextToken:ListTagsForResource' :: ListTagsForResource -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"nextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"limit" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
limit,
        ByteString
"resourceArn" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
resourceArn
      ]

-- |
--
-- /See:/ 'newListTagsForResourceResponse' smart constructor.
data ListTagsForResourceResponse = ListTagsForResourceResponse'
  { -- | The @nextToken@ value to include in a future @ListTagsForResource@
    -- request. When the results of a @ListTagsForResource@ request exceed
    -- @limit@, you can use this value to retrieve the next page of results.
    -- This value is @null@ when there are no more results to return.
    ListTagsForResourceResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListTagsForResourceResponse -> Int
httpStatus :: Prelude.Int,
    -- | The tags for the resource.
    ListTagsForResourceResponse -> [TagRef]
tags :: [TagRef]
  }
  deriving (ListTagsForResourceResponse -> ListTagsForResourceResponse -> Bool
(ListTagsForResourceResponse
 -> ListTagsForResourceResponse -> Bool)
-> (ListTagsForResourceResponse
    -> ListTagsForResourceResponse -> Bool)
-> Eq ListTagsForResourceResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListTagsForResourceResponse -> ListTagsForResourceResponse -> Bool
$c/= :: ListTagsForResourceResponse -> ListTagsForResourceResponse -> Bool
== :: ListTagsForResourceResponse -> ListTagsForResourceResponse -> Bool
$c== :: ListTagsForResourceResponse -> ListTagsForResourceResponse -> Bool
Prelude.Eq, ReadPrec [ListTagsForResourceResponse]
ReadPrec ListTagsForResourceResponse
Int -> ReadS ListTagsForResourceResponse
ReadS [ListTagsForResourceResponse]
(Int -> ReadS ListTagsForResourceResponse)
-> ReadS [ListTagsForResourceResponse]
-> ReadPrec ListTagsForResourceResponse
-> ReadPrec [ListTagsForResourceResponse]
-> Read ListTagsForResourceResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListTagsForResourceResponse]
$creadListPrec :: ReadPrec [ListTagsForResourceResponse]
readPrec :: ReadPrec ListTagsForResourceResponse
$creadPrec :: ReadPrec ListTagsForResourceResponse
readList :: ReadS [ListTagsForResourceResponse]
$creadList :: ReadS [ListTagsForResourceResponse]
readsPrec :: Int -> ReadS ListTagsForResourceResponse
$creadsPrec :: Int -> ReadS ListTagsForResourceResponse
Prelude.Read, Int -> ListTagsForResourceResponse -> ShowS
[ListTagsForResourceResponse] -> ShowS
ListTagsForResourceResponse -> String
(Int -> ListTagsForResourceResponse -> ShowS)
-> (ListTagsForResourceResponse -> String)
-> ([ListTagsForResourceResponse] -> ShowS)
-> Show ListTagsForResourceResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListTagsForResourceResponse] -> ShowS
$cshowList :: [ListTagsForResourceResponse] -> ShowS
show :: ListTagsForResourceResponse -> String
$cshow :: ListTagsForResourceResponse -> String
showsPrec :: Int -> ListTagsForResourceResponse -> ShowS
$cshowsPrec :: Int -> ListTagsForResourceResponse -> ShowS
Prelude.Show, (forall x.
 ListTagsForResourceResponse -> Rep ListTagsForResourceResponse x)
-> (forall x.
    Rep ListTagsForResourceResponse x -> ListTagsForResourceResponse)
-> Generic ListTagsForResourceResponse
forall x.
Rep ListTagsForResourceResponse x -> ListTagsForResourceResponse
forall x.
ListTagsForResourceResponse -> Rep ListTagsForResourceResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListTagsForResourceResponse x -> ListTagsForResourceResponse
$cfrom :: forall x.
ListTagsForResourceResponse -> Rep ListTagsForResourceResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListTagsForResourceResponse' 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', 'listTagsForResourceResponse_nextToken' - The @nextToken@ value to include in a future @ListTagsForResource@
-- request. When the results of a @ListTagsForResource@ request exceed
-- @limit@, you can use this value to retrieve the next page of results.
-- This value is @null@ when there are no more results to return.
--
-- 'httpStatus', 'listTagsForResourceResponse_httpStatus' - The response's http status code.
--
-- 'tags', 'listTagsForResourceResponse_tags' - The tags for the resource.
newListTagsForResourceResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListTagsForResourceResponse
newListTagsForResourceResponse :: Int -> ListTagsForResourceResponse
newListTagsForResourceResponse Int
pHttpStatus_ =
  ListTagsForResourceResponse' :: Maybe Text -> Int -> [TagRef] -> ListTagsForResourceResponse
ListTagsForResourceResponse'
    { $sel:nextToken:ListTagsForResourceResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListTagsForResourceResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:tags:ListTagsForResourceResponse' :: [TagRef]
tags = [TagRef]
forall a. Monoid a => a
Prelude.mempty
    }

-- | The @nextToken@ value to include in a future @ListTagsForResource@
-- request. When the results of a @ListTagsForResource@ request exceed
-- @limit@, you can use this value to retrieve the next page of results.
-- This value is @null@ when there are no more results to return.
listTagsForResourceResponse_nextToken :: Lens.Lens' ListTagsForResourceResponse (Prelude.Maybe Prelude.Text)
listTagsForResourceResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListTagsForResourceResponse -> f ListTagsForResourceResponse
listTagsForResourceResponse_nextToken = (ListTagsForResourceResponse -> Maybe Text)
-> (ListTagsForResourceResponse
    -> Maybe Text -> ListTagsForResourceResponse)
-> Lens' ListTagsForResourceResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTagsForResourceResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListTagsForResourceResponse' :: ListTagsForResourceResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListTagsForResourceResponse
s@ListTagsForResourceResponse' {} Maybe Text
a -> ListTagsForResourceResponse
s {$sel:nextToken:ListTagsForResourceResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListTagsForResourceResponse)

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

-- | The tags for the resource.
listTagsForResourceResponse_tags :: Lens.Lens' ListTagsForResourceResponse [TagRef]
listTagsForResourceResponse_tags :: ([TagRef] -> f [TagRef])
-> ListTagsForResourceResponse -> f ListTagsForResourceResponse
listTagsForResourceResponse_tags = (ListTagsForResourceResponse -> [TagRef])
-> (ListTagsForResourceResponse
    -> [TagRef] -> ListTagsForResourceResponse)
-> Lens' ListTagsForResourceResponse [TagRef]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTagsForResourceResponse' {[TagRef]
tags :: [TagRef]
$sel:tags:ListTagsForResourceResponse' :: ListTagsForResourceResponse -> [TagRef]
tags} -> [TagRef]
tags) (\s :: ListTagsForResourceResponse
s@ListTagsForResourceResponse' {} [TagRef]
a -> ListTagsForResourceResponse
s {$sel:tags:ListTagsForResourceResponse' :: [TagRef]
tags = [TagRef]
a} :: ListTagsForResourceResponse) (([TagRef] -> f [TagRef])
 -> ListTagsForResourceResponse -> f ListTagsForResourceResponse)
-> (([TagRef] -> f [TagRef]) -> [TagRef] -> f [TagRef])
-> ([TagRef] -> f [TagRef])
-> ListTagsForResourceResponse
-> f ListTagsForResourceResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([TagRef] -> f [TagRef]) -> [TagRef] -> f [TagRef]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.NFData ListTagsForResourceResponse