{-# 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.Location.Types.SearchForSuggestionsResult 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 SearchForSuggestionsResult = SearchForSuggestionsResult'
{
SearchForSuggestionsResult -> Maybe Text
placeId :: Prelude.Maybe Prelude.Text,
SearchForSuggestionsResult -> Text
text :: Prelude.Text
}
deriving (SearchForSuggestionsResult -> SearchForSuggestionsResult -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SearchForSuggestionsResult -> SearchForSuggestionsResult -> Bool
$c/= :: SearchForSuggestionsResult -> SearchForSuggestionsResult -> Bool
== :: SearchForSuggestionsResult -> SearchForSuggestionsResult -> Bool
$c== :: SearchForSuggestionsResult -> SearchForSuggestionsResult -> Bool
Prelude.Eq, ReadPrec [SearchForSuggestionsResult]
ReadPrec SearchForSuggestionsResult
Int -> ReadS SearchForSuggestionsResult
ReadS [SearchForSuggestionsResult]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SearchForSuggestionsResult]
$creadListPrec :: ReadPrec [SearchForSuggestionsResult]
readPrec :: ReadPrec SearchForSuggestionsResult
$creadPrec :: ReadPrec SearchForSuggestionsResult
readList :: ReadS [SearchForSuggestionsResult]
$creadList :: ReadS [SearchForSuggestionsResult]
readsPrec :: Int -> ReadS SearchForSuggestionsResult
$creadsPrec :: Int -> ReadS SearchForSuggestionsResult
Prelude.Read, Int -> SearchForSuggestionsResult -> ShowS
[SearchForSuggestionsResult] -> ShowS
SearchForSuggestionsResult -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SearchForSuggestionsResult] -> ShowS
$cshowList :: [SearchForSuggestionsResult] -> ShowS
show :: SearchForSuggestionsResult -> String
$cshow :: SearchForSuggestionsResult -> String
showsPrec :: Int -> SearchForSuggestionsResult -> ShowS
$cshowsPrec :: Int -> SearchForSuggestionsResult -> ShowS
Prelude.Show, forall x.
Rep SearchForSuggestionsResult x -> SearchForSuggestionsResult
forall x.
SearchForSuggestionsResult -> Rep SearchForSuggestionsResult x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SearchForSuggestionsResult x -> SearchForSuggestionsResult
$cfrom :: forall x.
SearchForSuggestionsResult -> Rep SearchForSuggestionsResult x
Prelude.Generic)
newSearchForSuggestionsResult ::
Prelude.Text ->
SearchForSuggestionsResult
newSearchForSuggestionsResult :: Text -> SearchForSuggestionsResult
newSearchForSuggestionsResult Text
pText_ =
SearchForSuggestionsResult'
{ $sel:placeId:SearchForSuggestionsResult' :: Maybe Text
placeId =
forall a. Maybe a
Prelude.Nothing,
$sel:text:SearchForSuggestionsResult' :: Text
text = Text
pText_
}
searchForSuggestionsResult_placeId :: Lens.Lens' SearchForSuggestionsResult (Prelude.Maybe Prelude.Text)
searchForSuggestionsResult_placeId :: Lens' SearchForSuggestionsResult (Maybe Text)
searchForSuggestionsResult_placeId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchForSuggestionsResult' {Maybe Text
placeId :: Maybe Text
$sel:placeId:SearchForSuggestionsResult' :: SearchForSuggestionsResult -> Maybe Text
placeId} -> Maybe Text
placeId) (\s :: SearchForSuggestionsResult
s@SearchForSuggestionsResult' {} Maybe Text
a -> SearchForSuggestionsResult
s {$sel:placeId:SearchForSuggestionsResult' :: Maybe Text
placeId = Maybe Text
a} :: SearchForSuggestionsResult)
searchForSuggestionsResult_text :: Lens.Lens' SearchForSuggestionsResult Prelude.Text
searchForSuggestionsResult_text :: Lens' SearchForSuggestionsResult Text
searchForSuggestionsResult_text = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchForSuggestionsResult' {Text
text :: Text
$sel:text:SearchForSuggestionsResult' :: SearchForSuggestionsResult -> Text
text} -> Text
text) (\s :: SearchForSuggestionsResult
s@SearchForSuggestionsResult' {} Text
a -> SearchForSuggestionsResult
s {$sel:text:SearchForSuggestionsResult' :: Text
text = Text
a} :: SearchForSuggestionsResult)
instance Data.FromJSON SearchForSuggestionsResult where
parseJSON :: Value -> Parser SearchForSuggestionsResult
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"SearchForSuggestionsResult"
( \Object
x ->
Maybe Text -> Text -> SearchForSuggestionsResult
SearchForSuggestionsResult'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"PlaceId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Text")
)
instance Prelude.Hashable SearchForSuggestionsResult where
hashWithSalt :: Int -> SearchForSuggestionsResult -> Int
hashWithSalt Int
_salt SearchForSuggestionsResult' {Maybe Text
Text
text :: Text
placeId :: Maybe Text
$sel:text:SearchForSuggestionsResult' :: SearchForSuggestionsResult -> Text
$sel:placeId:SearchForSuggestionsResult' :: SearchForSuggestionsResult -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
placeId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
text
instance Prelude.NFData SearchForSuggestionsResult where
rnf :: SearchForSuggestionsResult -> ()
rnf SearchForSuggestionsResult' {Maybe Text
Text
text :: Text
placeId :: Maybe Text
$sel:text:SearchForSuggestionsResult' :: SearchForSuggestionsResult -> Text
$sel:placeId:SearchForSuggestionsResult' :: SearchForSuggestionsResult -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
placeId seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
text