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