{-# 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.DescribeLocations
(
describeLocations
, DescribeLocations
, describeLocationsResponse
, DescribeLocationsResponse
, dlsrsLocations
, dlsrsResponseStatus
) 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 DescribeLocations =
DescribeLocations'
deriving (Eq, Read, Show, Data, Typeable, Generic)
describeLocations
:: DescribeLocations
describeLocations = DescribeLocations'
instance AWSRequest DescribeLocations where
type Rs DescribeLocations = DescribeLocationsResponse
request = postJSON directConnect
response
= receiveJSON
(\ s h x ->
DescribeLocationsResponse' <$>
(x .?> "locations" .!@ mempty) <*>
(pure (fromEnum s)))
instance Hashable DescribeLocations where
instance NFData DescribeLocations where
instance ToHeaders DescribeLocations where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("OvertureService.DescribeLocations" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DescribeLocations where
toJSON = const (Object mempty)
instance ToPath DescribeLocations where
toPath = const "/"
instance ToQuery DescribeLocations where
toQuery = const mempty
data DescribeLocationsResponse = DescribeLocationsResponse'
{ _dlsrsLocations :: !(Maybe [Location])
, _dlsrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
describeLocationsResponse
:: Int
-> DescribeLocationsResponse
describeLocationsResponse pResponseStatus_ =
DescribeLocationsResponse'
{_dlsrsLocations = Nothing, _dlsrsResponseStatus = pResponseStatus_}
dlsrsLocations :: Lens' DescribeLocationsResponse [Location]
dlsrsLocations = lens _dlsrsLocations (\ s a -> s{_dlsrsLocations = a}) . _Default . _Coerce
dlsrsResponseStatus :: Lens' DescribeLocationsResponse Int
dlsrsResponseStatus = lens _dlsrsResponseStatus (\ s a -> s{_dlsrsResponseStatus = a})
instance NFData DescribeLocationsResponse where