{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# 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.Types.NamespaceInfoV2
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.QuickSight.Types.NamespaceInfoV2 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.IdentityStore
import Amazonka.QuickSight.Types.NamespaceError
import Amazonka.QuickSight.Types.NamespaceStatus

-- | The error type.
--
-- /See:/ 'newNamespaceInfoV2' smart constructor.
data NamespaceInfoV2 = NamespaceInfoV2'
  { -- | The namespace ARN.
    NamespaceInfoV2 -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The namespace Amazon Web Services Region.
    NamespaceInfoV2 -> Maybe Text
capacityRegion :: Prelude.Maybe Prelude.Text,
    -- | The creation status of a namespace that is not yet completely created.
    NamespaceInfoV2 -> Maybe NamespaceStatus
creationStatus :: Prelude.Maybe NamespaceStatus,
    -- | The identity store used for the namespace.
    NamespaceInfoV2 -> Maybe IdentityStore
identityStore :: Prelude.Maybe IdentityStore,
    -- | The name of the error.
    NamespaceInfoV2 -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | An error that occurred when the namespace was created.
    NamespaceInfoV2 -> Maybe NamespaceError
namespaceError :: Prelude.Maybe NamespaceError
  }
  deriving (NamespaceInfoV2 -> NamespaceInfoV2 -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NamespaceInfoV2 -> NamespaceInfoV2 -> Bool
$c/= :: NamespaceInfoV2 -> NamespaceInfoV2 -> Bool
== :: NamespaceInfoV2 -> NamespaceInfoV2 -> Bool
$c== :: NamespaceInfoV2 -> NamespaceInfoV2 -> Bool
Prelude.Eq, ReadPrec [NamespaceInfoV2]
ReadPrec NamespaceInfoV2
Int -> ReadS NamespaceInfoV2
ReadS [NamespaceInfoV2]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [NamespaceInfoV2]
$creadListPrec :: ReadPrec [NamespaceInfoV2]
readPrec :: ReadPrec NamespaceInfoV2
$creadPrec :: ReadPrec NamespaceInfoV2
readList :: ReadS [NamespaceInfoV2]
$creadList :: ReadS [NamespaceInfoV2]
readsPrec :: Int -> ReadS NamespaceInfoV2
$creadsPrec :: Int -> ReadS NamespaceInfoV2
Prelude.Read, Int -> NamespaceInfoV2 -> ShowS
[NamespaceInfoV2] -> ShowS
NamespaceInfoV2 -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NamespaceInfoV2] -> ShowS
$cshowList :: [NamespaceInfoV2] -> ShowS
show :: NamespaceInfoV2 -> String
$cshow :: NamespaceInfoV2 -> String
showsPrec :: Int -> NamespaceInfoV2 -> ShowS
$cshowsPrec :: Int -> NamespaceInfoV2 -> ShowS
Prelude.Show, forall x. Rep NamespaceInfoV2 x -> NamespaceInfoV2
forall x. NamespaceInfoV2 -> Rep NamespaceInfoV2 x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep NamespaceInfoV2 x -> NamespaceInfoV2
$cfrom :: forall x. NamespaceInfoV2 -> Rep NamespaceInfoV2 x
Prelude.Generic)

-- |
-- Create a value of 'NamespaceInfoV2' 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', 'namespaceInfoV2_arn' - The namespace ARN.
--
-- 'capacityRegion', 'namespaceInfoV2_capacityRegion' - The namespace Amazon Web Services Region.
--
-- 'creationStatus', 'namespaceInfoV2_creationStatus' - The creation status of a namespace that is not yet completely created.
--
-- 'identityStore', 'namespaceInfoV2_identityStore' - The identity store used for the namespace.
--
-- 'name', 'namespaceInfoV2_name' - The name of the error.
--
-- 'namespaceError', 'namespaceInfoV2_namespaceError' - An error that occurred when the namespace was created.
newNamespaceInfoV2 ::
  NamespaceInfoV2
