{-# 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-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)
--
-- (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_requestId,
    createNamespaceResponse_capacityRegion,
    createNamespaceResponse_arn,
    createNamespaceResponse_creationStatus,
    createNamespaceResponse_name,
    createNamespaceResponse_identityStore,
    createNamespaceResponse_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:/ '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
(CreateNamespace -> CreateNamespace -> Bool)
-> (CreateNamespace -> CreateNamespace -> Bool)
-> Eq CreateNamespace
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]
(Int -> ReadS CreateNamespace)
-> ReadS [CreateNamespace]
-> ReadPrec CreateNamespace
-> ReadPrec [CreateNamespace]
-> Read 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
(Int -> CreateNamespace -> ShowS)
-> (CreateNamespace -> String)
-> ([CreateNamespace] -> ShowS)
-> Show CreateNamespace
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. CreateNamespace -> Rep CreateNamespace x)
-> (forall x. Rep CreateNamespace x -> CreateNamespace)
-> Generic CreateNamespace
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' :: Maybe (NonEmpty Tag)
-> Text -> Text -> IdentityStore -> CreateNamespace
CreateNamespace'
      { $sel:tags:CreateNamespace' :: Maybe (NonEmpty Tag)
tags = Maybe (NonEmpty Tag)
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 :: (Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> CreateNamespace -> f CreateNamespace
createNamespace_tags = (CreateNamespace -> Maybe (NonEmpty Tag))
-> (CreateNamespace -> Maybe (NonEmpty Tag) -> CreateNamespace)
-> Lens
     CreateNamespace
     CreateNamespace
     (Maybe (NonEmpty Tag))
     (Maybe (NonEmpty Tag))
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) ((Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
 -> CreateNamespace -> f CreateNamespace)
-> ((Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
    -> Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> (Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> CreateNamespace
-> f CreateNamespace
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag)
-> Iso
     (Maybe (NonEmpty Tag))
     (Maybe (NonEmpty Tag))
     (Maybe (NonEmpty Tag))
     (Maybe (NonEmpty Tag))
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 (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag)
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 :: (Text -> f Text) -> CreateNamespace -> f CreateNamespace
createNamespace_awsAccountId = (CreateNamespace -> Text)
-> (CreateNamespace -> Text -> CreateNamespace)
-> Lens CreateNamespace CreateNamespace Text Text
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 :: (Text -> f Text) -> CreateNamespace -> f CreateNamespace
createNamespace_namespace = (CreateNamespace -> Text)
-> (CreateNamespace -> Text -> CreateNamespace)
-> Lens CreateNamespace CreateNamespace Text Text
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 :: (IdentityStore -> f IdentityStore)
-> CreateNamespace -> f CreateNamespace
createNamespace_identityStore = (CreateNamespace -> IdentityStore)
-> (CreateNamespace -> IdentityStore -> CreateNamespace)
-> Lens CreateNamespace CreateNamespace IdentityStore 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 :: CreateNamespace -> Request CreateNamespace
request = Service -> CreateNamespace -> Request CreateNamespace
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateNamespace
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateNamespace)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateNamespace))
-> Logger
-> Service
-> Proxy CreateNamespace
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateNamespace)))
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 Text
-> Maybe Text
-> Maybe NamespaceStatus
-> Maybe Text
-> Maybe IdentityStore
-> Int
-> CreateNamespaceResponse
CreateNamespaceResponse'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe NamespaceStatus
 -> Maybe Text
 -> Maybe IdentityStore
 -> Int
 -> CreateNamespaceResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe NamespaceStatus
      -> Maybe Text
      -> Maybe IdentityStore
      -> Int
      -> CreateNamespaceResponse)
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 Text
   -> Maybe Text
   -> Maybe NamespaceStatus
   -> Maybe Text
   -> Maybe IdentityStore
   -> Int
   -> CreateNamespaceResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe NamespaceStatus
      -> Maybe Text
      -> Maybe IdentityStore
      -> Int
      -> CreateNamespaceResponse)
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
"CapacityRegion")
            Either
  String
  (Maybe Text
   -> Maybe NamespaceStatus
   -> Maybe Text
   -> Maybe IdentityStore
   -> Int
   -> CreateNamespaceResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe NamespaceStatus
      -> Maybe Text
      -> Maybe IdentityStore
      -> Int
      -> CreateNamespaceResponse)
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
"Arn")
            Either
  String
  (Maybe NamespaceStatus
   -> Maybe Text
   -> Maybe IdentityStore
   -> Int
   -> CreateNamespaceResponse)
-> Either String (Maybe NamespaceStatus)
-> Either
     String
     (Maybe Text
      -> Maybe IdentityStore -> Int -> CreateNamespaceResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe NamespaceStatus)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"CreationStatus")
            Either
  String
  (Maybe Text
   -> Maybe IdentityStore -> Int -> CreateNamespaceResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe IdentityStore -> Int -> CreateNamespaceResponse)
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
"Name")
            Either
  String (Maybe IdentityStore -> Int -> CreateNamespaceResponse)
-> Either String (Maybe IdentityStore)
-> Either String (Int -> CreateNamespaceResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe IdentityStore)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"IdentityStore")
            Either String (Int -> CreateNamespaceResponse)
-> Either String Int -> Either String CreateNamespaceResponse
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 CreateNamespace

instance Prelude.NFData CreateNamespace

instance Core.ToHeaders CreateNamespace where
  toHeaders :: CreateNamespace -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateNamespace -> 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.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
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"Tags" Text -> NonEmpty Tag -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NonEmpty Tag -> Pair) -> Maybe (NonEmpty Tag) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Tag)
tags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Namespace" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
namespace),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"IdentityStore" Text -> IdentityStore -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= IdentityStore
identityStore)
          ]
      )

instance Core.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)
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/accounts/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
awsAccountId]

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

-- | /See:/ 'newCreateNamespaceResponse' smart constructor.
data CreateNamespaceResponse = CreateNamespaceResponse'
  { -- | The Amazon Web Services request ID for this operation.
    CreateNamespaceResponse -> Maybe Text
requestId :: 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 ARN of the Amazon QuickSight namespace you created.
    CreateNamespaceResponse -> Maybe Text
arn :: 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,
    -- | The name of the new namespace that you created.
    CreateNamespaceResponse -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | 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 HTTP status of the request.
    CreateNamespaceResponse -> Int
status :: Prelude.Int
  }
  deriving (CreateNamespaceResponse -> CreateNamespaceResponse -> Bool
(CreateNamespaceResponse -> CreateNamespaceResponse -> Bool)
-> (CreateNamespaceResponse -> CreateNamespaceResponse -> Bool)
-> Eq CreateNamespaceResponse
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]
(Int -> ReadS CreateNamespaceResponse)
-> ReadS [CreateNamespaceResponse]
-> ReadPrec CreateNamespaceResponse
-> ReadPrec [CreateNamespaceResponse]
-> Read 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
(Int -> CreateNamespaceResponse -> ShowS)
-> (CreateNamespaceResponse -> String)
-> ([CreateNamespaceResponse] -> ShowS)
-> Show CreateNamespaceResponse
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.
 CreateNamespaceResponse -> Rep CreateNamespaceResponse x)
-> (forall x.
    Rep CreateNamespaceResponse x -> CreateNamespaceResponse)
-> Generic CreateNamespaceResponse
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:
--
-- 'requestId', 'createNamespaceResponse_requestId' - The Amazon Web Services request ID for this operation.
--
-- '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.
--
-- 'arn', 'createNamespaceResponse_arn' - The ARN of the Amazon QuickSight namespace you created.
--
-- '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.
--
-- 'name', 'createNamespaceResponse_name' - The name of the new namespace that you created.
--
-- 'identityStore', 'createNamespaceResponse_identityStore' - Specifies the type of your user identity directory. Currently, this
-- supports users with an identity type of @QUICKSIGHT@.
--
-- 'status', 'createNamespaceResponse_status' - The HTTP status of the request.
newCreateNamespaceResponse ::
  -- | 'status'
  Prelude.Int ->
  CreateNamespaceResponse
newCreateNamespaceResponse :: Int -> CreateNamespaceResponse
newCreateNamespaceResponse Int
pStatus_ =
  CreateNamespaceResponse' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe NamespaceStatus
