{-# 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.GetDocumentationPart
(
GetDocumentationPart (..),
newGetDocumentationPart,
getDocumentationPart_restApiId,
getDocumentationPart_documentationPartId,
DocumentationPart (..),
newDocumentationPart,
documentationPart_id,
documentationPart_location,
documentationPart_properties,
)
where
import Amazonka.APIGateway.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data GetDocumentationPart = GetDocumentationPart'
{
GetDocumentationPart -> Text
restApiId :: Prelude.Text,
GetDocumentationPart -> Text
documentationPartId :: Prelude.Text
}
deriving (GetDocumentationPart -> GetDocumentationPart -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetDocumentationPart -> GetDocumentationPart -> Bool
$c/= :: GetDocumentationPart -> GetDocumentationPart -> Bool
== :: GetDocumentationPart -> GetDocumentationPart -> Bool
$c== :: GetDocumentationPart -> GetDocumentationPart -> Bool
Prelude.Eq, ReadPrec [GetDocumentationPart]
ReadPrec GetDocumentationPart
Int -> ReadS GetDocumentationPart
ReadS [GetDocumentationPart]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetDocumentationPart]
$creadListPrec :: ReadPrec [GetDocumentationPart]
readPrec :: ReadPrec GetDocumentationPart
$creadPrec :: ReadPrec GetDocumentationPart
readList :: ReadS [GetDocumentationPart]
$creadList :: ReadS [GetDocumentationPart]
readsPrec :: Int -> ReadS GetDocumentationPart
$creadsPrec :: Int -> ReadS GetDocumentationPart
Prelude.Read, Int -> GetDocumentationPart -> ShowS
[GetDocumentationPart] -> ShowS
GetDocumentationPart -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetDocumentationPart] -> ShowS
$cshowList :: [GetDocumentationPart] -> ShowS
show :: GetDocumentationPart -> String
$cshow :: GetDocumentationPart -> String
showsPrec :: Int -> GetDocumentationPart -> ShowS
$cshowsPrec :: Int -> GetDocumentationPart -> ShowS
Prelude.Show, forall x. Rep GetDocumentationPart x -> GetDocumentationPart
forall x. GetDocumentationPart -> Rep GetDocumentationPart x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetDocumentationPart x -> GetDocumentationPart
$cfrom :: forall x. GetDocumentationPart -> Rep GetDocumentationPart x
Prelude.Generic)
newGetDocumentationPart ::
Prelude.Text ->
Prelude.Text ->
GetDocumentationPart
newGetDocumentationPart :: Text -> Text -> GetDocumentationPart
newGetDocumentationPart
Text
pRestApiId_
Text
pDocumentationPartId_ =
GetDocumentationPart'
{ $sel:restApiId:GetDocumentationPart' :: Text
restApiId = Text
pRestApiId_,
$sel:documentationPartId:GetDocumentationPart' :: Text
documentationPartId = Text
pDocumentationPartId_
}
getDocumentationPart_restApiId :: Lens.Lens' GetDocumentationPart Prelude.Text
getDocumentationPart_restApiId :: Lens' GetDocumentationPart Text
getDocumentationPart_restApiId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDocumentationPart' {Text
restApiId :: Text
$sel:restApiId:GetDocumentationPart' :: GetDocumentationPart -> Text
restApiId} -> Text
restApiId) (\s :: GetDocumentationPart
s@GetDocumentationPart' {} Text
a -> GetDocumentationPart
s {$sel:restApiId:GetDocumentationPart' :: Text
restApiId = Text
a} :: GetDocumentationPart)
getDocumentationPart_documentationPartId :: Lens.Lens' GetDocumentationPart Prelude.Text
getDocumentationPart_documentationPartId :: Lens' GetDocumentationPart Text
getDocumentationPart_documentationPartId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDocumentationPart' {Text
documentationPartId :: Text
$sel:documentationPartId:GetDocumentationPart' :: GetDocumentationPart -> Text
documentationPartId} -> Text
documentationPartId) (\s :: GetDocumentationPart
s@GetDocumentationPart' {} Text
a -> GetDocumentationPart
s {$sel:documentationPartId:GetDocumentationPart' :: Text
documentationPartId = Text
a} :: GetDocumentationPart)
instance Core.AWSRequest GetDocumentationPart where
type
AWSResponse GetDocumentationPart =
DocumentationPart
request :: (Service -> Service)
-> GetDocumentationPart -> Request GetDocumentationPart
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy GetDocumentationPart
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetDocumentationPart)))
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 -> forall a. FromJSON a => Object -> Either String a
Data.eitherParseJSON Object
x)
instance Prelude.Hashable GetDocumentationPart where
hashWithSalt :: Int -> GetDocumentationPart -> Int
hashWithSalt Int
_salt GetDocumentationPart' {Text
documentationPartId :: Text
restApiId :: Text
$sel:documentationPartId:GetDocumentationPart' :: GetDocumentationPart -> Text
$sel:restApiId:GetDocumentationPart' :: GetDocumentationPart -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
restApiId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
documentationPartId
instance Prelude.NFData GetDocumentationPart where
rnf :: GetDocumentationPart -> ()
rnf GetDocumentationPart' {Text
documentationPartId :: Text
restApiId :: Text
$sel:documentationPartId:GetDocumentationPart' :: GetDocumentationPart -> Text
$sel:restApiId:GetDocumentationPart' :: GetDocumentationPart -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
restApiId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
documentationPartId
instance Data.ToHeaders GetDocumentationPart where
toHeaders :: GetDocumentationPart -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Accept"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# (ByteString
"application/json" :: Prelude.ByteString)
]
)
instance Data.ToPath GetDocumentationPart where
toPath :: GetDocumentationPart -> ByteString
toPath GetDocumentationPart' {Text
documentationPartId :: Text
restApiId :: Text
$sel:documentationPartId:GetDocumentationPart' :: GetDocumentationPart -> Text
$sel:restApiId:GetDocumentationPart' :: GetDocumentationPart -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/restapis/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
restApiId,
ByteString
"/documentation/parts/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
documentationPartId
]
instance Data.ToQuery GetDocumentationPart where
toQuery :: GetDocumentationPart -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty