{-# 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.CodeCommit.ListApprovalRuleTemplates
-- 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)
--
-- Lists all approval rule templates in the specified AWS Region in your
-- AWS account. If an AWS Region is not specified, the AWS Region where you
-- are signed in is used.
module Amazonka.CodeCommit.ListApprovalRuleTemplates
  ( -- * Creating a Request
    ListApprovalRuleTemplates (..),
    newListApprovalRuleTemplates,

    -- * Request Lenses
    listApprovalRuleTemplates_nextToken,
    listApprovalRuleTemplates_maxResults,

    -- * Destructuring the Response
    ListApprovalRuleTemplatesResponse (..),
    newListApprovalRuleTemplatesResponse,

    -- * Response Lenses
    listApprovalRuleTemplatesResponse_nextToken,
    listApprovalRuleTemplatesResponse_approvalRuleTemplateNames,
    listApprovalRuleTemplatesResponse_httpStatus,
  )
where

import Amazonka.CodeCommit.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:/ 'newListApprovalRuleTemplates' smart constructor.
data ListApprovalRuleTemplates = ListApprovalRuleTemplates'
  { -- | An enumeration token that, when provided in a request, returns the next
    -- batch of the results.
    ListApprovalRuleTemplates -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | A non-zero, non-negative integer used to limit the number of returned
    -- results.
    ListApprovalRuleTemplates -> Maybe Int
maxResults :: Prelude.Maybe Prelude.Int
  }
  deriving (ListApprovalRuleTemplates -> ListApprovalRuleTemplates -> Bool
(ListApprovalRuleTemplates -> ListApprovalRuleTemplates -> Bool)
-> (ListApprovalRuleTemplates -> ListApprovalRuleTemplates -> Bool)
-> Eq ListApprovalRuleTemplates
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListApprovalRuleTemplates -> ListApprovalRuleTemplates -> Bool
$c/= :: ListApprovalRuleTemplates -> ListApprovalRuleTemplates -> Bool
== :: ListApprovalRuleTemplates -> ListApprovalRuleTemplates -> Bool
$c== :: ListApprovalRuleTemplates -> ListApprovalRuleTemplates -> Bool
Prelude.Eq, ReadPrec [ListApprovalRuleTemplates]
ReadPrec ListApprovalRuleTemplates
Int -> ReadS ListApprovalRuleTemplates
ReadS [ListApprovalRuleTemplates]
(Int -> ReadS ListApprovalRuleTemplates)
-> ReadS [ListApprovalRuleTemplates]
-> ReadPrec ListApprovalRuleTemplates
-> ReadPrec [ListApprovalRuleTemplates]
-> Read ListApprovalRuleTemplates
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListApprovalRuleTemplates]
$creadListPrec :: ReadPrec [ListApprovalRuleTemplates]
readPrec :: ReadPrec ListApprovalRuleTemplates
$creadPrec :: ReadPrec ListApprovalRuleTemplates
readList :: ReadS [ListApprovalRuleTemplates]
$creadList :: ReadS [ListApprovalRuleTemplates]
readsPrec :: Int -> ReadS ListApprovalRuleTemplates
$creadsPrec :: Int -> ReadS ListApprovalRuleTemplates
Prelude.Read, Int -> ListApprovalRuleTemplates -> ShowS
[ListApprovalRuleTemplates] -> ShowS
ListApprovalRuleTemplates -> String
(Int -> ListApprovalRuleTemplates -> ShowS)
-> (ListApprovalRuleTemplates -> String)
-> ([ListApprovalRuleTemplates] -> ShowS)
-> Show ListApprovalRuleTemplates
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListApprovalRuleTemplates] -> ShowS
$cshowList :: [ListApprovalRuleTemplates] -> ShowS
show :: ListApprovalRuleTemplates -> String
$cshow :: ListApprovalRuleTemplates -> String
showsPrec :: Int -> ListApprovalRuleTemplates -> ShowS
$cshowsPrec :: Int -> ListApprovalRuleTemplates -> ShowS
Prelude.Show, (forall x.
 ListApprovalRuleTemplates -> Rep ListApprovalRuleTemplates x)
-> (forall x.
    Rep ListApprovalRuleTemplates x -> ListApprovalRuleTemplates)
-> Generic ListApprovalRuleTemplates
forall x.
Rep ListApprovalRuleTemplates x -> ListApprovalRuleTemplates
forall x.
ListApprovalRuleTemplates -> Rep ListApprovalRuleTemplates x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListApprovalRuleTemplates x -> ListApprovalRuleTemplates
$cfrom :: forall x.
ListApprovalRuleTemplates -> Rep ListApprovalRuleTemplates x
Prelude.Generic)

-- |
-- Create a value of 'ListApprovalRuleTemplates' 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', 'listApprovalRuleTemplates_nextToken' - An enumeration token that, when provided in a request, returns the next
-- batch of the results.
--
-- 'maxResults', 'listApprovalRuleTemplates_maxResults' - A non-zero, non-negative integer used to limit the number of returned
-- results.
newListApprovalRuleTemplates ::
  ListApprovalRuleTemplates
newListApprovalRuleTemplates :: ListApprovalRuleTemplates
newListApprovalRuleTemplates =
  ListApprovalRuleTemplates' :: Maybe Text -> Maybe Int -> ListApprovalRuleTemplates
ListApprovalRuleTemplates'
    { $sel:nextToken:ListApprovalRuleTemplates' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListApprovalRuleTemplates' :: Maybe Int
maxResults = Maybe Int
forall a. Maybe a
Prelude.Nothing
    }

-- | An enumeration token that, when provided in a request, returns the next
-- batch of the results.
listApprovalRuleTemplates_nextToken :: Lens.Lens' ListApprovalRuleTemplates (Prelude.Maybe Prelude.Text)
listApprovalRuleTemplates_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListApprovalRuleTemplates -> f ListApprovalRuleTemplates
listApprovalRuleTemplates_nextToken = (ListApprovalRuleTemplates -> Maybe Text)
-> (ListApprovalRuleTemplates
    -> Maybe Text -> ListApprovalRuleTemplates)
-> Lens
     ListApprovalRuleTemplates
     ListApprovalRuleTemplates
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListApprovalRuleTemplates' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListApprovalRuleTemplates' :: ListApprovalRuleTemplates -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListApprovalRuleTemplates
s@ListApprovalRuleTemplates' {} Maybe Text
a -> ListApprovalRuleTemplates
s {$sel:nextToken:ListApprovalRuleTemplates' :: Maybe Text
nextToken = Maybe Text
a} :: ListApprovalRuleTemplates)

-- | A non-zero, non-negative integer used to limit the number of returned
-- results.
listApprovalRuleTemplates_maxResults :: Lens.Lens' ListApprovalRuleTemplates (Prelude.Maybe Prelude.Int)
listApprovalRuleTemplates_maxResults :: (Maybe Int -> f (Maybe Int))
-> ListApprovalRuleTemplates -> f ListApprovalRuleTemplates
listApprovalRuleTemplates_maxResults = (ListApprovalRuleTemplates -> Maybe Int)
-> (ListApprovalRuleTemplates
    -> Maybe Int -> ListApprovalRuleTemplates)
-> Lens
     ListApprovalRuleTemplates
     ListApprovalRuleTemplates
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListApprovalRuleTemplates' {Maybe Int
maxResults :: Maybe Int
$sel:maxResults:ListApprovalRuleTemplates' :: ListApprovalRuleTemplates -> Maybe Int
maxResults} -> Maybe Int
maxResults) (\s :: ListApprovalRuleTemplates
s@ListApprovalRuleTemplates' {} Maybe Int
a -> ListApprovalRuleTemplates
s {$sel:maxResults:ListApprovalRuleTemplates' :: Maybe Int
maxResults = Maybe Int
a} :: ListApprovalRuleTemplates)

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

instance Prelude.NFData ListApprovalRuleTemplates

instance Core.ToHeaders ListApprovalRuleTemplates where
  toHeaders :: ListApprovalRuleTemplates -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListApprovalRuleTemplates -> 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
"CodeCommit_20150413.ListApprovalRuleTemplates" ::
                          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 ListApprovalRuleTemplates where
  toJSON :: ListApprovalRuleTemplates -> Value
toJSON ListApprovalRuleTemplates' {Maybe Int
Maybe Text
maxResults :: Maybe Int
nextToken :: Maybe Text
$sel:maxResults:ListApprovalRuleTemplates' :: ListApprovalRuleTemplates -> Maybe Int
$sel:nextToken:ListApprovalRuleTemplates' :: ListApprovalRuleTemplates -> 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 -> 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 ListApprovalRuleTemplates where
  toPath :: ListApprovalRuleTemplates -> ByteString
toPath = ByteString -> ListApprovalRuleTemplates -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | /See:/ 'newListApprovalRuleTemplatesResponse' smart constructor.
data ListApprovalRuleTemplatesResponse = ListApprovalRuleTemplatesResponse'
  { -- | An enumeration token that allows the operation to batch the next results
    -- of the operation.
    ListApprovalRuleTemplatesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The names of all the approval rule templates found in the AWS Region for
    -- your AWS account.
    ListApprovalRuleTemplatesResponse -> Maybe [Text]
approvalRuleTemplateNames :: Prelude.Maybe [Prelude.Text],
    -- | The response's http status code.
    ListApprovalRuleTemplatesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListApprovalRuleTemplatesResponse
-> ListApprovalRuleTemplatesResponse -> Bool
(ListApprovalRuleTemplatesResponse
 -> ListApprovalRuleTemplatesResponse -> Bool)
-> (ListApprovalRuleTemplatesResponse
    -> ListApprovalRuleTemplatesResponse -> Bool)
-> Eq ListApprovalRuleTemplatesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListApprovalRuleTemplatesResponse
-> ListApprovalRuleTemplatesResponse -> Bool
$c/= :: ListApprovalRuleTemplatesResponse
-> ListApprovalRuleTemplatesResponse -> Bool
== :: ListApprovalRuleTemplatesResponse
-> ListApprovalRuleTemplatesResponse -> Bool
$c== :: ListApprovalRuleTemplatesResponse
-> ListApprovalRuleTemplatesResponse -> Bool
Prelude.Eq, ReadPrec [ListApprovalRuleTemplatesResponse]
ReadPrec ListApprovalRuleTemplatesResponse
Int -> ReadS ListApprovalRuleTemplatesResponse
ReadS [ListApprovalRuleTemplatesResponse]
(Int -> ReadS ListApprovalRuleTemplatesResponse)
-> ReadS [ListApprovalRuleTemplatesResponse]
-> ReadPrec ListApprovalRuleTemplatesResponse
-> ReadPrec [ListApprovalRuleTemplatesResponse]
-> Read ListApprovalRuleTemplatesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListApprovalRuleTemplatesResponse]
$creadListPrec :: ReadPrec [ListApprovalRuleTemplatesResponse]
readPrec :: ReadPrec ListApprovalRuleTemplatesResponse
$creadPrec :: ReadPrec ListApprovalRuleTemplatesResponse
readList :: ReadS [ListApprovalRuleTemplatesResponse]
$creadList :: ReadS [ListApprovalRuleTemplatesResponse]
readsPrec :: Int -> ReadS ListApprovalRuleTemplatesResponse
$creadsPrec :: Int -> ReadS ListApprovalRuleTemplatesResponse
Prelude.Read, Int -> ListApprovalRuleTemplatesResponse -> ShowS
[ListApprovalRuleTemplatesResponse] -> ShowS
ListApprovalRuleTemplatesResponse -> String
(Int -> ListApprovalRuleTemplatesResponse -> ShowS)
-> (ListApprovalRuleTemplatesResponse -> String)
-> ([ListApprovalRuleTemplatesResponse] -> ShowS)
-> Show ListApprovalRuleTemplatesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListApprovalRuleTemplatesResponse] -> ShowS
$cshowList :: [ListApprovalRuleTemplatesResponse] -> ShowS
show :: ListApprovalRuleTemplatesResponse -> String
$cshow :: ListApprovalRuleTemplatesResponse -> String
showsPrec :: Int -> ListApprovalRuleTemplatesResponse -> ShowS
$cshowsPrec :: Int -> ListApprovalRuleTemplatesResponse -> ShowS
Prelude.Show, (forall x.
 ListApprovalRuleTemplatesResponse
 -> Rep ListApprovalRuleTemplatesResponse x)
-> (forall x.
    Rep ListApprovalRuleTemplatesResponse x
    -> ListApprovalRuleTemplatesResponse)
