{-# 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.DoubleOptions where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data DoubleOptions = DoubleOptions'
{
DoubleOptions -> Maybe Text
sourceField :: Prelude.Maybe Prelude.Text,
DoubleOptions -> Maybe Bool
returnEnabled :: Prelude.Maybe Prelude.Bool,
DoubleOptions -> Maybe Bool
facetEnabled :: Prelude.Maybe Prelude.Bool,
DoubleOptions -> Maybe Bool
searchEnabled :: Prelude.Maybe Prelude.Bool,
DoubleOptions -> Maybe Bool
sortEnabled :: Prelude.Maybe Prelude.Bool,
DoubleOptions -> Maybe Double
defaultValue :: Prelude.Maybe Prelude.Double
}
deriving (DoubleOptions -> DoubleOptions -> Bool
(DoubleOptions -> DoubleOptions -> Bool)
-> (DoubleOptions -> DoubleOptions -> Bool) -> Eq DoubleOptions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DoubleOptions -> DoubleOptions -> Bool
$c/= :: DoubleOptions -> DoubleOptions -> Bool
== :: DoubleOptions -> DoubleOptions -> Bool
$c== :: DoubleOptions -> DoubleOptions -> Bool
Prelude.Eq, ReadPrec [DoubleOptions]
ReadPrec DoubleOptions
Int -> ReadS DoubleOptions
ReadS [DoubleOptions]
(Int -> ReadS DoubleOptions)
-> ReadS [DoubleOptions]
-> ReadPrec DoubleOptions
-> ReadPrec [DoubleOptions]
-> Read DoubleOptions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DoubleOptions]
$creadListPrec :: ReadPrec [DoubleOptions]
readPrec :: ReadPrec DoubleOptions
$creadPrec :: ReadPrec DoubleOptions
readList :: ReadS [DoubleOptions]
$creadList :: ReadS [DoubleOptions]
readsPrec :: Int -> ReadS DoubleOptions
$creadsPrec :: Int -> ReadS DoubleOptions
Prelude.Read, Int -> DoubleOptions -> ShowS
[DoubleOptions] -> ShowS
DoubleOptions -> String
(Int -> DoubleOptions -> ShowS)
-> (DoubleOptions -> String)
-> ([DoubleOptions] -> ShowS)
-> Show DoubleOptions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DoubleOptions] -> ShowS
$cshowList :: [DoubleOptions] -> ShowS
show :: DoubleOptions -> String
$cshow :: DoubleOptions -> String
showsPrec :: Int -> DoubleOptions -> ShowS
$cshowsPrec :: Int -> DoubleOptions -> ShowS
Prelude.Show, (forall x. DoubleOptions -> Rep DoubleOptions x)
-> (forall x. Rep DoubleOptions x -> DoubleOptions)
-> Generic DoubleOptions
forall x. Rep DoubleOptions x -> DoubleOptions
forall x. DoubleOptions -> Rep DoubleOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DoubleOptions x -> DoubleOptions
$cfrom :: forall x. DoubleOptions -> Rep DoubleOptions x
Prelude.Generic)
newDoubleOptions ::
DoubleOptions
newDoubleOptions :: DoubleOptions
newDoubleOptions =
DoubleOptions' :: Maybe Text
-> Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> Maybe Double
-> DoubleOptions
DoubleOptions'
{ $sel:sourceField:DoubleOptions' :: Maybe Text
sourceField = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:returnEnabled:DoubleOptions' :: Maybe Bool
returnEnabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:facetEnabled:DoubleOptions' :: Maybe Bool
facetEnabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:searchEnabled:DoubleOptions' :: Maybe Bool
searchEnabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:sortEnabled:DoubleOptions' :: Maybe Bool
sortEnabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:defaultValue:DoubleOptions' :: Maybe Double
defaultValue = Maybe Double
forall a. Maybe a
Prelude.Nothing
}
doubleOptions_sourceField :: Lens.Lens' DoubleOptions (Prelude.Maybe Prelude.Text)
doubleOptions_sourceField :: (Maybe Text -> f (Maybe Text)) -> DoubleOptions -> f DoubleOptions
doubleOptions_sourceField = (DoubleOptions -> Maybe Text)
-> (DoubleOptions -> Maybe Text -> DoubleOptions)
-> Lens DoubleOptions DoubleOptions (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DoubleOptions' {Maybe Text
sourceField :: Maybe Text
$sel:sourceField:DoubleOptions' :: DoubleOptions -> Maybe Text
sourceField} -> Maybe Text
sourceField) (\s :: DoubleOptions
s@DoubleOptions' {} Maybe Text
a -> DoubleOptions
s {$sel:sourceField:DoubleOptions' :: Maybe Text
sourceField = Maybe Text
a} :: DoubleOptions)
doubleOptions_returnEnabled :: Lens.Lens' DoubleOptions (Prelude.Maybe Prelude.Bool)
doubleOptions_returnEnabled :: (Maybe Bool -> f (Maybe Bool)) -> DoubleOptions -> f DoubleOptions
doubleOptions_returnEnabled = (DoubleOptions -> Maybe Bool)
-> (DoubleOptions -> Maybe Bool -> DoubleOptions)
-> Lens DoubleOptions DoubleOptions (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DoubleOptions' {Maybe Bool
returnEnabled :: Maybe Bool
$sel:returnEnabled:DoubleOptions' :: DoubleOptions -> Maybe Bool
returnEnabled} -> Maybe Bool
returnEnabled) (\s :: DoubleOptions
s@DoubleOptions' {} Maybe Bool
a -> DoubleOptions
s {$sel:returnEnabled:DoubleOptions' :: Maybe Bool
returnEnabled = Maybe Bool
a} :: DoubleOptions)
doubleOptions_facetEnabled :: Lens.Lens' DoubleOptions (Prelude.Maybe Prelude.Bool)
doubleOptions_facetEnabled :: (Maybe Bool -> f (Maybe Bool)) -> DoubleOptions -> f DoubleOptions
doubleOptions_facetEnabled = (DoubleOptions -> Maybe Bool)
-> (DoubleOptions -> Maybe Bool -> DoubleOptions)
-> Lens DoubleOptions DoubleOptions (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DoubleOptions' {Maybe Bool
facetEnabled :: Maybe Bool
$sel:facetEnabled:DoubleOptions' :: DoubleOptions -> Maybe Bool
facetEnabled} -> Maybe Bool
facetEnabled) (\s :: DoubleOptions
s@DoubleOptions' {} Maybe Bool
a -> DoubleOptions
s {$sel:facetEnabled:DoubleOptions' :: Maybe Bool
facetEnabled = Maybe Bool
a} :: DoubleOptions)
doubleOptions_searchEnabled :: Lens.Lens' DoubleOptions (Prelude.Maybe Prelude.Bool)
doubleOptions_searchEnabled :: (Maybe Bool -> f (Maybe Bool)) -> DoubleOptions -> f DoubleOptions
doubleOptions_searchEnabled = (DoubleOptions -> Maybe Bool)
-> (DoubleOptions -> Maybe Bool -> DoubleOptions)
-> Lens DoubleOptions DoubleOptions (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DoubleOptions' {Maybe Bool
searchEnabled :: Maybe Bool
$sel:searchEnabled:DoubleOptions' :: DoubleOptions -> Maybe Bool
searchEnabled} -> Maybe Bool
searchEnabled) (\s :: DoubleOptions
s@DoubleOptions' {} Maybe Bool
a -> DoubleOptions
s {$sel:searchEnabled:DoubleOptions' :: Maybe Bool
searchEnabled = Maybe Bool
a} :: DoubleOptions)
doubleOptions_sortEnabled :: Lens.Lens' DoubleOptions (Prelude.Maybe Prelude.Bool)
doubleOptions_sortEnabled :: (Maybe Bool -> f (Maybe Bool)) -> DoubleOptions -> f DoubleOptions
doubleOptions_sortEnabled = (DoubleOptions -> Maybe Bool)
-> (DoubleOptions -> Maybe Bool -> DoubleOptions)
-> Lens DoubleOptions DoubleOptions (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DoubleOptions' {Maybe Bool
sortEnabled :: Maybe Bool
$sel:sortEnabled:DoubleOptions' :: DoubleOptions -> Maybe Bool
sortEnabled} -> Maybe Bool
sortEnabled) (\s :: DoubleOptions
s@DoubleOptions' {} Maybe Bool
a -> DoubleOptions
s {$sel:sortEnabled:DoubleOptions' :: Maybe Bool
sortEnabled = Maybe Bool
a} :: DoubleOptions)
doubleOptions_defaultValue :: Lens.Lens' DoubleOptions (Prelude.Maybe Prelude.Double)
doubleOptions_defaultValue :: (Maybe Double -> f (Maybe Double))
-> DoubleOptions -> f DoubleOptions
doubleOptions_defaultValue = (DoubleOptions -> Maybe Double)
-> (DoubleOptions -> Maybe Double -> DoubleOptions)
-> Lens DoubleOptions DoubleOptions (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DoubleOptions' {Maybe Double
defaultValue :: Maybe Double
$sel:defaultValue:DoubleOptions' :: DoubleOptions -> Maybe Double
defaultValue} -> Maybe Double
defaultValue) (\s :: DoubleOptions
s@DoubleOptions' {} Maybe Double
a -> DoubleOptions
s {$sel:defaultValue:DoubleOptions' :: Maybe Double
defaultValue = Maybe Double
a} :: DoubleOptions)
instance Core.FromXML DoubleOptions where
parseXML :: [Node] -> Either String DoubleOptions
parseXML [Node]
x =
Maybe Text
-> Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> Maybe Double
-> DoubleOptions
DoubleOptions'
(Maybe Text
-> Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> Maybe Double
-> DoubleOptions)
-> Either String (Maybe Text)
-> Either
String
(Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> Maybe Double
-> DoubleOptions)
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
"SourceField")
Either
String
(Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> Maybe Double
-> DoubleOptions)
-> Either String (Maybe Bool)
-> Either
String
(Maybe Bool
-> Maybe Bool -> Maybe Bool -> Maybe Double -> DoubleOptions)
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 Bool -> Maybe Double -> DoubleOptions)
-> Either String (Maybe Bool)
-> Either
String (Maybe Bool -> Maybe Bool -> Maybe Double -> DoubleOptions)
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 Bool -> Maybe Double -> DoubleOptions)
-> Either String (Maybe Bool)
-> Either String (Maybe Bool -> Maybe Double -> DoubleOptions)
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 Bool -> Maybe Double -> DoubleOptions)
-> Either String (Maybe Bool)
-> Either String (Maybe Double -> DoubleOptions)
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
"SortEnabled")
Either String (Maybe Double -> DoubleOptions)
-> Either String (Maybe Double) -> Either String DoubleOptions
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Double)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"DefaultValue")
instance Prelude.Hashable DoubleOptions
instance Prelude.NFData DoubleOptions
instance Core.ToQuery DoubleOptions where
toQuery :: DoubleOptions -> QueryString
toQuery DoubleOptions' {Maybe Bool
Maybe Double
Maybe Text
defaultValue :: Maybe Double
sortEnabled :: Maybe Bool
searchEnabled :: Maybe Bool
facetEnabled :: Maybe Bool
returnEnabled :: Maybe Bool
sourceField :: Maybe Text
$sel:defaultValue:DoubleOptions' :: DoubleOptions -> Maybe Double
$sel:sortEnabled:DoubleOptions' :: DoubleOptions -> Maybe Bool
$sel:searchEnabled:DoubleOptions' :: DoubleOptions -> Maybe Bool
$sel:facetEnabled:DoubleOptions' :: DoubleOptions -> Maybe Bool
$sel:returnEnabled:DoubleOptions' :: DoubleOptions -> Maybe Bool
$sel:sourceField:DoubleOptions' :: DoubleOptions -> Maybe Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"SourceField" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
sourceField,
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
"SortEnabled" ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
sortEnabled,
ByteString
"DefaultValue" ByteString -> Maybe Double -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Double
defaultValue
]