{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Network.AWS.APIGateway.CreateVPCLink
(
createVPCLink
, CreateVPCLink
, cvlDescription
, cvlName
, cvlTargetARNs
, vpcLink
, VPCLink
, vlStatus
, vlTargetARNs
, vlName
, vlStatusMessage
, vlId
, vlDescription
) 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 CreateVPCLink = CreateVPCLink'
{ _cvlDescription :: !(Maybe Text)
, _cvlName :: !Text
, _cvlTargetARNs :: ![Text]
} deriving (Eq, Read, Show, Data, Typeable, Generic)
createVPCLink
:: Text
-> CreateVPCLink
createVPCLink pName_ =
CreateVPCLink'
{_cvlDescription = Nothing, _cvlName = pName_, _cvlTargetARNs = mempty}
cvlDescription :: Lens' CreateVPCLink (Maybe Text)
cvlDescription = lens _cvlDescription (\ s a -> s{_cvlDescription = a})
cvlName :: Lens' CreateVPCLink Text
cvlName = lens _cvlName (\ s a -> s{_cvlName = a})
cvlTargetARNs :: Lens' CreateVPCLink [Text]
cvlTargetARNs = lens _cvlTargetARNs (\ s a -> s{_cvlTargetARNs = a}) . _Coerce
instance AWSRequest CreateVPCLink where
type Rs CreateVPCLink = VPCLink
request = postJSON apiGateway
response = receiveJSON (\ s h x -> eitherParseJSON x)
instance Hashable CreateVPCLink where
instance NFData CreateVPCLink where
instance ToHeaders CreateVPCLink where
toHeaders
= const
(mconcat
["Accept" =# ("application/json" :: ByteString)])
instance ToJSON CreateVPCLink where
toJSON CreateVPCLink'{..}
= object
(catMaybes
[("description" .=) <$> _cvlDescription,
Just ("name" .= _cvlName),
Just ("targetArns" .= _cvlTargetARNs)])
instance ToPath CreateVPCLink where
toPath = const "/vpclinks"
instance ToQuery CreateVPCLink where
toQuery = const mempty