{-# 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.EFS.Types.CreationInfo where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data CreationInfo = CreationInfo'
{
CreationInfo -> Natural
ownerUid :: Prelude.Natural,
CreationInfo -> Natural
ownerGid :: Prelude.Natural,
CreationInfo -> Text
permissions :: Prelude.Text
}
deriving (CreationInfo -> CreationInfo -> Bool
(CreationInfo -> CreationInfo -> Bool)
-> (CreationInfo -> CreationInfo -> Bool) -> Eq CreationInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreationInfo -> CreationInfo -> Bool
$c/= :: CreationInfo -> CreationInfo -> Bool
== :: CreationInfo -> CreationInfo -> Bool
$c== :: CreationInfo -> CreationInfo -> Bool
Prelude.Eq, ReadPrec [CreationInfo]
ReadPrec CreationInfo
Int -> ReadS CreationInfo
ReadS [CreationInfo]
(Int -> ReadS CreationInfo)
-> ReadS [CreationInfo]
-> ReadPrec CreationInfo
-> ReadPrec [CreationInfo]
-> Read CreationInfo
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreationInfo]
$creadListPrec :: ReadPrec [CreationInfo]
readPrec :: ReadPrec CreationInfo
$creadPrec :: ReadPrec CreationInfo
readList :: ReadS [CreationInfo]
$creadList :: ReadS [CreationInfo]
readsPrec :: Int -> ReadS CreationInfo
$creadsPrec :: Int -> ReadS CreationInfo
Prelude.Read, Int -> CreationInfo -> ShowS
[CreationInfo] -> ShowS
CreationInfo -> String
(Int -> CreationInfo -> ShowS)
-> (CreationInfo -> String)
-> ([CreationInfo] -> ShowS)
-> Show CreationInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreationInfo] -> ShowS
$cshowList :: [CreationInfo] -> ShowS
show :: CreationInfo -> String
$cshow :: CreationInfo -> String
showsPrec :: Int -> CreationInfo -> ShowS
$cshowsPrec :: Int -> CreationInfo -> ShowS
Prelude.Show, (forall x. CreationInfo -> Rep CreationInfo x)
-> (forall x. Rep CreationInfo x -> CreationInfo)
-> Generic CreationInfo
forall x. Rep CreationInfo x -> CreationInfo
forall x. CreationInfo -> Rep CreationInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreationInfo x -> CreationInfo
$cfrom :: forall x. CreationInfo -> Rep CreationInfo x
Prelude.Generic)
newCreationInfo ::
Prelude.Natural ->
Prelude.Natural ->
Prelude.Text ->
CreationInfo
newCreationInfo :: Natural -> Natural -> Text -> CreationInfo
newCreationInfo Natural
pOwnerUid_ Natural
pOwnerGid_ Text
pPermissions_ =
CreationInfo' :: Natural -> Natural -> Text -> CreationInfo
CreationInfo'
{ $sel:ownerUid:CreationInfo' :: Natural
ownerUid = Natural
pOwnerUid_,
$sel:ownerGid:CreationInfo' :: Natural
ownerGid = Natural
pOwnerGid_,
$sel:permissions:CreationInfo' :: Text
permissions = Text
pPermissions_
}
creationInfo_ownerUid :: Lens.Lens' CreationInfo Prelude.Natural
creationInfo_ownerUid :: (Natural -> f Natural) -> CreationInfo -> f CreationInfo
creationInfo_ownerUid = (CreationInfo -> Natural)
-> (CreationInfo -> Natural -> CreationInfo)
-> Lens CreationInfo CreationInfo Natural Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreationInfo' {Natural
ownerUid :: Natural
$sel:ownerUid:CreationInfo' :: CreationInfo -> Natural
ownerUid} -> Natural
ownerUid) (\s :: CreationInfo
s@CreationInfo' {} Natural
a -> CreationInfo
s {$sel:ownerUid:CreationInfo' :: Natural
ownerUid = Natural
a} :: CreationInfo)
creationInfo_ownerGid :: Lens.Lens' CreationInfo Prelude.Natural
creationInfo_ownerGid :: (Natural -> f Natural) -> CreationInfo -> f CreationInfo
creationInfo_ownerGid = (CreationInfo -> Natural)
-> (CreationInfo -> Natural -> CreationInfo)
-> Lens CreationInfo CreationInfo Natural Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreationInfo' {Natural
ownerGid :: Natural
$sel:ownerGid:CreationInfo' :: CreationInfo -> Natural
ownerGid} -> Natural
ownerGid) (\s :: CreationInfo
s@CreationInfo' {} Natural
a -> CreationInfo
s {$sel:ownerGid:CreationInfo' :: Natural
ownerGid = Natural
a} :: CreationInfo)
creationInfo_permissions :: Lens.Lens' CreationInfo Prelude.Text
creationInfo_permissions :: (Text -> f Text) -> CreationInfo -> f CreationInfo
creationInfo_permissions = (CreationInfo -> Text)
-> (CreationInfo -> Text -> CreationInfo)
-> Lens CreationInfo CreationInfo Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreationInfo' {Text
permissions :: Text
$sel:permissions:CreationInfo' :: CreationInfo -> Text
permissions} -> Text
permissions) (\s :: CreationInfo
s@CreationInfo' {} Text
a -> CreationInfo
s {$sel:permissions:CreationInfo' :: Text
permissions = Text
a} :: CreationInfo)
instance Core.FromJSON CreationInfo where
parseJSON :: Value -> Parser CreationInfo
parseJSON =
String
-> (Object -> Parser CreationInfo) -> Value -> Parser CreationInfo
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"CreationInfo"
( \Object
x ->
Natural -> Natural -> Text -> CreationInfo
CreationInfo'
(Natural -> Natural -> Text -> CreationInfo)
-> Parser Natural -> Parser (Natural -> Text -> CreationInfo)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Natural
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"OwnerUid")
Parser (Natural -> Text -> CreationInfo)
-> Parser Natural -> Parser (Text -> CreationInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Natural
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"OwnerGid")
Parser (Text -> CreationInfo) -> Parser Text -> Parser CreationInfo
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
"Permissions")
)
instance Prelude.Hashable CreationInfo
instance Prelude.NFData CreationInfo
instance Core.ToJSON CreationInfo where
toJSON :: CreationInfo -> Value
toJSON CreationInfo' {Natural
Text
permissions :: Text
ownerGid :: Natural
ownerUid :: Natural
$sel:permissions:CreationInfo' :: CreationInfo -> Text
$sel:ownerGid:CreationInfo' :: CreationInfo -> Natural
$sel:ownerUid:CreationInfo' :: CreationInfo -> Natural
..} =
[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
"OwnerUid" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Natural
ownerUid),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"OwnerGid" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Natural
ownerGid),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Permissions" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
permissions)
]
)