{-# 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.KinesisAnalytics.Types.ReferenceDataSourceDescription where
import qualified Amazonka.Core as Core
import Amazonka.KinesisAnalytics.Types.S3ReferenceDataSourceDescription
import Amazonka.KinesisAnalytics.Types.SourceSchema
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ReferenceDataSourceDescription = ReferenceDataSourceDescription'
{
ReferenceDataSourceDescription -> Maybe SourceSchema
referenceSchema :: Prelude.Maybe SourceSchema,
ReferenceDataSourceDescription -> Text
referenceId :: Prelude.Text,
ReferenceDataSourceDescription -> Text
tableName :: Prelude.Text,
ReferenceDataSourceDescription -> S3ReferenceDataSourceDescription
s3ReferenceDataSourceDescription :: S3ReferenceDataSourceDescription
}
deriving (ReferenceDataSourceDescription
-> ReferenceDataSourceDescription -> Bool
(ReferenceDataSourceDescription
-> ReferenceDataSourceDescription -> Bool)
-> (ReferenceDataSourceDescription
-> ReferenceDataSourceDescription -> Bool)
-> Eq ReferenceDataSourceDescription
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ReferenceDataSourceDescription
-> ReferenceDataSourceDescription -> Bool
$c/= :: ReferenceDataSourceDescription
-> ReferenceDataSourceDescription -> Bool
== :: ReferenceDataSourceDescription
-> ReferenceDataSourceDescription -> Bool
$c== :: ReferenceDataSourceDescription
-> ReferenceDataSourceDescription -> Bool
Prelude.Eq, ReadPrec [ReferenceDataSourceDescription]
ReadPrec ReferenceDataSourceDescription
Int -> ReadS ReferenceDataSourceDescription
ReadS [ReferenceDataSourceDescription]
(Int -> ReadS ReferenceDataSourceDescription)
-> ReadS [ReferenceDataSourceDescription]
-> ReadPrec ReferenceDataSourceDescription
-> ReadPrec [ReferenceDataSourceDescription]
-> Read ReferenceDataSourceDescription
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ReferenceDataSourceDescription]
$creadListPrec :: ReadPrec [ReferenceDataSourceDescription]
readPrec :: ReadPrec ReferenceDataSourceDescription
$creadPrec :: ReadPrec ReferenceDataSourceDescription
readList :: ReadS [ReferenceDataSourceDescription]
$creadList :: ReadS [ReferenceDataSourceDescription]
readsPrec :: Int -> ReadS ReferenceDataSourceDescription
$creadsPrec :: Int -> ReadS ReferenceDataSourceDescription
Prelude.Read, Int -> ReferenceDataSourceDescription -> ShowS
[ReferenceDataSourceDescription] -> ShowS
ReferenceDataSourceDescription -> String
(Int -> ReferenceDataSourceDescription -> ShowS)
-> (ReferenceDataSourceDescription -> String)
-> ([ReferenceDataSourceDescription] -> ShowS)
-> Show ReferenceDataSourceDescription
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ReferenceDataSourceDescription] -> ShowS
$cshowList :: [ReferenceDataSourceDescription] -> ShowS
show :: ReferenceDataSourceDescription -> String
$cshow :: ReferenceDataSourceDescription -> String
showsPrec :: Int -> ReferenceDataSourceDescription -> ShowS
$cshowsPrec :: Int -> ReferenceDataSourceDescription -> ShowS
Prelude.Show, (forall x.
ReferenceDataSourceDescription
-> Rep ReferenceDataSourceDescription x)
-> (forall x.
Rep ReferenceDataSourceDescription x
-> ReferenceDataSourceDescription)
-> Generic ReferenceDataSourceDescription
forall x.
Rep ReferenceDataSourceDescription x
-> ReferenceDataSourceDescription
forall x.
ReferenceDataSourceDescription
-> Rep ReferenceDataSourceDescription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ReferenceDataSourceDescription x
-> ReferenceDataSourceDescription
$cfrom :: forall x.
ReferenceDataSourceDescription
-> Rep ReferenceDataSourceDescription x
Prelude.Generic)
newReferenceDataSourceDescription ::
Prelude.Text ->
Prelude.Text ->
S3ReferenceDataSourceDescription ->
ReferenceDataSourceDescription
newReferenceDataSourceDescription :: Text
-> Text
-> S3ReferenceDataSourceDescription
-> ReferenceDataSourceDescription
newReferenceDataSourceDescription
Text
pReferenceId_
Text
pTableName_
S3ReferenceDataSourceDescription
pS3ReferenceDataSourceDescription_ =
ReferenceDataSourceDescription' :: Maybe SourceSchema
-> Text
-> Text
-> S3ReferenceDataSourceDescription
-> ReferenceDataSourceDescription
ReferenceDataSourceDescription'
{ $sel:referenceSchema:ReferenceDataSourceDescription' :: Maybe SourceSchema
referenceSchema =
Maybe SourceSchema
forall a. Maybe a
Prelude.Nothing,
$sel:referenceId:ReferenceDataSourceDescription' :: Text
referenceId = Text
pReferenceId_,
$sel:tableName:ReferenceDataSourceDescription' :: Text
tableName = Text
pTableName_,
$sel:s3ReferenceDataSourceDescription:ReferenceDataSourceDescription' :: S3ReferenceDataSourceDescription
s3ReferenceDataSourceDescription =
S3ReferenceDataSourceDescription
pS3ReferenceDataSourceDescription_
}
referenceDataSourceDescription_referenceSchema :: Lens.Lens' ReferenceDataSourceDescription (Prelude.Maybe SourceSchema)
referenceDataSourceDescription_referenceSchema :: (Maybe SourceSchema -> f (Maybe SourceSchema))
-> ReferenceDataSourceDescription
-> f ReferenceDataSourceDescription
referenceDataSourceDescription_referenceSchema = (ReferenceDataSourceDescription -> Maybe SourceSchema)
-> (ReferenceDataSourceDescription
-> Maybe SourceSchema -> ReferenceDataSourceDescription)
-> Lens
ReferenceDataSourceDescription
ReferenceDataSourceDescription
(Maybe SourceSchema)
(Maybe SourceSchema)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReferenceDataSourceDescription' {Maybe SourceSchema
referenceSchema :: Maybe SourceSchema
$sel:referenceSchema:ReferenceDataSourceDescription' :: ReferenceDataSourceDescription -> Maybe SourceSchema
referenceSchema} -> Maybe SourceSchema
referenceSchema) (\s :: ReferenceDataSourceDescription
s@ReferenceDataSourceDescription' {} Maybe SourceSchema
a -> ReferenceDataSourceDescription
s {$sel:referenceSchema:ReferenceDataSourceDescription' :: Maybe SourceSchema
referenceSchema = Maybe SourceSchema
a} :: ReferenceDataSourceDescription)
referenceDataSourceDescription_referenceId :: Lens.Lens' ReferenceDataSourceDescription Prelude.Text
referenceDataSourceDescription_referenceId :: (Text -> f Text)
-> ReferenceDataSourceDescription
-> f ReferenceDataSourceDescription
referenceDataSourceDescription_referenceId = (ReferenceDataSourceDescription -> Text)
-> (ReferenceDataSourceDescription
-> Text -> ReferenceDataSourceDescription)
-> Lens
ReferenceDataSourceDescription
ReferenceDataSourceDescription
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReferenceDataSourceDescription' {Text
referenceId :: Text
$sel:referenceId:ReferenceDataSourceDescription' :: ReferenceDataSourceDescription -> Text
referenceId} -> Text
referenceId) (\s :: ReferenceDataSourceDescription
s@ReferenceDataSourceDescription' {} Text
a -> ReferenceDataSourceDescription
s {$sel:referenceId:ReferenceDataSourceDescription' :: Text
referenceId = Text
a} :: ReferenceDataSourceDescription)
referenceDataSourceDescription_tableName :: Lens.Lens' ReferenceDataSourceDescription Prelude.Text
referenceDataSourceDescription_tableName :: (Text -> f Text)
-> ReferenceDataSourceDescription
-> f ReferenceDataSourceDescription
referenceDataSourceDescription_tableName = (ReferenceDataSourceDescription -> Text)
-> (ReferenceDataSourceDescription
-> Text -> ReferenceDataSourceDescription)
-> Lens
ReferenceDataSourceDescription
ReferenceDataSourceDescription
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReferenceDataSourceDescription' {Text
tableName :: Text
$sel:tableName:ReferenceDataSourceDescription' :: ReferenceDataSourceDescription -> Text
tableName} -> Text
tableName) (\s :: ReferenceDataSourceDescription
s@ReferenceDataSourceDescription' {} Text
a -> ReferenceDataSourceDescription
s {$sel:tableName:ReferenceDataSourceDescription' :: Text
tableName = Text
a} :: ReferenceDataSourceDescription)
referenceDataSourceDescription_s3ReferenceDataSourceDescription :: Lens.Lens' ReferenceDataSourceDescription S3ReferenceDataSourceDescription
referenceDataSourceDescription_s3ReferenceDataSourceDescription :: (S3ReferenceDataSourceDescription
-> f S3ReferenceDataSourceDescription)
-> ReferenceDataSourceDescription
-> f ReferenceDataSourceDescription
referenceDataSourceDescription_s3ReferenceDataSourceDescription = (ReferenceDataSourceDescription
-> S3ReferenceDataSourceDescription)
-> (ReferenceDataSourceDescription
-> S3ReferenceDataSourceDescription
-> ReferenceDataSourceDescription)
-> Lens
ReferenceDataSourceDescription
ReferenceDataSourceDescription
S3ReferenceDataSourceDescription
S3ReferenceDataSourceDescription
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReferenceDataSourceDescription' {S3ReferenceDataSourceDescription
s3ReferenceDataSourceDescription :: S3ReferenceDataSourceDescription
$sel:s3ReferenceDataSourceDescription:ReferenceDataSourceDescription' :: ReferenceDataSourceDescription -> S3ReferenceDataSourceDescription
s3ReferenceDataSourceDescription} -> S3ReferenceDataSourceDescription
s3ReferenceDataSourceDescription) (\s :: ReferenceDataSourceDescription
s@ReferenceDataSourceDescription' {} S3ReferenceDataSourceDescription
a -> ReferenceDataSourceDescription
s {$sel:s3ReferenceDataSourceDescription:ReferenceDataSourceDescription' :: S3ReferenceDataSourceDescription
s3ReferenceDataSourceDescription = S3ReferenceDataSourceDescription
a} :: ReferenceDataSourceDescription)
instance Core.FromJSON ReferenceDataSourceDescription where
parseJSON :: Value -> Parser ReferenceDataSourceDescription
parseJSON =
String
-> (Object -> Parser ReferenceDataSourceDescription)
-> Value
-> Parser ReferenceDataSourceDescription
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ReferenceDataSourceDescription"
( \Object
x ->
Maybe SourceSchema
-> Text
-> Text
-> S3ReferenceDataSourceDescription
-> ReferenceDataSourceDescription
ReferenceDataSourceDescription'
(Maybe SourceSchema
-> Text
-> Text
-> S3ReferenceDataSourceDescription
-> ReferenceDataSourceDescription)
-> Parser (Maybe SourceSchema)
-> Parser
(Text
-> Text
-> S3ReferenceDataSourceDescription
-> ReferenceDataSourceDescription)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe SourceSchema)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ReferenceSchema")
Parser
(Text
-> Text
-> S3ReferenceDataSourceDescription
-> ReferenceDataSourceDescription)
-> Parser Text
-> Parser
(Text
-> S3ReferenceDataSourceDescription
-> ReferenceDataSourceDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ReferenceId")
Parser
(Text
-> S3ReferenceDataSourceDescription
-> ReferenceDataSourceDescription)
-> Parser Text
-> Parser
(S3ReferenceDataSourceDescription
-> ReferenceDataSourceDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"TableName")
Parser
(S3ReferenceDataSourceDescription
-> ReferenceDataSourceDescription)
-> Parser S3ReferenceDataSourceDescription
-> Parser ReferenceDataSourceDescription
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser S3ReferenceDataSourceDescription
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"S3ReferenceDataSourceDescription")
)
instance
Prelude.Hashable
ReferenceDataSourceDescription
instance
Prelude.NFData
ReferenceDataSourceDescription