{-# 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.DataBrew.Types.OutputFormatOptions where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.DataBrew.Types.CsvOutputOptions
import qualified Amazonka.Prelude as Prelude
data OutputFormatOptions = OutputFormatOptions'
{
OutputFormatOptions -> Maybe CsvOutputOptions
csv :: Prelude.Maybe CsvOutputOptions
}
deriving (OutputFormatOptions -> OutputFormatOptions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: OutputFormatOptions -> OutputFormatOptions -> Bool
$c/= :: OutputFormatOptions -> OutputFormatOptions -> Bool
== :: OutputFormatOptions -> OutputFormatOptions -> Bool
$c== :: OutputFormatOptions -> OutputFormatOptions -> Bool
Prelude.Eq, ReadPrec [OutputFormatOptions]
ReadPrec OutputFormatOptions
Int -> ReadS OutputFormatOptions
ReadS [OutputFormatOptions]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [OutputFormatOptions]
$creadListPrec :: ReadPrec [OutputFormatOptions]
readPrec :: ReadPrec OutputFormatOptions
$creadPrec :: ReadPrec OutputFormatOptions
readList :: ReadS [OutputFormatOptions]
$creadList :: ReadS [OutputFormatOptions]
readsPrec :: Int -> ReadS OutputFormatOptions
$creadsPrec :: Int -> ReadS OutputFormatOptions
Prelude.Read, Int -> OutputFormatOptions -> ShowS
[OutputFormatOptions] -> ShowS
OutputFormatOptions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [OutputFormatOptions] -> ShowS
$cshowList :: [OutputFormatOptions] -> ShowS
show :: OutputFormatOptions -> String
$cshow :: OutputFormatOptions -> String
showsPrec :: Int -> OutputFormatOptions -> ShowS
$cshowsPrec :: Int -> OutputFormatOptions -> ShowS
Prelude.Show, forall x. Rep OutputFormatOptions x -> OutputFormatOptions
forall x. OutputFormatOptions -> Rep OutputFormatOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep OutputFormatOptions x -> OutputFormatOptions
$cfrom :: forall x. OutputFormatOptions -> Rep OutputFormatOptions x
Prelude.Generic)
newOutputFormatOptions ::
OutputFormatOptions
newOutputFormatOptions :: OutputFormatOptions
newOutputFormatOptions =
OutputFormatOptions' {$sel:csv:OutputFormatOptions' :: Maybe CsvOutputOptions
csv = forall a. Maybe a
Prelude.Nothing}
outputFormatOptions_csv :: Lens.Lens' OutputFormatOptions (Prelude.Maybe CsvOutputOptions)
outputFormatOptions_csv :: Lens' OutputFormatOptions (Maybe CsvOutputOptions)
outputFormatOptions_csv = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OutputFormatOptions' {Maybe CsvOutputOptions
csv :: Maybe CsvOutputOptions
$sel:csv:OutputFormatOptions' :: OutputFormatOptions -> Maybe CsvOutputOptions
csv} -> Maybe CsvOutputOptions
csv) (\s :: OutputFormatOptions
s@OutputFormatOptions' {} Maybe CsvOutputOptions
a -> OutputFormatOptions
s {$sel:csv:OutputFormatOptions' :: Maybe CsvOutputOptions
csv = Maybe CsvOutputOptions
a} :: OutputFormatOptions)
instance Data.FromJSON OutputFormatOptions where
parseJSON :: Value -> Parser OutputFormatOptions
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"OutputFormatOptions"
( \Object
x ->
Maybe CsvOutputOptions -> OutputFormatOptions
OutputFormatOptions' forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Csv")
)
instance Prelude.Hashable OutputFormatOptions where
hashWithSalt :: Int -> OutputFormatOptions -> Int
hashWithSalt Int
_salt OutputFormatOptions' {Maybe CsvOutputOptions
csv :: Maybe CsvOutputOptions
$sel:csv:OutputFormatOptions' :: OutputFormatOptions -> Maybe CsvOutputOptions
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe CsvOutputOptions
csv
instance Prelude.NFData OutputFormatOptions where
rnf :: OutputFormatOptions -> ()
rnf OutputFormatOptions' {Maybe CsvOutputOptions
csv :: Maybe CsvOutputOptions
$sel:csv:OutputFormatOptions' :: OutputFormatOptions -> Maybe CsvOutputOptions
..} = forall a. NFData a => a -> ()
Prelude.rnf Maybe CsvOutputOptions
csv
instance Data.ToJSON OutputFormatOptions where
toJSON :: OutputFormatOptions -> Value
toJSON OutputFormatOptions' {Maybe CsvOutputOptions
csv :: Maybe CsvOutputOptions
$sel:csv:OutputFormatOptions' :: OutputFormatOptions -> Maybe CsvOutputOptions
..} =
[Pair] -> Value
Data.object
(forall a. [Maybe a] -> [a]
Prelude.catMaybes [(Key
"Csv" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CsvOutputOptions
csv])