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

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

-- |
--
-- /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
(NewLaunchProfileMember -> NewLaunchProfileMember -> Bool)
-> (NewLaunchProfileMember -> NewLaunchProfileMember -> Bool)
-> Eq NewLaunchProfileMember
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]
(Int -> ReadS NewLaunchProfileMember)
-> ReadS [NewLaunchProfileMember]
-> ReadPrec NewLaunchProfileMember
-> ReadPrec [NewLaunchProfileMember]
-> Read 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
(Int -> NewLaunchProfileMember -> ShowS)
-> (NewLaunchProfileMember -> String)
-> ([NewLaunchProfileMember] -> ShowS)
-> Show NewLaunchProfileMember
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. NewLaunchProfileMember -> Rep NewLaunchProfileMember x)
-> (forall x.
    Rep NewLaunchProfileMember x -> NewLaunchProfileMember)
-> Generic NewLaunchProfileMember
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' :: LaunchProfilePersona -> Text -> NewLaunchProfileMember
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 :: (LaunchProfilePersona -> f LaunchProfilePersona)
-> NewLaunchProfileMember -> f NewLaunchProfileMember
newLaunchProfileMember_persona = (NewLaunchProfileMember -> LaunchProfilePersona)
-> (NewLaunchProfileMember
    -> LaunchProfilePersona -> NewLaunchProfileMember)
-> Lens
     NewLaunchProfileMember
     NewLaunchProfileMember
     LaunchProfilePersona
     LaunchProfilePersona
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 :: (Text -> f Text)
-> NewLaunchProfileMember -> f NewLaunchProfileMember
newLaunchProfileMember_principalId = (NewLaunchProfileMember -> Text)
-> (NewLaunchProfileMember -> Text -> NewLaunchProfileMember)
-> Lens NewLaunchProfileMember NewLaunchProfileMember Text Text
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

instance Prelude.NFData NewLaunchProfileMember

instance Core.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
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"persona" Text -> LaunchProfilePersona -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= LaunchProfilePersona
persona),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"principalId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
principalId)
          ]
      )