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