newNamespaceInfoV2 :: NamespaceInfoV2
newNamespaceInfoV2 =
  NamespaceInfoV2'
    { $sel:arn:NamespaceInfoV2' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
      $sel:capacityRegion:NamespaceInfoV2' :: Maybe Text
capacityRegion = forall a. Maybe a
Prelude.Nothing,
      $sel:creationStatus:NamespaceInfoV2' :: Maybe NamespaceStatus
creationStatus = forall a. Maybe a
Prelude.Nothing,
      $sel:identityStore:NamespaceInfoV2' :: Maybe IdentityStore
identityStore = forall a. Maybe a
Prelude.Nothing,
      $sel:name:NamespaceInfoV2' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:namespaceError:NamespaceInfoV2' :: Maybe NamespaceError
namespaceError = forall a. Maybe a
Prelude.Nothing
    }

-- | The namespace ARN.
namespaceInfoV2_arn :: Lens.Lens' NamespaceInfoV2 (Prelude.Maybe Prelude.Text)
namespaceInfoV2_arn :: Lens' NamespaceInfoV2 (Maybe Text)
namespaceInfoV2_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NamespaceInfoV2' {Maybe Text
arn :: Maybe Text
$sel:arn:NamespaceInfoV2' :: NamespaceInfoV2 -> Maybe Text
arn} -> Maybe Text
arn) (\s :: NamespaceInfoV2
s@NamespaceInfoV2' {} Maybe Text
a -> NamespaceInfoV2
s {$sel:arn:NamespaceInfoV2' :: Maybe Text
arn = Maybe Text
a} :: NamespaceInfoV2)

-- | The namespace Amazon Web Services Region.
namespaceInfoV2_capacityRegion :: Lens.Lens' NamespaceInfoV2 (Prelude.Maybe Prelude.Text)
namespaceInfoV2_capacityRegion :: Lens' NamespaceInfoV2 (Maybe Text)
namespaceInfoV2_capacityRegion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NamespaceInfoV2' {Maybe Text
capacityRegion :: Maybe Text
$sel:capacityRegion:NamespaceInfoV2' :: NamespaceInfoV2 -> Maybe Text
capacityRegion} -> Maybe Text
capacityRegion) (\s :: NamespaceInfoV2
s@NamespaceInfoV2' {} Maybe Text
a -> NamespaceInfoV2
s {$sel:capacityRegion:NamespaceInfoV2' :: Maybe Text
capacityRegion = Maybe Text
a} :: NamespaceInfoV2)

-- | The creation status of a namespace that is not yet completely created.
namespaceInfoV2_creationStatus :: Lens.Lens' NamespaceInfoV2 (Prelude.Maybe NamespaceStatus)
namespaceInfoV2_creationStatus :: Lens' NamespaceInfoV2 (Maybe NamespaceStatus)
namespaceInfoV2_creationStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NamespaceInfoV2' {Maybe NamespaceStatus
creationStatus :: Maybe NamespaceStatus
$sel:creationStatus:NamespaceInfoV2' :: NamespaceInfoV2 -> Maybe NamespaceStatus
creationStatus} -> Maybe NamespaceStatus
creationStatus) (\s :: NamespaceInfoV2
s@NamespaceInfoV2' {} Maybe NamespaceStatus
a -> NamespaceInfoV2
s {$sel:creationStatus:NamespaceInfoV2' :: Maybe NamespaceStatus
creationStatus = Maybe NamespaceStatus
a} :: NamespaceInfoV2)

-- | The identity store used for the namespace.
namespaceInfoV2_identityStore :: Lens.Lens' NamespaceInfoV2 (Prelude.Maybe IdentityStore)
namespaceInfoV2_identityStore :: Lens' NamespaceInfoV2 (Maybe IdentityStore)
namespaceInfoV2_identityStore = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NamespaceInfoV2' {Maybe IdentityStore
identityStore :: Maybe IdentityStore
$sel:identityStore:NamespaceInfoV2' :: NamespaceInfoV2 -> Maybe IdentityStore
identityStore} -> Maybe IdentityStore
identityStore) (\s :: NamespaceInfoV2
s@NamespaceInfoV2' {} Maybe IdentityStore
a -> NamespaceInfoV2
s {$sel:identityStore:NamespaceInfoV2' :: Maybe IdentityStore
identityStore = Maybe IdentityStore
a} :: NamespaceInfoV2)

