module Network.AWS.DirectConnect.AllocateHostedConnection
(
allocateHostedConnection
, AllocateHostedConnection
, ahcConnectionId
, ahcOwnerAccount
, ahcBandwidth
, ahcConnectionName
, ahcVlan
, 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 AllocateHostedConnection = AllocateHostedConnection'
{ _ahcConnectionId :: !Text
, _ahcOwnerAccount :: !Text
, _ahcBandwidth :: !Text
, _ahcConnectionName :: !Text
, _ahcVlan :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
allocateHostedConnection
:: Text
-> Text
-> Text
-> Text
-> Int
-> AllocateHostedConnection
allocateHostedConnection pConnectionId_ pOwnerAccount_ pBandwidth_ pConnectionName_ pVlan_ =
AllocateHostedConnection'
{ _ahcConnectionId = pConnectionId_
, _ahcOwnerAccount = pOwnerAccount_
, _ahcBandwidth = pBandwidth_
, _ahcConnectionName = pConnectionName_
, _ahcVlan = pVlan_
}
ahcConnectionId :: Lens' AllocateHostedConnection Text
ahcConnectionId = lens _ahcConnectionId (\ s a -> s{_ahcConnectionId = a});
ahcOwnerAccount :: Lens' AllocateHostedConnection Text
ahcOwnerAccount = lens _ahcOwnerAccount (\ s a -> s{_ahcOwnerAccount = a});
ahcBandwidth :: Lens' AllocateHostedConnection Text
ahcBandwidth = lens _ahcBandwidth (\ s a -> s{_ahcBandwidth = a});
ahcConnectionName :: Lens' AllocateHostedConnection Text
ahcConnectionName = lens _ahcConnectionName (\ s a -> s{_ahcConnectionName = a});
ahcVlan :: Lens' AllocateHostedConnection Int
ahcVlan = lens _ahcVlan (\ s a -> s{_ahcVlan = a});
instance AWSRequest AllocateHostedConnection where
type Rs AllocateHostedConnection = Connection
request = postJSON directConnect
response = receiveJSON (\ s h x -> eitherParseJSON x)
instance Hashable AllocateHostedConnection where
instance NFData AllocateHostedConnection where
instance ToHeaders AllocateHostedConnection where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("OvertureService.AllocateHostedConnection" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON AllocateHostedConnection where
toJSON AllocateHostedConnection'{..}
= object
(catMaybes
[Just ("connectionId" .= _ahcConnectionId),
Just ("ownerAccount" .= _ahcOwnerAccount),
Just ("bandwidth" .= _ahcBandwidth),
Just ("connectionName" .= _ahcConnectionName),
Just ("vlan" .= _ahcVlan)])
instance ToPath AllocateHostedConnection where
toPath = const "/"
instance ToQuery AllocateHostedConnection where
toQuery = const mempty