{-# 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.CloudSearch.Types.LiteralArrayOptions where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data LiteralArrayOptions = LiteralArrayOptions'
{
LiteralArrayOptions -> Maybe Text
sourceFields :: Prelude.Maybe Prelude.Text,
LiteralArrayOptions -> Maybe Bool
returnEnabled :: Prelude.Maybe Prelude.Bool,
LiteralArrayOptions -> Maybe Bool
facetEnabled :: Prelude.Maybe Prelude.Bool,
LiteralArrayOptions -> Maybe Bool
searchEnabled :: Prelude.Maybe Prelude.Bool,
LiteralArrayOptions -> Maybe Text
defaultValue :: Prelude.Maybe Prelude.Text
}
deriving (LiteralArrayOptions -> LiteralArrayOptions -> Bool
(LiteralArrayOptions -> LiteralArrayOptions -> Bool)
-> (LiteralArrayOptions -> LiteralArrayOptions -> Bool)
-> Eq LiteralArrayOptions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LiteralArrayOptions -> LiteralArrayOptions -> Bool
$c/= :: LiteralArrayOptions -> LiteralArrayOptions -> Bool
== :: LiteralArrayOptions -> LiteralArrayOptions -> Bool
$c== :: LiteralArrayOptions -> LiteralArrayOptions -> Bool
Prelude.Eq, ReadPrec [LiteralArrayOptions]
ReadPrec LiteralArrayOptions
Int -> ReadS LiteralArrayOptions
ReadS [LiteralArrayOptions]
(Int -> ReadS LiteralArrayOptions)
-> ReadS [LiteralArrayOptions]
-> ReadPrec LiteralArrayOptions
-> ReadPrec [LiteralArrayOptions]
-> Read LiteralArrayOptions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LiteralArrayOptions]
$creadListPrec :: ReadPrec [LiteralArrayOptions]
readPrec :: ReadPrec LiteralArrayOptions
$creadPrec :: ReadPrec LiteralArrayOptions
readList :: ReadS [LiteralArrayOptions]
$creadList :: ReadS [LiteralArrayOptions]
readsPrec :: Int -> ReadS LiteralArrayOptions
$creadsPrec :: Int -> ReadS LiteralArrayOptions
Prelude.Read, Int -> LiteralArrayOptions -> ShowS
[LiteralArrayOptions] -> ShowS
LiteralArrayOptions -> String
(Int -> LiteralArrayOptions -> ShowS)
-> (LiteralArrayOptions -> String)
-> ([LiteralArrayOptions] -> ShowS)
-> Show LiteralArrayOptions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LiteralArrayOptions] -> ShowS
$cshowList :: [LiteralArrayOptions] -> ShowS
show :: LiteralArrayOptions -> String
$cshow :: LiteralArrayOptions -> String
showsPrec :: Int -> LiteralArrayOptions -> ShowS
$cshowsPrec :: Int -> LiteralArrayOptions -> ShowS
Prelude.Show, (forall x. LiteralArrayOptions -> Rep LiteralArrayOptions x)
-> (forall x. Rep LiteralArrayOptions x -> LiteralArrayOptions)
-> Generic LiteralArrayOptions
forall x. Rep LiteralArrayOptions x -> LiteralArrayOptions
forall x. LiteralArrayOptions -> Rep LiteralArrayOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LiteralArrayOptions x -> LiteralArrayOptions
$cfrom :: forall x. LiteralArrayOptions -> Rep LiteralArrayOptions x
Prelude.Generic)
newLiteralArrayOptions ::
LiteralArrayOptions
newLiteralArrayOptions :: LiteralArrayOptions
newLiteralArrayOptions =
LiteralArrayOptions' :: Maybe Text
-> Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> Maybe Text
-> LiteralArrayOptions
LiteralArrayOptions'
{ $sel:sourceFields:LiteralArrayOptions' :: Maybe Text
sourceFields =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:returnEnabled:LiteralArrayOptions' :: Maybe Bool
returnEnabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:facetEnabled:LiteralArrayOptions' :: Maybe Bool
facetEnabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:searchEnabled:LiteralArrayOptions' :: Maybe Bool
searchEnabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:defaultValue:LiteralArrayOptions' :: Maybe Text
defaultValue = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
literalArrayOptions_sourceFields :: Lens.Lens' LiteralArrayOptions (Prelude.Maybe Prelude.Text)
literalArrayOptions_sourceFields :: (Maybe Text -> f (Maybe Text))
-> LiteralArrayOptions -> f LiteralArrayOptions
literalArrayOptions_sourceFields = (LiteralArrayOptions -> Maybe Text)
-> (LiteralArrayOptions -> Maybe Text -> LiteralArrayOptions)
-> Lens
LiteralArrayOptions LiteralArrayOptions (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LiteralArrayOptions' {Maybe Text
sourceFields :: Maybe Text
$sel:sourceFields:LiteralArrayOptions' :: LiteralArrayOptions -> Maybe Text
sourceFields} -> Maybe Text
sourceFields) (\s :: LiteralArrayOptions
s@LiteralArrayOptions' {} Maybe Text
a -> LiteralArrayOptions
s {$sel:sourceFields:LiteralArrayOptions' :: Maybe Text
sourceFields = Maybe Text
a} :: LiteralArrayOptions)
literalArrayOptions_returnEnabled :: Lens.Lens' LiteralArrayOptions (Prelude.Maybe Prelude.Bool)
literalArrayOptions_returnEnabled :: (Maybe Bool -> f (Maybe Bool))
-> LiteralArrayOptions -> f LiteralArrayOptions
literalArrayOptions_returnEnabled = (LiteralArrayOptions -> Maybe Bool)
-> (LiteralArrayOptions -> Maybe Bool -> LiteralArrayOptions)
-> Lens
LiteralArrayOptions LiteralArrayOptions (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LiteralArrayOptions' {Maybe Bool
returnEnabled :: Maybe Bool
$sel:returnEnabled:LiteralArrayOptions' :: LiteralArrayOptions -> Maybe Bool
returnEnabled} -> Maybe Bool
returnEnabled) (\s :: LiteralArrayOptions
s@LiteralArrayOptions' {} Maybe Bool
a -> LiteralArrayOptions
s {$sel:returnEnabled:LiteralArrayOptions' :: Maybe Bool
returnEnabled = Maybe Bool
a} :: LiteralArrayOptions)
literalArrayOptions_facetEnabled :: Lens.Lens' LiteralArrayOptions (Prelude.Maybe Prelude.Bool)
literalArrayOptions_facetEnabled :: (Maybe Bool -> f (Maybe Bool))
-> LiteralArrayOptions -> f LiteralArrayOptions
literalArrayOptions_facetEnabled = (LiteralArrayOptions -> Maybe Bool)
-> (LiteralArrayOptions -> Maybe Bool -> LiteralArrayOptions)
-> Lens
LiteralArrayOptions LiteralArrayOptions (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LiteralArrayOptions' {Maybe Bool
facetEnabled :: Maybe Bool
$sel:facetEnabled:LiteralArrayOptions' :: LiteralArrayOptions -> Maybe Bool
facetEnabled} -> Maybe Bool
facetEnabled) (\s :: LiteralArrayOptions
s@LiteralArrayOptions' {} Maybe Bool
a -> LiteralArrayOptions
s {$sel:facetEnabled:LiteralArrayOptions' :: Maybe Bool
facetEnabled = Maybe Bool
a} :: LiteralArrayOptions)
literalArrayOptions_searchEnabled :: Lens.Lens' LiteralArrayOptions (Prelude.Maybe Prelude.Bool)
literalArrayOptions_searchEnabled :: (Maybe Bool -> f (Maybe Bool))
-> LiteralArrayOptions -> f LiteralArrayOptions
literalArrayOptions_searchEnabled = (LiteralArrayOptions -> Maybe Bool)
-> (LiteralArrayOptions -> Maybe Bool -> LiteralArrayOptions)
-> Lens
LiteralArrayOptions LiteralArrayOptions (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LiteralArrayOptions' {Maybe Bool
searchEnabled :: Maybe Bool
$sel:searchEnabled:LiteralArrayOptions' :: LiteralArrayOptions -> Maybe Bool
searchEnabled} -> Maybe Bool
searchEnabled) (\s :: LiteralArrayOptions
s@LiteralArrayOptions' {} Maybe Bool
a -> LiteralArrayOptions
s {$sel:searchEnabled:LiteralArrayOptions' :: Maybe Bool
searchEnabled = Maybe Bool
a} :: LiteralArrayOptions)
literalArrayOptions_defaultValue :: Lens.Lens' LiteralArrayOptions (Prelude.Maybe Prelude.Text)
literalArrayOptions_defaultValue :: (Maybe Text -> f (Maybe Text))
-> LiteralArrayOptions -> f LiteralArrayOptions
literalArrayOptions_defaultValue = (LiteralArrayOptions -> Maybe Text)
-> (LiteralArrayOptions -> Maybe Text -> LiteralArrayOptions)
-> Lens
LiteralArrayOptions LiteralArrayOptions (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LiteralArrayOptions' {Maybe Text
defaultValue :: Maybe Text
$sel:defaultValue:LiteralArrayOptions' :: LiteralArrayOptions -> Maybe Text
defaultValue} -> Maybe Text
defaultValue) (\s :: LiteralArrayOptions
s@LiteralArrayOptions' {} Maybe Text
a -> LiteralArrayOptions
s {$sel:defaultValue:LiteralArrayOptions' :: Maybe Text
defaultValue = Maybe Text
a} :: LiteralArrayOptions)
instance Core.FromXML LiteralArrayOptions where
parseXML :: [Node] -> Either String LiteralArrayOptions
parseXML [Node]
x =
Maybe Text
-> Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> Maybe Text
-> LiteralArrayOptions
LiteralArrayOptions'
(Maybe Text
-> Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> Maybe Text
-> LiteralArrayOptions)
-> Either String (Maybe Text)
-> Either
String
(Maybe Bool
-> Maybe Bool -> Maybe Bool -> Maybe Text -> LiteralArrayOptions)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"SourceFields")
Either
String
(Maybe Bool
-> Maybe Bool -> Maybe Bool -> Maybe Text -> LiteralArrayOptions)
-> Either String (Maybe Bool)
-> Either
String
(Maybe Bool -> Maybe Bool -> Maybe Text -> LiteralArrayOptions)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Bool)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ReturnEnabled")
Either
String
(Maybe Bool -> Maybe Bool -> Maybe Text -> LiteralArrayOptions)
-> Either String (Maybe Bool)
-> Either String (Maybe Bool -> Maybe Text -> LiteralArrayOptions)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Bool)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"FacetEnabled")
Either String (Maybe Bool -> Maybe Text -> LiteralArrayOptions)
-> Either String (Maybe Bool)
-> Either String (Maybe Text -> LiteralArrayOptions)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Bool)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"SearchEnabled")
Either String (Maybe Text -> LiteralArrayOptions)
-> Either String (Maybe Text) -> Either String LiteralArrayOptions
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"DefaultValue")
instance Prelude.Hashable LiteralArrayOptions
instance Prelude.NFData LiteralArrayOptions
instance Core.ToQuery LiteralArrayOptions where
toQuery :: LiteralArrayOptions -> QueryString
toQuery LiteralArrayOptions' {Maybe Bool
Maybe Text
defaultValue :: Maybe Text
searchEnabled :: Maybe Bool
facetEnabled :: Maybe Bool
returnEnabled :: Maybe Bool
sourceFields :: Maybe Text
$sel:defaultValue:LiteralArrayOptions' :: LiteralArrayOptions -> Maybe Text
$sel:searchEnabled:LiteralArrayOptions' :: LiteralArrayOptions -> Maybe Bool
$sel:facetEnabled:LiteralArrayOptions' :: LiteralArrayOptions -> Maybe Bool
$sel:returnEnabled:LiteralArrayOptions' :: LiteralArrayOptions -> Maybe Bool
$sel:sourceFields:LiteralArrayOptions' :: LiteralArrayOptions -> Maybe Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"SourceFields" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
sourceFields,
ByteString
"ReturnEnabled" ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
returnEnabled,
ByteString
"FacetEnabled" ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
facetEnabled,
ByteString
"SearchEnabled" ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
searchEnabled,
ByteString
"DefaultValue" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
defaultValue
]