{-# 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.CreateNamespace
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- (Enterprise edition only) Creates a new namespace for you to use with
-- Amazon QuickSight.
--
-- A namespace allows you to isolate the Amazon QuickSight users and groups
-- that are registered for that namespace. Users that access the namespace
-- can share assets only with other users or groups in the same namespace.
-- They can\'t see users and groups in other namespaces. You can create a
-- namespace after your Amazon Web Services account is subscribed to Amazon
-- QuickSight. The namespace must be unique within the Amazon Web Services
-- account. By default, there is a limit of 100 namespaces per Amazon Web
-- Services account. To increase your limit, create a ticket with Amazon
-- Web Services Support.
module Amazonka.QuickSight.CreateNamespace
  ( -- * Creating a Request
    CreateNamespace (..),
    newCreateNamespace,

    -- * Request Lenses
    createNamespace_tags,
    createNamespace_awsAccountId,
    createNamespace_namespace,
    createNamespace_identityStore,

    -- * Destructuring the Response
    CreateNamespaceResponse (..),
    newCreateNamespaceResponse,

    -- * Response Lenses
    createNamespaceResponse_arn,
    createNamespaceResponse_capacityRegion,
    createNamespaceResponse_creationStatus,
    createNamespaceResponse_identityStore,
    createNamespaceResponse_name,
    createNamespaceResponse_requestId,
    createNamespaceResponse_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:/ 'newCreateNamespace' smart constructor.
data CreateNamespace = CreateNamespace'
  { -- | The tags that you want to associate with the namespace that you\'re
    -- creating.
    CreateNamespace -> Maybe (NonEmpty Tag)
tags :: Prelude.Maybe (Prelude.NonEmpty Tag),
    -- | The ID for the Amazon Web Services account that you want to create the
    -- Amazon QuickSight namespace in.
    CreateNamespace -> Text
awsAccountId :: Prelude.Text,
    -- | The name that you want to use to describe the new namespace.
    CreateNamespace -> Text
namespace :: Prelude.Text,
    -- | Specifies the type of your user identity directory. Currently, this
    -- supports users with an identity type of @QUICKSIGHT@.
    CreateNamespace -> IdentityStore
identityStore :: IdentityStore
  }
  deriving (CreateNamespace -> CreateNamespace -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateNamespace -> CreateNamespace -> Bool
$c/= :: CreateNamespace -> CreateNamespace -> Bool
== :: CreateNamespace -> CreateNamespace -> Bool
$c== :: CreateNamespace -> CreateNamespace -> Bool
Prelude.Eq, ReadPrec [CreateNamespace]
ReadPrec CreateNamespace
Int -> ReadS CreateNamespace
ReadS [CreateNamespace]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateNamespace]
$creadListPrec :: ReadPrec [CreateNamespace]
readPrec :: ReadPrec CreateNamespace
$creadPrec :: ReadPrec CreateNamespace
readList :: ReadS [CreateNamespace]
$creadList :: ReadS [CreateNamespace]
readsPrec :: Int -> ReadS CreateNamespace
$creadsPrec :: Int -> ReadS CreateNamespace
Prelude.Read, Int -> CreateNamespace -> ShowS
[CreateNamespace] -> ShowS
CreateNamespace -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateNamespace] -> ShowS
$cshowList :: [CreateNamespace] -> ShowS
show :: CreateNamespace -> String
$cshow :: CreateNamespace -> String
showsPrec :: Int -> CreateNamespace -> ShowS
$cshowsPrec :: Int -> CreateNamespace -> ShowS
Prelude.Show, forall x. Rep CreateNamespace x -> CreateNamespace
forall x. CreateNamespace -> Rep CreateNamespace x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateNamespace x -> CreateNamespace
$cfrom :: forall x. CreateNamespace -> Rep CreateNamespace x
Prelude.Generic)

-- |
-- Create a value of 'CreateNamespace' 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:
--
-- 'tags', 'createNamespace_tags' - The tags that you want to associate with the namespace that you\'re
-- creating.
--
-- 'awsAccountId', 'createNamespace_awsAccountId' - The ID for the Amazon Web Services account that you want to create the
-- Amazon QuickSight namespace in.
--
-- 'namespace', 'createNamespace_namespace' - The name that you want to use to describe the new namespace.
--
-- 'identityStore', 'createNamespace_identityStore' - Specifies the type of your user identity directory. Currently, this
-- supports users with an identity type of @QUICKSIGHT@.
newCreateNamespace ::
  -- | 'awsAccountId'
  Prelude.Text ->
  -- | 'namespace'
  Prelude.Text ->
  -- | 'identityStore'
  IdentityStore ->
  CreateNamespace
newCreateNamespace :: Text -> Text -> IdentityStore -> CreateNamespace
newCreateNamespace
  Text
pAwsAccountId_
  Text
pNamespace_
  IdentityStore
pIdentityStore_ =
    CreateNamespace'
      { $sel:tags:CreateNamespace' :: Maybe (NonEmpty Tag)
tags = forall a. Maybe a
Prelude.Nothing,
        $sel:awsAccountId:CreateNamespace' :: Text
awsAccountId = Text
pAwsAccountId_,
        $sel:namespace:CreateNamespace' :: Text
namespace = Text
pNamespace_,
        $sel:identityStore:CreateNamespace' :: IdentityStore
identityStore = IdentityStore
pIdentityStore_
      }

-- | The tags that you want to associate with the namespace that you\'re
-- creating.
createNamespace_tags :: Lens.Lens' CreateNamespace (Prelude.Maybe (Prelude.NonEmpty Tag))
createNamespace_tags :: Lens' CreateNamespace (Maybe (NonEmpty Tag))
createNamespace_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNamespace' {Maybe (NonEmpty Tag)
tags :: Maybe (NonEmpty Tag)
$sel:tags:CreateNamespace' :: CreateNamespace -> Maybe (NonEmpty Tag)
tags} -> Maybe (NonEmpty Tag)
tags) (\s :: CreateNamespace
s@CreateNamespace' {} Maybe (NonEmpty Tag)
a -> CreateNamespace
s {$sel:tags:CreateNamespace' :: Maybe (NonEmpty Tag)
tags = Maybe (NonEmpty Tag)
a} :: CreateNamespace) 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 ID for the Amazon Web Services account that you want to create the
-- Amazon QuickSight namespace in.
createNamespace_awsAccountId :: Lens.Lens' CreateNamespace Prelude.Text
createNamespace_awsAccountId :: Lens' CreateNamespace Text
createNamespace_awsAccountId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNamespace' {Text
awsAccountId :: Text
$sel:awsAccountId:CreateNamespace' :: CreateNamespace -> Text
awsAccountId} -> Text
awsAccountId) (\s :: CreateNamespace
s@CreateNamespace' {} Text
a -> CreateNamespace
s {$sel:awsAccountId:CreateNamespace' :: Text
awsAccountId = Text
a} :: CreateNamespace)

-- | The name that you want to use to describe the new namespace.
createNamespace_namespace :: Lens.Lens' CreateNamespace Prelude.Text
createNamespace_namespace :: Lens' CreateNamespace Text
createNamespace_namespace = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNamespace' {Text
namespace :: Text
$sel:namespace:CreateNamespace' :: CreateNamespace -> Text
namespace} -> Text
namespace) (\s :: CreateNamespace
s@CreateNamespace' {} Text
a -> CreateNamespace
s {$sel:namespace:CreateNamespace' :: Text
namespace = Text
a} :: CreateNamespace)

-- | Specifies the type of your user identity directory. Currently, this
-- supports users with an identity type of @QUICKSIGHT@.
createNamespace_identityStore :: Lens.Lens' CreateNamespace IdentityStore
createNamespace_identityStore :: Lens' CreateNamespace IdentityStore
createNamespace_identityStore = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNamespace' {IdentityStore
identityStore :: IdentityStore
$sel:identityStore:CreateNamespace' :: CreateNamespace -> IdentityStore
identityStore} -> IdentityStore
identityStore) (\s :: CreateNamespace
s@CreateNamespace' {} IdentityStore
a -> CreateNamespace
s {$sel:identityStore:CreateNamespace' :: IdentityStore
identityStore = IdentityStore
a} :: CreateNamespace)

instance Core.AWSRequest CreateNamespace where
  type
    AWSResponse CreateNamespace =
      CreateNamespaceResponse
  request :: (Service -> Service) -> CreateNamespace -> Request CreateNamespace
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 CreateNamespace
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateNamespace)))
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 Text
-> Maybe Text
-> Maybe NamespaceStatus
-> Maybe IdentityStore
-> Maybe Text
-> Maybe Text
-> Int
-> CreateNamespaceResponse
CreateNamespaceResponse'
            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
"Arn")
            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
"CapacityRegion")
            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
"CreationStatus")
            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
"IdentityStore")
            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
"Name")
            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 CreateNamespace where
  hashWithSalt :: Int -> CreateNamespace -> Int
hashWithSalt Int
_salt CreateNamespace' {Maybe (NonEmpty Tag)
Text
IdentityStore
identityStore :: IdentityStore
namespace :: Text
awsAccountId :: Text
tags :: Maybe (NonEmpty Tag)
$sel:identityStore:CreateNamespace' :: CreateNamespace -> IdentityStore
$sel:namespace:CreateNamespace' :: CreateNamespace -> Text
$sel:awsAccountId:CreateNamespace' :: CreateNamespace -> Text
$sel:tags:CreateNamespace' :: CreateNamespace -> Maybe (NonEmpty Tag)
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty Tag)
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
awsAccountId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
namespace
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` IdentityStore
identityStore

instance Prelude.NFData CreateNamespace where
  rnf :: CreateNamespace -> ()
rnf CreateNamespace' {Maybe (NonEmpty Tag)
Text
IdentityStore
identityStore :: IdentityStore
namespace :: Text
awsAccountId :: Text
tags :: Maybe (NonEmpty Tag)
$sel:identityStore:CreateNamespace' :: CreateNamespace -> IdentityStore
$sel:namespace:CreateNamespace' :: CreateNamespace -> Text
$sel:awsAccountId:CreateNamespace' :: CreateNamespace -> Text
$sel:tags:CreateNamespace' :: CreateNamespace -> Maybe (NonEmpty Tag)
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty Tag)
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
awsAccountId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
namespace
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf IdentityStore
identityStore

instance Data.ToHeaders CreateNamespace where
  toHeaders :: CreateNamespace -> 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.ToJSON CreateNamespace where
  toJSON :: CreateNamespace -> Value
toJSON CreateNamespace' {Maybe (NonEmpty Tag)
Text
IdentityStore
identityStore :: IdentityStore
namespace :: Text
awsAccountId :: Text
tags :: Maybe (NonEmpty Tag)
$sel:identityStore:CreateNamespace' :: CreateNamespace -> IdentityStore
$sel:namespace:CreateNamespace' :: CreateNamespace -> Text
$sel:awsAccountId:CreateNamespace' :: CreateNamespace -> Text
$sel:tags:CreateNamespace' :: CreateNamespace -> Maybe (NonEmpty Tag)
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"Tags" 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 (NonEmpty Tag)
tags,
            forall a. a -> Maybe a
Prelude.Just (Key
"Namespace" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
namespace),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"IdentityStore" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= IdentityStore
identityStore)
          ]
      )

instance Data.ToPath CreateNamespace where
  toPath :: CreateNamespace -> ByteString
toPath CreateNamespace' {Maybe (NonEmpty Tag)
Text
IdentityStore
identityStore :: IdentityStore
namespace :: Text
awsAccountId :: Text
tags :: Maybe (NonEmpty Tag)
$sel:identityStore:CreateNamespace' :: CreateNamespace -> IdentityStore
$sel:namespace:CreateNamespace' :: CreateNamespace -> Text
$sel:awsAccountId:CreateNamespace' :: CreateNamespace -> Text
$sel:tags:CreateNamespace' :: CreateNamespace -> Maybe (NonEmpty Tag)
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/accounts/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
awsAccountId]

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

-- | /See:/ 'newCreateNamespaceResponse' smart constructor.
data CreateNamespaceResponse = CreateNamespaceResponse'
  { -- | The ARN of the Amazon QuickSight namespace you created.
    CreateNamespaceResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Web Services Region; that you want to use for the free SPICE
    -- capacity for the new namespace. This is set to the region that you run
    -- CreateNamespace in.
    CreateNamespaceResponse -> Maybe Text
capacityRegion :: Prelude.Maybe Prelude.Text,
    -- | The status of the creation of the namespace. This is an asynchronous
    -- process. A status of @CREATED@ means that your namespace is ready to
    -- use. If an error occurs, it indicates if the process is @retryable@ or
    -- @non-retryable@. In the case of a non-retryable error, refer to the
    -- error message for follow-up tasks.
    CreateNamespaceResponse -> Maybe NamespaceStatus
creationStatus :: Prelude.Maybe NamespaceStatus,
    -- | Specifies the type of your user identity directory. Currently, this
    -- supports users with an identity type of @QUICKSIGHT@.
    CreateNamespaceResponse -> Maybe IdentityStore
identityStore :: Prelude.Maybe IdentityStore,
    -- | The name of the new namespace that you created.
    CreateNamespaceResponse -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Web Services request ID for this operation.
    CreateNamespaceResponse -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
    -- | The HTTP status of the request.
    CreateNamespaceResponse -> Int
status :: Prelude.Int
  }
  deriving (CreateNamespaceResponse -> CreateNamespaceResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateNamespaceResponse -> CreateNamespaceResponse -> Bool
$c/= :: CreateNamespaceResponse -> CreateNamespaceResponse -> Bool
== :: CreateNamespaceResponse -> CreateNamespaceResponse -> Bool
$c== :: CreateNamespaceResponse -> CreateNamespaceResponse -> Bool
Prelude.Eq, ReadPrec [CreateNamespaceResponse]
ReadPrec CreateNamespaceResponse
Int -> ReadS CreateNamespaceResponse
ReadS [CreateNamespaceResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateNamespaceResponse]
$creadListPrec :: ReadPrec [CreateNamespaceResponse]
readPrec :: ReadPrec CreateNamespaceResponse
$creadPrec :: ReadPrec CreateNamespaceResponse
readList :: ReadS [CreateNamespaceResponse]
$creadList :: ReadS [CreateNamespaceResponse]
readsPrec :: Int -> ReadS CreateNamespaceResponse
$creadsPrec :: Int -> ReadS CreateNamespaceResponse
Prelude.Read, Int -> CreateNamespaceResponse -> ShowS
[CreateNamespaceResponse] -> ShowS
CreateNamespaceResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateNamespaceResponse] -> ShowS
$cshowList :: [CreateNamespaceResponse] -> ShowS
show :: CreateNamespaceResponse -> String
$cshow :: CreateNamespaceResponse -> String
showsPrec :: Int -> CreateNamespaceResponse -> ShowS
$cshowsPrec :: Int -> CreateNamespaceResponse -> ShowS
Prelude.Show, forall x. Rep CreateNamespaceResponse x -> CreateNamespaceResponse
forall x. CreateNamespaceResponse -> Rep CreateNamespaceResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateNamespaceResponse x -> CreateNamespaceResponse
$cfrom :: forall x. CreateNamespaceResponse -> Rep CreateNamespaceResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateNamespaceResponse' 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:
--
-- 'arn', 'createNamespaceResponse_arn' - The ARN of the Amazon QuickSight namespace you created.
--
-- 'capacityRegion', 'createNamespaceResponse_capacityRegion' - The Amazon Web Services Region; that you want to use for the free SPICE
-- capacity for the new namespace. This is set to the region that you run
-- CreateNamespace in.
--
-- 'creationStatus', 'createNamespaceResponse_creationStatus' - The status of the creation of the namespace. This is an asynchronous
-- process. A status of @CREATED@ means that your namespace is ready to
-- use. If an error occurs, it indicates if the process is @retryable@ or
-- @non-retryable@. In the case of a non-retryable error, refer to the
-- error message for follow-up tasks.
--
-- 'identityStore', 'createNamespaceResponse_identityStore' - Specifies the type of your user identity directory. Currently, this
-- supports users with an identity type of @QUICKSIGHT@.
--
-- 'name', 'createNamespaceResponse_name' - The name of the new namespace that you created.
--
-- 'requestId', 'createNamespaceResponse_requestId' - The Amazon Web Services request ID for this operation.
--
-- 'status', 'createNamespaceResponse_status' - The HTTP status of the request.
newCreateNamespaceResponse ::
  -- | 'status'
  Prelude.Int ->
  CreateNamespaceResponse
newCreateNamespaceResponse :: Int -> CreateNamespaceResponse
newCreateNamespaceResponse Int
pStatus_ =
  CreateNamespaceResponse'
    { $sel:arn:CreateNamespaceResponse' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
      $sel:capacityRegion:CreateNamespaceResponse' :: Maybe Text
capacityRegion = forall a. Maybe a
Prelude.Nothing,
      $sel:creationStatus:CreateNamespaceResponse' :: Maybe NamespaceStatus
creationStatus = forall a. Maybe a
Prelude.Nothing,
      $sel:identityStore:CreateNamespaceResponse' :: Maybe IdentityStore
identityStore = forall a. Maybe a
Prelude.Nothing,
      $sel:name:CreateNamespaceResponse' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:requestId:CreateNamespaceResponse' :: Maybe Text
requestId = forall a. Maybe a
Prelude.Nothing,
      $sel:status:CreateNamespaceResponse' :: Int
status = Int
pStatus_
    }

-- | The ARN of the Amazon QuickSight namespace you created.
createNamespaceResponse_arn :: Lens.Lens' CreateNamespaceResponse (Prelude.Maybe Prelude.Text)
createNamespaceResponse_arn :: Lens' CreateNamespaceResponse (Maybe Text)
createNamespaceResponse_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNamespaceResponse' {Maybe Text
arn :: Maybe Text
$sel:arn:CreateNamespaceResponse' :: CreateNamespaceResponse -> Maybe Text
arn} -> Maybe Text
arn) (\s :: CreateNamespaceResponse
s@CreateNamespaceResponse' {} Maybe Text
a -> CreateNamespaceResponse
s {$sel:arn:CreateNamespaceResponse' :: Maybe Text
arn = Maybe Text
a} :: CreateNamespaceResponse)

-- | The Amazon Web Services Region; that you want to use for the free SPICE
-- capacity for the new namespace. This is set to the region that you run
-- CreateNamespace in.
createNamespaceResponse_capacityRegion :: Lens.Lens' CreateNamespaceResponse (Prelude.Maybe Prelude.Text)
createNamespaceResponse_capacityRegion :: Lens' CreateNamespaceResponse (Maybe Text)
createNamespaceResponse_capacityRegion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNamespaceResponse' {Maybe Text
capacityRegion :: Maybe Text
$sel:capacityRegion:CreateNamespaceResponse' :: CreateNamespaceResponse -> Maybe Text
capacityRegion} -> Maybe Text
capacityRegion) (\s :: CreateNamespaceResponse
s@CreateNamespaceResponse' {} Maybe Text
a -> CreateNamespaceResponse
s {$sel:capacityRegion:CreateNamespaceResponse' :: Maybe Text
capacityRegion = Maybe Text
a} :: CreateNamespaceResponse)

-- | The status of the creation of the namespace. This is an asynchronous
-- process. A status of @CREATED@ means that your namespace is ready to
-- use. If an error occurs, it indicates if the process is @retryable@ or
-- @non-retryable@. In the case of a non-retryable error, refer to the
-- error message for follow-up tasks.
createNamespaceResponse_creationStatus :: Lens.Lens' CreateNamespaceResponse (Prelude.Maybe NamespaceStatus)
createNamespaceResponse_creationStatus :: Lens' CreateNamespaceResponse (Maybe NamespaceStatus)
createNamespaceResponse_creationStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNamespaceResponse' {Maybe NamespaceStatus
creationStatus :: Maybe NamespaceStatus
$sel:creationStatus:CreateNamespaceResponse' :: CreateNamespaceResponse -> Maybe NamespaceStatus
creationStatus} -> Maybe NamespaceStatus
creationStatus) (\s :: CreateNamespaceResponse
s@CreateNamespaceResponse' {} Maybe NamespaceStatus
a -> CreateNamespaceResponse
s {$sel:creationStatus:CreateNamespaceResponse' :: Maybe NamespaceStatus
creationStatus = Maybe NamespaceStatus
a} :: CreateNamespaceResponse)

-- | Specifies the type of your user identity directory. Currently, this
-- supports users with an identity type of @QUICKSIGHT@.
createNamespaceResponse_identityStore :: Lens.Lens' CreateNamespaceResponse (Prelude.Maybe IdentityStore)
createNamespaceResponse_identityStore :: Lens' CreateNamespaceResponse (Maybe IdentityStore)
createNamespaceResponse_identityStore = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNamespaceResponse' {Maybe IdentityStore
identityStore :: Maybe IdentityStore
$sel:identityStore:CreateNamespaceResponse' :: CreateNamespaceResponse -> Maybe IdentityStore
identityStore} -> Maybe IdentityStore
identityStore) (\s :: CreateNamespaceResponse
s@CreateNamespaceResponse' {} Maybe IdentityStore
a -> CreateNamespaceResponse
s {$sel:identityStore:CreateNamespaceResponse' :: Maybe IdentityStore
identityStore = Maybe IdentityStore
a} :: CreateNamespaceResponse)

-- | The name of the new namespace that you created.
createNamespaceResponse_name :: Lens.Lens' CreateNamespaceResponse (Prelude.Maybe Prelude.Text)
createNamespaceResponse_name :: Lens' CreateNamespaceResponse (Maybe Text)
createNamespaceResponse_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNamespaceResponse' {Maybe Text
name :: Maybe Text
$sel:name:CreateNamespaceResponse' :: CreateNamespaceResponse -> Maybe Text
name} -> Maybe Text
name) (\s :: CreateNamespaceResponse
s@CreateNamespaceResponse' {} Maybe Text
a -> CreateNamespaceResponse
s {$sel:name:CreateNamespaceResponse' :: Maybe Text
name = Maybe Text
a} :: CreateNamespaceResponse)

-- | The Amazon Web Services request ID for this operation.
createNamespaceResponse_requestId :: Lens.Lens' CreateNamespaceResponse (Prelude.Maybe Prelude.Text)
createNamespaceResponse_requestId :: Lens' CreateNamespaceResponse (Maybe Text)
createNamespaceResponse_requestId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNamespaceResponse' {Maybe Text
requestId :: Maybe Text
$sel:requestId:CreateNamespaceResponse' :: CreateNamespaceResponse -> Maybe Text
requestId} -> Maybe Text
requestId) (\s :: CreateNamespaceResponse
s@CreateNamespaceResponse' {} Maybe Text
a -> CreateNamespaceResponse
s {$sel:requestId:CreateNamespaceResponse' :: Maybe Text
requestId = Maybe Text
a} :: CreateNamespaceResponse)

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

instance Prelude.NFData CreateNamespaceResponse where
  rnf :: CreateNamespaceResponse -> ()
rnf CreateNamespaceResponse' {Int
Maybe Text
Maybe IdentityStore
Maybe NamespaceStatus
status :: Int
requestId :: Maybe Text
name :: Maybe Text
identityStore :: Maybe IdentityStore
creationStatus :: Maybe NamespaceStatus
capacityRegion :: Maybe Text
arn :: Maybe Text
$sel:status:CreateNamespaceResponse' :: CreateNamespaceResponse -> Int
$sel:requestId:CreateNamespaceResponse' :: CreateNamespaceResponse -> Maybe Text
$sel:name:CreateNamespaceResponse' :: CreateNamespaceResponse -> Maybe Text
$sel:identityStore:CreateNamespaceResponse' :: CreateNamespaceResponse -> Maybe IdentityStore
$sel:creationStatus:CreateNamespaceResponse' :: CreateNamespaceResponse -> Maybe NamespaceStatus
$sel:capacityRegion:CreateNamespaceResponse' :: CreateNamespaceResponse -> Maybe Text
$sel:arn:CreateNamespaceResponse' :: CreateNamespaceResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
capacityRegion
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe NamespaceStatus
creationStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe IdentityStore
identityStore
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
      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