{-# 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-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Lists the namespaces for the specified Amazon Web Services account.
--
-- This operation returns paginated results.
module Amazonka.QuickSight.ListNamespaces
  ( -- * Creating a Request
    ListNamespaces (..),
    newListNamespaces,

    -- * Request Lenses
    listNamespaces_nextToken,
    listNamespaces_maxResults,
    listNamespaces_awsAccountId,

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

    -- * Response Lenses
    listNamespacesResponse_requestId,
    listNamespacesResponse_namespaces,
    listNamespacesResponse_nextToken,
    listNamespacesResponse_status,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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'
  { -- | A pagination token that can be used in a subsequent request.
    ListNamespaces -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results to return.
    ListNamespaces -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | 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
(ListNamespaces -> ListNamespaces -> Bool)
-> (ListNamespaces -> ListNamespaces -> Bool) -> Eq ListNamespaces
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]
(Int -> ReadS ListNamespaces)
-> ReadS [ListNamespaces]
-> ReadPrec ListNamespaces
-> ReadPrec [ListNamespaces]
-> Read 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
(Int -> ListNamespaces -> ShowS)
-> (ListNamespaces -> String)
-> ([ListNamespaces] -> ShowS)
-> Show ListNamespaces
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. ListNamespaces -> Rep ListNamespaces x)
-> (forall x. Rep ListNamespaces x -> ListNamespaces)
-> Generic ListNamespaces
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:
--
-- 'nextToken', 'listNamespaces_nextToken' - A pagination token that can be used in a subsequent request.
--
-- 'maxResults', 'listNamespaces_maxResults' - The maximum number of results to return.
--
-- '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' :: Maybe Text -> Maybe Natural -> Text -> ListNamespaces
ListNamespaces'
    { $sel:nextToken:ListNamespaces' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListNamespaces' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:awsAccountId:ListNamespaces' :: Text
awsAccountId = Text
pAwsAccountId_
    }

-- | A pagination token that can be used in a subsequent request.
listNamespaces_nextToken :: Lens.Lens' ListNamespaces (Prelude.Maybe Prelude.Text)
listNamespaces_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListNamespaces -> f ListNamespaces
listNamespaces_nextToken = (ListNamespaces -> Maybe Text)
-> (ListNamespaces -> Maybe Text -> ListNamespaces)
-> Lens ListNamespaces ListNamespaces (Maybe Text) (Maybe Text)
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 maximum number of results to return.
listNamespaces_maxResults :: Lens.Lens' ListNamespaces (Prelude.Maybe Prelude.Natural)
listNamespaces_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListNamespaces -> f ListNamespaces
listNamespaces_maxResults = (ListNamespaces -> Maybe Natural)
-> (ListNamespaces -> Maybe Natural -> ListNamespaces)
-> Lens
     ListNamespaces ListNamespaces (Maybe Natural) (Maybe Natural)
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)

-- | 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 :: (Text -> f Text) -> ListNamespaces -> f ListNamespaces
listNamespaces_awsAccountId = (ListNamespaces -> Text)
-> (ListNamespaces -> Text -> ListNamespaces)
-> Lens ListNamespaces ListNamespaces Text Text
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
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListNamespaces
ListNamespacesResponse
rs
            ListNamespacesResponse
-> Getting (First Text) ListNamespacesResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListNamespacesResponse
-> Const (First Text) ListNamespacesResponse
Lens' ListNamespacesResponse (Maybe Text)
listNamespacesResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListNamespacesResponse
 -> Const (First Text) ListNamespacesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListNamespacesResponse 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 ListNamespaces
forall a. Maybe a
Prelude.Nothing
    | Maybe [NamespaceInfoV2] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListNamespaces
ListNamespacesResponse
rs
            ListNamespacesResponse
-> Getting
     (First [NamespaceInfoV2]) ListNamespacesResponse [NamespaceInfoV2]
-> Maybe [NamespaceInfoV2]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [NamespaceInfoV2]
 -> Const (First [NamespaceInfoV2]) (Maybe [NamespaceInfoV2]))
-> ListNamespacesResponse
-> Const (First [NamespaceInfoV2]) ListNamespacesResponse
Lens' ListNamespacesResponse (Maybe [NamespaceInfoV2])
listNamespacesResponse_namespaces
              ((Maybe [NamespaceInfoV2]
  -> Const (First [NamespaceInfoV2]) (Maybe [NamespaceInfoV2]))
 -> ListNamespacesResponse
 -> Const (First [NamespaceInfoV2]) ListNamespacesResponse)
-> (([NamespaceInfoV2]
     -> Const (First [NamespaceInfoV2]) [NamespaceInfoV2])
    -> Maybe [NamespaceInfoV2]
    -> Const (First [NamespaceInfoV2]) (Maybe [NamespaceInfoV2]))
-> Getting
     (First [NamespaceInfoV2]) ListNamespacesResponse [NamespaceInfoV2]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([NamespaceInfoV2]
 -> Const (First [NamespaceInfoV2]) [NamespaceInfoV2])
-> Maybe [NamespaceInfoV2]
-> Const (First [NamespaceInfoV2]) (Maybe [NamespaceInfoV2])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListNamespaces
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListNamespaces -> Maybe ListNamespaces
forall a. a -> Maybe a
Prelude.Just (ListNamespaces -> Maybe ListNamespaces)
-> ListNamespaces -> Maybe ListNamespaces
forall a b. (a -> b) -> a -> b
Prelude.$
        ListNamespaces
rq
          ListNamespaces
-> (ListNamespaces -> ListNamespaces) -> ListNamespaces
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListNamespaces -> Identity ListNamespaces
Lens ListNamespaces ListNamespaces (Maybe Text) (Maybe Text)
listNamespaces_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListNamespaces -> Identity ListNamespaces)
-> Maybe Text -> ListNamespaces -> ListNamespaces
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListNamespaces
ListNamespacesResponse
rs
          ListNamespacesResponse
-> Getting (First Text) ListNamespacesResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListNamespacesResponse
-> Const (First Text) ListNamespacesResponse
Lens' ListNamespacesResponse (Maybe Text)
listNamespacesResponse_nextToken ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListNamespacesResponse
 -> Const (First Text) ListNamespacesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListNamespacesResponse 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 ListNamespaces where
  type
    AWSResponse ListNamespaces =
      ListNamespacesResponse
  request :: ListNamespaces -> Request ListNamespaces
request = Service -> ListNamespaces -> Request ListNamespaces
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy ListNamespaces
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListNamespaces)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListNamespaces))
-> Logger
-> Service
-> Proxy ListNamespaces
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListNamespaces)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe [NamespaceInfoV2]
-> Maybe Text
-> Int
-> ListNamespacesResponse
ListNamespacesResponse'
            (Maybe Text
 -> Maybe [NamespaceInfoV2]
 -> Maybe Text
 -> Int
 -> ListNamespacesResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [NamespaceInfoV2]
      -> Maybe Text -> Int -> ListNamespacesResponse)
forall (f :: * -> *) a b. Functor 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
"RequestId")
            Either
  String
  (Maybe [NamespaceInfoV2]
   -> Maybe Text -> Int -> ListNamespacesResponse)
-> Either String (Maybe [NamespaceInfoV2])
-> Either String (Maybe Text -> Int -> ListNamespacesResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [NamespaceInfoV2]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Namespaces" Either String (Maybe (Maybe [NamespaceInfoV2]))
-> Maybe [NamespaceInfoV2]
-> Either String (Maybe [NamespaceInfoV2])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [NamespaceInfoV2]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Maybe Text -> Int -> ListNamespacesResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ListNamespacesResponse)
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 -> ListNamespacesResponse)
-> Either String Int -> Either String ListNamespacesResponse
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 ListNamespaces

instance Prelude.NFData ListNamespaces

instance Core.ToHeaders ListNamespaces where
  toHeaders :: ListNamespaces -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListNamespaces -> 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.0" ::
                          Prelude.ByteString
                      )
          ]
      )

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

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

-- | /See:/ 'newListNamespacesResponse' smart constructor.
data ListNamespacesResponse = ListNamespacesResponse'
  { -- | The Amazon Web Services request ID for this operation.
    ListNamespacesResponse -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
    -- | 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 pagination token that can be used in a subsequent request.
    ListNamespacesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The HTTP status of the request.
    ListNamespacesResponse -> Int
status :: Prelude.Int
  }
  deriving (ListNamespacesResponse -> ListNamespacesResponse -> Bool
(ListNamespacesResponse -> ListNamespacesResponse -> Bool)
-> (ListNamespacesResponse -> ListNamespacesResponse -> Bool)
-> Eq ListNamespacesResponse
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]
(Int -> ReadS ListNamespacesResponse)
-> ReadS [ListNamespacesResponse]
-> ReadPrec ListNamespacesResponse
-> ReadPrec [ListNamespacesResponse]
-> Read 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
(Int -> ListNamespacesResponse -> ShowS)
-> (ListNamespacesResponse -> String)
-> ([ListNamespacesResponse] -> ShowS)
-> Show ListNamespacesResponse
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. ListNamespacesResponse -> Rep ListNamespacesResponse x)
-> (forall x.
    Rep ListNamespacesResponse x -> ListNamespacesResponse)