-> Maybe Text
-> Maybe IdentityStore
-> Int
-> CreateNamespaceResponse
CreateNamespaceResponse'
    { $sel:requestId:CreateNamespaceResponse' :: Maybe Text
requestId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:capacityRegion:CreateNamespaceResponse' :: Maybe Text
capacityRegion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:CreateNamespaceResponse' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:creationStatus:CreateNamespaceResponse' :: Maybe NamespaceStatus
creationStatus = Maybe NamespaceStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:name:CreateNamespaceResponse' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:identityStore:CreateNamespaceResponse' :: Maybe IdentityStore
identityStore = Maybe IdentityStore
forall a. Maybe a
Prelude.Nothing,
      $sel:status:CreateNamespaceResponse' :: Int
status = Int
pStatus_
    }

-- | The Amazon Web Services request ID for this operation.
createNamespaceResponse_requestId :: Lens.Lens' CreateNamespaceResponse (Prelude.Maybe Prelude.Text)
createNamespaceResponse_requestId :: (Maybe Text -> f (Maybe Text))
-> CreateNamespaceResponse -> f CreateNamespaceResponse
createNamespaceResponse_requestId = (CreateNamespaceResponse -> Maybe Text)
-> (CreateNamespaceResponse
    -> Maybe Text -> CreateNamespaceResponse)
-> Lens
     CreateNamespaceResponse
     CreateNamespaceResponse
     (Maybe Text)
     (Maybe Text)
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 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 :: (Maybe Text -> f (Maybe Text))
-> CreateNamespaceResponse -> f CreateNamespaceResponse
createNamespaceResponse_capacityRegion = (CreateNamespaceResponse -> Maybe Text)
-> (CreateNamespaceResponse
    -> Maybe Text -> CreateNamespaceResponse)
-> Lens
     CreateNamespaceResponse
     CreateNamespaceResponse
     (Maybe Text)
     (Maybe Text)
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 ARN of the Amazon QuickSight namespace you created.
createNamespaceResponse_arn :: Lens.Lens' CreateNamespaceResponse (Prelude.Maybe Prelude.Text)
createNamespaceResponse_arn :: (Maybe Text -> f (Maybe Text))
-> CreateNamespaceResponse -> f CreateNamespaceResponse
createNamespaceResponse_arn = (CreateNamespaceResponse -> Maybe Text)
-> (CreateNamespaceResponse
    -> Maybe Text -> CreateNamespaceResponse)
-> Lens
     CreateNamespaceResponse
     CreateNamespaceResponse
     (Maybe Text)
     (Maybe Text)
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 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 :: (Maybe NamespaceStatus -> f (Maybe NamespaceStatus))
-> CreateNamespaceResponse -> f CreateNamespaceResponse
createNamespaceResponse_creationStatus = (CreateNamespaceResponse -> Maybe NamespaceStatus)
-> (CreateNamespaceResponse
    -> Maybe NamespaceStatus -> CreateNamespaceResponse)
-> Lens
     CreateNamespaceResponse
     CreateNamespaceResponse
     (Maybe NamespaceStatus)
     (Maybe NamespaceStatus)
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)

-- | The name of the new namespace that you created.
createNamespaceResponse_name :: Lens.Lens' CreateNamespaceResponse (Prelude.Maybe Prelude.Text)
createNamespaceResponse_name :: (Maybe Text -> f (Maybe Text))
-> CreateNamespaceResponse -> f CreateNamespaceResponse
createNamespaceResponse_name = (CreateNamespaceResponse -> Maybe Text)
-> (CreateNamespaceResponse
    -> Maybe Text -> CreateNamespaceResponse)
-> Lens
     CreateNamespaceResponse
     CreateNamespaceResponse
     (Maybe Text)
     (Maybe Text)
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)

-- | 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 :: (Maybe IdentityStore -> f (Maybe IdentityStore))
-> CreateNamespaceResponse -> f CreateNamespaceResponse
createNamespaceResponse_identityStore = (CreateNamespaceResponse -> Maybe IdentityStore)
-> (CreateNamespaceResponse
    -> Maybe IdentityStore -> CreateNamespaceResponse)
-> Lens
     CreateNamespaceResponse
     CreateNamespaceResponse
     (Maybe IdentityStore)
     (Maybe 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 HTTP status of the request.
createNamespaceResponse_status :: Lens.Lens' CreateNamespaceResponse Prelude.Int
createNamespaceResponse_status :: (Int -> f Int)
-> CreateNamespaceResponse -> f CreateNamespaceResponse
createNamespaceResponse_status = (CreateNamespaceResponse -> Int)
-> (CreateNamespaceResponse -> Int -> CreateNamespaceResponse)
-> Lens CreateNamespaceResponse CreateNamespaceResponse Int Int
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