{-# 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.DirectConnect.DeleteConnection
(
deleteConnection
, DeleteConnection
, dcConnectionId
, connection
, Connection
, cLagId
, cVlan
, cLocation
, cAwsDevice
, cConnectionId
, cLoaIssueTime
, cPartnerName
, cConnectionName
, cBandwidth
, cOwnerAccount
, cRegion
, cConnectionState
) where
import Network.AWS.DirectConnect.Types
import Network.AWS.DirectConnect.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype DeleteConnection = DeleteConnection'
{ _dcConnectionId :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteConnection
:: Text
-> DeleteConnection
deleteConnection pConnectionId_ =
DeleteConnection' {_dcConnectionId = pConnectionId_}
dcConnectionId :: Lens' DeleteConnection Text
dcConnectionId = lens _dcConnectionId (\ s a -> s{_dcConnectionId = a})
instance AWSRequest DeleteConnection where
type Rs DeleteConnection = Connection
request = postJSON directConnect
response = receiveJSON (\ s h x -> eitherParseJSON x)
instance Hashable DeleteConnection where
instance NFData DeleteConnection where
instance ToHeaders DeleteConnection where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("OvertureService.DeleteConnection" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DeleteConnection where
toJSON DeleteConnection'{..}
= object
(catMaybes
[Just ("connectionId" .= _dcConnectionId)])
instance ToPath DeleteConnection where
toPath = const "/"
instance ToQuery DeleteConnection where
toQuery = const mempty