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