{-# 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.DescribeConnections
(
describeConnections
, DescribeConnections
, dConnectionId
, connections
, Connections
, cConnections
) 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 DescribeConnections = DescribeConnections'
{ _dConnectionId :: Maybe Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
describeConnections
:: DescribeConnections
describeConnections = DescribeConnections' {_dConnectionId = Nothing}
dConnectionId :: Lens' DescribeConnections (Maybe Text)
dConnectionId = lens _dConnectionId (\ s a -> s{_dConnectionId = a})
instance AWSRequest DescribeConnections where
type Rs DescribeConnections = Connections
request = postJSON directConnect
response = receiveJSON (\ s h x -> eitherParseJSON x)
instance Hashable DescribeConnections where
instance NFData DescribeConnections where
instance ToHeaders DescribeConnections where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("OvertureService.DescribeConnections" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DescribeConnections where
toJSON DescribeConnections'{..}
= object
(catMaybes [("connectionId" .=) <$> _dConnectionId])
instance ToPath DescribeConnections where
toPath = const "/"
instance ToQuery DescribeConnections where
toQuery = const mempty