{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data DoubleOptions = DoubleOptions'
{
DoubleOptions -> Maybe Double
defaultValue :: Prelude.Maybe Prelude.Double,
DoubleOptions -> Maybe Bool
facetEnabled :: Prelude.Maybe Prelude.Bool,
DoubleOptions -> Maybe Bool
returnEnabled :: Prelude.Maybe Prelude.Bool,
DoubleOptions -> Maybe Bool
searchEnabled :: Prelude.Maybe Prelude.Bool,
DoubleOptions -> Maybe Bool
sortEnabled :: Prelude.Maybe Prelude.Bool,
DoubleOptions -> Maybe Text
sourceField :: Prelude.Maybe Prelude.Text
}
deriving (DoubleOptions -> DoubleOptions -> Bool
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]
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
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. 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'
{ $sel:defaultValue:DoubleOptions' :: Maybe Double
defaultValue = forall a. Maybe a
Prelude.Nothing,
$sel:facetEnabled:DoubleOptions' :: Maybe Bool
facetEnabled = forall a. Maybe a
Prelude.Nothing,
$sel:returnEnabled:DoubleOptions' :: Maybe Bool
returnEnabled = forall a. Maybe a
Prelude.Nothing,
$sel:searchEnabled:DoubleOptions' :: Maybe Bool
searchEnabled = forall a. Maybe a
Prelude.Nothing,
$sel:sortEnabled:DoubleOptions' :: Maybe Bool
sortEnabled = forall a. Maybe a
Prelude.Nothing,
$sel:sourceField:DoubleOptions' :: Maybe Text
sourceField = forall a. Maybe a
Prelude.Nothing
}
doubleOptions_defaultValue :: Lens.Lens' DoubleOptions (Prelude.Maybe Prelude.Double)
doubleOptions_defaultValue :: Lens' DoubleOptions (Maybe Double)
doubleOptions_defaultValue = 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)
doubleOptions_facetEnabled :: Lens.Lens' DoubleOptions (Prelude.Maybe Prelude.Bool)
doubleOptions_facetEnabled :: Lens' DoubleOptions (Maybe Bool)
doubleOptions_facetEnabled = 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_returnEnabled :: Lens.Lens' DoubleOptions (Prelude.Maybe Prelude.Bool)
doubleOptions_returnEnabled :: Lens' DoubleOptions (Maybe Bool)
doubleOptions_returnEnabled = 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_searchEnabled :: Lens.Lens' DoubleOptions (Prelude.Maybe Prelude.Bool)
doubleOptions_searchEnabled :: Lens' DoubleOptions (Maybe Bool)
doubleOptions_searchEnabled = 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 :: Lens' DoubleOptions (Maybe Bool)
doubleOptions_sortEnabled = 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_sourceField :: Lens.Lens' DoubleOptions (Prelude.Maybe Prelude.Text)
doubleOptions_sourceField :: Lens' DoubleOptions (Maybe Text)
doubleOptions_sourceField = 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)
instance Data.FromXML DoubleOptions where
parseXML :: [Node] -> Either String DoubleOptions
parseXML [Node]
x =
Maybe Double
-> Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> Maybe Text
-> DoubleOptions
DoubleOptions'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"DefaultValue")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"FacetEnabled")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"ReturnEnabled")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"SearchEnabled")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"SortEnabled")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"SourceField")
instance Prelude.Hashable DoubleOptions where
hashWithSalt :: Int -> DoubleOptions -> Int
hashWithSalt Int
_salt DoubleOptions' {Maybe Bool
Maybe Double
Maybe Text
sourceField :: Maybe Text
sortEnabled :: Maybe Bool
searchEnabled :: Maybe Bool
returnEnabled :: Maybe Bool
facetEnabled :: Maybe Bool
defaultValue :: Maybe Double
$sel:sourceField:DoubleOptions' :: DoubleOptions -> Maybe Text
$sel:sortEnabled:DoubleOptions' :: DoubleOptions -> Maybe Bool
$sel:searchEnabled:DoubleOptions' :: DoubleOptions -> Maybe Bool
$sel:returnEnabled:DoubleOptions' :: DoubleOptions -> Maybe Bool
$sel:facetEnabled:DoubleOptions' :: DoubleOptions -> Maybe Bool
$sel:defaultValue:DoubleOptions' :: DoubleOptions -> Maybe Double
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
defaultValue
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
facetEnabled
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
returnEnabled
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
searchEnabled
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
sortEnabled
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
sourceField
instance Prelude.NFData DoubleOptions where
rnf :: DoubleOptions -> ()
rnf DoubleOptions' {Maybe Bool
Maybe Double
Maybe Text
sourceField :: Maybe Text
sortEnabled :: Maybe Bool
searchEnabled :: Maybe Bool
returnEnabled :: Maybe Bool
facetEnabled :: Maybe Bool
defaultValue :: Maybe Double
$sel:sourceField:DoubleOptions' :: DoubleOptions -> Maybe Text
$sel:sortEnabled:DoubleOptions' :: DoubleOptions -> Maybe Bool
$sel:searchEnabled:DoubleOptions' :: DoubleOptions -> Maybe Bool
$sel:returnEnabled:DoubleOptions' :: DoubleOptions -> Maybe Bool
$sel:facetEnabled:DoubleOptions' :: DoubleOptions -> Maybe Bool
$sel:defaultValue:DoubleOptions' :: DoubleOptions -> Maybe Double
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
defaultValue
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
facetEnabled
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
returnEnabled
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
searchEnabled
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
sortEnabled
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
sourceField
instance Data.ToQuery DoubleOptions where
toQuery :: DoubleOptions -> QueryString
toQuery DoubleOptions' {Maybe Bool
Maybe Double
Maybe Text
sourceField :: Maybe Text
sortEnabled :: Maybe Bool
searchEnabled :: Maybe Bool
returnEnabled :: Maybe Bool
facetEnabled :: Maybe Bool
defaultValue :: Maybe Double
$sel:sourceField:DoubleOptions' :: DoubleOptions -> Maybe Text
$sel:sortEnabled:DoubleOptions' :: DoubleOptions -> Maybe Bool
$sel:searchEnabled:DoubleOptions' :: DoubleOptions -> Maybe Bool
$sel:returnEnabled:DoubleOptions' :: DoubleOptions -> Maybe Bool
$sel:facetEnabled:DoubleOptions' :: DoubleOptions -> Maybe Bool
$sel:defaultValue:DoubleOptions' :: DoubleOptions -> Maybe Double
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"DefaultValue" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Double
defaultValue,
ByteString
"FacetEnabled" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
facetEnabled,
ByteString
"ReturnEnabled" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
returnEnabled,
ByteString
"SearchEnabled" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
searchEnabled,
ByteString
"SortEnabled" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
sortEnabled,
ByteString
"SourceField" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
sourceField
]