{-# 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.AssociateHostedConnection
(
associateHostedConnection
, AssociateHostedConnection
, assConnectionId
, assParentConnectionId
, 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
data AssociateHostedConnection = AssociateHostedConnection'
{ _assConnectionId :: !Text
, _assParentConnectionId :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
associateHostedConnection
:: Text
-> Text
-> AssociateHostedConnection
associateHostedConnection pConnectionId_ pParentConnectionId_ =
AssociateHostedConnection'
{ _assConnectionId = pConnectionId_
, _assParentConnectionId = pParentConnectionId_
}
assConnectionId :: Lens' AssociateHostedConnection Text
assConnectionId = lens _assConnectionId (\ s a -> s{_assConnectionId = a})
assParentConnectionId :: Lens' AssociateHostedConnection Text
assParentConnectionId = lens _assParentConnectionId (\ s a -> s{_assParentConnectionId = a})
instance AWSRequest AssociateHostedConnection where
type Rs AssociateHostedConnection = Connection
request = postJSON directConnect
response = receiveJSON (\ s h x -> eitherParseJSON x)
instance Hashable AssociateHostedConnection where
instance NFData AssociateHostedConnection where
instance ToHeaders AssociateHostedConnection where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("OvertureService.AssociateHostedConnection" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON AssociateHostedConnection where
toJSON AssociateHostedConnection'{..}
= object
(catMaybes
[Just ("connectionId" .= _assConnectionId),
Just
("parentConnectionId" .= _assParentConnectionId)])
instance ToPath AssociateHostedConnection where
toPath = const "/"
instance ToQuery AssociateHostedConnection where
toQuery = const mempty