{-# 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.Route53AutoNaming.ListNamespaces
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Lists summary information about the namespaces that were created by the
-- current Amazon Web Services account.
--
-- This operation returns paginated results.
module Amazonka.Route53AutoNaming.ListNamespaces
  ( -- * Creating a Request
    ListNamespaces (..),
    newListNamespaces,

    -- * Request Lenses
    listNamespaces_filters,
    listNamespaces_maxResults,
    listNamespaces_nextToken,

    -- * Destructuring the Response
    ListNamespacesResponse (..),
    newListNamespacesResponse,

    -- * Response Lenses
    listNamespacesResponse_namespaces,
    listNamespacesResponse_nextToken,
    listNamespacesResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.Route53AutoNaming.Types

-- | /See:/ 'newListNamespaces' smart constructor.
data ListNamespaces = ListNamespaces'
  { -- | A complex type that contains specifications for the namespaces that you
    -- want to list.
    --
    -- If you specify more than one filter, a namespace must match all filters
    -- to be returned by @ListNamespaces@.
    ListNamespaces -> Maybe [NamespaceFilter]
filters :: Prelude.Maybe [NamespaceFilter],
    -- | The maximum number of namespaces that you want Cloud Map to return in
    -- the response to a @ListNamespaces@ request. If you don\'t specify a
    -- value for @MaxResults@, Cloud Map returns up to 100 namespaces.
    ListNamespaces -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | For the first @ListNamespaces@ request, omit this value.
    --
    -- If the response contains @NextToken@, submit another @ListNamespaces@
    -- request to get the next group of results. Specify the value of
    -- @NextToken@ from the previous response in the next request.
    --
    -- Cloud Map gets @MaxResults@ namespaces and then filters them based on
    -- the specified criteria. It\'s possible that no namespaces in the first
    -- @MaxResults@ namespaces matched the specified criteria but that
    -- subsequent groups of @MaxResults@ namespaces do contain namespaces that
    -- match the criteria.
    ListNamespaces -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
  }
  deriving (ListNamespaces -> ListNamespaces -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListNamespaces -> ListNamespaces -> Bool
$c/= :: ListNamespaces -> ListNamespaces -> Bool
== :: ListNamespaces -> ListNamespaces -> Bool
$c== :: ListNamespaces -> ListNamespaces -> Bool
Prelude.Eq, ReadPrec [ListNamespaces]
ReadPrec ListNamespaces
Int -> ReadS ListNamespaces
ReadS [ListNamespaces]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListNamespaces]
$creadListPrec :: ReadPrec [ListNamespaces]
readPrec :: ReadPrec ListNamespaces
$creadPrec :: ReadPrec ListNamespaces
readList :: ReadS [ListNamespaces]
$creadList :: ReadS [ListNamespaces]
readsPrec :: Int -> ReadS ListNamespaces
$creadsPrec :: Int -> ReadS ListNamespaces
Prelude.Read, Int -> ListNamespaces -> ShowS
[ListNamespaces] -> ShowS
ListNamespaces -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListNamespaces] -> ShowS
$cshowList :: [ListNamespaces] -> ShowS
show :: ListNamespaces -> String
$cshow :: ListNamespaces -> String
showsPrec :: Int -> ListNamespaces -> ShowS
$cshowsPrec :: Int -> ListNamespaces -> ShowS
Prelude.Show, forall x. Rep ListNamespaces x -> ListNamespaces
forall x. ListNamespaces -> Rep ListNamespaces x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListNamespaces x -> ListNamespaces
$cfrom :: forall x. ListNamespaces -> Rep ListNamespaces x
Prelude.Generic)

-- |
-- Create a value of 'ListNamespaces' 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:
--
-- 'filters', 'listNamespaces_filters' - A complex type that contains specifications for the namespaces that you
-- want to list.
--
-- If you specify more than one filter, a namespace must match all filters
-- to be returned by @ListNamespaces@.
--
-- 'maxResults', 'listNamespaces_maxResults' - The maximum number of namespaces that you want Cloud Map to return in
-- the response to a @ListNamespaces@ request. If you don\'t specify a
-- value for @MaxResults@, Cloud Map returns up to 100 namespaces.
--
-- 'nextToken', 'listNamespaces_nextToken' - For the first @ListNamespaces@ request, omit this value.
--
-- If the response contains @NextToken@, submit another @ListNamespaces@
-- request to get the next group of results. Specify the value of
-- @NextToken@ from the previous response in the next request.
--
-- Cloud Map gets @MaxResults@ namespaces and then filters them based on
-- the specified criteria. It\'s possible that no namespaces in the first
-- @MaxResults@ namespaces matched the specified criteria but that
-- subsequent groups of @MaxResults@ namespaces do contain namespaces that
-- match the criteria.
newListNamespaces ::
  ListNamespaces