-> Generic ListApprovalRuleTemplatesResponse
forall x.
Rep ListApprovalRuleTemplatesResponse x
-> ListApprovalRuleTemplatesResponse
forall x.
ListApprovalRuleTemplatesResponse
-> Rep ListApprovalRuleTemplatesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListApprovalRuleTemplatesResponse x
-> ListApprovalRuleTemplatesResponse
$cfrom :: forall x.
ListApprovalRuleTemplatesResponse
-> Rep ListApprovalRuleTemplatesResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListApprovalRuleTemplatesResponse' 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', 'listApprovalRuleTemplatesResponse_nextToken' - An enumeration token that allows the operation to batch the next results
-- of the operation.
--
-- 'approvalRuleTemplateNames', 'listApprovalRuleTemplatesResponse_approvalRuleTemplateNames' - The names of all the approval rule templates found in the AWS Region for
-- your AWS account.
--
-- 'httpStatus', 'listApprovalRuleTemplatesResponse_httpStatus' - The response's http status code.
newListApprovalRuleTemplatesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListApprovalRuleTemplatesResponse
newListApprovalRuleTemplatesResponse :: Int -> ListApprovalRuleTemplatesResponse
newListApprovalRuleTemplatesResponse Int
pHttpStatus_ =
  ListApprovalRuleTemplatesResponse' :: Maybe Text
-> Maybe [Text] -> Int -> ListApprovalRuleTemplatesResponse
ListApprovalRuleTemplatesResponse'
    { $sel:nextToken:ListApprovalRuleTemplatesResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:approvalRuleTemplateNames:ListApprovalRuleTemplatesResponse' :: Maybe [Text]
approvalRuleTemplateNames =
        Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListApprovalRuleTemplatesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | An enumeration token that allows the operation to batch the next results
-- of the operation.
listApprovalRuleTemplatesResponse_nextToken :: Lens.Lens' ListApprovalRuleTemplatesResponse (Prelude.Maybe Prelude.Text)
listApprovalRuleTemplatesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListApprovalRuleTemplatesResponse
-> f ListApprovalRuleTemplatesResponse
listApprovalRuleTemplatesResponse_nextToken = (ListApprovalRuleTemplatesResponse -> Maybe Text)
-> (ListApprovalRuleTemplatesResponse
    -> Maybe Text -> ListApprovalRuleTemplatesResponse)
-> Lens
     ListApprovalRuleTemplatesResponse
     ListApprovalRuleTemplatesResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListApprovalRuleTemplatesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListApprovalRuleTemplatesResponse' :: ListApprovalRuleTemplatesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListApprovalRuleTemplatesResponse
s@ListApprovalRuleTemplatesResponse' {} Maybe Text
a -> ListApprovalRuleTemplatesResponse
s {$sel:nextToken:ListApprovalRuleTemplatesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListApprovalRuleTemplatesResponse)

-- | The names of all the approval rule templates found in the AWS Region for
-- your AWS account.
listApprovalRuleTemplatesResponse_approvalRuleTemplateNames :: Lens.Lens' ListApprovalRuleTemplatesResponse (Prelude.Maybe [Prelude.Text])
listApprovalRuleTemplatesResponse_approvalRuleTemplateNames :: (Maybe [Text] -> f (Maybe [Text]))
-> ListApprovalRuleTemplatesResponse
-> f ListApprovalRuleTemplatesResponse
listApprovalRuleTemplatesResponse_approvalRuleTemplateNames = (ListApprovalRuleTemplatesResponse -> Maybe [Text])
-> (ListApprovalRuleTemplatesResponse
    -> Maybe [Text] -> ListApprovalRuleTemplatesResponse)
-> Lens
     ListApprovalRuleTemplatesResponse
     ListApprovalRuleTemplatesResponse
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListApprovalRuleTemplatesResponse' {Maybe [Text]
approvalRuleTemplateNames :: Maybe [Text]
$sel:approvalRuleTemplateNames:ListApprovalRuleTemplatesResponse' :: ListApprovalRuleTemplatesResponse -> Maybe [Text]
approvalRuleTemplateNames} -> Maybe [Text]
approvalRuleTemplateNames) (\s :: ListApprovalRuleTemplatesResponse
s@ListApprovalRuleTemplatesResponse' {} Maybe [Text]
a -> ListApprovalRuleTemplatesResponse
s {$sel:approvalRuleTemplateNames:ListApprovalRuleTemplatesResponse' :: Maybe [Text]
approvalRuleTemplateNames = Maybe [Text]
a} :: ListApprovalRuleTemplatesResponse) ((Maybe [Text] -> f (Maybe [Text]))
 -> ListApprovalRuleTemplatesResponse
 -> f ListApprovalRuleTemplatesResponse)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ListApprovalRuleTemplatesResponse
-> f ListApprovalRuleTemplatesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    ListApprovalRuleTemplatesResponse