-- | The name of the error.
namespaceInfoV2_name :: Lens.Lens' NamespaceInfoV2 (Prelude.Maybe Prelude.Text)
namespaceInfoV2_name :: Lens' NamespaceInfoV2 (Maybe Text)
namespaceInfoV2_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NamespaceInfoV2' {Maybe Text
name :: Maybe Text
$sel:name:NamespaceInfoV2' :: NamespaceInfoV2 -> Maybe Text
name} -> Maybe Text
name) (\s :: NamespaceInfoV2
s@NamespaceInfoV2' {} Maybe Text
a -> NamespaceInfoV2
s {$sel:name:NamespaceInfoV2' :: Maybe Text
name = Maybe Text
a} :: NamespaceInfoV2)

-- | An error that occurred when the namespace was created.
namespaceInfoV2_namespaceError :: Lens.Lens' NamespaceInfoV2 (Prelude.Maybe NamespaceError)
namespaceInfoV2_namespaceError :: Lens' NamespaceInfoV2 (Maybe NamespaceError)
namespaceInfoV2_namespaceError = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NamespaceInfoV2' {Maybe NamespaceError
namespaceError :: Maybe NamespaceError
$sel:namespaceError:NamespaceInfoV2' :: NamespaceInfoV2 -> Maybe NamespaceError
namespaceError} -> Maybe NamespaceError
namespaceError) (\s :: NamespaceInfoV2
s@NamespaceInfoV2' {} Maybe NamespaceError
a -> NamespaceInfoV2
s {$sel:namespaceError:NamespaceInfoV2' :: Maybe NamespaceError
namespaceError = Maybe NamespaceError
a} :: NamespaceInfoV2)

instance Data.FromJSON NamespaceInfoV2 where
  parseJSON :: Value -> Parser NamespaceInfoV2
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"NamespaceInfoV2"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe NamespaceStatus
-> Maybe IdentityStore
-> Maybe Text
-> Maybe NamespaceError
-> NamespaceInfoV2
NamespaceInfoV2'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (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 -> Parser (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 -> Parser (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 -> Parser (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 -> Parser (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 -> Parser (Maybe a)
Data..:? Key
"NamespaceError")
      )

instance Prelude.Hashable NamespaceInfoV2 where
  hashWithSalt :: Int -> NamespaceInfoV2 -> Int
hashWithSalt Int
_salt NamespaceInfoV2' {Maybe Text
Maybe IdentityStore
Maybe NamespaceError
Maybe NamespaceStatus
namespaceError :: Maybe NamespaceError
name :: Maybe Text
identityStore :: Maybe IdentityStore
creationStatus :: Maybe NamespaceStatus
capacityRegion :: Maybe Text
arn :: Maybe Text
$sel:namespaceError:NamespaceInfoV2' :: NamespaceInfoV2 -> Maybe NamespaceError
$sel:name:NamespaceInfoV2' :: NamespaceInfoV2 -> Maybe Text
$sel:identityStore:NamespaceInfoV2' :: NamespaceInfoV2 -> Maybe IdentityStore
$sel:creationStatus:NamespaceInfoV2' :: NamespaceInfoV2 -> Maybe NamespaceStatus
$sel:capacityRegion:NamespaceInfoV2' :: NamespaceInfoV2 -> Maybe Text
$sel:arn:NamespaceInfoV2' :: NamespaceInfoV2 -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
arn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
capacityRegion
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe NamespaceStatus
creationStatus
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe IdentityStore
identityStore
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe NamespaceError
namespaceError

instance Prelude.NFData NamespaceInfoV2 where
  rnf :: NamespaceInfoV2 -> ()
rnf NamespaceInfoV2' {Maybe Text
Maybe IdentityStore
Maybe NamespaceError
Maybe NamespaceStatus
namespaceError :: Maybe NamespaceError
name :: Maybe Text
identityStore :: Maybe IdentityStore
creationStatus :: Maybe NamespaceStatus
capacityRegion :: Maybe Text
arn :: Maybe Text
$sel:namespaceError:NamespaceInfoV2' :: NamespaceInfoV2 -> Maybe NamespaceError
$sel:name:NamespaceInfoV2' :: NamespaceInfoV2 -> Maybe Text
$sel:identityStore:NamespaceInfoV2' :: NamespaceInfoV2 -> Maybe IdentityStore
$sel:creationStatus:NamespaceInfoV2' :: NamespaceInfoV2 -> Maybe NamespaceStatus
$sel:capacityRegion:NamespaceInfoV2' :: NamespaceInfoV2 -> Maybe Text
$sel:arn:NamespaceInfoV2' :: NamespaceInfoV2 -> 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 NamespaceError
namespaceError