newListNamespaces :: ListNamespaces
newListNamespaces =
  ListNamespaces'
    { $sel:filters:ListNamespaces' :: Maybe [NamespaceFilter]
filters = forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListNamespaces' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListNamespaces' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing
    }

-- | A complex type that contains specifications for the namespaces that you
-- want to list.
--
-- If you specify more than one filter, a namespace must match all filters
-- to be returned by @ListNamespaces@.
listNamespaces_filters :: Lens.Lens' ListNamespaces (Prelude.Maybe [NamespaceFilter])
listNamespaces_filters :: Lens' ListNamespaces (Maybe [NamespaceFilter])
listNamespaces_filters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListNamespaces' {Maybe [NamespaceFilter]
filters :: Maybe [NamespaceFilter]
$sel:filters:ListNamespaces' :: ListNamespaces -> Maybe [NamespaceFilter]
filters} -> Maybe [NamespaceFilter]
filters) (\s :: ListNamespaces
s@ListNamespaces' {} Maybe [NamespaceFilter]
a -> ListNamespaces
s {$sel:filters:ListNamespaces' :: Maybe [NamespaceFilter]
filters = Maybe [NamespaceFilter]
a} :: ListNamespaces) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The maximum number of namespaces that you want Cloud Map to return in
-- the response to a @ListNamespaces@ request. If you don\'t specify a
-- value for @MaxResults@, Cloud Map returns up to 100 namespaces.
listNamespaces_maxResults :: Lens.Lens' ListNamespaces (Prelude.Maybe Prelude.Natural)
listNamespaces_maxResults :: Lens' ListNamespaces (Maybe Natural)
listNamespaces_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListNamespaces' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListNamespaces' :: ListNamespaces -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListNamespaces
s@ListNamespaces' {} Maybe Natural
a -> ListNamespaces
s {$sel:maxResults:ListNamespaces' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListNamespaces)

-- | For the first @ListNamespaces@ request, omit this value.
--
-- If the response contains @NextToken@, submit another @ListNamespaces@
-- request to get the next group of results. Specify the value of
-- @NextToken@ from the previous response in the next request.
--
-- Cloud Map gets @MaxResults@ namespaces and then filters them based on
-- the specified criteria. It\'s possible that no namespaces in the first
-- @MaxResults@ namespaces matched the specified criteria but that
-- subsequent groups of @MaxResults@ namespaces do contain namespaces that
-- match the criteria.
listNamespaces_nextToken :: Lens.Lens' ListNamespaces (Prelude.Maybe Prelude.Text)
listNamespaces_nextToken :: Lens' ListNamespaces (Maybe Text)
listNamespaces_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListNamespaces' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListNamespaces' :: ListNamespaces -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListNamespaces
s@ListNamespaces' {} Maybe Text
a -> ListNamespaces
s {$sel:nextToken:ListNamespaces' :: Maybe Text
nextToken = Maybe Text
a} :: ListNamespaces)

instance Core.AWSPager ListNamespaces where
  page :: ListNamespaces
-> AWSResponse ListNamespaces -> Maybe ListNamespaces
page ListNamespaces
rq AWSResponse ListNamespaces
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListNamespaces
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListNamespacesResponse (Maybe Text)
listNamespacesResponse_nextToken
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListNamespaces
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListNamespacesResponse (Maybe [NamespaceSummary])
listNamespacesResponse_namespaces
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ ListNamespaces
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListNamespaces (Maybe Text)
listNamespaces_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListNamespaces
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListNamespacesResponse (Maybe Text)
listNamespacesResponse_nextToken
          forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest ListNamespaces where
  type
    AWSResponse ListNamespaces =
      ListNamespacesResponse
  request :: (Service -> Service) -> ListNamespaces -> Request ListNamespaces
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListNamespaces
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListNamespaces)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe [NamespaceSummary]
-> Maybe Text -> Int -> ListNamespacesResponse
ListNamespacesResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Namespaces" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"NextToken")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable ListNamespaces where
  hashWithSalt :: Int -> ListNamespaces -> Int
