{-# 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.ListRepositories
-- 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)
--
-- Gets information about one or more repositories.
--
-- This operation returns paginated results.
module Amazonka.CodeCommit.ListRepositories
  ( -- * Creating a Request
    ListRepositories (..),
    newListRepositories,

    -- * Request Lenses
    listRepositories_nextToken,
    listRepositories_order,
    listRepositories_sortBy,

    -- * Destructuring the Response
    ListRepositoriesResponse (..),
    newListRepositoriesResponse,

    -- * Response Lenses
    listRepositoriesResponse_repositories,
    listRepositoriesResponse_nextToken,
    listRepositoriesResponse_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

-- | Represents the input of a list repositories operation.
--
-- /See:/ 'newListRepositories' smart constructor.
data ListRepositories = ListRepositories'
  { -- | An enumeration token that allows the operation to batch the results of
    -- the operation. Batch sizes are 1,000 for list repository operations.
    -- When the client sends the token back to AWS CodeCommit, another page of
    -- 1,000 records is retrieved.
    ListRepositories -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The order in which to sort the results of a list repositories operation.
    ListRepositories -> Maybe OrderEnum
order :: Prelude.Maybe OrderEnum,
    -- | The criteria used to sort the results of a list repositories operation.
    ListRepositories -> Maybe SortByEnum
sortBy :: Prelude.Maybe SortByEnum
  }
  deriving (ListRepositories -> ListRepositories -> Bool
(ListRepositories -> ListRepositories -> Bool)
-> (ListRepositories -> ListRepositories -> Bool)
-> Eq ListRepositories
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListRepositories -> ListRepositories -> Bool
$c/= :: ListRepositories -> ListRepositories -> Bool
== :: ListRepositories -> ListRepositories -> Bool
$c== :: ListRepositories -> ListRepositories -> Bool
Prelude.Eq, ReadPrec [ListRepositories]
ReadPrec ListRepositories
Int -> ReadS ListRepositories
ReadS [ListRepositories]
(Int -> ReadS ListRepositories)
-> ReadS [ListRepositories]
-> ReadPrec ListRepositories
-> ReadPrec [ListRepositories]
-> Read ListRepositories
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListRepositories]
$creadListPrec :: ReadPrec [ListRepositories]
readPrec :: ReadPrec ListRepositories
$creadPrec :: ReadPrec ListRepositories
readList :: ReadS [ListRepositories]
$creadList :: ReadS [ListRepositories]
readsPrec :: Int -> ReadS ListRepositories
$creadsPrec :: Int -> ReadS ListRepositories
Prelude.Read, Int -> ListRepositories -> ShowS
[ListRepositories] -> ShowS
ListRepositories -> String
(Int -> ListRepositories -> ShowS)
-> (ListRepositories -> String)
-> ([ListRepositories] -> ShowS)
-> Show ListRepositories
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListRepositories] -> ShowS
$cshowList :: [ListRepositories] -> ShowS
show :: ListRepositories -> String
$cshow :: ListRepositories -> String
showsPrec :: Int -> ListRepositories -> ShowS
$cshowsPrec :: Int -> ListRepositories -> ShowS
Prelude.Show, (forall x. ListRepositories -> Rep ListRepositories x)
-> (forall x. Rep ListRepositories x -> ListRepositories)
-> Generic ListRepositories
forall x. Rep ListRepositories x -> ListRepositories
forall x. ListRepositories -> Rep ListRepositories x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListRepositories x -> ListRepositories
$cfrom :: forall x. ListRepositories -> Rep ListRepositories x
Prelude.Generic)

-- |
-- Create a value of 'ListRepositories' 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', 'listRepositories_nextToken' - An enumeration token that allows the operation to batch the results of
-- the operation. Batch sizes are 1,000 for list repository operations.
-- When the client sends the token back to AWS CodeCommit, another page of
-- 1,000 records is retrieved.
--
-- 'order', 'listRepositories_order' - The order in which to sort the results of a list repositories operation.
--
-- 'sortBy', 'listRepositories_sortBy' - The criteria used to sort the results of a list repositories operation.
newListRepositories ::
  ListRepositories
newListRepositories :: ListRepositories
newListRepositories =
  ListRepositories' :: Maybe Text
-> Maybe OrderEnum -> Maybe SortByEnum -> ListRepositories
ListRepositories'
    { $sel:nextToken:ListRepositories' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:order:ListRepositories' :: Maybe OrderEnum
order = Maybe OrderEnum
forall a. Maybe a
Prelude.Nothing,
      $sel:sortBy:ListRepositories' :: Maybe SortByEnum
sortBy = Maybe SortByEnum
forall a. Maybe a
Prelude.Nothing
    }

-- | An enumeration token that allows the operation to batch the results of
-- the operation. Batch sizes are 1,000 for list repository operations.
-- When the client sends the token back to AWS CodeCommit, another page of
-- 1,000 records is retrieved.
listRepositories_nextToken :: Lens.Lens' ListRepositories (Prelude.Maybe Prelude.Text)
listRepositories_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListRepositories -> f ListRepositories
listRepositories_nextToken = (ListRepositories -> Maybe Text)
-> (ListRepositories -> Maybe Text -> ListRepositories)
-> Lens ListRepositories ListRepositories (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRepositories' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListRepositories' :: ListRepositories -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListRepositories
s@ListRepositories' {} Maybe Text
a -> ListRepositories
s {$sel:nextToken:ListRepositories' :: Maybe Text
nextToken = Maybe Text
a} :: ListRepositories)

-- | The order in which to sort the results of a list repositories operation.
listRepositories_order :: Lens.Lens' ListRepositories (Prelude.Maybe OrderEnum)
listRepositories_order :: (Maybe OrderEnum -> f (Maybe OrderEnum))
-> ListRepositories -> f ListRepositories
listRepositories_order = (ListRepositories -> Maybe OrderEnum)
-> (ListRepositories -> Maybe OrderEnum -> ListRepositories)
-> Lens
     ListRepositories
     ListRepositories
     (Maybe OrderEnum)
     (Maybe OrderEnum)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRepositories' {Maybe OrderEnum
order :: Maybe OrderEnum
$sel:order:ListRepositories' :: ListRepositories -> Maybe OrderEnum
order} -> Maybe OrderEnum
order) (\s :: ListRepositories
s@ListRepositories' {} Maybe OrderEnum
a -> ListRepositories
s {$sel:order:ListRepositories' :: Maybe OrderEnum
order = Maybe OrderEnum
a} :: ListRepositories)

-- | The criteria used to sort the results of a list repositories operation.
listRepositories_sortBy :: Lens.Lens' ListRepositories (Prelude.Maybe SortByEnum)
listRepositories_sortBy :: (Maybe SortByEnum -> f (Maybe SortByEnum))
-> ListRepositories -> f ListRepositories
listRepositories_sortBy = (ListRepositories -> Maybe SortByEnum)
-> (ListRepositories -> Maybe SortByEnum -> ListRepositories)
-> Lens
     ListRepositories
     ListRepositories
     (Maybe SortByEnum)
     (Maybe SortByEnum)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRepositories' {Maybe SortByEnum
sortBy :: Maybe SortByEnum
$sel:sortBy:ListRepositories' :: ListRepositories -> Maybe SortByEnum
sortBy} -> Maybe SortByEnum
sortBy) (\s :: ListRepositories
s@ListRepositories' {} Maybe SortByEnum
a -> ListRepositories
s {$sel:sortBy:ListRepositories' :: Maybe SortByEnum
sortBy = Maybe SortByEnum
a} :: ListRepositories)

instance Core.AWSPager ListRepositories where
  page :: ListRepositories
-> AWSResponse ListRepositories -> Maybe ListRepositories
page ListRepositories
rq AWSResponse ListRepositories
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListRepositories
ListRepositoriesResponse
rs
            ListRepositoriesResponse
-> Getting (First Text) ListRepositoriesResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListRepositoriesResponse
-> Const (First Text) ListRepositoriesResponse
Lens' ListRepositoriesResponse (Maybe Text)
listRepositoriesResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListRepositoriesResponse
 -> Const (First Text) ListRepositoriesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListRepositoriesResponse 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 ListRepositories
forall a. Maybe a
Prelude.Nothing
    | Maybe [RepositoryNameIdPair] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListRepositories
ListRepositoriesResponse
rs
            ListRepositoriesResponse
-> Getting
     (First [RepositoryNameIdPair])
     ListRepositoriesResponse
     [RepositoryNameIdPair]
-> Maybe [RepositoryNameIdPair]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [RepositoryNameIdPair]
 -> Const
      (First [RepositoryNameIdPair]) (Maybe [RepositoryNameIdPair]))
-> ListRepositoriesResponse
-> Const (First [RepositoryNameIdPair]) ListRepositoriesResponse
Lens' ListRepositoriesResponse (Maybe [RepositoryNameIdPair])
listRepositoriesResponse_repositories
              ((Maybe [RepositoryNameIdPair]
  -> Const
       (First [RepositoryNameIdPair]) (Maybe [RepositoryNameIdPair]))
 -> ListRepositoriesResponse
 -> Const (First [RepositoryNameIdPair]) ListRepositoriesResponse)
-> (([RepositoryNameIdPair]
     -> Const (First [RepositoryNameIdPair]) [RepositoryNameIdPair])
    -> Maybe [RepositoryNameIdPair]
    -> Const
         (First [RepositoryNameIdPair]) (Maybe [RepositoryNameIdPair]))
-> Getting
     (First [RepositoryNameIdPair])
     ListRepositoriesResponse
     [RepositoryNameIdPair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([RepositoryNameIdPair]
 -> Const (First [RepositoryNameIdPair]) [RepositoryNameIdPair])
-> Maybe [RepositoryNameIdPair]
-> Const
     (First [RepositoryNameIdPair]) (Maybe [RepositoryNameIdPair])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListRepositories
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListRepositories -> Maybe ListRepositories
forall a. a -> Maybe a
Prelude.Just (ListRepositories -> Maybe ListRepositories)
-> ListRepositories -> Maybe ListRepositories
forall a b. (a -> b) -> a -> b
Prelude.$
        ListRepositories
rq
          ListRepositories
-> (ListRepositories -> ListRepositories) -> ListRepositories
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListRepositories -> Identity ListRepositories
Lens ListRepositories ListRepositories (Maybe Text) (Maybe Text)
listRepositories_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListRepositories -> Identity ListRepositories)
-> Maybe Text -> ListRepositories -> ListRepositories
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListRepositories
ListRepositoriesResponse
rs
          ListRepositoriesResponse
-> Getting (First Text) ListRepositoriesResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListRepositoriesResponse
-> Const (First Text) ListRepositoriesResponse
Lens' ListRepositoriesResponse (Maybe Text)
listRepositoriesResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListRepositoriesResponse
 -> Const (First Text) ListRepositoriesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListRepositoriesResponse 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 ListRepositories where
  type
    AWSResponse ListRepositories =
      ListRepositoriesResponse
  request :: ListRepositories -> Request ListRepositories
request = Service -> ListRepositories -> Request ListRepositories
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ListRepositories
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListRepositories)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListRepositories))
-> Logger
-> Service
-> Proxy ListRepositories
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListRepositories)))
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 [RepositoryNameIdPair]
-> Maybe Text -> Int -> ListRepositoriesResponse
ListRepositoriesResponse'
            (Maybe [RepositoryNameIdPair]
 -> Maybe Text -> Int -> ListRepositoriesResponse)
-> Either String (Maybe [RepositoryNameIdPair])
-> Either String (Maybe Text -> Int -> ListRepositoriesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text -> Either String (Maybe (Maybe [RepositoryNameIdPair]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"repositories" Either String (Maybe (Maybe [RepositoryNameIdPair]))
-> Maybe [RepositoryNameIdPair]
-> Either String (Maybe [RepositoryNameIdPair])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [RepositoryNameIdPair]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Maybe Text -> Int -> ListRepositoriesResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ListRepositoriesResponse)
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 -> ListRepositoriesResponse)
-> Either String Int -> Either String ListRepositoriesResponse
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 ListRepositories

instance Prelude.NFData ListRepositories

instance Core.ToHeaders ListRepositories where
  toHeaders :: ListRepositories -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListRepositories -> 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.ListRepositories" ::
                          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 ListRepositories where
  toJSON :: ListRepositories -> Value
toJSON ListRepositories' {Maybe Text
Maybe OrderEnum
Maybe SortByEnum
sortBy :: Maybe SortByEnum
order :: Maybe OrderEnum
nextToken :: Maybe Text
$sel:sortBy:ListRepositories' :: ListRepositories -> Maybe SortByEnum
$sel:order:ListRepositories' :: ListRepositories -> Maybe OrderEnum
$sel:nextToken:ListRepositories' :: ListRepositories -> 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
"order" Text -> OrderEnum -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (OrderEnum -> Pair) -> Maybe OrderEnum -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe OrderEnum
order,
            (Text
"sortBy" Text -> SortByEnum -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (SortByEnum -> Pair) -> Maybe SortByEnum -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SortByEnum
sortBy
          ]
      )

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

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

-- | Represents the output of a list repositories operation.
--
-- /See:/ 'newListRepositoriesResponse' smart constructor.
data ListRepositoriesResponse = ListRepositoriesResponse'
  { -- | Lists the repositories called by the list repositories operation.
    ListRepositoriesResponse -> Maybe [RepositoryNameIdPair]
repositories :: Prelude.Maybe [RepositoryNameIdPair],
    -- | An enumeration token that allows the operation to batch the results of
    -- the operation. Batch sizes are 1,000 for list repository operations.
    -- When the client sends the token back to AWS CodeCommit, another page of
    -- 1,000 records is retrieved.
    ListRepositoriesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListRepositoriesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListRepositoriesResponse -> ListRepositoriesResponse -> Bool
(ListRepositoriesResponse -> ListRepositoriesResponse -> Bool)
-> (ListRepositoriesResponse -> ListRepositoriesResponse -> Bool)
-> Eq ListRepositoriesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListRepositoriesResponse -> ListRepositoriesResponse -> Bool
$c/= :: ListRepositoriesResponse -> ListRepositoriesResponse -> Bool
== :: ListRepositoriesResponse -> ListRepositoriesResponse -> Bool
$c== :: ListRepositoriesResponse -> ListRepositoriesResponse -> Bool
Prelude.Eq, ReadPrec [ListRepositoriesResponse]
ReadPrec ListRepositoriesResponse
Int -> ReadS ListRepositoriesResponse
ReadS [ListRepositoriesResponse]
(Int -> ReadS ListRepositoriesResponse)
-> ReadS [ListRepositoriesResponse]
-> ReadPrec ListRepositoriesResponse
-> ReadPrec [ListRepositoriesResponse]
-> Read ListRepositoriesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListRepositoriesResponse]
$creadListPrec :: ReadPrec [ListRepositoriesResponse]
readPrec :: ReadPrec ListRepositoriesResponse
$creadPrec :: ReadPrec ListRepositoriesResponse
readList :: ReadS [ListRepositoriesResponse]
$creadList :: ReadS [ListRepositoriesResponse]
readsPrec :: Int -> ReadS ListRepositoriesResponse
$creadsPrec :: Int -> ReadS ListRepositoriesResponse
Prelude.Read, Int -> ListRepositoriesResponse -> ShowS
[ListRepositoriesResponse] -> ShowS
ListRepositoriesResponse -> String
(Int -> ListRepositoriesResponse -> ShowS)
-> (ListRepositoriesResponse -> String)
-> ([ListRepositoriesResponse] -> ShowS)
-> Show ListRepositoriesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListRepositoriesResponse] -> ShowS
$cshowList :: [ListRepositoriesResponse] -> ShowS
show :: ListRepositoriesResponse -> String
$cshow :: ListRepositoriesResponse -> String
showsPrec :: Int -> ListRepositoriesResponse -> ShowS
$cshowsPrec :: Int -> ListRepositoriesResponse -> ShowS
Prelude.Show, (forall x.
 ListRepositoriesResponse -> Rep ListRepositoriesResponse x)
-> (forall x.
    Rep ListRepositoriesResponse x -> ListRepositoriesResponse)
-> Generic ListRepositoriesResponse
forall x.
Rep ListRepositoriesResponse x -> ListRepositoriesResponse
forall x.
ListRepositoriesResponse -> Rep ListRepositoriesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListRepositoriesResponse x -> ListRepositoriesResponse
$cfrom :: forall x.
ListRepositoriesResponse -> Rep ListRepositoriesResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListRepositoriesResponse' 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:
--
-- 'repositories', 'listRepositoriesResponse_repositories' - Lists the repositories called by the list repositories operation.
--
-- 'nextToken', 'listRepositoriesResponse_nextToken' - An enumeration token that allows the operation to batch the results of
-- the operation. Batch sizes are 1,000 for list repository operations.
-- When the client sends the token back to AWS CodeCommit, another page of
-- 1,000 records is retrieved.
--
-- 'httpStatus', 'listRepositoriesResponse_httpStatus' - The response's http status code.
newListRepositoriesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListRepositoriesResponse
newListRepositoriesResponse :: Int -> ListRepositoriesResponse
newListRepositoriesResponse Int
pHttpStatus_ =
  ListRepositoriesResponse' :: Maybe [RepositoryNameIdPair]
-> Maybe Text -> Int -> ListRepositoriesResponse
ListRepositoriesResponse'
    { $sel:repositories:ListRepositoriesResponse' :: Maybe [RepositoryNameIdPair]
repositories =
        Maybe [RepositoryNameIdPair]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListRepositoriesResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListRepositoriesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Lists the repositories called by the list repositories operation.
listRepositoriesResponse_repositories :: Lens.Lens' ListRepositoriesResponse (Prelude.Maybe [RepositoryNameIdPair])
listRepositoriesResponse_repositories :: (Maybe [RepositoryNameIdPair] -> f (Maybe [RepositoryNameIdPair]))
-> ListRepositoriesResponse -> f ListRepositoriesResponse
listRepositoriesResponse_repositories = (ListRepositoriesResponse -> Maybe [RepositoryNameIdPair])
-> (ListRepositoriesResponse
    -> Maybe [RepositoryNameIdPair] -> ListRepositoriesResponse)
-> Lens' ListRepositoriesResponse (Maybe [RepositoryNameIdPair])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRepositoriesResponse' {Maybe [RepositoryNameIdPair]
repositories :: Maybe [RepositoryNameIdPair]
$sel:repositories:ListRepositoriesResponse' :: ListRepositoriesResponse -> Maybe [RepositoryNameIdPair]
repositories} -> Maybe [RepositoryNameIdPair]
repositories) (\s :: ListRepositoriesResponse
s@ListRepositoriesResponse' {} Maybe [RepositoryNameIdPair]
a -> ListRepositoriesResponse
s {$sel:repositories:ListRepositoriesResponse' :: Maybe [RepositoryNameIdPair]
repositories = Maybe [RepositoryNameIdPair]
a} :: ListRepositoriesResponse) ((Maybe [RepositoryNameIdPair] -> f (Maybe [RepositoryNameIdPair]))
 -> ListRepositoriesResponse -> f ListRepositoriesResponse)
-> ((Maybe [RepositoryNameIdPair]
     -> f (Maybe [RepositoryNameIdPair]))
    -> Maybe [RepositoryNameIdPair]
    -> f (Maybe [RepositoryNameIdPair]))
-> (Maybe [RepositoryNameIdPair]
    -> f (Maybe [RepositoryNameIdPair]))
-> ListRepositoriesResponse
-> f ListRepositoriesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [RepositoryNameIdPair]
  [RepositoryNameIdPair]
  [RepositoryNameIdPair]
  [RepositoryNameIdPair]
-> Iso
     (Maybe [RepositoryNameIdPair])
     (Maybe [RepositoryNameIdPair])
     (Maybe [RepositoryNameIdPair])
     (Maybe [RepositoryNameIdPair])
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
  [RepositoryNameIdPair]
  [RepositoryNameIdPair]
  [RepositoryNameIdPair]
  [RepositoryNameIdPair]
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 results of
-- the operation. Batch sizes are 1,000 for list repository operations.
-- When the client sends the token back to AWS CodeCommit, another page of
-- 1,000 records is retrieved.
listRepositoriesResponse_nextToken :: Lens.Lens' ListRepositoriesResponse (Prelude.Maybe Prelude.Text)
listRepositoriesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListRepositoriesResponse -> f ListRepositoriesResponse
listRepositoriesResponse_nextToken = (ListRepositoriesResponse -> Maybe Text)
-> (ListRepositoriesResponse
    -> Maybe Text -> ListRepositoriesResponse)
-> Lens' ListRepositoriesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRepositoriesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListRepositoriesResponse' :: ListRepositoriesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListRepositoriesResponse
s@ListRepositoriesResponse' {} Maybe Text
a -> ListRepositoriesResponse
s {$sel:nextToken:ListRepositoriesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListRepositoriesResponse)

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

instance Prelude.NFData ListRepositoriesResponse