module Network.AWS.ElasticBeanstalk.RetrieveEnvironmentInfo
(
RetrieveEnvironmentInfo
, retrieveEnvironmentInfo
, rei1EnvironmentId
, rei1EnvironmentName
, rei1InfoType
, RetrieveEnvironmentInfoResponse
, retrieveEnvironmentInfoResponse
, reirEnvironmentInfo
) where
import Network.AWS.Prelude
import Network.AWS.Request.Query
import Network.AWS.ElasticBeanstalk.Types
import qualified GHC.Exts
data RetrieveEnvironmentInfo = RetrieveEnvironmentInfo
{ _rei1EnvironmentId :: Maybe Text
, _rei1EnvironmentName :: Maybe Text
, _rei1InfoType :: EnvironmentInfoType
} deriving (Eq, Show)
retrieveEnvironmentInfo :: EnvironmentInfoType
-> RetrieveEnvironmentInfo
retrieveEnvironmentInfo p1 = RetrieveEnvironmentInfo
{ _rei1InfoType = p1
, _rei1EnvironmentId = Nothing
, _rei1EnvironmentName = Nothing
}
rei1EnvironmentId :: Lens' RetrieveEnvironmentInfo (Maybe Text)
rei1EnvironmentId =
lens _rei1EnvironmentId (\s a -> s { _rei1EnvironmentId = a })
rei1EnvironmentName :: Lens' RetrieveEnvironmentInfo (Maybe Text)
rei1EnvironmentName =
lens _rei1EnvironmentName (\s a -> s { _rei1EnvironmentName = a })
rei1InfoType :: Lens' RetrieveEnvironmentInfo EnvironmentInfoType
rei1InfoType = lens _rei1InfoType (\s a -> s { _rei1InfoType = a })
newtype RetrieveEnvironmentInfoResponse = RetrieveEnvironmentInfoResponse
{ _reirEnvironmentInfo :: List "member" EnvironmentInfoDescription
} deriving (Eq, Show, Monoid, Semigroup)
instance GHC.Exts.IsList RetrieveEnvironmentInfoResponse where
type Item RetrieveEnvironmentInfoResponse = EnvironmentInfoDescription
fromList = RetrieveEnvironmentInfoResponse . GHC.Exts.fromList
toList = GHC.Exts.toList . _reirEnvironmentInfo
retrieveEnvironmentInfoResponse :: RetrieveEnvironmentInfoResponse
retrieveEnvironmentInfoResponse = RetrieveEnvironmentInfoResponse
{ _reirEnvironmentInfo = mempty
}
reirEnvironmentInfo :: Lens' RetrieveEnvironmentInfoResponse [EnvironmentInfoDescription]
reirEnvironmentInfo =
lens _reirEnvironmentInfo (\s a -> s { _reirEnvironmentInfo = a })
. _List
instance ToPath RetrieveEnvironmentInfo where
toPath = const "/"
instance ToQuery RetrieveEnvironmentInfo where
toQuery RetrieveEnvironmentInfo{..} = mconcat
[ "EnvironmentId" =? _rei1EnvironmentId
, "EnvironmentName" =? _rei1EnvironmentName
, "InfoType" =? _rei1InfoType
]
instance ToHeaders RetrieveEnvironmentInfo
instance AWSRequest RetrieveEnvironmentInfo where
type Sv RetrieveEnvironmentInfo = ElasticBeanstalk
type Rs RetrieveEnvironmentInfo = RetrieveEnvironmentInfoResponse
request = post "RetrieveEnvironmentInfo"
response = xmlResponse
instance FromXML RetrieveEnvironmentInfoResponse where
parseXML = withElement "RetrieveEnvironmentInfoResult" $ \x -> RetrieveEnvironmentInfoResponse
<$> x .@? "EnvironmentInfo" .!@ mempty