hashWithSalt Int
_salt ListNamespaces' {Maybe Natural
Maybe [NamespaceFilter]
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe [NamespaceFilter]
$sel:nextToken:ListNamespaces' :: ListNamespaces -> Maybe Text
$sel:maxResults:ListNamespaces' :: ListNamespaces -> Maybe Natural
$sel:filters:ListNamespaces' :: ListNamespaces -> Maybe [NamespaceFilter]
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [NamespaceFilter]
filters
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken

instance Prelude.NFData ListNamespaces where
  rnf :: ListNamespaces -> ()
rnf ListNamespaces' {Maybe Natural
Maybe [NamespaceFilter]
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe [NamespaceFilter]
$sel:nextToken:ListNamespaces' :: ListNamespaces -> Maybe Text
$sel:maxResults:ListNamespaces' :: ListNamespaces -> Maybe Natural
$sel:filters:ListNamespaces' :: ListNamespaces -> Maybe [NamespaceFilter]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [NamespaceFilter]
filters
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken

instance Data.ToHeaders ListNamespaces where
  toHeaders :: ListNamespaces -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"Route53AutoNaming_v20170314.ListNamespaces" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON ListNamespaces where
  toJSON :: ListNamespaces -> Value
toJSON ListNamespaces' {Maybe Natural
Maybe [NamespaceFilter]
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe [NamespaceFilter]
$sel:nextToken:ListNamespaces' :: ListNamespaces -> Maybe Text
$sel:maxResults:ListNamespaces' :: ListNamespaces -> Maybe Natural
$sel:filters:ListNamespaces' :: ListNamespaces -> Maybe [NamespaceFilter]
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"Filters" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [NamespaceFilter]
filters,
            (Key
"MaxResults" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
            (Key
"NextToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken
          ]
      )

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

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

