{-# 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.GetIntegration
(
GetIntegration (..),
newGetIntegration,
getIntegration_restApiId,
getIntegration_resourceId,
getIntegration_httpMethod,
Integration (..),
newIntegration,
integration_httpMethod,
integration_requestTemplates,
integration_credentials,
integration_connectionId,
integration_requestParameters,
integration_contentHandling,
integration_passthroughBehavior,
integration_uri,
integration_integrationResponses,
integration_tlsConfig,
integration_cacheNamespace,
integration_timeoutInMillis,
integration_type,
integration_connectionType,
integration_cacheKeyParameters,
)
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 GetIntegration = GetIntegration'
{
GetIntegration -> Text
restApiId :: Prelude.Text,
GetIntegration -> Text
resourceId :: Prelude.Text,
GetIntegration -> Text
httpMethod :: Prelude.Text
}
deriving (GetIntegration -> GetIntegration -> Bool
(GetIntegration -> GetIntegration -> Bool)
-> (GetIntegration -> GetIntegration -> Bool) -> Eq GetIntegration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetIntegration -> GetIntegration -> Bool
$c/= :: GetIntegration -> GetIntegration -> Bool
== :: GetIntegration -> GetIntegration -> Bool
$c== :: GetIntegration -> GetIntegration -> Bool
Prelude.Eq, ReadPrec [GetIntegration]
ReadPrec GetIntegration
Int -> ReadS GetIntegration
ReadS [GetIntegration]
(Int -> ReadS GetIntegration)
-> ReadS [GetIntegration]
-> ReadPrec GetIntegration
-> ReadPrec [GetIntegration]
-> Read GetIntegration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetIntegration]
$creadListPrec :: ReadPrec [GetIntegration]
readPrec :: ReadPrec GetIntegration
$creadPrec :: ReadPrec GetIntegration
readList :: ReadS [GetIntegration]
$creadList :: ReadS [GetIntegration]
readsPrec :: Int -> ReadS GetIntegration
$creadsPrec :: Int -> ReadS GetIntegration
Prelude.Read, Int -> GetIntegration -> ShowS
[GetIntegration] -> ShowS
GetIntegration -> String
(Int -> GetIntegration -> ShowS)
-> (GetIntegration -> String)
-> ([GetIntegration] -> ShowS)
-> Show GetIntegration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetIntegration] -> ShowS
$cshowList :: [GetIntegration] -> ShowS
show :: GetIntegration -> String
$cshow :: GetIntegration -> String
showsPrec :: Int -> GetIntegration -> ShowS
$cshowsPrec :: Int -> GetIntegration -> ShowS
Prelude.Show, (forall x. GetIntegration -> Rep GetIntegration x)
-> (forall x. Rep GetIntegration x -> GetIntegration)
-> Generic GetIntegration
forall x. Rep GetIntegration x -> GetIntegration
forall x. GetIntegration -> Rep GetIntegration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetIntegration x -> GetIntegration
$cfrom :: forall x. GetIntegration -> Rep GetIntegration x
Prelude.Generic)
newGetIntegration ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
GetIntegration
newGetIntegration :: Text -> Text -> Text -> GetIntegration
newGetIntegration
Text
pRestApiId_
Text
pResourceId_
Text
pHttpMethod_ =
GetIntegration' :: Text -> Text -> Text -> GetIntegration
GetIntegration'
{ $sel:restApiId:GetIntegration' :: Text
restApiId = Text
pRestApiId_,
$sel:resourceId:GetIntegration' :: Text
resourceId = Text
pResourceId_,
$sel:httpMethod:GetIntegration' :: Text
httpMethod = Text
pHttpMethod_
}
getIntegration_restApiId :: Lens.Lens' GetIntegration Prelude.Text
getIntegration_restApiId :: (Text -> f Text) -> GetIntegration -> f GetIntegration
getIntegration_restApiId = (GetIntegration -> Text)
-> (GetIntegration -> Text -> GetIntegration)
-> Lens GetIntegration GetIntegration Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetIntegration' {Text
restApiId :: Text
$sel:restApiId:GetIntegration' :: GetIntegration -> Text
restApiId} -> Text
restApiId) (\s :: GetIntegration
s@GetIntegration' {} Text
a -> GetIntegration
s {$sel:restApiId:GetIntegration' :: Text
restApiId = Text
a} :: GetIntegration)
getIntegration_resourceId :: Lens.Lens' GetIntegration Prelude.Text
getIntegration_resourceId :: (Text -> f Text) -> GetIntegration -> f GetIntegration
getIntegration_resourceId = (GetIntegration -> Text)
-> (GetIntegration -> Text -> GetIntegration)
-> Lens GetIntegration GetIntegration Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetIntegration' {Text
resourceId :: Text
$sel:resourceId:GetIntegration' :: GetIntegration -> Text
resourceId} -> Text
resourceId) (\s :: GetIntegration
s@GetIntegration' {} Text
a -> GetIntegration
s {$sel:resourceId:GetIntegration' :: Text
resourceId = Text
a} :: GetIntegration)
getIntegration_httpMethod :: Lens.Lens' GetIntegration Prelude.Text
getIntegration_httpMethod :: (Text -> f Text) -> GetIntegration -> f GetIntegration
getIntegration_httpMethod = (GetIntegration -> Text)
-> (GetIntegration -> Text -> GetIntegration)
-> Lens GetIntegration GetIntegration Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetIntegration' {Text
httpMethod :: Text
$sel:httpMethod:GetIntegration' :: GetIntegration -> Text
httpMethod} -> Text
httpMethod) (\s :: GetIntegration
s@GetIntegration' {} Text
a -> GetIntegration
s {$sel:httpMethod:GetIntegration' :: Text
httpMethod = Text
a} :: GetIntegration)
instance Core.AWSRequest GetIntegration where
type AWSResponse GetIntegration = Integration
request :: GetIntegration -> Request GetIntegration
request = Service -> GetIntegration -> Request GetIntegration
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy GetIntegration
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetIntegration)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetIntegration))
-> Logger
-> Service
-> Proxy GetIntegration
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetIntegration)))
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 Integration
forall a. FromJSON a => Object -> Either String a
Core.eitherParseJSON Object
x)
instance Prelude.Hashable GetIntegration
instance Prelude.NFData GetIntegration
instance Core.ToHeaders GetIntegration where
toHeaders :: GetIntegration -> ResponseHeaders
toHeaders =
ResponseHeaders -> GetIntegration -> 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 GetIntegration where
toPath :: GetIntegration -> ByteString
toPath GetIntegration' {Text
httpMethod :: Text
resourceId :: Text
restApiId :: Text
$sel:httpMethod:GetIntegration' :: GetIntegration -> Text
$sel:resourceId:GetIntegration' :: GetIntegration -> Text
$sel:restApiId:GetIntegration' :: GetIntegration -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/restapis/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
restApiId,
ByteString
"/resources/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
resourceId,
ByteString
"/methods/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
httpMethod,
ByteString
"/integration"
]
instance Core.ToQuery GetIntegration where
toQuery :: GetIntegration -> QueryString
toQuery = QueryString -> GetIntegration -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty