{-# 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.CloudSearchDomains.Types.SuggestionMatch where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data SuggestionMatch = SuggestionMatch'
{
SuggestionMatch -> Maybe Text
suggestion :: Prelude.Maybe Prelude.Text,
SuggestionMatch -> Maybe Integer
score :: Prelude.Maybe Prelude.Integer,
SuggestionMatch -> Maybe Text
id :: Prelude.Maybe Prelude.Text
}
deriving (SuggestionMatch -> SuggestionMatch -> Bool
(SuggestionMatch -> SuggestionMatch -> Bool)
-> (SuggestionMatch -> SuggestionMatch -> Bool)
-> Eq SuggestionMatch
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SuggestionMatch -> SuggestionMatch -> Bool
$c/= :: SuggestionMatch -> SuggestionMatch -> Bool
== :: SuggestionMatch -> SuggestionMatch -> Bool
$c== :: SuggestionMatch -> SuggestionMatch -> Bool
Prelude.Eq, ReadPrec [SuggestionMatch]
ReadPrec SuggestionMatch
Int -> ReadS SuggestionMatch
ReadS [SuggestionMatch]
(Int -> ReadS SuggestionMatch)
-> ReadS [SuggestionMatch]
-> ReadPrec SuggestionMatch
-> ReadPrec [SuggestionMatch]
-> Read SuggestionMatch
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SuggestionMatch]
$creadListPrec :: ReadPrec [SuggestionMatch]
readPrec :: ReadPrec SuggestionMatch
$creadPrec :: ReadPrec SuggestionMatch
readList :: ReadS [SuggestionMatch]
$creadList :: ReadS [SuggestionMatch]
readsPrec :: Int -> ReadS SuggestionMatch
$creadsPrec :: Int -> ReadS SuggestionMatch
Prelude.Read, Int -> SuggestionMatch -> ShowS
[SuggestionMatch] -> ShowS
SuggestionMatch -> String
(Int -> SuggestionMatch -> ShowS)
-> (SuggestionMatch -> String)
-> ([SuggestionMatch] -> ShowS)
-> Show SuggestionMatch
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SuggestionMatch] -> ShowS
$cshowList :: [SuggestionMatch] -> ShowS
show :: SuggestionMatch -> String
$cshow :: SuggestionMatch -> String
showsPrec :: Int -> SuggestionMatch -> ShowS
$cshowsPrec :: Int -> SuggestionMatch -> ShowS
Prelude.Show, (forall x. SuggestionMatch -> Rep SuggestionMatch x)
-> (forall x. Rep SuggestionMatch x -> SuggestionMatch)
-> Generic SuggestionMatch
forall x. Rep SuggestionMatch x -> SuggestionMatch
forall x. SuggestionMatch -> Rep SuggestionMatch x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SuggestionMatch x -> SuggestionMatch
$cfrom :: forall x. SuggestionMatch -> Rep SuggestionMatch x
Prelude.Generic)
newSuggestionMatch ::
SuggestionMatch
newSuggestionMatch :: SuggestionMatch
newSuggestionMatch =
SuggestionMatch' :: Maybe Text -> Maybe Integer -> Maybe Text -> SuggestionMatch
SuggestionMatch'
{ $sel:suggestion:SuggestionMatch' :: Maybe Text
suggestion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:score:SuggestionMatch' :: Maybe Integer
score = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
$sel:id:SuggestionMatch' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
suggestionMatch_suggestion :: Lens.Lens' SuggestionMatch (Prelude.Maybe Prelude.Text)
suggestionMatch_suggestion :: (Maybe Text -> f (Maybe Text))
-> SuggestionMatch -> f SuggestionMatch
suggestionMatch_suggestion = (SuggestionMatch -> Maybe Text)
-> (SuggestionMatch -> Maybe Text -> SuggestionMatch)
-> Lens SuggestionMatch SuggestionMatch (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SuggestionMatch' {Maybe Text
suggestion :: Maybe Text
$sel:suggestion:SuggestionMatch' :: SuggestionMatch -> Maybe Text
suggestion} -> Maybe Text
suggestion) (\s :: SuggestionMatch
s@SuggestionMatch' {} Maybe Text
a -> SuggestionMatch
s {$sel:suggestion:SuggestionMatch' :: Maybe Text
suggestion = Maybe Text
a} :: SuggestionMatch)
suggestionMatch_score :: Lens.Lens' SuggestionMatch (Prelude.Maybe Prelude.Integer)
suggestionMatch_score :: (Maybe Integer -> f (Maybe Integer))
-> SuggestionMatch -> f SuggestionMatch
suggestionMatch_score = (SuggestionMatch -> Maybe Integer)
-> (SuggestionMatch -> Maybe Integer -> SuggestionMatch)
-> Lens
SuggestionMatch SuggestionMatch (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SuggestionMatch' {Maybe Integer
score :: Maybe Integer
$sel:score:SuggestionMatch' :: SuggestionMatch -> Maybe Integer
score} -> Maybe Integer
score) (\s :: SuggestionMatch
s@SuggestionMatch' {} Maybe Integer
a -> SuggestionMatch
s {$sel:score:SuggestionMatch' :: Maybe Integer
score = Maybe Integer
a} :: SuggestionMatch)
suggestionMatch_id :: Lens.Lens' SuggestionMatch (Prelude.Maybe Prelude.Text)
suggestionMatch_id :: (Maybe Text -> f (Maybe Text))
-> SuggestionMatch -> f SuggestionMatch
suggestionMatch_id = (SuggestionMatch -> Maybe Text)
-> (SuggestionMatch -> Maybe Text -> SuggestionMatch)
-> Lens SuggestionMatch SuggestionMatch (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SuggestionMatch' {Maybe Text
id :: Maybe Text
$sel:id:SuggestionMatch' :: SuggestionMatch -> Maybe Text
id} -> Maybe Text
id) (\s :: SuggestionMatch
s@SuggestionMatch' {} Maybe Text
a -> SuggestionMatch
s {$sel:id:SuggestionMatch' :: Maybe Text
id = Maybe Text
a} :: SuggestionMatch)
instance Core.FromJSON SuggestionMatch where
parseJSON :: Value -> Parser SuggestionMatch
parseJSON =
String
-> (Object -> Parser SuggestionMatch)
-> Value
-> Parser SuggestionMatch
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"SuggestionMatch"
( \Object
x ->
Maybe Text -> Maybe Integer -> Maybe Text -> SuggestionMatch
SuggestionMatch'
(Maybe Text -> Maybe Integer -> Maybe Text -> SuggestionMatch)
-> Parser (Maybe Text)
-> Parser (Maybe Integer -> Maybe Text -> SuggestionMatch)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"suggestion")
Parser (Maybe Integer -> Maybe Text -> SuggestionMatch)
-> Parser (Maybe Integer) -> Parser (Maybe Text -> SuggestionMatch)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"score")
Parser (Maybe Text -> SuggestionMatch)
-> Parser (Maybe Text) -> Parser SuggestionMatch
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"id")
)
instance Prelude.Hashable SuggestionMatch
instance Prelude.NFData SuggestionMatch