{-# 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.QuickSight.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 the namespaces for the specified Amazon Web Services account. This
-- operation doesn\'t list deleted namespaces.
--
-- This operation returns paginated results.
module Amazonka.QuickSight.ListNamespaces
  ( -- * Creating a Request
    ListNamespaces (..),
    newListNamespaces,

    -- * Request Lenses
    listNamespaces_maxResults,
    listNamespaces_nextToken,
    listNamespaces_awsAccountId,

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

    -- * Response Lenses
    listNamespacesResponse_namespaces,
    listNamespacesResponse_nextToken,
    listNamespacesResponse_requestId,
    listNamespacesResponse_status,
  )
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 Amazonka.QuickSight.Types
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newListNamespaces' smart constructor.
data ListNamespaces = ListNamespaces'
  { -- | The maximum number of results to return.
    ListNamespaces -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | A unique pagination token that can be used in a subsequent request. You
    -- will receive a pagination token in the response body of a previous
    -- @ListNameSpaces@ API call if there is more data that can be returned. To
    -- receive the data, make another @ListNamespaces@ API call with the
    -- returned token to retrieve the next page of data. Each token is valid
    -- for 24 hours. If you try to make a @ListNamespaces@ API call with an
    -- expired token, you will receive a @HTTP 400 InvalidNextTokenException@
    -- error.
    ListNamespaces -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The ID for the Amazon Web Services account that contains the Amazon
    -- QuickSight namespaces that you want to list.
    ListNamespaces -> Text
awsAccountId :: 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:
--
-- 'maxResults', 'listNamespaces_maxResults' - The maximum number of results to return.
--
-- 'nextToken', 'listNamespaces_nextToken' - A unique pagination token that can be used in a subsequent request. You
-- will receive a pagination token in the response body of a previous
-- @ListNameSpaces@ API call if there is more data that can be returned. To
-- receive the data, make another @ListNamespaces@ API call with the
-- returned token to retrieve the next page of data. Each token is valid
-- for 24 hours. If you try to make a @ListNamespaces@ API call with an
-- expired token, you will receive a @HTTP 400 InvalidNextTokenException@
-- error.
--
-- 'awsAccountId', 'listNamespaces_awsAccountId' - The ID for the Amazon Web Services account that contains the Amazon
-- QuickSight namespaces that you want to list.
newListNamespaces ::
  -- | 'awsAccountId'
  Prelude.Text ->
  ListNamespaces
newListNamespaces :: Text -> ListNamespaces
newListNamespaces Text
pAwsAccountId_ =
  ListNamespaces'
    { $sel:maxResults:ListNamespaces' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListNamespaces' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:awsAccountId:ListNamespaces' :: Text
awsAccountId = Text
pAwsAccountId_
    }

-- | The maximum number of results to return.
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)

-- | A unique pagination token that can be used in a subsequent request. You
-- will receive a pagination token in the response body of a previous
-- @ListNameSpaces@ API call if there is more data that can be returned. To
-- receive the data, make another @ListNamespaces@ API call with the
-- returned token to retrieve the next page of data. Each token is valid
-- for 24 hours. If you try to make a @ListNamespaces@ API call with an
-- expired token, you will receive a @HTTP 400 InvalidNextTokenException@
-- error.
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)

-- | The ID for the Amazon Web Services account that contains the Amazon
-- QuickSight namespaces that you want to list.
listNamespaces_awsAccountId :: Lens.Lens' ListNamespaces Prelude.Text
listNamespaces_awsAccountId :: Lens' ListNamespaces Text
listNamespaces_awsAccountId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListNamespaces' {Text
awsAccountId :: Text
$sel:awsAccountId:ListNamespaces' :: ListNamespaces -> Text
awsAccountId} -> Text
awsAccountId) (\s :: ListNamespaces
s@ListNamespaces' {} Text
a -> ListNamespaces
s {$sel:awsAccountId:ListNamespaces' :: Text
awsAccountId = 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 [NamespaceInfoV2])
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 => Service -> a -> Request a
Request.get (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 [NamespaceInfoV2]
-> Maybe Text -> 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.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"RequestId")
            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 Text
Text
awsAccountId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:awsAccountId:ListNamespaces' :: ListNamespaces -> Text
$sel:nextToken:ListNamespaces' :: ListNamespaces -> Maybe Text
$sel:maxResults:ListNamespaces' :: ListNamespaces -> Maybe Natural
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
awsAccountId

instance Prelude.NFData ListNamespaces where
  rnf :: ListNamespaces -> ()
rnf ListNamespaces' {Maybe Natural
Maybe Text
Text
awsAccountId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:awsAccountId:ListNamespaces' :: ListNamespaces -> Text
$sel:nextToken:ListNamespaces' :: ListNamespaces -> Maybe Text
$sel:maxResults:ListNamespaces' :: ListNamespaces -> Maybe Natural
..} =
    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
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
awsAccountId

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
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.0" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToPath ListNamespaces where
  toPath :: ListNamespaces -> ByteString
toPath ListNamespaces' {Maybe Natural
Maybe Text
Text
awsAccountId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:awsAccountId:ListNamespaces' :: ListNamespaces -> Text
$sel:nextToken:ListNamespaces' :: ListNamespaces -> Maybe Text
$sel:maxResults:ListNamespaces' :: ListNamespaces -> Maybe Natural
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/accounts/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
awsAccountId, ByteString
"/namespaces"]

instance Data.ToQuery ListNamespaces where
  toQuery :: ListNamespaces -> QueryString
toQuery ListNamespaces' {Maybe Natural
Maybe Text
Text
awsAccountId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:awsAccountId:ListNamespaces' :: ListNamespaces -> Text
$sel:nextToken:ListNamespaces' :: ListNamespaces -> Maybe Text
$sel:maxResults:ListNamespaces' :: ListNamespaces -> Maybe Natural
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"max-results" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
maxResults,
        ByteString
"next-token" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
nextToken
      ]

-- | /See:/ 'newListNamespacesResponse' smart constructor.
data ListNamespacesResponse = ListNamespacesResponse'
  { -- | The information about the namespaces in this Amazon Web Services
    -- account. The response includes the namespace ARN, name, Amazon Web
    -- Services Region, notification email address, creation status, and
    -- identity store.
    ListNamespacesResponse -> Maybe [NamespaceInfoV2]
namespaces :: Prelude.Maybe [NamespaceInfoV2],
    -- | A unique pagination token that can be used in a subsequent request.
    -- Receiving @NextToken@ in your response inticates that there is more data
    -- that can be returned. To receive the data, make another @ListNamespaces@
    -- API call with the returned token to retrieve the next page of data. Each
    -- token is valid for 24 hours. If you try to make a @ListNamespaces@ API
    -- call with an expired token, you will receive a
    -- @HTTP 400 InvalidNextTokenException@ error.
    ListNamespacesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Web Services request ID for this operation.
    ListNamespacesResponse -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
    -- | The HTTP status of the request.
    ListNamespacesResponse -> Int
status :: 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' - The information about the namespaces in this Amazon Web Services
-- account. The response includes the namespace ARN, name, Amazon Web
-- Services Region, notification email address, creation status, and
-- identity store.
--
-- 'nextToken', 'listNamespacesResponse_nextToken' - A unique pagination token that can be used in a subsequent request.
-- Receiving @NextToken@ in your response inticates that there is more data
-- that can be returned. To receive the data, make another @ListNamespaces@
-- API call with the returned token to retrieve the next page of data. Each
-- token is valid for 24 hours. If you try to make a @ListNamespaces@ API
-- call with an expired token, you will receive a
-- @HTTP 400 InvalidNextTokenException@ error.
--
-- 'requestId', 'listNamespacesResponse_requestId' - The Amazon Web Services request ID for this operation.
--
-- 'status', 'listNamespacesResponse_status' - The HTTP status of the request.
newListNamespacesResponse ::
  -- | 'status'
  Prelude.Int ->
  ListNamespacesResponse
newListNamespacesResponse :: Int -> ListNamespacesResponse
newListNamespacesResponse Int
pStatus_ =
  ListNamespacesResponse'
    { $sel:namespaces:ListNamespacesResponse' :: Maybe [NamespaceInfoV2]
namespaces =
        forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListNamespacesResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:requestId:ListNamespacesResponse' :: Maybe Text
requestId = forall a. Maybe a
Prelude.Nothing,
      $sel:status:ListNamespacesResponse' :: Int
status = Int
pStatus_
    }

-- | The information about the namespaces in this Amazon Web Services
-- account. The response includes the namespace ARN, name, Amazon Web
-- Services Region, notification email address, creation status, and
-- identity store.
listNamespacesResponse_namespaces :: Lens.Lens' ListNamespacesResponse (Prelude.Maybe [NamespaceInfoV2])
listNamespacesResponse_namespaces :: Lens' ListNamespacesResponse (Maybe [NamespaceInfoV2])
listNamespacesResponse_namespaces = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListNamespacesResponse' {Maybe [NamespaceInfoV2]
namespaces :: Maybe [NamespaceInfoV2]
$sel:namespaces:ListNamespacesResponse' :: ListNamespacesResponse -> Maybe [NamespaceInfoV2]
namespaces} -> Maybe [NamespaceInfoV2]
namespaces) (\s :: ListNamespacesResponse
s@ListNamespacesResponse' {} Maybe [NamespaceInfoV2]
a -> ListNamespacesResponse
s {$sel:namespaces:ListNamespacesResponse' :: Maybe [NamespaceInfoV2]
namespaces = Maybe [NamespaceInfoV2]
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

-- | A unique pagination token that can be used in a subsequent request.
-- Receiving @NextToken@ in your response inticates that there is more data
-- that can be returned. To receive the data, make another @ListNamespaces@
-- API call with the returned token to retrieve the next page of data. Each
-- token is valid for 24 hours. If you try to make a @ListNamespaces@ API
-- call with an expired token, you will receive a
-- @HTTP 400 InvalidNextTokenException@ error.
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 Amazon Web Services request ID for this operation.
listNamespacesResponse_requestId :: Lens.Lens' ListNamespacesResponse (Prelude.Maybe Prelude.Text)
listNamespacesResponse_requestId :: Lens' ListNamespacesResponse (Maybe Text)
listNamespacesResponse_requestId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListNamespacesResponse' {Maybe Text
requestId :: Maybe Text
$sel:requestId:ListNamespacesResponse' :: ListNamespacesResponse -> Maybe Text
requestId} -> Maybe Text
requestId) (\s :: ListNamespacesResponse
s@ListNamespacesResponse' {} Maybe Text
a -> ListNamespacesResponse
s {$sel:requestId:ListNamespacesResponse' :: Maybe Text
requestId = Maybe Text
a} :: ListNamespacesResponse)

-- | The HTTP status of the request.
listNamespacesResponse_status :: Lens.Lens' ListNamespacesResponse Prelude.Int
listNamespacesResponse_status :: Lens' ListNamespacesResponse Int
listNamespacesResponse_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListNamespacesResponse' {Int
status :: Int
$sel:status:ListNamespacesResponse' :: ListNamespacesResponse -> Int
status} -> Int
status) (\s :: ListNamespacesResponse
s@ListNamespacesResponse' {} Int
a -> ListNamespacesResponse
s {$sel:status:ListNamespacesResponse' :: Int
status = Int
a} :: ListNamespacesResponse)

instance Prelude.NFData ListNamespacesResponse where
  rnf :: ListNamespacesResponse -> ()
rnf ListNamespacesResponse' {Int
Maybe [NamespaceInfoV2]
Maybe Text
status :: Int
requestId :: Maybe Text
nextToken :: Maybe Text
namespaces :: Maybe [NamespaceInfoV2]
$sel:status:ListNamespacesResponse' :: ListNamespacesResponse -> Int
$sel:requestId:ListNamespacesResponse' :: ListNamespacesResponse -> Maybe Text
$sel:nextToken:ListNamespacesResponse' :: ListNamespacesResponse -> Maybe Text
$sel:namespaces:ListNamespacesResponse' :: ListNamespacesResponse -> Maybe [NamespaceInfoV2]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [NamespaceInfoV2]
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 Maybe Text
requestId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
status