-- | /See:/ 'newListNamespacesResponse' smart constructor.
data ListNamespacesResponse = ListNamespacesResponse'
  { -- | An array that contains one @NamespaceSummary@ object for each namespace
    -- that matches the specified filter criteria.
    ListNamespacesResponse -> Maybe [NamespaceSummary]
namespaces :: Prelude.Maybe [NamespaceSummary],
    -- | If the response contains @NextToken@, submit another @ListNamespaces@
    -- request to get the next group of results. Specify the value of
    -- @NextToken@ from the previous response in the next request.
    --
    -- Cloud Map gets @MaxResults@ namespaces and then filters them based on
    -- the specified criteria. It\'s possible that no namespaces in the first
    -- @MaxResults@ namespaces matched the specified criteria but that
    -- subsequent groups of @MaxResults@ namespaces do contain namespaces that
    -- match the criteria.
    ListNamespacesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListNamespacesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListNamespacesResponse -> ListNamespacesResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListNamespacesResponse -> ListNamespacesResponse -> Bool
$c/= :: ListNamespacesResponse -> ListNamespacesResponse -> Bool
== :: ListNamespacesResponse -> ListNamespacesResponse -> Bool
$c== :: ListNamespacesResponse -> ListNamespacesResponse -> Bool
Prelude.Eq, ReadPrec [ListNamespacesResponse]
ReadPrec ListNamespacesResponse
Int -> ReadS ListNamespacesResponse
ReadS [ListNamespacesResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListNamespacesResponse]
$creadListPrec :: ReadPrec [ListNamespacesResponse]
readPrec :: ReadPrec ListNamespacesResponse
$creadPrec :: ReadPrec ListNamespacesResponse
readList :: ReadS [ListNamespacesResponse]
$creadList :: ReadS [ListNamespacesResponse]
readsPrec :: Int -> ReadS ListNamespacesResponse
$creadsPrec :: Int -> ReadS ListNamespacesResponse
Prelude.Read, Int -> ListNamespacesResponse -> ShowS
[ListNamespacesResponse] -> ShowS
ListNamespacesResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListNamespacesResponse] -> ShowS
$cshowList :: [ListNamespacesResponse] -> ShowS
show :: ListNamespacesResponse -> String
$cshow :: ListNamespacesResponse -> String
showsPrec :: Int -> ListNamespacesResponse -> ShowS
$cshowsPrec :: Int -> ListNamespacesResponse -> ShowS
Prelude.Show, forall x. Rep ListNamespacesResponse x -> ListNamespacesResponse
forall x. ListNamespacesResponse -> Rep ListNamespacesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListNamespacesResponse x -> ListNamespacesResponse
$cfrom :: forall x. ListNamespacesResponse -> Rep ListNamespacesResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListNamespacesResponse' 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:
--
-- 'namespaces', 'listNamespacesResponse_namespaces' - An array that contains one @NamespaceSummary@ object for each namespace
-- that matches the specified filter criteria.
--
-- 'nextToken', 'listNamespacesResponse_nextToken' - If the response contains @NextToken@, submit another @ListNamespaces@
-- request to get the next group of results. Specify the value of
-- @NextToken@ from the previous response in the next request.
--
-- Cloud Map gets @MaxResults@ namespaces and then filters them based on
-- the specified criteria. It\'s possible that no namespaces in the first
-- @MaxResults@ namespaces matched the specified criteria but that
-- subsequent groups of @MaxResults@ namespaces do contain namespaces that
-- match the criteria.
--
-- 'httpStatus', 'listNamespacesResponse_httpStatus' - The response's http status code.
newListNamespacesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListNamespacesResponse
newListNamespacesResponse :: Int -> ListNamespacesResponse
newListNamespacesResponse Int
pHttpStatus_ =
  ListNamespacesResponse'
    { $sel:namespaces:ListNamespacesResponse' :: Maybe [NamespaceSummary]
namespaces =
        forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListNamespacesResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListNamespacesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | An array that contains one @NamespaceSummary@ object for each namespace
-- that matches the specified filter criteria.
listNamespacesResponse_namespaces :: Lens.Lens' ListNamespacesResponse (Prelude.Maybe [NamespaceSummary])
listNamespacesResponse_namespaces :: Lens' ListNamespacesResponse (Maybe [NamespaceSummary])
listNamespacesResponse_namespaces = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListNamespacesResponse' {Maybe [NamespaceSummary]
namespaces :: Maybe [NamespaceSummary]
$sel:namespaces:ListNamespacesResponse' :: ListNamespacesResponse -> Maybe [NamespaceSummary]
namespaces} -> Maybe [NamespaceSummary]
namespaces) (\s :: ListNamespacesResponse
s@ListNamespacesResponse' {} Maybe [NamespaceSummary]
a -> ListNamespacesResponse
s {$sel:namespaces:ListNamespacesResponse' :: Maybe [NamespaceSummary]
namespaces = Maybe [NamespaceSummary]
a} :: ListNamespacesResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | If the response contains @NextToken@, submit another @ListNamespaces@
-- request to get the next group of results. Specify the value of
-- @NextToken@ from the previous response in the next request.
--
-- Cloud Map gets @MaxResults@ namespaces and then filters them based on
-- the specified criteria. It\'s possible that no namespaces in the first
-- @MaxResults@ namespaces matched the specified criteria but that
-- subsequent groups of @MaxResults@ namespaces do contain namespaces that
-- match the criteria.
listNamespacesResponse_nextToken :: Lens.Lens' ListNamespacesResponse (Prelude.Maybe Prelude.Text)
listNamespacesResponse_nextToken :: Lens' ListNamespacesResponse (Maybe Text)
listNamespacesResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListNamespacesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListNamespacesResponse' :: ListNamespacesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListNamespacesResponse
s@ListNamespacesResponse' {} Maybe Text
a -> ListNamespacesResponse
s {$sel:nextToken:ListNamespacesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListNamespacesResponse)

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

instance Prelude.NFData ListNamespacesResponse where
  rnf :: ListNamespacesResponse -> ()
rnf ListNamespacesResponse' {Int
Maybe [NamespaceSummary]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
namespaces :: Maybe [NamespaceSummary]
$sel:httpStatus:ListNamespacesResponse' :: ListNamespacesResponse -> Int
$sel:nextToken:ListNamespacesResponse' :: ListNamespacesResponse -> Maybe Text
$sel:namespaces:ListNamespacesResponse' :: ListNamespacesResponse -> Maybe [NamespaceSummary]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [NamespaceSummary]
namespaces
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus