{-# 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 #-}
module Amazonka.EKS.Types.IdentityProviderConfig where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data IdentityProviderConfig = IdentityProviderConfig'
{
IdentityProviderConfig -> Text
type' :: Prelude.Text,
IdentityProviderConfig -> Text
name :: Prelude.Text
}
deriving (IdentityProviderConfig -> IdentityProviderConfig -> Bool
(IdentityProviderConfig -> IdentityProviderConfig -> Bool)
-> (IdentityProviderConfig -> IdentityProviderConfig -> Bool)
-> Eq IdentityProviderConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: IdentityProviderConfig -> IdentityProviderConfig -> Bool
$c/= :: IdentityProviderConfig -> IdentityProviderConfig -> Bool
== :: IdentityProviderConfig -> IdentityProviderConfig -> Bool
$c== :: IdentityProviderConfig -> IdentityProviderConfig -> Bool
Prelude.Eq, ReadPrec [IdentityProviderConfig]
ReadPrec IdentityProviderConfig
Int -> ReadS IdentityProviderConfig
ReadS [IdentityProviderConfig]
(Int -> ReadS IdentityProviderConfig)
-> ReadS [IdentityProviderConfig]
-> ReadPrec IdentityProviderConfig
-> ReadPrec [IdentityProviderConfig]
-> Read IdentityProviderConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [IdentityProviderConfig]
$creadListPrec :: ReadPrec [IdentityProviderConfig]
readPrec :: ReadPrec IdentityProviderConfig
$creadPrec :: ReadPrec IdentityProviderConfig
readList :: ReadS [IdentityProviderConfig]
$creadList :: ReadS [IdentityProviderConfig]
readsPrec :: Int -> ReadS IdentityProviderConfig
$creadsPrec :: Int -> ReadS IdentityProviderConfig
Prelude.Read, Int -> IdentityProviderConfig -> ShowS
[IdentityProviderConfig] -> ShowS
IdentityProviderConfig -> String
(Int -> IdentityProviderConfig -> ShowS)
-> (IdentityProviderConfig -> String)
-> ([IdentityProviderConfig] -> ShowS)
-> Show IdentityProviderConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [IdentityProviderConfig] -> ShowS
$cshowList :: [IdentityProviderConfig] -> ShowS
show :: IdentityProviderConfig -> String
$cshow :: IdentityProviderConfig -> String
showsPrec :: Int -> IdentityProviderConfig -> ShowS
$cshowsPrec :: Int -> IdentityProviderConfig -> ShowS
Prelude.Show, (forall x. IdentityProviderConfig -> Rep IdentityProviderConfig x)
-> (forall x.
Rep IdentityProviderConfig x -> IdentityProviderConfig)
-> Generic IdentityProviderConfig
forall x. Rep IdentityProviderConfig x -> IdentityProviderConfig
forall x. IdentityProviderConfig -> Rep IdentityProviderConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep IdentityProviderConfig x -> IdentityProviderConfig
$cfrom :: forall x. IdentityProviderConfig -> Rep IdentityProviderConfig x
Prelude.Generic)
newIdentityProviderConfig ::
Prelude.Text ->
Prelude.Text ->
IdentityProviderConfig
newIdentityProviderConfig :: Text -> Text -> IdentityProviderConfig
newIdentityProviderConfig Text
pType_ Text
pName_ =
IdentityProviderConfig' :: Text -> Text -> IdentityProviderConfig
IdentityProviderConfig'
{ $sel:type':IdentityProviderConfig' :: Text
type' = Text
pType_,
$sel:name:IdentityProviderConfig' :: Text
name = Text
pName_
}
identityProviderConfig_type :: Lens.Lens' IdentityProviderConfig Prelude.Text
identityProviderConfig_type :: (Text -> f Text)
-> IdentityProviderConfig -> f IdentityProviderConfig
identityProviderConfig_type = (IdentityProviderConfig -> Text)
-> (IdentityProviderConfig -> Text -> IdentityProviderConfig)
-> Lens IdentityProviderConfig IdentityProviderConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IdentityProviderConfig' {Text
type' :: Text
$sel:type':IdentityProviderConfig' :: IdentityProviderConfig -> Text
type'} -> Text
type') (\s :: IdentityProviderConfig
s@IdentityProviderConfig' {} Text
a -> IdentityProviderConfig
s {$sel:type':IdentityProviderConfig' :: Text
type' = Text
a} :: IdentityProviderConfig)
identityProviderConfig_name :: Lens.Lens' IdentityProviderConfig Prelude.Text
identityProviderConfig_name :: (Text -> f Text)
-> IdentityProviderConfig -> f IdentityProviderConfig
identityProviderConfig_name = (IdentityProviderConfig -> Text)
-> (IdentityProviderConfig -> Text -> IdentityProviderConfig)
-> Lens IdentityProviderConfig IdentityProviderConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IdentityProviderConfig' {Text
name :: Text
$sel:name:IdentityProviderConfig' :: IdentityProviderConfig -> Text
name} -> Text
name) (\s :: IdentityProviderConfig
s@IdentityProviderConfig' {} Text
a -> IdentityProviderConfig
s {$sel:name:IdentityProviderConfig' :: Text
name = Text
a} :: IdentityProviderConfig)
instance Core.FromJSON IdentityProviderConfig where
parseJSON :: Value -> Parser IdentityProviderConfig
parseJSON =
String
-> (Object -> Parser IdentityProviderConfig)
-> Value
-> Parser IdentityProviderConfig
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"IdentityProviderConfig"
( \Object
x ->
Text -> Text -> IdentityProviderConfig
IdentityProviderConfig'
(Text -> Text -> IdentityProviderConfig)
-> Parser Text -> Parser (Text -> IdentityProviderConfig)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"type") Parser (Text -> IdentityProviderConfig)
-> Parser Text -> Parser IdentityProviderConfig
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"name")
)
instance Prelude.Hashable IdentityProviderConfig
instance Prelude.NFData IdentityProviderConfig
instance Core.ToJSON IdentityProviderConfig where
toJSON :: IdentityProviderConfig -> Value
toJSON IdentityProviderConfig' {Text
name :: Text
type' :: Text
$sel:name:IdentityProviderConfig' :: IdentityProviderConfig -> Text
$sel:type':IdentityProviderConfig' :: IdentityProviderConfig -> Text
..} =
[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
"type" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
type'),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name)
]
)