{-# 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.Nimble.Types.NewLaunchProfileMember
-- 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.Nimble.Types.NewLaunchProfileMember where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Nimble.Types.LaunchProfilePersona
import qualified Amazonka.Prelude as Prelude

-- | A new member that is added to a launch profile.
--
-- /See:/ 'newNewLaunchProfileMember' smart constructor.
data NewLaunchProfileMember = NewLaunchProfileMember'
  { -- | The persona.
    NewLaunchProfileMember -> LaunchProfilePersona
persona :: LaunchProfilePersona,
    -- | The principal ID.
    NewLaunchProfileMember -> Text
principalId :: Prelude.Text
  }
  deriving (NewLaunchProfileMember -> NewLaunchProfileMember -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NewLaunchProfileMember -> NewLaunchProfileMember -> Bool
$c/= :: NewLaunchProfileMember -> NewLaunchProfileMember -> Bool
== :: NewLaunchProfileMember -> NewLaunchProfileMember -> Bool
$c== :: NewLaunchProfileMember -> NewLaunchProfileMember -> Bool
Prelude.Eq, ReadPrec [NewLaunchProfileMember]
ReadPrec NewLaunchProfileMember
Int -> ReadS NewLaunchProfileMember
ReadS [NewLaunchProfileMember]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [NewLaunchProfileMember]
$creadListPrec :: ReadPrec [NewLaunchProfileMember]
readPrec :: ReadPrec NewLaunchProfileMember
$creadPrec :: ReadPrec NewLaunchProfileMember
readList :: ReadS [NewLaunchProfileMember]
$creadList :: ReadS [NewLaunchProfileMember]
readsPrec :: Int -> ReadS NewLaunchProfileMember
$creadsPrec :: Int -> ReadS NewLaunchProfileMember
Prelude.Read, Int -> NewLaunchProfileMember -> ShowS
[NewLaunchProfileMember] -> ShowS
NewLaunchProfileMember -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NewLaunchProfileMember] -> ShowS
$cshowList :: [NewLaunchProfileMember] -> ShowS
show :: NewLaunchProfileMember -> String
$cshow :: NewLaunchProfileMember -> String
showsPrec :: Int -> NewLaunchProfileMember -> ShowS
$cshowsPrec :: Int -> NewLaunchProfileMember -> ShowS
Prelude.Show, forall x. Rep NewLaunchProfileMember x -> NewLaunchProfileMember
forall x. NewLaunchProfileMember -> Rep NewLaunchProfileMember x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep NewLaunchProfileMember x -> NewLaunchProfileMember
$cfrom :: forall x. NewLaunchProfileMember -> Rep NewLaunchProfileMember x
Prelude.Generic)

-- |
-- Create a value of 'NewLaunchProfileMember' 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:
--
-- 'persona', 'newLaunchProfileMember_persona' - The persona.
--
-- 'principalId', 'newLaunchProfileMember_principalId' - The principal ID.
newNewLaunchProfileMember ::
  -- | 'persona'
  LaunchProfilePersona ->
  -- | 'principalId'
  Prelude.Text ->
  NewLaunchProfileMember
newNewLaunchProfileMember :: LaunchProfilePersona -> Text -> NewLaunchProfileMember
newNewLaunchProfileMember LaunchProfilePersona
pPersona_ Text
pPrincipalId_ =
  NewLaunchProfileMember'
    { $sel:persona:NewLaunchProfileMember' :: LaunchProfilePersona
persona = LaunchProfilePersona
pPersona_,
      $sel:principalId:NewLaunchProfileMember' :: Text
principalId = Text
pPrincipalId_
    }

-- | The persona.
newLaunchProfileMember_persona :: Lens.Lens' NewLaunchProfileMember LaunchProfilePersona
newLaunchProfileMember_persona :: Lens' NewLaunchProfileMember LaunchProfilePersona
newLaunchProfileMember_persona = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NewLaunchProfileMember' {LaunchProfilePersona
persona :: LaunchProfilePersona
$sel:persona:NewLaunchProfileMember' :: NewLaunchProfileMember -> LaunchProfilePersona
persona} -> LaunchProfilePersona
persona) (\s :: NewLaunchProfileMember
s@NewLaunchProfileMember' {} LaunchProfilePersona
a -> NewLaunchProfileMember
s {$sel:persona:NewLaunchProfileMember' :: LaunchProfilePersona
persona = LaunchProfilePersona
a} :: NewLaunchProfileMember)

-- | The principal ID.
newLaunchProfileMember_principalId :: Lens.Lens' NewLaunchProfileMember Prelude.Text
newLaunchProfileMember_principalId :: Lens' NewLaunchProfileMember Text
newLaunchProfileMember_principalId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NewLaunchProfileMember' {Text
principalId :: Text
$sel:principalId:NewLaunchProfileMember' :: NewLaunchProfileMember -> Text
principalId} -> Text
principalId) (\s :: NewLaunchProfileMember
s@NewLaunchProfileMember' {} Text
a -> NewLaunchProfileMember
s {$sel:principalId:NewLaunchProfileMember' :: Text
principalId = Text
a} :: NewLaunchProfileMember)

instance Prelude.Hashable NewLaunchProfileMember where
  hashWithSalt :: Int -> NewLaunchProfileMember -> Int
hashWithSalt Int
_salt NewLaunchProfileMember' {Text
LaunchProfilePersona
principalId :: Text
persona :: LaunchProfilePersona
$sel:principalId:NewLaunchProfileMember' :: NewLaunchProfileMember -> Text
$sel:persona:NewLaunchProfileMember' :: NewLaunchProfileMember -> LaunchProfilePersona
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` LaunchProfilePersona
persona
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
principalId

instance Prelude.NFData NewLaunchProfileMember where
  rnf :: NewLaunchProfileMember -> ()
rnf NewLaunchProfileMember' {Text
LaunchProfilePersona
principalId :: Text
persona :: LaunchProfilePersona
$sel:principalId:NewLaunchProfileMember' :: NewLaunchProfileMember -> Text
$sel:persona:NewLaunchProfileMember' :: NewLaunchProfileMember -> LaunchProfilePersona
..} =
    forall a. NFData a => a -> ()
Prelude.rnf LaunchProfilePersona
persona
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
principalId

instance Data.ToJSON NewLaunchProfileMember where
  toJSON :: NewLaunchProfileMember -> Value
toJSON NewLaunchProfileMember' {Text
LaunchProfilePersona
principalId :: Text
persona :: LaunchProfilePersona
$sel:principalId:NewLaunchProfileMember' :: NewLaunchProfileMember -> Text
$sel:persona:NewLaunchProfileMember' :: NewLaunchProfileMember -> LaunchProfilePersona
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ forall a. a -> Maybe a
Prelude.Just (Key
"persona" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= LaunchProfilePersona
persona),
            forall a. a -> Maybe a
Prelude.Just (Key
"principalId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
principalId)
          ]
      )