module Network.AWS.OpsWorks.DescribeRaidArrays
(
DescribeRaidArrays
, describeRaidArrays
, draInstanceId
, draRaidArrayIds
, draStackId
, DescribeRaidArraysResponse
, describeRaidArraysResponse
, drarRaidArrays
) where
import Network.AWS.Prelude
import Network.AWS.Request.JSON
import Network.AWS.OpsWorks.Types
import qualified GHC.Exts
data DescribeRaidArrays = DescribeRaidArrays
{ _draInstanceId :: Maybe Text
, _draRaidArrayIds :: List "InstanceIds" Text
, _draStackId :: Maybe Text
} deriving (Eq, Ord, Show)
describeRaidArrays :: DescribeRaidArrays
describeRaidArrays = DescribeRaidArrays
{ _draInstanceId = Nothing
, _draStackId = Nothing
, _draRaidArrayIds = mempty
}
draInstanceId :: Lens' DescribeRaidArrays (Maybe Text)
draInstanceId = lens _draInstanceId (\s a -> s { _draInstanceId = a })
draRaidArrayIds :: Lens' DescribeRaidArrays [Text]
draRaidArrayIds = lens _draRaidArrayIds (\s a -> s { _draRaidArrayIds = a }) . _List
draStackId :: Lens' DescribeRaidArrays (Maybe Text)
draStackId = lens _draStackId (\s a -> s { _draStackId = a })
newtype DescribeRaidArraysResponse = DescribeRaidArraysResponse
{ _drarRaidArrays :: List "RaidArrays" RaidArray
} deriving (Eq, Show, Monoid, Semigroup)
instance GHC.Exts.IsList DescribeRaidArraysResponse where
type Item DescribeRaidArraysResponse = RaidArray
fromList = DescribeRaidArraysResponse . GHC.Exts.fromList
toList = GHC.Exts.toList . _drarRaidArrays
describeRaidArraysResponse :: DescribeRaidArraysResponse
describeRaidArraysResponse = DescribeRaidArraysResponse
{ _drarRaidArrays = mempty
}
drarRaidArrays :: Lens' DescribeRaidArraysResponse [RaidArray]
drarRaidArrays = lens _drarRaidArrays (\s a -> s { _drarRaidArrays = a }) . _List
instance ToPath DescribeRaidArrays where
toPath = const "/"
instance ToQuery DescribeRaidArrays where
toQuery = const mempty
instance ToHeaders DescribeRaidArrays
instance ToJSON DescribeRaidArrays where
toJSON DescribeRaidArrays{..} = object
[ "InstanceId" .= _draInstanceId
, "StackId" .= _draStackId
, "RaidArrayIds" .= _draRaidArrayIds
]
instance AWSRequest DescribeRaidArrays where
type Sv DescribeRaidArrays = OpsWorks
type Rs DescribeRaidArrays = DescribeRaidArraysResponse
request = post "DescribeRaidArrays"
response = jsonResponse
instance FromJSON DescribeRaidArraysResponse where
parseJSON = withObject "DescribeRaidArraysResponse" $ \o -> DescribeRaidArraysResponse
<$> o .:? "RaidArrays" .!= mempty