{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.Location.SearchPlaceIndexForText
(
SearchPlaceIndexForText (..),
newSearchPlaceIndexForText,
searchPlaceIndexForText_filterBBox,
searchPlaceIndexForText_biasPosition,
searchPlaceIndexForText_filterCountries,
searchPlaceIndexForText_maxResults,
searchPlaceIndexForText_indexName,
searchPlaceIndexForText_text,
SearchPlaceIndexForTextResponse (..),
newSearchPlaceIndexForTextResponse,
searchPlaceIndexForTextResponse_httpStatus,
searchPlaceIndexForTextResponse_results,
searchPlaceIndexForTextResponse_summary,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Location.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data SearchPlaceIndexForText = SearchPlaceIndexForText'
{
SearchPlaceIndexForText -> Maybe (Sensitive (NonEmpty Double))
filterBBox :: Prelude.Maybe (Core.Sensitive (Prelude.NonEmpty Prelude.Double)),
SearchPlaceIndexForText -> Maybe (Sensitive (NonEmpty Double))
biasPosition :: Prelude.Maybe (Core.Sensitive (Prelude.NonEmpty Prelude.Double)),
SearchPlaceIndexForText -> Maybe (NonEmpty Text)
filterCountries :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
SearchPlaceIndexForText -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
SearchPlaceIndexForText -> Text
indexName :: Prelude.Text,
SearchPlaceIndexForText -> Sensitive Text
text :: Core.Sensitive Prelude.Text
}
deriving (SearchPlaceIndexForText -> SearchPlaceIndexForText -> Bool
(SearchPlaceIndexForText -> SearchPlaceIndexForText -> Bool)
-> (SearchPlaceIndexForText -> SearchPlaceIndexForText -> Bool)
-> Eq SearchPlaceIndexForText
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SearchPlaceIndexForText -> SearchPlaceIndexForText -> Bool
$c/= :: SearchPlaceIndexForText -> SearchPlaceIndexForText -> Bool
== :: SearchPlaceIndexForText -> SearchPlaceIndexForText -> Bool
$c== :: SearchPlaceIndexForText -> SearchPlaceIndexForText -> Bool
Prelude.Eq, Int -> SearchPlaceIndexForText -> ShowS
[SearchPlaceIndexForText] -> ShowS
SearchPlaceIndexForText -> String
(Int -> SearchPlaceIndexForText -> ShowS)
-> (SearchPlaceIndexForText -> String)
-> ([SearchPlaceIndexForText] -> ShowS)
-> Show SearchPlaceIndexForText
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SearchPlaceIndexForText] -> ShowS
$cshowList :: [SearchPlaceIndexForText] -> ShowS
show :: SearchPlaceIndexForText -> String
$cshow :: SearchPlaceIndexForText -> String
showsPrec :: Int -> SearchPlaceIndexForText -> ShowS
$cshowsPrec :: Int -> SearchPlaceIndexForText -> ShowS
Prelude.Show, (forall x.
SearchPlaceIndexForText -> Rep SearchPlaceIndexForText x)
-> (forall x.
Rep SearchPlaceIndexForText x -> SearchPlaceIndexForText)
-> Generic SearchPlaceIndexForText
forall x. Rep SearchPlaceIndexForText x -> SearchPlaceIndexForText
forall x. SearchPlaceIndexForText -> Rep SearchPlaceIndexForText x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SearchPlaceIndexForText x -> SearchPlaceIndexForText
$cfrom :: forall x. SearchPlaceIndexForText -> Rep SearchPlaceIndexForText x
Prelude.Generic)
newSearchPlaceIndexForText ::
Prelude.Text ->
Prelude.Text ->
SearchPlaceIndexForText
newSearchPlaceIndexForText :: Text -> Text -> SearchPlaceIndexForText
newSearchPlaceIndexForText Text
pIndexName_ Text
pText_ =
SearchPlaceIndexForText' :: Maybe (Sensitive (NonEmpty Double))
-> Maybe (Sensitive (NonEmpty Double))
-> Maybe (NonEmpty Text)
-> Maybe Natural
-> Text
-> Sensitive Text
-> SearchPlaceIndexForText
SearchPlaceIndexForText'
{ $sel:filterBBox:SearchPlaceIndexForText' :: Maybe (Sensitive (NonEmpty Double))
filterBBox =
Maybe (Sensitive (NonEmpty Double))
forall a. Maybe a
Prelude.Nothing,
$sel:biasPosition:SearchPlaceIndexForText' :: Maybe (Sensitive (NonEmpty Double))
biasPosition = Maybe (Sensitive (NonEmpty Double))
forall a. Maybe a
Prelude.Nothing,
$sel:filterCountries:SearchPlaceIndexForText' :: Maybe (NonEmpty Text)
filterCountries = Maybe (NonEmpty Text)
forall a. Maybe a
Prelude.Nothing,
$sel:maxResults:SearchPlaceIndexForText' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:indexName:SearchPlaceIndexForText' :: Text
indexName = Text
pIndexName_,
$sel:text:SearchPlaceIndexForText' :: Sensitive Text
text = Tagged Text (Identity Text)
-> Tagged (Sensitive Text) (Identity (Sensitive Text))
forall a. Iso' (Sensitive a) a
Core._Sensitive (Tagged Text (Identity Text)
-> Tagged (Sensitive Text) (Identity (Sensitive Text)))
-> Text -> Sensitive Text
forall t b. AReview t b -> b -> t
Lens.# Text
pText_
}
searchPlaceIndexForText_filterBBox :: Lens.Lens' SearchPlaceIndexForText (Prelude.Maybe (Prelude.NonEmpty Prelude.Double))
searchPlaceIndexForText_filterBBox :: (Maybe (NonEmpty Double) -> f (Maybe (NonEmpty Double)))
-> SearchPlaceIndexForText -> f SearchPlaceIndexForText
searchPlaceIndexForText_filterBBox = (SearchPlaceIndexForText -> Maybe (Sensitive (NonEmpty Double)))
-> (SearchPlaceIndexForText
-> Maybe (Sensitive (NonEmpty Double)) -> SearchPlaceIndexForText)
-> Lens
SearchPlaceIndexForText
SearchPlaceIndexForText
(Maybe (Sensitive (NonEmpty Double)))
(Maybe (Sensitive (NonEmpty Double)))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchPlaceIndexForText' {Maybe (Sensitive (NonEmpty Double))
filterBBox :: Maybe (Sensitive (NonEmpty Double))
$sel:filterBBox:SearchPlaceIndexForText' :: SearchPlaceIndexForText -> Maybe (Sensitive (NonEmpty Double))
filterBBox} -> Maybe (Sensitive (NonEmpty Double))
filterBBox) (\s :: SearchPlaceIndexForText
s@SearchPlaceIndexForText' {} Maybe (Sensitive (NonEmpty Double))
a -> SearchPlaceIndexForText
s {$sel:filterBBox:SearchPlaceIndexForText' :: Maybe (Sensitive (NonEmpty Double))
filterBBox = Maybe (Sensitive (NonEmpty Double))
a} :: SearchPlaceIndexForText) ((Maybe (Sensitive (NonEmpty Double))
-> f (Maybe (Sensitive (NonEmpty Double))))
-> SearchPlaceIndexForText -> f SearchPlaceIndexForText)
-> ((Maybe (NonEmpty Double) -> f (Maybe (NonEmpty Double)))
-> Maybe (Sensitive (NonEmpty Double))
-> f (Maybe (Sensitive (NonEmpty Double))))
-> (Maybe (NonEmpty Double) -> f (Maybe (NonEmpty Double)))
-> SearchPlaceIndexForText
-> f SearchPlaceIndexForText
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(Sensitive (NonEmpty Double))
(Sensitive (NonEmpty Double))
(NonEmpty Double)
(NonEmpty Double)
-> Iso
(Maybe (Sensitive (NonEmpty Double)))
(Maybe (Sensitive (NonEmpty Double)))
(Maybe (NonEmpty Double))
(Maybe (NonEmpty Double))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping (AnIso
(Sensitive (NonEmpty Double))
(Sensitive (NonEmpty Double))
(NonEmpty Double)
(NonEmpty Double)
forall a. Iso' (Sensitive a) a
Core._Sensitive AnIso
(Sensitive (NonEmpty Double))
(Sensitive (NonEmpty Double))
(NonEmpty Double)
(NonEmpty Double)
-> (Exchange
(NonEmpty Double)
(NonEmpty Double)
(NonEmpty Double)
(Identity (NonEmpty Double))
-> Exchange
(NonEmpty Double)
(NonEmpty Double)
(NonEmpty Double)
(Identity (NonEmpty Double)))
-> AnIso
(Sensitive (NonEmpty Double))
(Sensitive (NonEmpty Double))
(NonEmpty Double)
(NonEmpty Double)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Exchange
(NonEmpty Double)
(NonEmpty Double)
(NonEmpty Double)
(Identity (NonEmpty Double))
-> Exchange
(NonEmpty Double)
(NonEmpty Double)
(NonEmpty Double)
(Identity (NonEmpty Double))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced)
searchPlaceIndexForText_biasPosition :: Lens.Lens' SearchPlaceIndexForText (Prelude.Maybe (Prelude.NonEmpty Prelude.Double))
searchPlaceIndexForText_biasPosition :: (Maybe (NonEmpty Double) -> f (Maybe (NonEmpty Double)))
-> SearchPlaceIndexForText -> f SearchPlaceIndexForText
searchPlaceIndexForText_biasPosition = (SearchPlaceIndexForText -> Maybe (Sensitive (NonEmpty Double)))
-> (SearchPlaceIndexForText
-> Maybe (Sensitive (NonEmpty Double)) -> SearchPlaceIndexForText)
-> Lens
SearchPlaceIndexForText
SearchPlaceIndexForText
(Maybe (Sensitive (NonEmpty Double)))
(Maybe (Sensitive (NonEmpty Double)))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchPlaceIndexForText' {Maybe (Sensitive (NonEmpty Double))
biasPosition :: Maybe (Sensitive (NonEmpty Double))
$sel:biasPosition:SearchPlaceIndexForText' :: SearchPlaceIndexForText -> Maybe (Sensitive (NonEmpty Double))
biasPosition} -> Maybe (Sensitive (NonEmpty Double))
biasPosition) (\s :: SearchPlaceIndexForText
s@SearchPlaceIndexForText' {} Maybe (Sensitive (NonEmpty Double))
a -> SearchPlaceIndexForText
s {$sel:biasPosition:SearchPlaceIndexForText' :: Maybe (Sensitive (NonEmpty Double))
biasPosition = Maybe (Sensitive (NonEmpty Double))
a} :: SearchPlaceIndexForText) ((Maybe (Sensitive (NonEmpty Double))
-> f (Maybe (Sensitive (NonEmpty Double))))
-> SearchPlaceIndexForText -> f SearchPlaceIndexForText)
-> ((Maybe (NonEmpty Double) -> f (Maybe (NonEmpty Double)))
-> Maybe (Sensitive (NonEmpty Double))
-> f (Maybe (Sensitive (NonEmpty Double))))
-> (Maybe (NonEmpty Double) -> f (Maybe (NonEmpty Double)))
-> SearchPlaceIndexForText
-> f SearchPlaceIndexForText
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(Sensitive (NonEmpty Double))
(Sensitive (NonEmpty Double))
(NonEmpty Double)
(NonEmpty Double)
-> Iso
(Maybe (Sensitive (NonEmpty Double)))
(Maybe (Sensitive (NonEmpty Double)))
(Maybe (NonEmpty Double))
(Maybe (NonEmpty Double))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping (AnIso
(Sensitive (NonEmpty Double))
(Sensitive (NonEmpty Double))
(NonEmpty Double)
(NonEmpty Double)
forall a. Iso' (Sensitive a) a
Core._Sensitive AnIso
(Sensitive (NonEmpty Double))
(Sensitive (NonEmpty Double))
(NonEmpty Double)
(NonEmpty Double)
-> (Exchange
(NonEmpty Double)
(NonEmpty Double)
(NonEmpty Double)
(Identity (NonEmpty Double))
-> Exchange
(NonEmpty Double)
(NonEmpty Double)
(NonEmpty Double)
(Identity (NonEmpty Double)))
-> AnIso
(Sensitive (NonEmpty Double))
(Sensitive (NonEmpty Double))
(NonEmpty Double)
(NonEmpty Double)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Exchange
(NonEmpty Double)
(NonEmpty Double)
(NonEmpty Double)
(Identity (NonEmpty Double))
-> Exchange
(NonEmpty Double)
(NonEmpty Double)
(NonEmpty Double)
(Identity (NonEmpty Double))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced)
searchPlaceIndexForText_filterCountries :: Lens.Lens' SearchPlaceIndexForText (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
searchPlaceIndexForText_filterCountries :: (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> SearchPlaceIndexForText -> f SearchPlaceIndexForText
searchPlaceIndexForText_filterCountries = (SearchPlaceIndexForText -> Maybe (NonEmpty Text))
-> (SearchPlaceIndexForText
-> Maybe (NonEmpty Text) -> SearchPlaceIndexForText)
-> Lens
SearchPlaceIndexForText
SearchPlaceIndexForText
(Maybe (NonEmpty Text))
(Maybe (NonEmpty Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchPlaceIndexForText' {Maybe (NonEmpty Text)
filterCountries :: Maybe (NonEmpty Text)
$sel:filterCountries:SearchPlaceIndexForText' :: SearchPlaceIndexForText -> Maybe (NonEmpty Text)
filterCountries} -> Maybe (NonEmpty Text)
filterCountries) (\s :: SearchPlaceIndexForText
s@SearchPlaceIndexForText' {} Maybe (NonEmpty Text)
a -> SearchPlaceIndexForText
s {$sel:filterCountries:SearchPlaceIndexForText' :: Maybe (NonEmpty Text)
filterCountries = Maybe (NonEmpty Text)
a} :: SearchPlaceIndexForText) ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> SearchPlaceIndexForText -> f SearchPlaceIndexForText)
-> ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> SearchPlaceIndexForText
-> f SearchPlaceIndexForText
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
-> Iso
(Maybe (NonEmpty Text))
(Maybe (NonEmpty Text))
(Maybe (NonEmpty Text))
(Maybe (NonEmpty Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
(NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
searchPlaceIndexForText_maxResults :: Lens.Lens' SearchPlaceIndexForText (Prelude.Maybe Prelude.Natural)
searchPlaceIndexForText_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> SearchPlaceIndexForText -> f SearchPlaceIndexForText
searchPlaceIndexForText_maxResults = (SearchPlaceIndexForText -> Maybe Natural)
-> (SearchPlaceIndexForText
-> Maybe Natural -> SearchPlaceIndexForText)
-> Lens
SearchPlaceIndexForText
SearchPlaceIndexForText
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchPlaceIndexForText' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:SearchPlaceIndexForText' :: SearchPlaceIndexForText -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: SearchPlaceIndexForText
s@SearchPlaceIndexForText' {} Maybe Natural
a -> SearchPlaceIndexForText
s {$sel:maxResults:SearchPlaceIndexForText' :: Maybe Natural
maxResults = Maybe Natural
a} :: SearchPlaceIndexForText)
searchPlaceIndexForText_indexName :: Lens.Lens' SearchPlaceIndexForText Prelude.Text
searchPlaceIndexForText_indexName :: (Text -> f Text)
-> SearchPlaceIndexForText -> f SearchPlaceIndexForText
searchPlaceIndexForText_indexName = (SearchPlaceIndexForText -> Text)
-> (SearchPlaceIndexForText -> Text -> SearchPlaceIndexForText)
-> Lens SearchPlaceIndexForText SearchPlaceIndexForText Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchPlaceIndexForText' {Text
indexName :: Text
$sel:indexName:SearchPlaceIndexForText' :: SearchPlaceIndexForText -> Text
indexName} -> Text
indexName) (\s :: SearchPlaceIndexForText
s@SearchPlaceIndexForText' {} Text
a -> SearchPlaceIndexForText
s {$sel:indexName:SearchPlaceIndexForText' :: Text
indexName = Text
a} :: SearchPlaceIndexForText)
searchPlaceIndexForText_text :: Lens.Lens' SearchPlaceIndexForText Prelude.Text
searchPlaceIndexForText_text :: (Text -> f Text)
-> SearchPlaceIndexForText -> f SearchPlaceIndexForText
searchPlaceIndexForText_text = (SearchPlaceIndexForText -> Sensitive Text)
-> (SearchPlaceIndexForText
-> Sensitive Text -> SearchPlaceIndexForText)
-> Lens
SearchPlaceIndexForText
SearchPlaceIndexForText
(Sensitive Text)
(Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchPlaceIndexForText' {Sensitive Text
text :: Sensitive Text
$sel:text:SearchPlaceIndexForText' :: SearchPlaceIndexForText -> Sensitive Text
text} -> Sensitive Text
text) (\s :: SearchPlaceIndexForText
s@SearchPlaceIndexForText' {} Sensitive Text
a -> SearchPlaceIndexForText
s {$sel:text:SearchPlaceIndexForText' :: Sensitive Text
text = Sensitive Text
a} :: SearchPlaceIndexForText) ((Sensitive Text -> f (Sensitive Text))
-> SearchPlaceIndexForText -> f SearchPlaceIndexForText)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> SearchPlaceIndexForText
-> f SearchPlaceIndexForText
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> f Text) -> Sensitive Text -> f (Sensitive Text)
forall a. Iso' (Sensitive a) a
Core._Sensitive
instance Core.AWSRequest SearchPlaceIndexForText where
type
AWSResponse SearchPlaceIndexForText =
SearchPlaceIndexForTextResponse
request :: SearchPlaceIndexForText -> Request SearchPlaceIndexForText
request = Service
-> SearchPlaceIndexForText -> Request SearchPlaceIndexForText
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy SearchPlaceIndexForText
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse SearchPlaceIndexForText)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse SearchPlaceIndexForText))
-> Logger
-> Service
-> Proxy SearchPlaceIndexForText
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse SearchPlaceIndexForText)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Int
-> [SearchForTextResult]
-> SearchPlaceIndexForTextSummary
-> SearchPlaceIndexForTextResponse
SearchPlaceIndexForTextResponse'
(Int
-> [SearchForTextResult]
-> SearchPlaceIndexForTextSummary
-> SearchPlaceIndexForTextResponse)
-> Either String Int
-> Either
String
([SearchForTextResult]
-> SearchPlaceIndexForTextSummary
-> SearchPlaceIndexForTextResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
Either
String
([SearchForTextResult]
-> SearchPlaceIndexForTextSummary
-> SearchPlaceIndexForTextResponse)
-> Either String [SearchForTextResult]
-> Either
String
(SearchPlaceIndexForTextSummary -> SearchPlaceIndexForTextResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe [SearchForTextResult])
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Results" Either String (Maybe [SearchForTextResult])
-> [SearchForTextResult] -> Either String [SearchForTextResult]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [SearchForTextResult]
forall a. Monoid a => a
Prelude.mempty)
Either
String
(SearchPlaceIndexForTextSummary -> SearchPlaceIndexForTextResponse)
-> Either String SearchPlaceIndexForTextSummary
-> Either String SearchPlaceIndexForTextResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String SearchPlaceIndexForTextSummary
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"Summary")
)
instance Prelude.Hashable SearchPlaceIndexForText
instance Prelude.NFData SearchPlaceIndexForText
instance Core.ToHeaders SearchPlaceIndexForText where
toHeaders :: SearchPlaceIndexForText -> ResponseHeaders
toHeaders =
ResponseHeaders -> SearchPlaceIndexForText -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON SearchPlaceIndexForText where
toJSON :: SearchPlaceIndexForText -> Value
toJSON SearchPlaceIndexForText' {Maybe Natural
Maybe (NonEmpty Text)
Maybe (Sensitive (NonEmpty Double))
Text
Sensitive Text
text :: Sensitive Text
indexName :: Text
maxResults :: Maybe Natural
filterCountries :: Maybe (NonEmpty Text)
biasPosition :: Maybe (Sensitive (NonEmpty Double))
filterBBox :: Maybe (Sensitive (NonEmpty Double))
$sel:text:SearchPlaceIndexForText' :: SearchPlaceIndexForText -> Sensitive Text
$sel:indexName:SearchPlaceIndexForText' :: SearchPlaceIndexForText -> Text
$sel:maxResults:SearchPlaceIndexForText' :: SearchPlaceIndexForText -> Maybe Natural
$sel:filterCountries:SearchPlaceIndexForText' :: SearchPlaceIndexForText -> Maybe (NonEmpty Text)
$sel:biasPosition:SearchPlaceIndexForText' :: SearchPlaceIndexForText -> Maybe (Sensitive (NonEmpty Double))
$sel:filterBBox:SearchPlaceIndexForText' :: SearchPlaceIndexForText -> Maybe (Sensitive (NonEmpty Double))
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"FilterBBox" Text -> Sensitive (NonEmpty Double) -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Sensitive (NonEmpty Double) -> Pair)
-> Maybe (Sensitive (NonEmpty Double)) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive (NonEmpty Double))
filterBBox,
(Text
"BiasPosition" Text -> Sensitive (NonEmpty Double) -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Sensitive (NonEmpty Double) -> Pair)
-> Maybe (Sensitive (NonEmpty Double)) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive (NonEmpty Double))
biasPosition,
(Text
"FilterCountries" Text -> NonEmpty Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(NonEmpty Text -> Pair) -> Maybe (NonEmpty Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Text)
filterCountries,
(Text
"MaxResults" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Text" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Sensitive Text
text)
]
)
instance Core.ToPath SearchPlaceIndexForText where
toPath :: SearchPlaceIndexForText -> ByteString
toPath SearchPlaceIndexForText' {Maybe Natural
Maybe (NonEmpty Text)
Maybe (Sensitive (NonEmpty Double))
Text
Sensitive Text
text :: Sensitive Text
indexName :: Text
maxResults :: Maybe Natural
filterCountries :: Maybe (NonEmpty Text)
biasPosition :: Maybe (Sensitive (NonEmpty Double))
filterBBox :: Maybe (Sensitive (NonEmpty Double))
$sel:text:SearchPlaceIndexForText' :: SearchPlaceIndexForText -> Sensitive Text
$sel:indexName:SearchPlaceIndexForText' :: SearchPlaceIndexForText -> Text
$sel:maxResults:SearchPlaceIndexForText' :: SearchPlaceIndexForText -> Maybe Natural
$sel:filterCountries:SearchPlaceIndexForText' :: SearchPlaceIndexForText -> Maybe (NonEmpty Text)
$sel:biasPosition:SearchPlaceIndexForText' :: SearchPlaceIndexForText -> Maybe (Sensitive (NonEmpty Double))
$sel:filterBBox:SearchPlaceIndexForText' :: SearchPlaceIndexForText -> Maybe (Sensitive (NonEmpty Double))
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/places/v0/indexes/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
indexName,
ByteString
"/search/text"
]
instance Core.ToQuery SearchPlaceIndexForText where
toQuery :: SearchPlaceIndexForText -> QueryString
toQuery = QueryString -> SearchPlaceIndexForText -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data SearchPlaceIndexForTextResponse = SearchPlaceIndexForTextResponse'
{
SearchPlaceIndexForTextResponse -> Int
httpStatus :: Prelude.Int,
SearchPlaceIndexForTextResponse -> [SearchForTextResult]
results :: [SearchForTextResult],
SearchPlaceIndexForTextResponse -> SearchPlaceIndexForTextSummary
summary :: SearchPlaceIndexForTextSummary
}
deriving (SearchPlaceIndexForTextResponse
-> SearchPlaceIndexForTextResponse -> Bool
(SearchPlaceIndexForTextResponse
-> SearchPlaceIndexForTextResponse -> Bool)
-> (SearchPlaceIndexForTextResponse
-> SearchPlaceIndexForTextResponse -> Bool)
-> Eq SearchPlaceIndexForTextResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SearchPlaceIndexForTextResponse
-> SearchPlaceIndexForTextResponse -> Bool
$c/= :: SearchPlaceIndexForTextResponse
-> SearchPlaceIndexForTextResponse -> Bool
== :: SearchPlaceIndexForTextResponse
-> SearchPlaceIndexForTextResponse -> Bool
$c== :: SearchPlaceIndexForTextResponse
-> SearchPlaceIndexForTextResponse -> Bool
Prelude.Eq, Int -> SearchPlaceIndexForTextResponse -> ShowS
[SearchPlaceIndexForTextResponse] -> ShowS
SearchPlaceIndexForTextResponse -> String
(Int -> SearchPlaceIndexForTextResponse -> ShowS)
-> (SearchPlaceIndexForTextResponse -> String)
-> ([SearchPlaceIndexForTextResponse] -> ShowS)
-> Show SearchPlaceIndexForTextResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SearchPlaceIndexForTextResponse] -> ShowS
$cshowList :: [SearchPlaceIndexForTextResponse] -> ShowS
show :: SearchPlaceIndexForTextResponse -> String
$cshow :: SearchPlaceIndexForTextResponse -> String
showsPrec :: Int -> SearchPlaceIndexForTextResponse -> ShowS
$cshowsPrec :: Int -> SearchPlaceIndexForTextResponse -> ShowS
Prelude.Show, (forall x.
SearchPlaceIndexForTextResponse
-> Rep SearchPlaceIndexForTextResponse x)
-> (forall x.
Rep SearchPlaceIndexForTextResponse x
-> SearchPlaceIndexForTextResponse)
-> Generic SearchPlaceIndexForTextResponse
forall x.
Rep SearchPlaceIndexForTextResponse x
-> SearchPlaceIndexForTextResponse
forall x.
SearchPlaceIndexForTextResponse
-> Rep SearchPlaceIndexForTextResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SearchPlaceIndexForTextResponse x
-> SearchPlaceIndexForTextResponse
$cfrom :: forall x.
SearchPlaceIndexForTextResponse
-> Rep SearchPlaceIndexForTextResponse x
Prelude.Generic)
newSearchPlaceIndexForTextResponse ::
Prelude.Int ->
SearchPlaceIndexForTextSummary ->
SearchPlaceIndexForTextResponse
newSearchPlaceIndexForTextResponse :: Int
-> SearchPlaceIndexForTextSummary
-> SearchPlaceIndexForTextResponse
newSearchPlaceIndexForTextResponse
Int
pHttpStatus_
SearchPlaceIndexForTextSummary
pSummary_ =
SearchPlaceIndexForTextResponse' :: Int
-> [SearchForTextResult]
-> SearchPlaceIndexForTextSummary
-> SearchPlaceIndexForTextResponse
SearchPlaceIndexForTextResponse'
{ $sel:httpStatus:SearchPlaceIndexForTextResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:results:SearchPlaceIndexForTextResponse' :: [SearchForTextResult]
results = [SearchForTextResult]
forall a. Monoid a => a
Prelude.mempty,
$sel:summary:SearchPlaceIndexForTextResponse' :: SearchPlaceIndexForTextSummary
summary = SearchPlaceIndexForTextSummary
pSummary_
}
searchPlaceIndexForTextResponse_httpStatus :: Lens.Lens' SearchPlaceIndexForTextResponse Prelude.Int
searchPlaceIndexForTextResponse_httpStatus :: (Int -> f Int)
-> SearchPlaceIndexForTextResponse
-> f SearchPlaceIndexForTextResponse
searchPlaceIndexForTextResponse_httpStatus = (SearchPlaceIndexForTextResponse -> Int)
-> (SearchPlaceIndexForTextResponse
-> Int -> SearchPlaceIndexForTextResponse)
-> Lens
SearchPlaceIndexForTextResponse
SearchPlaceIndexForTextResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchPlaceIndexForTextResponse' {Int
httpStatus :: Int
$sel:httpStatus:SearchPlaceIndexForTextResponse' :: SearchPlaceIndexForTextResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: SearchPlaceIndexForTextResponse
s@SearchPlaceIndexForTextResponse' {} Int
a -> SearchPlaceIndexForTextResponse
s {$sel:httpStatus:SearchPlaceIndexForTextResponse' :: Int
httpStatus = Int
a} :: SearchPlaceIndexForTextResponse)
searchPlaceIndexForTextResponse_results :: Lens.Lens' SearchPlaceIndexForTextResponse [SearchForTextResult]
searchPlaceIndexForTextResponse_results :: ([SearchForTextResult] -> f [SearchForTextResult])
-> SearchPlaceIndexForTextResponse
-> f SearchPlaceIndexForTextResponse
searchPlaceIndexForTextResponse_results = (SearchPlaceIndexForTextResponse -> [SearchForTextResult])
-> (SearchPlaceIndexForTextResponse
-> [SearchForTextResult] -> SearchPlaceIndexForTextResponse)
-> Lens
SearchPlaceIndexForTextResponse
SearchPlaceIndexForTextResponse
[SearchForTextResult]
[SearchForTextResult]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchPlaceIndexForTextResponse' {[SearchForTextResult]
results :: [SearchForTextResult]
$sel:results:SearchPlaceIndexForTextResponse' :: SearchPlaceIndexForTextResponse -> [SearchForTextResult]
results} -> [SearchForTextResult]
results) (\s :: SearchPlaceIndexForTextResponse
s@SearchPlaceIndexForTextResponse' {} [SearchForTextResult]
a -> SearchPlaceIndexForTextResponse
s {$sel:results:SearchPlaceIndexForTextResponse' :: [SearchForTextResult]
results = [SearchForTextResult]
a} :: SearchPlaceIndexForTextResponse) (([SearchForTextResult] -> f [SearchForTextResult])
-> SearchPlaceIndexForTextResponse
-> f SearchPlaceIndexForTextResponse)
-> (([SearchForTextResult] -> f [SearchForTextResult])
-> [SearchForTextResult] -> f [SearchForTextResult])
-> ([SearchForTextResult] -> f [SearchForTextResult])
-> SearchPlaceIndexForTextResponse
-> f SearchPlaceIndexForTextResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([SearchForTextResult] -> f [SearchForTextResult])
-> [SearchForTextResult] -> f [SearchForTextResult]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
searchPlaceIndexForTextResponse_summary :: Lens.Lens' SearchPlaceIndexForTextResponse SearchPlaceIndexForTextSummary
searchPlaceIndexForTextResponse_summary :: (SearchPlaceIndexForTextSummary
-> f SearchPlaceIndexForTextSummary)
-> SearchPlaceIndexForTextResponse
-> f SearchPlaceIndexForTextResponse
searchPlaceIndexForTextResponse_summary = (SearchPlaceIndexForTextResponse -> SearchPlaceIndexForTextSummary)
-> (SearchPlaceIndexForTextResponse
-> SearchPlaceIndexForTextSummary
-> SearchPlaceIndexForTextResponse)
-> Lens
SearchPlaceIndexForTextResponse
SearchPlaceIndexForTextResponse
SearchPlaceIndexForTextSummary
SearchPlaceIndexForTextSummary
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchPlaceIndexForTextResponse' {SearchPlaceIndexForTextSummary
summary :: SearchPlaceIndexForTextSummary
$sel:summary:SearchPlaceIndexForTextResponse' :: SearchPlaceIndexForTextResponse -> SearchPlaceIndexForTextSummary
summary} -> SearchPlaceIndexForTextSummary
summary) (\s :: SearchPlaceIndexForTextResponse
s@SearchPlaceIndexForTextResponse' {} SearchPlaceIndexForTextSummary
a -> SearchPlaceIndexForTextResponse
s {$sel:summary:SearchPlaceIndexForTextResponse' :: SearchPlaceIndexForTextSummary
summary = SearchPlaceIndexForTextSummary
a} :: SearchPlaceIndexForTextResponse)
instance
Prelude.NFData
SearchPlaceIndexForTextResponse