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