{-# 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.IntOptions 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 IntOptions = IntOptions'
{
IntOptions -> Maybe Integer
defaultValue :: Prelude.Maybe Prelude.Integer,
IntOptions -> Maybe Bool
facetEnabled :: Prelude.Maybe Prelude.Bool,
IntOptions -> Maybe Bool
returnEnabled :: Prelude.Maybe Prelude.Bool,
IntOptions -> Maybe Bool
searchEnabled :: Prelude.Maybe Prelude.Bool,
IntOptions -> Maybe Bool
sortEnabled :: Prelude.Maybe Prelude.Bool,
IntOptions -> Maybe Text
sourceField :: Prelude.Maybe Prelude.Text
}
deriving (IntOptions -> IntOptions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: IntOptions -> IntOptions -> Bool
$c/= :: IntOptions -> IntOptions -> Bool
== :: IntOptions -> IntOptions -> Bool
$c== :: IntOptions -> IntOptions -> Bool
Prelude.Eq, ReadPrec [IntOptions]
ReadPrec IntOptions
Int -> ReadS IntOptions
ReadS [IntOptions]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [IntOptions]
$creadListPrec :: ReadPrec [IntOptions]
readPrec :: ReadPrec IntOptions
$creadPrec :: ReadPrec IntOptions
readList :: ReadS [IntOptions]
$creadList :: ReadS [IntOptions]
readsPrec :: Int -> ReadS IntOptions
$creadsPrec :: Int -> ReadS IntOptions
Prelude.Read, Int -> IntOptions -> ShowS
[IntOptions] -> ShowS
IntOptions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [IntOptions] -> ShowS
$cshowList :: [IntOptions] -> ShowS
show :: IntOptions -> String
$cshow :: IntOptions -> String
showsPrec :: Int -> IntOptions -> ShowS
$cshowsPrec :: Int -> IntOptions -> ShowS
Prelude.Show, forall x. Rep IntOptions x -> IntOptions
forall x. IntOptions -> Rep IntOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep IntOptions x -> IntOptions
$cfrom :: forall x. IntOptions -> Rep IntOptions x
Prelude.Generic)
newIntOptions ::
IntOptions
newIntOptions :: IntOptions
newIntOptions =
IntOptions'
{ $sel:defaultValue:IntOptions' :: Maybe Integer
defaultValue = forall a. Maybe a
Prelude.Nothing,
$sel:facetEnabled:IntOptions' :: Maybe Bool
facetEnabled = forall a. Maybe a
Prelude.Nothing,
$sel:returnEnabled:IntOptions' :: Maybe Bool
returnEnabled = forall a. Maybe a
Prelude.Nothing,
$sel:searchEnabled:IntOptions' :: Maybe Bool
searchEnabled = forall a. Maybe a
Prelude.Nothing,
$sel:sortEnabled:IntOptions' :: Maybe Bool
sortEnabled = forall a. Maybe a
Prelude.Nothing,
$sel:sourceField:IntOptions' :: Maybe Text
sourceField = forall a. Maybe a
Prelude.Nothing
}
intOptions_defaultValue :: Lens.Lens' IntOptions (Prelude.Maybe Prelude.Integer)
intOptions_defaultValue :: Lens' IntOptions (Maybe Integer)
intOptions_defaultValue = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IntOptions' {Maybe Integer
defaultValue :: Maybe Integer
$sel:defaultValue:IntOptions' :: IntOptions -> Maybe Integer
defaultValue} -> Maybe Integer
defaultValue) (\s :: IntOptions
s@IntOptions' {} Maybe Integer
a -> IntOptions
s {$sel:defaultValue:IntOptions' :: Maybe Integer
defaultValue = Maybe Integer
a} :: IntOptions)
intOptions_facetEnabled :: Lens.Lens' IntOptions (Prelude.Maybe Prelude.Bool)
intOptions_facetEnabled :: Lens' IntOptions (Maybe Bool)
intOptions_facetEnabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IntOptions' {Maybe Bool
facetEnabled :: Maybe Bool
$sel:facetEnabled:IntOptions' :: IntOptions -> Maybe Bool
facetEnabled} -> Maybe Bool
facetEnabled) (\s :: IntOptions
s@IntOptions' {} Maybe Bool
a -> IntOptions
s {$sel:facetEnabled:IntOptions' :: Maybe Bool
facetEnabled = Maybe Bool
a} :: IntOptions)
intOptions_returnEnabled :: Lens.Lens' IntOptions (Prelude.Maybe Prelude.Bool)
intOptions_returnEnabled :: Lens' IntOptions (Maybe Bool)
intOptions_returnEnabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IntOptions' {Maybe Bool
returnEnabled :: Maybe Bool
$sel:returnEnabled:IntOptions' :: IntOptions -> Maybe Bool
returnEnabled} -> Maybe Bool
returnEnabled) (\s :: IntOptions
s@IntOptions' {} Maybe Bool
a -> IntOptions
s {$sel:returnEnabled:IntOptions' :: Maybe Bool
returnEnabled = Maybe Bool
a} :: IntOptions)
intOptions_searchEnabled :: Lens.Lens' IntOptions (Prelude.Maybe Prelude.Bool)
intOptions_searchEnabled :: Lens' IntOptions (Maybe Bool)
intOptions_searchEnabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IntOptions' {Maybe Bool
searchEnabled :: Maybe Bool
$sel:searchEnabled:IntOptions' :: IntOptions -> Maybe Bool
searchEnabled} -> Maybe Bool
searchEnabled) (\s :: IntOptions
s@IntOptions' {} Maybe Bool
a -> IntOptions
s {$sel:searchEnabled:IntOptions' :: Maybe Bool
searchEnabled = Maybe Bool
a} :: IntOptions)
intOptions_sortEnabled :: Lens.Lens' IntOptions (Prelude.Maybe Prelude.Bool)
intOptions_sortEnabled :: Lens' IntOptions (Maybe Bool)
intOptions_sortEnabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IntOptions' {Maybe Bool
sortEnabled :: Maybe Bool
$sel:sortEnabled:IntOptions' :: IntOptions -> Maybe Bool
sortEnabled} -> Maybe Bool
sortEnabled) (\s :: IntOptions
s@IntOptions' {} Maybe Bool
a -> IntOptions
s {$sel:sortEnabled:IntOptions' :: Maybe Bool
sortEnabled = Maybe Bool
a} :: IntOptions)
intOptions_sourceField :: Lens.Lens' IntOptions (Prelude.Maybe Prelude.Text)
intOptions_sourceField :: Lens' IntOptions (Maybe Text)
intOptions_sourceField = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IntOptions' {Maybe Text
sourceField :: Maybe Text
$sel:sourceField:IntOptions' :: IntOptions -> Maybe Text
sourceField} -> Maybe Text
sourceField) (\s :: IntOptions
s@IntOptions' {} Maybe Text
a -> IntOptions
s {$sel:sourceField:IntOptions' :: Maybe Text
sourceField = Maybe Text
a} :: IntOptions)
instance Data.FromXML IntOptions where
parseXML :: [Node] -> Either String IntOptions
parseXML [Node]
x =
Maybe Integer
-> Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> Maybe Text
-> IntOptions
IntOptions'
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 IntOptions where
hashWithSalt :: Int -> IntOptions -> Int
hashWithSalt Int
_salt IntOptions' {Maybe Bool
Maybe Integer
Maybe Text
sourceField :: Maybe Text
sortEnabled :: Maybe Bool
searchEnabled :: Maybe Bool
returnEnabled :: Maybe Bool
facetEnabled :: Maybe Bool
defaultValue :: Maybe Integer
$sel:sourceField:IntOptions' :: IntOptions -> Maybe Text
$sel:sortEnabled:IntOptions' :: IntOptions -> Maybe Bool
$sel:searchEnabled:IntOptions' :: IntOptions -> Maybe Bool
$sel:returnEnabled:IntOptions' :: IntOptions -> Maybe Bool
$sel:facetEnabled:IntOptions' :: IntOptions -> Maybe Bool
$sel:defaultValue:IntOptions' :: IntOptions -> Maybe Integer
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
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 IntOptions where
rnf :: IntOptions -> ()
rnf IntOptions' {Maybe Bool
Maybe Integer
Maybe Text
sourceField :: Maybe Text
sortEnabled :: Maybe Bool
searchEnabled :: Maybe Bool
returnEnabled :: Maybe Bool
facetEnabled :: Maybe Bool
defaultValue :: Maybe Integer
$sel:sourceField:IntOptions' :: IntOptions -> Maybe Text
$sel:sortEnabled:IntOptions' :: IntOptions -> Maybe Bool
$sel:searchEnabled:IntOptions' :: IntOptions -> Maybe Bool
$sel:returnEnabled:IntOptions' :: IntOptions -> Maybe Bool
$sel:facetEnabled:IntOptions' :: IntOptions -> Maybe Bool
$sel:defaultValue:IntOptions' :: IntOptions -> Maybe Integer
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
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 IntOptions where
toQuery :: IntOptions -> QueryString
toQuery IntOptions' {Maybe Bool
Maybe Integer
Maybe Text
sourceField :: Maybe Text
sortEnabled :: Maybe Bool
searchEnabled :: Maybe Bool
returnEnabled :: Maybe Bool
facetEnabled :: Maybe Bool
defaultValue :: Maybe Integer
$sel:sourceField:IntOptions' :: IntOptions -> Maybe Text
$sel:sortEnabled:IntOptions' :: IntOptions -> Maybe Bool
$sel:searchEnabled:IntOptions' :: IntOptions -> Maybe Bool
$sel:returnEnabled:IntOptions' :: IntOptions -> Maybe Bool
$sel:facetEnabled:IntOptions' :: IntOptions -> Maybe Bool
$sel:defaultValue:IntOptions' :: IntOptions -> Maybe Integer
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"DefaultValue" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Integer
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
]