{-# 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.QopConfiguration 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.HdfsDataTransferProtection
import Amazonka.DataSync.Types.HdfsRpcProtection
import qualified Amazonka.Prelude as Prelude
data QopConfiguration = QopConfiguration'
{
QopConfiguration -> Maybe HdfsDataTransferProtection
dataTransferProtection :: Prelude.Maybe HdfsDataTransferProtection,
QopConfiguration -> Maybe HdfsRpcProtection
rpcProtection :: Prelude.Maybe HdfsRpcProtection
}
deriving (QopConfiguration -> QopConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: QopConfiguration -> QopConfiguration -> Bool
$c/= :: QopConfiguration -> QopConfiguration -> Bool
== :: QopConfiguration -> QopConfiguration -> Bool
$c== :: QopConfiguration -> QopConfiguration -> Bool
Prelude.Eq, ReadPrec [QopConfiguration]
ReadPrec QopConfiguration
Int -> ReadS QopConfiguration
ReadS [QopConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [QopConfiguration]
$creadListPrec :: ReadPrec [QopConfiguration]
readPrec :: ReadPrec QopConfiguration
$creadPrec :: ReadPrec QopConfiguration
readList :: ReadS [QopConfiguration]
$creadList :: ReadS [QopConfiguration]
readsPrec :: Int -> ReadS QopConfiguration
$creadsPrec :: Int -> ReadS QopConfiguration
Prelude.Read, Int -> QopConfiguration -> ShowS
[QopConfiguration] -> ShowS
QopConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [QopConfiguration] -> ShowS
$cshowList :: [QopConfiguration] -> ShowS
show :: QopConfiguration -> String
$cshow :: QopConfiguration -> String
showsPrec :: Int -> QopConfiguration -> ShowS
$cshowsPrec :: Int -> QopConfiguration -> ShowS
Prelude.Show, forall x. Rep QopConfiguration x -> QopConfiguration
forall x. QopConfiguration -> Rep QopConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep QopConfiguration x -> QopConfiguration
$cfrom :: forall x. QopConfiguration -> Rep QopConfiguration x
Prelude.Generic)
newQopConfiguration ::
QopConfiguration
newQopConfiguration :: QopConfiguration
newQopConfiguration =
QopConfiguration'
{ $sel:dataTransferProtection:QopConfiguration' :: Maybe HdfsDataTransferProtection
dataTransferProtection =
forall a. Maybe a
Prelude.Nothing,
$sel:rpcProtection:QopConfiguration' :: Maybe HdfsRpcProtection
rpcProtection = forall a. Maybe a
Prelude.Nothing
}
qopConfiguration_dataTransferProtection :: Lens.Lens' QopConfiguration (Prelude.Maybe HdfsDataTransferProtection)
qopConfiguration_dataTransferProtection :: Lens' QopConfiguration (Maybe HdfsDataTransferProtection)
qopConfiguration_dataTransferProtection = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\QopConfiguration' {Maybe HdfsDataTransferProtection
dataTransferProtection :: Maybe HdfsDataTransferProtection
$sel:dataTransferProtection:QopConfiguration' :: QopConfiguration -> Maybe HdfsDataTransferProtection
dataTransferProtection} -> Maybe HdfsDataTransferProtection
dataTransferProtection) (\s :: QopConfiguration
s@QopConfiguration' {} Maybe HdfsDataTransferProtection
a -> QopConfiguration
s {$sel:dataTransferProtection:QopConfiguration' :: Maybe HdfsDataTransferProtection
dataTransferProtection = Maybe HdfsDataTransferProtection
a} :: QopConfiguration)
qopConfiguration_rpcProtection :: Lens.Lens' QopConfiguration (Prelude.Maybe HdfsRpcProtection)
qopConfiguration_rpcProtection :: Lens' QopConfiguration (Maybe HdfsRpcProtection)
qopConfiguration_rpcProtection = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\QopConfiguration' {Maybe HdfsRpcProtection
rpcProtection :: Maybe HdfsRpcProtection
$sel:rpcProtection:QopConfiguration' :: QopConfiguration -> Maybe HdfsRpcProtection
rpcProtection} -> Maybe HdfsRpcProtection
rpcProtection) (\s :: QopConfiguration
s@QopConfiguration' {} Maybe HdfsRpcProtection
a -> QopConfiguration
s {$sel:rpcProtection:QopConfiguration' :: Maybe HdfsRpcProtection
rpcProtection = Maybe HdfsRpcProtection
a} :: QopConfiguration)
instance Data.FromJSON QopConfiguration where
parseJSON :: Value -> Parser QopConfiguration
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"QopConfiguration"
( \Object
x ->
Maybe HdfsDataTransferProtection
-> Maybe HdfsRpcProtection -> QopConfiguration
QopConfiguration'
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
"DataTransferProtection")
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
"RpcProtection")
)
instance Prelude.Hashable QopConfiguration where
hashWithSalt :: Int -> QopConfiguration -> Int
hashWithSalt Int
_salt QopConfiguration' {Maybe HdfsDataTransferProtection
Maybe HdfsRpcProtection
rpcProtection :: Maybe HdfsRpcProtection
dataTransferProtection :: Maybe HdfsDataTransferProtection
$sel:rpcProtection:QopConfiguration' :: QopConfiguration -> Maybe HdfsRpcProtection
$sel:dataTransferProtection:QopConfiguration' :: QopConfiguration -> Maybe HdfsDataTransferProtection
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe HdfsDataTransferProtection
dataTransferProtection
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe HdfsRpcProtection
rpcProtection
instance Prelude.NFData QopConfiguration where
rnf :: QopConfiguration -> ()
rnf QopConfiguration' {Maybe HdfsDataTransferProtection
Maybe HdfsRpcProtection
rpcProtection :: Maybe HdfsRpcProtection
dataTransferProtection :: Maybe HdfsDataTransferProtection
$sel:rpcProtection:QopConfiguration' :: QopConfiguration -> Maybe HdfsRpcProtection
$sel:dataTransferProtection:QopConfiguration' :: QopConfiguration -> Maybe HdfsDataTransferProtection
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe HdfsDataTransferProtection
dataTransferProtection
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe HdfsRpcProtection
rpcProtection
instance Data.ToJSON QopConfiguration where
toJSON :: QopConfiguration -> Value
toJSON QopConfiguration' {Maybe HdfsDataTransferProtection
Maybe HdfsRpcProtection
rpcProtection :: Maybe HdfsRpcProtection
dataTransferProtection :: Maybe HdfsDataTransferProtection
$sel:rpcProtection:QopConfiguration' :: QopConfiguration -> Maybe HdfsRpcProtection
$sel:dataTransferProtection:QopConfiguration' :: QopConfiguration -> Maybe HdfsDataTransferProtection
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"DataTransferProtection" 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 HdfsDataTransferProtection
dataTransferProtection,
(Key
"RpcProtection" 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 HdfsRpcProtection
rpcProtection
]
)