{-# 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.ListAssociatedApprovalRuleTemplatesForRepository
-- 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 that are associated with a specified
-- repository.
module Amazonka.CodeCommit.ListAssociatedApprovalRuleTemplatesForRepository
  ( -- * Creating a Request
    ListAssociatedApprovalRuleTemplatesForRepository (..),
    newListAssociatedApprovalRuleTemplatesForRepository,

    -- * Request Lenses
    listAssociatedApprovalRuleTemplatesForRepository_nextToken,
    listAssociatedApprovalRuleTemplatesForRepository_maxResults,
    listAssociatedApprovalRuleTemplatesForRepository_repositoryName,

    -- * Destructuring the Response
    ListAssociatedApprovalRuleTemplatesForRepositoryResponse (..),
    newListAssociatedApprovalRuleTemplatesForRepositoryResponse,

    -- * Response Lenses
    listAssociatedApprovalRuleTemplatesForRepositoryResponse_nextToken,
    listAssociatedApprovalRuleTemplatesForRepositoryResponse_approvalRuleTemplateNames,
    listAssociatedApprovalRuleTemplatesForRepositoryResponse_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:/ 'newListAssociatedApprovalRuleTemplatesForRepository' smart constructor.
data ListAssociatedApprovalRuleTemplatesForRepository = ListAssociatedApprovalRuleTemplatesForRepository'
  { -- | An enumeration token that, when provided in a request, returns the next
    -- batch of the results.
    ListAssociatedApprovalRuleTemplatesForRepository -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | A non-zero, non-negative integer used to limit the number of returned
    -- results.
    ListAssociatedApprovalRuleTemplatesForRepository -> Maybe Int
maxResults :: Prelude.Maybe Prelude.Int,
    -- | The name of the repository for which you want to list all associated
    -- approval rule templates.
    ListAssociatedApprovalRuleTemplatesForRepository -> Text
repositoryName :: Prelude.Text
  }
  deriving (ListAssociatedApprovalRuleTemplatesForRepository
-> ListAssociatedApprovalRuleTemplatesForRepository -> Bool
(ListAssociatedApprovalRuleTemplatesForRepository
 -> ListAssociatedApprovalRuleTemplatesForRepository -> Bool)
-> (ListAssociatedApprovalRuleTemplatesForRepository
    -> ListAssociatedApprovalRuleTemplatesForRepository -> Bool)
-> Eq ListAssociatedApprovalRuleTemplatesForRepository
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListAssociatedApprovalRuleTemplatesForRepository
-> ListAssociatedApprovalRuleTemplatesForRepository -> Bool
$c/= :: ListAssociatedApprovalRuleTemplatesForRepository
-> ListAssociatedApprovalRuleTemplatesForRepository -> Bool
== :: ListAssociatedApprovalRuleTemplatesForRepository
-> ListAssociatedApprovalRuleTemplatesForRepository -> Bool
$c== :: ListAssociatedApprovalRuleTemplatesForRepository
-> ListAssociatedApprovalRuleTemplatesForRepository -> Bool
Prelude.Eq, ReadPrec [ListAssociatedApprovalRuleTemplatesForRepository]
ReadPrec ListAssociatedApprovalRuleTemplatesForRepository
Int -> ReadS ListAssociatedApprovalRuleTemplatesForRepository
ReadS [ListAssociatedApprovalRuleTemplatesForRepository]
(Int -> ReadS ListAssociatedApprovalRuleTemplatesForRepository)
-> ReadS [ListAssociatedApprovalRuleTemplatesForRepository]
-> ReadPrec ListAssociatedApprovalRuleTemplatesForRepository
-> ReadPrec [ListAssociatedApprovalRuleTemplatesForRepository]
-> Read ListAssociatedApprovalRuleTemplatesForRepository
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListAssociatedApprovalRuleTemplatesForRepository]
$creadListPrec :: ReadPrec [ListAssociatedApprovalRuleTemplatesForRepository]
readPrec :: ReadPrec ListAssociatedApprovalRuleTemplatesForRepository
$creadPrec :: ReadPrec ListAssociatedApprovalRuleTemplatesForRepository
readList :: ReadS [ListAssociatedApprovalRuleTemplatesForRepository]
$creadList :: ReadS [ListAssociatedApprovalRuleTemplatesForRepository]
readsPrec :: Int -> ReadS ListAssociatedApprovalRuleTemplatesForRepository
$creadsPrec :: Int -> ReadS ListAssociatedApprovalRuleTemplatesForRepository
Prelude.Read, Int -> ListAssociatedApprovalRuleTemplatesForRepository -> ShowS
[ListAssociatedApprovalRuleTemplatesForRepository] -> ShowS
ListAssociatedApprovalRuleTemplatesForRepository -> String
(Int -> ListAssociatedApprovalRuleTemplatesForRepository -> ShowS)
-> (ListAssociatedApprovalRuleTemplatesForRepository -> String)
-> ([ListAssociatedApprovalRuleTemplatesForRepository] -> ShowS)
-> Show ListAssociatedApprovalRuleTemplatesForRepository
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListAssociatedApprovalRuleTemplatesForRepository] -> ShowS
$cshowList :: [ListAssociatedApprovalRuleTemplatesForRepository] -> ShowS
show :: ListAssociatedApprovalRuleTemplatesForRepository -> String
$cshow :: ListAssociatedApprovalRuleTemplatesForRepository -> String
showsPrec :: Int -> ListAssociatedApprovalRuleTemplatesForRepository -> ShowS
$cshowsPrec :: Int -> ListAssociatedApprovalRuleTemplatesForRepository -> ShowS
Prelude.Show, (forall x.
 ListAssociatedApprovalRuleTemplatesForRepository
 -> Rep ListAssociatedApprovalRuleTemplatesForRepository x)
-> (forall x.
    Rep ListAssociatedApprovalRuleTemplatesForRepository x
    -> ListAssociatedApprovalRuleTemplatesForRepository)
-> Generic ListAssociatedApprovalRuleTemplatesForRepository
forall x.
Rep ListAssociatedApprovalRuleTemplatesForRepository x
-> ListAssociatedApprovalRuleTemplatesForRepository
forall x.
ListAssociatedApprovalRuleTemplatesForRepository
-> Rep ListAssociatedApprovalRuleTemplatesForRepository x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListAssociatedApprovalRuleTemplatesForRepository x
-> ListAssociatedApprovalRuleTemplatesForRepository
$cfrom :: forall x.
ListAssociatedApprovalRuleTemplatesForRepository
-> Rep ListAssociatedApprovalRuleTemplatesForRepository x
Prelude.Generic)

-- |
-- Create a value of 'ListAssociatedApprovalRuleTemplatesForRepository' 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', 'listAssociatedApprovalRuleTemplatesForRepository_nextToken' - An enumeration token that, when provided in a request, returns the next
-- batch of the results.
--
-- 'maxResults', 'listAssociatedApprovalRuleTemplatesForRepository_maxResults' - A non-zero, non-negative integer used to limit the number of returned
-- results.
--
-- 'repositoryName', 'listAssociatedApprovalRuleTemplatesForRepository_repositoryName' - The name of the repository for which you want to list all associated
-- approval rule templates.
newListAssociatedApprovalRuleTemplatesForRepository ::
  -- | 'repositoryName'
  Prelude.Text ->
  ListAssociatedApprovalRuleTemplatesForRepository
newListAssociatedApprovalRuleTemplatesForRepository :: Text -> ListAssociatedApprovalRuleTemplatesForRepository
newListAssociatedApprovalRuleTemplatesForRepository
  Text
pRepositoryName_ =
    ListAssociatedApprovalRuleTemplatesForRepository' :: Maybe Text
-> Maybe Int
-> Text
-> ListAssociatedApprovalRuleTemplatesForRepository
ListAssociatedApprovalRuleTemplatesForRepository'
      { $sel:nextToken:ListAssociatedApprovalRuleTemplatesForRepository' :: Maybe Text
nextToken =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:maxResults:ListAssociatedApprovalRuleTemplatesForRepository' :: Maybe Int
maxResults =
          Maybe Int
forall a. Maybe a
Prelude.Nothing,
        $sel:repositoryName:ListAssociatedApprovalRuleTemplatesForRepository' :: Text
repositoryName =
          Text
pRepositoryName_
      }

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

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

-- | The name of the repository for which you want to list all associated
-- approval rule templates.
listAssociatedApprovalRuleTemplatesForRepository_repositoryName :: Lens.Lens' ListAssociatedApprovalRuleTemplatesForRepository Prelude.Text
listAssociatedApprovalRuleTemplatesForRepository_repositoryName :: (Text -> f Text)
-> ListAssociatedApprovalRuleTemplatesForRepository
-> f ListAssociatedApprovalRuleTemplatesForRepository
listAssociatedApprovalRuleTemplatesForRepository_repositoryName = (ListAssociatedApprovalRuleTemplatesForRepository -> Text)
-> (ListAssociatedApprovalRuleTemplatesForRepository
    -> Text -> ListAssociatedApprovalRuleTemplatesForRepository)
-> Lens
     ListAssociatedApprovalRuleTemplatesForRepository
     ListAssociatedApprovalRuleTemplatesForRepository
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAssociatedApprovalRuleTemplatesForRepository' {Text
repositoryName :: Text
$sel:repositoryName:ListAssociatedApprovalRuleTemplatesForRepository' :: ListAssociatedApprovalRuleTemplatesForRepository -> Text
repositoryName} -> Text
repositoryName) (\s :: ListAssociatedApprovalRuleTemplatesForRepository
s@ListAssociatedApprovalRuleTemplatesForRepository' {} Text
a -> ListAssociatedApprovalRuleTemplatesForRepository
s {$sel:repositoryName:ListAssociatedApprovalRuleTemplatesForRepository' :: Text
repositoryName = Text
a} :: ListAssociatedApprovalRuleTemplatesForRepository)

instance
  Core.AWSRequest
    ListAssociatedApprovalRuleTemplatesForRepository
  where
  type
    AWSResponse
      ListAssociatedApprovalRuleTemplatesForRepository =
      ListAssociatedApprovalRuleTemplatesForRepositoryResponse
  request :: ListAssociatedApprovalRuleTemplatesForRepository
-> Request ListAssociatedApprovalRuleTemplatesForRepository
request = Service
-> ListAssociatedApprovalRuleTemplatesForRepository
-> Request ListAssociatedApprovalRuleTemplatesForRepository
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ListAssociatedApprovalRuleTemplatesForRepository
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse ListAssociatedApprovalRuleTemplatesForRepository)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either
      String
      (AWSResponse ListAssociatedApprovalRuleTemplatesForRepository))
-> Logger
-> Service
-> Proxy ListAssociatedApprovalRuleTemplatesForRepository
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse ListAssociatedApprovalRuleTemplatesForRepository)))
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
-> ListAssociatedApprovalRuleTemplatesForRepositoryResponse
ListAssociatedApprovalRuleTemplatesForRepositoryResponse'
            (Maybe Text
 -> Maybe [Text]
 -> Int
 -> ListAssociatedApprovalRuleTemplatesForRepositoryResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [Text]
      -> Int -> ListAssociatedApprovalRuleTemplatesForRepositoryResponse)
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 -> ListAssociatedApprovalRuleTemplatesForRepositoryResponse)
-> Either String (Maybe [Text])
-> Either
     String
     (Int -> ListAssociatedApprovalRuleTemplatesForRepositoryResponse)
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 -> ListAssociatedApprovalRuleTemplatesForRepositoryResponse)
-> Either String Int
-> Either
     String ListAssociatedApprovalRuleTemplatesForRepositoryResponse
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
    ListAssociatedApprovalRuleTemplatesForRepository

instance
  Prelude.NFData
    ListAssociatedApprovalRuleTemplatesForRepository

instance
  Core.ToHeaders
    ListAssociatedApprovalRuleTemplatesForRepository
  where
  toHeaders :: ListAssociatedApprovalRuleTemplatesForRepository -> ResponseHeaders
toHeaders =
    ResponseHeaders
-> ListAssociatedApprovalRuleTemplatesForRepository
-> 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.ListAssociatedApprovalRuleTemplatesForRepository" ::
                          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
    ListAssociatedApprovalRuleTemplatesForRepository
  where
  toJSON :: ListAssociatedApprovalRuleTemplatesForRepository -> Value
toJSON
    ListAssociatedApprovalRuleTemplatesForRepository' {Maybe Int
Maybe Text
Text
repositoryName :: Text
maxResults :: Maybe Int
nextToken :: Maybe Text
$sel:repositoryName:ListAssociatedApprovalRuleTemplatesForRepository' :: ListAssociatedApprovalRuleTemplatesForRepository -> Text
$sel:maxResults:ListAssociatedApprovalRuleTemplatesForRepository' :: ListAssociatedApprovalRuleTemplatesForRepository -> Maybe Int
$sel:nextToken:ListAssociatedApprovalRuleTemplatesForRepository' :: ListAssociatedApprovalRuleTemplatesForRepository -> 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,
              Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
                (Text
"repositoryName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
repositoryName)
            ]
        )

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

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

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

-- |
-- Create a value of 'ListAssociatedApprovalRuleTemplatesForRepositoryResponse' 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', 'listAssociatedApprovalRuleTemplatesForRepositoryResponse_nextToken' - An enumeration token that allows the operation to batch the next results
-- of the operation.
--
-- 'approvalRuleTemplateNames', 'listAssociatedApprovalRuleTemplatesForRepositoryResponse_approvalRuleTemplateNames' - The names of all approval rule templates associated with the repository.
--
-- 'httpStatus', 'listAssociatedApprovalRuleTemplatesForRepositoryResponse_httpStatus' - The response's http status code.
newListAssociatedApprovalRuleTemplatesForRepositoryResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListAssociatedApprovalRuleTemplatesForRepositoryResponse
newListAssociatedApprovalRuleTemplatesForRepositoryResponse :: Int -> ListAssociatedApprovalRuleTemplatesForRepositoryResponse
newListAssociatedApprovalRuleTemplatesForRepositoryResponse
  Int
pHttpStatus_ =
    ListAssociatedApprovalRuleTemplatesForRepositoryResponse' :: Maybe Text
-> Maybe [Text]
-> Int
-> ListAssociatedApprovalRuleTemplatesForRepositoryResponse
ListAssociatedApprovalRuleTemplatesForRepositoryResponse'
      { $sel:nextToken:ListAssociatedApprovalRuleTemplatesForRepositoryResponse' :: Maybe Text
nextToken =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:approvalRuleTemplateNames:ListAssociatedApprovalRuleTemplatesForRepositoryResponse' :: Maybe [Text]
approvalRuleTemplateNames =
          Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:ListAssociatedApprovalRuleTemplatesForRepositoryResponse' :: Int
httpStatus =
          Int
pHttpStatus_
      }

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

-- | The names of all approval rule templates associated with the repository.
listAssociatedApprovalRuleTemplatesForRepositoryResponse_approvalRuleTemplateNames :: Lens.Lens' ListAssociatedApprovalRuleTemplatesForRepositoryResponse (Prelude.Maybe [Prelude.Text])
listAssociatedApprovalRuleTemplatesForRepositoryResponse_approvalRuleTemplateNames :: (Maybe [Text] -> f (Maybe [Text]))
-> ListAssociatedApprovalRuleTemplatesForRepositoryResponse
-> f ListAssociatedApprovalRuleTemplatesForRepositoryResponse
listAssociatedApprovalRuleTemplatesForRepositoryResponse_approvalRuleTemplateNames = (ListAssociatedApprovalRuleTemplatesForRepositoryResponse
 -> Maybe [Text])
