{-# 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.S3Target where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data S3Target = S3Target'
{
S3Target -> Maybe Text
path :: Prelude.Maybe Prelude.Text,
S3Target -> Maybe Int
sampleSize :: Prelude.Maybe Prelude.Int,
S3Target -> Maybe Text
connectionName :: Prelude.Maybe Prelude.Text,
S3Target -> Maybe [Text]
exclusions :: Prelude.Maybe [Prelude.Text],
S3Target -> Maybe Text
eventQueueArn :: Prelude.Maybe Prelude.Text,
S3Target -> Maybe Text
dlqEventQueueArn :: Prelude.Maybe Prelude.Text
}
deriving (S3Target -> S3Target -> Bool
(S3Target -> S3Target -> Bool)
-> (S3Target -> S3Target -> Bool) -> Eq S3Target
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: S3Target -> S3Target -> Bool
$c/= :: S3Target -> S3Target -> Bool
== :: S3Target -> S3Target -> Bool
$c== :: S3Target -> S3Target -> Bool
Prelude.Eq, ReadPrec [S3Target]
ReadPrec S3Target
Int -> ReadS S3Target
ReadS [S3Target]
(Int -> ReadS S3Target)
-> ReadS [S3Target]
-> ReadPrec S3Target
-> ReadPrec [S3Target]
-> Read S3Target
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [S3Target]
$creadListPrec :: ReadPrec [S3Target]
readPrec :: ReadPrec S3Target
$creadPrec :: ReadPrec S3Target
readList :: ReadS [S3Target]
$creadList :: ReadS [S3Target]
readsPrec :: Int -> ReadS S3Target
$creadsPrec :: Int -> ReadS S3Target
Prelude.Read, Int -> S3Target -> ShowS
[S3Target] -> ShowS
S3Target -> String
(Int -> S3Target -> ShowS)
-> (S3Target -> String) -> ([S3Target] -> ShowS) -> Show S3Target
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [S3Target] -> ShowS
$cshowList :: [S3Target] -> ShowS
show :: S3Target -> String
$cshow :: S3Target -> String
showsPrec :: Int -> S3Target -> ShowS
$cshowsPrec :: Int -> S3Target -> ShowS
Prelude.Show, (forall x. S3Target -> Rep S3Target x)
-> (forall x. Rep S3Target x -> S3Target) -> Generic S3Target
forall x. Rep S3Target x -> S3Target
forall x. S3Target -> Rep S3Target x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep S3Target x -> S3Target
$cfrom :: forall x. S3Target -> Rep S3Target x
Prelude.Generic)
newS3Target ::
S3Target
newS3Target :: S3Target
newS3Target =
S3Target' :: Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> S3Target
S3Target'
{ $sel:path:S3Target' :: Maybe Text
path = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:sampleSize:S3Target' :: Maybe Int
sampleSize = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:connectionName:S3Target' :: Maybe Text
connectionName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:exclusions:S3Target' :: Maybe [Text]
exclusions = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:eventQueueArn:S3Target' :: Maybe Text
eventQueueArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:dlqEventQueueArn:S3Target' :: Maybe Text
dlqEventQueueArn = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
s3Target_path :: Lens.Lens' S3Target (Prelude.Maybe Prelude.Text)
s3Target_path :: (Maybe Text -> f (Maybe Text)) -> S3Target -> f S3Target
s3Target_path = (S3Target -> Maybe Text)
-> (S3Target -> Maybe Text -> S3Target)
-> Lens S3Target S3Target (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3Target' {Maybe Text
path :: Maybe Text
$sel:path:S3Target' :: S3Target -> Maybe Text
path} -> Maybe Text
path) (\s :: S3Target
s@S3Target' {} Maybe Text
a -> S3Target
s {$sel:path:S3Target' :: Maybe Text
path = Maybe Text
a} :: S3Target)
s3Target_sampleSize :: Lens.Lens' S3Target (Prelude.Maybe Prelude.Int)
s3Target_sampleSize :: (Maybe Int -> f (Maybe Int)) -> S3Target -> f S3Target
s3Target_sampleSize = (S3Target -> Maybe Int)
-> (S3Target -> Maybe Int -> S3Target)
-> Lens S3Target S3Target (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3Target' {Maybe Int
sampleSize :: Maybe Int
$sel:sampleSize:S3Target' :: S3Target -> Maybe Int
sampleSize} -> Maybe Int
sampleSize) (\s :: S3Target
s@S3Target' {} Maybe Int
a -> S3Target
s {$sel:sampleSize:S3Target' :: Maybe Int
sampleSize = Maybe Int
a} :: S3Target)
s3Target_connectionName :: Lens.Lens' S3Target (Prelude.Maybe Prelude.Text)
s3Target_connectionName :: (Maybe Text -> f (Maybe Text)) -> S3Target -> f S3Target
s3Target_connectionName = (S3Target -> Maybe Text)
-> (S3Target -> Maybe Text -> S3Target)
-> Lens S3Target S3Target (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3Target' {Maybe Text
connectionName :: Maybe Text
$sel:connectionName:S3Target' :: S3Target -> Maybe Text
connectionName} -> Maybe Text
connectionName) (\s :: S3Target
s@S3Target' {} Maybe Text
a -> S3Target
s {$sel:connectionName:S3Target' :: Maybe Text
connectionName = Maybe Text
a} :: S3Target)
s3Target_exclusions :: Lens.Lens' S3Target (Prelude.Maybe [Prelude.Text])
s3Target_exclusions :: (Maybe [Text] -> f (Maybe [Text])) -> S3Target -> f S3Target
s3Target_exclusions = (S3Target -> Maybe [Text])
-> (S3Target -> Maybe [Text] -> S3Target)
-> Lens S3Target S3Target (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3Target' {Maybe [Text]
exclusions :: Maybe [Text]
$sel:exclusions:S3Target' :: S3Target -> Maybe [Text]
exclusions} -> Maybe [Text]
exclusions) (\s :: S3Target
s@S3Target' {} Maybe [Text]
a -> S3Target
s {$sel:exclusions:S3Target' :: Maybe [Text]
exclusions = Maybe [Text]
a} :: S3Target) ((Maybe [Text] -> f (Maybe [Text])) -> S3Target -> f S3Target)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> S3Target
-> f S3Target
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
s3Target_eventQueueArn :: Lens.Lens' S3Target (Prelude.Maybe Prelude.Text)
s3Target_eventQueueArn :: (Maybe Text -> f (Maybe Text)) -> S3Target -> f S3Target
s3Target_eventQueueArn = (S3Target -> Maybe Text)
-> (S3Target -> Maybe Text -> S3Target)
-> Lens S3Target S3Target (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3Target' {Maybe Text
eventQueueArn :: Maybe Text
$sel:eventQueueArn:S3Target' :: S3Target -> Maybe Text
eventQueueArn} -> Maybe Text
eventQueueArn) (\s :: S3Target
s@S3Target' {} Maybe Text
a -> S3Target
s {$sel:eventQueueArn:S3Target' :: Maybe Text
eventQueueArn = Maybe Text
a} :: S3Target)
s3Target_dlqEventQueueArn :: Lens.Lens' S3Target (Prelude.Maybe Prelude.Text)
s3Target_dlqEventQueueArn :: (Maybe Text -> f (Maybe Text)) -> S3Target -> f S3Target
s3Target_dlqEventQueueArn = (S3Target -> Maybe Text)
-> (S3Target -> Maybe Text -> S3Target)
-> Lens S3Target S3Target (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3Target' {Maybe Text
dlqEventQueueArn :: Maybe Text
$sel:dlqEventQueueArn:S3Target' :: S3Target -> Maybe Text
dlqEventQueueArn} -> Maybe Text
dlqEventQueueArn) (\s :: S3Target
s@S3Target' {} Maybe Text
a -> S3Target
s {$sel:dlqEventQueueArn:S3Target' :: Maybe Text
dlqEventQueueArn = Maybe Text
a} :: S3Target)
instance Core.FromJSON S3Target where
parseJSON :: Value -> Parser S3Target
parseJSON =
String -> (Object -> Parser S3Target) -> Value -> Parser S3Target
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"S3Target"
( \Object
x ->
Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> S3Target
S3Target'
(Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> S3Target)
-> Parser (Maybe Text)
-> Parser
(Maybe Int
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> S3Target)
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 Int
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> S3Target)
-> Parser (Maybe Int)
-> Parser
(Maybe Text
-> Maybe [Text] -> Maybe Text -> Maybe Text -> S3Target)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SampleSize")
Parser
(Maybe Text
-> Maybe [Text] -> Maybe Text -> Maybe Text -> S3Target)
-> Parser (Maybe Text)
-> Parser (Maybe [Text] -> Maybe Text -> Maybe Text -> S3Target)
forall (f :: * -> *) a b. Applicative f => 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
"ConnectionName")
Parser (Maybe [Text] -> Maybe Text -> Maybe Text -> S3Target)
-> Parser (Maybe [Text])
-> Parser (Maybe Text -> Maybe Text -> S3Target)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Exclusions" Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
Parser (Maybe Text -> Maybe Text -> S3Target)
-> Parser (Maybe Text) -> Parser (Maybe Text -> S3Target)
forall (f :: * -> *) a b. Applicative f => 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
"EventQueueArn")
Parser (Maybe Text -> S3Target)
-> Parser (Maybe Text) -> Parser S3Target
forall (f :: * -> *) a b. Applicative f => 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
"DlqEventQueueArn")
)
instance Prelude.Hashable S3Target
instance Prelude.NFData S3Target
instance Core.ToJSON S3Target where
toJSON :: S3Target -> Value
toJSON S3Target' {Maybe Int
Maybe [Text]
Maybe Text
dlqEventQueueArn :: Maybe Text
eventQueueArn :: Maybe Text
exclusions :: Maybe [Text]
connectionName :: Maybe Text
sampleSize :: Maybe Int
path :: Maybe Text
$sel:dlqEventQueueArn:S3Target' :: S3Target -> Maybe Text
$sel:eventQueueArn:S3Target' :: S3Target -> Maybe Text
$sel:exclusions:S3Target' :: S3Target -> Maybe [Text]
$sel:connectionName:S3Target' :: S3Target -> Maybe Text
$sel:sampleSize:S3Target' :: S3Target -> Maybe Int
$sel:path:S3Target' :: S3Target -> 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
"SampleSize" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
sampleSize,
(Text
"ConnectionName" 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
connectionName,
(Text
"Exclusions" 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]
exclusions,
(Text
"EventQueueArn" 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
eventQueueArn,
(Text
"DlqEventQueueArn" 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
dlqEventQueueArn
]
)