{-# 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.ListRepositoriesForApprovalRuleTemplate
-- 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 repositories associated with the specified approval rule
-- template.
module Amazonka.CodeCommit.ListRepositoriesForApprovalRuleTemplate
  ( -- * Creating a Request
    ListRepositoriesForApprovalRuleTemplate (..),
    newListRepositoriesForApprovalRuleTemplate,

    -- * Request Lenses
    listRepositoriesForApprovalRuleTemplate_nextToken,
    listRepositoriesForApprovalRuleTemplate_maxResults,
    listRepositoriesForApprovalRuleTemplate_approvalRuleTemplateName,

    -- * Destructuring the Response
    ListRepositoriesForApprovalRuleTemplateResponse (..),
    newListRepositoriesForApprovalRuleTemplateResponse,

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

-- |
-- Create a value of 'ListRepositoriesForApprovalRuleTemplate' 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', 'listRepositoriesForApprovalRuleTemplate_nextToken' - An enumeration token that, when provided in a request, returns the next
-- batch of the results.
--
-- 'maxResults', 'listRepositoriesForApprovalRuleTemplate_maxResults' - A non-zero, non-negative integer used to limit the number of returned
-- results.
--
-- 'approvalRuleTemplateName', 'listRepositoriesForApprovalRuleTemplate_approvalRuleTemplateName' - The name of the approval rule template for which you want to list
-- repositories that are associated with that template.
newListRepositoriesForApprovalRuleTemplate ::
  -- | 'approvalRuleTemplateName'
  Prelude.Text ->
  ListRepositoriesForApprovalRuleTemplate
newListRepositoriesForApprovalRuleTemplate :: Text -> ListRepositoriesForApprovalRuleTemplate
newListRepositoriesForApprovalRuleTemplate
  Text
pApprovalRuleTemplateName_ =
    ListRepositoriesForApprovalRuleTemplate' :: Maybe Text
-> Maybe Int -> Text -> ListRepositoriesForApprovalRuleTemplate
ListRepositoriesForApprovalRuleTemplate'
      { $sel:nextToken:ListRepositoriesForApprovalRuleTemplate' :: Maybe Text
nextToken =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:maxResults:ListRepositoriesForApprovalRuleTemplate' :: Maybe Int
maxResults = Maybe Int
forall a. Maybe a
Prelude.Nothing,
        $sel:approvalRuleTemplateName:ListRepositoriesForApprovalRuleTemplate' :: Text
approvalRuleTemplateName =
          Text
pApprovalRuleTemplateName_
      }

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

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

-- | The name of the approval rule template for which you want to list
-- repositories that are associated with that template.
listRepositoriesForApprovalRuleTemplate_approvalRuleTemplateName :: Lens.Lens' ListRepositoriesForApprovalRuleTemplate Prelude.Text
listRepositoriesForApprovalRuleTemplate_approvalRuleTemplateName :: (Text -> f Text)
-> ListRepositoriesForApprovalRuleTemplate
-> f ListRepositoriesForApprovalRuleTemplate
listRepositoriesForApprovalRuleTemplate_approvalRuleTemplateName = (ListRepositoriesForApprovalRuleTemplate -> Text)
-> (ListRepositoriesForApprovalRuleTemplate
    -> Text -> ListRepositoriesForApprovalRuleTemplate)
-> Lens
     ListRepositoriesForApprovalRuleTemplate
     ListRepositoriesForApprovalRuleTemplate
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRepositoriesForApprovalRuleTemplate' {Text
approvalRuleTemplateName :: Text
$sel:approvalRuleTemplateName:ListRepositoriesForApprovalRuleTemplate' :: ListRepositoriesForApprovalRuleTemplate -> Text
approvalRuleTemplateName} -> Text
approvalRuleTemplateName) (\s :: ListRepositoriesForApprovalRuleTemplate
s@ListRepositoriesForApprovalRuleTemplate' {} Text
a -> ListRepositoriesForApprovalRuleTemplate
s {$sel:approvalRuleTemplateName:ListRepositoriesForApprovalRuleTemplate' :: Text
approvalRuleTemplateName = Text
a} :: ListRepositoriesForApprovalRuleTemplate)

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

instance
  Prelude.NFData
    ListRepositoriesForApprovalRuleTemplate

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

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

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

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

-- |
-- Create a value of 'ListRepositoriesForApprovalRuleTemplateResponse' 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:
--
-- 'repositoryNames', 'listRepositoriesForApprovalRuleTemplateResponse_repositoryNames' - A list of repository names that are associated with the specified
-- approval rule template.
--
-- 'nextToken', 'listRepositoriesForApprovalRuleTemplateResponse_nextToken' - An enumeration token that allows the operation to batch the next results
-- of the operation.
--
-- 'httpStatus', 'listRepositoriesForApprovalRuleTemplateResponse_httpStatus' - The response's http status code.
newListRepositoriesForApprovalRuleTemplateResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListRepositoriesForApprovalRuleTemplateResponse
newListRepositoriesForApprovalRuleTemplateResponse :: Int -> ListRepositoriesForApprovalRuleTemplateResponse
newListRepositoriesForApprovalRuleTemplateResponse
  Int
pHttpStatus_ =
    ListRepositoriesForApprovalRuleTemplateResponse' :: Maybe [Text]
-> Maybe Text
-> Int
-> ListRepositoriesForApprovalRuleTemplateResponse
ListRepositoriesForApprovalRuleTemplateResponse'
      { $sel:repositoryNames:ListRepositoriesForApprovalRuleTemplateResponse' :: Maybe [Text]
repositoryNames =
          Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
        $sel:nextToken:ListRepositoriesForApprovalRuleTemplateResponse' :: Maybe Text
nextToken =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:ListRepositoriesForApprovalRuleTemplateResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | A list of repository names that are associated with the specified
-- approval rule template.
listRepositoriesForApprovalRuleTemplateResponse_repositoryNames :: Lens.Lens' ListRepositoriesForApprovalRuleTemplateResponse (Prelude.Maybe [Prelude.Text])
listRepositoriesForApprovalRuleTemplateResponse_repositoryNames :: (Maybe [Text] -> f (Maybe [Text]))
-> ListRepositoriesForApprovalRuleTemplateResponse
-> f ListRepositoriesForApprovalRuleTemplateResponse
listRepositoriesForApprovalRuleTemplateResponse_repositoryNames = (ListRepositoriesForApprovalRuleTemplateResponse -> Maybe [Text])
-> (ListRepositoriesForApprovalRuleTemplateResponse
    -> Maybe [Text] -> ListRepositoriesForApprovalRuleTemplateResponse)
-> Lens
     ListRepositoriesForApprovalRuleTemplateResponse
     ListRepositoriesForApprovalRuleTemplateResponse
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRepositoriesForApprovalRuleTemplateResponse' {Maybe [Text]
repositoryNames :: Maybe [Text]
$sel:repositoryNames:ListRepositoriesForApprovalRuleTemplateResponse' :: ListRepositoriesForApprovalRuleTemplateResponse -> Maybe [Text]
repositoryNames} -> Maybe [Text]
repositoryNames) (\s :: ListRepositoriesForApprovalRuleTemplateResponse
s@ListRepositoriesForApprovalRuleTemplateResponse' {} Maybe [Text]
a -> ListRepositoriesForApprovalRuleTemplateResponse
s {$sel:repositoryNames:ListRepositoriesForApprovalRuleTemplateResponse' :: Maybe [Text]
repositoryNames = Maybe [Text]
a} :: ListRepositoriesForApprovalRuleTemplateResponse) ((Maybe [Text] -> f (Maybe [Text]))
 -> ListRepositoriesForApprovalRuleTemplateResponse
 -> f ListRepositoriesForApprovalRuleTemplateResponse)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ListRepositoriesForApprovalRuleTemplateResponse
-> f ListRepositoriesForApprovalRuleTemplateResponse
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

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

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

instance
  Prelude.NFData
    ListRepositoriesForApprovalRuleTemplateResponse