{-# 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.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ExcelOptions = ExcelOptions'
{
ExcelOptions -> Maybe (NonEmpty Natural)
sheetIndexes :: Prelude.Maybe (Prelude.NonEmpty Prelude.Natural),
ExcelOptions -> Maybe (NonEmpty Text)
sheetNames :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
:: Prelude.Maybe Prelude.Bool
}
deriving (ExcelOptions -> ExcelOptions -> Bool
(ExcelOptions -> ExcelOptions -> Bool)
-> (ExcelOptions -> ExcelOptions -> Bool) -> Eq ExcelOptions
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]
(Int -> ReadS ExcelOptions)
-> ReadS [ExcelOptions]
-> ReadPrec ExcelOptions
-> ReadPrec [ExcelOptions]
-> Read 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
(Int -> ExcelOptions -> ShowS)
-> (ExcelOptions -> String)
-> ([ExcelOptions] -> ShowS)
-> Show ExcelOptions
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. ExcelOptions -> Rep ExcelOptions x)
-> (forall x. Rep ExcelOptions x -> ExcelOptions)
-> Generic ExcelOptions
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' :: Maybe (NonEmpty Natural)
-> Maybe (NonEmpty Text) -> Maybe Bool -> ExcelOptions
ExcelOptions'
{ $sel:sheetIndexes:ExcelOptions' :: Maybe (NonEmpty Natural)
sheetIndexes = Maybe (NonEmpty Natural)
forall a. Maybe a
Prelude.Nothing,
$sel:sheetNames:ExcelOptions' :: Maybe (NonEmpty Text)
sheetNames = Maybe (NonEmpty Text)
forall a. Maybe a
Prelude.Nothing,
$sel:headerRow:ExcelOptions' :: Maybe Bool
headerRow = Maybe Bool
forall a. Maybe a
Prelude.Nothing
}
excelOptions_sheetIndexes :: Lens.Lens' ExcelOptions (Prelude.Maybe (Prelude.NonEmpty Prelude.Natural))
excelOptions_sheetIndexes :: (Maybe (NonEmpty Natural) -> f (Maybe (NonEmpty Natural)))
-> ExcelOptions -> f ExcelOptions
excelOptions_sheetIndexes = (ExcelOptions -> Maybe (NonEmpty Natural))
-> (ExcelOptions -> Maybe (NonEmpty Natural) -> ExcelOptions)
-> Lens
ExcelOptions
ExcelOptions
(Maybe (NonEmpty Natural))
(Maybe (NonEmpty Natural))
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) ((Maybe (NonEmpty Natural) -> f (Maybe (NonEmpty Natural)))
-> ExcelOptions -> f ExcelOptions)
-> ((Maybe (NonEmpty Natural) -> f (Maybe (NonEmpty Natural)))
-> Maybe (NonEmpty Natural) -> f (Maybe (NonEmpty Natural)))
-> (Maybe (NonEmpty Natural) -> f (Maybe (NonEmpty Natural)))
-> ExcelOptions
-> f ExcelOptions
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(NonEmpty Natural)
(NonEmpty Natural)
(NonEmpty Natural)
(NonEmpty Natural)
-> Iso
(Maybe (NonEmpty Natural))
(Maybe (NonEmpty Natural))
(Maybe (NonEmpty Natural))
(Maybe (NonEmpty Natural))
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 AnIso
(NonEmpty Natural)
(NonEmpty Natural)
(NonEmpty Natural)
(NonEmpty Natural)
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 :: (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> ExcelOptions -> f ExcelOptions
excelOptions_sheetNames = (ExcelOptions -> Maybe (NonEmpty Text))
-> (ExcelOptions -> Maybe (NonEmpty Text) -> ExcelOptions)
-> Lens
ExcelOptions
ExcelOptions
(Maybe (NonEmpty Text))
(Maybe (NonEmpty Text))
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) ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> ExcelOptions -> f ExcelOptions)
-> ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> ExcelOptions
-> f ExcelOptions
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
-> Iso
(Maybe (NonEmpty Text))
(Maybe (NonEmpty Text))
(Maybe (NonEmpty Text))
(Maybe (NonEmpty Text))
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 AnIso
(NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
excelOptions_headerRow :: Lens.Lens' ExcelOptions (Prelude.Maybe Prelude.Bool)
= (ExcelOptions -> Maybe Bool)
-> (ExcelOptions -> Maybe Bool -> ExcelOptions)
-> Lens ExcelOptions ExcelOptions (Maybe Bool) (Maybe 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)
instance Core.FromJSON ExcelOptions where
parseJSON :: Value -> Parser ExcelOptions
parseJSON =
String
-> (Object -> Parser ExcelOptions) -> Value -> Parser ExcelOptions
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ExcelOptions"
( \Object
x ->
Maybe (NonEmpty Natural)
-> Maybe (NonEmpty Text) -> Maybe Bool -> ExcelOptions
ExcelOptions'
(Maybe (NonEmpty Natural)
-> Maybe (NonEmpty Text) -> Maybe Bool -> ExcelOptions)
-> Parser (Maybe (NonEmpty Natural))
-> Parser (Maybe (NonEmpty Text) -> Maybe Bool -> ExcelOptions)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (NonEmpty Natural))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SheetIndexes")
Parser (Maybe (NonEmpty Text) -> Maybe Bool -> ExcelOptions)
-> Parser (Maybe (NonEmpty Text))
-> Parser (Maybe Bool -> ExcelOptions)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (NonEmpty Text))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SheetNames")
Parser (Maybe Bool -> ExcelOptions)
-> Parser (Maybe Bool) -> Parser ExcelOptions
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"HeaderRow")
)
instance Prelude.Hashable ExcelOptions
instance Prelude.NFData ExcelOptions
instance Core.ToJSON ExcelOptions where
toJSON :: ExcelOptions -> Value
toJSON ExcelOptions' {Maybe Bool
Maybe (NonEmpty Natural)
Maybe (NonEmpty Text)
headerRow :: Maybe Bool
sheetNames :: Maybe (NonEmpty Text)
sheetIndexes :: Maybe (NonEmpty Natural)
$sel:headerRow:ExcelOptions' :: ExcelOptions -> Maybe Bool
$sel:sheetNames:ExcelOptions' :: ExcelOptions -> Maybe (NonEmpty Text)
$sel:sheetIndexes:ExcelOptions' :: ExcelOptions -> Maybe (NonEmpty Natural)
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"SheetIndexes" Text -> NonEmpty Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NonEmpty Natural -> Pair)
-> Maybe (NonEmpty Natural) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Natural)
sheetIndexes,
(Text
"SheetNames" Text -> NonEmpty Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NonEmpty Text -> Pair) -> Maybe (NonEmpty Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Text)
sheetNames,
(Text
"HeaderRow" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
headerRow
]
)