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