module Network.AWS.CloudSearch.DescribeExpressions
(
DescribeExpressions
, describeExpressions
, deDeployed
, deDomainName
, deExpressionNames
, DescribeExpressionsResponse
, describeExpressionsResponse
, derExpressions
) where
import Network.AWS.Prelude
import Network.AWS.Request.Query
import Network.AWS.CloudSearch.Types
import qualified GHC.Exts
data DescribeExpressions = DescribeExpressions
{ _deDeployed :: Maybe Bool
, _deDomainName :: Text
, _deExpressionNames :: List "member" Text
} deriving (Eq, Ord, Read, Show)
describeExpressions :: Text
-> DescribeExpressions
describeExpressions p1 = DescribeExpressions
{ _deDomainName = p1
, _deExpressionNames = mempty
, _deDeployed = Nothing
}
deDeployed :: Lens' DescribeExpressions (Maybe Bool)
deDeployed = lens _deDeployed (\s a -> s { _deDeployed = a })
deDomainName :: Lens' DescribeExpressions Text
deDomainName = lens _deDomainName (\s a -> s { _deDomainName = a })
deExpressionNames :: Lens' DescribeExpressions [Text]
deExpressionNames =
lens _deExpressionNames (\s a -> s { _deExpressionNames = a })
. _List
newtype DescribeExpressionsResponse = DescribeExpressionsResponse
{ _derExpressions :: List "member" ExpressionStatus
} deriving (Eq, Read, Show, Monoid, Semigroup)
instance GHC.Exts.IsList DescribeExpressionsResponse where
type Item DescribeExpressionsResponse = ExpressionStatus
fromList = DescribeExpressionsResponse . GHC.Exts.fromList
toList = GHC.Exts.toList . _derExpressions
describeExpressionsResponse :: DescribeExpressionsResponse
describeExpressionsResponse = DescribeExpressionsResponse
{ _derExpressions = mempty
}
derExpressions :: Lens' DescribeExpressionsResponse [ExpressionStatus]
derExpressions = lens _derExpressions (\s a -> s { _derExpressions = a }) . _List
instance ToPath DescribeExpressions where
toPath = const "/"
instance ToQuery DescribeExpressions where
toQuery DescribeExpressions{..} = mconcat
[ "Deployed" =? _deDeployed
, "DomainName" =? _deDomainName
, "ExpressionNames" =? _deExpressionNames
]
instance ToHeaders DescribeExpressions
instance AWSRequest DescribeExpressions where
type Sv DescribeExpressions = CloudSearch
type Rs DescribeExpressions = DescribeExpressionsResponse
request = post "DescribeExpressions"
response = xmlResponse
instance FromXML DescribeExpressionsResponse where
parseXML = withElement "DescribeExpressionsResult" $ \x -> DescribeExpressionsResponse
<$> x .@? "Expressions" .!@ mempty