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