{-# 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.SearchPlaceIndexForSuggestions
(
SearchPlaceIndexForSuggestions (..),
newSearchPlaceIndexForSuggestions,
searchPlaceIndexForSuggestions_biasPosition,
searchPlaceIndexForSuggestions_filterBBox,
searchPlaceIndexForSuggestions_filterCountries,
searchPlaceIndexForSuggestions_language,
searchPlaceIndexForSuggestions_maxResults,
searchPlaceIndexForSuggestions_indexName,
searchPlaceIndexForSuggestions_text,
SearchPlaceIndexForSuggestionsResponse (..),
newSearchPlaceIndexForSuggestionsResponse,
searchPlaceIndexForSuggestionsResponse_httpStatus,
searchPlaceIndexForSuggestionsResponse_results,
searchPlaceIndexForSuggestionsResponse_summary,
)
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
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data SearchPlaceIndexForSuggestions = SearchPlaceIndexForSuggestions'
{
SearchPlaceIndexForSuggestions
-> Maybe (Sensitive (NonEmpty Double))
biasPosition :: Prelude.Maybe (Data.Sensitive (Prelude.NonEmpty Prelude.Double)),
SearchPlaceIndexForSuggestions
-> Maybe (Sensitive (NonEmpty Double))
filterBBox :: Prelude.Maybe (Data.Sensitive (Prelude.NonEmpty Prelude.Double)),
SearchPlaceIndexForSuggestions -> Maybe (NonEmpty Text)
filterCountries :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
SearchPlaceIndexForSuggestions -> Maybe Text
language :: Prelude.Maybe Prelude.Text,
SearchPlaceIndexForSuggestions -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
SearchPlaceIndexForSuggestions -> Text
indexName :: Prelude.Text,
SearchPlaceIndexForSuggestions -> Sensitive Text
text :: Data.Sensitive Prelude.Text
}
deriving (SearchPlaceIndexForSuggestions
-> SearchPlaceIndexForSuggestions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SearchPlaceIndexForSuggestions
-> SearchPlaceIndexForSuggestions -> Bool
$c/= :: SearchPlaceIndexForSuggestions
-> SearchPlaceIndexForSuggestions -> Bool
== :: SearchPlaceIndexForSuggestions
-> SearchPlaceIndexForSuggestions -> Bool
$c== :: SearchPlaceIndexForSuggestions
-> SearchPlaceIndexForSuggestions -> Bool
Prelude.Eq, Int -> SearchPlaceIndexForSuggestions -> ShowS
[SearchPlaceIndexForSuggestions] -> ShowS
SearchPlaceIndexForSuggestions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SearchPlaceIndexForSuggestions] -> ShowS
$cshowList :: [SearchPlaceIndexForSuggestions] -> ShowS
show :: SearchPlaceIndexForSuggestions -> String
$cshow :: SearchPlaceIndexForSuggestions -> String
showsPrec :: Int -> SearchPlaceIndexForSuggestions -> ShowS
$cshowsPrec :: Int -> SearchPlaceIndexForSuggestions -> ShowS
Prelude.Show, forall x.
Rep SearchPlaceIndexForSuggestions x
-> SearchPlaceIndexForSuggestions
forall x.
SearchPlaceIndexForSuggestions
-> Rep SearchPlaceIndexForSuggestions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SearchPlaceIndexForSuggestions x
-> SearchPlaceIndexForSuggestions
$cfrom :: forall x.
SearchPlaceIndexForSuggestions
-> Rep SearchPlaceIndexForSuggestions x
Prelude.Generic)
newSearchPlaceIndexForSuggestions ::
Prelude.Text ->
Prelude.Text ->
SearchPlaceIndexForSuggestions
newSearchPlaceIndexForSuggestions :: Text -> Text -> SearchPlaceIndexForSuggestions
newSearchPlaceIndexForSuggestions Text
pIndexName_ Text
pText_ =
SearchPlaceIndexForSuggestions'
{ $sel:biasPosition:SearchPlaceIndexForSuggestions' :: Maybe (Sensitive (NonEmpty Double))
biasPosition =
forall a. Maybe a
Prelude.Nothing,
$sel:filterBBox:SearchPlaceIndexForSuggestions' :: Maybe (Sensitive (NonEmpty Double))
filterBBox = forall a. Maybe a
Prelude.Nothing,
$sel:filterCountries:SearchPlaceIndexForSuggestions' :: Maybe (NonEmpty Text)
filterCountries = forall a. Maybe a
Prelude.Nothing,
$sel:language:SearchPlaceIndexForSuggestions' :: Maybe Text
language = forall a. Maybe a
Prelude.Nothing,
$sel:maxResults:SearchPlaceIndexForSuggestions' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
$sel:indexName:SearchPlaceIndexForSuggestions' :: Text
indexName = Text
pIndexName_,
$sel:text:SearchPlaceIndexForSuggestions' :: Sensitive Text
text = forall a. Iso' (Sensitive a) a
Data._Sensitive forall t b. AReview t b -> b -> t
Lens.# Text
pText_
}
searchPlaceIndexForSuggestions_biasPosition :: Lens.Lens' SearchPlaceIndexForSuggestions (Prelude.Maybe (Prelude.NonEmpty Prelude.Double))
searchPlaceIndexForSuggestions_biasPosition :: Lens' SearchPlaceIndexForSuggestions (Maybe (NonEmpty Double))
searchPlaceIndexForSuggestions_biasPosition = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchPlaceIndexForSuggestions' {Maybe (Sensitive (NonEmpty Double))
biasPosition :: Maybe (Sensitive (NonEmpty Double))
$sel:biasPosition:SearchPlaceIndexForSuggestions' :: SearchPlaceIndexForSuggestions
-> Maybe (Sensitive (NonEmpty Double))
biasPosition} -> Maybe (Sensitive (NonEmpty Double))
biasPosition) (\s :: SearchPlaceIndexForSuggestions
s@SearchPlaceIndexForSuggestions' {} Maybe (Sensitive (NonEmpty Double))
a -> SearchPlaceIndexForSuggestions
s {$sel:biasPosition:SearchPlaceIndexForSuggestions' :: Maybe (Sensitive (NonEmpty Double))
biasPosition = Maybe (Sensitive (NonEmpty Double))
a} :: SearchPlaceIndexForSuggestions) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 (forall a. Iso' (Sensitive a) a
Data._Sensitive forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced)
searchPlaceIndexForSuggestions_filterBBox :: Lens.Lens' SearchPlaceIndexForSuggestions (Prelude.Maybe (Prelude.NonEmpty Prelude.Double))
searchPlaceIndexForSuggestions_filterBBox :: Lens' SearchPlaceIndexForSuggestions (Maybe (NonEmpty Double))
searchPlaceIndexForSuggestions_filterBBox = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchPlaceIndexForSuggestions' {Maybe (Sensitive (NonEmpty Double))
filterBBox :: Maybe (Sensitive (NonEmpty Double))
$sel:filterBBox:SearchPlaceIndexForSuggestions' :: SearchPlaceIndexForSuggestions
-> Maybe (Sensitive (NonEmpty Double))
filterBBox} -> Maybe (Sensitive (NonEmpty Double))
filterBBox) (\s :: SearchPlaceIndexForSuggestions
s@SearchPlaceIndexForSuggestions' {} Maybe (Sensitive (NonEmpty Double))
a -> SearchPlaceIndexForSuggestions
s {$sel:filterBBox:SearchPlaceIndexForSuggestions' :: Maybe (Sensitive (NonEmpty Double))
filterBBox = Maybe (Sensitive (NonEmpty Double))
a} :: SearchPlaceIndexForSuggestions) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 (forall a. Iso' (Sensitive a) a
Data._Sensitive forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced)
searchPlaceIndexForSuggestions_filterCountries :: Lens.Lens' SearchPlaceIndexForSuggestions (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
searchPlaceIndexForSuggestions_filterCountries :: Lens' SearchPlaceIndexForSuggestions (Maybe (NonEmpty Text))
searchPlaceIndexForSuggestions_filterCountries = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchPlaceIndexForSuggestions' {Maybe (NonEmpty Text)
filterCountries :: Maybe (NonEmpty Text)
$sel:filterCountries:SearchPlaceIndexForSuggestions' :: SearchPlaceIndexForSuggestions -> Maybe (NonEmpty Text)
filterCountries} -> Maybe (NonEmpty Text)
filterCountries) (\s :: SearchPlaceIndexForSuggestions
s@SearchPlaceIndexForSuggestions' {} Maybe (NonEmpty Text)
a -> SearchPlaceIndexForSuggestions
s {$sel:filterCountries:SearchPlaceIndexForSuggestions' :: Maybe (NonEmpty Text)
filterCountries = Maybe (NonEmpty Text)
a} :: SearchPlaceIndexForSuggestions) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
searchPlaceIndexForSuggestions_language :: Lens.Lens' SearchPlaceIndexForSuggestions (Prelude.Maybe Prelude.Text)
searchPlaceIndexForSuggestions_language :: Lens' SearchPlaceIndexForSuggestions (Maybe Text)
searchPlaceIndexForSuggestions_language = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchPlaceIndexForSuggestions' {Maybe Text
language :: Maybe Text
$sel:language:SearchPlaceIndexForSuggestions' :: SearchPlaceIndexForSuggestions -> Maybe Text
language} -> Maybe Text
language) (\s :: SearchPlaceIndexForSuggestions
s@SearchPlaceIndexForSuggestions' {} Maybe Text
a -> SearchPlaceIndexForSuggestions
s {$sel:language:SearchPlaceIndexForSuggestions' :: Maybe Text
language = Maybe Text
a} :: SearchPlaceIndexForSuggestions)
searchPlaceIndexForSuggestions_maxResults :: Lens.Lens' SearchPlaceIndexForSuggestions (Prelude.Maybe Prelude.Natural)
searchPlaceIndexForSuggestions_maxResults :: Lens' SearchPlaceIndexForSuggestions (Maybe Natural)
searchPlaceIndexForSuggestions_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchPlaceIndexForSuggestions' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:SearchPlaceIndexForSuggestions' :: SearchPlaceIndexForSuggestions -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: SearchPlaceIndexForSuggestions
s@SearchPlaceIndexForSuggestions' {} Maybe Natural
a -> SearchPlaceIndexForSuggestions
s {$sel:maxResults:SearchPlaceIndexForSuggestions' :: Maybe Natural
maxResults = Maybe Natural
a} :: SearchPlaceIndexForSuggestions)
searchPlaceIndexForSuggestions_indexName :: Lens.Lens' SearchPlaceIndexForSuggestions Prelude.Text
searchPlaceIndexForSuggestions_indexName :: Lens' SearchPlaceIndexForSuggestions Text
searchPlaceIndexForSuggestions_indexName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchPlaceIndexForSuggestions' {Text
indexName :: Text
$sel:indexName:SearchPlaceIndexForSuggestions' :: SearchPlaceIndexForSuggestions -> Text
indexName} -> Text
indexName) (\s :: SearchPlaceIndexForSuggestions
s@SearchPlaceIndexForSuggestions' {} Text
a -> SearchPlaceIndexForSuggestions
s {$sel:indexName:SearchPlaceIndexForSuggestions' :: Text
indexName = Text
a} :: SearchPlaceIndexForSuggestions)
searchPlaceIndexForSuggestions_text :: Lens.Lens' SearchPlaceIndexForSuggestions Prelude.Text
searchPlaceIndexForSuggestions_text :: Lens' SearchPlaceIndexForSuggestions Text
searchPlaceIndexForSuggestions_text = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchPlaceIndexForSuggestions' {Sensitive Text
text :: Sensitive Text
$sel:text:SearchPlaceIndexForSuggestions' :: SearchPlaceIndexForSuggestions -> Sensitive Text
text} -> Sensitive Text
text) (\s :: SearchPlaceIndexForSuggestions
s@SearchPlaceIndexForSuggestions' {} Sensitive Text
a -> SearchPlaceIndexForSuggestions
s {$sel:text:SearchPlaceIndexForSuggestions' :: Sensitive Text
text = Sensitive Text
a} :: SearchPlaceIndexForSuggestions) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a. Iso' (Sensitive a) a
Data._Sensitive
instance
Core.AWSRequest
SearchPlaceIndexForSuggestions
where
type
AWSResponse SearchPlaceIndexForSuggestions =
SearchPlaceIndexForSuggestionsResponse
request :: (Service -> Service)
-> SearchPlaceIndexForSuggestions
-> Request SearchPlaceIndexForSuggestions
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy SearchPlaceIndexForSuggestions
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse SearchPlaceIndexForSuggestions)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Int
-> [SearchForSuggestionsResult]
-> SearchPlaceIndexForSuggestionsSummary
-> SearchPlaceIndexForSuggestionsResponse
SearchPlaceIndexForSuggestionsResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Results" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"Summary")
)
instance
Prelude.Hashable
SearchPlaceIndexForSuggestions
where
hashWithSalt :: Int -> SearchPlaceIndexForSuggestions -> Int
hashWithSalt
Int
_salt
SearchPlaceIndexForSuggestions' {Maybe Natural
Maybe (NonEmpty Text)
Maybe Text
Maybe (Sensitive (NonEmpty Double))
Text
Sensitive Text
text :: Sensitive Text
indexName :: Text
maxResults :: Maybe Natural
language :: Maybe Text
filterCountries :: Maybe (NonEmpty Text)
filterBBox :: Maybe (Sensitive (NonEmpty Double))
biasPosition :: Maybe (Sensitive (NonEmpty Double))
$sel:text:SearchPlaceIndexForSuggestions' :: SearchPlaceIndexForSuggestions -> Sensitive Text
$sel:indexName:SearchPlaceIndexForSuggestions' :: SearchPlaceIndexForSuggestions -> Text
$sel:maxResults:SearchPlaceIndexForSuggestions' :: SearchPlaceIndexForSuggestions -> Maybe Natural
$sel:language:SearchPlaceIndexForSuggestions' :: SearchPlaceIndexForSuggestions -> Maybe Text
$sel:filterCountries:SearchPlaceIndexForSuggestions' :: SearchPlaceIndexForSuggestions -> Maybe (NonEmpty Text)
$sel:filterBBox:SearchPlaceIndexForSuggestions' :: SearchPlaceIndexForSuggestions
-> Maybe (Sensitive (NonEmpty Double))
$sel:biasPosition:SearchPlaceIndexForSuggestions' :: SearchPlaceIndexForSuggestions
-> Maybe (Sensitive (NonEmpty Double))
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive (NonEmpty Double))
biasPosition
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive (NonEmpty Double))
filterBBox
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty Text)
filterCountries
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
language
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
indexName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Sensitive Text
text
instance
Prelude.NFData
SearchPlaceIndexForSuggestions
where
rnf :: SearchPlaceIndexForSuggestions -> ()
rnf SearchPlaceIndexForSuggestions' {Maybe Natural
Maybe (NonEmpty Text)
Maybe Text
Maybe (Sensitive (NonEmpty Double))
Text
Sensitive Text
text :: Sensitive Text
indexName :: Text
maxResults :: Maybe Natural
language :: Maybe Text
filterCountries :: Maybe (NonEmpty Text)
filterBBox :: Maybe (Sensitive (NonEmpty Double))
biasPosition :: Maybe (Sensitive (NonEmpty Double))
$sel:text:SearchPlaceIndexForSuggestions' :: SearchPlaceIndexForSuggestions -> Sensitive Text
$sel:indexName:SearchPlaceIndexForSuggestions' :: SearchPlaceIndexForSuggestions -> Text
$sel:maxResults:SearchPlaceIndexForSuggestions' :: SearchPlaceIndexForSuggestions -> Maybe Natural
$sel:language:SearchPlaceIndexForSuggestions' :: SearchPlaceIndexForSuggestions -> Maybe Text
$sel:filterCountries:SearchPlaceIndexForSuggestions' :: SearchPlaceIndexForSuggestions -> Maybe (NonEmpty Text)
$sel:filterBBox:SearchPlaceIndexForSuggestions' :: SearchPlaceIndexForSuggestions
-> Maybe (Sensitive (NonEmpty Double))
$sel:biasPosition:SearchPlaceIndexForSuggestions' :: SearchPlaceIndexForSuggestions
-> Maybe (Sensitive (NonEmpty Double))
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive (NonEmpty Double))
biasPosition
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive (NonEmpty Double))
filterBBox
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty Text)
filterCountries
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
language
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
indexName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Sensitive Text
text
instance
Data.ToHeaders
SearchPlaceIndexForSuggestions
where
toHeaders :: SearchPlaceIndexForSuggestions -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON SearchPlaceIndexForSuggestions where
toJSON :: SearchPlaceIndexForSuggestions -> Value
toJSON SearchPlaceIndexForSuggestions' {Maybe Natural
Maybe (NonEmpty Text)
Maybe Text
Maybe (Sensitive (NonEmpty Double))
Text
Sensitive Text
text :: Sensitive Text
indexName :: Text
maxResults :: Maybe Natural
language :: Maybe Text
filterCountries :: Maybe (NonEmpty Text)
filterBBox :: Maybe (Sensitive (NonEmpty Double))
biasPosition :: Maybe (Sensitive (NonEmpty Double))
$sel:text:SearchPlaceIndexForSuggestions' :: SearchPlaceIndexForSuggestions -> Sensitive Text
$sel:indexName:SearchPlaceIndexForSuggestions' :: SearchPlaceIndexForSuggestions -> Text
$sel:maxResults:SearchPlaceIndexForSuggestions' :: SearchPlaceIndexForSuggestions -> Maybe Natural
$sel:language:SearchPlaceIndexForSuggestions' :: SearchPlaceIndexForSuggestions -> Maybe Text
$sel:filterCountries:SearchPlaceIndexForSuggestions' :: SearchPlaceIndexForSuggestions -> Maybe (NonEmpty Text)
$sel:filterBBox:SearchPlaceIndexForSuggestions' :: SearchPlaceIndexForSuggestions
-> Maybe (Sensitive (NonEmpty Double))
$sel:biasPosition:SearchPlaceIndexForSuggestions' :: SearchPlaceIndexForSuggestions
-> Maybe (Sensitive (NonEmpty Double))
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"BiasPosition" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive (NonEmpty Double))
biasPosition,
(Key
"FilterBBox" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive (NonEmpty Double))
filterBBox,
(Key
"FilterCountries" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Text)
filterCountries,
(Key
"Language" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
language,
(Key
"MaxResults" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
forall a. a -> Maybe a
Prelude.Just (Key
"Text" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Sensitive Text
text)
]
)
instance Data.ToPath SearchPlaceIndexForSuggestions where
toPath :: SearchPlaceIndexForSuggestions -> ByteString
toPath SearchPlaceIndexForSuggestions' {Maybe Natural
Maybe (NonEmpty Text)
Maybe Text
Maybe (Sensitive (NonEmpty Double))
Text
Sensitive Text
text :: Sensitive Text
indexName :: Text
maxResults :: Maybe Natural
language :: Maybe Text
filterCountries :: Maybe (NonEmpty Text)
filterBBox :: Maybe (Sensitive (NonEmpty Double))
biasPosition :: Maybe (Sensitive (NonEmpty Double))
$sel:text:SearchPlaceIndexForSuggestions' :: SearchPlaceIndexForSuggestions -> Sensitive Text
$sel:indexName:SearchPlaceIndexForSuggestions' :: SearchPlaceIndexForSuggestions -> Text
$sel:maxResults:SearchPlaceIndexForSuggestions' :: SearchPlaceIndexForSuggestions -> Maybe Natural
$sel:language:SearchPlaceIndexForSuggestions' :: SearchPlaceIndexForSuggestions -> Maybe Text
$sel:filterCountries:SearchPlaceIndexForSuggestions' :: SearchPlaceIndexForSuggestions -> Maybe (NonEmpty Text)
$sel:filterBBox:SearchPlaceIndexForSuggestions' :: SearchPlaceIndexForSuggestions
-> Maybe (Sensitive (NonEmpty Double))
$sel:biasPosition:SearchPlaceIndexForSuggestions' :: SearchPlaceIndexForSuggestions
-> Maybe (Sensitive (NonEmpty Double))
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/places/v0/indexes/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
indexName,
ByteString
"/search/suggestions"
]
instance Data.ToQuery SearchPlaceIndexForSuggestions where
toQuery :: SearchPlaceIndexForSuggestions -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data SearchPlaceIndexForSuggestionsResponse = SearchPlaceIndexForSuggestionsResponse'
{
SearchPlaceIndexForSuggestionsResponse -> Int
httpStatus :: Prelude.Int,
SearchPlaceIndexForSuggestionsResponse
-> [SearchForSuggestionsResult]
results :: [SearchForSuggestionsResult],
SearchPlaceIndexForSuggestionsResponse
-> SearchPlaceIndexForSuggestionsSummary
summary :: SearchPlaceIndexForSuggestionsSummary
}
deriving (SearchPlaceIndexForSuggestionsResponse
-> SearchPlaceIndexForSuggestionsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SearchPlaceIndexForSuggestionsResponse
-> SearchPlaceIndexForSuggestionsResponse -> Bool
$c/= :: SearchPlaceIndexForSuggestionsResponse
-> SearchPlaceIndexForSuggestionsResponse -> Bool
== :: SearchPlaceIndexForSuggestionsResponse
-> SearchPlaceIndexForSuggestionsResponse -> Bool
$c== :: SearchPlaceIndexForSuggestionsResponse
-> SearchPlaceIndexForSuggestionsResponse -> Bool
Prelude.Eq, Int -> SearchPlaceIndexForSuggestionsResponse -> ShowS
[SearchPlaceIndexForSuggestionsResponse] -> ShowS
SearchPlaceIndexForSuggestionsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SearchPlaceIndexForSuggestionsResponse] -> ShowS
$cshowList :: [SearchPlaceIndexForSuggestionsResponse] -> ShowS
show :: SearchPlaceIndexForSuggestionsResponse -> String
$cshow :: SearchPlaceIndexForSuggestionsResponse -> String
showsPrec :: Int -> SearchPlaceIndexForSuggestionsResponse -> ShowS
$cshowsPrec :: Int -> SearchPlaceIndexForSuggestionsResponse -> ShowS
Prelude.Show, forall x.
Rep SearchPlaceIndexForSuggestionsResponse x
-> SearchPlaceIndexForSuggestionsResponse
forall x.
SearchPlaceIndexForSuggestionsResponse
-> Rep SearchPlaceIndexForSuggestionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SearchPlaceIndexForSuggestionsResponse x
-> SearchPlaceIndexForSuggestionsResponse
$cfrom :: forall x.
SearchPlaceIndexForSuggestionsResponse
-> Rep SearchPlaceIndexForSuggestionsResponse x
Prelude.Generic)
newSearchPlaceIndexForSuggestionsResponse ::
Prelude.Int ->
SearchPlaceIndexForSuggestionsSummary ->
SearchPlaceIndexForSuggestionsResponse
newSearchPlaceIndexForSuggestionsResponse :: Int
-> SearchPlaceIndexForSuggestionsSummary
-> SearchPlaceIndexForSuggestionsResponse
newSearchPlaceIndexForSuggestionsResponse
Int
pHttpStatus_
SearchPlaceIndexForSuggestionsSummary
pSummary_ =
SearchPlaceIndexForSuggestionsResponse'
{ $sel:httpStatus:SearchPlaceIndexForSuggestionsResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:results:SearchPlaceIndexForSuggestionsResponse' :: [SearchForSuggestionsResult]
results = forall a. Monoid a => a
Prelude.mempty,
$sel:summary:SearchPlaceIndexForSuggestionsResponse' :: SearchPlaceIndexForSuggestionsSummary
summary = SearchPlaceIndexForSuggestionsSummary
pSummary_
}
searchPlaceIndexForSuggestionsResponse_httpStatus :: Lens.Lens' SearchPlaceIndexForSuggestionsResponse Prelude.Int
searchPlaceIndexForSuggestionsResponse_httpStatus :: Lens' SearchPlaceIndexForSuggestionsResponse Int
searchPlaceIndexForSuggestionsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchPlaceIndexForSuggestionsResponse' {Int
httpStatus :: Int
$sel:httpStatus:SearchPlaceIndexForSuggestionsResponse' :: SearchPlaceIndexForSuggestionsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: SearchPlaceIndexForSuggestionsResponse
s@SearchPlaceIndexForSuggestionsResponse' {} Int
a -> SearchPlaceIndexForSuggestionsResponse
s {$sel:httpStatus:SearchPlaceIndexForSuggestionsResponse' :: Int
httpStatus = Int
a} :: SearchPlaceIndexForSuggestionsResponse)
searchPlaceIndexForSuggestionsResponse_results :: Lens.Lens' SearchPlaceIndexForSuggestionsResponse [SearchForSuggestionsResult]
searchPlaceIndexForSuggestionsResponse_results :: Lens'
SearchPlaceIndexForSuggestionsResponse [SearchForSuggestionsResult]
searchPlaceIndexForSuggestionsResponse_results = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchPlaceIndexForSuggestionsResponse' {[SearchForSuggestionsResult]
results :: [SearchForSuggestionsResult]
$sel:results:SearchPlaceIndexForSuggestionsResponse' :: SearchPlaceIndexForSuggestionsResponse
-> [SearchForSuggestionsResult]
results} -> [SearchForSuggestionsResult]
results) (\s :: SearchPlaceIndexForSuggestionsResponse
s@SearchPlaceIndexForSuggestionsResponse' {} [SearchForSuggestionsResult]
a -> SearchPlaceIndexForSuggestionsResponse
s {$sel:results:SearchPlaceIndexForSuggestionsResponse' :: [SearchForSuggestionsResult]
results = [SearchForSuggestionsResult]
a} :: SearchPlaceIndexForSuggestionsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
searchPlaceIndexForSuggestionsResponse_summary :: Lens.Lens' SearchPlaceIndexForSuggestionsResponse SearchPlaceIndexForSuggestionsSummary
searchPlaceIndexForSuggestionsResponse_summary :: Lens'
SearchPlaceIndexForSuggestionsResponse
SearchPlaceIndexForSuggestionsSummary
searchPlaceIndexForSuggestionsResponse_summary = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchPlaceIndexForSuggestionsResponse' {SearchPlaceIndexForSuggestionsSummary
summary :: SearchPlaceIndexForSuggestionsSummary
$sel:summary:SearchPlaceIndexForSuggestionsResponse' :: SearchPlaceIndexForSuggestionsResponse
-> SearchPlaceIndexForSuggestionsSummary
summary} -> SearchPlaceIndexForSuggestionsSummary
summary) (\s :: SearchPlaceIndexForSuggestionsResponse
s@SearchPlaceIndexForSuggestionsResponse' {} SearchPlaceIndexForSuggestionsSummary
a -> SearchPlaceIndexForSuggestionsResponse
s {$sel:summary:SearchPlaceIndexForSuggestionsResponse' :: SearchPlaceIndexForSuggestionsSummary
summary = SearchPlaceIndexForSuggestionsSummary
a} :: SearchPlaceIndexForSuggestionsResponse)
instance
Prelude.NFData
SearchPlaceIndexForSuggestionsResponse
where
rnf :: SearchPlaceIndexForSuggestionsResponse -> ()
rnf SearchPlaceIndexForSuggestionsResponse' {Int
[SearchForSuggestionsResult]
SearchPlaceIndexForSuggestionsSummary
summary :: SearchPlaceIndexForSuggestionsSummary
results :: [SearchForSuggestionsResult]
httpStatus :: Int
$sel:summary:SearchPlaceIndexForSuggestionsResponse' :: SearchPlaceIndexForSuggestionsResponse
-> SearchPlaceIndexForSuggestionsSummary
$sel:results:SearchPlaceIndexForSuggestionsResponse' :: SearchPlaceIndexForSuggestionsResponse
-> [SearchForSuggestionsResult]
$sel:httpStatus:SearchPlaceIndexForSuggestionsResponse' :: SearchPlaceIndexForSuggestionsResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [SearchForSuggestionsResult]
results
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf SearchPlaceIndexForSuggestionsSummary
summary