-> Generic ListNamespacesResponse
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:
--
-- 'requestId', 'listNamespacesResponse_requestId' - The Amazon Web Services request ID for this operation.
--
-- '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 pagination token that can be used in a subsequent request.
--
-- 'status', 'listNamespacesResponse_status' - The HTTP status of the request.
newListNamespacesResponse ::
  -- | 'status'
  Prelude.Int ->
  ListNamespacesResponse
newListNamespacesResponse :: Int -> ListNamespacesResponse
newListNamespacesResponse Int
pStatus_ =
  ListNamespacesResponse' :: Maybe Text
-> Maybe [NamespaceInfoV2]
-> Maybe Text
-> Int
-> ListNamespacesResponse
ListNamespacesResponse'
    { $sel:requestId:ListNamespacesResponse' :: Maybe Text
requestId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:namespaces:ListNamespacesResponse' :: Maybe [NamespaceInfoV2]
namespaces = Maybe [NamespaceInfoV2]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListNamespacesResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:status:ListNamespacesResponse' :: Int
status = Int
pStatus_
    }

-- | The Amazon Web Services request ID for this operation.
listNamespacesResponse_requestId :: Lens.Lens' ListNamespacesResponse (Prelude.Maybe Prelude.Text)
listNamespacesResponse_requestId :: (Maybe Text -> f (Maybe Text))
-> ListNamespacesResponse -> f ListNamespacesResponse
listNamespacesResponse_requestId = (ListNamespacesResponse -> Maybe Text)
-> (ListNamespacesResponse -> Maybe Text -> ListNamespacesResponse)
-> Lens' ListNamespacesResponse (Maybe Text)
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 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 :: (Maybe [NamespaceInfoV2] -> f (Maybe [NamespaceInfoV2]))
-> ListNamespacesResponse -> f ListNamespacesResponse
listNamespacesResponse_namespaces = (ListNamespacesResponse -> Maybe [NamespaceInfoV2])
-> (ListNamespacesResponse
    -> Maybe [NamespaceInfoV2] -> ListNamespacesResponse)
-> Lens' ListNamespacesResponse (Maybe [NamespaceInfoV2])
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) ((Maybe [NamespaceInfoV2] -> f (Maybe [NamespaceInfoV2]))
 -> ListNamespacesResponse -> f ListNamespacesResponse)
-> ((Maybe [NamespaceInfoV2] -> f (Maybe [NamespaceInfoV2]))
    -> Maybe [NamespaceInfoV2] -> f (Maybe [NamespaceInfoV2]))
-> (Maybe [NamespaceInfoV2] -> f (Maybe [NamespaceInfoV2]))
-> ListNamespacesResponse
-> f ListNamespacesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [NamespaceInfoV2]
  [NamespaceInfoV2]
  [NamespaceInfoV2]
  [NamespaceInfoV2]
-> Iso
     (Maybe [NamespaceInfoV2])
     (Maybe [NamespaceInfoV2])
     (Maybe [NamespaceInfoV2])
     (Maybe [NamespaceInfoV2])
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
  [NamespaceInfoV2]
  [NamespaceInfoV2]
  [NamespaceInfoV2]
  [NamespaceInfoV2]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A pagination token that can be used in a subsequent request.
listNamespacesResponse_nextToken :: Lens.Lens' ListNamespacesResponse (Prelude.Maybe Prelude.Text)
listNamespacesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListNamespacesResponse -> f ListNamespacesResponse
listNamespacesResponse_nextToken = (ListNamespacesResponse -> Maybe Text)
-> (ListNamespacesResponse -> Maybe Text -> ListNamespacesResponse)
-> Lens' ListNamespacesResponse (Maybe Text)
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 HTTP status of the request.
listNamespacesResponse_status :: Lens.Lens' ListNamespacesResponse Prelude.Int
listNamespacesResponse_status :: (Int -> f Int)
-> ListNamespacesResponse -> f ListNamespacesResponse
listNamespacesResponse_status = (ListNamespacesResponse -> Int)
-> (ListNamespacesResponse -> Int -> ListNamespacesResponse)
-> Lens ListNamespacesResponse ListNamespacesResponse Int Int
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