{-# 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 qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.ECS.Types.EFSAuthorizationConfigIAM
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
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]
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
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. 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'
{ $sel:accessPointId:EFSAuthorizationConfig' :: Maybe Text
accessPointId =
forall a. Maybe a
Prelude.Nothing,
$sel:iam:EFSAuthorizationConfig' :: Maybe EFSAuthorizationConfigIAM
iam = forall a. Maybe a
Prelude.Nothing
}
eFSAuthorizationConfig_accessPointId :: Lens.Lens' EFSAuthorizationConfig (Prelude.Maybe Prelude.Text)
eFSAuthorizationConfig_accessPointId :: Lens' EFSAuthorizationConfig (Maybe Text)
eFSAuthorizationConfig_accessPointId = 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 :: Lens' EFSAuthorizationConfig (Maybe EFSAuthorizationConfigIAM)
eFSAuthorizationConfig_iam = 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 Data.FromJSON EFSAuthorizationConfig where
parseJSON :: Value -> Parser EFSAuthorizationConfig
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"EFSAuthorizationConfig"
( \Object
x ->
Maybe Text
-> Maybe EFSAuthorizationConfigIAM -> EFSAuthorizationConfig
EFSAuthorizationConfig'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"accessPointId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"iam")
)
instance Prelude.Hashable EFSAuthorizationConfig where
hashWithSalt :: Int -> EFSAuthorizationConfig -> Int
hashWithSalt Int
_salt EFSAuthorizationConfig' {Maybe Text
Maybe EFSAuthorizationConfigIAM
iam :: Maybe EFSAuthorizationConfigIAM
accessPointId :: Maybe Text
$sel:iam:EFSAuthorizationConfig' :: EFSAuthorizationConfig -> Maybe EFSAuthorizationConfigIAM
$sel:accessPointId:EFSAuthorizationConfig' :: EFSAuthorizationConfig -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
accessPointId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe EFSAuthorizationConfigIAM
iam
instance Prelude.NFData EFSAuthorizationConfig where
rnf :: EFSAuthorizationConfig -> ()
rnf EFSAuthorizationConfig' {Maybe Text
Maybe EFSAuthorizationConfigIAM
iam :: Maybe EFSAuthorizationConfigIAM
accessPointId :: Maybe Text
$sel:iam:EFSAuthorizationConfig' :: EFSAuthorizationConfig -> Maybe EFSAuthorizationConfigIAM
$sel:accessPointId:EFSAuthorizationConfig' :: EFSAuthorizationConfig -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
accessPointId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe EFSAuthorizationConfigIAM
iam
instance Data.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
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"accessPointId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
accessPointId,
(Key
"iam" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe EFSAuthorizationConfigIAM
iam
]
)