{-# 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.FinSpace.Types.SuperuserParameters
-- 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.FinSpace.Types.SuperuserParameters 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

-- | Configuration information for the superuser.
--
-- /See:/ 'newSuperuserParameters' smart constructor.
data SuperuserParameters = SuperuserParameters'
  { -- | The email address of the superuser.
    SuperuserParameters -> Sensitive Text
emailAddress :: Data.Sensitive Prelude.Text,
    -- | The first name of the superuser.
    SuperuserParameters -> Text
firstName :: Prelude.Text,
    -- | The last name of the superuser.
    SuperuserParameters -> Text
lastName :: Prelude.Text
  }
  deriving (SuperuserParameters -> SuperuserParameters -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SuperuserParameters -> SuperuserParameters -> Bool
$c/= :: SuperuserParameters -> SuperuserParameters -> Bool
== :: SuperuserParameters -> SuperuserParameters -> Bool
$c== :: SuperuserParameters -> SuperuserParameters -> Bool
Prelude.Eq, Int -> SuperuserParameters -> ShowS
[SuperuserParameters] -> ShowS
SuperuserParameters -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SuperuserParameters] -> ShowS
$cshowList :: [SuperuserParameters] -> ShowS
show :: SuperuserParameters -> String
$cshow :: SuperuserParameters -> String
showsPrec :: Int -> SuperuserParameters -> ShowS
$cshowsPrec :: Int -> SuperuserParameters -> ShowS
Prelude.Show, forall x. Rep SuperuserParameters x -> SuperuserParameters
forall x. SuperuserParameters -> Rep SuperuserParameters x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SuperuserParameters x -> SuperuserParameters
$cfrom :: forall x. SuperuserParameters -> Rep SuperuserParameters x
Prelude.Generic)

-- |
-- Create a value of 'SuperuserParameters' 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:
--
-- 'emailAddress', 'superuserParameters_emailAddress' - The email address of the superuser.
--
-- 'firstName', 'superuserParameters_firstName' - The first name of the superuser.
--
-- 'lastName', 'superuserParameters_lastName' - The last name of the superuser.
newSuperuserParameters ::
  -- | 'emailAddress'
  Prelude.Text ->
  -- | 'firstName'
  Prelude.Text ->
  -- | 'lastName'
  Prelude.Text ->
  SuperuserParameters
newSuperuserParameters :: Text -> Text -> Text -> SuperuserParameters
newSuperuserParameters
  Text
pEmailAddress_
  Text
pFirstName_
  Text
pLastName_ =
    SuperuserParameters'
      { $sel:emailAddress:SuperuserParameters' :: Sensitive Text
emailAddress =
          forall a. Iso' (Sensitive a) a
Data._Sensitive forall t b. AReview t b -> b -> t
Lens.# Text
pEmailAddress_,
        $sel:firstName:SuperuserParameters' :: Text
firstName = Text
pFirstName_,
        $sel:lastName:SuperuserParameters' :: Text
lastName = Text
pLastName_
      }

-- | The email address of the superuser.
superuserParameters_emailAddress :: Lens.Lens' SuperuserParameters Prelude.Text
superuserParameters_emailAddress :: Lens' SuperuserParameters Text
superuserParameters_emailAddress = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SuperuserParameters' {Sensitive Text
emailAddress :: Sensitive Text
$sel:emailAddress:SuperuserParameters' :: SuperuserParameters -> Sensitive Text
emailAddress} -> Sensitive Text
emailAddress) (\s :: SuperuserParameters
s@SuperuserParameters' {} Sensitive Text
a -> SuperuserParameters
s {$sel:emailAddress:SuperuserParameters' :: Sensitive Text
emailAddress = Sensitive Text
a} :: SuperuserParameters) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a. Iso' (Sensitive a) a
Data._Sensitive

-- | The first name of the superuser.
superuserParameters_firstName :: Lens.Lens' SuperuserParameters Prelude.Text
superuserParameters_firstName :: Lens' SuperuserParameters Text
superuserParameters_firstName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SuperuserParameters' {Text
firstName :: Text
$sel:firstName:SuperuserParameters' :: SuperuserParameters -> Text
firstName} -> Text
firstName) (\s :: SuperuserParameters
s@SuperuserParameters' {} Text
a -> SuperuserParameters
s {$sel:firstName:SuperuserParameters' :: Text
firstName = Text
a} :: SuperuserParameters)

-- | The last name of the superuser.
superuserParameters_lastName :: Lens.Lens' SuperuserParameters Prelude.Text
superuserParameters_lastName :: Lens' SuperuserParameters Text
superuserParameters_lastName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SuperuserParameters' {Text
lastName :: Text
$sel:lastName:SuperuserParameters' :: SuperuserParameters -> Text
lastName} -> Text
lastName) (\s :: SuperuserParameters
s@SuperuserParameters' {} Text
a -> SuperuserParameters
s {$sel:lastName:SuperuserParameters' :: Text
lastName = Text
a} :: SuperuserParameters)

instance Prelude.Hashable SuperuserParameters where
  hashWithSalt :: Int -> SuperuserParameters -> Int
hashWithSalt Int
_salt SuperuserParameters' {Text
Sensitive Text
lastName :: Text
firstName :: Text
emailAddress :: Sensitive Text
$sel:lastName:SuperuserParameters' :: SuperuserParameters -> Text
$sel:firstName:SuperuserParameters' :: SuperuserParameters -> Text
$sel:emailAddress:SuperuserParameters' :: SuperuserParameters -> Sensitive Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Sensitive Text
emailAddress
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
firstName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
lastName

instance Prelude.NFData SuperuserParameters where
  rnf :: SuperuserParameters -> ()
rnf SuperuserParameters' {Text
Sensitive Text
lastName :: Text
firstName :: Text
emailAddress :: Sensitive Text
$sel:lastName:SuperuserParameters' :: SuperuserParameters -> Text
$sel:firstName:SuperuserParameters' :: SuperuserParameters -> Text
$sel:emailAddress:SuperuserParameters' :: SuperuserParameters -> Sensitive Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Sensitive Text
emailAddress
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
firstName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
lastName

instance Data.ToJSON SuperuserParameters where
  toJSON :: SuperuserParameters -> Value
toJSON SuperuserParameters' {Text
Sensitive Text
lastName :: Text
firstName :: Text
emailAddress :: Sensitive Text
$sel:lastName:SuperuserParameters' :: SuperuserParameters -> Text
$sel:firstName:SuperuserParameters' :: SuperuserParameters -> Text
$sel:emailAddress:SuperuserParameters' :: SuperuserParameters -> Sensitive Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ forall a. a -> Maybe a
Prelude.Just (Key
"emailAddress" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Sensitive Text
emailAddress),
            forall a. a -> Maybe a
Prelude.Just (Key
"firstName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
firstName),
            forall a. a -> Maybe a
Prelude.Just (Key
"lastName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
lastName)
          ]
      )