module Network.AWS.DirectConnect.DeleteConnection
(
DeleteConnection
, deleteConnection
, dcConnectionId
, DeleteConnectionResponse
, deleteConnectionResponse
, dcrBandwidth
, dcrConnectionId
, dcrConnectionName
, dcrConnectionState
, dcrLocation
, dcrOwnerAccount
, dcrPartnerName
, dcrRegion
, dcrVlan
) where
import Network.AWS.Prelude
import Network.AWS.Request.JSON
import Network.AWS.DirectConnect.Types
import qualified GHC.Exts
newtype DeleteConnection = DeleteConnection
{ _dcConnectionId :: Text
} deriving (Eq, Ord, Show, Monoid, IsString)
deleteConnection :: Text
-> DeleteConnection
deleteConnection p1 = DeleteConnection
{ _dcConnectionId = p1
}
dcConnectionId :: Lens' DeleteConnection Text
dcConnectionId = lens _dcConnectionId (\s a -> s { _dcConnectionId = a })
data DeleteConnectionResponse = DeleteConnectionResponse
{ _dcrBandwidth :: Maybe Text
, _dcrConnectionId :: Maybe Text
, _dcrConnectionName :: Maybe Text
, _dcrConnectionState :: Maybe ConnectionState
, _dcrLocation :: Maybe Text
, _dcrOwnerAccount :: Maybe Text
, _dcrPartnerName :: Maybe Text
, _dcrRegion :: Maybe Text
, _dcrVlan :: Maybe Int
} deriving (Eq, Show)
deleteConnectionResponse :: DeleteConnectionResponse
deleteConnectionResponse = DeleteConnectionResponse
{ _dcrOwnerAccount = Nothing
, _dcrConnectionId = Nothing
, _dcrConnectionName = Nothing
, _dcrConnectionState = Nothing
, _dcrRegion = Nothing
, _dcrLocation = Nothing
, _dcrBandwidth = Nothing
, _dcrVlan = Nothing
, _dcrPartnerName = Nothing
}
dcrBandwidth :: Lens' DeleteConnectionResponse (Maybe Text)
dcrBandwidth = lens _dcrBandwidth (\s a -> s { _dcrBandwidth = a })
dcrConnectionId :: Lens' DeleteConnectionResponse (Maybe Text)
dcrConnectionId = lens _dcrConnectionId (\s a -> s { _dcrConnectionId = a })
dcrConnectionName :: Lens' DeleteConnectionResponse (Maybe Text)
dcrConnectionName =
lens _dcrConnectionName (\s a -> s { _dcrConnectionName = a })
dcrConnectionState :: Lens' DeleteConnectionResponse (Maybe ConnectionState)
dcrConnectionState =
lens _dcrConnectionState (\s a -> s { _dcrConnectionState = a })
dcrLocation :: Lens' DeleteConnectionResponse (Maybe Text)
dcrLocation = lens _dcrLocation (\s a -> s { _dcrLocation = a })
dcrOwnerAccount :: Lens' DeleteConnectionResponse (Maybe Text)
dcrOwnerAccount = lens _dcrOwnerAccount (\s a -> s { _dcrOwnerAccount = a })
dcrPartnerName :: Lens' DeleteConnectionResponse (Maybe Text)
dcrPartnerName = lens _dcrPartnerName (\s a -> s { _dcrPartnerName = a })
dcrRegion :: Lens' DeleteConnectionResponse (Maybe Text)
dcrRegion = lens _dcrRegion (\s a -> s { _dcrRegion = a })
dcrVlan :: Lens' DeleteConnectionResponse (Maybe Int)
dcrVlan = lens _dcrVlan (\s a -> s { _dcrVlan = a })
instance ToPath DeleteConnection where
toPath = const "/"
instance ToQuery DeleteConnection where
toQuery = const mempty
instance ToHeaders DeleteConnection
instance ToJSON DeleteConnection where
toJSON DeleteConnection{..} = object
[ "connectionId" .= _dcConnectionId
]
instance AWSRequest DeleteConnection where
type Sv DeleteConnection = DirectConnect
type Rs DeleteConnection = DeleteConnectionResponse
request = post "DeleteConnection"
response = jsonResponse
instance FromJSON DeleteConnectionResponse where
parseJSON = withObject "DeleteConnectionResponse" $ \o -> DeleteConnectionResponse
<$> o .:? "bandwidth"
<*> o .:? "connectionId"
<*> o .:? "connectionName"
<*> o .:? "connectionState"
<*> o .:? "location"
<*> o .:? "ownerAccount"
<*> o .:? "partnerName"
<*> o .:? "region"
<*> o .:? "vlan"