{-# 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.SearchForTextResult where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Location.Types.Place
import qualified Amazonka.Prelude as Prelude
data SearchForTextResult = SearchForTextResult'
{
SearchForTextResult -> Maybe Double
distance :: Prelude.Maybe Prelude.Double,
SearchForTextResult -> Maybe Text
placeId :: Prelude.Maybe Prelude.Text,
SearchForTextResult -> Maybe Double
relevance :: Prelude.Maybe Prelude.Double,
SearchForTextResult -> Place
place :: Place
}
deriving (SearchForTextResult -> SearchForTextResult -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SearchForTextResult -> SearchForTextResult -> Bool
$c/= :: SearchForTextResult -> SearchForTextResult -> Bool
== :: SearchForTextResult -> SearchForTextResult -> Bool
$c== :: SearchForTextResult -> SearchForTextResult -> Bool
Prelude.Eq, Int -> SearchForTextResult -> ShowS
[SearchForTextResult] -> ShowS
SearchForTextResult -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SearchForTextResult] -> ShowS
$cshowList :: [SearchForTextResult] -> ShowS
show :: SearchForTextResult -> String
$cshow :: SearchForTextResult -> String
showsPrec :: Int -> SearchForTextResult -> ShowS
$cshowsPrec :: Int -> SearchForTextResult -> ShowS
Prelude.Show, forall x. Rep SearchForTextResult x -> SearchForTextResult
forall x. SearchForTextResult -> Rep SearchForTextResult x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SearchForTextResult x -> SearchForTextResult
$cfrom :: forall x. SearchForTextResult -> Rep SearchForTextResult x
Prelude.Generic)
newSearchForTextResult ::
Place ->
SearchForTextResult
newSearchForTextResult :: Place -> SearchForTextResult
newSearchForTextResult Place
pPlace_ =
SearchForTextResult'
{ $sel:distance:SearchForTextResult' :: Maybe Double
distance = forall a. Maybe a
Prelude.Nothing,
$sel:placeId:SearchForTextResult' :: Maybe Text
placeId = forall a. Maybe a
Prelude.Nothing,
$sel:relevance:SearchForTextResult' :: Maybe Double
relevance = forall a. Maybe a
Prelude.Nothing,
$sel:place:SearchForTextResult' :: Place
place = Place
pPlace_
}
searchForTextResult_distance :: Lens.Lens' SearchForTextResult (Prelude.Maybe Prelude.Double)
searchForTextResult_distance :: Lens' SearchForTextResult (Maybe Double)
searchForTextResult_distance = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchForTextResult' {Maybe Double
distance :: Maybe Double
$sel:distance:SearchForTextResult' :: SearchForTextResult -> Maybe Double
distance} -> Maybe Double
distance) (\s :: SearchForTextResult
s@SearchForTextResult' {} Maybe Double
a -> SearchForTextResult
s {$sel:distance:SearchForTextResult' :: Maybe Double
distance = Maybe Double
a} :: SearchForTextResult)
searchForTextResult_placeId :: Lens.Lens' SearchForTextResult (Prelude.Maybe Prelude.Text)
searchForTextResult_placeId :: Lens' SearchForTextResult (Maybe Text)
searchForTextResult_placeId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchForTextResult' {Maybe Text
placeId :: Maybe Text
$sel:placeId:SearchForTextResult' :: SearchForTextResult -> Maybe Text
placeId} -> Maybe Text
placeId) (\s :: SearchForTextResult
s@SearchForTextResult' {} Maybe Text
a -> SearchForTextResult
s {$sel:placeId:SearchForTextResult' :: Maybe Text
placeId = Maybe Text
a} :: SearchForTextResult)
searchForTextResult_relevance :: Lens.Lens' SearchForTextResult (Prelude.Maybe Prelude.Double)
searchForTextResult_relevance :: Lens' SearchForTextResult (Maybe Double)
searchForTextResult_relevance = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchForTextResult' {Maybe Double
relevance :: Maybe Double
$sel:relevance:SearchForTextResult' :: SearchForTextResult -> Maybe Double
relevance} -> Maybe Double
relevance) (\s :: SearchForTextResult
s@SearchForTextResult' {} Maybe Double
a -> SearchForTextResult
s {$sel:relevance:SearchForTextResult' :: Maybe Double
relevance = Maybe Double
a} :: SearchForTextResult)
searchForTextResult_place :: Lens.Lens' SearchForTextResult Place
searchForTextResult_place :: Lens' SearchForTextResult Place
searchForTextResult_place = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchForTextResult' {Place
place :: Place
$sel:place:SearchForTextResult' :: SearchForTextResult -> Place
place} -> Place
place) (\s :: SearchForTextResult
s@SearchForTextResult' {} Place
a -> SearchForTextResult
s {$sel:place:SearchForTextResult' :: Place
place = Place
a} :: SearchForTextResult)
instance Data.FromJSON SearchForTextResult where
parseJSON :: Value -> Parser SearchForTextResult
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"SearchForTextResult"
( \Object
x ->
Maybe Double
-> Maybe Text -> Maybe Double -> Place -> SearchForTextResult
SearchForTextResult'
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
"Distance")
forall (f :: * -> *) a b. Applicative f => 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 (Maybe a)
Data..:? Key
"Relevance")
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
"Place")
)
instance Prelude.Hashable SearchForTextResult where
hashWithSalt :: Int -> SearchForTextResult -> Int
hashWithSalt Int
_salt SearchForTextResult' {Maybe Double
Maybe Text
Place
place :: Place
relevance :: Maybe Double
placeId :: Maybe Text
distance :: Maybe Double
$sel:place:SearchForTextResult' :: SearchForTextResult -> Place
$sel:relevance:SearchForTextResult' :: SearchForTextResult -> Maybe Double
$sel:placeId:SearchForTextResult' :: SearchForTextResult -> Maybe Text
$sel:distance:SearchForTextResult' :: SearchForTextResult -> Maybe Double
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
distance
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
placeId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
relevance
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Place
place
instance Prelude.NFData SearchForTextResult where
rnf :: SearchForTextResult -> ()
rnf SearchForTextResult' {Maybe Double
Maybe Text
Place
place :: Place
relevance :: Maybe Double
placeId :: Maybe Text
distance :: Maybe Double
$sel:place:SearchForTextResult' :: SearchForTextResult -> Place
$sel:relevance:SearchForTextResult' :: SearchForTextResult -> Maybe Double
$sel:placeId:SearchForTextResult' :: SearchForTextResult -> Maybe Text
$sel:distance:SearchForTextResult' :: SearchForTextResult -> Maybe Double
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
distance
seq :: forall a b. a -> b -> b
`Prelude.seq` 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 Maybe Double
relevance
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Place
place