{-# 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_cacheKeyParameters,
integration_cacheNamespace,
integration_connectionId,
integration_connectionType,
integration_contentHandling,
integration_credentials,
integration_httpMethod,
integration_integrationResponses,
integration_passthroughBehavior,
integration_requestParameters,
integration_requestTemplates,
integration_timeoutInMillis,
integration_tlsConfig,
integration_type,
integration_uri,
)
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 GetIntegration = GetIntegration'
{
GetIntegration -> Text
restApiId :: Prelude.Text,
GetIntegration -> Text
resourceId :: Prelude.Text,
GetIntegration -> Text
httpMethod :: Prelude.Text
}
deriving (GetIntegration -> GetIntegration -> Bool
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]
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
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. 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'
{ $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 :: Lens' GetIntegration Text
getIntegration_restApiId = 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 :: Lens' GetIntegration Text
getIntegration_resourceId = 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 :: Lens' GetIntegration Text
getIntegration_httpMethod = 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 :: (Service -> Service) -> GetIntegration -> Request GetIntegration
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 GetIntegration
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetIntegration)))
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 GetIntegration where
hashWithSalt :: Int -> GetIntegration -> Int
hashWithSalt Int
_salt GetIntegration' {Text
httpMethod :: Text
resourceId :: Text
restApiId :: Text
$sel:httpMethod:GetIntegration' :: GetIntegration -> Text
$sel:resourceId:GetIntegration' :: GetIntegration -> Text
$sel:restApiId:GetIntegration' :: GetIntegration -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
restApiId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
resourceId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
httpMethod
instance Prelude.NFData GetIntegration where
rnf :: GetIntegration -> ()
rnf GetIntegration' {Text
httpMethod :: Text
resourceId :: Text
restApiId :: Text
$sel:httpMethod:GetIntegration' :: GetIntegration -> Text
$sel:resourceId:GetIntegration' :: GetIntegration -> Text
$sel:restApiId:GetIntegration' :: GetIntegration -> 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
resourceId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
httpMethod
instance Data.ToHeaders GetIntegration where
toHeaders :: GetIntegration -> 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 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
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/restapis/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
restApiId,
ByteString
"/resources/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
resourceId,
ByteString
"/methods/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
httpMethod,
ByteString
"/integration"
]
instance Data.ToQuery GetIntegration where
toQuery :: GetIntegration -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty