{-# 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.FsxProtocolSmb where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.DataSync.Types.SmbMountOptions
import qualified Amazonka.Prelude as Prelude
data FsxProtocolSmb = FsxProtocolSmb'
{
FsxProtocolSmb -> Maybe Text
domain :: Prelude.Maybe Prelude.Text,
FsxProtocolSmb -> Maybe SmbMountOptions
mountOptions :: Prelude.Maybe SmbMountOptions,
FsxProtocolSmb -> Sensitive Text
password :: Data.Sensitive Prelude.Text,
FsxProtocolSmb -> Text
user :: Prelude.Text
}
deriving (FsxProtocolSmb -> FsxProtocolSmb -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FsxProtocolSmb -> FsxProtocolSmb -> Bool
$c/= :: FsxProtocolSmb -> FsxProtocolSmb -> Bool
== :: FsxProtocolSmb -> FsxProtocolSmb -> Bool
$c== :: FsxProtocolSmb -> FsxProtocolSmb -> Bool
Prelude.Eq, Int -> FsxProtocolSmb -> ShowS
[FsxProtocolSmb] -> ShowS
FsxProtocolSmb -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FsxProtocolSmb] -> ShowS
$cshowList :: [FsxProtocolSmb] -> ShowS
show :: FsxProtocolSmb -> String
$cshow :: FsxProtocolSmb -> String
showsPrec :: Int -> FsxProtocolSmb -> ShowS
$cshowsPrec :: Int -> FsxProtocolSmb -> ShowS
Prelude.Show, forall x. Rep FsxProtocolSmb x -> FsxProtocolSmb
forall x. FsxProtocolSmb -> Rep FsxProtocolSmb x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FsxProtocolSmb x -> FsxProtocolSmb
$cfrom :: forall x. FsxProtocolSmb -> Rep FsxProtocolSmb x
Prelude.Generic)
newFsxProtocolSmb ::
Prelude.Text ->
Prelude.Text ->
FsxProtocolSmb
newFsxProtocolSmb :: Text -> Text -> FsxProtocolSmb
newFsxProtocolSmb Text
pPassword_ Text
pUser_ =
FsxProtocolSmb'
{ $sel:domain:FsxProtocolSmb' :: Maybe Text
domain = forall a. Maybe a
Prelude.Nothing,
$sel:mountOptions:FsxProtocolSmb' :: Maybe SmbMountOptions
mountOptions = forall a. Maybe a
Prelude.Nothing,
$sel:password:FsxProtocolSmb' :: Sensitive Text
password = forall a. Iso' (Sensitive a) a
Data._Sensitive forall t b. AReview t b -> b -> t
Lens.# Text
pPassword_,
$sel:user:FsxProtocolSmb' :: Text
user = Text
pUser_
}
fsxProtocolSmb_domain :: Lens.Lens' FsxProtocolSmb (Prelude.Maybe Prelude.Text)
fsxProtocolSmb_domain :: Lens' FsxProtocolSmb (Maybe Text)
fsxProtocolSmb_domain = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FsxProtocolSmb' {Maybe Text
domain :: Maybe Text
$sel:domain:FsxProtocolSmb' :: FsxProtocolSmb -> Maybe Text
domain} -> Maybe Text
domain) (\s :: FsxProtocolSmb
s@FsxProtocolSmb' {} Maybe Text
a -> FsxProtocolSmb
s {$sel:domain:FsxProtocolSmb' :: Maybe Text
domain = Maybe Text
a} :: FsxProtocolSmb)
fsxProtocolSmb_mountOptions :: Lens.Lens' FsxProtocolSmb (Prelude.Maybe SmbMountOptions)
fsxProtocolSmb_mountOptions :: Lens' FsxProtocolSmb (Maybe SmbMountOptions)
fsxProtocolSmb_mountOptions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FsxProtocolSmb' {Maybe SmbMountOptions
mountOptions :: Maybe SmbMountOptions
$sel:mountOptions:FsxProtocolSmb' :: FsxProtocolSmb -> Maybe SmbMountOptions
mountOptions} -> Maybe SmbMountOptions
mountOptions) (\s :: FsxProtocolSmb
s@FsxProtocolSmb' {} Maybe SmbMountOptions
a -> FsxProtocolSmb
s {$sel:mountOptions:FsxProtocolSmb' :: Maybe SmbMountOptions
mountOptions = Maybe SmbMountOptions
a} :: FsxProtocolSmb)
fsxProtocolSmb_password :: Lens.Lens' FsxProtocolSmb Prelude.Text
fsxProtocolSmb_password :: Lens' FsxProtocolSmb Text
fsxProtocolSmb_password = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FsxProtocolSmb' {Sensitive Text
password :: Sensitive Text
$sel:password:FsxProtocolSmb' :: FsxProtocolSmb -> Sensitive Text
password} -> Sensitive Text
password) (\s :: FsxProtocolSmb
s@FsxProtocolSmb' {} Sensitive Text
a -> FsxProtocolSmb
s {$sel:password:FsxProtocolSmb' :: Sensitive Text
password = Sensitive Text
a} :: FsxProtocolSmb) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a. Iso' (Sensitive a) a
Data._Sensitive
fsxProtocolSmb_user :: Lens.Lens' FsxProtocolSmb Prelude.Text
fsxProtocolSmb_user :: Lens' FsxProtocolSmb Text
fsxProtocolSmb_user = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FsxProtocolSmb' {Text
user :: Text
$sel:user:FsxProtocolSmb' :: FsxProtocolSmb -> Text
user} -> Text
user) (\s :: FsxProtocolSmb
s@FsxProtocolSmb' {} Text
a -> FsxProtocolSmb
s {$sel:user:FsxProtocolSmb' :: Text
user = Text
a} :: FsxProtocolSmb)
instance Data.FromJSON FsxProtocolSmb where
parseJSON :: Value -> Parser FsxProtocolSmb
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"FsxProtocolSmb"
( \Object
x ->
Maybe Text
-> Maybe SmbMountOptions
-> Sensitive Text
-> Text
-> FsxProtocolSmb
FsxProtocolSmb'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Domain")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"MountOptions")
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
"Password")
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
"User")
)
instance Prelude.Hashable FsxProtocolSmb where
hashWithSalt :: Int -> FsxProtocolSmb -> Int
hashWithSalt Int
_salt FsxProtocolSmb' {Maybe Text
Maybe SmbMountOptions
Text
Sensitive Text
user :: Text
password :: Sensitive Text
mountOptions :: Maybe SmbMountOptions
domain :: Maybe Text
$sel:user:FsxProtocolSmb' :: FsxProtocolSmb -> Text
$sel:password:FsxProtocolSmb' :: FsxProtocolSmb -> Sensitive Text
$sel:mountOptions:FsxProtocolSmb' :: FsxProtocolSmb -> Maybe SmbMountOptions
$sel:domain:FsxProtocolSmb' :: FsxProtocolSmb -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
domain
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SmbMountOptions
mountOptions
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Sensitive Text
password
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
user
instance Prelude.NFData FsxProtocolSmb where
rnf :: FsxProtocolSmb -> ()
rnf FsxProtocolSmb' {Maybe Text
Maybe SmbMountOptions
Text
Sensitive Text
user :: Text
password :: Sensitive Text
mountOptions :: Maybe SmbMountOptions
domain :: Maybe Text
$sel:user:FsxProtocolSmb' :: FsxProtocolSmb -> Text
$sel:password:FsxProtocolSmb' :: FsxProtocolSmb -> Sensitive Text
$sel:mountOptions:FsxProtocolSmb' :: FsxProtocolSmb -> Maybe SmbMountOptions
$sel:domain:FsxProtocolSmb' :: FsxProtocolSmb -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
domain
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe SmbMountOptions
mountOptions
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Sensitive Text
password
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
user
instance Data.ToJSON FsxProtocolSmb where
toJSON :: FsxProtocolSmb -> Value
toJSON FsxProtocolSmb' {Maybe Text
Maybe SmbMountOptions
Text
Sensitive Text
user :: Text
password :: Sensitive Text
mountOptions :: Maybe SmbMountOptions
domain :: Maybe Text
$sel:user:FsxProtocolSmb' :: FsxProtocolSmb -> Text
$sel:password:FsxProtocolSmb' :: FsxProtocolSmb -> Sensitive Text
$sel:mountOptions:FsxProtocolSmb' :: FsxProtocolSmb -> Maybe SmbMountOptions
$sel:domain:FsxProtocolSmb' :: FsxProtocolSmb -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"Domain" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
domain,
(Key
"MountOptions" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SmbMountOptions
mountOptions,
forall a. a -> Maybe a
Prelude.Just (Key
"Password" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Sensitive Text
password),
forall a. a -> Maybe a
Prelude.Just (Key
"User" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
user)
]
)