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