module Network.AWS.APIGateway.PutIntegrationResponse
(
putIntegrationResponse
, PutIntegrationResponse
, piResponseTemplates
, piSelectionPattern
, piResponseParameters
, piRestAPIId
, piResourceId
, piHttpMethod
, piStatusCode
, integrationResponse
, IntegrationResponse
, iResponseTemplates
, iSelectionPattern
, iStatusCode
, iResponseParameters
) where
import Network.AWS.APIGateway.Types
import Network.AWS.APIGateway.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data PutIntegrationResponse = PutIntegrationResponse'
{ _piResponseTemplates :: !(Maybe (Map Text Text))
, _piSelectionPattern :: !(Maybe Text)
, _piResponseParameters :: !(Maybe (Map Text Text))
, _piRestAPIId :: !Text
, _piResourceId :: !Text
, _piHttpMethod :: !Text
, _piStatusCode :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
putIntegrationResponse
:: Text
-> Text
-> Text
-> Text
-> PutIntegrationResponse
putIntegrationResponse pRestAPIId_ pResourceId_ pHttpMethod_ pStatusCode_ =
PutIntegrationResponse'
{ _piResponseTemplates = Nothing
, _piSelectionPattern = Nothing
, _piResponseParameters = Nothing
, _piRestAPIId = pRestAPIId_
, _piResourceId = pResourceId_
, _piHttpMethod = pHttpMethod_
, _piStatusCode = pStatusCode_
}
piResponseTemplates :: Lens' PutIntegrationResponse (HashMap Text Text)
piResponseTemplates = lens _piResponseTemplates (\ s a -> s{_piResponseTemplates = a}) . _Default . _Map;
piSelectionPattern :: Lens' PutIntegrationResponse (Maybe Text)
piSelectionPattern = lens _piSelectionPattern (\ s a -> s{_piSelectionPattern = a});
piResponseParameters :: Lens' PutIntegrationResponse (HashMap Text Text)
piResponseParameters = lens _piResponseParameters (\ s a -> s{_piResponseParameters = a}) . _Default . _Map;
piRestAPIId :: Lens' PutIntegrationResponse Text
piRestAPIId = lens _piRestAPIId (\ s a -> s{_piRestAPIId = a});
piResourceId :: Lens' PutIntegrationResponse Text
piResourceId = lens _piResourceId (\ s a -> s{_piResourceId = a});
piHttpMethod :: Lens' PutIntegrationResponse Text
piHttpMethod = lens _piHttpMethod (\ s a -> s{_piHttpMethod = a});
piStatusCode :: Lens' PutIntegrationResponse Text
piStatusCode = lens _piStatusCode (\ s a -> s{_piStatusCode = a});
instance AWSRequest PutIntegrationResponse where
type Rs PutIntegrationResponse = IntegrationResponse
request = putJSON apiGateway
response = receiveJSON (\ s h x -> eitherParseJSON x)
instance Hashable PutIntegrationResponse
instance ToHeaders PutIntegrationResponse where
toHeaders
= const
(mconcat
["Accept" =# ("application/json" :: ByteString)])
instance ToJSON PutIntegrationResponse where
toJSON PutIntegrationResponse'{..}
= object
(catMaybes
[("responseTemplates" .=) <$> _piResponseTemplates,
("selectionPattern" .=) <$> _piSelectionPattern,
("responseParameters" .=) <$> _piResponseParameters])
instance ToPath PutIntegrationResponse where
toPath PutIntegrationResponse'{..}
= mconcat
["/restapis/", toBS _piRestAPIId, "/resources/",
toBS _piResourceId, "/methods/", toBS _piHttpMethod,
"/integration/responses/", toBS _piStatusCode]
instance ToQuery PutIntegrationResponse where
toQuery = const mempty