-> (ListAssociatedApprovalRuleTemplatesForRepositoryResponse
    -> Maybe [Text]
    -> ListAssociatedApprovalRuleTemplatesForRepositoryResponse)
-> Lens
     ListAssociatedApprovalRuleTemplatesForRepositoryResponse
     ListAssociatedApprovalRuleTemplatesForRepositoryResponse
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAssociatedApprovalRuleTemplatesForRepositoryResponse' {Maybe [Text]
approvalRuleTemplateNames :: Maybe [Text]
$sel:approvalRuleTemplateNames:ListAssociatedApprovalRuleTemplatesForRepositoryResponse' :: ListAssociatedApprovalRuleTemplatesForRepositoryResponse
-> Maybe [Text]
approvalRuleTemplateNames} -> Maybe [Text]
approvalRuleTemplateNames) (\s :: ListAssociatedApprovalRuleTemplatesForRepositoryResponse
s@ListAssociatedApprovalRuleTemplatesForRepositoryResponse' {} Maybe [Text]
a -> ListAssociatedApprovalRuleTemplatesForRepositoryResponse
s {$sel:approvalRuleTemplateNames:ListAssociatedApprovalRuleTemplatesForRepositoryResponse' :: Maybe [Text]
approvalRuleTemplateNames = Maybe [Text]
a} :: ListAssociatedApprovalRuleTemplatesForRepositoryResponse) ((Maybe [Text] -> f (Maybe [Text]))
 -> ListAssociatedApprovalRuleTemplatesForRepositoryResponse
 -> f ListAssociatedApprovalRuleTemplatesForRepositoryResponse)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ListAssociatedApprovalRuleTemplatesForRepositoryResponse
-> f ListAssociatedApprovalRuleTemplatesForRepositoryResponse
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.
listAssociatedApprovalRuleTemplatesForRepositoryResponse_httpStatus :: Lens.Lens' ListAssociatedApprovalRuleTemplatesForRepositoryResponse Prelude.Int
listAssociatedApprovalRuleTemplatesForRepositoryResponse_httpStatus :: (Int -> f Int)
-> ListAssociatedApprovalRuleTemplatesForRepositoryResponse
-> f ListAssociatedApprovalRuleTemplatesForRepositoryResponse
listAssociatedApprovalRuleTemplatesForRepositoryResponse_httpStatus = (ListAssociatedApprovalRuleTemplatesForRepositoryResponse -> Int)
-> (ListAssociatedApprovalRuleTemplatesForRepositoryResponse
    -> Int -> ListAssociatedApprovalRuleTemplatesForRepositoryResponse)
-> Lens
     ListAssociatedApprovalRuleTemplatesForRepositoryResponse
     ListAssociatedApprovalRuleTemplatesForRepositoryResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAssociatedApprovalRuleTemplatesForRepositoryResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListAssociatedApprovalRuleTemplatesForRepositoryResponse' :: ListAssociatedApprovalRuleTemplatesForRepositoryResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListAssociatedApprovalRuleTemplatesForRepositoryResponse
s@ListAssociatedApprovalRuleTemplatesForRepositoryResponse' {} Int
a -> ListAssociatedApprovalRuleTemplatesForRepositoryResponse
s {$sel:httpStatus:ListAssociatedApprovalRuleTemplatesForRepositoryResponse' :: Int
httpStatus = Int
a} :: ListAssociatedApprovalRuleTemplatesForRepositoryResponse)

instance
  Prelude.NFData
    ListAssociatedApprovalRuleTemplatesForRepositoryResponse