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