{-# 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.GetMapGlyphs
(
GetMapGlyphs (..),
newGetMapGlyphs,
getMapGlyphs_fontStack,
getMapGlyphs_fontUnicodeRange,
getMapGlyphs_mapName,
GetMapGlyphsResponse (..),
newGetMapGlyphsResponse,
getMapGlyphsResponse_blob,
getMapGlyphsResponse_contentType,
getMapGlyphsResponse_httpStatus,
)
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 GetMapGlyphs = GetMapGlyphs'
{
GetMapGlyphs -> Text
fontStack :: Prelude.Text,
GetMapGlyphs -> Text
fontUnicodeRange :: Prelude.Text,
GetMapGlyphs -> Text
mapName :: Prelude.Text
}
deriving (GetMapGlyphs -> GetMapGlyphs -> Bool
(GetMapGlyphs -> GetMapGlyphs -> Bool)
-> (GetMapGlyphs -> GetMapGlyphs -> Bool) -> Eq GetMapGlyphs
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetMapGlyphs -> GetMapGlyphs -> Bool
$c/= :: GetMapGlyphs -> GetMapGlyphs -> Bool
== :: GetMapGlyphs -> GetMapGlyphs -> Bool
$c== :: GetMapGlyphs -> GetMapGlyphs -> Bool
Prelude.Eq, ReadPrec [GetMapGlyphs]
ReadPrec GetMapGlyphs
Int -> ReadS GetMapGlyphs
ReadS [GetMapGlyphs]
(Int -> ReadS GetMapGlyphs)
-> ReadS [GetMapGlyphs]
-> ReadPrec GetMapGlyphs
-> ReadPrec [GetMapGlyphs]
-> Read GetMapGlyphs
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetMapGlyphs]
$creadListPrec :: ReadPrec [GetMapGlyphs]
readPrec :: ReadPrec GetMapGlyphs
$creadPrec :: ReadPrec GetMapGlyphs
readList :: ReadS [GetMapGlyphs]
$creadList :: ReadS [GetMapGlyphs]
readsPrec :: Int -> ReadS GetMapGlyphs
$creadsPrec :: Int -> ReadS GetMapGlyphs
Prelude.Read, Int -> GetMapGlyphs -> ShowS
[GetMapGlyphs] -> ShowS
GetMapGlyphs -> String
(Int -> GetMapGlyphs -> ShowS)
-> (GetMapGlyphs -> String)
-> ([GetMapGlyphs] -> ShowS)
-> Show GetMapGlyphs
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetMapGlyphs] -> ShowS
$cshowList :: [GetMapGlyphs] -> ShowS
show :: GetMapGlyphs -> String
$cshow :: GetMapGlyphs -> String
showsPrec :: Int -> GetMapGlyphs -> ShowS
$cshowsPrec :: Int -> GetMapGlyphs -> ShowS
Prelude.Show, (forall x. GetMapGlyphs -> Rep GetMapGlyphs x)
-> (forall x. Rep GetMapGlyphs x -> GetMapGlyphs)
-> Generic GetMapGlyphs
forall x. Rep GetMapGlyphs x -> GetMapGlyphs
forall x. GetMapGlyphs -> Rep GetMapGlyphs x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetMapGlyphs x -> GetMapGlyphs
$cfrom :: forall x. GetMapGlyphs -> Rep GetMapGlyphs x
Prelude.Generic)
newGetMapGlyphs ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
GetMapGlyphs
newGetMapGlyphs :: Text -> Text -> Text -> GetMapGlyphs
newGetMapGlyphs
Text
pFontStack_
Text
pFontUnicodeRange_
Text
pMapName_ =
GetMapGlyphs' :: Text -> Text -> Text -> GetMapGlyphs
GetMapGlyphs'
{ $sel:fontStack:GetMapGlyphs' :: Text
fontStack = Text
pFontStack_,
$sel:fontUnicodeRange:GetMapGlyphs' :: Text
fontUnicodeRange = Text
pFontUnicodeRange_,
$sel:mapName:GetMapGlyphs' :: Text
mapName = Text
pMapName_
}
getMapGlyphs_fontStack :: Lens.Lens' GetMapGlyphs Prelude.Text
getMapGlyphs_fontStack :: (Text -> f Text) -> GetMapGlyphs -> f GetMapGlyphs
getMapGlyphs_fontStack = (GetMapGlyphs -> Text)
-> (GetMapGlyphs -> Text -> GetMapGlyphs)
-> Lens GetMapGlyphs GetMapGlyphs Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMapGlyphs' {Text
fontStack :: Text
$sel:fontStack:GetMapGlyphs' :: GetMapGlyphs -> Text
fontStack} -> Text
fontStack) (\s :: GetMapGlyphs
s@GetMapGlyphs' {} Text
a -> GetMapGlyphs
s {$sel:fontStack:GetMapGlyphs' :: Text
fontStack = Text
a} :: GetMapGlyphs)
getMapGlyphs_fontUnicodeRange :: Lens.Lens' GetMapGlyphs Prelude.Text
getMapGlyphs_fontUnicodeRange :: (Text -> f Text) -> GetMapGlyphs -> f GetMapGlyphs
getMapGlyphs_fontUnicodeRange = (GetMapGlyphs -> Text)
-> (GetMapGlyphs -> Text -> GetMapGlyphs)
-> Lens GetMapGlyphs GetMapGlyphs Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMapGlyphs' {Text
fontUnicodeRange :: Text
$sel:fontUnicodeRange:GetMapGlyphs' :: GetMapGlyphs -> Text
fontUnicodeRange} -> Text
fontUnicodeRange) (\s :: GetMapGlyphs
s@GetMapGlyphs' {} Text
a -> GetMapGlyphs
s {$sel:fontUnicodeRange:GetMapGlyphs' :: Text
fontUnicodeRange = Text
a} :: GetMapGlyphs)
getMapGlyphs_mapName :: Lens.Lens' GetMapGlyphs Prelude.Text
getMapGlyphs_mapName :: (Text -> f Text) -> GetMapGlyphs -> f GetMapGlyphs
getMapGlyphs_mapName = (GetMapGlyphs -> Text)
-> (GetMapGlyphs -> Text -> GetMapGlyphs)
-> Lens GetMapGlyphs GetMapGlyphs Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMapGlyphs' {Text
mapName :: Text
$sel:mapName:GetMapGlyphs' :: GetMapGlyphs -> Text
mapName} -> Text
mapName) (\s :: GetMapGlyphs
s@GetMapGlyphs' {} Text
a -> GetMapGlyphs
s {$sel:mapName:GetMapGlyphs' :: Text
mapName = Text
a} :: GetMapGlyphs)
instance Core.AWSRequest GetMapGlyphs where
type AWSResponse GetMapGlyphs = GetMapGlyphsResponse
request :: GetMapGlyphs -> Request GetMapGlyphs
request = Service -> GetMapGlyphs -> Request GetMapGlyphs
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy GetMapGlyphs
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetMapGlyphs)))
response =
(Int
-> ResponseHeaders
-> ByteString
-> Either String (AWSResponse GetMapGlyphs))
-> Logger
-> Service
-> Proxy GetMapGlyphs
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetMapGlyphs)))
forall (m :: * -> *) a.
MonadResource m =>
(Int
-> ResponseHeaders -> ByteString -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveBytes
( \Int
s ResponseHeaders
h ByteString
x ->
Maybe ByteString -> Maybe Text -> Int -> GetMapGlyphsResponse
GetMapGlyphsResponse'
(Maybe ByteString -> Maybe Text -> Int -> GetMapGlyphsResponse)
-> Either String (Maybe ByteString)
-> Either String (Maybe Text -> Int -> GetMapGlyphsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Maybe ByteString -> Either String (Maybe ByteString)
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (ByteString -> Maybe ByteString
forall a. a -> Maybe a
Prelude.Just (ByteString -> ByteString
Prelude.coerce ByteString
x)))
Either String (Maybe Text -> Int -> GetMapGlyphsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> GetMapGlyphsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (ResponseHeaders
h ResponseHeaders -> HeaderName -> Either String (Maybe Text)
forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Core..#? HeaderName
"Content-Type")
Either String (Int -> GetMapGlyphsResponse)
-> Either String Int -> Either String GetMapGlyphsResponse
forall (f :: * -> *) a b. Applicative f => 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))
)
instance Prelude.Hashable GetMapGlyphs
instance Prelude.NFData GetMapGlyphs
instance Core.ToHeaders GetMapGlyphs where
toHeaders :: GetMapGlyphs -> ResponseHeaders
toHeaders =
ResponseHeaders -> GetMapGlyphs -> 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.ToPath GetMapGlyphs where
toPath :: GetMapGlyphs -> ByteString
toPath GetMapGlyphs' {Text
mapName :: Text
fontUnicodeRange :: Text
fontStack :: Text
$sel:mapName:GetMapGlyphs' :: GetMapGlyphs -> Text
$sel:fontUnicodeRange:GetMapGlyphs' :: GetMapGlyphs -> Text
$sel:fontStack:GetMapGlyphs' :: GetMapGlyphs -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/maps/v0/maps/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
mapName,
ByteString
"/glyphs/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
fontStack,
ByteString
"/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
fontUnicodeRange
]
instance Core.ToQuery GetMapGlyphs where
toQuery :: GetMapGlyphs -> QueryString
toQuery = QueryString -> GetMapGlyphs -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data GetMapGlyphsResponse = GetMapGlyphsResponse'
{
GetMapGlyphsResponse -> Maybe ByteString
blob :: Prelude.Maybe Prelude.ByteString,
GetMapGlyphsResponse -> Maybe Text
contentType :: Prelude.Maybe Prelude.Text,
GetMapGlyphsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetMapGlyphsResponse -> GetMapGlyphsResponse -> Bool
(GetMapGlyphsResponse -> GetMapGlyphsResponse -> Bool)
-> (GetMapGlyphsResponse -> GetMapGlyphsResponse -> Bool)
-> Eq GetMapGlyphsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetMapGlyphsResponse -> GetMapGlyphsResponse -> Bool
$c/= :: GetMapGlyphsResponse -> GetMapGlyphsResponse -> Bool
== :: GetMapGlyphsResponse -> GetMapGlyphsResponse -> Bool
$c== :: GetMapGlyphsResponse -> GetMapGlyphsResponse -> Bool
Prelude.Eq, ReadPrec [GetMapGlyphsResponse]
ReadPrec GetMapGlyphsResponse
Int -> ReadS GetMapGlyphsResponse
ReadS [GetMapGlyphsResponse]
(Int -> ReadS GetMapGlyphsResponse)
-> ReadS [GetMapGlyphsResponse]
-> ReadPrec GetMapGlyphsResponse
-> ReadPrec [GetMapGlyphsResponse]
-> Read GetMapGlyphsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetMapGlyphsResponse]
$creadListPrec :: ReadPrec [GetMapGlyphsResponse]
readPrec :: ReadPrec GetMapGlyphsResponse
$creadPrec :: ReadPrec GetMapGlyphsResponse
readList :: ReadS [GetMapGlyphsResponse]
$creadList :: ReadS [GetMapGlyphsResponse]
readsPrec :: Int -> ReadS GetMapGlyphsResponse
$creadsPrec :: Int -> ReadS GetMapGlyphsResponse
Prelude.Read, Int -> GetMapGlyphsResponse -> ShowS
[GetMapGlyphsResponse] -> ShowS
GetMapGlyphsResponse -> String
(Int -> GetMapGlyphsResponse -> ShowS)
-> (GetMapGlyphsResponse -> String)
-> ([GetMapGlyphsResponse] -> ShowS)
-> Show GetMapGlyphsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetMapGlyphsResponse] -> ShowS
$cshowList :: [GetMapGlyphsResponse] -> ShowS
show :: GetMapGlyphsResponse -> String
$cshow :: GetMapGlyphsResponse -> String
showsPrec :: Int -> GetMapGlyphsResponse -> ShowS
$cshowsPrec :: Int -> GetMapGlyphsResponse -> ShowS
Prelude.Show, (forall x. GetMapGlyphsResponse -> Rep GetMapGlyphsResponse x)
-> (forall x. Rep GetMapGlyphsResponse x -> GetMapGlyphsResponse)
-> Generic GetMapGlyphsResponse
forall x. Rep GetMapGlyphsResponse x -> GetMapGlyphsResponse
forall x. GetMapGlyphsResponse -> Rep GetMapGlyphsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetMapGlyphsResponse x -> GetMapGlyphsResponse
$cfrom :: forall x. GetMapGlyphsResponse -> Rep GetMapGlyphsResponse x
Prelude.Generic)
newGetMapGlyphsResponse ::
Prelude.Int ->
GetMapGlyphsResponse
newGetMapGlyphsResponse :: Int -> GetMapGlyphsResponse
newGetMapGlyphsResponse Int
pHttpStatus_ =
GetMapGlyphsResponse' :: Maybe ByteString -> Maybe Text -> Int -> GetMapGlyphsResponse
GetMapGlyphsResponse'
{ $sel:blob:GetMapGlyphsResponse' :: Maybe ByteString
blob = Maybe ByteString
forall a. Maybe a
Prelude.Nothing,
$sel:contentType:GetMapGlyphsResponse' :: Maybe Text
contentType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetMapGlyphsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getMapGlyphsResponse_blob :: Lens.Lens' GetMapGlyphsResponse (Prelude.Maybe Prelude.ByteString)
getMapGlyphsResponse_blob :: (Maybe ByteString -> f (Maybe ByteString))
-> GetMapGlyphsResponse -> f GetMapGlyphsResponse
getMapGlyphsResponse_blob = (GetMapGlyphsResponse -> Maybe ByteString)
-> (GetMapGlyphsResponse
-> Maybe ByteString -> GetMapGlyphsResponse)
-> Lens
GetMapGlyphsResponse
GetMapGlyphsResponse
(Maybe ByteString)
(Maybe ByteString)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMapGlyphsResponse' {Maybe ByteString
blob :: Maybe ByteString
$sel:blob:GetMapGlyphsResponse' :: GetMapGlyphsResponse -> Maybe ByteString
blob} -> Maybe ByteString
blob) (\s :: GetMapGlyphsResponse
s@GetMapGlyphsResponse' {} Maybe ByteString
a -> GetMapGlyphsResponse
s {$sel:blob:GetMapGlyphsResponse' :: Maybe ByteString
blob = Maybe ByteString
a} :: GetMapGlyphsResponse)
getMapGlyphsResponse_contentType :: Lens.Lens' GetMapGlyphsResponse (Prelude.Maybe Prelude.Text)
getMapGlyphsResponse_contentType :: (Maybe Text -> f (Maybe Text))
-> GetMapGlyphsResponse -> f GetMapGlyphsResponse
getMapGlyphsResponse_contentType = (GetMapGlyphsResponse -> Maybe Text)
-> (GetMapGlyphsResponse -> Maybe Text -> GetMapGlyphsResponse)
-> Lens
GetMapGlyphsResponse GetMapGlyphsResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMapGlyphsResponse' {Maybe Text
contentType :: Maybe Text
$sel:contentType:GetMapGlyphsResponse' :: GetMapGlyphsResponse -> Maybe Text
contentType} -> Maybe Text
contentType) (\s :: GetMapGlyphsResponse
s@GetMapGlyphsResponse' {} Maybe Text
a -> GetMapGlyphsResponse
s {$sel:contentType:GetMapGlyphsResponse' :: Maybe Text
contentType = Maybe Text
a} :: GetMapGlyphsResponse)
getMapGlyphsResponse_httpStatus :: Lens.Lens' GetMapGlyphsResponse Prelude.Int
getMapGlyphsResponse_httpStatus :: (Int -> f Int) -> GetMapGlyphsResponse -> f GetMapGlyphsResponse
getMapGlyphsResponse_httpStatus = (GetMapGlyphsResponse -> Int)
-> (GetMapGlyphsResponse -> Int -> GetMapGlyphsResponse)
-> Lens GetMapGlyphsResponse GetMapGlyphsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMapGlyphsResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetMapGlyphsResponse' :: GetMapGlyphsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetMapGlyphsResponse
s@GetMapGlyphsResponse' {} Int
a -> GetMapGlyphsResponse
s {$sel:httpStatus:GetMapGlyphsResponse' :: Int
httpStatus = Int
a} :: GetMapGlyphsResponse)
instance Prelude.NFData GetMapGlyphsResponse