{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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. 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'
{ $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 :: Lens' CreationInfo Natural
creationInfo_ownerUid = 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 :: Lens' CreationInfo Natural
creationInfo_ownerGid = 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 :: Lens' CreationInfo Text
creationInfo_permissions = 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 Data.FromJSON CreationInfo where
parseJSON :: Value -> Parser CreationInfo
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"CreationInfo"
( \Object
x ->
Natural -> Natural -> Text -> CreationInfo
CreationInfo'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"OwnerUid")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"OwnerGid")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Permissions")
)
instance Prelude.Hashable CreationInfo where
hashWithSalt :: Int -> CreationInfo -> Int
hashWithSalt Int
_salt CreationInfo' {Natural
Text
permissions :: Text
ownerGid :: Natural
ownerUid :: Natural
$sel:permissions:CreationInfo' :: CreationInfo -> Text
$sel:ownerGid:CreationInfo' :: CreationInfo -> Natural
$sel:ownerUid:CreationInfo' :: CreationInfo -> Natural
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
ownerUid
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
ownerGid
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
permissions
instance Prelude.NFData CreationInfo where
rnf :: CreationInfo -> ()
rnf CreationInfo' {Natural
Text
permissions :: Text
ownerGid :: Natural
ownerUid :: Natural
$sel:permissions:CreationInfo' :: CreationInfo -> Text
$sel:ownerGid:CreationInfo' :: CreationInfo -> Natural
$sel:ownerUid:CreationInfo' :: CreationInfo -> Natural
..} =
forall a. NFData a => a -> ()
Prelude.rnf Natural
ownerUid
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Natural
ownerGid
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
permissions
instance Data.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
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"OwnerUid" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Natural
ownerUid),
forall a. a -> Maybe a
Prelude.Just (Key
"OwnerGid" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Natural
ownerGid),
forall a. a -> Maybe a
Prelude.Just (Key
"Permissions" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
permissions)
]
)