{-# 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.ExcelOptions where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data ExcelOptions = ExcelOptions'
{
:: Prelude.Maybe Prelude.Bool,
ExcelOptions -> Maybe (NonEmpty Natural)
sheetIndexes :: Prelude.Maybe (Prelude.NonEmpty Prelude.Natural),
ExcelOptions -> Maybe (NonEmpty Text)
sheetNames :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text)
}
deriving (ExcelOptions -> ExcelOptions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExcelOptions -> ExcelOptions -> Bool
$c/= :: ExcelOptions -> ExcelOptions -> Bool
== :: ExcelOptions -> ExcelOptions -> Bool
$c== :: ExcelOptions -> ExcelOptions -> Bool
Prelude.Eq, ReadPrec [ExcelOptions]
ReadPrec ExcelOptions
Int -> ReadS ExcelOptions
ReadS [ExcelOptions]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ExcelOptions]
$creadListPrec :: ReadPrec [ExcelOptions]
readPrec :: ReadPrec ExcelOptions
$creadPrec :: ReadPrec ExcelOptions
readList :: ReadS [ExcelOptions]
$creadList :: ReadS [ExcelOptions]
readsPrec :: Int -> ReadS ExcelOptions
$creadsPrec :: Int -> ReadS ExcelOptions
Prelude.Read, Int -> ExcelOptions -> ShowS
[ExcelOptions] -> ShowS
ExcelOptions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ExcelOptions] -> ShowS
$cshowList :: [ExcelOptions] -> ShowS
show :: ExcelOptions -> String
$cshow :: ExcelOptions -> String
showsPrec :: Int -> ExcelOptions -> ShowS
$cshowsPrec :: Int -> ExcelOptions -> ShowS
Prelude.Show, forall x. Rep ExcelOptions x -> ExcelOptions
forall x. ExcelOptions -> Rep ExcelOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ExcelOptions x -> ExcelOptions
$cfrom :: forall x. ExcelOptions -> Rep ExcelOptions x
Prelude.Generic)
newExcelOptions ::
ExcelOptions
newExcelOptions :: ExcelOptions
newExcelOptions =
ExcelOptions'
{ $sel:headerRow:ExcelOptions' :: Maybe Bool
headerRow = forall a. Maybe a
Prelude.Nothing,
$sel:sheetIndexes:ExcelOptions' :: Maybe (NonEmpty Natural)
sheetIndexes = forall a. Maybe a
Prelude.Nothing,
$sel:sheetNames:ExcelOptions' :: Maybe (NonEmpty Text)
sheetNames = forall a. Maybe a
Prelude.Nothing
}
excelOptions_headerRow :: Lens.Lens' ExcelOptions (Prelude.Maybe Prelude.Bool)
= forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExcelOptions' {Maybe Bool
headerRow :: Maybe Bool
$sel:headerRow:ExcelOptions' :: ExcelOptions -> Maybe Bool
headerRow} -> Maybe Bool
headerRow) (\s :: ExcelOptions
s@ExcelOptions' {} Maybe Bool
a -> ExcelOptions
s {$sel:headerRow:ExcelOptions' :: Maybe Bool
headerRow = Maybe Bool
a} :: ExcelOptions)
excelOptions_sheetIndexes :: Lens.Lens' ExcelOptions (Prelude.Maybe (Prelude.NonEmpty Prelude.Natural))
excelOptions_sheetIndexes :: Lens' ExcelOptions (Maybe (NonEmpty Natural))
excelOptions_sheetIndexes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExcelOptions' {Maybe (NonEmpty Natural)
sheetIndexes :: Maybe (NonEmpty Natural)
$sel:sheetIndexes:ExcelOptions' :: ExcelOptions -> Maybe (NonEmpty Natural)
sheetIndexes} -> Maybe (NonEmpty Natural)
sheetIndexes) (\s :: ExcelOptions
s@ExcelOptions' {} Maybe (NonEmpty Natural)
a -> ExcelOptions
s {$sel:sheetIndexes:ExcelOptions' :: Maybe (NonEmpty Natural)
sheetIndexes = Maybe (NonEmpty Natural)
a} :: ExcelOptions) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
excelOptions_sheetNames :: Lens.Lens' ExcelOptions (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
excelOptions_sheetNames :: Lens' ExcelOptions (Maybe (NonEmpty Text))
excelOptions_sheetNames = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExcelOptions' {Maybe (NonEmpty Text)
sheetNames :: Maybe (NonEmpty Text)
$sel:sheetNames:ExcelOptions' :: ExcelOptions -> Maybe (NonEmpty Text)
sheetNames} -> Maybe (NonEmpty Text)
sheetNames) (\s :: ExcelOptions
s@ExcelOptions' {} Maybe (NonEmpty Text)
a -> ExcelOptions
s {$sel:sheetNames:ExcelOptions' :: Maybe (NonEmpty Text)
sheetNames = Maybe (NonEmpty Text)
a} :: ExcelOptions) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Data.FromJSON ExcelOptions where
parseJSON :: Value -> Parser ExcelOptions
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ExcelOptions"
( \Object
x ->
Maybe Bool
-> Maybe (NonEmpty Natural)
-> Maybe (NonEmpty Text)
-> ExcelOptions
ExcelOptions'
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
"HeaderRow")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"SheetIndexes")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"SheetNames")
)
instance Prelude.Hashable ExcelOptions where
hashWithSalt :: Int -> ExcelOptions -> Int
hashWithSalt Int
_salt ExcelOptions' {Maybe Bool
Maybe (NonEmpty Natural)
Maybe (NonEmpty Text)
sheetNames :: Maybe (NonEmpty Text)
sheetIndexes :: Maybe (NonEmpty Natural)
headerRow :: Maybe Bool
$sel:sheetNames:ExcelOptions' :: ExcelOptions -> Maybe (NonEmpty Text)
$sel:sheetIndexes:ExcelOptions' :: ExcelOptions -> Maybe (NonEmpty Natural)
$sel:headerRow:ExcelOptions' :: ExcelOptions -> Maybe Bool
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
headerRow
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty Natural)
sheetIndexes
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty Text)
sheetNames
instance Prelude.NFData ExcelOptions where
rnf :: ExcelOptions -> ()
rnf ExcelOptions' {Maybe Bool
Maybe (NonEmpty Natural)
Maybe (NonEmpty Text)
sheetNames :: Maybe (NonEmpty Text)
sheetIndexes :: Maybe (NonEmpty Natural)
headerRow :: Maybe Bool
$sel:sheetNames:ExcelOptions' :: ExcelOptions -> Maybe (NonEmpty Text)
$sel:sheetIndexes:ExcelOptions' :: ExcelOptions -> Maybe (NonEmpty Natural)
$sel:headerRow:ExcelOptions' :: ExcelOptions -> Maybe Bool
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
headerRow
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty Natural)
sheetIndexes
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty Text)
sheetNames
instance Data.ToJSON ExcelOptions where
toJSON :: ExcelOptions -> Value
toJSON ExcelOptions' {Maybe Bool
Maybe (NonEmpty Natural)
Maybe (NonEmpty Text)
sheetNames :: Maybe (NonEmpty Text)
sheetIndexes :: Maybe (NonEmpty Natural)
headerRow :: Maybe Bool
$sel:sheetNames:ExcelOptions' :: ExcelOptions -> Maybe (NonEmpty Text)
$sel:sheetIndexes:ExcelOptions' :: ExcelOptions -> Maybe (NonEmpty Natural)
$sel:headerRow:ExcelOptions' :: ExcelOptions -> Maybe Bool
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"HeaderRow" 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 Bool
headerRow,
(Key
"SheetIndexes" 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 (NonEmpty Natural)
sheetIndexes,
(Key
"SheetNames" 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 (NonEmpty Text)
sheetNames
]
)