{-# 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.UpdateIntegrationResponse
(
UpdateIntegrationResponse (..),
newUpdateIntegrationResponse,
updateIntegrationResponse_patchOperations,
updateIntegrationResponse_restApiId,
updateIntegrationResponse_resourceId,
updateIntegrationResponse_httpMethod,
updateIntegrationResponse_statusCode,
IntegrationResponse (..),
newIntegrationResponse,
integrationResponse_contentHandling,
integrationResponse_responseTemplates,
integrationResponse_selectionPattern,
integrationResponse_statusCode,
integrationResponse_responseParameters,
)
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 UpdateIntegrationResponse = UpdateIntegrationResponse'
{
UpdateIntegrationResponse -> Maybe [PatchOperation]
patchOperations :: Prelude.Maybe [PatchOperation],
UpdateIntegrationResponse -> Text
restApiId :: Prelude.Text,
UpdateIntegrationResponse -> Text
resourceId :: Prelude.Text,
UpdateIntegrationResponse -> Text
httpMethod :: Prelude.Text,
UpdateIntegrationResponse -> Text
statusCode :: Prelude.Text
}
deriving (UpdateIntegrationResponse -> UpdateIntegrationResponse -> Bool
(UpdateIntegrationResponse -> UpdateIntegrationResponse -> Bool)
-> (UpdateIntegrationResponse -> UpdateIntegrationResponse -> Bool)
-> Eq UpdateIntegrationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateIntegrationResponse -> UpdateIntegrationResponse -> Bool
$c/= :: UpdateIntegrationResponse -> UpdateIntegrationResponse -> Bool
== :: UpdateIntegrationResponse -> UpdateIntegrationResponse -> Bool
$c== :: UpdateIntegrationResponse -> UpdateIntegrationResponse -> Bool
Prelude.Eq, ReadPrec [UpdateIntegrationResponse]
ReadPrec UpdateIntegrationResponse
Int -> ReadS UpdateIntegrationResponse
ReadS [UpdateIntegrationResponse]
(Int -> ReadS UpdateIntegrationResponse)
-> ReadS [UpdateIntegrationResponse]
-> ReadPrec UpdateIntegrationResponse
-> ReadPrec [UpdateIntegrationResponse]
-> Read UpdateIntegrationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateIntegrationResponse]
$creadListPrec :: ReadPrec [UpdateIntegrationResponse]
readPrec :: ReadPrec UpdateIntegrationResponse
$creadPrec :: ReadPrec UpdateIntegrationResponse
readList :: ReadS [UpdateIntegrationResponse]
$creadList :: ReadS [UpdateIntegrationResponse]
readsPrec :: Int -> ReadS UpdateIntegrationResponse
$creadsPrec :: Int -> ReadS UpdateIntegrationResponse
Prelude.Read, Int -> UpdateIntegrationResponse -> ShowS
[UpdateIntegrationResponse] -> ShowS
UpdateIntegrationResponse -> String
(Int -> UpdateIntegrationResponse -> ShowS)
-> (UpdateIntegrationResponse -> String)
-> ([UpdateIntegrationResponse] -> ShowS)
-> Show UpdateIntegrationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateIntegrationResponse] -> ShowS
$cshowList :: [UpdateIntegrationResponse] -> ShowS
show :: UpdateIntegrationResponse -> String
$cshow :: UpdateIntegrationResponse -> String
showsPrec :: Int -> UpdateIntegrationResponse -> ShowS
$cshowsPrec :: Int -> UpdateIntegrationResponse -> ShowS
Prelude.Show, (forall x.
UpdateIntegrationResponse -> Rep UpdateIntegrationResponse x)
-> (forall x.
Rep UpdateIntegrationResponse x -> UpdateIntegrationResponse)
-> Generic UpdateIntegrationResponse
forall x.
Rep UpdateIntegrationResponse x -> UpdateIntegrationResponse
forall x.
UpdateIntegrationResponse -> Rep UpdateIntegrationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateIntegrationResponse x -> UpdateIntegrationResponse
$cfrom :: forall x.
UpdateIntegrationResponse -> Rep UpdateIntegrationResponse x
Prelude.Generic)
newUpdateIntegrationResponse ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
UpdateIntegrationResponse
newUpdateIntegrationResponse :: Text -> Text -> Text -> Text -> UpdateIntegrationResponse
newUpdateIntegrationResponse
Text
pRestApiId_
Text
pResourceId_
Text
pHttpMethod_
Text
pStatusCode_ =
UpdateIntegrationResponse' :: Maybe [PatchOperation]
-> Text -> Text -> Text -> Text -> UpdateIntegrationResponse
UpdateIntegrationResponse'
{ $sel:patchOperations:UpdateIntegrationResponse' :: Maybe [PatchOperation]
patchOperations =
Maybe [PatchOperation]
forall a. Maybe a
Prelude.Nothing,
$sel:restApiId:UpdateIntegrationResponse' :: Text
restApiId = Text
pRestApiId_,
$sel:resourceId:UpdateIntegrationResponse' :: Text
resourceId = Text
pResourceId_,
$sel:httpMethod:UpdateIntegrationResponse' :: Text
httpMethod = Text
pHttpMethod_,
$sel:statusCode:UpdateIntegrationResponse' :: Text
statusCode = Text
pStatusCode_
}
updateIntegrationResponse_patchOperations :: Lens.Lens' UpdateIntegrationResponse (Prelude.Maybe [PatchOperation])
updateIntegrationResponse_patchOperations :: (Maybe [PatchOperation] -> f (Maybe [PatchOperation]))
-> UpdateIntegrationResponse -> f UpdateIntegrationResponse
updateIntegrationResponse_patchOperations = (UpdateIntegrationResponse -> Maybe [PatchOperation])
-> (UpdateIntegrationResponse
-> Maybe [PatchOperation] -> UpdateIntegrationResponse)
-> Lens
UpdateIntegrationResponse
UpdateIntegrationResponse
(Maybe [PatchOperation])
(Maybe [PatchOperation])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateIntegrationResponse' {Maybe [PatchOperation]
patchOperations :: Maybe [PatchOperation]
$sel:patchOperations:UpdateIntegrationResponse' :: UpdateIntegrationResponse -> Maybe [PatchOperation]
patchOperations} -> Maybe [PatchOperation]
patchOperations) (\s :: UpdateIntegrationResponse
s@UpdateIntegrationResponse' {} Maybe [PatchOperation]
a -> UpdateIntegrationResponse
s {$sel:patchOperations:UpdateIntegrationResponse' :: Maybe [PatchOperation]
patchOperations = Maybe [PatchOperation]
a} :: UpdateIntegrationResponse) ((Maybe [PatchOperation] -> f (Maybe [PatchOperation]))
-> UpdateIntegrationResponse -> f UpdateIntegrationResponse)
-> ((Maybe [PatchOperation] -> f (Maybe [PatchOperation]))
-> Maybe [PatchOperation] -> f (Maybe [PatchOperation]))
-> (Maybe [PatchOperation] -> f (Maybe [PatchOperation]))
-> UpdateIntegrationResponse
-> f UpdateIntegrationResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[PatchOperation] [PatchOperation] [PatchOperation] [PatchOperation]
-> Iso
(Maybe [PatchOperation])
(Maybe [PatchOperation])
(Maybe [PatchOperation])
(Maybe [PatchOperation])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
[PatchOperation] [PatchOperation] [PatchOperation] [PatchOperation]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
updateIntegrationResponse_restApiId :: Lens.Lens' UpdateIntegrationResponse Prelude.Text
updateIntegrationResponse_restApiId :: (Text -> f Text)
-> UpdateIntegrationResponse -> f UpdateIntegrationResponse
updateIntegrationResponse_restApiId = (UpdateIntegrationResponse -> Text)
-> (UpdateIntegrationResponse -> Text -> UpdateIntegrationResponse)
-> Lens
UpdateIntegrationResponse UpdateIntegrationResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateIntegrationResponse' {Text
restApiId :: Text
$sel:restApiId:UpdateIntegrationResponse' :: UpdateIntegrationResponse -> Text
restApiId} -> Text
restApiId) (\s :: UpdateIntegrationResponse
s@UpdateIntegrationResponse' {} Text
a -> UpdateIntegrationResponse
s {$sel:restApiId:UpdateIntegrationResponse' :: Text
restApiId = Text
a} :: UpdateIntegrationResponse)
updateIntegrationResponse_resourceId :: Lens.Lens' UpdateIntegrationResponse Prelude.Text
updateIntegrationResponse_resourceId :: (Text -> f Text)
-> UpdateIntegrationResponse -> f UpdateIntegrationResponse
updateIntegrationResponse_resourceId = (UpdateIntegrationResponse -> Text)
-> (UpdateIntegrationResponse -> Text -> UpdateIntegrationResponse)
-> Lens
UpdateIntegrationResponse UpdateIntegrationResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateIntegrationResponse' {Text
resourceId :: Text
$sel:resourceId:UpdateIntegrationResponse' :: UpdateIntegrationResponse -> Text
resourceId} -> Text
resourceId) (\s :: UpdateIntegrationResponse
s@UpdateIntegrationResponse' {} Text
a -> UpdateIntegrationResponse
s {$sel:resourceId:UpdateIntegrationResponse' :: Text
resourceId = Text
a} :: UpdateIntegrationResponse)
updateIntegrationResponse_httpMethod :: Lens.Lens' UpdateIntegrationResponse Prelude.Text
updateIntegrationResponse_httpMethod :: (Text -> f Text)
-> UpdateIntegrationResponse -> f UpdateIntegrationResponse
updateIntegrationResponse_httpMethod = (UpdateIntegrationResponse -> Text)
-> (UpdateIntegrationResponse -> Text -> UpdateIntegrationResponse)
-> Lens
UpdateIntegrationResponse UpdateIntegrationResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateIntegrationResponse' {Text
httpMethod :: Text
$sel:httpMethod:UpdateIntegrationResponse' :: UpdateIntegrationResponse -> Text
httpMethod} -> Text
httpMethod) (\s :: UpdateIntegrationResponse
s@UpdateIntegrationResponse' {} Text
a -> UpdateIntegrationResponse
s {$sel:httpMethod:UpdateIntegrationResponse' :: Text
httpMethod = Text
a} :: UpdateIntegrationResponse)
updateIntegrationResponse_statusCode :: Lens.Lens' UpdateIntegrationResponse Prelude.Text
updateIntegrationResponse_statusCode :: (Text -> f Text)
-> UpdateIntegrationResponse -> f UpdateIntegrationResponse
updateIntegrationResponse_statusCode = (UpdateIntegrationResponse -> Text)
-> (UpdateIntegrationResponse -> Text -> UpdateIntegrationResponse)
-> Lens
UpdateIntegrationResponse UpdateIntegrationResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateIntegrationResponse' {Text
statusCode :: Text
$sel:statusCode:UpdateIntegrationResponse' :: UpdateIntegrationResponse -> Text
statusCode} -> Text
statusCode) (\s :: UpdateIntegrationResponse
s@UpdateIntegrationResponse' {} Text
a -> UpdateIntegrationResponse
s {$sel:statusCode:UpdateIntegrationResponse' :: Text
statusCode = Text
a} :: UpdateIntegrationResponse)
instance Core.AWSRequest UpdateIntegrationResponse where
type
AWSResponse UpdateIntegrationResponse =
IntegrationResponse
request :: UpdateIntegrationResponse -> Request UpdateIntegrationResponse
request = Service
-> UpdateIntegrationResponse -> Request UpdateIntegrationResponse
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.patchJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateIntegrationResponse
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateIntegrationResponse)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse UpdateIntegrationResponse))
-> Logger
-> Service
-> Proxy UpdateIntegrationResponse
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateIntegrationResponse)))
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 IntegrationResponse
forall a. FromJSON a => Object -> Either String a
Core.eitherParseJSON Object
x)
instance Prelude.Hashable UpdateIntegrationResponse
instance Prelude.NFData UpdateIntegrationResponse
instance Core.ToHeaders UpdateIntegrationResponse where
toHeaders :: UpdateIntegrationResponse -> ResponseHeaders
toHeaders =
ResponseHeaders -> UpdateIntegrationResponse -> 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.ToJSON UpdateIntegrationResponse where
toJSON :: UpdateIntegrationResponse -> Value
toJSON UpdateIntegrationResponse' {Maybe [PatchOperation]
Text
statusCode :: Text
httpMethod :: Text
resourceId :: Text
restApiId :: Text
patchOperations :: Maybe [PatchOperation]
$sel:statusCode:UpdateIntegrationResponse' :: UpdateIntegrationResponse -> Text
$sel:httpMethod:UpdateIntegrationResponse' :: UpdateIntegrationResponse -> Text
$sel:resourceId:UpdateIntegrationResponse' :: UpdateIntegrationResponse -> Text
$sel:restApiId:UpdateIntegrationResponse' :: UpdateIntegrationResponse -> Text
$sel:patchOperations:UpdateIntegrationResponse' :: UpdateIntegrationResponse -> Maybe [PatchOperation]
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"patchOperations" Text -> [PatchOperation] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
([PatchOperation] -> Pair) -> Maybe [PatchOperation] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [PatchOperation]
patchOperations
]
)
instance Core.ToPath UpdateIntegrationResponse where
toPath :: UpdateIntegrationResponse -> ByteString
toPath UpdateIntegrationResponse' {Maybe [PatchOperation]
Text
statusCode :: Text
httpMethod :: Text
resourceId :: Text
restApiId :: Text
patchOperations :: Maybe [PatchOperation]
$sel:statusCode:UpdateIntegrationResponse' :: UpdateIntegrationResponse -> Text
$sel:httpMethod:UpdateIntegrationResponse' :: UpdateIntegrationResponse -> Text
$sel:resourceId:UpdateIntegrationResponse' :: UpdateIntegrationResponse -> Text
$sel:restApiId:UpdateIntegrationResponse' :: UpdateIntegrationResponse -> Text
$sel:patchOperations:UpdateIntegrationResponse' :: UpdateIntegrationResponse -> Maybe [PatchOperation]
..} =
[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/responses/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
statusCode
]
instance Core.ToQuery UpdateIntegrationResponse where
toQuery :: UpdateIntegrationResponse -> QueryString
toQuery = QueryString -> UpdateIntegrationResponse -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty