{-# 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.Schemas.ListRegistries
-- 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)
--
-- List the registries.
--
-- This operation returns paginated results.
module Amazonka.Schemas.ListRegistries
  ( -- * Creating a Request
    ListRegistries (..),
    newListRegistries,

    -- * Request Lenses
    listRegistries_registryNamePrefix,
    listRegistries_nextToken,
    listRegistries_scope,
    listRegistries_limit,

    -- * Destructuring the Response
    ListRegistriesResponse (..),
    newListRegistriesResponse,

    -- * Response Lenses
    listRegistriesResponse_registries,
    listRegistriesResponse_nextToken,
    listRegistriesResponse_httpStatus,
  )
where

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
import Amazonka.Schemas.Types

-- | /See:/ 'newListRegistries' smart constructor.
data ListRegistries = ListRegistries'
  { -- | Specifying this limits the results to only those registry names that
    -- start with the specified prefix.
    ListRegistries -> Maybe Text
registryNamePrefix :: Prelude.Maybe Prelude.Text,
    -- | The token that specifies the next page of results to return. To request
    -- the first page, leave NextToken empty. The token will expire in 24
    -- hours, and cannot be shared with other accounts.
    ListRegistries -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Can be set to Local or AWS to limit responses to your custom registries,
    -- or the ones provided by AWS.
    ListRegistries -> Maybe Text
scope :: Prelude.Maybe Prelude.Text,
    ListRegistries -> Maybe Int
limit :: Prelude.Maybe Prelude.Int
  }
  deriving (ListRegistries -> ListRegistries -> Bool
(ListRegistries -> ListRegistries -> Bool)
-> (ListRegistries -> ListRegistries -> Bool) -> Eq ListRegistries
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListRegistries -> ListRegistries -> Bool
$c/= :: ListRegistries -> ListRegistries -> Bool
== :: ListRegistries -> ListRegistries -> Bool
$c== :: ListRegistries -> ListRegistries -> Bool
Prelude.Eq, ReadPrec [ListRegistries]
ReadPrec ListRegistries
Int -> ReadS ListRegistries
ReadS [ListRegistries]
(Int -> ReadS ListRegistries)
-> ReadS [ListRegistries]
-> ReadPrec ListRegistries
-> ReadPrec [ListRegistries]
-> Read ListRegistries
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListRegistries]
$creadListPrec :: ReadPrec [ListRegistries]
readPrec :: ReadPrec ListRegistries
$creadPrec :: ReadPrec ListRegistries
readList :: ReadS [ListRegistries]
$creadList :: ReadS [ListRegistries]
readsPrec :: Int -> ReadS ListRegistries
$creadsPrec :: Int -> ReadS ListRegistries
Prelude.Read, Int -> ListRegistries -> ShowS
[ListRegistries] -> ShowS
ListRegistries -> String
(Int -> ListRegistries -> ShowS)
-> (ListRegistries -> String)
-> ([ListRegistries] -> ShowS)
-> Show ListRegistries
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListRegistries] -> ShowS
$cshowList :: [ListRegistries] -> ShowS
show :: ListRegistries -> String
$cshow :: ListRegistries -> String
showsPrec :: Int -> ListRegistries -> ShowS
$cshowsPrec :: Int -> ListRegistries -> ShowS
Prelude.Show, (forall x. ListRegistries -> Rep ListRegistries x)
-> (forall x. Rep ListRegistries x -> ListRegistries)
-> Generic ListRegistries
forall x. Rep ListRegistries x -> ListRegistries
forall x. ListRegistries -> Rep ListRegistries x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListRegistries x -> ListRegistries
$cfrom :: forall x. ListRegistries -> Rep ListRegistries x
Prelude.Generic)

-- |
-- Create a value of 'ListRegistries' 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:
--
-- 'registryNamePrefix', 'listRegistries_registryNamePrefix' - Specifying this limits the results to only those registry names that
-- start with the specified prefix.
--
-- 'nextToken', 'listRegistries_nextToken' - The token that specifies the next page of results to return. To request
-- the first page, leave NextToken empty. The token will expire in 24
-- hours, and cannot be shared with other accounts.
--
-- 'scope', 'listRegistries_scope' - Can be set to Local or AWS to limit responses to your custom registries,
-- or the ones provided by AWS.
--
-- 'limit', 'listRegistries_limit' - Undocumented member.
newListRegistries ::
  ListRegistries
newListRegistries :: ListRegistries
newListRegistries =
  ListRegistries' :: Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Int -> ListRegistries
ListRegistries'
    { $sel:registryNamePrefix:ListRegistries' :: Maybe Text
registryNamePrefix =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListRegistries' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:scope:ListRegistries' :: Maybe Text
scope = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:limit:ListRegistries' :: Maybe Int
limit = Maybe Int
forall a. Maybe a
Prelude.Nothing
    }

-- | Specifying this limits the results to only those registry names that
-- start with the specified prefix.
listRegistries_registryNamePrefix :: Lens.Lens' ListRegistries (Prelude.Maybe Prelude.Text)
listRegistries_registryNamePrefix :: (Maybe Text -> f (Maybe Text))
-> ListRegistries -> f ListRegistries
listRegistries_registryNamePrefix = (ListRegistries -> Maybe Text)
-> (ListRegistries -> Maybe Text -> ListRegistries)
-> Lens ListRegistries ListRegistries (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRegistries' {Maybe Text
registryNamePrefix :: Maybe Text
$sel:registryNamePrefix:ListRegistries' :: ListRegistries -> Maybe Text
registryNamePrefix} -> Maybe Text
registryNamePrefix) (\s :: ListRegistries
s@ListRegistries' {} Maybe Text
a -> ListRegistries
s {$sel:registryNamePrefix:ListRegistries' :: Maybe Text
registryNamePrefix = Maybe Text
a} :: ListRegistries)

-- | The token that specifies the next page of results to return. To request
-- the first page, leave NextToken empty. The token will expire in 24
-- hours, and cannot be shared with other accounts.
listRegistries_nextToken :: Lens.Lens' ListRegistries (Prelude.Maybe Prelude.Text)
listRegistries_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListRegistries -> f ListRegistries
listRegistries_nextToken = (ListRegistries -> Maybe Text)
-> (ListRegistries -> Maybe Text -> ListRegistries)
-> Lens ListRegistries ListRegistries (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRegistries' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListRegistries' :: ListRegistries -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListRegistries
s@ListRegistries' {} Maybe Text
a -> ListRegistries
s {$sel:nextToken:ListRegistries' :: Maybe Text
nextToken = Maybe Text
a} :: ListRegistries)

-- | Can be set to Local or AWS to limit responses to your custom registries,
-- or the ones provided by AWS.
listRegistries_scope :: Lens.Lens' ListRegistries (Prelude.Maybe Prelude.Text)
listRegistries_scope :: (Maybe Text -> f (Maybe Text))
-> ListRegistries -> f ListRegistries
listRegistries_scope = (ListRegistries -> Maybe Text)
-> (ListRegistries -> Maybe Text -> ListRegistries)
-> Lens ListRegistries ListRegistries (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRegistries' {Maybe Text
scope :: Maybe Text
$sel:scope:ListRegistries' :: ListRegistries -> Maybe Text
scope} -> Maybe Text
scope) (\s :: ListRegistries
s@ListRegistries' {} Maybe Text
a -> ListRegistries
s {$sel:scope:ListRegistries' :: Maybe Text
scope = Maybe Text
a} :: ListRegistries)

-- | Undocumented member.
listRegistries_limit :: Lens.Lens' ListRegistries (Prelude.Maybe Prelude.Int)
listRegistries_limit :: (Maybe Int -> f (Maybe Int)) -> ListRegistries -> f ListRegistries
listRegistries_limit = (ListRegistries -> Maybe Int)
-> (ListRegistries -> Maybe Int -> ListRegistries)
-> Lens ListRegistries ListRegistries (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRegistries' {Maybe Int
limit :: Maybe Int
$sel:limit:ListRegistries' :: ListRegistries -> Maybe Int
limit} -> Maybe Int
limit) (\s :: ListRegistries
s@ListRegistries' {} Maybe Int
a -> ListRegistries
s {$sel:limit:ListRegistries' :: Maybe Int
limit = Maybe Int
a} :: ListRegistries)

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

instance Prelude.NFData ListRegistries

instance Core.ToHeaders ListRegistries where
  toHeaders :: ListRegistries -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListRegistries -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ 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.ToPath ListRegistries where
  toPath :: ListRegistries -> ByteString
toPath = ByteString -> ListRegistries -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/v1/registries"

instance Core.ToQuery ListRegistries where
  toQuery :: ListRegistries -> QueryString
toQuery ListRegistries' {Maybe Int
Maybe Text
limit :: Maybe Int
scope :: Maybe Text
nextToken :: Maybe Text
registryNamePrefix :: Maybe Text
$sel:limit:ListRegistries' :: ListRegistries -> Maybe Int
$sel:scope:ListRegistries' :: ListRegistries -> Maybe Text
$sel:nextToken:ListRegistries' :: ListRegistries -> Maybe Text
$sel:registryNamePrefix:ListRegistries' :: ListRegistries -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"registryNamePrefix" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
registryNamePrefix,
        ByteString
"nextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"scope" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
scope,
        ByteString
"limit" ByteString -> Maybe Int -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Int
limit
      ]

-- | /See:/ 'newListRegistriesResponse' smart constructor.
data ListRegistriesResponse = ListRegistriesResponse'
  { -- | An array of registry summaries.
    ListRegistriesResponse -> Maybe [RegistrySummary]
registries :: Prelude.Maybe [RegistrySummary],
    -- | The token that specifies the next page of results to return. To request
    -- the first page, leave NextToken empty. The token will expire in 24
    -- hours, and cannot be shared with other accounts.
    ListRegistriesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListRegistriesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListRegistriesResponse -> ListRegistriesResponse -> Bool
(ListRegistriesResponse -> ListRegistriesResponse -> Bool)
-> (ListRegistriesResponse -> ListRegistriesResponse -> Bool)
-> Eq ListRegistriesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListRegistriesResponse -> ListRegistriesResponse -> Bool
$c/= :: ListRegistriesResponse -> ListRegistriesResponse -> Bool
== :: ListRegistriesResponse -> ListRegistriesResponse -> Bool
$c== :: ListRegistriesResponse -> ListRegistriesResponse -> Bool
Prelude.Eq, ReadPrec [ListRegistriesResponse]
ReadPrec ListRegistriesResponse
Int -> ReadS ListRegistriesResponse
ReadS [ListRegistriesResponse]
(Int -> ReadS ListRegistriesResponse)
-> ReadS [ListRegistriesResponse]
-> ReadPrec ListRegistriesResponse
-> ReadPrec [ListRegistriesResponse]
-> Read ListRegistriesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListRegistriesResponse]
$creadListPrec :: ReadPrec [ListRegistriesResponse]
readPrec :: ReadPrec ListRegistriesResponse
$creadPrec :: ReadPrec ListRegistriesResponse
readList :: ReadS [ListRegistriesResponse]
$creadList :: ReadS [ListRegistriesResponse]
readsPrec :: Int -> ReadS ListRegistriesResponse
$creadsPrec :: Int -> ReadS ListRegistriesResponse
Prelude.Read, Int -> ListRegistriesResponse -> ShowS
[ListRegistriesResponse] -> ShowS
ListRegistriesResponse -> String
(Int -> ListRegistriesResponse -> ShowS)
-> (ListRegistriesResponse -> String)
-> ([ListRegistriesResponse] -> ShowS)
-> Show ListRegistriesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListRegistriesResponse] -> ShowS
$cshowList :: [ListRegistriesResponse] -> ShowS
show :: ListRegistriesResponse -> String
$cshow :: ListRegistriesResponse -> String
showsPrec :: Int -> ListRegistriesResponse -> ShowS
$cshowsPrec :: Int -> ListRegistriesResponse -> ShowS
Prelude.Show, (forall x. ListRegistriesResponse -> Rep ListRegistriesResponse x)
-> (forall x.
    Rep ListRegistriesResponse x -> ListRegistriesResponse)
-> Generic ListRegistriesResponse
forall x. Rep ListRegistriesResponse x -> ListRegistriesResponse
forall x. ListRegistriesResponse -> Rep ListRegistriesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListRegistriesResponse x -> ListRegistriesResponse
$cfrom :: forall x. ListRegistriesResponse -> Rep ListRegistriesResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListRegistriesResponse' 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:
--
-- 'registries', 'listRegistriesResponse_registries' - An array of registry summaries.
--
-- 'nextToken', 'listRegistriesResponse_nextToken' - The token that specifies the next page of results to return. To request
-- the first page, leave NextToken empty. The token will expire in 24
-- hours, and cannot be shared with other accounts.
--
-- 'httpStatus', 'listRegistriesResponse_httpStatus' - The response's http status code.
newListRegistriesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListRegistriesResponse
newListRegistriesResponse :: Int -> ListRegistriesResponse
newListRegistriesResponse Int
pHttpStatus_ =
  ListRegistriesResponse' :: Maybe [RegistrySummary]
-> Maybe Text -> Int -> ListRegistriesResponse
ListRegistriesResponse'
    { $sel:registries:ListRegistriesResponse' :: Maybe [RegistrySummary]
registries =
        Maybe [RegistrySummary]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListRegistriesResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListRegistriesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | An array of registry summaries.
listRegistriesResponse_registries :: Lens.Lens' ListRegistriesResponse (Prelude.Maybe [RegistrySummary])
listRegistriesResponse_registries :: (Maybe [RegistrySummary] -> f (Maybe [RegistrySummary]))
-> ListRegistriesResponse -> f ListRegistriesResponse
listRegistriesResponse_registries = (ListRegistriesResponse -> Maybe [RegistrySummary])
-> (ListRegistriesResponse
    -> Maybe [RegistrySummary] -> ListRegistriesResponse)
-> Lens' ListRegistriesResponse (Maybe [RegistrySummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRegistriesResponse' {Maybe [RegistrySummary]
registries :: Maybe [RegistrySummary]
$sel:registries:ListRegistriesResponse' :: ListRegistriesResponse -> Maybe [RegistrySummary]
registries} -> Maybe [RegistrySummary]
registries) (\s :: ListRegistriesResponse
s@ListRegistriesResponse' {} Maybe [RegistrySummary]
a -> ListRegistriesResponse
s {$sel:registries:ListRegistriesResponse' :: Maybe [RegistrySummary]
registries = Maybe [RegistrySummary]
a} :: ListRegistriesResponse) ((Maybe [RegistrySummary] -> f (Maybe [RegistrySummary]))
 -> ListRegistriesResponse -> f ListRegistriesResponse)
-> ((Maybe [RegistrySummary] -> f (Maybe [RegistrySummary]))
    -> Maybe [RegistrySummary] -> f (Maybe [RegistrySummary]))
-> (Maybe [RegistrySummary] -> f (Maybe [RegistrySummary]))
-> ListRegistriesResponse
-> f ListRegistriesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [RegistrySummary]
  [RegistrySummary]
  [RegistrySummary]
  [RegistrySummary]
-> Iso
     (Maybe [RegistrySummary])
     (Maybe [RegistrySummary])
     (Maybe [RegistrySummary])
     (Maybe [RegistrySummary])
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
  [RegistrySummary]
  [RegistrySummary]
  [RegistrySummary]
  [RegistrySummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The token that specifies the next page of results to return. To request
-- the first page, leave NextToken empty. The token will expire in 24
-- hours, and cannot be shared with other accounts.
listRegistriesResponse_nextToken :: Lens.Lens' ListRegistriesResponse (Prelude.Maybe Prelude.Text)
listRegistriesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListRegistriesResponse -> f ListRegistriesResponse
listRegistriesResponse_nextToken = (ListRegistriesResponse -> Maybe Text)
-> (ListRegistriesResponse -> Maybe Text -> ListRegistriesResponse)
-> Lens' ListRegistriesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRegistriesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListRegistriesResponse' :: ListRegistriesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListRegistriesResponse
s@ListRegistriesResponse' {} Maybe Text
a -> ListRegistriesResponse
s {$sel:nextToken:ListRegistriesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListRegistriesResponse)

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

instance Prelude.NFData ListRegistriesResponse