{-# 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.APIGateway.GetBasePathMapping
(
GetBasePathMapping (..),
newGetBasePathMapping,
getBasePathMapping_domainName,
getBasePathMapping_basePath,
BasePathMapping (..),
newBasePathMapping,
basePathMapping_stage,
basePathMapping_basePath,
basePathMapping_restApiId,
)
where
import Amazonka.APIGateway.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data GetBasePathMapping = GetBasePathMapping'
{
GetBasePathMapping -> Text
domainName :: Prelude.Text,
GetBasePathMapping -> Text
basePath :: Prelude.Text
}
deriving (GetBasePathMapping -> GetBasePathMapping -> Bool
(GetBasePathMapping -> GetBasePathMapping -> Bool)
-> (GetBasePathMapping -> GetBasePathMapping -> Bool)
-> Eq GetBasePathMapping
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetBasePathMapping -> GetBasePathMapping -> Bool
$c/= :: GetBasePathMapping -> GetBasePathMapping -> Bool
== :: GetBasePathMapping -> GetBasePathMapping -> Bool
$c== :: GetBasePathMapping -> GetBasePathMapping -> Bool
Prelude.Eq, ReadPrec [GetBasePathMapping]
ReadPrec GetBasePathMapping
Int -> ReadS GetBasePathMapping
ReadS [GetBasePathMapping]
(Int -> ReadS GetBasePathMapping)
-> ReadS [GetBasePathMapping]
-> ReadPrec GetBasePathMapping
-> ReadPrec [GetBasePathMapping]
-> Read GetBasePathMapping
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetBasePathMapping]
$creadListPrec :: ReadPrec [GetBasePathMapping]
readPrec :: ReadPrec GetBasePathMapping
$creadPrec :: ReadPrec GetBasePathMapping
readList :: ReadS [GetBasePathMapping]
$creadList :: ReadS [GetBasePathMapping]
readsPrec :: Int -> ReadS GetBasePathMapping
$creadsPrec :: Int -> ReadS GetBasePathMapping
Prelude.Read, Int -> GetBasePathMapping -> ShowS
[GetBasePathMapping] -> ShowS
GetBasePathMapping -> String
(Int -> GetBasePathMapping -> ShowS)
-> (GetBasePathMapping -> String)
-> ([GetBasePathMapping] -> ShowS)
-> Show GetBasePathMapping
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetBasePathMapping] -> ShowS
$cshowList :: [GetBasePathMapping] -> ShowS
show :: GetBasePathMapping -> String
$cshow :: GetBasePathMapping -> String
showsPrec :: Int -> GetBasePathMapping -> ShowS
$cshowsPrec :: Int -> GetBasePathMapping -> ShowS
Prelude.Show, (forall x. GetBasePathMapping -> Rep GetBasePathMapping x)
-> (forall x. Rep GetBasePathMapping x -> GetBasePathMapping)
-> Generic GetBasePathMapping
forall x. Rep GetBasePathMapping x -> GetBasePathMapping
forall x. GetBasePathMapping -> Rep GetBasePathMapping x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetBasePathMapping x -> GetBasePathMapping
$cfrom :: forall x. GetBasePathMapping -> Rep GetBasePathMapping x
Prelude.Generic)
newGetBasePathMapping ::
Prelude.Text ->
Prelude.Text ->
GetBasePathMapping
newGetBasePathMapping :: Text -> Text -> GetBasePathMapping
newGetBasePathMapping Text
pDomainName_ Text
pBasePath_ =
GetBasePathMapping' :: Text -> Text -> GetBasePathMapping
GetBasePathMapping'
{ $sel:domainName:GetBasePathMapping' :: Text
domainName = Text
pDomainName_,
$sel:basePath:GetBasePathMapping' :: Text
basePath = Text
pBasePath_
}
getBasePathMapping_domainName :: Lens.Lens' GetBasePathMapping Prelude.Text
getBasePathMapping_domainName :: (Text -> f Text) -> GetBasePathMapping -> f GetBasePathMapping
getBasePathMapping_domainName = (GetBasePathMapping -> Text)
-> (GetBasePathMapping -> Text -> GetBasePathMapping)
-> Lens GetBasePathMapping GetBasePathMapping Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBasePathMapping' {Text
domainName :: Text
$sel:domainName:GetBasePathMapping' :: GetBasePathMapping -> Text
domainName} -> Text
domainName) (\s :: GetBasePathMapping
s@GetBasePathMapping' {} Text
a -> GetBasePathMapping
s {$sel:domainName:GetBasePathMapping' :: Text
domainName = Text
a} :: GetBasePathMapping)
getBasePathMapping_basePath :: Lens.Lens' GetBasePathMapping Prelude.Text
getBasePathMapping_basePath :: (Text -> f Text) -> GetBasePathMapping -> f GetBasePathMapping
getBasePathMapping_basePath = (GetBasePathMapping -> Text)
-> (GetBasePathMapping -> Text -> GetBasePathMapping)
-> Lens GetBasePathMapping GetBasePathMapping Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBasePathMapping' {Text
basePath :: Text
$sel:basePath:GetBasePathMapping' :: GetBasePathMapping -> Text
basePath} -> Text
basePath) (\s :: GetBasePathMapping
s@GetBasePathMapping' {} Text
a -> GetBasePathMapping
s {$sel:basePath:GetBasePathMapping' :: Text
basePath = Text
a} :: GetBasePathMapping)
instance Core.AWSRequest GetBasePathMapping where
type AWSResponse GetBasePathMapping = BasePathMapping
request :: GetBasePathMapping -> Request GetBasePathMapping
request = Service -> GetBasePathMapping -> Request GetBasePathMapping
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy GetBasePathMapping
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetBasePathMapping)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetBasePathMapping))
-> Logger
-> Service
-> Proxy GetBasePathMapping
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetBasePathMapping)))
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 -> Object -> Either String BasePathMapping
forall a. FromJSON a => Object -> Either String a
Core.eitherParseJSON Object
x)
instance Prelude.Hashable GetBasePathMapping
instance Prelude.NFData GetBasePathMapping
instance Core.ToHeaders GetBasePathMapping where
toHeaders :: GetBasePathMapping -> ResponseHeaders
toHeaders =
ResponseHeaders -> GetBasePathMapping -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Accept"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# (ByteString
"application/json" :: Prelude.ByteString)
]
)
instance Core.ToPath GetBasePathMapping where
toPath :: GetBasePathMapping -> ByteString
toPath GetBasePathMapping' {Text
basePath :: Text
domainName :: Text
$sel:basePath:GetBasePathMapping' :: GetBasePathMapping -> Text
$sel:domainName:GetBasePathMapping' :: GetBasePathMapping -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/domainnames/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
domainName,
ByteString
"/basepathmappings/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
basePath
]
instance Core.ToQuery GetBasePathMapping where
toQuery :: GetBasePathMapping -> QueryString
toQuery = QueryString -> GetBasePathMapping -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty