{-# 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.AnalysisOptions where
import Amazonka.CloudSearch.Types.AlgorithmicStemming
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AnalysisOptions = AnalysisOptions'
{
AnalysisOptions -> Maybe AlgorithmicStemming
algorithmicStemming :: Prelude.Maybe AlgorithmicStemming,
AnalysisOptions -> Maybe Text
stopwords :: Prelude.Maybe Prelude.Text,
AnalysisOptions -> Maybe Text
japaneseTokenizationDictionary :: Prelude.Maybe Prelude.Text,
AnalysisOptions -> Maybe Text
synonyms :: Prelude.Maybe Prelude.Text,
AnalysisOptions -> Maybe Text
stemmingDictionary :: Prelude.Maybe Prelude.Text
}
deriving (AnalysisOptions -> AnalysisOptions -> Bool
(AnalysisOptions -> AnalysisOptions -> Bool)
-> (AnalysisOptions -> AnalysisOptions -> Bool)
-> Eq AnalysisOptions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AnalysisOptions -> AnalysisOptions -> Bool
$c/= :: AnalysisOptions -> AnalysisOptions -> Bool
== :: AnalysisOptions -> AnalysisOptions -> Bool
$c== :: AnalysisOptions -> AnalysisOptions -> Bool
Prelude.Eq, ReadPrec [AnalysisOptions]
ReadPrec AnalysisOptions
Int -> ReadS AnalysisOptions
ReadS [AnalysisOptions]
(Int -> ReadS AnalysisOptions)
-> ReadS [AnalysisOptions]
-> ReadPrec AnalysisOptions
-> ReadPrec [AnalysisOptions]
-> Read AnalysisOptions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AnalysisOptions]
$creadListPrec :: ReadPrec [AnalysisOptions]
readPrec :: ReadPrec AnalysisOptions
$creadPrec :: ReadPrec AnalysisOptions
readList :: ReadS [AnalysisOptions]
$creadList :: ReadS [AnalysisOptions]
readsPrec :: Int -> ReadS AnalysisOptions
$creadsPrec :: Int -> ReadS AnalysisOptions
Prelude.Read, Int -> AnalysisOptions -> ShowS
[AnalysisOptions] -> ShowS
AnalysisOptions -> String
(Int -> AnalysisOptions -> ShowS)
-> (AnalysisOptions -> String)
-> ([AnalysisOptions] -> ShowS)
-> Show AnalysisOptions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AnalysisOptions] -> ShowS
$cshowList :: [AnalysisOptions] -> ShowS
show :: AnalysisOptions -> String
$cshow :: AnalysisOptions -> String
showsPrec :: Int -> AnalysisOptions -> ShowS
$cshowsPrec :: Int -> AnalysisOptions -> ShowS
Prelude.Show, (forall x. AnalysisOptions -> Rep AnalysisOptions x)
-> (forall x. Rep AnalysisOptions x -> AnalysisOptions)
-> Generic AnalysisOptions
forall x. Rep AnalysisOptions x -> AnalysisOptions
forall x. AnalysisOptions -> Rep AnalysisOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AnalysisOptions x -> AnalysisOptions
$cfrom :: forall x. AnalysisOptions -> Rep AnalysisOptions x
Prelude.Generic)
newAnalysisOptions ::
AnalysisOptions
newAnalysisOptions :: AnalysisOptions
newAnalysisOptions =
AnalysisOptions' :: Maybe AlgorithmicStemming
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> AnalysisOptions
AnalysisOptions'
{ $sel:algorithmicStemming:AnalysisOptions' :: Maybe AlgorithmicStemming
algorithmicStemming =
Maybe AlgorithmicStemming
forall a. Maybe a
Prelude.Nothing,
$sel:stopwords:AnalysisOptions' :: Maybe Text
stopwords = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:japaneseTokenizationDictionary:AnalysisOptions' :: Maybe Text
japaneseTokenizationDictionary = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:synonyms:AnalysisOptions' :: Maybe Text
synonyms = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:stemmingDictionary:AnalysisOptions' :: Maybe Text
stemmingDictionary = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
analysisOptions_algorithmicStemming :: Lens.Lens' AnalysisOptions (Prelude.Maybe AlgorithmicStemming)
analysisOptions_algorithmicStemming :: (Maybe AlgorithmicStemming -> f (Maybe AlgorithmicStemming))
-> AnalysisOptions -> f AnalysisOptions
analysisOptions_algorithmicStemming = (AnalysisOptions -> Maybe AlgorithmicStemming)
-> (AnalysisOptions
-> Maybe AlgorithmicStemming -> AnalysisOptions)
-> Lens
AnalysisOptions
AnalysisOptions
(Maybe AlgorithmicStemming)
(Maybe AlgorithmicStemming)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AnalysisOptions' {Maybe AlgorithmicStemming
algorithmicStemming :: Maybe AlgorithmicStemming
$sel:algorithmicStemming:AnalysisOptions' :: AnalysisOptions -> Maybe AlgorithmicStemming
algorithmicStemming} -> Maybe AlgorithmicStemming
algorithmicStemming) (\s :: AnalysisOptions
s@AnalysisOptions' {} Maybe AlgorithmicStemming
a -> AnalysisOptions
s {$sel:algorithmicStemming:AnalysisOptions' :: Maybe AlgorithmicStemming
algorithmicStemming = Maybe AlgorithmicStemming
a} :: AnalysisOptions)
analysisOptions_stopwords :: Lens.Lens' AnalysisOptions (Prelude.Maybe Prelude.Text)
analysisOptions_stopwords :: (Maybe Text -> f (Maybe Text))
-> AnalysisOptions -> f AnalysisOptions
analysisOptions_stopwords = (AnalysisOptions -> Maybe Text)
-> (AnalysisOptions -> Maybe Text -> AnalysisOptions)
-> Lens AnalysisOptions AnalysisOptions (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AnalysisOptions' {Maybe Text
stopwords :: Maybe Text
$sel:stopwords:AnalysisOptions' :: AnalysisOptions -> Maybe Text
stopwords} -> Maybe Text
stopwords) (\s :: AnalysisOptions
s@AnalysisOptions' {} Maybe Text
a -> AnalysisOptions
s {$sel:stopwords:AnalysisOptions' :: Maybe Text
stopwords = Maybe Text
a} :: AnalysisOptions)
analysisOptions_japaneseTokenizationDictionary :: Lens.Lens' AnalysisOptions (Prelude.Maybe Prelude.Text)
analysisOptions_japaneseTokenizationDictionary :: (Maybe Text -> f (Maybe Text))
-> AnalysisOptions -> f AnalysisOptions
analysisOptions_japaneseTokenizationDictionary = (AnalysisOptions -> Maybe Text)
-> (AnalysisOptions -> Maybe Text -> AnalysisOptions)
-> Lens AnalysisOptions AnalysisOptions (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AnalysisOptions' {Maybe Text
japaneseTokenizationDictionary :: Maybe Text
$sel:japaneseTokenizationDictionary:AnalysisOptions' :: AnalysisOptions -> Maybe Text
japaneseTokenizationDictionary} -> Maybe Text
japaneseTokenizationDictionary) (\s :: AnalysisOptions
s@AnalysisOptions' {} Maybe Text
a -> AnalysisOptions
s {$sel:japaneseTokenizationDictionary:AnalysisOptions' :: Maybe Text
japaneseTokenizationDictionary = Maybe Text
a} :: AnalysisOptions)
analysisOptions_synonyms :: Lens.Lens' AnalysisOptions (Prelude.Maybe Prelude.Text)
analysisOptions_synonyms :: (Maybe Text -> f (Maybe Text))
-> AnalysisOptions -> f AnalysisOptions
analysisOptions_synonyms = (AnalysisOptions -> Maybe Text)
-> (AnalysisOptions -> Maybe Text -> AnalysisOptions)
-> Lens AnalysisOptions AnalysisOptions (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AnalysisOptions' {Maybe Text
synonyms :: Maybe Text
$sel:synonyms:AnalysisOptions' :: AnalysisOptions -> Maybe Text
synonyms} -> Maybe Text
synonyms) (\s :: AnalysisOptions
s@AnalysisOptions' {} Maybe Text
a -> AnalysisOptions
s {$sel:synonyms:AnalysisOptions' :: Maybe Text
synonyms = Maybe Text
a} :: AnalysisOptions)
analysisOptions_stemmingDictionary :: Lens.Lens' AnalysisOptions (Prelude.Maybe Prelude.Text)
analysisOptions_stemmingDictionary :: (Maybe Text -> f (Maybe Text))
-> AnalysisOptions -> f AnalysisOptions
analysisOptions_stemmingDictionary = (AnalysisOptions -> Maybe Text)
-> (AnalysisOptions -> Maybe Text -> AnalysisOptions)
-> Lens AnalysisOptions AnalysisOptions (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AnalysisOptions' {Maybe Text
stemmingDictionary :: Maybe Text
$sel:stemmingDictionary:AnalysisOptions' :: AnalysisOptions -> Maybe Text
stemmingDictionary} -> Maybe Text
stemmingDictionary) (\s :: AnalysisOptions
s@AnalysisOptions' {} Maybe Text
a -> AnalysisOptions
s {$sel:stemmingDictionary:AnalysisOptions' :: Maybe Text
stemmingDictionary = Maybe Text
a} :: AnalysisOptions)
instance Core.FromXML AnalysisOptions where
parseXML :: [Node] -> Either String AnalysisOptions
parseXML [Node]
x =
Maybe AlgorithmicStemming
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> AnalysisOptions
AnalysisOptions'
(Maybe AlgorithmicStemming
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> AnalysisOptions)
-> Either String (Maybe AlgorithmicStemming)
-> Either
String
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> AnalysisOptions)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe AlgorithmicStemming)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"AlgorithmicStemming")
Either
String
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> AnalysisOptions)
-> Either String (Maybe Text)
-> Either
String (Maybe Text -> Maybe Text -> Maybe Text -> AnalysisOptions)
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
"Stopwords")
Either
String (Maybe Text -> Maybe Text -> Maybe Text -> AnalysisOptions)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Maybe Text -> AnalysisOptions)
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
"JapaneseTokenizationDictionary")
Either String (Maybe Text -> Maybe Text -> AnalysisOptions)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> AnalysisOptions)
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
"Synonyms")
Either String (Maybe Text -> AnalysisOptions)
-> Either String (Maybe Text) -> Either String AnalysisOptions
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
"StemmingDictionary")
instance Prelude.Hashable AnalysisOptions
instance Prelude.NFData AnalysisOptions
instance Core.ToQuery AnalysisOptions where
toQuery :: AnalysisOptions -> QueryString
toQuery AnalysisOptions' {Maybe Text
Maybe AlgorithmicStemming
stemmingDictionary :: Maybe Text
synonyms :: Maybe Text
japaneseTokenizationDictionary :: Maybe Text
stopwords :: Maybe Text
algorithmicStemming :: Maybe AlgorithmicStemming
$sel:stemmingDictionary:AnalysisOptions' :: AnalysisOptions -> Maybe Text
$sel:synonyms:AnalysisOptions' :: AnalysisOptions -> Maybe Text
$sel:japaneseTokenizationDictionary:AnalysisOptions' :: AnalysisOptions -> Maybe Text
$sel:stopwords:AnalysisOptions' :: AnalysisOptions -> Maybe Text
$sel:algorithmicStemming:AnalysisOptions' :: AnalysisOptions -> Maybe AlgorithmicStemming
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"AlgorithmicStemming" ByteString -> Maybe AlgorithmicStemming -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe AlgorithmicStemming
algorithmicStemming,
ByteString
"Stopwords" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
stopwords,
ByteString
"JapaneseTokenizationDictionary"
ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
japaneseTokenizationDictionary,
ByteString
"Synonyms" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
synonyms,
ByteString
"StemmingDictionary" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
stemmingDictionary
]