{-# 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.LaunchProfileMembership
-- 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.LaunchProfileMembership 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:/ 'newLaunchProfileMembership' smart constructor.
data LaunchProfileMembership = LaunchProfileMembership'
  { -- | The ID of the identity store.
    LaunchProfileMembership -> Maybe Text
identityStoreId :: Prelude.Maybe Prelude.Text,
    -- | The principal ID.
    LaunchProfileMembership -> Maybe Text
principalId :: Prelude.Maybe Prelude.Text,
    -- | The persona.
    LaunchProfileMembership -> Maybe LaunchProfilePersona
persona :: Prelude.Maybe LaunchProfilePersona
  }
  deriving (LaunchProfileMembership -> LaunchProfileMembership -> Bool
(LaunchProfileMembership -> LaunchProfileMembership -> Bool)
-> (LaunchProfileMembership -> LaunchProfileMembership -> Bool)
-> Eq LaunchProfileMembership
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LaunchProfileMembership -> LaunchProfileMembership -> Bool
$c/= :: LaunchProfileMembership -> LaunchProfileMembership -> Bool
== :: LaunchProfileMembership -> LaunchProfileMembership -> Bool
$c== :: LaunchProfileMembership -> LaunchProfileMembership -> Bool
Prelude.Eq, ReadPrec [LaunchProfileMembership]
ReadPrec LaunchProfileMembership
Int -> ReadS LaunchProfileMembership
ReadS [LaunchProfileMembership]
(Int -> ReadS LaunchProfileMembership)
-> ReadS [LaunchProfileMembership]
-> ReadPrec LaunchProfileMembership
-> ReadPrec [LaunchProfileMembership]
-> Read LaunchProfileMembership
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LaunchProfileMembership]
$creadListPrec :: ReadPrec [LaunchProfileMembership]
readPrec :: ReadPrec LaunchProfileMembership
$creadPrec :: ReadPrec LaunchProfileMembership
readList :: ReadS [LaunchProfileMembership]
$creadList :: ReadS [LaunchProfileMembership]
readsPrec :: Int -> ReadS LaunchProfileMembership
$creadsPrec :: Int -> ReadS LaunchProfileMembership
Prelude.Read, Int -> LaunchProfileMembership -> ShowS
[LaunchProfileMembership] -> ShowS
LaunchProfileMembership -> String
(Int -> LaunchProfileMembership -> ShowS)
-> (LaunchProfileMembership -> String)
-> ([LaunchProfileMembership] -> ShowS)
-> Show LaunchProfileMembership
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LaunchProfileMembership] -> ShowS
$cshowList :: [LaunchProfileMembership] -> ShowS
show :: LaunchProfileMembership -> String
$cshow :: LaunchProfileMembership -> String
showsPrec :: Int -> LaunchProfileMembership -> ShowS
$cshowsPrec :: Int -> LaunchProfileMembership -> ShowS
Prelude.Show, (forall x.
 LaunchProfileMembership -> Rep LaunchProfileMembership x)
-> (forall x.
    Rep LaunchProfileMembership x -> LaunchProfileMembership)
-> Generic LaunchProfileMembership
forall x. Rep LaunchProfileMembership x -> LaunchProfileMembership
forall x. LaunchProfileMembership -> Rep LaunchProfileMembership x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LaunchProfileMembership x -> LaunchProfileMembership
$cfrom :: forall x. LaunchProfileMembership -> Rep LaunchProfileMembership x
Prelude.Generic)

-- |
-- Create a value of 'LaunchProfileMembership' 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:
--
-- 'identityStoreId', 'launchProfileMembership_identityStoreId' - The ID of the identity store.
--
-- 'principalId', 'launchProfileMembership_principalId' - The principal ID.
--
-- 'persona', 'launchProfileMembership_persona' - The persona.
newLaunchProfileMembership ::
  LaunchProfileMembership
newLaunchProfileMembership :: LaunchProfileMembership
newLaunchProfileMembership =
  LaunchProfileMembership' :: Maybe Text
-> Maybe Text
-> Maybe LaunchProfilePersona
-> LaunchProfileMembership
LaunchProfileMembership'
    { $sel:identityStoreId:LaunchProfileMembership' :: Maybe Text
identityStoreId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:principalId:LaunchProfileMembership' :: Maybe Text
principalId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:persona:LaunchProfileMembership' :: Maybe LaunchProfilePersona
persona = Maybe LaunchProfilePersona
forall a. Maybe a
Prelude.Nothing
    }

-- | The ID of the identity store.
launchProfileMembership_identityStoreId :: Lens.Lens' LaunchProfileMembership (Prelude.Maybe Prelude.Text)
launchProfileMembership_identityStoreId :: (Maybe Text -> f (Maybe Text))
-> LaunchProfileMembership -> f LaunchProfileMembership
launchProfileMembership_identityStoreId = (LaunchProfileMembership -> Maybe Text)
-> (LaunchProfileMembership
    -> Maybe Text -> LaunchProfileMembership)
-> Lens
     LaunchProfileMembership
     LaunchProfileMembership
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LaunchProfileMembership' {Maybe Text
identityStoreId :: Maybe Text
$sel:identityStoreId:LaunchProfileMembership' :: LaunchProfileMembership -> Maybe Text
identityStoreId} -> Maybe Text
identityStoreId) (\s :: LaunchProfileMembership
s@LaunchProfileMembership' {} Maybe Text
a -> LaunchProfileMembership
s {$sel:identityStoreId:LaunchProfileMembership' :: Maybe Text
identityStoreId = Maybe Text
a} :: LaunchProfileMembership)

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

-- | The persona.
launchProfileMembership_persona :: Lens.Lens' LaunchProfileMembership (Prelude.Maybe LaunchProfilePersona)
launchProfileMembership_persona :: (Maybe LaunchProfilePersona -> f (Maybe LaunchProfilePersona))
-> LaunchProfileMembership -> f LaunchProfileMembership
launchProfileMembership_persona = (LaunchProfileMembership -> Maybe LaunchProfilePersona)
-> (LaunchProfileMembership
    -> Maybe LaunchProfilePersona -> LaunchProfileMembership)
-> Lens
     LaunchProfileMembership
     LaunchProfileMembership
     (Maybe LaunchProfilePersona)
     (Maybe LaunchProfilePersona)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LaunchProfileMembership' {Maybe LaunchProfilePersona
persona :: Maybe LaunchProfilePersona
$sel:persona:LaunchProfileMembership' :: LaunchProfileMembership -> Maybe LaunchProfilePersona
persona} -> Maybe LaunchProfilePersona
persona) (\s :: LaunchProfileMembership
s@LaunchProfileMembership' {} Maybe LaunchProfilePersona
a -> LaunchProfileMembership
s {$sel:persona:LaunchProfileMembership' :: Maybe LaunchProfilePersona
persona = Maybe LaunchProfilePersona
a} :: LaunchProfileMembership)

instance Core.FromJSON LaunchProfileMembership where
  parseJSON :: Value -> Parser LaunchProfileMembership
parseJSON =
    String
-> (Object -> Parser LaunchProfileMembership)
-> Value
-> Parser LaunchProfileMembership
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"LaunchProfileMembership"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe LaunchProfilePersona
-> LaunchProfileMembership
LaunchProfileMembership'
            (Maybe Text
 -> Maybe Text
 -> Maybe LaunchProfilePersona
 -> LaunchProfileMembership)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe LaunchProfilePersona -> LaunchProfileMembership)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"identityStoreId")
            Parser
  (Maybe Text
   -> Maybe LaunchProfilePersona -> LaunchProfileMembership)
-> Parser (Maybe Text)
-> Parser (Maybe LaunchProfilePersona -> LaunchProfileMembership)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"principalId")
            Parser (Maybe LaunchProfilePersona -> LaunchProfileMembership)
-> Parser (Maybe LaunchProfilePersona)
-> Parser LaunchProfileMembership
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe LaunchProfilePersona)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"persona")
      )

instance Prelude.Hashable LaunchProfileMembership

instance Prelude.NFData LaunchProfileMembership