{-# 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.OpsWorksCM.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)
--
-- Returns a list of tags that are applied to the specified AWS OpsWorks
-- for Chef Automate or AWS OpsWorks for Puppet Enterprise servers or
-- backups.
--
-- This operation returns paginated results.
module Amazonka.OpsWorksCM.ListTagsForResource
  ( -- * Creating a Request
    ListTagsForResource (..),
    newListTagsForResource,

    -- * Request Lenses
    listTagsForResource_nextToken,
    listTagsForResource_maxResults,
    listTagsForResource_resourceArn,

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

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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.OpsWorksCM.Types
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'
  { -- | NextToken is a string that is returned in some command responses. It
    -- indicates that not all entries have been returned, and that you must run
    -- at least one more request to get remaining items. To get remaining
    -- results, call @ListTagsForResource@ again, and assign the token from the
    -- previous results as the value of the @nextToken@ parameter. If there are
    -- no more results, the response object\'s @nextToken@ parameter value is
    -- @null@. Setting a @nextToken@ value that was not returned in your
    -- previous results causes an @InvalidNextTokenException@ to occur.
    ListTagsForResource -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | To receive a paginated response, use this parameter to specify the
    -- maximum number of results to be returned with a single call. If the
    -- number of available results exceeds this maximum, the response includes
    -- a @NextToken@ value that you can assign to the @NextToken@ request
    -- parameter to get the next set of results.
    ListTagsForResource -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The Amazon Resource Number (ARN) of an AWS OpsWorks for Chef Automate or
    -- AWS OpsWorks for Puppet Enterprise server for which you want to show
    -- applied tags. For example,
    -- @arn:aws:opsworks-cm:us-west-2:123456789012:server\/test-owcm-server\/EXAMPLE-66b0-4196-8274-d1a2bEXAMPLE@.
    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' - NextToken is a string that is returned in some command responses. It
-- indicates that not all entries have been returned, and that you must run
-- at least one more request to get remaining items. To get remaining
-- results, call @ListTagsForResource@ again, and assign the token from the
-- previous results as the value of the @nextToken@ parameter. If there are
-- no more results, the response object\'s @nextToken@ parameter value is
-- @null@. Setting a @nextToken@ value that was not returned in your
-- previous results causes an @InvalidNextTokenException@ to occur.
--
-- 'maxResults', 'listTagsForResource_maxResults' - To receive a paginated response, use this parameter to specify the
-- maximum number of results to be returned with a single call. If the
-- number of available results exceeds this maximum, the response includes
-- a @NextToken@ value that you can assign to the @NextToken@ request
-- parameter to get the next set of results.
--
-- 'resourceArn', 'listTagsForResource_resourceArn' - The Amazon Resource Number (ARN) of an AWS OpsWorks for Chef Automate or
-- AWS OpsWorks for Puppet Enterprise server for which you want to show
-- applied tags. For example,
-- @arn:aws:opsworks-cm:us-west-2:123456789012:server\/test-owcm-server\/EXAMPLE-66b0-4196-8274-d1a2bEXAMPLE@.
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:maxResults:ListTagsForResource' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:resourceArn:ListTagsForResource' :: Text
resourceArn = Text
pResourceArn_
    }

-- | NextToken is a string that is returned in some command responses. It
-- indicates that not all entries have been returned, and that you must run
-- at least one more request to get remaining items. To get remaining
-- results, call @ListTagsForResource@ again, and assign the token from the
-- previous results as the value of the @nextToken@ parameter. If there are
-- no more results, the response object\'s @nextToken@ parameter value is
-- @null@. Setting a @nextToken@ value that was not returned in your
-- previous results causes an @InvalidNextTokenException@ to occur.
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)

-- | To receive a paginated response, use this parameter to specify the
-- maximum number of results to be returned with a single call. If the
-- number of available results exceeds this maximum, the response includes
-- a @NextToken@ value that you can assign to the @NextToken@ request
-- parameter to get the next set of results.
listTagsForResource_maxResults :: Lens.Lens' ListTagsForResource (Prelude.Maybe Prelude.Natural)
listTagsForResource_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListTagsForResource -> f ListTagsForResource
listTagsForResource_maxResults = (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
maxResults :: Maybe Natural
$sel:maxResults:ListTagsForResource' :: ListTagsForResource -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListTagsForResource
s@ListTagsForResource' {} Maybe Natural
a -> ListTagsForResource
s {$sel:maxResults:ListTagsForResource' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListTagsForResource)

-- | The Amazon Resource Number (ARN) of an AWS OpsWorks for Chef Automate or
-- AWS OpsWorks for Puppet Enterprise server for which you want to show
-- applied tags. For example,
-- @arn:aws:opsworks-cm:us-west-2:123456789012:server\/test-owcm-server\/EXAMPLE-66b0-4196-8274-d1a2bEXAMPLE@.
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
    | Maybe [Tag] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListTagsForResource
ListTagsForResourceResponse
rs
            ListTagsForResourceResponse
-> Getting (First [Tag]) ListTagsForResourceResponse [Tag]
-> Maybe [Tag]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [Tag] -> Const (First [Tag]) (Maybe [Tag]))
-> ListTagsForResourceResponse
-> Const (First [Tag]) ListTagsForResourceResponse
Lens' ListTagsForResourceResponse (Maybe [Tag])
listTagsForResourceResponse_tags
              ((Maybe [Tag] -> Const (First [Tag]) (Maybe [Tag]))
 -> ListTagsForResourceResponse
 -> Const (First [Tag]) ListTagsForResourceResponse)
-> (([Tag] -> Const (First [Tag]) [Tag])
    -> Maybe [Tag] -> Const (First [Tag]) (Maybe [Tag]))
-> Getting (First [Tag]) ListTagsForResourceResponse [Tag]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Tag] -> Const (First [Tag]) [Tag])
-> Maybe [Tag] -> Const (First [Tag]) (Maybe [Tag])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      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, ToJSON a) => Service -> a -> Request a
Request.postJSON 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 -> Maybe [Tag] -> Int -> ListTagsForResourceResponse
ListTagsForResourceResponse'
            (Maybe Text -> Maybe [Tag] -> Int -> ListTagsForResourceResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe [Tag] -> Int -> 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 (Maybe [Tag] -> Int -> ListTagsForResourceResponse)
-> Either String (Maybe [Tag])
-> Either String (Int -> ListTagsForResourceResponse)
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 -> ListTagsForResourceResponse)
-> Either String Int -> Either String 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))
      )

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
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"OpsWorksCM_V2016_11_01.ListTagsForResource" ::
                          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 ListTagsForResource where
  toJSON :: ListTagsForResource -> Value
toJSON ListTagsForResource' {Maybe Natural
Maybe Text
Text
resourceArn :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:resourceArn:ListTagsForResource' :: ListTagsForResource -> Text
$sel:maxResults:ListTagsForResource' :: ListTagsForResource -> Maybe Natural
$sel:nextToken:ListTagsForResource' :: ListTagsForResource -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (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 -> 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
maxResults,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ResourceArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
resourceArn)
          ]
      )

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

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

-- | /See:/ 'newListTagsForResourceResponse' smart constructor.
data ListTagsForResourceResponse = ListTagsForResourceResponse'
  { -- | A token that you can use as the value of @NextToken@ in subsequent calls
    -- to the API to show more results.
    ListTagsForResourceResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Tags that have been applied to the resource.
    ListTagsForResourceResponse -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The response's http status code.
    ListTagsForResourceResponse -> Int
httpStatus :: Prelude.Int
  }
  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' - A token that you can use as the value of @NextToken@ in subsequent calls
-- to the API to show more results.
--
-- 'tags', 'listTagsForResourceResponse_tags' - Tags that have been applied to the resource.
--
-- 'httpStatus', 'listTagsForResourceResponse_httpStatus' - The response's http status code.
newListTagsForResourceResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListTagsForResourceResponse
newListTagsForResourceResponse :: Int -> ListTagsForResourceResponse
newListTagsForResourceResponse Int
pHttpStatus_ =
  ListTagsForResourceResponse' :: Maybe Text -> Maybe [Tag] -> Int -> ListTagsForResourceResponse
ListTagsForResourceResponse'
    { $sel:nextToken:ListTagsForResourceResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:ListTagsForResourceResponse' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListTagsForResourceResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A token that you can use as the value of @NextToken@ in subsequent calls
-- to the API to show more results.
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)

-- | Tags that have been applied to the resource.
listTagsForResourceResponse_tags :: Lens.Lens' ListTagsForResourceResponse (Prelude.Maybe [Tag])
listTagsForResourceResponse_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> ListTagsForResourceResponse -> f ListTagsForResourceResponse
listTagsForResourceResponse_tags = (ListTagsForResourceResponse -> Maybe [Tag])
-> (ListTagsForResourceResponse
    -> Maybe [Tag] -> ListTagsForResourceResponse)
-> Lens' ListTagsForResourceResponse (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTagsForResourceResponse' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:ListTagsForResourceResponse' :: ListTagsForResourceResponse -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: ListTagsForResourceResponse
s@ListTagsForResourceResponse' {} Maybe [Tag]
a -> ListTagsForResourceResponse
s {$sel:tags:ListTagsForResourceResponse' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: ListTagsForResourceResponse) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> ListTagsForResourceResponse -> f ListTagsForResourceResponse)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> ListTagsForResourceResponse
-> f ListTagsForResourceResponse
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.
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)

instance Prelude.NFData ListTagsForResourceResponse