{-# 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.Firehose.Types.CopyCommand where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data CopyCommand = CopyCommand'
{
CopyCommand -> Maybe Text
copyOptions :: Prelude.Maybe Prelude.Text,
CopyCommand -> Maybe Text
dataTableColumns :: Prelude.Maybe Prelude.Text,
CopyCommand -> Text
dataTableName :: Prelude.Text
}
deriving (CopyCommand -> CopyCommand -> Bool
(CopyCommand -> CopyCommand -> Bool)
-> (CopyCommand -> CopyCommand -> Bool) -> Eq CopyCommand
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CopyCommand -> CopyCommand -> Bool
$c/= :: CopyCommand -> CopyCommand -> Bool
== :: CopyCommand -> CopyCommand -> Bool
$c== :: CopyCommand -> CopyCommand -> Bool
Prelude.Eq, ReadPrec [CopyCommand]
ReadPrec CopyCommand
Int -> ReadS CopyCommand
ReadS [CopyCommand]
(Int -> ReadS CopyCommand)
-> ReadS [CopyCommand]
-> ReadPrec CopyCommand
-> ReadPrec [CopyCommand]
-> Read CopyCommand
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CopyCommand]
$creadListPrec :: ReadPrec [CopyCommand]
readPrec :: ReadPrec CopyCommand
$creadPrec :: ReadPrec CopyCommand
readList :: ReadS [CopyCommand]
$creadList :: ReadS [CopyCommand]
readsPrec :: Int -> ReadS CopyCommand
$creadsPrec :: Int -> ReadS CopyCommand
Prelude.Read, Int -> CopyCommand -> ShowS
[CopyCommand] -> ShowS
CopyCommand -> String
(Int -> CopyCommand -> ShowS)
-> (CopyCommand -> String)
-> ([CopyCommand] -> ShowS)
-> Show CopyCommand
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CopyCommand] -> ShowS
$cshowList :: [CopyCommand] -> ShowS
show :: CopyCommand -> String
$cshow :: CopyCommand -> String
showsPrec :: Int -> CopyCommand -> ShowS
$cshowsPrec :: Int -> CopyCommand -> ShowS
Prelude.Show, (forall x. CopyCommand -> Rep CopyCommand x)
-> (forall x. Rep CopyCommand x -> CopyCommand)
-> Generic CopyCommand
forall x. Rep CopyCommand x -> CopyCommand
forall x. CopyCommand -> Rep CopyCommand x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CopyCommand x -> CopyCommand
$cfrom :: forall x. CopyCommand -> Rep CopyCommand x
Prelude.Generic)
newCopyCommand ::
Prelude.Text ->
CopyCommand
newCopyCommand :: Text -> CopyCommand
newCopyCommand Text
pDataTableName_ =
CopyCommand' :: Maybe Text -> Maybe Text -> Text -> CopyCommand
CopyCommand'
{ $sel:copyOptions:CopyCommand' :: Maybe Text
copyOptions = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:dataTableColumns:CopyCommand' :: Maybe Text
dataTableColumns = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:dataTableName:CopyCommand' :: Text
dataTableName = Text
pDataTableName_
}
copyCommand_copyOptions :: Lens.Lens' CopyCommand (Prelude.Maybe Prelude.Text)
copyCommand_copyOptions :: (Maybe Text -> f (Maybe Text)) -> CopyCommand -> f CopyCommand
copyCommand_copyOptions = (CopyCommand -> Maybe Text)
-> (CopyCommand -> Maybe Text -> CopyCommand)
-> Lens CopyCommand CopyCommand (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyCommand' {Maybe Text
copyOptions :: Maybe Text
$sel:copyOptions:CopyCommand' :: CopyCommand -> Maybe Text
copyOptions} -> Maybe Text
copyOptions) (\s :: CopyCommand
s@CopyCommand' {} Maybe Text
a -> CopyCommand
s {$sel:copyOptions:CopyCommand' :: Maybe Text
copyOptions = Maybe Text
a} :: CopyCommand)
copyCommand_dataTableColumns :: Lens.Lens' CopyCommand (Prelude.Maybe Prelude.Text)
copyCommand_dataTableColumns :: (Maybe Text -> f (Maybe Text)) -> CopyCommand -> f CopyCommand
copyCommand_dataTableColumns = (CopyCommand -> Maybe Text)
-> (CopyCommand -> Maybe Text -> CopyCommand)
-> Lens CopyCommand CopyCommand (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyCommand' {Maybe Text
dataTableColumns :: Maybe Text
$sel:dataTableColumns:CopyCommand' :: CopyCommand -> Maybe Text
dataTableColumns} -> Maybe Text
dataTableColumns) (\s :: CopyCommand
s@CopyCommand' {} Maybe Text
a -> CopyCommand
s {$sel:dataTableColumns:CopyCommand' :: Maybe Text
dataTableColumns = Maybe Text
a} :: CopyCommand)
copyCommand_dataTableName :: Lens.Lens' CopyCommand Prelude.Text
copyCommand_dataTableName :: (Text -> f Text) -> CopyCommand -> f CopyCommand
copyCommand_dataTableName = (CopyCommand -> Text)
-> (CopyCommand -> Text -> CopyCommand)
-> Lens CopyCommand CopyCommand Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyCommand' {Text
dataTableName :: Text
$sel:dataTableName:CopyCommand' :: CopyCommand -> Text
dataTableName} -> Text
dataTableName) (\s :: CopyCommand
s@CopyCommand' {} Text
a -> CopyCommand
s {$sel:dataTableName:CopyCommand' :: Text
dataTableName = Text
a} :: CopyCommand)
instance Core.FromJSON CopyCommand where
parseJSON :: Value -> Parser CopyCommand
parseJSON =
String
-> (Object -> Parser CopyCommand) -> Value -> Parser CopyCommand
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"CopyCommand"
( \Object
x ->
Maybe Text -> Maybe Text -> Text -> CopyCommand
CopyCommand'
(Maybe Text -> Maybe Text -> Text -> CopyCommand)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Text -> CopyCommand)
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
"CopyOptions")
Parser (Maybe Text -> Text -> CopyCommand)
-> Parser (Maybe Text) -> Parser (Text -> CopyCommand)
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
"DataTableColumns")
Parser (Text -> CopyCommand) -> Parser Text -> Parser CopyCommand
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
"DataTableName")
)
instance Prelude.Hashable CopyCommand
instance Prelude.NFData CopyCommand
instance Core.ToJSON CopyCommand where
toJSON :: CopyCommand -> Value
toJSON CopyCommand' {Maybe Text
Text
dataTableName :: Text
dataTableColumns :: Maybe Text
copyOptions :: Maybe Text
$sel:dataTableName:CopyCommand' :: CopyCommand -> Text
$sel:dataTableColumns:CopyCommand' :: CopyCommand -> Maybe Text
$sel:copyOptions:CopyCommand' :: CopyCommand -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"CopyOptions" 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
copyOptions,
(Text
"DataTableColumns" 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
dataTableColumns,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"DataTableName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
dataTableName)
]
)